From: support
Date: Wed, 26 Oct 2022 12:13:12 +0000 (+0000)
Subject: Built motion from commit 18decb32.|2.6.20
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=107873b43ede48a20383887b02e6edda5a158954;p=motion2.git
Built motion from commit 18decb32.|2.6.20
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9188002..72584d1 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-26T04:35:14.451Z",
+ "time": "2022-10-26T12:04:32.698Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index cacf6e5..b881c6a 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-26T04:35:14.451Z",
+ "time": "2022-10-26T12:04:32.698Z",
"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 f0811cd..d868ee3 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 _0x0e93=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','TEXT','exports','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e93,0x1b6));var _0x30e9=function(_0x5c27f4,_0x502ce2){_0x5c27f4=_0x5c27f4-0x0;var _0x55698c=_0x0e93[_0x5c27f4];return _0x55698c;};'use strict';var Sequelize=require('sequelize');module[_0x30e9('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x501c36){return this[_0x30e9('0x1')](_0x30e9('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x30e9('0x3'),_0x30e9('0x4'),_0x30e9('0x5'),_0x30e9('0x6'),_0x30e9('0x7'),_0x30e9('0x8'),'bot',_0x30e9('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x30e9('0xa')},'data1':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['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[_0x30e9('0xb')](0x1000),'comment':_0x30e9('0xc')},'data4':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comments':_0x30e9('0xd')},'data5':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comments':_0x30e9('0xe')},'data6':{'type':Sequelize[_0x30e9('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x30e9('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x7a95=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x5e84ee,_0x4e49af){var _0x14a436=function(_0x5ba5eb){while(--_0x5ba5eb){_0x5e84ee['push'](_0x5e84ee['shift']());}};_0x14a436(++_0x4e49af);}(_0x7a95,0xa5));var _0x57a9=function(_0x28259f,_0x4f7913){_0x28259f=_0x28259f-0x0;var _0x3d4d2b=_0x7a95[_0x28259f];return _0x3d4d2b;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'get':function(_0x4620d1){return this[_0x57a9('0x2')](_0x57a9('0x3'));}},'action':{'type':Sequelize[_0x57a9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x57a9('0x5'),_0x57a9('0x6'),_0x57a9('0x7'),_0x57a9('0x8'),_0x57a9('0x9'),_0x57a9('0xa'),_0x57a9('0xb'),_0x57a9('0xc')]],'msg':_0x57a9('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x57a9('0xe')},'data2':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0xf')},'data3':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0x10')},'data4':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':_0x57a9('0x11')},'data6':{'type':Sequelize[_0x57a9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x57a9('0x12')],'comments':_0x57a9('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 7a29727..2b3c200 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 _0xf0e9=['catch','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','body','Action','find'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xf0e9,0x197));var _0x9f0e=function(_0x51dbe1,_0x18f331){_0x51dbe1=_0x51dbe1-0x0;var _0x99910e=_0xf0e9[_0x51dbe1];return _0x99910e;};'use strict';var emlformat=require(_0x9f0e('0x0'));var rimraf=require(_0x9f0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f0e('0x2'));var moment=require(_0x9f0e('0x3'));var BPromise=require(_0x9f0e('0x4'));var Mustache=require(_0x9f0e('0x5'));var util=require(_0x9f0e('0x6'));var path=require(_0x9f0e('0x7'));var sox=require(_0x9f0e('0x8'));var csv=require(_0x9f0e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f0e('0xa'));var crypto=require(_0x9f0e('0xb'));var jsforce=require(_0x9f0e('0xc'));var deskjs=require(_0x9f0e('0xd'));var toCsv=require(_0x9f0e('0x9'));var querystring=require('querystring');var Papa=require(_0x9f0e('0xe'));var Redis=require(_0x9f0e('0xf'));var authService=require(_0x9f0e('0x10'));var qs=require(_0x9f0e('0x11'));var as=require(_0x9f0e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f0e('0x13'));var utils=require(_0x9f0e('0x14'));var config=require(_0x9f0e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f0e('0x16'))['db'];function respondWithStatusCode(_0x5e901a,_0x32d9ac){_0x32d9ac=_0x32d9ac||0xcc;return function(_0x48cac0){if(_0x48cac0){return _0x5e901a['sendStatus'](_0x32d9ac);}return _0x5e901a[_0x9f0e('0x17')](_0x32d9ac)['end']();};}function respondWithResult(_0x2c60a5,_0x5d393f){_0x5d393f=_0x5d393f||0xc8;return function(_0x42b47d){if(_0x42b47d){return _0x2c60a5[_0x9f0e('0x17')](_0x5d393f)['json'](_0x42b47d);}};}function respondWithFilteredResult(_0x15d79c,_0x9f5e87){return function(_0x28f464){if(_0x28f464){var _0x4d7520=typeof _0x9f5e87['offset']===_0x9f0e('0x18')&&typeof _0x9f5e87[_0x9f0e('0x19')]===_0x9f0e('0x18');var _0x41952f=_0x28f464['count'];var _0x41ac56=_0x4d7520?0x0:_0x9f5e87['offset'];var _0x178742=_0x4d7520?_0x28f464['count']:_0x9f5e87[_0x9f0e('0x1a')]+_0x9f5e87[_0x9f0e('0x19')];var _0x44edc5;if(_0x178742>=_0x41952f){_0x178742=_0x41952f;_0x44edc5=0xc8;}else{_0x44edc5=0xce;}_0x15d79c[_0x9f0e('0x17')](_0x44edc5);return _0x15d79c[_0x9f0e('0x1b')](_0x9f0e('0x1c'),_0x41ac56+'-'+_0x178742+'/'+_0x41952f)[_0x9f0e('0x1d')](_0x28f464);}return null;};}function patchUpdates(_0x3575b9){return function(_0x19008e){try{jsonpatch[_0x9f0e('0x1e')](_0x19008e,_0x3575b9,!![]);}catch(_0x505659){return BPromise[_0x9f0e('0x1f')](_0x505659);}return _0x19008e[_0x9f0e('0x20')]();};}function saveUpdates(_0x52c048,_0x50a5c7){return function(_0x965772){if(_0x965772){return _0x965772[_0x9f0e('0x21')](_0x52c048)[_0x9f0e('0x22')](function(_0xe78e6d){return _0xe78e6d;});}return null;};}function removeEntity(_0x2c9b51,_0xdf5433){return function(_0x1488b3){if(_0x1488b3){return _0x1488b3[_0x9f0e('0x23')]()[_0x9f0e('0x22')](function(){_0x2c9b51[_0x9f0e('0x17')](0xcc)[_0x9f0e('0x24')]();});}};}function handleEntityNotFound(_0x23ffd2,_0x42413b){return function(_0x318e4e){if(!_0x318e4e){_0x23ffd2['sendStatus'](0x194);}return _0x318e4e;};}function handleError(_0x50a1e5,_0x3cf944){_0x3cf944=_0x3cf944||0x1f4;return function(_0x445164){logger[_0x9f0e('0x25')](_0x445164[_0x9f0e('0x26')]);if(_0x445164[_0x9f0e('0x27')]){delete _0x445164[_0x9f0e('0x27')];}_0x50a1e5[_0x9f0e('0x17')](_0x3cf944)['send'](_0x445164);};}exports[_0x9f0e('0x21')]=function(_0x3db57e,_0x1a25b4){if(_0x3db57e[_0x9f0e('0x28')]['id']){delete _0x3db57e[_0x9f0e('0x28')]['id'];}return db[_0x9f0e('0x29')][_0x9f0e('0x2a')]({'where':{'id':_0x3db57e['params']['id']}})[_0x9f0e('0x22')](handleEntityNotFound(_0x1a25b4,null))[_0x9f0e('0x22')](saveUpdates(_0x3db57e[_0x9f0e('0x28')],null))[_0x9f0e('0x22')](respondWithResult(_0x1a25b4,null))[_0x9f0e('0x2b')](handleError(_0x1a25b4,null));};exports[_0x9f0e('0x23')]=function(_0x579486,_0x5a41cf){return db[_0x9f0e('0x29')][_0x9f0e('0x2a')]({'where':{'id':_0x579486[_0x9f0e('0x2c')]['id']}})[_0x9f0e('0x22')](handleEntityNotFound(_0x5a41cf,null))[_0x9f0e('0x22')](removeEntity(_0x5a41cf,null))[_0x9f0e('0x2b')](handleError(_0x5a41cf,null));};
\ No newline at end of file
+var _0xc5a0=['stack','name','send','update','body','Action','params','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x5adb00,_0x329c2a){var _0xc32601=function(_0x4bdff8){while(--_0x4bdff8){_0x5adb00['push'](_0x5adb00['shift']());}};_0xc32601(++_0x329c2a);}(_0xc5a0,0xbc));var _0x0c5a=function(_0x504f5d,_0xefefa7){_0x504f5d=_0x504f5d-0x0;var _0x3f794d=_0xc5a0[_0x504f5d];return _0x3f794d;};'use strict';var emlformat=require(_0x0c5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c5a('0x1'));var rp=require('request-promise');var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var Mustache=require(_0x0c5a('0x4'));var util=require(_0x0c5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0c5a('0x6'));var ejs=require(_0x0c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x0c5a('0x8'));var _=require(_0x0c5a('0x9'));var squel=require(_0x0c5a('0xa'));var crypto=require(_0x0c5a('0xb'));var jsforce=require(_0x0c5a('0xc'));var deskjs=require(_0x0c5a('0xd'));var toCsv=require(_0x0c5a('0x6'));var querystring=require(_0x0c5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c5a('0xf'));var authService=require(_0x0c5a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c5a('0x11'));var logger=require(_0x0c5a('0x12'))('api');var utils=require(_0x0c5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c5a('0x14'));var db=require(_0x0c5a('0x15'))['db'];function respondWithStatusCode(_0x14cd6b,_0x324ae9){_0x324ae9=_0x324ae9||0xcc;return function(_0x289a0c){if(_0x289a0c){return _0x14cd6b['sendStatus'](_0x324ae9);}return _0x14cd6b['status'](_0x324ae9)[_0x0c5a('0x16')]();};}function respondWithResult(_0x56c3b1,_0x7c71a8){_0x7c71a8=_0x7c71a8||0xc8;return function(_0x138720){if(_0x138720){return _0x56c3b1[_0x0c5a('0x17')](_0x7c71a8)[_0x0c5a('0x18')](_0x138720);}};}function respondWithFilteredResult(_0x396bf2,_0x5e50b9){return function(_0x443258){if(_0x443258){var _0x73520f=typeof _0x5e50b9[_0x0c5a('0x19')]===_0x0c5a('0x1a')&&typeof _0x5e50b9['limit']===_0x0c5a('0x1a');var _0x3bf1db=_0x443258[_0x0c5a('0x1b')];var _0x425ac7=_0x73520f?0x0:_0x5e50b9[_0x0c5a('0x19')];var _0x43cc7b=_0x73520f?_0x443258[_0x0c5a('0x1b')]:_0x5e50b9[_0x0c5a('0x19')]+_0x5e50b9[_0x0c5a('0x1c')];var _0x4475f5;if(_0x43cc7b>=_0x3bf1db){_0x43cc7b=_0x3bf1db;_0x4475f5=0xc8;}else{_0x4475f5=0xce;}_0x396bf2[_0x0c5a('0x17')](_0x4475f5);return _0x396bf2[_0x0c5a('0x1d')](_0x0c5a('0x1e'),_0x425ac7+'-'+_0x43cc7b+'/'+_0x3bf1db)[_0x0c5a('0x18')](_0x443258);}return null;};}function patchUpdates(_0x1a933a){return function(_0x1f05f0){try{jsonpatch[_0x0c5a('0x1f')](_0x1f05f0,_0x1a933a,!![]);}catch(_0x332993){return BPromise[_0x0c5a('0x20')](_0x332993);}return _0x1f05f0[_0x0c5a('0x21')]();};}function saveUpdates(_0x2b9586,_0x2dabcb){return function(_0x3f599c){if(_0x3f599c){return _0x3f599c['update'](_0x2b9586)[_0x0c5a('0x22')](function(_0x4d00d4){return _0x4d00d4;});}return null;};}function removeEntity(_0x575f5e,_0x457d63){return function(_0x26de60){if(_0x26de60){return _0x26de60[_0x0c5a('0x23')]()['then'](function(){_0x575f5e[_0x0c5a('0x17')](0xcc)[_0x0c5a('0x16')]();});}};}function handleEntityNotFound(_0x91c3ed,_0x29a79f){return function(_0x1d5ee9){if(!_0x1d5ee9){_0x91c3ed['sendStatus'](0x194);}return _0x1d5ee9;};}function handleError(_0x44b87c,_0x1ff181){_0x1ff181=_0x1ff181||0x1f4;return function(_0x3ceee3){logger[_0x0c5a('0x24')](_0x3ceee3[_0x0c5a('0x25')]);if(_0x3ceee3[_0x0c5a('0x26')]){delete _0x3ceee3[_0x0c5a('0x26')];}_0x44b87c[_0x0c5a('0x17')](_0x1ff181)[_0x0c5a('0x27')](_0x3ceee3);};}exports[_0x0c5a('0x28')]=function(_0x2949c1,_0x332bcf){if(_0x2949c1['body']['id']){delete _0x2949c1[_0x0c5a('0x29')]['id'];}return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x2949c1[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x332bcf,null))[_0x0c5a('0x22')](saveUpdates(_0x2949c1['body'],null))[_0x0c5a('0x22')](respondWithResult(_0x332bcf,null))['catch'](handleError(_0x332bcf,null));};exports[_0x0c5a('0x23')]=function(_0x5e7bc2,_0x2e60c9){return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x5e7bc2[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x2e60c9,null))[_0x0c5a('0x22')](removeEntity(_0x2e60c9,null))[_0x0c5a('0x2c')](handleError(_0x2e60c9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 1a4b3b7..23dea0d 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 _0x3b91=['path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xa76f70,_0x115a75){var _0x24459b=function(_0x425831){while(--_0x425831){_0xa76f70['push'](_0xa76f70['shift']());}};_0x24459b(++_0x115a75);}(_0x3b91,0x127));var _0x13b9=function(_0x909ba0,_0x48d8be){_0x909ba0=_0x909ba0-0x0;var _0x2673c5=_0x3b91[_0x909ba0];return _0x2673c5;};'use strict';var _=require(_0x13b9('0x0'));var util=require(_0x13b9('0x1'));var logger=require(_0x13b9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x13b9('0x3'));var rp=require(_0x13b9('0x4'));var fs=require('fs');var path=require(_0x13b9('0x5'));var rimraf=require(_0x13b9('0x6'));var config=require(_0x13b9('0x7'));var attributes=require('./action.attributes');module[_0x13b9('0x8')]=function(_0x33bcd2,_0x4fe8dd){return _0x33bcd2[_0x13b9('0x9')](_0x13b9('0xa'),attributes,{'tableName':_0x13b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff3c=['tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x361e2c,_0x5f584f){var _0x859c70=function(_0x1f0ab5){while(--_0x1f0ab5){_0x361e2c['push'](_0x361e2c['shift']());}};_0x859c70(++_0x5f584f);}(_0xff3c,0x1a3));var _0xcff3=function(_0x3c4322,_0x2e87f9){_0x3c4322=_0x3c4322-0x0;var _0x4ea1b5=_0xff3c[_0x3c4322];return _0x4ea1b5;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require(_0xcff3('0x2'))('api');var moment=require(_0xcff3('0x3'));var BPromise=require(_0xcff3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x5'));var rimraf=require(_0xcff3('0x6'));var config=require(_0xcff3('0x7'));var attributes=require(_0xcff3('0x8'));module['exports']=function(_0x205a14,_0x48a6b2){return _0x205a14[_0xcff3('0x9')]('Action',attributes,{'tableName':_0xcff3('0xa'),'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 c120798..bd6da6e 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x4975,0x86));var _0x5497=function(_0x14f63f,_0x24fb36){_0x14f63f=_0x14f63f-0x0;var _0x256758=_0x4975[_0x14f63f];return _0x256758;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0xf96866,_0x547647){var _0x336c0d=function(_0x4d03be){while(--_0x4d03be){_0xf96866['push'](_0xf96866['shift']());}};_0x336c0d(++_0x547647);}(_0xe14b,0x93));var _0xbe14=function(_0x38dd04,_0xabfd0b){_0x38dd04=_0x38dd04-0x0;var _0x429407=_0xe14b[_0x38dd04];return _0x429407;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 65d88f1..cb48595 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 _0x9ea3=['isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./action.controller','put'];(function(_0x28101b,_0x264a9b){var _0x1d562f=function(_0x35f53e){while(--_0x35f53e){_0x28101b['push'](_0x28101b['shift']());}};_0x1d562f(++_0x264a9b);}(_0x9ea3,0x170));var _0x39ea=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x9ea3[_0x3358ba];return _0x296e73;};'use strict';var multer=require(_0x39ea('0x0'));var util=require(_0x39ea('0x1'));var path=require('path');var timeout=require(_0x39ea('0x2'));var express=require(_0x39ea('0x3'));var router=express[_0x39ea('0x4')]();var fs_extra=require(_0x39ea('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x39ea('0x6'));var controller=require(_0x39ea('0x7'));router[_0x39ea('0x8')]('/:id',auth[_0x39ea('0x9')](),controller[_0x39ea('0xa')]);router[_0x39ea('0xb')]('/:id',auth[_0x39ea('0x9')](),controller['destroy']);module[_0x39ea('0xc')]=router;
\ No newline at end of file
+var _0x6859=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x5a66d8,_0x988719){var _0x488c3b=function(_0x53023f){while(--_0x53023f){_0x5a66d8['push'](_0x5a66d8['shift']());}};_0x488c3b(++_0x988719);}(_0x6859,0xc3));var _0x9685=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x6859[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0x9685('0x0'));var util=require('util');var path=require(_0x9685('0x1'));var timeout=require(_0x9685('0x2'));var express=require(_0x9685('0x3'));var router=express[_0x9685('0x4')]();var fs_extra=require(_0x9685('0x5'));var auth=require(_0x9685('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9685('0x7'));var controller=require(_0x9685('0x8'));router['put'](_0x9685('0x9'),auth[_0x9685('0xa')](),controller[_0x9685('0xb')]);router[_0x9685('0xc')](_0x9685('0x9'),auth['isAuthenticated'](),controller[_0x9685('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 9e87710..8cc0b0f 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x5fd1,0x155));var _0x15fd=function(_0x12bd4a,_0x12b7a0){_0x12bd4a=_0x12bd4a-0x0;var _0x298112=_0x5fd1[_0x12bd4a];return _0x298112;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
+var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x3b9e53,_0x2f9366){var _0x51af53=function(_0x56bbe8){while(--_0x56bbe8){_0x3b9e53['push'](_0x3b9e53['shift']());}};_0x51af53(++_0x2f9366);}(_0x687b,0x14a));var _0xb687=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x687b[_0x29b886];return _0x263ef9;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 559ce66..e9aff69 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 _0xdd73=['startDate','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','cross_join','Sequelize','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','preview','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MIN(%s)','ROUND(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','foreignKey','format','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dba26,_0x32927e){var _0x1ad78c=function(_0x1fe9e5){while(--_0x1fe9e5){_0x3dba26['push'](_0x3dba26['shift']());}};_0x1ad78c(++_0x32927e);}(_0xdd73,0x156));var _0x3dd7=function(_0x9571f9,_0x5a7460){_0x9571f9=_0x9571f9-0x0;var _0x5cd19b=_0xdd73[_0x9571f9];return _0x5cd19b;};'use strict';var emlformat=require(_0x3dd7('0x0'));var rimraf=require(_0x3dd7('0x1'));var zipdir=require(_0x3dd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3dd7('0x3'));var BPromise=require(_0x3dd7('0x4'));var Mustache=require(_0x3dd7('0x5'));var util=require(_0x3dd7('0x6'));var path=require(_0x3dd7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3dd7('0x8'));var fs=require('fs');var fs_extra=require(_0x3dd7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dd7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3dd7('0xb'));var querystring=require(_0x3dd7('0xc'));var Papa=require(_0x3dd7('0xd'));var Redis=require('ioredis');var authService=require(_0x3dd7('0xe'));var qs=require(_0x3dd7('0xf'));var as=require(_0x3dd7('0x10'));var hardwareService=require(_0x3dd7('0x11'));var logger=require(_0x3dd7('0x12'))(_0x3dd7('0x13'));var utils=require(_0x3dd7('0x14'));var config=require(_0x3dd7('0x15'));var licenseUtil=require(_0x3dd7('0x16'));var db=require(_0x3dd7('0x17'))['db'];var dbH=require('../../mysqldb')[_0x3dd7('0x18')];function respondWithStatusCode(_0x21acfc,_0x1c2586){_0x1c2586=_0x1c2586||0xcc;return function(_0x4dff40){if(_0x4dff40){return _0x21acfc[_0x3dd7('0x19')](_0x1c2586);}return _0x21acfc[_0x3dd7('0x1a')](_0x1c2586)[_0x3dd7('0x1b')]();};}function respondWithResult(_0x5dbc24,_0x1397aa){_0x1397aa=_0x1397aa||0xc8;return function(_0x4421fa){if(_0x4421fa){return _0x5dbc24['status'](_0x1397aa)['json'](_0x4421fa);}};}function respondWithFilteredResult(_0x586a3,_0x5cb42c){return function(_0x34f265){if(_0x34f265){var _0x345e24=typeof _0x5cb42c[_0x3dd7('0x1c')]===_0x3dd7('0x1d')&&typeof _0x5cb42c[_0x3dd7('0x1e')]==='undefined';var _0xaa09cd=_0x34f265[_0x3dd7('0x1f')];var _0x275bd1=_0x345e24?0x0:_0x5cb42c[_0x3dd7('0x1c')];var _0x258236=_0x345e24?_0x34f265[_0x3dd7('0x1f')]:_0x5cb42c[_0x3dd7('0x1c')]+_0x5cb42c[_0x3dd7('0x1e')];var _0x3d7a64;if(_0x258236>=_0xaa09cd){_0x258236=_0xaa09cd;_0x3d7a64=0xc8;}else{_0x3d7a64=0xce;}_0x586a3['status'](_0x3d7a64);return _0x586a3[_0x3dd7('0x20')](_0x3dd7('0x21'),_0x275bd1+'-'+_0x258236+'/'+_0xaa09cd)['json'](_0x34f265);}return null;};}function patchUpdates(_0xa23a78){return function(_0x5cbd1d){try{jsonpatch[_0x3dd7('0x22')](_0x5cbd1d,_0xa23a78,!![]);}catch(_0x4247dd){return BPromise['reject'](_0x4247dd);}return _0x5cbd1d[_0x3dd7('0x23')]();};}function saveUpdates(_0x44682b,_0x4d0e1a){return function(_0x48b6a9){if(_0x48b6a9){return _0x48b6a9[_0x3dd7('0x24')](_0x44682b)[_0x3dd7('0x25')](function(_0x5bc765){return _0x5bc765;});}return null;};}function removeEntity(_0x1f72f9,_0x20530a){return function(_0x1b822b){if(_0x1b822b){return _0x1b822b['destroy']()['then'](function(){var _0x4b675d=_0x1b822b[_0x3dd7('0x26')]({'plain':!![]});var _0x5eab9b=_0x3dd7('0x27');return db[_0x3dd7('0x28')][_0x3dd7('0x29')]({'where':{'type':_0x5eab9b,'resourceId':_0x4b675d['id']}})[_0x3dd7('0x25')](function(){return _0x1b822b;});})[_0x3dd7('0x25')](function(){_0x1f72f9[_0x3dd7('0x1a')](0xcc)[_0x3dd7('0x1b')]();});}};}function handleEntityNotFound(_0x302adb,_0x2342d1){return function(_0x402b38){if(!_0x402b38){_0x302adb[_0x3dd7('0x19')](0x194);}return _0x402b38;};}function handleError(_0x553848,_0x599ef5){_0x599ef5=_0x599ef5||0x1f4;return function(_0x356a11){logger[_0x3dd7('0x2a')](_0x356a11[_0x3dd7('0x2b')]);if(_0x356a11[_0x3dd7('0x2c')]){delete _0x356a11[_0x3dd7('0x2c')];}_0x553848[_0x3dd7('0x1a')](_0x599ef5)[_0x3dd7('0x2d')](_0x356a11);};}exports[_0x3dd7('0x2e')]=function(_0x236b89,_0x659681){var _0xb41b98={},_0x5ef5a4={},_0x1aaacc={'count':0x0,'rows':[]};var _0x4745b2=_[_0x3dd7('0x2f')](db[_0x3dd7('0x30')][_0x3dd7('0x31')],function(_0x40717e){return{'name':_0x40717e['fieldName'],'type':_0x40717e['type'][_0x3dd7('0x32')]};});_0x5ef5a4[_0x3dd7('0x33')]=_[_0x3dd7('0x2f')](_0x4745b2,_0x3dd7('0x2c'));_0x5ef5a4[_0x3dd7('0x34')]=_[_0x3dd7('0x35')](_0x236b89[_0x3dd7('0x34')]);_0x5ef5a4['filters']=_[_0x3dd7('0x36')](_0x5ef5a4[_0x3dd7('0x33')],_0x5ef5a4[_0x3dd7('0x34')]);_0xb41b98[_0x3dd7('0x37')]=_[_0x3dd7('0x36')](_0x5ef5a4[_0x3dd7('0x33')],qs['fields'](_0x236b89['query'][_0x3dd7('0x38')]));_0xb41b98[_0x3dd7('0x37')]=_0xb41b98[_0x3dd7('0x37')][_0x3dd7('0x39')]?_0xb41b98[_0x3dd7('0x37')]:_0x5ef5a4[_0x3dd7('0x33')];if(!_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x3a')](_0x3dd7('0x3b'))){_0xb41b98['limit']=qs[_0x3dd7('0x1e')](_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x1e')]);_0xb41b98[_0x3dd7('0x1c')]=qs[_0x3dd7('0x1c')](_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x1c')]);}_0xb41b98[_0x3dd7('0x3c')]=qs[_0x3dd7('0x3d')](_0x236b89[_0x3dd7('0x34')]['sort']);_0xb41b98[_0x3dd7('0x3e')]=qs[_0x3dd7('0x3f')](_[_0x3dd7('0x40')](_0x236b89[_0x3dd7('0x34')],_0x5ef5a4[_0x3dd7('0x3f')]),_0x4745b2);if(_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x41')]){_0xb41b98['where']=_[_0x3dd7('0x42')](_0xb41b98[_0x3dd7('0x3e')],{'$or':_[_0x3dd7('0x2f')](_0x4745b2,function(_0x210076){if(_0x210076[_0x3dd7('0x43')]!==_0x3dd7('0x44')){var _0xa9eae1={};_0xa9eae1[_0x210076[_0x3dd7('0x2c')]]={'$like':'%'+_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x41')]+'%'};return _0xa9eae1;}})});}_0xb41b98=_[_0x3dd7('0x42')]({},_0xb41b98,_0x236b89['options']);var _0x59f0fe={'where':_0xb41b98[_0x3dd7('0x3e')]};return db[_0x3dd7('0x30')][_0x3dd7('0x1f')](_0x59f0fe)['then'](function(_0x3b7c6c){_0x1aaacc[_0x3dd7('0x1f')]=_0x3b7c6c;if(_0x236b89['query'][_0x3dd7('0x45')]){_0xb41b98['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3dd7('0x46')](_0xb41b98);})['then'](function(_0x1922b8){_0x1aaacc[_0x3dd7('0x47')]=_0x1922b8;return _0x1aaacc;})[_0x3dd7('0x25')](respondWithFilteredResult(_0x659681,_0xb41b98))[_0x3dd7('0x48')](handleError(_0x659681,null));};exports[_0x3dd7('0x49')]=function(_0x512385,_0x212017){var _0x174cca={'raw':![],'where':{'id':_0x512385[_0x3dd7('0x4a')]['id']}},_0x11db02={};_0x11db02['model']=_[_0x3dd7('0x35')](db[_0x3dd7('0x30')][_0x3dd7('0x31')]);_0x11db02[_0x3dd7('0x34')]=_['keys'](_0x512385[_0x3dd7('0x34')]);_0x11db02[_0x3dd7('0x3f')]=_[_0x3dd7('0x36')](_0x11db02[_0x3dd7('0x33')],_0x11db02[_0x3dd7('0x34')]);_0x174cca['attributes']=_[_0x3dd7('0x36')](_0x11db02[_0x3dd7('0x33')],qs[_0x3dd7('0x38')](_0x512385[_0x3dd7('0x34')][_0x3dd7('0x38')]));_0x174cca['attributes']=_0x174cca[_0x3dd7('0x37')]['length']?_0x174cca['attributes']:_0x11db02[_0x3dd7('0x33')];if(_0x512385[_0x3dd7('0x34')][_0x3dd7('0x45')]){_0x174cca[_0x3dd7('0x4b')]=[{'all':!![]}];}_0x174cca=_[_0x3dd7('0x42')]({},_0x174cca,_0x512385[_0x3dd7('0x4c')]);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x174cca)[_0x3dd7('0x25')](handleEntityNotFound(_0x212017,null))[_0x3dd7('0x25')](respondWithResult(_0x212017,null))[_0x3dd7('0x48')](handleError(_0x212017,null));};exports['create']=function(_0x202768,_0x2cfa9e){return db[_0x3dd7('0x30')][_0x3dd7('0x4e')](_0x202768[_0x3dd7('0x4f')],{})[_0x3dd7('0x25')](function(_0x2b0e06){var _0x3eb418=_0x202768[_0x3dd7('0x50')][_0x3dd7('0x26')]({'plain':!![]});if(!_0x3eb418)throw new Error(_0x3dd7('0x51'));if(_0x3eb418[_0x3dd7('0x52')]===_0x3dd7('0x50')){var _0x3bace7=_0x2b0e06[_0x3dd7('0x26')]({'plain':!![]});var _0x12302e=_0x3dd7('0x53');return db[_0x3dd7('0x54')][_0x3dd7('0x4d')]({'where':{'name':_0x12302e,'userProfileId':_0x3eb418['userProfileId']},'raw':!![]})['then'](function(_0x25abf7){if(_0x25abf7&&_0x25abf7[_0x3dd7('0x55')]===0x0){return db['UserProfileResource'][_0x3dd7('0x4e')]({'name':_0x3bace7[_0x3dd7('0x2c')],'resourceId':_0x3bace7['id'],'type':_0x3dd7('0x27'),'sectionId':_0x25abf7['id']},{})['then'](function(){return _0x2b0e06;});}else{return _0x2b0e06;}})[_0x3dd7('0x48')](function(_0xc51c6f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc51c6f);throw _0xc51c6f;});}return _0x2b0e06;})[_0x3dd7('0x25')](respondWithResult(_0x2cfa9e,0xc9))[_0x3dd7('0x48')](handleError(_0x2cfa9e,null));};exports[_0x3dd7('0x24')]=function(_0x163be2,_0x37e0fe){if(_0x163be2['body']['id']){delete _0x163be2[_0x3dd7('0x4f')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x163be2[_0x3dd7('0x4a')]['id']}})[_0x3dd7('0x25')](handleEntityNotFound(_0x37e0fe,null))['then'](saveUpdates(_0x163be2[_0x3dd7('0x4f')],null))[_0x3dd7('0x25')](respondWithResult(_0x37e0fe,null))[_0x3dd7('0x48')](handleError(_0x37e0fe,null));};exports['destroy']=function(_0x1ac726,_0xfc940){return db[_0x3dd7('0x30')]['find']({'where':{'id':_0x1ac726[_0x3dd7('0x4a')]['id']}})[_0x3dd7('0x25')](handleEntityNotFound(_0xfc940,null))[_0x3dd7('0x25')](removeEntity(_0xfc940,null))[_0x3dd7('0x48')](handleError(_0xfc940,null));};exports[_0x3dd7('0x56')]=function(_0x255448,_0x3cd7bc){var _0x52fa58=0xa;var _0x28f017=['join',_0x3dd7('0x57'),'right_join','cross_join'];var _0x302e94={'SUM':_0x3dd7('0x58'),'COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':'MIN(%s)','AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':_0x3dd7('0x5f')};var _0x3cc273={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x30d44d=function(_0x10e80c){return!_[_0x3dd7('0x63')]([_0x3dd7('0x64'),_0x3dd7('0x65'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x10e80c);};var _0x6c940d=function(_0x4255d5){if(!_0x4255d5||!_0x4255d5['rules'][_0x3dd7('0x39')]){return'';}for(var _0x1d4f6b='(',_0x72ffff=0x0;_0x72ffff<_0x4255d5[_0x3dd7('0x66')][_0x3dd7('0x39')];_0x72ffff+=0x1){_0x72ffff>0x0&&(_0x1d4f6b+='\x20'+_0x4255d5[_0x3dd7('0x67')]+'\x20');_0x1d4f6b+=_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x68')]?_0x6c940d(_0x4255d5[_0x3dd7('0x66')][_0x72ffff]['group']):_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x69')]+'\x20'+_0x4255d5[_0x3dd7('0x66')][_0x72ffff]['condition']+(_0x30d44d(_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x6a')])?'\x20'+_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x6b')]:'');}return _0x1d4f6b+')';};var _0x1fc654={'where':{'id':_0x255448['params']['id']}},_0x35cd83,_0x56e578,_0xe8ba3d,_0x39afd7,_0x3e635d;_0x1fc654=_['merge']({},_0x1fc654,_0x255448[_0x3dd7('0x4c')]);return db[_0x3dd7('0x30')][_0x3dd7('0x4d')](_0x1fc654)[_0x3dd7('0x25')](function(_0x1cd570){if(_0x1cd570){_0x35cd83=_0x1cd570;return _0x1cd570[_0x3dd7('0x6c')]();}return null;})[_0x3dd7('0x25')](function(_0x319886){if(_0x319886){if(!_0x319886[_0x3dd7('0x39')]){throw new db['Sequelize'][(_0x3dd7('0x6d'))](_0x3dd7('0x6e'),0x193);}_0x56e578=_0x319886;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})[_0x3dd7('0x25')](function(_0x3d3c0a){if(_0x3d3c0a){_0xe8ba3d=_[_0x3dd7('0x70')](_0x3d3c0a,'id');var _0xbec089;var _0x2fad32=squel[_0x3dd7('0x71')]();_0x2fad32[_0x3dd7('0x72')](_0x35cd83[_0x3dd7('0x73')]);for(var _0x45b605=0x0;_0x45b605<_0x56e578[_0x3dd7('0x39')];_0x45b605+=0x1){_0xbec089=_0x56e578[_0x45b605][_0x3dd7('0x74')]?_0xe8ba3d[_0x56e578[_0x45b605]['MetricId']][_0x3dd7('0x75')]:_0x56e578[_0x45b605]['field'];_0xbec089=_0x56e578[_0x45b605][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x302e94[_0x56e578[_0x45b605]['function']],'%s',_0xbec089):_0xbec089;_0xbec089=_0x56e578[_0x45b605]['format']?_[_0x3dd7('0x77')](_0x3cc273[_0x56e578[_0x45b605]['format']],'%s',_0xbec089):_0xbec089;if(_0x56e578[_0x45b605][_0x3dd7('0x78')]){_0x2fad32[_0x3dd7('0x68')](_0xbec089);}_0x56e578[_0x45b605][_0x3dd7('0x79')]&&_0x2fad32[_0x3dd7('0x3c')](_0xbec089,_0x56e578[_0x45b605][_0x3dd7('0x79')]===_0x3dd7('0x7a')?![]:!![]);_0x2fad32[_0x3dd7('0x69')](_0xbec089,_0x56e578[_0x45b605][_0x3dd7('0x7b')]||_0xbec089);}if(_0x35cd83[_0x3dd7('0x7c')]){_0x35cd83[_0x3dd7('0x7c')]=JSON['parse'](_0x35cd83[_0x3dd7('0x7c')]);for(var _0x4b214d=0x0;_0x4b214d<_0x35cd83[_0x3dd7('0x7c')]['length'];_0x4b214d+=0x1){if(_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x43')]&&_[_0x3dd7('0x63')](_0x28f017,_0x35cd83['joins'][_0x4b214d][_0x3dd7('0x43')])&&_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['parentKey']&&_0x35cd83['joins'][_0x4b214d]['foreignTable']&&_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignKey']){_0x2fad32[_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x43')]](_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x35cd83[_0x3dd7('0x73')],_0x35cd83['joins'][_0x4b214d][_0x3dd7('0x7d')],_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x7e')],_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignKey']));}}}if(_0x35cd83[_0x3dd7('0x7f')]){_0x35cd83['conditions']=JSON[_0x3dd7('0x80')](_0x35cd83[_0x3dd7('0x7f')]);_0x2fad32['where'](_0x6c940d(_0x35cd83['conditions'][_0x3dd7('0x68')]));}_0x3e635d=_0x2fad32[_0x3dd7('0x81')]();_0x2fad32[_0x3dd7('0x1e')](_0x52fa58);_0x2fad32[_0x3dd7('0x1c')](0x0);logger[_0x3dd7('0x82')](_0x3dd7('0x83'),_0x2fad32[_0x3dd7('0x84')]());return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x2fad32[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});}})['then'](respondWithResult(_0x3cd7bc,null))['catch'](handleError(_0x3cd7bc,null));};function runReport(_0x5867b2,_0x512a73,_0x7aab8c){var _0x3da8ef=_0x512a73[_0x3dd7('0x2c')];var _0x4b2210=0xa;var _0x3e37c2=[_0x3dd7('0x88'),'left_join','right_join','cross_join'];var _0x3a867a={'SUM':'SUM(%s)','COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':_0x3dd7('0x89'),'AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':_0x3dd7('0x5f')};var _0x2d3c9e={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':_0x3dd7('0x8a'),'UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x212cc9=function(_0xadf7c7){return!_[_0x3dd7('0x63')](['IS\x20NULL',_0x3dd7('0x65'),_0x3dd7('0x8b'),_0x3dd7('0x8c')],_0xadf7c7);};var _0x22ae12=function(_0x5521d0){if(!_0x5521d0||!_0x5521d0[_0x3dd7('0x66')]['length']){return'';}for(var _0x5028ec='(',_0x432293=0x0;_0x432293<_0x5521d0[_0x3dd7('0x66')]['length'];_0x432293+=0x1){_0x432293>0x0&&(_0x5028ec+='\x20'+_0x5521d0[_0x3dd7('0x67')]+'\x20');_0x5028ec+=_0x5521d0['rules'][_0x432293][_0x3dd7('0x68')]?_0x22ae12(_0x5521d0['rules'][_0x432293][_0x3dd7('0x68')]):_0x5521d0[_0x3dd7('0x66')][_0x432293]['field']+'\x20'+_0x5521d0['rules'][_0x432293][_0x3dd7('0x6a')]+(_0x212cc9(_0x5521d0[_0x3dd7('0x66')][_0x432293][_0x3dd7('0x6a')])?'\x20'+_0x5521d0[_0x3dd7('0x66')][_0x432293][_0x3dd7('0x6b')]:'');}return _0x5028ec+')';};var _0x31a9b7={'where':{'id':_0x5867b2['id']}},_0x95f6f0,_0x392990,_0x48dfa1,_0x5dbabd,_0x1deea7;_0x31a9b7=_[_0x3dd7('0x42')]({},_0x31a9b7,_0x7aab8c);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x31a9b7)['then'](function(_0x45def3){if(_0x45def3){_0x95f6f0=_0x45def3;return _0x45def3[_0x3dd7('0x6c')]();}return null;})['then'](function(_0x29646f){if(_0x29646f){if(!_0x29646f[_0x3dd7('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x392990=_0x29646f;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})[_0x3dd7('0x25')](function(_0x3f04ca){if(_0x3f04ca){_0x48dfa1=_[_0x3dd7('0x70')](_0x3f04ca,'id');var _0x3e156f;var _0x466eb1=squel[_0x3dd7('0x71')]();_0x466eb1['from'](_0x95f6f0[_0x3dd7('0x73')]);for(var _0x2e99b9=0x0;_0x2e99b9<_0x392990[_0x3dd7('0x39')];_0x2e99b9+=0x1){_0x3e156f=_0x392990[_0x2e99b9]['MetricId']?_0x48dfa1[_0x392990[_0x2e99b9]['MetricId']][_0x3dd7('0x75')]:_0x392990[_0x2e99b9][_0x3dd7('0x69')];_0x3e156f=_0x392990[_0x2e99b9][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x3a867a[_0x392990[_0x2e99b9][_0x3dd7('0x76')]],'%s',_0x3e156f):_0x3e156f;_0x3e156f=_0x392990[_0x2e99b9]['format']?_[_0x3dd7('0x77')](_0x2d3c9e[_0x392990[_0x2e99b9]['format']],'%s',_0x3e156f):_0x3e156f;if(_0x392990[_0x2e99b9][_0x3dd7('0x78')]){_0x466eb1[_0x3dd7('0x68')](_0x3e156f);}_0x392990[_0x2e99b9]['orderBy']&&_0x466eb1[_0x3dd7('0x3c')](_0x3e156f,_0x392990[_0x2e99b9]['orderBy']==='DESC'?![]:!![]);_0x466eb1[_0x3dd7('0x69')](_0x3e156f,_0x392990[_0x2e99b9][_0x3dd7('0x7b')]||_0x3e156f);}if(_0x95f6f0[_0x3dd7('0x7c')]){_0x95f6f0[_0x3dd7('0x7c')]=JSON['parse'](_0x95f6f0['joins']);for(var _0x3787b8=0x0;_0x3787b8<_0x95f6f0[_0x3dd7('0x7c')][_0x3dd7('0x39')];_0x3787b8+=0x1){if(_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x43')]&&_[_0x3dd7('0x63')](_0x3e37c2,_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x43')])&&_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7d')]&&_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7e')]&&_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x8d')]){_0x466eb1[_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x43')]](_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x7e')],null,util[_0x3dd7('0x8e')](_0x3dd7('0x8f'),_0x95f6f0[_0x3dd7('0x73')],_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7d')],_0x95f6f0['joins'][_0x3787b8]['foreignTable'],_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x8d')]));}}}if(_0x95f6f0[_0x3dd7('0x7f')]){_0x95f6f0['conditions']=JSON[_0x3dd7('0x80')](_0x95f6f0[_0x3dd7('0x7f')]);_0x466eb1['where'](_0x22ae12(_0x95f6f0['conditions'][_0x3dd7('0x68')]));}_0x1deea7=_0x466eb1[_0x3dd7('0x81')]();_0x466eb1[_0x3dd7('0x1e')](_0x4b2210);_0x466eb1['offset'](0x0);return;}})[_0x3dd7('0x25')](function(){if(_0x512a73[_0x3dd7('0x90')]===_0x3dd7('0x91')){return null;}var _0x1afaa5=_[_0x3dd7('0x42')](_0x512a73,{'name':_0x512a73[_0x3dd7('0x92')]||_0x512a73[_0x3dd7('0x2c')]||_0x95f6f0[_0x3dd7('0x2c')],'basename':_0x3da8ef,'savename':util[_0x3dd7('0x8e')](_0x3dd7('0x93'),_0x512a73[_0x3dd7('0x2c')]||_0x95f6f0[_0x3dd7('0x2c')],require(_0x3dd7('0x94'))[_0x3dd7('0x95')](0x4),_0x512a73[_0x3dd7('0x90')]||_0x3dd7('0x96')),'reportId':_0x95f6f0['id'],'reportType':_0x3dd7('0x97')});return db[_0x3dd7('0x98')][_0x3dd7('0x4e')](_0x1afaa5,{'raw':!![]});})[_0x3dd7('0x25')](function(_0x35345e){if(_0x95f6f0['table']===_0x3dd7('0x99')){_0x1deea7[_0x3dd7('0x3e')](_0x95f6f0[_0x3dd7('0x73')]+_0x3dd7('0x9a'),_0x512a73['startDate'],_0x512a73[_0x3dd7('0x9b')]);}else{_0x1deea7[_0x3dd7('0x3e')](_0x95f6f0['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x512a73[_0x3dd7('0x9c')],_0x512a73[_0x3dd7('0x9b')]);}if(_0x35345e){logger['info'](_0x3dd7('0x9d'),_0x1deea7[_0x3dd7('0x84')]());require(_0x3dd7('0x9e'))['fork'](path[_0x3dd7('0x88')](__dirname,'../../components/export/',_0x35345e[_0x3dd7('0x90')]),[_0x35345e['id'],_0x1deea7[_0x3dd7('0x84')](),path['join'](__dirname,_0x3dd7('0x9f'),_0x35345e[_0x3dd7('0xa0')]),_0x3da8ef]);return _0x35345e;}else{var _0x2ec6f9=squel[_0x3dd7('0x71')]();_0x2ec6f9[_0x3dd7('0x72')]('('+_0x1deea7[_0x3dd7('0x84')]()+')',_0x3dd7('0xa1'));_0x2ec6f9[_0x3dd7('0x69')](_0x3dd7('0xa2'),_0x3dd7('0x1f'));_0x1deea7['limit'](_0x512a73[_0x3dd7('0x1e')]||_0x4b2210);_0x1deea7[_0x3dd7('0x1c')](_0x512a73[_0x3dd7('0x1c')]||0x0);return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x2ec6f9[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]})[_0x3dd7('0x25')](function(_0x392ef1){if(!_0x392ef1[_0x3dd7('0x39')]){_0x5dbabd=0x0;}else{_0x5dbabd=_0x392ef1[0x0]['count']||0x0;}return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x1deea7['toString'](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});})[_0x3dd7('0x25')](function(_0x183e57){return{'rows':_0x183e57||[],'count':_0x5dbabd};});}});}exports[_0x3dd7('0xa3')]=function(_0x2be557,_0x29ba6f){return runReport(_0x2be557[_0x3dd7('0x4a')],_0x2be557[_0x3dd7('0x34')],_0x2be557[_0x3dd7('0x4c')])[_0x3dd7('0x25')](respondWithResult(_0x29ba6f,null))[_0x3dd7('0x48')](handleError(_0x29ba6f,null));};exports['runReport']=runReport;exports['query']=function(_0x10c8e7,_0x3cf25e){var _0xa2732f=0xa;var _0x59acd7=[_0x3dd7('0x88'),'left_join','right_join',_0x3dd7('0xa4')];var _0x36d9da={'SUM':_0x3dd7('0x58'),'COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':_0x3dd7('0x89'),'AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x24f69d={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':_0x3dd7('0x8a'),'UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x550432=function(_0x251466){return!_[_0x3dd7('0x63')](['IS\x20NULL',_0x3dd7('0x65'),_0x3dd7('0x8b'),_0x3dd7('0x8c')],_0x251466);};var _0x9b93e7=function(_0x26528c){if(!_0x26528c||!_0x26528c[_0x3dd7('0x66')][_0x3dd7('0x39')]){return'';}for(var _0x39eacd='(',_0x2bef10=0x0;_0x2bef10<_0x26528c[_0x3dd7('0x66')]['length'];_0x2bef10+=0x1){_0x2bef10>0x0&&(_0x39eacd+='\x20'+_0x26528c['operator']+'\x20');_0x39eacd+=_0x26528c['rules'][_0x2bef10][_0x3dd7('0x68')]?_0x9b93e7(_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x68')]):_0x26528c['rules'][_0x2bef10][_0x3dd7('0x69')]+'\x20'+_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6a')]+(_0x550432(_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6a')])?'\x20'+_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6b')]:'');}return _0x39eacd+')';};var _0x2d116a={'where':{'id':_0x10c8e7['params']['id']}},_0x2aea66,_0x579318,_0x1207ca,_0x3236f9,_0x372e4d;_0x2d116a=_[_0x3dd7('0x42')]({},_0x2d116a,_0x10c8e7[_0x3dd7('0x4c')]);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x2d116a)[_0x3dd7('0x25')](function(_0x44b3b7){if(_0x44b3b7){_0x2aea66=_0x44b3b7;return _0x44b3b7[_0x3dd7('0x6c')]();}return null;})['then'](function(_0x5ce1d7){if(_0x5ce1d7){if(!_0x5ce1d7['length']){throw new db[(_0x3dd7('0xa5'))][(_0x3dd7('0x6d'))](_0x3dd7('0x6e'),0x193);}_0x579318=_0x5ce1d7;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})['then'](function(_0xa92e3c){if(_0xa92e3c){_0x1207ca=_[_0x3dd7('0x70')](_0xa92e3c,'id');var _0x3bd821;var _0x3a3758=squel[_0x3dd7('0x71')]();_0x3a3758['from'](_0x2aea66['table']);for(var _0x292649=0x0;_0x292649<_0x579318['length'];_0x292649+=0x1){_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x74')]?_0x1207ca[_0x579318[_0x292649][_0x3dd7('0x74')]]['metric']:_0x579318[_0x292649][_0x3dd7('0x69')];_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x36d9da[_0x579318[_0x292649][_0x3dd7('0x76')]],'%s',_0x3bd821):_0x3bd821;_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x8e')]?_['replace'](_0x24f69d[_0x579318[_0x292649][_0x3dd7('0x8e')]],'%s',_0x3bd821):_0x3bd821;if(_0x579318[_0x292649]['groupBy']){_0x3a3758[_0x3dd7('0x68')](_0x3bd821);}_0x579318[_0x292649][_0x3dd7('0x79')]&&_0x3a3758[_0x3dd7('0x3c')](_0x3bd821,_0x579318[_0x292649][_0x3dd7('0x79')]===_0x3dd7('0x7a')?![]:!![]);_0x3a3758[_0x3dd7('0x69')](_0x3bd821,_0x579318[_0x292649][_0x3dd7('0x7b')]||_0x3bd821);}if(_0x2aea66[_0x3dd7('0x7c')]){_0x2aea66[_0x3dd7('0x7c')]=JSON[_0x3dd7('0x80')](_0x2aea66[_0x3dd7('0x7c')]);for(var _0x311e9e=0x0;_0x311e9e<_0x2aea66[_0x3dd7('0x7c')][_0x3dd7('0x39')];_0x311e9e+=0x1){if(_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x43')]&&_['includes'](_0x59acd7,_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x43')])&&_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7d')]&&_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7e')]&&_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x8d')]){_0x3a3758[_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x43')]](_0x2aea66[_0x3dd7('0x7c')][_0x311e9e]['foreignTable'],null,util[_0x3dd7('0x8e')](_0x3dd7('0x8f'),_0x2aea66[_0x3dd7('0x73')],_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x7d')],_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7e')],_0x2aea66[_0x3dd7('0x7c')][_0x311e9e]['foreignKey']));}}}if(_0x2aea66[_0x3dd7('0x7f')]){_0x2aea66[_0x3dd7('0x7f')]=JSON['parse'](_0x2aea66[_0x3dd7('0x7f')]);_0x3a3758[_0x3dd7('0x3e')](_0x9b93e7(_0x2aea66[_0x3dd7('0x7f')]['group']));}_0x372e4d=_0x3a3758[_0x3dd7('0x81')]();_0x3a3758[_0x3dd7('0x1e')](_0xa2732f);_0x3a3758[_0x3dd7('0x1c')](0x0);logger[_0x3dd7('0x82')](_0x3dd7('0x83'),_0x3a3758['toString']());return dbH[_0x3dd7('0x85')]['query'](_0x3a3758[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});}})[_0x3dd7('0x25')](function(){return{'sql':_0x372e4d[_0x3dd7('0x84')]()};})[_0x3dd7('0x25')](respondWithResult(_0x3cf25e,null))[_0x3dd7('0x48')](handleError(_0x3cf25e,null));};
\ No newline at end of file
+var _0xaf2f=['then','get','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','findAll','rows','params','includeAll','include','find','catch','create','user','role','Reports','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)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','SELECT','cross_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','left_join','groupBy','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x5ad1ee,_0x49bdd2){var _0x2fcb07=function(_0x108aea){while(--_0x108aea){_0x5ad1ee['push'](_0x5ad1ee['shift']());}};_0x2fcb07(++_0x49bdd2);}(_0xaf2f,0x126));var _0xfaf2=function(_0x4b72b3,_0xb05c18){_0x4b72b3=_0x4b72b3-0x0;var _0x4bed2f=_0xaf2f[_0x4b72b3];return _0x4bed2f;};'use strict';var emlformat=require(_0xfaf2('0x0'));var rimraf=require(_0xfaf2('0x1'));var zipdir=require(_0xfaf2('0x2'));var jsonpatch=require(_0xfaf2('0x3'));var rp=require(_0xfaf2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaf2('0x5'));var util=require('util');var path=require(_0xfaf2('0x6'));var sox=require(_0xfaf2('0x7'));var csv=require('to-csv');var ejs=require(_0xfaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xfaf2('0x9'));var _=require(_0xfaf2('0xa'));var squel=require(_0xfaf2('0xb'));var crypto=require(_0xfaf2('0xc'));var jsforce=require(_0xfaf2('0xd'));var deskjs=require(_0xfaf2('0xe'));var toCsv=require(_0xfaf2('0xf'));var querystring=require(_0xfaf2('0x10'));var Papa=require(_0xfaf2('0x11'));var Redis=require(_0xfaf2('0x12'));var authService=require(_0xfaf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf2('0x14'));var hardwareService=require(_0xfaf2('0x15'));var logger=require('../../config/logger')(_0xfaf2('0x16'));var utils=require(_0xfaf2('0x17'));var config=require(_0xfaf2('0x18'));var licenseUtil=require(_0xfaf2('0x19'));var db=require(_0xfaf2('0x1a'))['db'];var dbH=require(_0xfaf2('0x1a'))[_0xfaf2('0x1b')];function respondWithStatusCode(_0x4cb9ef,_0x1a6acf){_0x1a6acf=_0x1a6acf||0xcc;return function(_0x532e74){if(_0x532e74){return _0x4cb9ef[_0xfaf2('0x1c')](_0x1a6acf);}return _0x4cb9ef['status'](_0x1a6acf)[_0xfaf2('0x1d')]();};}function respondWithResult(_0x5cddfc,_0x46f038){_0x46f038=_0x46f038||0xc8;return function(_0x36f083){if(_0x36f083){return _0x5cddfc[_0xfaf2('0x1e')](_0x46f038)['json'](_0x36f083);}};}function respondWithFilteredResult(_0x187a61,_0x126bfb){return function(_0x7aa8b2){if(_0x7aa8b2){var _0x32bbd8=typeof _0x126bfb[_0xfaf2('0x1f')]===_0xfaf2('0x20')&&typeof _0x126bfb[_0xfaf2('0x21')]===_0xfaf2('0x20');var _0x3b7f5e=_0x7aa8b2[_0xfaf2('0x22')];var _0x5991e9=_0x32bbd8?0x0:_0x126bfb[_0xfaf2('0x1f')];var _0x3564a0=_0x32bbd8?_0x7aa8b2['count']:_0x126bfb[_0xfaf2('0x1f')]+_0x126bfb[_0xfaf2('0x21')];var _0xda4911;if(_0x3564a0>=_0x3b7f5e){_0x3564a0=_0x3b7f5e;_0xda4911=0xc8;}else{_0xda4911=0xce;}_0x187a61[_0xfaf2('0x1e')](_0xda4911);return _0x187a61[_0xfaf2('0x23')](_0xfaf2('0x24'),_0x5991e9+'-'+_0x3564a0+'/'+_0x3b7f5e)[_0xfaf2('0x25')](_0x7aa8b2);}return null;};}function patchUpdates(_0x1f9480){return function(_0x5d4467){try{jsonpatch[_0xfaf2('0x26')](_0x5d4467,_0x1f9480,!![]);}catch(_0x14ff68){return BPromise[_0xfaf2('0x27')](_0x14ff68);}return _0x5d4467['save']();};}function saveUpdates(_0x30553c,_0x155bc1){return function(_0x3560a0){if(_0x3560a0){return _0x3560a0[_0xfaf2('0x28')](_0x30553c)['then'](function(_0x2eadcf){return _0x2eadcf;});}return null;};}function removeEntity(_0x19e933,_0x2c2370){return function(_0x1c7f27){if(_0x1c7f27){return _0x1c7f27[_0xfaf2('0x29')]()[_0xfaf2('0x2a')](function(){var _0x364b4f=_0x1c7f27[_0xfaf2('0x2b')]({'plain':!![]});var _0xbb1c0b=_0xfaf2('0x2c');return db[_0xfaf2('0x2d')][_0xfaf2('0x29')]({'where':{'type':_0xbb1c0b,'resourceId':_0x364b4f['id']}})['then'](function(){return _0x1c7f27;});})['then'](function(){_0x19e933[_0xfaf2('0x1e')](0xcc)[_0xfaf2('0x1d')]();});}};}function handleEntityNotFound(_0x548511,_0x15b711){return function(_0x5c0f08){if(!_0x5c0f08){_0x548511[_0xfaf2('0x1c')](0x194);}return _0x5c0f08;};}function handleError(_0xe3c01a,_0x26cafe){_0x26cafe=_0x26cafe||0x1f4;return function(_0x34e232){logger[_0xfaf2('0x2e')](_0x34e232[_0xfaf2('0x2f')]);if(_0x34e232[_0xfaf2('0x30')]){delete _0x34e232[_0xfaf2('0x30')];}_0xe3c01a[_0xfaf2('0x1e')](_0x26cafe)['send'](_0x34e232);};}exports[_0xfaf2('0x31')]=function(_0x1df04d,_0x2e726c){var _0x280219={},_0x4d35b5={},_0x5817b1={'count':0x0,'rows':[]};var _0x262d77=_[_0xfaf2('0x32')](db[_0xfaf2('0x33')][_0xfaf2('0x34')],function(_0x4d4553){return{'name':_0x4d4553[_0xfaf2('0x35')],'type':_0x4d4553[_0xfaf2('0x36')][_0xfaf2('0x37')]};});_0x4d35b5[_0xfaf2('0x38')]=_['map'](_0x262d77,_0xfaf2('0x30'));_0x4d35b5[_0xfaf2('0x39')]=_[_0xfaf2('0x3a')](_0x1df04d[_0xfaf2('0x39')]);_0x4d35b5['filters']=_[_0xfaf2('0x3b')](_0x4d35b5[_0xfaf2('0x38')],_0x4d35b5['query']);_0x280219[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x4d35b5['model'],qs[_0xfaf2('0x3d')](_0x1df04d[_0xfaf2('0x39')]['fields']));_0x280219[_0xfaf2('0x3c')]=_0x280219[_0xfaf2('0x3c')][_0xfaf2('0x3e')]?_0x280219[_0xfaf2('0x3c')]:_0x4d35b5['model'];if(!_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x3f')]('nolimit')){_0x280219[_0xfaf2('0x21')]=qs[_0xfaf2('0x21')](_0x1df04d['query'][_0xfaf2('0x21')]);_0x280219[_0xfaf2('0x1f')]=qs[_0xfaf2('0x1f')](_0x1df04d[_0xfaf2('0x39')]['offset']);}_0x280219[_0xfaf2('0x40')]=qs[_0xfaf2('0x41')](_0x1df04d[_0xfaf2('0x39')]['sort']);_0x280219['where']=qs[_0xfaf2('0x42')](_[_0xfaf2('0x43')](_0x1df04d[_0xfaf2('0x39')],_0x4d35b5[_0xfaf2('0x42')]),_0x262d77);if(_0x1df04d[_0xfaf2('0x39')]['filter']){_0x280219[_0xfaf2('0x44')]=_[_0xfaf2('0x45')](_0x280219[_0xfaf2('0x44')],{'$or':_[_0xfaf2('0x32')](_0x262d77,function(_0x4a860c){if(_0x4a860c['type']!=='VIRTUAL'){var _0x2b8d99={};_0x2b8d99[_0x4a860c['name']]={'$like':'%'+_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x46')]+'%'};return _0x2b8d99;}})});}_0x280219=_[_0xfaf2('0x45')]({},_0x280219,_0x1df04d[_0xfaf2('0x47')]);var _0x2af6b6={'where':_0x280219[_0xfaf2('0x44')]};return db[_0xfaf2('0x33')]['count'](_0x2af6b6)[_0xfaf2('0x2a')](function(_0x2ecf3d){_0x5817b1[_0xfaf2('0x22')]=_0x2ecf3d;if(_0x1df04d[_0xfaf2('0x39')]['includeAll']){_0x280219['include']=[{'all':!![]}];}return db[_0xfaf2('0x33')][_0xfaf2('0x48')](_0x280219);})['then'](function(_0x22284e){_0x5817b1[_0xfaf2('0x49')]=_0x22284e;return _0x5817b1;})['then'](respondWithFilteredResult(_0x2e726c,_0x280219))['catch'](handleError(_0x2e726c,null));};exports['show']=function(_0xe45a70,_0x539c3d){var _0x381bc0={'raw':![],'where':{'id':_0xe45a70[_0xfaf2('0x4a')]['id']}},_0x3d079f={};_0x3d079f[_0xfaf2('0x38')]=_[_0xfaf2('0x3a')](db[_0xfaf2('0x33')][_0xfaf2('0x34')]);_0x3d079f[_0xfaf2('0x39')]=_['keys'](_0xe45a70[_0xfaf2('0x39')]);_0x3d079f['filters']=_['intersection'](_0x3d079f[_0xfaf2('0x38')],_0x3d079f['query']);_0x381bc0[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x3d079f[_0xfaf2('0x38')],qs[_0xfaf2('0x3d')](_0xe45a70[_0xfaf2('0x39')]['fields']));_0x381bc0[_0xfaf2('0x3c')]=_0x381bc0['attributes'][_0xfaf2('0x3e')]?_0x381bc0[_0xfaf2('0x3c')]:_0x3d079f['model'];if(_0xe45a70[_0xfaf2('0x39')][_0xfaf2('0x4b')]){_0x381bc0[_0xfaf2('0x4c')]=[{'all':!![]}];}_0x381bc0=_[_0xfaf2('0x45')]({},_0x381bc0,_0xe45a70['options']);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x381bc0)[_0xfaf2('0x2a')](handleEntityNotFound(_0x539c3d,null))[_0xfaf2('0x2a')](respondWithResult(_0x539c3d,null))[_0xfaf2('0x4e')](handleError(_0x539c3d,null));};exports[_0xfaf2('0x4f')]=function(_0x3b1a95,_0x448afe){return db[_0xfaf2('0x33')][_0xfaf2('0x4f')](_0x3b1a95['body'],{})['then'](function(_0x4de5aa){var _0x559044=_0x3b1a95[_0xfaf2('0x50')]['get']({'plain':!![]});if(!_0x559044)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559044[_0xfaf2('0x51')]===_0xfaf2('0x50')){var _0x4e2581=_0x4de5aa[_0xfaf2('0x2b')]({'plain':!![]});var _0x5a8ab4=_0xfaf2('0x52');return db[_0xfaf2('0x53')][_0xfaf2('0x4d')]({'where':{'name':_0x5a8ab4,'userProfileId':_0x559044[_0xfaf2('0x54')]},'raw':!![]})[_0xfaf2('0x2a')](function(_0x198c72){if(_0x198c72&&_0x198c72[_0xfaf2('0x55')]===0x0){return db[_0xfaf2('0x2d')][_0xfaf2('0x4f')]({'name':_0x4e2581[_0xfaf2('0x30')],'resourceId':_0x4e2581['id'],'type':'CustomReports','sectionId':_0x198c72['id']},{})['then'](function(){return _0x4de5aa;});}else{return _0x4de5aa;}})[_0xfaf2('0x4e')](function(_0x1d4d44){logger[_0xfaf2('0x2e')](_0xfaf2('0x56'),_0x1d4d44);throw _0x1d4d44;});}return _0x4de5aa;})['then'](respondWithResult(_0x448afe,0xc9))['catch'](handleError(_0x448afe,null));};exports[_0xfaf2('0x28')]=function(_0x28cf1f,_0x234e9f){if(_0x28cf1f['body']['id']){delete _0x28cf1f[_0xfaf2('0x57')]['id'];}return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x28cf1f['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x234e9f,null))[_0xfaf2('0x2a')](saveUpdates(_0x28cf1f[_0xfaf2('0x57')],null))[_0xfaf2('0x2a')](respondWithResult(_0x234e9f,null))[_0xfaf2('0x4e')](handleError(_0x234e9f,null));};exports['destroy']=function(_0x27aaf6,_0x17a331){return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x27aaf6['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x17a331,null))['then'](removeEntity(_0x17a331,null))[_0xfaf2('0x4e')](handleError(_0x17a331,null));};exports[_0xfaf2('0x58')]=function(_0x4b89d7,_0x1c2810){var _0x7e8f3f=0xa;var _0x47c0d7=[_0xfaf2('0x59'),'left_join',_0xfaf2('0x5a'),'cross_join'];var _0x30988f={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x3d3677={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':_0xfaf2('0x65')};var _0x15dec1=function(_0x43c0b9){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),_0xfaf2('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43c0b9);};var _0x4a6b65=function(_0x298f86){if(!_0x298f86||!_0x298f86['rules'][_0xfaf2('0x3e')]){return'';}for(var _0x1ee1ae='(',_0x334ccb=0x0;_0x334ccb<_0x298f86[_0xfaf2('0x69')]['length'];_0x334ccb+=0x1){_0x334ccb>0x0&&(_0x1ee1ae+='\x20'+_0x298f86[_0xfaf2('0x6a')]+'\x20');_0x1ee1ae+=_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]?_0x4a6b65(_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]):_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6c')]+'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6d')]+(_0x15dec1(_0x298f86[_0xfaf2('0x69')][_0x334ccb]['condition'])?'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6e')]:'');}return _0x1ee1ae+')';};var _0x179c7c={'where':{'id':_0x4b89d7[_0xfaf2('0x4a')]['id']}},_0x418852,_0x53ec76,_0x55f417,_0x4781ad,_0x5c7673;_0x179c7c=_[_0xfaf2('0x45')]({},_0x179c7c,_0x4b89d7['options']);return db[_0xfaf2('0x33')]['find'](_0x179c7c)[_0xfaf2('0x2a')](function(_0x3b8e56){if(_0x3b8e56){_0x418852=_0x3b8e56;return _0x3b8e56['getFields']();}return null;})[_0xfaf2('0x2a')](function(_0x52b7c3){if(_0x52b7c3){if(!_0x52b7c3[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x53ec76=_0x52b7c3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x333305){if(_0x333305){_0x55f417=_[_0xfaf2('0x72')](_0x333305,'id');var _0x2c6013;var _0x4aec5a=squel[_0xfaf2('0x73')]();_0x4aec5a[_0xfaf2('0x74')](_0x418852[_0xfaf2('0x75')]);for(var _0x143a1f=0x0;_0x143a1f<_0x53ec76[_0xfaf2('0x3e')];_0x143a1f+=0x1){_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x76')]?_0x55f417[_0x53ec76[_0x143a1f][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x53ec76[_0x143a1f][_0xfaf2('0x6c')];_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x78')]?_[_0xfaf2('0x79')](_0x30988f[_0x53ec76[_0x143a1f]['function']],'%s',_0x2c6013):_0x2c6013;_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]?_['replace'](_0x3d3677[_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]],'%s',_0x2c6013):_0x2c6013;if(_0x53ec76[_0x143a1f]['groupBy']){_0x4aec5a[_0xfaf2('0x6b')](_0x2c6013);}_0x53ec76[_0x143a1f][_0xfaf2('0x7b')]&&_0x4aec5a[_0xfaf2('0x40')](_0x2c6013,_0x53ec76[_0x143a1f]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x4aec5a[_0xfaf2('0x6c')](_0x2c6013,_0x53ec76[_0x143a1f][_0xfaf2('0x7d')]||_0x2c6013);}if(_0x418852[_0xfaf2('0x7e')]){_0x418852[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x418852['joins']);for(var _0x2e0cec=0x0;_0x2e0cec<_0x418852[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x2e0cec+=0x1){if(_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['type']&&_[_0xfaf2('0x66')](_0x47c0d7,_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x36')])&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x80')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x81')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]){_0x4aec5a[_0x418852['joins'][_0x2e0cec][_0xfaf2('0x36')]](_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['foreignTable'],null,util[_0xfaf2('0x7a')]('%s.%s\x20=\x20%s.%s',_0x418852[_0xfaf2('0x75')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x80')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x81')],_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]));}}}if(_0x418852[_0xfaf2('0x83')]){_0x418852[_0xfaf2('0x83')]=JSON['parse'](_0x418852[_0xfaf2('0x83')]);_0x4aec5a[_0xfaf2('0x44')](_0x4a6b65(_0x418852['conditions'][_0xfaf2('0x6b')]));}_0x5c7673=_0x4aec5a[_0xfaf2('0x84')]();_0x4aec5a[_0xfaf2('0x21')](_0x7e8f3f);_0x4aec5a[_0xfaf2('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x4aec5a[_0xfaf2('0x85')]());return dbH['sequelize']['query'](_0x4aec5a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfaf2('0x86')]});}})['then'](respondWithResult(_0x1c2810,null))[_0xfaf2('0x4e')](handleError(_0x1c2810,null));};function runReport(_0x40f693,_0x5c1dac,_0x52c1d9){var _0x370184=_0x5c1dac[_0xfaf2('0x30')];var _0x3bda03=0xa;var _0x8e5ccb=['join','left_join',_0xfaf2('0x5a'),_0xfaf2('0x87')];var _0x237198={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfaf2('0x5e'),'MIN':'MIN(%s)','AVG':_0xfaf2('0x88'),'GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x1b0f63={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e83c=function(_0x3c6d41){return!_[_0xfaf2('0x66')](['IS\x20NULL',_0xfaf2('0x68'),_0xfaf2('0x8b'),_0xfaf2('0x8c')],_0x3c6d41);};var _0x443005=function(_0x8fb83c){if(!_0x8fb83c||!_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x305b54='(',_0x51dbed=0x0;_0x51dbed<_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x51dbed+=0x1){_0x51dbed>0x0&&(_0x305b54+='\x20'+_0x8fb83c[_0xfaf2('0x6a')]+'\x20');_0x305b54+=_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6b')]?_0x443005(_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['group']):_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6c')]+'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6d')]+(_0x24e83c(_0x8fb83c['rules'][_0x51dbed][_0xfaf2('0x6d')])?'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['value']:'');}return _0x305b54+')';};var _0x16c846={'where':{'id':_0x40f693['id']}},_0x4ba198,_0x659b1b,_0x3724a9,_0x274f5c,_0x4558c2;_0x16c846=_[_0xfaf2('0x45')]({},_0x16c846,_0x52c1d9);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x16c846)[_0xfaf2('0x2a')](function(_0x5f0c35){if(_0x5f0c35){_0x4ba198=_0x5f0c35;return _0x5f0c35[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0xa21aee){if(_0xa21aee){if(!_0xa21aee[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x659b1b=_0xa21aee;return db[_0xfaf2('0x8e')][_0xfaf2('0x48')]({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x4bbc0e){if(_0x4bbc0e){_0x3724a9=_[_0xfaf2('0x72')](_0x4bbc0e,'id');var _0x5a59af;var _0x50a4c0=squel['select']();_0x50a4c0[_0xfaf2('0x74')](_0x4ba198[_0xfaf2('0x75')]);for(var _0x2b64c3=0x0;_0x2b64c3<_0x659b1b[_0xfaf2('0x3e')];_0x2b64c3+=0x1){_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]?_0x3724a9[_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]]['metric']:_0x659b1b[_0x2b64c3]['field'];_0x5a59af=_0x659b1b[_0x2b64c3]['function']?_[_0xfaf2('0x79')](_0x237198[_0x659b1b[_0x2b64c3][_0xfaf2('0x78')]],'%s',_0x5a59af):_0x5a59af;_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x1b0f63[_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]],'%s',_0x5a59af):_0x5a59af;if(_0x659b1b[_0x2b64c3]['groupBy']){_0x50a4c0[_0xfaf2('0x6b')](_0x5a59af);}_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]&&_0x50a4c0[_0xfaf2('0x40')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]===_0xfaf2('0x7c')?![]:!![]);_0x50a4c0[_0xfaf2('0x6c')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7d')]||_0x5a59af);}if(_0x4ba198[_0xfaf2('0x7e')]){_0x4ba198[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x4ba198[_0xfaf2('0x7e')]);for(var _0x243692=0x0;_0x243692<_0x4ba198[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x243692+=0x1){if(_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]&&_[_0xfaf2('0x66')](_0x8e5ccb,_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')])&&_0x4ba198['joins'][_0x243692]['parentKey']&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')]&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]){_0x50a4c0[_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]](_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x4ba198['table'],_0x4ba198['joins'][_0x243692][_0xfaf2('0x80')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]));}}}if(_0x4ba198[_0xfaf2('0x83')]){_0x4ba198[_0xfaf2('0x83')]=JSON['parse'](_0x4ba198[_0xfaf2('0x83')]);_0x50a4c0[_0xfaf2('0x44')](_0x443005(_0x4ba198[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x4558c2=_0x50a4c0[_0xfaf2('0x84')]();_0x50a4c0['limit'](_0x3bda03);_0x50a4c0[_0xfaf2('0x1f')](0x0);return;}})[_0xfaf2('0x2a')](function(){if(_0x5c1dac[_0xfaf2('0x90')]===_0xfaf2('0x91')){return null;}var _0x9c3608=_[_0xfaf2('0x45')](_0x5c1dac,{'name':_0x5c1dac[_0xfaf2('0x92')]||_0x5c1dac[_0xfaf2('0x30')]||_0x4ba198[_0xfaf2('0x30')],'basename':_0x370184,'savename':util['format'](_0xfaf2('0x93'),_0x5c1dac['name']||_0x4ba198['name'],require(_0xfaf2('0x94'))[_0xfaf2('0x95')](0x4),_0x5c1dac[_0xfaf2('0x90')]||'csv'),'reportId':_0x4ba198['id'],'reportType':_0xfaf2('0x96')});return db[_0xfaf2('0x97')][_0xfaf2('0x4f')](_0x9c3608,{'raw':!![]});})['then'](function(_0x10b0ef){if(_0x4ba198[_0xfaf2('0x75')]==='cdr'){_0x4558c2[_0xfaf2('0x44')](_0x4ba198[_0xfaf2('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5c1dac[_0xfaf2('0x98')],_0x5c1dac[_0xfaf2('0x99')]);}else{_0x4558c2[_0xfaf2('0x44')](_0x4ba198['table']+_0xfaf2('0x9a'),_0x5c1dac['startDate'],_0x5c1dac['endDate']);}if(_0x10b0ef){logger[_0xfaf2('0x9b')]('Run\x20Query:',_0x4558c2['toString']());require(_0xfaf2('0x9c'))[_0xfaf2('0x9d')](path[_0xfaf2('0x59')](__dirname,'../../components/export/',_0x10b0ef[_0xfaf2('0x90')]),[_0x10b0ef['id'],_0x4558c2[_0xfaf2('0x85')](),path[_0xfaf2('0x59')](__dirname,_0xfaf2('0x9e'),_0x10b0ef['savename']),_0x370184]);return _0x10b0ef;}else{var _0x3fe47c=squel[_0xfaf2('0x73')]();_0x3fe47c[_0xfaf2('0x74')]('('+_0x4558c2[_0xfaf2('0x85')]()+')',_0xfaf2('0x9f'));_0x3fe47c[_0xfaf2('0x6c')](_0xfaf2('0xa0'),'count');_0x4558c2[_0xfaf2('0x21')](_0x5c1dac['limit']||_0x3bda03);_0x4558c2['offset'](_0x5c1dac[_0xfaf2('0x1f')]||0x0);return dbH[_0xfaf2('0xa1')]['query'](_0x3fe47c[_0xfaf2('0x85')](),{'type':dbH['sequelize'][_0xfaf2('0xa2')][_0xfaf2('0x86')]})[_0xfaf2('0x2a')](function(_0x29031a){if(!_0x29031a[_0xfaf2('0x3e')]){_0x274f5c=0x0;}else{_0x274f5c=_0x29031a[0x0][_0xfaf2('0x22')]||0x0;}return dbH['sequelize'][_0xfaf2('0x39')](_0x4558c2[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')][_0xfaf2('0x86')]});})[_0xfaf2('0x2a')](function(_0x453ab7){return{'rows':_0x453ab7||[],'count':_0x274f5c};});}});}exports[_0xfaf2('0xa3')]=function(_0x1d067a,_0x2a66e4){return runReport(_0x1d067a[_0xfaf2('0x4a')],_0x1d067a[_0xfaf2('0x39')],_0x1d067a[_0xfaf2('0x47')])[_0xfaf2('0x2a')](respondWithResult(_0x2a66e4,null))['catch'](handleError(_0x2a66e4,null));};exports[_0xfaf2('0xa4')]=runReport;exports[_0xfaf2('0x39')]=function(_0x44f585,_0x53b8b0){var _0x57cf1a=0xa;var _0x2a25a9=['join',_0xfaf2('0xa5'),_0xfaf2('0x5a'),'cross_join'];var _0x299f69={'SUM':'SUM(%s)','COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x164c28={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x512563=function(_0x31bd06){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),'IS\x20NOT\x20NULL',_0xfaf2('0x8b'),'IS\x20NOT\x20EMPTY'],_0x31bd06);};var _0x59484d=function(_0x52e7c8){if(!_0x52e7c8||!_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x405098='(',_0x3050d1=0x0;_0x3050d1<_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x3050d1+=0x1){_0x3050d1>0x0&&(_0x405098+='\x20'+_0x52e7c8[_0xfaf2('0x6a')]+'\x20');_0x405098+=_0x52e7c8[_0xfaf2('0x69')][_0x3050d1]['group']?_0x59484d(_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6b')]):_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6c')]+'\x20'+_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6d')]+(_0x512563(_0x52e7c8['rules'][_0x3050d1]['condition'])?'\x20'+_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6e')]:'');}return _0x405098+')';};var _0x2eda44={'where':{'id':_0x44f585[_0xfaf2('0x4a')]['id']}},_0x37a04c,_0x4868a7,_0x3bbb6a,_0x35bd7b,_0x7fbe67;_0x2eda44=_[_0xfaf2('0x45')]({},_0x2eda44,_0x44f585[_0xfaf2('0x47')]);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x2eda44)[_0xfaf2('0x2a')](function(_0x3ae28e){if(_0x3ae28e){_0x37a04c=_0x3ae28e;return _0x3ae28e[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0x5e54ef){if(_0x5e54ef){if(!_0x5e54ef[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))]['ValidationErrorItem'](_0xfaf2('0x71'),0x193);}_0x4868a7=_0x5e54ef;return db[_0xfaf2('0x8e')]['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x173782){if(_0x173782){_0x3bbb6a=_['keyBy'](_0x173782,'id');var _0x53bba4;var _0x48397c=squel[_0xfaf2('0x73')]();_0x48397c[_0xfaf2('0x74')](_0x37a04c['table']);for(var _0x3086bc=0x0;_0x3086bc<_0x4868a7['length'];_0x3086bc+=0x1){_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x76')]?_0x3bbb6a[_0x4868a7[_0x3086bc][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x4868a7[_0x3086bc][_0xfaf2('0x6c')];_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x78')]?_['replace'](_0x299f69[_0x4868a7[_0x3086bc][_0xfaf2('0x78')]],'%s',_0x53bba4):_0x53bba4;_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x164c28[_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]],'%s',_0x53bba4):_0x53bba4;if(_0x4868a7[_0x3086bc][_0xfaf2('0xa6')]){_0x48397c[_0xfaf2('0x6b')](_0x53bba4);}_0x4868a7[_0x3086bc]['orderBy']&&_0x48397c[_0xfaf2('0x40')](_0x53bba4,_0x4868a7[_0x3086bc]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x48397c[_0xfaf2('0x6c')](_0x53bba4,_0x4868a7[_0x3086bc][_0xfaf2('0x7d')]||_0x53bba4);}if(_0x37a04c[_0xfaf2('0x7e')]){_0x37a04c[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x7e')]);for(var _0x32779b=0x0;_0x32779b<_0x37a04c[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x32779b+=0x1){if(_0x37a04c['joins'][_0x32779b][_0xfaf2('0x36')]&&_['includes'](_0x2a25a9,_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')])&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]){_0x48397c[_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')]](_0x37a04c[_0xfaf2('0x7e')][_0x32779b]['foreignTable'],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x37a04c[_0xfaf2('0x75')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]));}}}if(_0x37a04c[_0xfaf2('0x83')]){_0x37a04c[_0xfaf2('0x83')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x83')]);_0x48397c[_0xfaf2('0x44')](_0x59484d(_0x37a04c[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x7fbe67=_0x48397c[_0xfaf2('0x84')]();_0x48397c['limit'](_0x57cf1a);_0x48397c['offset'](0x0);logger[_0xfaf2('0xa7')]('Limited\x20Query:',_0x48397c[_0xfaf2('0x85')]());return dbH[_0xfaf2('0xa1')][_0xfaf2('0x39')](_0x48397c[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')]['SELECT']});}})['then'](function(){return{'sql':_0x7fbe67[_0xfaf2('0x85')]()};})[_0xfaf2('0x2a')](respondWithResult(_0x53b8b0,null))[_0xfaf2('0x4e')](handleError(_0x53b8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d9ae339..f0296b3 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 _0x2b26=['path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xf7c71f,_0x14fcf2){var _0x2d0564=function(_0x2c565d){while(--_0x2c565d){_0xf7c71f['push'](_0xf7c71f['shift']());}};_0x2d0564(++_0x14fcf2);}(_0x2b26,0xbd));var _0x62b2=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2b26[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x62b2('0x0'));var util=require(_0x62b2('0x1'));var logger=require(_0x62b2('0x2'))(_0x62b2('0x3'));var moment=require('moment');var BPromise=require(_0x62b2('0x4'));var rp=require(_0x62b2('0x5'));var fs=require('fs');var path=require(_0x62b2('0x6'));var rimraf=require('rimraf');var config=require(_0x62b2('0x7'));var attributes=require(_0x62b2('0x8'));module[_0x62b2('0x9')]=function(_0x3c35f8,_0x16e9a0){return _0x3c35f8[_0x62b2('0xa')](_0x62b2('0xb'),attributes,{'tableName':_0x62b2('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebd8=['path','../../config/environment','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xebd8,0x164));var _0x8ebd=function(_0x566aff,_0x37fa7a){_0x566aff=_0x566aff-0x0;var _0x28ff10=_0xebd8[_0x566aff];return _0x28ff10;};'use strict';var _=require('lodash');var util=require(_0x8ebd('0x0'));var logger=require(_0x8ebd('0x1'))(_0x8ebd('0x2'));var moment=require('moment');var BPromise=require(_0x8ebd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ebd('0x4'));var rimraf=require('rimraf');var config=require(_0x8ebd('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x21f2f6,_0x41f227){return _0x21f2f6['define'](_0x8ebd('0x6'),attributes,{'tableName':_0x8ebd('0x7'),'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 648a2fc..a5f2b1e 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 _0x9ecd=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x9ecd,0x1cf));var _0xd9ec=function(_0x103841,_0x447d69){_0x103841=_0x103841-0x0;var _0x568b18=_0x9ecd[_0x103841];return _0x568b18;};'use strict';var _=require(_0xd9ec('0x0'));var util=require(_0xd9ec('0x1'));var moment=require(_0xd9ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ec('0x3'));var fs=require('fs');var Redis=require(_0xd9ec('0x4'));var db=require(_0xd9ec('0x5'))['db'];var utils=require(_0xd9ec('0x6'));var logger=require(_0xd9ec('0x7'))(_0xd9ec('0x8'));var config=require(_0xd9ec('0x9'));var jayson=require(_0xd9ec('0xa'));var client=jayson['client'][_0xd9ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ca1f4,_0x123c26,_0x1e825e){return new BPromise(function(_0x304089,_0xc06a60){return client[_0xd9ec('0xc')](_0x1ca1f4,_0x1e825e)[_0xd9ec('0xd')](function(_0x44e9c0){logger[_0xd9ec('0xe')](_0xd9ec('0xf'),_0x123c26,'request\x20sent');logger[_0xd9ec('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x123c26,_0xd9ec('0x11'),JSON[_0xd9ec('0x12')](_0x44e9c0));if(_0x44e9c0[_0xd9ec('0x13')]){if(_0x44e9c0['error'][_0xd9ec('0x14')]===0x1f4){logger[_0xd9ec('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x123c26,_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);return _0xc06a60(_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);}logger[_0xd9ec('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x123c26,_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);return _0x304089(_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);}else{logger[_0xd9ec('0xe')](_0xd9ec('0xf'),_0x123c26,_0xd9ec('0x11'));_0x304089(_0x44e9c0[_0xd9ec('0x16')][_0xd9ec('0x15')]);}})[_0xd9ec('0x17')](function(_0x4a3d52){logger[_0xd9ec('0x13')](_0xd9ec('0xf'),_0x123c26,_0x4a3d52);_0xc06a60(_0x4a3d52);});});}
\ No newline at end of file
+var _0x6776=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7a7e22,_0x5c8f17){var _0x57c703=function(_0x4268fb){while(--_0x4268fb){_0x7a7e22['push'](_0x7a7e22['shift']());}};_0x57c703(++_0x5c8f17);}(_0x6776,0xcc));var _0x6677=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0x6776[_0x5f49bc];return _0x44bbb9;};'use strict';var _=require(_0x6677('0x0'));var util=require(_0x6677('0x1'));var moment=require(_0x6677('0x2'));var BPromise=require(_0x6677('0x3'));var rs=require(_0x6677('0x4'));var fs=require('fs');var Redis=require(_0x6677('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6677('0x6'));var logger=require(_0x6677('0x7'))(_0x6677('0x8'));var config=require('../../config/environment');var jayson=require(_0x6677('0x9'));var client=jayson[_0x6677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20048f,_0xce23d6,_0x3d6ade){return new BPromise(function(_0x22ace7,_0x40766a){return client[_0x6677('0xb')](_0x20048f,_0x3d6ade)[_0x6677('0xc')](function(_0x3898a3){logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));logger[_0x6677('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xce23d6,_0x6677('0xf'),JSON[_0x6677('0x11')](_0x3898a3));if(_0x3898a3[_0x6677('0x12')]){if(_0x3898a3[_0x6677('0x12')][_0x6677('0x13')]===0x1f4){logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x40766a(_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);}logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x22ace7(_0x3898a3['error'][_0x6677('0x14')]);}else{logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));_0x22ace7(_0x3898a3[_0x6677('0x15')][_0x6677('0x14')]);}})[_0x6677('0x16')](function(_0x3c1a80){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce23d6,_0x3c1a80);_0x40766a(_0x3c1a80);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8dcd338..483552e 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 _0x9027=['isAuthenticated','index','/:id','show','get','/:id/preview','preview','run','/:id/query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x268882,_0xb2de98){var _0x2d800d=function(_0x430b2d){while(--_0x430b2d){_0x268882['push'](_0x268882['shift']());}};_0x2d800d(++_0xb2de98);}(_0x9027,0x151));var _0x7902=function(_0x211783,_0x1437a4){_0x211783=_0x211783-0x0;var _0x5f29ed=_0x9027[_0x211783];return _0x5f29ed;};'use strict';var multer=require(_0x7902('0x0'));var util=require(_0x7902('0x1'));var path=require('path');var timeout=require(_0x7902('0x2'));var express=require('express');var router=express[_0x7902('0x3')]();var fs_extra=require(_0x7902('0x4'));var auth=require(_0x7902('0x5'));var interaction=require(_0x7902('0x6'));var config=require(_0x7902('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x7902('0x8')](),controller[_0x7902('0x9')]);router['get'](_0x7902('0xa'),auth[_0x7902('0x8')](),controller[_0x7902('0xb')]);router[_0x7902('0xc')](_0x7902('0xd'),auth[_0x7902('0x8')](),controller[_0x7902('0xe')]);router['get']('/:id/run',auth[_0x7902('0x8')](),controller[_0x7902('0xf')]);router[_0x7902('0xc')](_0x7902('0x10'),auth[_0x7902('0x8')](),controller['query']);router[_0x7902('0x11')]('/',auth[_0x7902('0x8')](),controller[_0x7902('0x12')]);router['put']('/:id',auth[_0x7902('0x8')](),controller[_0x7902('0x13')]);router[_0x7902('0x14')]('/:id',auth[_0x7902('0x8')](),controller[_0x7902('0x15')]);module[_0x7902('0x16')]=router;
\ No newline at end of file
+var _0x5086=['create','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','show','preview','run','query'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x5086,0x16d));var _0x6508=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5086[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6508('0x0'));var util=require('util');var path=require(_0x6508('0x1'));var timeout=require(_0x6508('0x2'));var express=require(_0x6508('0x3'));var router=express[_0x6508('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6508('0x5'));var interaction=require(_0x6508('0x6'));var config=require(_0x6508('0x7'));var controller=require(_0x6508('0x8'));router['get']('/',auth[_0x6508('0x9')](),controller['index']);router[_0x6508('0xa')]('/:id',auth[_0x6508('0x9')](),controller[_0x6508('0xb')]);router[_0x6508('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x6508('0xc')]);router[_0x6508('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x6508('0xd')]);router[_0x6508('0xa')]('/:id/query',auth[_0x6508('0x9')](),controller[_0x6508('0xe')]);router['post']('/',auth[_0x6508('0x9')](),controller[_0x6508('0xf')]);router['put'](_0x6508('0x10'),auth[_0x6508('0x9')](),controller[_0x6508('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6508('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index ea02b39..dd784ab 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x57dde5,_0x45fe38){var _0x18d519=function(_0x1955bf){while(--_0x1955bf){_0x57dde5['push'](_0x57dde5['shift']());}};_0x18d519(++_0x45fe38);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ff4a7,_0xe37347){_0x2ff4a7=_0x2ff4a7-0x0;var _0xc01c3f=_0x8ef6[_0x2ff4a7];return _0xc01c3f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8180fca..4aadc35 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x125d23,_0x1ab0c4){var _0x13c0b5=function(_0x560da6){while(--_0x560da6){_0x125d23['push'](_0x125d23['shift']());}};_0x13c0b5(++_0x1ab0c4);}(_0x1967,0x173));var _0x7196=function(_0x4fe049,_0x52bedb){_0x4fe049=_0x4fe049-0x0;var _0x1946b5=_0x1967[_0x4fe049];return _0x1946b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x4819,0xcd));var _0x9481=function(_0x30505b,_0x3b6c06){_0x30505b=_0x30505b-0x0;var _0x4f7466=_0x4819[_0x30505b];return _0x4f7466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5e4e1c1..ba272ec 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 _0x2441=['define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x20d290,_0x40fc11){var _0x2bfa8f=function(_0x2498e0){while(--_0x2498e0){_0x20d290['push'](_0x20d290['shift']());}};_0x2bfa8f(++_0x40fc11);}(_0x2441,0x1dc));var _0x1244=function(_0x4173e8,_0x19a95f){_0x4173e8=_0x4173e8-0x0;var _0x44fd49=_0x2441[_0x4173e8];return _0x44fd49;};'use strict';var _=require('lodash');var util=require(_0x1244('0x0'));var logger=require(_0x1244('0x1'))('api');var moment=require(_0x1244('0x2'));var BPromise=require('bluebird');var rp=require(_0x1244('0x3'));var fs=require('fs');var path=require(_0x1244('0x4'));var rimraf=require(_0x1244('0x5'));var config=require(_0x1244('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1244('0x7')]=function(_0x1c19a3,_0x46c71b){return _0x1c19a3[_0x1244('0x8')](_0x1244('0x9'),attributes,{'tableName':_0x1244('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d1d=['request-promise','rimraf','../../config/environment','define','analytics_default_reports','util','../../config/logger','moment','bluebird'];(function(_0x174c4d,_0x3771df){var _0x5a23c7=function(_0x5034c7){while(--_0x5034c7){_0x174c4d['push'](_0x174c4d['shift']());}};_0x5a23c7(++_0x3771df);}(_0x1d1d,0xcb));var _0xd1d1=function(_0x178015,_0x4bcd41){_0x178015=_0x178015-0x0;var _0x5ef3c5=_0x1d1d[_0x178015];return _0x5ef3c5;};'use strict';var _=require('lodash');var util=require(_0xd1d1('0x0'));var logger=require(_0xd1d1('0x1'))('api');var moment=require(_0xd1d1('0x2'));var BPromise=require(_0xd1d1('0x3'));var rp=require(_0xd1d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d1('0x5'));var config=require(_0xd1d1('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x1d1294,_0x1f256f){return _0x1d1294[_0xd1d1('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xd1d1('0x8'),'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 b081245..7dad965 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 _0xa9f2=['code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e18a9,_0x2ae8c2){var _0x39d8d7=function(_0x4729ef){while(--_0x4729ef){_0x2e18a9['push'](_0x2e18a9['shift']());}};_0x39d8d7(++_0x2ae8c2);}(_0xa9f2,0x10c));var _0x2a9f=function(_0x5b2ae5,_0x1c24d9){_0x5b2ae5=_0x5b2ae5-0x0;var _0x5d5216=_0xa9f2[_0x5b2ae5];return _0x5d5216;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a9f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a9f('0x1'));var db=require(_0x2a9f('0x2'))['db'];var utils=require(_0x2a9f('0x3'));var logger=require(_0x2a9f('0x4'))(_0x2a9f('0x5'));var config=require(_0x2a9f('0x6'));var jayson=require(_0x2a9f('0x7'));var client=jayson[_0x2a9f('0x8')][_0x2a9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24f399,_0xa555e3,_0x257602){return new BPromise(function(_0x518504,_0x5d1505){return client[_0x2a9f('0xa')](_0x24f399,_0x257602)[_0x2a9f('0xb')](function(_0x15253f){logger[_0x2a9f('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,'request\x20sent');logger[_0x2a9f('0xd')](_0x2a9f('0xe'),_0xa555e3,_0x2a9f('0xf'),JSON[_0x2a9f('0x10')](_0x15253f));if(_0x15253f['error']){if(_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x12')]===0x1f4){logger[_0x2a9f('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);return _0x5d1505(_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);return _0x518504(_0x15253f['error']['message']);}else{logger[_0x2a9f('0xc')](_0x2a9f('0x14'),_0xa555e3,_0x2a9f('0xf'));_0x518504(_0x15253f[_0x2a9f('0x15')][_0x2a9f('0x13')]);}})['catch'](function(_0x29c10b){logger[_0x2a9f('0x11')](_0x2a9f('0x14'),_0xa555e3,_0x29c10b);_0x5d1505(_0x29c10b);});});}
\ No newline at end of file
+var _0xa797=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ff733,_0x5f2825){var _0x156deb=function(_0x1f684d){while(--_0x1f684d){_0x2ff733['push'](_0x2ff733['shift']());}};_0x156deb(++_0x5f2825);}(_0xa797,0x127));var _0x7a79=function(_0x3b36af,_0x3556e8){_0x3b36af=_0x3b36af-0x0;var _0x578b1c=_0xa797[_0x3b36af];return _0x578b1c;};'use strict';var _=require(_0x7a79('0x0'));var util=require(_0x7a79('0x1'));var moment=require(_0x7a79('0x2'));var BPromise=require(_0x7a79('0x3'));var rs=require(_0x7a79('0x4'));var fs=require('fs');var Redis=require(_0x7a79('0x5'));var db=require(_0x7a79('0x6'))['db'];var utils=require(_0x7a79('0x7'));var logger=require('../../config/logger')(_0x7a79('0x8'));var config=require(_0x7a79('0x9'));var jayson=require(_0x7a79('0xa'));var client=jayson['client'][_0x7a79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48e17a,_0x4d7f0e,_0x5cf034){return new BPromise(function(_0x3429ba,_0x25875b){return client[_0x7a79('0xc')](_0x48e17a,_0x5cf034)['then'](function(_0xcc9a99){logger[_0x7a79('0xd')](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));logger[_0x7a79('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d7f0e,'request\x20sent',JSON['stringify'](_0xcc9a99));if(_0xcc9a99[_0x7a79('0x11')]){if(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x12')]===0x1f4){logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99['error']['message']);return _0x25875b(_0xcc9a99[_0x7a79('0x11')]['message']);}logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);return _0x3429ba(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);}else{logger['info'](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));_0x3429ba(_0xcc9a99[_0x7a79('0x14')][_0x7a79('0x13')]);}})[_0x7a79('0x15')](function(_0xd22eb3){logger[_0x7a79('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d7f0e,_0xd22eb3);_0x25875b(_0xd22eb3);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a2124af..7572d30 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 _0x5c7b=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','preview','run','/:id/query','query','post'];(function(_0x4c34c6,_0x1240d6){var _0x2f0192=function(_0x1ea197){while(--_0x1ea197){_0x4c34c6['push'](_0x4c34c6['shift']());}};_0x2f0192(++_0x1240d6);}(_0x5c7b,0x9c));var _0xb5c7=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5c7b[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0xb5c7('0x0'));var path=require(_0xb5c7('0x1'));var timeout=require(_0xb5c7('0x2'));var express=require(_0xb5c7('0x3'));var router=express[_0xb5c7('0x4')]();var fs_extra=require(_0xb5c7('0x5'));var auth=require(_0xb5c7('0x6'));var interaction=require(_0xb5c7('0x7'));var config=require(_0xb5c7('0x8'));var controller=require(_0xb5c7('0x9'));router[_0xb5c7('0xa')]('/',auth[_0xb5c7('0xb')](),controller['index']);router[_0xb5c7('0xa')](_0xb5c7('0xc'),auth['isAuthenticated'](),controller[_0xb5c7('0xd')]);router[_0xb5c7('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb5c7('0xe')]);router[_0xb5c7('0xa')]('/:id/run',auth[_0xb5c7('0xb')](),controller[_0xb5c7('0xf')]);router[_0xb5c7('0xa')](_0xb5c7('0x10'),auth['isAuthenticated'](),controller[_0xb5c7('0x11')]);router[_0xb5c7('0x12')]('/',auth[_0xb5c7('0xb')](),controller[_0xb5c7('0x13')]);router[_0xb5c7('0x14')](_0xb5c7('0xc'),auth['isAuthenticated'](),controller[_0xb5c7('0x15')]);router[_0xb5c7('0x16')](_0xb5c7('0xc'),auth[_0xb5c7('0xb')](),controller[_0xb5c7('0x17')]);module[_0xb5c7('0x18')]=router;
\ No newline at end of file
+var _0xfb5b=['destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put'];(function(_0x1bfd2d,_0x18fca5){var _0x7b1809=function(_0x59561f){while(--_0x59561f){_0x1bfd2d['push'](_0x1bfd2d['shift']());}};_0x7b1809(++_0x18fca5);}(_0xfb5b,0x89));var _0xbfb5=function(_0x4c6c3f,_0x54c1ee){_0x4c6c3f=_0x4c6c3f-0x0;var _0x3f0d7c=_0xfb5b[_0x4c6c3f];return _0x3f0d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbfb5('0x0'));var timeout=require(_0xbfb5('0x1'));var express=require('express');var router=express[_0xbfb5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfb5('0x3'));var config=require(_0xbfb5('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xbfb5('0x5')]('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x7')]);router[_0xbfb5('0x5')](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x9')]);router[_0xbfb5('0x5')](_0xbfb5('0xa'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xb')]);router['get'](_0xbfb5('0xc'),auth[_0xbfb5('0x6')](),controller['run']);router[_0xbfb5('0x5')](_0xbfb5('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xe')]);router[_0xbfb5('0xf')](_0xbfb5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 71e8c57..948df9b 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 _0x51d9=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv'];(function(_0x531ba8,_0x54f49b){var _0x5e9a15=function(_0x22534c){while(--_0x22534c){_0x531ba8['push'](_0x531ba8['shift']());}};_0x5e9a15(++_0x54f49b);}(_0x51d9,0x145));var _0x951d=function(_0x4632ea,_0x10082c){_0x4632ea=_0x4632ea-0x0;var _0x368f3c=_0x51d9[_0x4632ea];return _0x368f3c;};'use strict';var Sequelize=require(_0x951d('0x0'));var moment=require('moment');module[_0x951d('0x1')]={'name':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x951d('0x3')](_0x951d('0x4'),'pdf',_0x951d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x951d('0x6')]},'endDate':{'type':Sequelize[_0x951d('0x6')]},'status':{'type':Sequelize[_0x951d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x951d('0x7'),_0x951d('0x8')),'allowNull':![],'defaultValue':_0x951d('0x7')},'reportId':{'type':Sequelize[_0x951d('0x9')](0xb)[_0x951d('0xa')]},'reportType':{'type':Sequelize[_0x951d('0x2')]}};
\ No newline at end of file
+var _0x80c6=['STRING','ENUM','xlsx','DATE','Loading','scheduled','manual','sequelize','moment','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x80c6,0x151));var _0x680c=function(_0x32453a,_0x3ed27d){_0x32453a=_0x32453a-0x0;var _0x2182bb=_0x80c6[_0x32453a];return _0x2182bb;};'use strict';var Sequelize=require(_0x680c('0x0'));var moment=require(_0x680c('0x1'));module[_0x680c('0x2')]={'name':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x680c('0x4')]('csv','pdf',_0x680c('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x680c('0x6')]},'endDate':{'type':Sequelize[_0x680c('0x6')]},'status':{'type':Sequelize[_0x680c('0x3')],'defaultValue':_0x680c('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x680c('0x8')),'allowNull':![],'defaultValue':_0x680c('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x680c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e7a1d23..d36722a 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 _0xeba1=['role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','existsSync','join','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','output','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','fields','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0xeba1,0x13c));var _0x1eba=function(_0x192ec3,_0x1d17ef){_0x192ec3=_0x192ec3-0x0;var _0x852295=_0xeba1[_0x192ec3];return _0x852295;};'use strict';var emlformat=require(_0x1eba('0x0'));var rimraf=require(_0x1eba('0x1'));var zipdir=require(_0x1eba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1eba('0x3'));var moment=require(_0x1eba('0x4'));var BPromise=require(_0x1eba('0x5'));var Mustache=require('mustache');var util=require(_0x1eba('0x6'));var path=require(_0x1eba('0x7'));var sox=require(_0x1eba('0x8'));var csv=require(_0x1eba('0x9'));var ejs=require(_0x1eba('0xa'));var fs=require('fs');var fs_extra=require(_0x1eba('0xb'));var _=require('lodash');var squel=require(_0x1eba('0xc'));var crypto=require(_0x1eba('0xd'));var jsforce=require(_0x1eba('0xe'));var deskjs=require(_0x1eba('0xf'));var toCsv=require(_0x1eba('0x9'));var querystring=require(_0x1eba('0x10'));var Papa=require('papaparse');var Redis=require(_0x1eba('0x11'));var authService=require(_0x1eba('0x12'));var qs=require(_0x1eba('0x13'));var as=require(_0x1eba('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1eba('0x15'))('api');var utils=require(_0x1eba('0x16'));var config=require(_0x1eba('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2934e9,_0x1437f2){_0x1437f2=_0x1437f2||0xcc;return function(_0x469216){if(_0x469216){return _0x2934e9[_0x1eba('0x18')](_0x1437f2);}return _0x2934e9['status'](_0x1437f2)[_0x1eba('0x19')]();};}function respondWithResult(_0x2bcd55,_0x5cedbe){_0x5cedbe=_0x5cedbe||0xc8;return function(_0x3af96c){if(_0x3af96c){return _0x2bcd55[_0x1eba('0x1a')](_0x5cedbe)['json'](_0x3af96c);}};}function respondWithFilteredResult(_0x31ab5b,_0x2200ae){return function(_0x13c100){if(_0x13c100){var _0x58252a=typeof _0x2200ae[_0x1eba('0x1b')]===_0x1eba('0x1c')&&typeof _0x2200ae['limit']===_0x1eba('0x1c');var _0x588525=_0x13c100[_0x1eba('0x1d')];var _0x45e6ce=_0x58252a?0x0:_0x2200ae[_0x1eba('0x1b')];var _0x41115c=_0x58252a?_0x13c100[_0x1eba('0x1d')]:_0x2200ae[_0x1eba('0x1b')]+_0x2200ae[_0x1eba('0x1e')];var _0x46b125;if(_0x41115c>=_0x588525){_0x41115c=_0x588525;_0x46b125=0xc8;}else{_0x46b125=0xce;}_0x31ab5b['status'](_0x46b125);return _0x31ab5b[_0x1eba('0x1f')](_0x1eba('0x20'),_0x45e6ce+'-'+_0x41115c+'/'+_0x588525)[_0x1eba('0x21')](_0x13c100);}return null;};}function patchUpdates(_0x463842){return function(_0x14132c){try{jsonpatch[_0x1eba('0x22')](_0x14132c,_0x463842,!![]);}catch(_0x4f5374){return BPromise[_0x1eba('0x23')](_0x4f5374);}return _0x14132c[_0x1eba('0x24')]();};}function saveUpdates(_0x544418,_0x3393d7){return function(_0x15ca86){if(_0x15ca86){return _0x15ca86['update'](_0x544418)[_0x1eba('0x25')](function(_0x157cce){return _0x157cce;});}return null;};}function removeEntity(_0x1a77d0,_0x132577){return function(_0x330bdf){if(_0x330bdf){return _0x330bdf[_0x1eba('0x26')]()['then'](function(){var _0x5d18bb=_0x330bdf['get']({'plain':!![]});var _0x1aaba1=_0x1eba('0x27');return db[_0x1eba('0x28')][_0x1eba('0x26')]({'where':{'type':_0x1aaba1,'resourceId':_0x5d18bb['id']}})[_0x1eba('0x25')](function(){return _0x330bdf;});})['then'](function(){_0x1a77d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ebc77,_0x12262b){return function(_0x1d393b){if(!_0x1d393b){_0x5ebc77[_0x1eba('0x18')](0x194);}return _0x1d393b;};}function handleError(_0x24459d,_0x27dfaa){_0x27dfaa=_0x27dfaa||0x1f4;return function(_0x2bd39f){logger[_0x1eba('0x29')](_0x2bd39f[_0x1eba('0x2a')]);if(_0x2bd39f[_0x1eba('0x2b')]){delete _0x2bd39f[_0x1eba('0x2b')];}_0x24459d[_0x1eba('0x1a')](_0x27dfaa)[_0x1eba('0x2c')](_0x2bd39f);};}exports[_0x1eba('0x2d')]=function(_0x3e452b,_0x3b9c9f){var _0x247aa2={},_0xdad81c={},_0x1a373d={'count':0x0,'rows':[]};var _0x43f06f=_[_0x1eba('0x2e')](db[_0x1eba('0x2f')]['rawAttributes'],function(_0x5b1608){return{'name':_0x5b1608[_0x1eba('0x30')],'type':_0x5b1608[_0x1eba('0x31')][_0x1eba('0x32')]};});_0xdad81c[_0x1eba('0x33')]=_[_0x1eba('0x2e')](_0x43f06f,_0x1eba('0x2b'));_0xdad81c[_0x1eba('0x34')]=_['keys'](_0x3e452b[_0x1eba('0x34')]);_0xdad81c[_0x1eba('0x35')]=_[_0x1eba('0x36')](_0xdad81c[_0x1eba('0x33')],_0xdad81c[_0x1eba('0x34')]);_0x247aa2['attributes']=_[_0x1eba('0x36')](_0xdad81c[_0x1eba('0x33')],qs['fields'](_0x3e452b[_0x1eba('0x34')]['fields']));_0x247aa2[_0x1eba('0x37')]=_0x247aa2['attributes']['length']?_0x247aa2[_0x1eba('0x37')]:_0xdad81c[_0x1eba('0x33')];if(!_0x3e452b['query'][_0x1eba('0x38')](_0x1eba('0x39'))){_0x247aa2['limit']=qs[_0x1eba('0x1e')](_0x3e452b[_0x1eba('0x34')][_0x1eba('0x1e')]);_0x247aa2[_0x1eba('0x1b')]=qs[_0x1eba('0x1b')](_0x3e452b[_0x1eba('0x34')]['offset']);}_0x247aa2[_0x1eba('0x3a')]=qs['sort'](_0x3e452b[_0x1eba('0x34')][_0x1eba('0x3b')]);_0x247aa2[_0x1eba('0x3c')]=qs[_0x1eba('0x35')](_[_0x1eba('0x3d')](_0x3e452b[_0x1eba('0x34')],_0xdad81c[_0x1eba('0x35')]),_0x43f06f);if(_0x3e452b['query'][_0x1eba('0x3e')]){_0x247aa2[_0x1eba('0x3c')]=_[_0x1eba('0x3f')](_0x247aa2[_0x1eba('0x3c')],{'$or':_[_0x1eba('0x2e')](_0x43f06f,function(_0x7d0860){if(_0x7d0860['type']!==_0x1eba('0x40')){var _0x1bf926={};_0x1bf926[_0x7d0860[_0x1eba('0x2b')]]={'$like':'%'+_0x3e452b[_0x1eba('0x34')][_0x1eba('0x3e')]+'%'};return _0x1bf926;}})});}_0x247aa2=_[_0x1eba('0x3f')]({},_0x247aa2,_0x3e452b[_0x1eba('0x41')]);var _0x11b32a={'where':_0x247aa2[_0x1eba('0x3c')]};return db[_0x1eba('0x2f')][_0x1eba('0x1d')](_0x11b32a)[_0x1eba('0x25')](function(_0x25c179){_0x1a373d[_0x1eba('0x1d')]=_0x25c179;if(_0x3e452b[_0x1eba('0x34')][_0x1eba('0x42')]){_0x247aa2[_0x1eba('0x43')]=[{'all':!![]}];}return db[_0x1eba('0x2f')][_0x1eba('0x44')](_0x247aa2);})[_0x1eba('0x25')](function(_0x1a35b2){_0x1a373d['rows']=_0x1a35b2;return _0x1a373d;})[_0x1eba('0x25')](respondWithFilteredResult(_0x3b9c9f,_0x247aa2))[_0x1eba('0x45')](handleError(_0x3b9c9f,null));};exports['show']=function(_0x1d8e05,_0x5abb60){var _0x284b0e={'raw':!![],'where':{'id':_0x1d8e05[_0x1eba('0x46')]['id']}},_0x2f1b75={};_0x2f1b75[_0x1eba('0x33')]=_[_0x1eba('0x47')](db[_0x1eba('0x2f')][_0x1eba('0x48')]);_0x2f1b75['query']=_['keys'](_0x1d8e05[_0x1eba('0x34')]);_0x2f1b75[_0x1eba('0x35')]=_['intersection'](_0x2f1b75[_0x1eba('0x33')],_0x2f1b75[_0x1eba('0x34')]);_0x284b0e['attributes']=_['intersection'](_0x2f1b75['model'],qs[_0x1eba('0x49')](_0x1d8e05['query']['fields']));_0x284b0e[_0x1eba('0x37')]=_0x284b0e['attributes'][_0x1eba('0x4a')]?_0x284b0e['attributes']:_0x2f1b75['model'];if(_0x1d8e05['query'][_0x1eba('0x42')]){_0x284b0e[_0x1eba('0x43')]=[{'all':!![]}];}_0x284b0e=_[_0x1eba('0x3f')]({},_0x284b0e,_0x1d8e05[_0x1eba('0x41')]);return db[_0x1eba('0x2f')][_0x1eba('0x4b')](_0x284b0e)[_0x1eba('0x25')](handleEntityNotFound(_0x5abb60,null))[_0x1eba('0x25')](respondWithResult(_0x5abb60,null))['catch'](handleError(_0x5abb60,null));};exports['create']=function(_0x53af7c,_0x429cb2){return db[_0x1eba('0x2f')][_0x1eba('0x4c')](_0x53af7c[_0x1eba('0x4d')],{})['then'](function(_0x35052c){var _0x1c461b=_0x53af7c['user'][_0x1eba('0x4e')]({'plain':!![]});if(!_0x1c461b)throw new Error(_0x1eba('0x4f'));if(_0x1c461b[_0x1eba('0x50')]===_0x1eba('0x51')){var _0x2de09a=_0x35052c[_0x1eba('0x4e')]({'plain':!![]});var _0x12ce50=_0x1eba('0x27');return db[_0x1eba('0x52')][_0x1eba('0x4b')]({'where':{'name':_0x12ce50,'userProfileId':_0x1c461b[_0x1eba('0x53')]},'raw':!![]})[_0x1eba('0x25')](function(_0x587917){if(_0x587917&&_0x587917[_0x1eba('0x54')]===0x0){return db[_0x1eba('0x28')][_0x1eba('0x4c')]({'name':_0x2de09a[_0x1eba('0x2b')],'resourceId':_0x2de09a['id'],'type':_0x587917['name'],'sectionId':_0x587917['id']},{})[_0x1eba('0x25')](function(){return _0x35052c;});}else{return _0x35052c;}})['catch'](function(_0x4ca822){logger[_0x1eba('0x29')](_0x1eba('0x55'),_0x4ca822);throw _0x4ca822;});}return _0x35052c;})[_0x1eba('0x25')](respondWithResult(_0x429cb2,0xc9))[_0x1eba('0x45')](handleError(_0x429cb2,null));};exports[_0x1eba('0x56')]=function(_0x5ccc7a,_0x5a6f70){if(_0x5ccc7a[_0x1eba('0x4d')]['id']){delete _0x5ccc7a[_0x1eba('0x4d')]['id'];}return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x5ccc7a[_0x1eba('0x46')]['id']}})[_0x1eba('0x25')](handleEntityNotFound(_0x5a6f70,null))['then'](saveUpdates(_0x5ccc7a[_0x1eba('0x4d')],null))[_0x1eba('0x25')](respondWithResult(_0x5a6f70,null))[_0x1eba('0x45')](handleError(_0x5a6f70,null));};exports['destroy']=function(_0x3ecddd,_0x3d6d3d){return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x3ecddd[_0x1eba('0x46')]['id']}})[_0x1eba('0x25')](handleEntityNotFound(_0x3d6d3d,null))[_0x1eba('0x25')](removeEntity(_0x3d6d3d,null))[_0x1eba('0x45')](handleError(_0x3d6d3d,null));};exports[_0x1eba('0x57')]=function(_0x3fca1b,_0x425ff1,_0x3b29b0){return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x3fca1b[_0x1eba('0x46')]['id']},'attributes':[_0x1eba('0x2b'),_0x1eba('0x58'),'savename','output'],'raw':!![]})[_0x1eba('0x25')](handleEntityNotFound(_0x425ff1,null))[_0x1eba('0x25')](function(_0x45896d){if(_0x45896d){if(!fs[_0x1eba('0x59')](path[_0x1eba('0x5a')](config['root'],_0x1eba('0x5b'),_0x45896d[_0x1eba('0x5c')]))){throw new db[(_0x1eba('0x5d'))]['ValidationError'](_0x1eba('0x5e'));}if(_0x3fca1b[_0x1eba('0x34')][_0x1eba('0x5f')]){return _0x425ff1[_0x1eba('0x18')](0xc8);}return _0x425ff1[_0x1eba('0x57')](path['join'](config[_0x1eba('0x60')],_0x1eba('0x5b'),_0x45896d[_0x1eba('0x5c')]),util['format']('%s.%s',_0x45896d[_0x1eba('0x58')]||_0x45896d['name'],_0x45896d[_0x1eba('0x61')][_0x1eba('0x62')]()));}})[_0x1eba('0x45')](handleError(_0x425ff1,null));};
\ No newline at end of file
+var _0xaee4=['save','get','ExtractedReports','UserProfileResource','destroy','then','name','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject'];(function(_0x308ca1,_0xf8eb57){var _0x1c589e=function(_0x1489b7){while(--_0x1489b7){_0x308ca1['push'](_0x308ca1['shift']());}};_0x1c589e(++_0xf8eb57);}(_0xaee4,0xf9));var _0x4aee=function(_0x4f869b,_0x457e62){_0x4f869b=_0x4f869b-0x0;var _0x456ff7=_0xaee4[_0x4f869b];return _0x456ff7;};'use strict';var emlformat=require(_0x4aee('0x0'));var rimraf=require(_0x4aee('0x1'));var zipdir=require(_0x4aee('0x2'));var jsonpatch=require(_0x4aee('0x3'));var rp=require(_0x4aee('0x4'));var moment=require(_0x4aee('0x5'));var BPromise=require(_0x4aee('0x6'));var Mustache=require('mustache');var util=require(_0x4aee('0x7'));var path=require(_0x4aee('0x8'));var sox=require(_0x4aee('0x9'));var csv=require(_0x4aee('0xa'));var ejs=require(_0x4aee('0xb'));var fs=require('fs');var fs_extra=require(_0x4aee('0xc'));var _=require('lodash');var squel=require(_0x4aee('0xd'));var crypto=require(_0x4aee('0xe'));var jsforce=require(_0x4aee('0xf'));var deskjs=require(_0x4aee('0x10'));var toCsv=require(_0x4aee('0xa'));var querystring=require('querystring');var Papa=require(_0x4aee('0x11'));var Redis=require(_0x4aee('0x12'));var authService=require(_0x4aee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aee('0x14'));var logger=require(_0x4aee('0x15'))(_0x4aee('0x16'));var utils=require(_0x4aee('0x17'));var config=require(_0x4aee('0x18'));var licenseUtil=require(_0x4aee('0x19'));var db=require(_0x4aee('0x1a'))['db'];function respondWithStatusCode(_0x3b1c17,_0x291c95){_0x291c95=_0x291c95||0xcc;return function(_0x3585bd){if(_0x3585bd){return _0x3b1c17[_0x4aee('0x1b')](_0x291c95);}return _0x3b1c17[_0x4aee('0x1c')](_0x291c95)['end']();};}function respondWithResult(_0x3b9193,_0x20f621){_0x20f621=_0x20f621||0xc8;return function(_0x54cddf){if(_0x54cddf){return _0x3b9193[_0x4aee('0x1c')](_0x20f621)[_0x4aee('0x1d')](_0x54cddf);}};}function respondWithFilteredResult(_0x45b3cf,_0xfc48ed){return function(_0x5a45df){if(_0x5a45df){var _0x47c357=typeof _0xfc48ed[_0x4aee('0x1e')]==='undefined'&&typeof _0xfc48ed[_0x4aee('0x1f')]==='undefined';var _0x3d4028=_0x5a45df[_0x4aee('0x20')];var _0x44daf5=_0x47c357?0x0:_0xfc48ed[_0x4aee('0x1e')];var _0x1c35df=_0x47c357?_0x5a45df[_0x4aee('0x20')]:_0xfc48ed[_0x4aee('0x1e')]+_0xfc48ed[_0x4aee('0x1f')];var _0x3474d0;if(_0x1c35df>=_0x3d4028){_0x1c35df=_0x3d4028;_0x3474d0=0xc8;}else{_0x3474d0=0xce;}_0x45b3cf[_0x4aee('0x1c')](_0x3474d0);return _0x45b3cf['set'](_0x4aee('0x21'),_0x44daf5+'-'+_0x1c35df+'/'+_0x3d4028)[_0x4aee('0x1d')](_0x5a45df);}return null;};}function patchUpdates(_0xdeb0ba){return function(_0x54bb91){try{jsonpatch[_0x4aee('0x22')](_0x54bb91,_0xdeb0ba,!![]);}catch(_0x92666d){return BPromise[_0x4aee('0x23')](_0x92666d);}return _0x54bb91[_0x4aee('0x24')]();};}function saveUpdates(_0x200ea0,_0x39a659){return function(_0x1697d3){if(_0x1697d3){return _0x1697d3['update'](_0x200ea0)['then'](function(_0x247a72){return _0x247a72;});}return null;};}function removeEntity(_0x4f14af,_0xd2efc0){return function(_0x1fa8f9){if(_0x1fa8f9){return _0x1fa8f9['destroy']()['then'](function(){var _0x4f3c9b=_0x1fa8f9[_0x4aee('0x25')]({'plain':!![]});var _0xc7c083=_0x4aee('0x26');return db[_0x4aee('0x27')][_0x4aee('0x28')]({'where':{'type':_0xc7c083,'resourceId':_0x4f3c9b['id']}})['then'](function(){return _0x1fa8f9;});})[_0x4aee('0x29')](function(){_0x4f14af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dca55,_0x4fd286){return function(_0x19182f){if(!_0x19182f){_0x2dca55[_0x4aee('0x1b')](0x194);}return _0x19182f;};}function handleError(_0x47deab,_0xab9eb4){_0xab9eb4=_0xab9eb4||0x1f4;return function(_0x322bfa){logger['error'](_0x322bfa['stack']);if(_0x322bfa[_0x4aee('0x2a')]){delete _0x322bfa['name'];}_0x47deab[_0x4aee('0x1c')](_0xab9eb4)['send'](_0x322bfa);};}exports[_0x4aee('0x2b')]=function(_0x204b7e,_0x219a46){var _0x61efd1={},_0x263d98={},_0x562c0f={'count':0x0,'rows':[]};var _0x756ea8=_[_0x4aee('0x2c')](db[_0x4aee('0x2d')][_0x4aee('0x2e')],function(_0x348640){return{'name':_0x348640['fieldName'],'type':_0x348640['type'][_0x4aee('0x2f')]};});_0x263d98[_0x4aee('0x30')]=_[_0x4aee('0x2c')](_0x756ea8,_0x4aee('0x2a'));_0x263d98[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x204b7e[_0x4aee('0x31')]);_0x263d98['filters']=_['intersection'](_0x263d98[_0x4aee('0x30')],_0x263d98[_0x4aee('0x31')]);_0x61efd1[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x263d98[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x204b7e[_0x4aee('0x31')]['fields']));_0x61efd1[_0x4aee('0x33')]=_0x61efd1['attributes'][_0x4aee('0x36')]?_0x61efd1['attributes']:_0x263d98[_0x4aee('0x30')];if(!_0x204b7e['query'][_0x4aee('0x37')]('nolimit')){_0x61efd1[_0x4aee('0x1f')]=qs[_0x4aee('0x1f')](_0x204b7e['query'][_0x4aee('0x1f')]);_0x61efd1[_0x4aee('0x1e')]=qs[_0x4aee('0x1e')](_0x204b7e[_0x4aee('0x31')][_0x4aee('0x1e')]);}_0x61efd1[_0x4aee('0x38')]=qs['sort'](_0x204b7e['query']['sort']);_0x61efd1[_0x4aee('0x39')]=qs[_0x4aee('0x3a')](_[_0x4aee('0x3b')](_0x204b7e['query'],_0x263d98[_0x4aee('0x3a')]),_0x756ea8);if(_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]){_0x61efd1['where']=_[_0x4aee('0x3d')](_0x61efd1[_0x4aee('0x39')],{'$or':_['map'](_0x756ea8,function(_0x45e6ce){if(_0x45e6ce[_0x4aee('0x3e')]!==_0x4aee('0x3f')){var _0xdaf027={};_0xdaf027[_0x45e6ce[_0x4aee('0x2a')]]={'$like':'%'+_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]+'%'};return _0xdaf027;}})});}_0x61efd1=_['merge']({},_0x61efd1,_0x204b7e[_0x4aee('0x40')]);var _0x3823ba={'where':_0x61efd1[_0x4aee('0x39')]};return db['AnalyticExtractedReport'][_0x4aee('0x20')](_0x3823ba)['then'](function(_0x342888){_0x562c0f[_0x4aee('0x20')]=_0x342888;if(_0x204b7e['query']['includeAll']){_0x61efd1[_0x4aee('0x41')]=[{'all':!![]}];}return db[_0x4aee('0x2d')][_0x4aee('0x42')](_0x61efd1);})[_0x4aee('0x29')](function(_0x66ac7f){_0x562c0f[_0x4aee('0x43')]=_0x66ac7f;return _0x562c0f;})[_0x4aee('0x29')](respondWithFilteredResult(_0x219a46,_0x61efd1))[_0x4aee('0x44')](handleError(_0x219a46,null));};exports[_0x4aee('0x45')]=function(_0x30de25,_0x125507){var _0x352f3a={'raw':!![],'where':{'id':_0x30de25[_0x4aee('0x46')]['id']}},_0x5013c4={};_0x5013c4[_0x4aee('0x30')]=_[_0x4aee('0x32')](db['AnalyticExtractedReport'][_0x4aee('0x2e')]);_0x5013c4[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x30de25[_0x4aee('0x31')]);_0x5013c4[_0x4aee('0x3a')]=_['intersection'](_0x5013c4[_0x4aee('0x30')],_0x5013c4[_0x4aee('0x31')]);_0x352f3a[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x5013c4[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x30de25[_0x4aee('0x31')][_0x4aee('0x35')]));_0x352f3a[_0x4aee('0x33')]=_0x352f3a[_0x4aee('0x33')]['length']?_0x352f3a[_0x4aee('0x33')]:_0x5013c4[_0x4aee('0x30')];if(_0x30de25[_0x4aee('0x31')][_0x4aee('0x47')]){_0x352f3a[_0x4aee('0x41')]=[{'all':!![]}];}_0x352f3a=_[_0x4aee('0x3d')]({},_0x352f3a,_0x30de25[_0x4aee('0x40')]);return db[_0x4aee('0x2d')][_0x4aee('0x48')](_0x352f3a)[_0x4aee('0x29')](handleEntityNotFound(_0x125507,null))[_0x4aee('0x29')](respondWithResult(_0x125507,null))[_0x4aee('0x44')](handleError(_0x125507,null));};exports[_0x4aee('0x49')]=function(_0x4a0e1a,_0x441c33){return db[_0x4aee('0x2d')][_0x4aee('0x49')](_0x4a0e1a['body'],{})[_0x4aee('0x29')](function(_0x2df7bd){var _0x514e33=_0x4a0e1a[_0x4aee('0x4a')][_0x4aee('0x25')]({'plain':!![]});if(!_0x514e33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514e33['role']===_0x4aee('0x4a')){var _0x4cd316=_0x2df7bd[_0x4aee('0x25')]({'plain':!![]});var _0x25069c='ExtractedReports';return db[_0x4aee('0x4b')][_0x4aee('0x48')]({'where':{'name':_0x25069c,'userProfileId':_0x514e33[_0x4aee('0x4c')]},'raw':!![]})[_0x4aee('0x29')](function(_0x231607){if(_0x231607&&_0x231607[_0x4aee('0x4d')]===0x0){return db[_0x4aee('0x27')][_0x4aee('0x49')]({'name':_0x4cd316['name'],'resourceId':_0x4cd316['id'],'type':_0x231607['name'],'sectionId':_0x231607['id']},{})[_0x4aee('0x29')](function(){return _0x2df7bd;});}else{return _0x2df7bd;}})[_0x4aee('0x44')](function(_0x423fac){logger[_0x4aee('0x4e')](_0x4aee('0x4f'),_0x423fac);throw _0x423fac;});}return _0x2df7bd;})[_0x4aee('0x29')](respondWithResult(_0x441c33,0xc9))[_0x4aee('0x44')](handleError(_0x441c33,null));};exports['update']=function(_0xf67ba6,_0x1d8bf7){if(_0xf67ba6['body']['id']){delete _0xf67ba6[_0x4aee('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x4aee('0x48')]({'where':{'id':_0xf67ba6['params']['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x1d8bf7,null))['then'](saveUpdates(_0xf67ba6[_0x4aee('0x50')],null))[_0x4aee('0x29')](respondWithResult(_0x1d8bf7,null))[_0x4aee('0x44')](handleError(_0x1d8bf7,null));};exports[_0x4aee('0x28')]=function(_0x5178db,_0x2aece8){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x5178db[_0x4aee('0x46')]['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x2aece8,null))['then'](removeEntity(_0x2aece8,null))[_0x4aee('0x44')](handleError(_0x2aece8,null));};exports[_0x4aee('0x51')]=function(_0x4ab417,_0x1537bf,_0x679440){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x4ab417[_0x4aee('0x46')]['id']},'attributes':[_0x4aee('0x2a'),_0x4aee('0x52'),_0x4aee('0x53'),_0x4aee('0x54')],'raw':!![]})[_0x4aee('0x29')](handleEntityNotFound(_0x1537bf,null))[_0x4aee('0x29')](function(_0x7954b9){if(_0x7954b9){if(!fs[_0x4aee('0x55')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]))){throw new db['Sequelize'][(_0x4aee('0x59'))](_0x4aee('0x5a'));}if(_0x4ab417[_0x4aee('0x31')][_0x4aee('0x5b')]){return _0x1537bf[_0x4aee('0x1b')](0xc8);}return _0x1537bf[_0x4aee('0x51')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]),util[_0x4aee('0x5c')](_0x4aee('0x5d'),_0x7954b9[_0x4aee('0x52')]||_0x7954b9[_0x4aee('0x2a')],_0x7954b9[_0x4aee('0x54')][_0x4aee('0x5e')]()));}})[_0x4aee('0x44')](handleError(_0x1537bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 02ceccf..2fe92b3 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 _0xd049=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2789f0,_0x1bd4e9){var _0x58b8b2=function(_0x48cd16){while(--_0x48cd16){_0x2789f0['push'](_0x2789f0['shift']());}};_0x58b8b2(++_0x1bd4e9);}(_0xd049,0x172));var _0x9d04=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd049[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x9d04('0x0'));var util=require(_0x9d04('0x1'));var logger=require(_0x9d04('0x2'))(_0x9d04('0x3'));var moment=require(_0x9d04('0x4'));var BPromise=require(_0x9d04('0x5'));var rp=require(_0x9d04('0x6'));var fs=require('fs');var path=require(_0x9d04('0x7'));var rimraf=require('rimraf');var config=require(_0x9d04('0x8'));var attributes=require(_0x9d04('0x9'));module[_0x9d04('0xa')]=function(_0x346d3d,_0x50b4bb){return _0x346d3d[_0x9d04('0xb')](_0x9d04('0xc'),attributes,{'tableName':_0x9d04('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd5a=['path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18fc2d,_0x3d356a){var _0x409fc8=function(_0x432710){while(--_0x432710){_0x18fc2d['push'](_0x18fc2d['shift']());}};_0x409fc8(++_0x3d356a);}(_0xcd5a,0xa1));var _0xacd5=function(_0x16834b,_0x4c2cda){_0x16834b=_0x16834b-0x0;var _0x4c7aee=_0xcd5a[_0x16834b];return _0x4c7aee;};'use strict';var _=require(_0xacd5('0x0'));var util=require(_0xacd5('0x1'));var logger=require(_0xacd5('0x2'))(_0xacd5('0x3'));var moment=require(_0xacd5('0x4'));var BPromise=require(_0xacd5('0x5'));var rp=require(_0xacd5('0x6'));var fs=require('fs');var path=require(_0xacd5('0x7'));var rimraf=require(_0xacd5('0x8'));var config=require(_0xacd5('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0xacd5('0xa')]=function(_0x106087,_0x313668){return _0x106087[_0xacd5('0xb')](_0xacd5('0xc'),attributes,{'tableName':_0xacd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 4d56d21..5383348 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 _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8a1634,_0x755249){var _0x51d741=function(_0x2d65eb){while(--_0x2d65eb){_0x8a1634['push'](_0x8a1634['shift']());}};_0x51d741(++_0x755249);}(_0x4b39,0x133));var _0x94b3=function(_0x4503f6,_0x3babaf){_0x4503f6=_0x4503f6-0x0;var _0x2277d1=_0x4b39[_0x4503f6];return _0x2277d1;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});}
\ No newline at end of file
+var _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x6f75,0x71));var _0x56f7=function(_0x3a4998,_0x5b8203){_0x3a4998=_0x3a4998-0x0;var _0x18e7df=_0x6f75[_0x3a4998];return _0x18e7df;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ec4e2f4..e6ce910 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 _0x09d1=['get','isAuthenticated','index','/:id','/:id/download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x57f743,_0x1f3944){var _0x29417d=function(_0x130711){while(--_0x130711){_0x57f743['push'](_0x57f743['shift']());}};_0x29417d(++_0x1f3944);}(_0x09d1,0x74));var _0x109d=function(_0x43e7c4,_0x2b0ef1){_0x43e7c4=_0x43e7c4-0x0;var _0x49ae54=_0x09d1[_0x43e7c4];return _0x49ae54;};'use strict';var multer=require(_0x109d('0x0'));var util=require(_0x109d('0x1'));var path=require(_0x109d('0x2'));var timeout=require(_0x109d('0x3'));var express=require(_0x109d('0x4'));var router=express[_0x109d('0x5')]();var fs_extra=require(_0x109d('0x6'));var auth=require(_0x109d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x109d('0x8'));var controller=require(_0x109d('0x9'));router[_0x109d('0xa')]('/',auth[_0x109d('0xb')](),controller[_0x109d('0xc')]);router['get'](_0x109d('0xd'),auth[_0x109d('0xb')](),controller['show']);router[_0x109d('0xa')](_0x109d('0xe'),auth[_0x109d('0xb')](),controller['download']);router[_0x109d('0xf')]('/',auth[_0x109d('0xb')](),controller[_0x109d('0x10')]);router[_0x109d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x12')]);router[_0x109d('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4606=['/:id/download','download','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2bf755,_0x4b156b){var _0x2e1810=function(_0x77fbae){while(--_0x77fbae){_0x2bf755['push'](_0x2bf755['shift']());}};_0x2e1810(++_0x4b156b);}(_0x4606,0x1e4));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6460('0x0'));var util=require('util');var path=require(_0x6460('0x1'));var timeout=require(_0x6460('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6460('0x3'));var config=require(_0x6460('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x6460('0x5')](),controller[_0x6460('0x6')]);router[_0x6460('0x7')]('/:id',auth[_0x6460('0x5')](),controller[_0x6460('0x8')]);router[_0x6460('0x7')](_0x6460('0x9'),auth[_0x6460('0x5')](),controller[_0x6460('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6460('0xb')]);router[_0x6460('0xc')](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xe')]);router['delete'](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xf')]);module[_0x6460('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c37fc7c..5760a9f 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 _0x569c=['TEXT','STRING','sequelize','exports'];(function(_0x240575,_0x491964){var _0x2d139d=function(_0x3c6296){while(--_0x3c6296){_0x240575['push'](_0x240575['shift']());}};_0x2d139d(++_0x491964);}(_0x569c,0x13e));var _0xc569=function(_0x4ff8e1,_0x29b296){_0x4ff8e1=_0x4ff8e1-0x0;var _0x3ba8d4=_0x569c[_0x4ff8e1];return _0x3ba8d4;};'use strict';var Sequelize=require(_0xc569('0x0'));module[_0xc569('0x1')]={'field':{'type':Sequelize[_0xc569('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xc569('0x3')]},'format':{'type':Sequelize[_0xc569('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc569('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4280=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4280,0x136));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0428('0x0'));module['exports']={'field':{'type':Sequelize[_0x0428('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0428('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0428('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0428('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 5d0b395..bd98ded 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 _0x94a4=['hasOwnProperty','order','sort','where','pick','filter','merge','type','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','bulkCreate','update','destroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','then','sendStatus','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3f19b3,_0x3f0849){var _0xd61898=function(_0x3ca685){while(--_0x3ca685){_0x3f19b3['push'](_0x3f19b3['shift']());}};_0xd61898(++_0x3f0849);}(_0x94a4,0x1a8));var _0x494a=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x94a4[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x494a('0x0'));var rimraf=require(_0x494a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x494a('0x2'));var Mustache=require(_0x494a('0x3'));var util=require('util');var path=require('path');var sox=require(_0x494a('0x4'));var csv=require(_0x494a('0x5'));var ejs=require(_0x494a('0x6'));var fs=require('fs');var fs_extra=require(_0x494a('0x7'));var _=require(_0x494a('0x8'));var squel=require(_0x494a('0x9'));var crypto=require(_0x494a('0xa'));var jsforce=require(_0x494a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x494a('0xc'));var Papa=require(_0x494a('0xd'));var Redis=require(_0x494a('0xe'));var authService=require(_0x494a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x494a('0x10'));var hardwareService=require(_0x494a('0x11'));var logger=require(_0x494a('0x12'))(_0x494a('0x13'));var utils=require(_0x494a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x494a('0x15'));var db=require(_0x494a('0x16'))['db'];function respondWithStatusCode(_0x1696f7,_0x3c1c98){_0x3c1c98=_0x3c1c98||0xcc;return function(_0x37c6be){if(_0x37c6be){return _0x1696f7['sendStatus'](_0x3c1c98);}return _0x1696f7[_0x494a('0x17')](_0x3c1c98)[_0x494a('0x18')]();};}function respondWithResult(_0x57ddf1,_0x576ab8){_0x576ab8=_0x576ab8||0xc8;return function(_0x7b02f7){if(_0x7b02f7){return _0x57ddf1[_0x494a('0x17')](_0x576ab8)[_0x494a('0x19')](_0x7b02f7);}};}function respondWithFilteredResult(_0x2fc8da,_0x2377d1){return function(_0x27c5d1){if(_0x27c5d1){var _0x386671=typeof _0x2377d1[_0x494a('0x1a')]===_0x494a('0x1b')&&typeof _0x2377d1['limit']==='undefined';var _0x52118d=_0x27c5d1['count'];var _0x10749a=_0x386671?0x0:_0x2377d1[_0x494a('0x1a')];var _0x37b995=_0x386671?_0x27c5d1[_0x494a('0x1c')]:_0x2377d1['offset']+_0x2377d1[_0x494a('0x1d')];var _0x2fe50e;if(_0x37b995>=_0x52118d){_0x37b995=_0x52118d;_0x2fe50e=0xc8;}else{_0x2fe50e=0xce;}_0x2fc8da[_0x494a('0x17')](_0x2fe50e);return _0x2fc8da[_0x494a('0x1e')]('Content-Range',_0x10749a+'-'+_0x37b995+'/'+_0x52118d)[_0x494a('0x19')](_0x27c5d1);}return null;};}function patchUpdates(_0x553a10){return function(_0x56fa61){try{jsonpatch[_0x494a('0x1f')](_0x56fa61,_0x553a10,!![]);}catch(_0x43094b){return BPromise[_0x494a('0x20')](_0x43094b);}return _0x56fa61['save']();};}function saveUpdates(_0x57ffd5,_0x44428c){return function(_0x3675e4){if(_0x3675e4){return _0x3675e4['update'](_0x57ffd5)['then'](function(_0x3cd9d9){return _0x3cd9d9;});}return null;};}function removeEntity(_0x466f72,_0x376f21){return function(_0x24e7fb){if(_0x24e7fb){return _0x24e7fb['destroy']()[_0x494a('0x21')](function(){_0x466f72[_0x494a('0x17')](0xcc)[_0x494a('0x18')]();});}};}function handleEntityNotFound(_0x5064cd,_0x3e0ddd){return function(_0x52ec5b){if(!_0x52ec5b){_0x5064cd[_0x494a('0x22')](0x194);}return _0x52ec5b;};}function handleError(_0x399bcd,_0x31270f){_0x31270f=_0x31270f||0x1f4;return function(_0x593efc){logger[_0x494a('0x23')](_0x593efc[_0x494a('0x24')]);if(_0x593efc[_0x494a('0x25')]){delete _0x593efc['name'];}_0x399bcd[_0x494a('0x17')](_0x31270f)[_0x494a('0x26')](_0x593efc);};}exports['index']=function(_0x4cb6d9,_0x15cf3a){var _0x180707={},_0x612f84={},_0x3999b5={'count':0x0,'rows':[]};var _0x44b8a6=_[_0x494a('0x27')](db['AnalyticFieldReport']['rawAttributes'],function(_0x233219){return{'name':_0x233219[_0x494a('0x28')],'type':_0x233219['type'][_0x494a('0x29')]};});_0x612f84[_0x494a('0x2a')]=_[_0x494a('0x27')](_0x44b8a6,_0x494a('0x25'));_0x612f84[_0x494a('0x2b')]=_[_0x494a('0x2c')](_0x4cb6d9['query']);_0x612f84[_0x494a('0x2d')]=_[_0x494a('0x2e')](_0x612f84[_0x494a('0x2a')],_0x612f84[_0x494a('0x2b')]);_0x180707[_0x494a('0x2f')]=_['intersection'](_0x612f84[_0x494a('0x2a')],qs[_0x494a('0x30')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x30')]));_0x180707[_0x494a('0x2f')]=_0x180707[_0x494a('0x2f')][_0x494a('0x31')]?_0x180707[_0x494a('0x2f')]:_0x612f84[_0x494a('0x2a')];if(!_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x32')]('nolimit')){_0x180707[_0x494a('0x1d')]=qs[_0x494a('0x1d')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x1d')]);_0x180707[_0x494a('0x1a')]=qs[_0x494a('0x1a')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x1a')]);}_0x180707[_0x494a('0x33')]=qs[_0x494a('0x34')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x34')]);_0x180707[_0x494a('0x35')]=qs[_0x494a('0x2d')](_[_0x494a('0x36')](_0x4cb6d9[_0x494a('0x2b')],_0x612f84['filters']),_0x44b8a6);if(_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x37')]){_0x180707[_0x494a('0x35')]=_[_0x494a('0x38')](_0x180707[_0x494a('0x35')],{'$or':_[_0x494a('0x27')](_0x44b8a6,function(_0x55ab20){if(_0x55ab20[_0x494a('0x39')]!=='VIRTUAL'){var _0x222390={};_0x222390[_0x55ab20[_0x494a('0x25')]]={'$like':'%'+_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x37')]+'%'};return _0x222390;}})});}_0x180707=_[_0x494a('0x38')]({},_0x180707,_0x4cb6d9[_0x494a('0x3a')]);var _0x3a13ed={'where':_0x180707[_0x494a('0x35')]};return db[_0x494a('0x3b')][_0x494a('0x1c')](_0x3a13ed)[_0x494a('0x21')](function(_0x59c216){_0x3999b5['count']=_0x59c216;if(_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x3c')]){_0x180707[_0x494a('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x494a('0x3e')](_0x180707);})[_0x494a('0x21')](function(_0x881ba7){_0x3999b5[_0x494a('0x3f')]=_0x881ba7;return _0x3999b5;})[_0x494a('0x21')](respondWithFilteredResult(_0x15cf3a,_0x180707))['catch'](handleError(_0x15cf3a,null));};exports[_0x494a('0x40')]=function(_0x38354e,_0x355dbe){var _0x3b9c63={'raw':![],'where':{'id':_0x38354e[_0x494a('0x41')]['id']}},_0x4b8964={};_0x4b8964['model']=_[_0x494a('0x2c')](db['AnalyticFieldReport'][_0x494a('0x42')]);_0x4b8964[_0x494a('0x2b')]=_[_0x494a('0x2c')](_0x38354e['query']);_0x4b8964[_0x494a('0x2d')]=_['intersection'](_0x4b8964[_0x494a('0x2a')],_0x4b8964['query']);_0x3b9c63['attributes']=_[_0x494a('0x2e')](_0x4b8964[_0x494a('0x2a')],qs['fields'](_0x38354e[_0x494a('0x2b')][_0x494a('0x30')]));_0x3b9c63[_0x494a('0x2f')]=_0x3b9c63[_0x494a('0x2f')][_0x494a('0x31')]?_0x3b9c63[_0x494a('0x2f')]:_0x4b8964[_0x494a('0x2a')];if(_0x38354e[_0x494a('0x2b')][_0x494a('0x3c')]){_0x3b9c63['include']=[{'all':!![]}];}_0x3b9c63=_[_0x494a('0x38')]({},_0x3b9c63,_0x38354e[_0x494a('0x3a')]);return db['AnalyticFieldReport'][_0x494a('0x43')](_0x3b9c63)['then'](handleEntityNotFound(_0x355dbe,null))[_0x494a('0x21')](respondWithResult(_0x355dbe,null))[_0x494a('0x44')](handleError(_0x355dbe,null));};exports[_0x494a('0x45')]=function(_0x5d4fb6,_0x597e16){return db[_0x494a('0x3b')][_0x494a('0x45')](_0x5d4fb6[_0x494a('0x46')],{})[_0x494a('0x21')](respondWithResult(_0x597e16,0xc9))['catch'](handleError(_0x597e16,null));};exports['bulkCreate']=function(_0x4730f0,_0x53e936){return db['AnalyticFieldReport'][_0x494a('0x47')](_0x4730f0[_0x494a('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53e936,0xc9))[_0x494a('0x44')](handleError(_0x53e936,null));};exports[_0x494a('0x48')]=function(_0x4c3b4e,_0x1b8575){if(_0x4c3b4e[_0x494a('0x46')]['id']){delete _0x4c3b4e['body']['id'];}return db[_0x494a('0x3b')][_0x494a('0x43')]({'where':{'id':_0x4c3b4e[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x1b8575,null))[_0x494a('0x21')](saveUpdates(_0x4c3b4e[_0x494a('0x46')],null))[_0x494a('0x21')](respondWithResult(_0x1b8575,null))[_0x494a('0x44')](handleError(_0x1b8575,null));};exports[_0x494a('0x49')]=function(_0x525427,_0x1aa262){return db[_0x494a('0x3b')][_0x494a('0x43')]({'where':{'id':_0x525427[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x1aa262,null))[_0x494a('0x21')](removeEntity(_0x1aa262,null))[_0x494a('0x44')](handleError(_0x1aa262,null));};exports['bulkDestroy']=function(_0x2b53f6,_0x363c4f){return db[_0x494a('0x3b')]['destroy']({'where':{'id':_0x2b53f6[_0x494a('0x2b')][_0x494a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x494a('0x21')](respondWithResult(_0x363c4f,0xcc))[_0x494a('0x44')](handleError(_0x363c4f,null));};exports['addFields']=function(_0x290542,_0x868fcb,_0x2738b2){return db[_0x494a('0x4b')][_0x494a('0x4c')]({'where':{'id':_0x290542[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x868fcb,null))['then'](function(_0x4fa0f5){if(_0x4fa0f5){return db['sequelize'][_0x494a('0x4d')](function(_0x54f423){return db[_0x494a('0x3b')][_0x494a('0x49')]({'where':{'CustomReportId':_0x290542[_0x494a('0x41')]['id']},'transaction':_0x54f423})[_0x494a('0x21')](function(_0x32370b){var _0x284b54=_[_0x494a('0x27')](_0x290542[_0x494a('0x46')],function(_0x4ded60){delete _0x4ded60['id'];_0x4ded60[_0x494a('0x4e')]=_0x290542[_0x494a('0x41')]['id'];return _0x4ded60;});return db[_0x494a('0x3b')][_0x494a('0x47')](_0x284b54,{'transaction':_0x54f423});});})['then'](function(){return db[_0x494a('0x3b')][_0x494a('0x3e')]({'where':{'CustomReportId':_0x290542['params']['id']}});});}})[_0x494a('0x21')](respondWithResult(_0x868fcb,null))[_0x494a('0x44')](handleError(_0x868fcb,null));};
\ No newline at end of file
+var _0x50ea=['VIRTUAL','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where'];(function(_0x1d2e01,_0x30e8aa){var _0x36bc23=function(_0x59613c){while(--_0x59613c){_0x1d2e01['push'](_0x1d2e01['shift']());}};_0x36bc23(++_0x30e8aa);}(_0x50ea,0x1ca));var _0xa50e=function(_0xff7bd7,_0x1eef65){_0xff7bd7=_0xff7bd7-0x0;var _0x2b9786=_0x50ea[_0xff7bd7];return _0x2b9786;};'use strict';var emlformat=require(_0xa50e('0x0'));var rimraf=require(_0xa50e('0x1'));var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa50e('0x8'));var csv=require(_0xa50e('0x9'));var ejs=require(_0xa50e('0xa'));var fs=require('fs');var fs_extra=require(_0xa50e('0xb'));var _=require(_0xa50e('0xc'));var squel=require(_0xa50e('0xd'));var crypto=require(_0xa50e('0xe'));var jsforce=require(_0xa50e('0xf'));var deskjs=require(_0xa50e('0x10'));var toCsv=require(_0xa50e('0x9'));var querystring=require(_0xa50e('0x11'));var Papa=require(_0xa50e('0x12'));var Redis=require(_0xa50e('0x13'));var authService=require(_0xa50e('0x14'));var qs=require(_0xa50e('0x15'));var as=require(_0xa50e('0x16'));var hardwareService=require(_0xa50e('0x17'));var logger=require(_0xa50e('0x18'))(_0xa50e('0x19'));var utils=require(_0xa50e('0x1a'));var config=require(_0xa50e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa50e('0x1c'))['db'];function respondWithStatusCode(_0x29c414,_0xc2d654){_0xc2d654=_0xc2d654||0xcc;return function(_0xf3d641){if(_0xf3d641){return _0x29c414[_0xa50e('0x1d')](_0xc2d654);}return _0x29c414[_0xa50e('0x1e')](_0xc2d654)['end']();};}function respondWithResult(_0x289b5b,_0x5650fb){_0x5650fb=_0x5650fb||0xc8;return function(_0x11e8d){if(_0x11e8d){return _0x289b5b['status'](_0x5650fb)[_0xa50e('0x1f')](_0x11e8d);}};}function respondWithFilteredResult(_0xcac5f0,_0x4f6d9b){return function(_0x2c9945){if(_0x2c9945){var _0x3627cc=typeof _0x4f6d9b[_0xa50e('0x20')]==='undefined'&&typeof _0x4f6d9b['limit']==='undefined';var _0x35edc4=_0x2c9945[_0xa50e('0x21')];var _0x48a610=_0x3627cc?0x0:_0x4f6d9b['offset'];var _0x2c25c3=_0x3627cc?_0x2c9945[_0xa50e('0x21')]:_0x4f6d9b[_0xa50e('0x20')]+_0x4f6d9b['limit'];var _0x343174;if(_0x2c25c3>=_0x35edc4){_0x2c25c3=_0x35edc4;_0x343174=0xc8;}else{_0x343174=0xce;}_0xcac5f0['status'](_0x343174);return _0xcac5f0['set'](_0xa50e('0x22'),_0x48a610+'-'+_0x2c25c3+'/'+_0x35edc4)[_0xa50e('0x1f')](_0x2c9945);}return null;};}function patchUpdates(_0x80ff38){return function(_0x481f36){try{jsonpatch[_0xa50e('0x23')](_0x481f36,_0x80ff38,!![]);}catch(_0x5b4d66){return BPromise[_0xa50e('0x24')](_0x5b4d66);}return _0x481f36[_0xa50e('0x25')]();};}function saveUpdates(_0x222115,_0x1753ae){return function(_0x3ecfa7){if(_0x3ecfa7){return _0x3ecfa7['update'](_0x222115)[_0xa50e('0x26')](function(_0xff0918){return _0xff0918;});}return null;};}function removeEntity(_0x37724f,_0x1369bc){return function(_0xbb3cc3){if(_0xbb3cc3){return _0xbb3cc3[_0xa50e('0x27')]()['then'](function(){_0x37724f['status'](0xcc)[_0xa50e('0x28')]();});}};}function handleEntityNotFound(_0x2cc0ac,_0xbb3463){return function(_0xbde460){if(!_0xbde460){_0x2cc0ac['sendStatus'](0x194);}return _0xbde460;};}function handleError(_0x22902c,_0x5adacc){_0x5adacc=_0x5adacc||0x1f4;return function(_0x1b10a2){logger['error'](_0x1b10a2[_0xa50e('0x29')]);if(_0x1b10a2[_0xa50e('0x2a')]){delete _0x1b10a2[_0xa50e('0x2a')];}_0x22902c['status'](_0x5adacc)[_0xa50e('0x2b')](_0x1b10a2);};}exports['index']=function(_0x79e5ab,_0x2c2299){var _0x48a530={},_0x419253={},_0x121682={'count':0x0,'rows':[]};var _0x5c4d4f=_['map'](db[_0xa50e('0x2c')][_0xa50e('0x2d')],function(_0x320ff8){return{'name':_0x320ff8[_0xa50e('0x2e')],'type':_0x320ff8[_0xa50e('0x2f')][_0xa50e('0x30')]};});_0x419253['model']=_[_0xa50e('0x31')](_0x5c4d4f,'name');_0x419253['query']=_[_0xa50e('0x32')](_0x79e5ab[_0xa50e('0x33')]);_0x419253['filters']=_[_0xa50e('0x34')](_0x419253[_0xa50e('0x35')],_0x419253[_0xa50e('0x33')]);_0x48a530[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x419253['model'],qs['fields'](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x37')]));_0x48a530['attributes']=_0x48a530['attributes'][_0xa50e('0x38')]?_0x48a530[_0xa50e('0x36')]:_0x419253[_0xa50e('0x35')];if(!_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x39')](_0xa50e('0x3a'))){_0x48a530[_0xa50e('0x3b')]=qs[_0xa50e('0x3b')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3b')]);_0x48a530[_0xa50e('0x20')]=qs[_0xa50e('0x20')](_0x79e5ab[_0xa50e('0x33')]['offset']);}_0x48a530['order']=qs[_0xa50e('0x3c')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3c')]);_0x48a530['where']=qs[_0xa50e('0x3d')](_[_0xa50e('0x3e')](_0x79e5ab['query'],_0x419253[_0xa50e('0x3d')]),_0x5c4d4f);if(_0x79e5ab['query']['filter']){_0x48a530[_0xa50e('0x3f')]=_['merge'](_0x48a530[_0xa50e('0x3f')],{'$or':_[_0xa50e('0x31')](_0x5c4d4f,function(_0xab6230){if(_0xab6230[_0xa50e('0x2f')]!==_0xa50e('0x40')){var _0x54e236={};_0x54e236[_0xab6230[_0xa50e('0x2a')]]={'$like':'%'+_0x79e5ab[_0xa50e('0x33')]['filter']+'%'};return _0x54e236;}})});}_0x48a530=_[_0xa50e('0x41')]({},_0x48a530,_0x79e5ab[_0xa50e('0x42')]);var _0x1894f6={'where':_0x48a530['where']};return db[_0xa50e('0x2c')][_0xa50e('0x21')](_0x1894f6)[_0xa50e('0x26')](function(_0x4dcd23){_0x121682['count']=_0x4dcd23;if(_0x79e5ab[_0xa50e('0x33')]['includeAll']){_0x48a530['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa50e('0x43')](_0x48a530);})[_0xa50e('0x26')](function(_0x46d0dd){_0x121682[_0xa50e('0x44')]=_0x46d0dd;return _0x121682;})[_0xa50e('0x26')](respondWithFilteredResult(_0x2c2299,_0x48a530))['catch'](handleError(_0x2c2299,null));};exports[_0xa50e('0x45')]=function(_0x293d26,_0x876dc3){var _0x3a7acc={'raw':![],'where':{'id':_0x293d26[_0xa50e('0x46')]['id']}},_0x69713a={};_0x69713a['model']=_[_0xa50e('0x32')](db['AnalyticFieldReport'][_0xa50e('0x2d')]);_0x69713a[_0xa50e('0x33')]=_['keys'](_0x293d26[_0xa50e('0x33')]);_0x69713a[_0xa50e('0x3d')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],_0x69713a['query']);_0x3a7acc[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],qs[_0xa50e('0x37')](_0x293d26[_0xa50e('0x33')]['fields']));_0x3a7acc[_0xa50e('0x36')]=_0x3a7acc[_0xa50e('0x36')][_0xa50e('0x38')]?_0x3a7acc[_0xa50e('0x36')]:_0x69713a[_0xa50e('0x35')];if(_0x293d26[_0xa50e('0x33')][_0xa50e('0x47')]){_0x3a7acc[_0xa50e('0x48')]=[{'all':!![]}];}_0x3a7acc=_['merge']({},_0x3a7acc,_0x293d26[_0xa50e('0x42')]);return db[_0xa50e('0x2c')][_0xa50e('0x49')](_0x3a7acc)[_0xa50e('0x26')](handleEntityNotFound(_0x876dc3,null))[_0xa50e('0x26')](respondWithResult(_0x876dc3,null))[_0xa50e('0x4a')](handleError(_0x876dc3,null));};exports[_0xa50e('0x4b')]=function(_0x3b9e63,_0x2a8054){return db[_0xa50e('0x2c')][_0xa50e('0x4b')](_0x3b9e63[_0xa50e('0x4c')],{})[_0xa50e('0x26')](respondWithResult(_0x2a8054,0xc9))[_0xa50e('0x4a')](handleError(_0x2a8054,null));};exports[_0xa50e('0x4d')]=function(_0x5a35f6,_0x2cf481){return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x5a35f6[_0xa50e('0x4c')],{'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x2cf481,0xc9))[_0xa50e('0x4a')](handleError(_0x2cf481,null));};exports[_0xa50e('0x4e')]=function(_0x189b54,_0x556438){if(_0x189b54[_0xa50e('0x4c')]['id']){delete _0x189b54[_0xa50e('0x4c')]['id'];}return db[_0xa50e('0x2c')][_0xa50e('0x49')]({'where':{'id':_0x189b54[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x556438,null))[_0xa50e('0x26')](saveUpdates(_0x189b54[_0xa50e('0x4c')],null))[_0xa50e('0x26')](respondWithResult(_0x556438,null))['catch'](handleError(_0x556438,null));};exports[_0xa50e('0x27')]=function(_0x29192a,_0x32c7bc){return db[_0xa50e('0x2c')]['find']({'where':{'id':_0x29192a[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x32c7bc,null))[_0xa50e('0x26')](removeEntity(_0x32c7bc,null))['catch'](handleError(_0x32c7bc,null));};exports[_0xa50e('0x4f')]=function(_0x14d619,_0x3f51cd){return db[_0xa50e('0x2c')]['destroy']({'where':{'id':_0x14d619['query'][_0xa50e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x3f51cd,0xcc))[_0xa50e('0x4a')](handleError(_0x3f51cd,null));};exports[_0xa50e('0x51')]=function(_0x15c874,_0x490c58,_0x6f533c){return db[_0xa50e('0x52')][_0xa50e('0x53')]({'where':{'id':_0x15c874[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x490c58,null))[_0xa50e('0x26')](function(_0x243539){if(_0x243539){return db[_0xa50e('0x54')][_0xa50e('0x55')](function(_0x311c3e){return db[_0xa50e('0x2c')][_0xa50e('0x27')]({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']},'transaction':_0x311c3e})['then'](function(_0x35e11f){var _0x218760=_[_0xa50e('0x31')](_0x15c874[_0xa50e('0x4c')],function(_0x392682){delete _0x392682['id'];_0x392682[_0xa50e('0x56')]=_0x15c874['params']['id'];return _0x392682;});return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x218760,{'transaction':_0x311c3e});});})[_0xa50e('0x26')](function(){return db[_0xa50e('0x2c')]['findAll']({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']}});});}})['then'](respondWithResult(_0x490c58,null))['catch'](handleError(_0x490c58,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3dfde1d..bf4019f 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 _0x3045=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x580f59,_0x4ae4de){var _0x4095ba=function(_0x3ec1d3){while(--_0x3ec1d3){_0x580f59['push'](_0x580f59['shift']());}};_0x4095ba(++_0x4ae4de);}(_0x3045,0x1d2));var _0x5304=function(_0x56972f,_0x59e239){_0x56972f=_0x56972f-0x0;var _0x3c9258=_0x3045[_0x56972f];return _0x3c9258;};'use strict';var _=require(_0x5304('0x0'));var util=require(_0x5304('0x1'));var logger=require(_0x5304('0x2'))('api');var moment=require(_0x5304('0x3'));var BPromise=require(_0x5304('0x4'));var rp=require(_0x5304('0x5'));var fs=require('fs');var path=require(_0x5304('0x6'));var rimraf=require(_0x5304('0x7'));var config=require(_0x5304('0x8'));var attributes=require(_0x5304('0x9'));module[_0x5304('0xa')]=function(_0x31bea4,_0x1d3694){return _0x31bea4[_0x5304('0xb')](_0x5304('0xc'),attributes,{'tableName':_0x5304('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a1f=['analytics_report_fields','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f20d6,_0x3dd14c){var _0x3c8528=function(_0x3eb3f2){while(--_0x3eb3f2){_0x3f20d6['push'](_0x3f20d6['shift']());}};_0x3c8528(++_0x3dd14c);}(_0x5a1f,0x1e5));var _0xf5a1=function(_0x1a37e9,_0x506022){_0x1a37e9=_0x1a37e9-0x0;var _0x2dd1ad=_0x5a1f[_0x1a37e9];return _0x2dd1ad;};'use strict';var _=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var logger=require('../../config/logger')(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a1('0x5'));var config=require(_0xf5a1('0x6'));var attributes=require(_0xf5a1('0x7'));module[_0xf5a1('0x8')]=function(_0x45c7c0,_0x1a63bf){return _0x45c7c0[_0xf5a1('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xf5a1('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 a28cfcb..3dadc4a 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 _0x34a4=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x32c8ed,_0x45fef2){var _0x580764=function(_0xeb440e){while(--_0xeb440e){_0x32c8ed['push'](_0x32c8ed['shift']());}};_0x580764(++_0x45fef2);}(_0x34a4,0x1ba));var _0x434a=function(_0x362ad7,_0x948800){_0x362ad7=_0x362ad7-0x0;var _0x54703b=_0x34a4[_0x362ad7];return _0x54703b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x434a('0x0'));var BPromise=require(_0x434a('0x1'));var rs=require(_0x434a('0x2'));var fs=require('fs');var Redis=require(_0x434a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x434a('0x4'));var logger=require(_0x434a('0x5'))('rpc');var config=require(_0x434a('0x6'));var jayson=require(_0x434a('0x7'));var client=jayson[_0x434a('0x8')][_0x434a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29fc6f,_0x505755,_0xd29c36){return new BPromise(function(_0x16d622,_0x12cace){return client['request'](_0x29fc6f,_0xd29c36)[_0x434a('0xa')](function(_0x1941a4){logger[_0x434a('0xb')](_0x434a('0xc'),_0x505755,'request\x20sent');logger[_0x434a('0xd')](_0x434a('0xe'),_0x505755,_0x434a('0xf'),JSON[_0x434a('0x10')](_0x1941a4));if(_0x1941a4[_0x434a('0x11')]){if(_0x1941a4[_0x434a('0x11')][_0x434a('0x12')]===0x1f4){logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0x1941a4[_0x434a('0x11')]['message']);return _0x12cace(_0x1941a4[_0x434a('0x11')][_0x434a('0x13')]);}logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0x1941a4[_0x434a('0x11')][_0x434a('0x13')]);return _0x16d622(_0x1941a4[_0x434a('0x11')]['message']);}else{logger[_0x434a('0xb')](_0x434a('0xc'),_0x505755,_0x434a('0xf'));_0x16d622(_0x1941a4[_0x434a('0x14')][_0x434a('0x13')]);}})['catch'](function(_0xa6e2bb){logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0xa6e2bb);_0x12cace(_0xa6e2bb);});});}
\ No newline at end of file
+var _0x8bba=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x2738d5,_0x2a6f42){var _0x5c92db=function(_0x4a50fe){while(--_0x4a50fe){_0x2738d5['push'](_0x2738d5['shift']());}};_0x5c92db(++_0x2a6f42);}(_0x8bba,0x18e));var _0xa8bb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8bba[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xa8bb('0x0'));var util=require(_0xa8bb('0x1'));var moment=require(_0xa8bb('0x2'));var BPromise=require(_0xa8bb('0x3'));var rs=require(_0xa8bb('0x4'));var fs=require('fs');var Redis=require(_0xa8bb('0x5'));var db=require(_0xa8bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8bb('0x7'));var config=require(_0xa8bb('0x8'));var jayson=require(_0xa8bb('0x9'));var client=jayson['client'][_0xa8bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fe735,_0x2bdae2,_0x3afeb4){return new BPromise(function(_0x3d3196,_0x520669){return client[_0xa8bb('0xb')](_0x9fe735,_0x3afeb4)['then'](function(_0x78ff08){logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));logger[_0xa8bb('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2bdae2,_0xa8bb('0xe'),JSON[_0xa8bb('0x10')](_0x78ff08));if(_0x78ff08['error']){if(_0x78ff08['error'][_0xa8bb('0x11')]===0x1f4){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x520669(_0x78ff08['error']['message']);}logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x3d3196(_0x78ff08['error'][_0xa8bb('0x13')]);}else{logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));_0x3d3196(_0x78ff08[_0xa8bb('0x14')]['message']);}})[_0xa8bb('0x15')](function(_0x5ba952){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x5ba952);_0x520669(_0x5ba952);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 946ca3e..fb22be2 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(_0x331604,_0x577eb3){var _0x45829d=function(_0x256517){while(--_0x256517){_0x331604['push'](_0x331604['shift']());}};_0x45829d(++_0x577eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x139a94,_0x7a7ac2){var _0x4f259e=function(_0xdf86fe){while(--_0xdf86fe){_0x139a94['push'](_0x139a94['shift']());}};_0x4f259e(++_0x7a7ac2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 447d1dd..7b0b355 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 _0x23a3=['TEXT','STRING','name'];(function(_0x2f398d,_0x41c205){var _0x383fd5=function(_0x1cbc4b){while(--_0x1cbc4b){_0x2f398d['push'](_0x2f398d['shift']());}};_0x383fd5(++_0x41c205);}(_0x23a3,0x131));var _0x323a=function(_0x2fcaa3,_0x2ba904){_0x2fcaa3=_0x2fcaa3-0x0;var _0x8f4089=_0x23a3[_0x2fcaa3];return _0x8f4089;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x323a('0x0')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x323a('0x1')]},'description':{'type':Sequelize[_0x323a('0x2')]}};
\ No newline at end of file
+var _0xa062=['TEXT','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa062,0x101));var _0x2a06=function(_0x3f75d7,_0x22bab8){_0x3f75d7=_0x3f75d7-0x0;var _0x26fb16=_0xa062[_0x3f75d7];return _0x26fb16;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'name':{'type':Sequelize[_0x2a06('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2a06('0x2')]},'metric':{'type':Sequelize[_0x2a06('0x3')]},'description':{'type':Sequelize[_0x2a06('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index c8e18a2..0ff2bab 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4f15ec,_0x5b25fd){var _0x1c1548=function(_0x580618){while(--_0x580618){_0x4f15ec['push'](_0x4f15ec['shift']());}};_0x1c1548(++_0x5b25fd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0x7fbe[_0x535963];return _0x3975f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x6aa7,0x178));var _0x76aa=function(_0x2d3f23,_0x2bf9f7){_0x2d3f23=_0x2d3f23-0x0;var _0x244ced=_0x6aa7[_0x2d3f23];return _0x244ced;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ca3ea5c..39590e9 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 _0xea31=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash'];(function(_0x4d9820,_0x2c08f6){var _0x491cc2=function(_0x3cba49){while(--_0x3cba49){_0x4d9820['push'](_0x4d9820['shift']());}};_0x491cc2(++_0x2c08f6);}(_0xea31,0x6b));var _0x1ea3=function(_0x1e7e0f,_0x4f355){_0x1e7e0f=_0x1e7e0f-0x0;var _0x3ee999=_0xea31[_0x1e7e0f];return _0x3ee999;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28b1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','analytics_metrics'];(function(_0x1a4bc0,_0x31747f){var _0x3c11e6=function(_0x4e5af6){while(--_0x4e5af6){_0x1a4bc0['push'](_0x1a4bc0['shift']());}};_0x3c11e6(++_0x31747f);}(_0x28b1,0x1d6));var _0x128b=function(_0x49f42f,_0x4f3ce7){_0x49f42f=_0x49f42f-0x0;var _0x40368b=_0x28b1[_0x49f42f];return _0x40368b;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var logger=require(_0x128b('0x2'))('api');var moment=require(_0x128b('0x3'));var BPromise=require(_0x128b('0x4'));var rp=require(_0x128b('0x5'));var fs=require('fs');var path=require(_0x128b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x128b('0x7'));module['exports']=function(_0x5c3ceb,_0x3699d5){return _0x5c3ceb['define'](_0x128b('0x8'),attributes,{'tableName':_0x128b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 931db8c..4f53eb6 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 _0x15af=['error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x1701e5,_0x7f9087){var _0x4ffbba=function(_0x40f73f){while(--_0x40f73f){_0x1701e5['push'](_0x1701e5['shift']());}};_0x4ffbba(++_0x7f9087);}(_0x15af,0xb9));var _0xf15a=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x15af[_0x2d4661];return _0x42ed1e;};'use strict';var _=require('lodash');var util=require(_0xf15a('0x0'));var moment=require(_0xf15a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf15a('0x2'));var fs=require('fs');var Redis=require(_0xf15a('0x3'));var db=require(_0xf15a('0x4'))['db'];var utils=require(_0xf15a('0x5'));var logger=require(_0xf15a('0x6'))('rpc');var config=require(_0xf15a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf15a('0x8')][_0xf15a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x225fbe,_0x35777c,_0x38e403){return new BPromise(function(_0x138a68,_0x54ff2c){return client[_0xf15a('0xa')](_0x225fbe,_0x38e403)[_0xf15a('0xb')](function(_0x31ba28){logger[_0xf15a('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x35777c,_0xf15a('0xd'));logger['debug'](_0xf15a('0xe'),_0x35777c,_0xf15a('0xd'),JSON['stringify'](_0x31ba28));if(_0x31ba28[_0xf15a('0xf')]){if(_0x31ba28[_0xf15a('0xf')]['code']===0x1f4){logger[_0xf15a('0xf')](_0xf15a('0x10'),_0x35777c,_0x31ba28[_0xf15a('0xf')]['message']);return _0x54ff2c(_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);}logger[_0xf15a('0xf')](_0xf15a('0x10'),_0x35777c,_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);return _0x138a68(_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);}else{logger['info'](_0xf15a('0x10'),_0x35777c,_0xf15a('0xd'));_0x138a68(_0x31ba28[_0xf15a('0x12')][_0xf15a('0x11')]);}})[_0xf15a('0x13')](function(_0x2e200d){logger[_0xf15a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x35777c,_0x2e200d);_0x54ff2c(_0x2e200d);});});}
\ No newline at end of file
+var _0x0c2c=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x52d39a,_0x242577){var _0x8344a=function(_0x1d197a){while(--_0x1d197a){_0x52d39a['push'](_0x52d39a['shift']());}};_0x8344a(++_0x242577);}(_0x0c2c,0x1bd));var _0xc0c2=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0c2c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc0c2('0x0'));var util=require('util');var moment=require(_0xc0c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0c2('0x2'));var fs=require('fs');var Redis=require(_0xc0c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c2('0x5'));var jayson=require(_0xc0c2('0x6'));var client=jayson[_0xc0c2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497bc3,_0x558aeb,_0x19998b){return new BPromise(function(_0x5a4ab6,_0x4b59d5){return client[_0xc0c2('0x8')](_0x497bc3,_0x19998b)[_0xc0c2('0x9')](function(_0x26ed3f){logger[_0xc0c2('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x558aeb,_0xc0c2('0xb'));logger[_0xc0c2('0xc')](_0xc0c2('0xd'),_0x558aeb,_0xc0c2('0xb'),JSON[_0xc0c2('0xe')](_0x26ed3f));if(_0x26ed3f['error']){if(_0x26ed3f[_0xc0c2('0xf')]['code']===0x1f4){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x4b59d5(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x5a4ab6(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}else{logger[_0xc0c2('0xa')](_0xc0c2('0x10'),_0x558aeb,'request\x20sent');_0x5a4ab6(_0x26ed3f['result']['message']);}})[_0xc0c2('0x12')](function(_0x188e6c){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x188e6c);_0x4b59d5(_0x188e6c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0bc5310..0176ba5 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 _0xfd6e=['create','put','update','delete','destroy','exports','multer','path','express','Router','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x5a558e,_0x2c0473){var _0x44eb26=function(_0x1841b4){while(--_0x1841b4){_0x5a558e['push'](_0x5a558e['shift']());}};_0x44eb26(++_0x2c0473);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xefd6('0x0'));var util=require('util');var path=require(_0xefd6('0x1'));var timeout=require('connect-timeout');var express=require(_0xefd6('0x2'));var router=express[_0xefd6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xefd6('0x4'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xefd6('0x5')](),controller[_0xefd6('0x6')]);router[_0xefd6('0x7')](_0xefd6('0x8'),auth[_0xefd6('0x5')](),controller['show']);router['post']('/',auth[_0xefd6('0x5')](),controller[_0xefd6('0x9')]);router[_0xefd6('0xa')]('/:id',auth[_0xefd6('0x5')](),controller[_0xefd6('0xb')]);router[_0xefd6('0xc')](_0xefd6('0x8'),auth['isAuthenticated'](),controller[_0xefd6('0xd')]);module[_0xefd6('0xe')]=router;
\ No newline at end of file
+var _0xec46=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x6d7446,_0x179e0e){var _0x6bf1a=function(_0x1b8eb9){while(--_0x1b8eb9){_0x6d7446['push'](_0x6d7446['shift']());}};_0x6bf1a(++_0x179e0e);}(_0xec46,0x19c));var _0x6ec4=function(_0x267d66,_0xe313d1){_0x267d66=_0x267d66-0x0;var _0x1742be=_0xec46[_0x267d66];return _0x1742be;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ec4('0x4'));var auth=require(_0x6ec4('0x5'));var interaction=require(_0x6ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x6ec4('0x7'));router[_0x6ec4('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ec4('0x9')]);router['get'](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xc')]);router[_0x6ec4('0xd')]('/',auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0xf')](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0x10')]);router[_0x6ec4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6ec4('0x12')]);module[_0x6ec4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 96f89d0..a47d0ea 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 _0xf318=['exports','sequelize'];(function(_0x209547,_0x34e21d){var _0x2050c1=function(_0x57b26e){while(--_0x57b26e){_0x209547['push'](_0x209547['shift']());}};_0x2050c1(++_0x34e21d);}(_0xf318,0x89));var _0x8f31=function(_0x30de0f,_0x4decdb){_0x30de0f=_0x30de0f-0x0;var _0x5b1808=_0xf318[_0x30de0f];return _0x5b1808;};'use strict';var Sequelize=require(_0x8f31('0x0'));module[_0x8f31('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x1e69=['TEXT','exports'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x1e69,0x85));var _0x91e6=function(_0x2c6991,_0x4b5775){_0x2c6991=_0x2c6991-0x0;var _0x4de9fa=_0x1e69[_0x2c6991];return _0x4de9fa;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'tree':{'type':Sequelize[_0x91e6('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 db72356..29e583a 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 _0xc0da=['save','update','then','error','stack','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x4f129d,_0x326a68){var _0x11bf8e=function(_0x50af32){while(--_0x50af32){_0x4f129d['push'](_0x4f129d['shift']());}};_0x11bf8e(++_0x326a68);}(_0xc0da,0xc2));var _0xac0d=function(_0x2be66f,_0x3c4c29){_0x2be66f=_0x2be66f-0x0;var _0x403664=_0xc0da[_0x2be66f];return _0x403664;};'use strict';var emlformat=require(_0xac0d('0x0'));var rimraf=require(_0xac0d('0x1'));var zipdir=require(_0xac0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac0d('0x3'));var moment=require(_0xac0d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac0d('0x5'));var util=require(_0xac0d('0x6'));var path=require(_0xac0d('0x7'));var sox=require(_0xac0d('0x8'));var csv=require(_0xac0d('0x9'));var ejs=require(_0xac0d('0xa'));var fs=require('fs');var fs_extra=require(_0xac0d('0xb'));var _=require(_0xac0d('0xc'));var squel=require(_0xac0d('0xd'));var crypto=require(_0xac0d('0xe'));var jsforce=require(_0xac0d('0xf'));var deskjs=require(_0xac0d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac0d('0x11'));var Redis=require(_0xac0d('0x12'));var authService=require(_0xac0d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac0d('0x14'));var logger=require(_0xac0d('0x15'))('api');var utils=require(_0xac0d('0x16'));var config=require(_0xac0d('0x17'));var licenseUtil=require(_0xac0d('0x18'));var db=require(_0xac0d('0x19'))['db'];function respondWithStatusCode(_0x2fe7c0,_0x4a7cb1){_0x4a7cb1=_0x4a7cb1||0xcc;return function(_0x211014){if(_0x211014){return _0x2fe7c0[_0xac0d('0x1a')](_0x4a7cb1);}return _0x2fe7c0[_0xac0d('0x1b')](_0x4a7cb1)[_0xac0d('0x1c')]();};}function respondWithResult(_0x2fa189,_0x58a18d){_0x58a18d=_0x58a18d||0xc8;return function(_0xf139b9){if(_0xf139b9){return _0x2fa189[_0xac0d('0x1b')](_0x58a18d)[_0xac0d('0x1d')](_0xf139b9);}};}function respondWithFilteredResult(_0xfe21ec,_0x1309d){return function(_0x75cccf){if(_0x75cccf){var _0x46feb7=typeof _0x1309d['offset']===_0xac0d('0x1e')&&typeof _0x1309d[_0xac0d('0x1f')]===_0xac0d('0x1e');var _0x232bdb=_0x75cccf[_0xac0d('0x20')];var _0x4167b6=_0x46feb7?0x0:_0x1309d[_0xac0d('0x21')];var _0x220a01=_0x46feb7?_0x75cccf['count']:_0x1309d[_0xac0d('0x21')]+_0x1309d['limit'];var _0x534ce5;if(_0x220a01>=_0x232bdb){_0x220a01=_0x232bdb;_0x534ce5=0xc8;}else{_0x534ce5=0xce;}_0xfe21ec[_0xac0d('0x1b')](_0x534ce5);return _0xfe21ec['set'](_0xac0d('0x22'),_0x4167b6+'-'+_0x220a01+'/'+_0x232bdb)[_0xac0d('0x1d')](_0x75cccf);}return null;};}function patchUpdates(_0x4ec3d3){return function(_0x3a74b1){try{jsonpatch[_0xac0d('0x23')](_0x3a74b1,_0x4ec3d3,!![]);}catch(_0x34f30c){return BPromise[_0xac0d('0x24')](_0x34f30c);}return _0x3a74b1[_0xac0d('0x25')]();};}function saveUpdates(_0x4af6bc,_0x4ea36c){return function(_0x533986){if(_0x533986){return _0x533986[_0xac0d('0x26')](_0x4af6bc)[_0xac0d('0x27')](function(_0x56e5ed){return _0x56e5ed;});}return null;};}function removeEntity(_0x423400,_0x319f78){return function(_0x54314e){if(_0x54314e){return _0x54314e['destroy']()[_0xac0d('0x27')](function(){_0x423400['status'](0xcc)[_0xac0d('0x1c')]();});}};}function handleEntityNotFound(_0x581cd0,_0x5d8a33){return function(_0x34e311){if(!_0x34e311){_0x581cd0[_0xac0d('0x1a')](0x194);}return _0x34e311;};}function handleError(_0x5a1bbd,_0x449146){_0x449146=_0x449146||0x1f4;return function(_0x427421){logger[_0xac0d('0x28')](_0x427421[_0xac0d('0x29')]);if(_0x427421['name']){delete _0x427421['name'];}_0x5a1bbd[_0xac0d('0x1b')](_0x449146)[_0xac0d('0x2a')](_0x427421);};}exports[_0xac0d('0x2b')]=function(_0x2ad332,_0x162284){var _0xcc6426={},_0x5f4202={},_0x56022f={'count':0x0,'rows':[]};var _0x2c77e9=_[_0xac0d('0x2c')](db[_0xac0d('0x2d')][_0xac0d('0x2e')],function(_0x44b219){return{'name':_0x44b219[_0xac0d('0x2f')],'type':_0x44b219[_0xac0d('0x30')]['key']};});_0x5f4202[_0xac0d('0x31')]=_['map'](_0x2c77e9,_0xac0d('0x32'));_0x5f4202[_0xac0d('0x33')]=_[_0xac0d('0x34')](_0x2ad332[_0xac0d('0x33')]);_0x5f4202['filters']=_[_0xac0d('0x35')](_0x5f4202[_0xac0d('0x31')],_0x5f4202[_0xac0d('0x33')]);_0xcc6426['attributes']=_[_0xac0d('0x35')](_0x5f4202['model'],qs['fields'](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x36')]));_0xcc6426['attributes']=_0xcc6426[_0xac0d('0x37')][_0xac0d('0x38')]?_0xcc6426[_0xac0d('0x37')]:_0x5f4202['model'];if(!_0x2ad332[_0xac0d('0x33')]['hasOwnProperty'](_0xac0d('0x39'))){_0xcc6426[_0xac0d('0x1f')]=qs[_0xac0d('0x1f')](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x1f')]);_0xcc6426[_0xac0d('0x21')]=qs[_0xac0d('0x21')](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x21')]);}_0xcc6426[_0xac0d('0x3a')]=qs[_0xac0d('0x3b')](_0x2ad332['query'][_0xac0d('0x3b')]);_0xcc6426['where']=qs[_0xac0d('0x3c')](_[_0xac0d('0x3d')](_0x2ad332[_0xac0d('0x33')],_0x5f4202['filters']),_0x2c77e9);if(_0x2ad332[_0xac0d('0x33')][_0xac0d('0x3e')]){_0xcc6426[_0xac0d('0x3f')]=_[_0xac0d('0x40')](_0xcc6426[_0xac0d('0x3f')],{'$or':_[_0xac0d('0x2c')](_0x2c77e9,function(_0x5e4de5){if(_0x5e4de5[_0xac0d('0x30')]!==_0xac0d('0x41')){var _0x269e53={};_0x269e53[_0x5e4de5[_0xac0d('0x32')]]={'$like':'%'+_0x2ad332['query']['filter']+'%'};return _0x269e53;}})});}_0xcc6426=_[_0xac0d('0x40')]({},_0xcc6426,_0x2ad332[_0xac0d('0x42')]);var _0x2f2425={'where':_0xcc6426[_0xac0d('0x3f')]};return db[_0xac0d('0x2d')]['count'](_0x2f2425)[_0xac0d('0x27')](function(_0x960e7a){_0x56022f[_0xac0d('0x20')]=_0x960e7a;if(_0x2ad332['query']['includeAll']){_0xcc6426[_0xac0d('0x43')]=[{'all':!![]}];}return db[_0xac0d('0x2d')][_0xac0d('0x44')](_0xcc6426);})[_0xac0d('0x27')](function(_0xcd5a9b){_0x56022f[_0xac0d('0x45')]=_0xcd5a9b;return _0x56022f;})[_0xac0d('0x27')](respondWithFilteredResult(_0x162284,_0xcc6426))[_0xac0d('0x46')](handleError(_0x162284,null));};exports[_0xac0d('0x47')]=function(_0x1b1f0b,_0x534367){var _0x3bc74f={'raw':!![],'where':{'id':_0x1b1f0b[_0xac0d('0x48')]['id']}},_0x157198={};_0x157198['model']=_[_0xac0d('0x34')](db[_0xac0d('0x2d')][_0xac0d('0x2e')]);_0x157198[_0xac0d('0x33')]=_[_0xac0d('0x34')](_0x1b1f0b[_0xac0d('0x33')]);_0x157198[_0xac0d('0x3c')]=_[_0xac0d('0x35')](_0x157198[_0xac0d('0x31')],_0x157198[_0xac0d('0x33')]);_0x3bc74f[_0xac0d('0x37')]=_[_0xac0d('0x35')](_0x157198[_0xac0d('0x31')],qs[_0xac0d('0x36')](_0x1b1f0b[_0xac0d('0x33')][_0xac0d('0x36')]));_0x3bc74f[_0xac0d('0x37')]=_0x3bc74f[_0xac0d('0x37')][_0xac0d('0x38')]?_0x3bc74f[_0xac0d('0x37')]:_0x157198[_0xac0d('0x31')];if(_0x1b1f0b[_0xac0d('0x33')]['includeAll']){_0x3bc74f[_0xac0d('0x43')]=[{'all':!![]}];}_0x3bc74f=_[_0xac0d('0x40')]({},_0x3bc74f,_0x1b1f0b['options']);return db['AnalyticTreeReport'][_0xac0d('0x49')](_0x3bc74f)[_0xac0d('0x27')](handleEntityNotFound(_0x534367,null))['then'](respondWithResult(_0x534367,null))[_0xac0d('0x46')](handleError(_0x534367,null));};exports[_0xac0d('0x4a')]=function(_0x24a84e,_0x476cab){return db[_0xac0d('0x2d')]['create'](_0x24a84e[_0xac0d('0x4b')],{})[_0xac0d('0x27')](respondWithResult(_0x476cab,0xc9))['catch'](handleError(_0x476cab,null));};exports['update']=function(_0x43ec6e,_0x3b8e90){if(_0x43ec6e['body']['id']){delete _0x43ec6e[_0xac0d('0x4b')]['id'];}return db[_0xac0d('0x2d')][_0xac0d('0x49')]({'where':{'id':_0x43ec6e[_0xac0d('0x48')]['id']}})[_0xac0d('0x27')](handleEntityNotFound(_0x3b8e90,null))['then'](saveUpdates(_0x43ec6e['body'],null))[_0xac0d('0x27')](respondWithResult(_0x3b8e90,null))[_0xac0d('0x46')](handleError(_0x3b8e90,null));};exports[_0xac0d('0x4c')]=function(_0x56acf6,_0x42eb7b){return db[_0xac0d('0x2d')]['find']({'where':{'id':_0x56acf6[_0xac0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x42eb7b,null))[_0xac0d('0x27')](removeEntity(_0x42eb7b,null))[_0xac0d('0x46')](handleError(_0x42eb7b,null));};
\ No newline at end of file
+var _0x11da=['api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger'];(function(_0x31d3b4,_0x138abc){var _0x43b94b=function(_0x50d9f3){while(--_0x50d9f3){_0x31d3b4['push'](_0x31d3b4['shift']());}};_0x43b94b(++_0x138abc);}(_0x11da,0x7f));var _0xa11d=function(_0x4f184d,_0x124bbe){_0x4f184d=_0x4f184d-0x0;var _0x5a1c06=_0x11da[_0x4f184d];return _0x5a1c06;};'use strict';var emlformat=require(_0xa11d('0x0'));var rimraf=require(_0xa11d('0x1'));var zipdir=require(_0xa11d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa11d('0x3'));var moment=require(_0xa11d('0x4'));var BPromise=require(_0xa11d('0x5'));var Mustache=require(_0xa11d('0x6'));var util=require(_0xa11d('0x7'));var path=require(_0xa11d('0x8'));var sox=require(_0xa11d('0x9'));var csv=require('to-csv');var ejs=require(_0xa11d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11d('0xb'));var squel=require(_0xa11d('0xc'));var crypto=require(_0xa11d('0xd'));var jsforce=require(_0xa11d('0xe'));var deskjs=require(_0xa11d('0xf'));var toCsv=require(_0xa11d('0x10'));var querystring=require(_0xa11d('0x11'));var Papa=require(_0xa11d('0x12'));var Redis=require(_0xa11d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa11d('0x14'))(_0xa11d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa11d('0x16'))['db'];function respondWithStatusCode(_0x285b6e,_0x4a2402){_0x4a2402=_0x4a2402||0xcc;return function(_0x16a908){if(_0x16a908){return _0x285b6e[_0xa11d('0x17')](_0x4a2402);}return _0x285b6e[_0xa11d('0x18')](_0x4a2402)[_0xa11d('0x19')]();};}function respondWithResult(_0x252844,_0x21543e){_0x21543e=_0x21543e||0xc8;return function(_0x602c0){if(_0x602c0){return _0x252844[_0xa11d('0x18')](_0x21543e)[_0xa11d('0x1a')](_0x602c0);}};}function respondWithFilteredResult(_0x578ba8,_0x4b342e){return function(_0x534641){if(_0x534641){var _0x5ea49e=typeof _0x4b342e[_0xa11d('0x1b')]===_0xa11d('0x1c')&&typeof _0x4b342e[_0xa11d('0x1d')]===_0xa11d('0x1c');var _0x13839c=_0x534641[_0xa11d('0x1e')];var _0x411533=_0x5ea49e?0x0:_0x4b342e[_0xa11d('0x1b')];var _0x1af580=_0x5ea49e?_0x534641[_0xa11d('0x1e')]:_0x4b342e['offset']+_0x4b342e[_0xa11d('0x1d')];var _0x251009;if(_0x1af580>=_0x13839c){_0x1af580=_0x13839c;_0x251009=0xc8;}else{_0x251009=0xce;}_0x578ba8[_0xa11d('0x18')](_0x251009);return _0x578ba8[_0xa11d('0x1f')](_0xa11d('0x20'),_0x411533+'-'+_0x1af580+'/'+_0x13839c)[_0xa11d('0x1a')](_0x534641);}return null;};}function patchUpdates(_0x4144aa){return function(_0x467b66){try{jsonpatch[_0xa11d('0x21')](_0x467b66,_0x4144aa,!![]);}catch(_0x3a09cd){return BPromise['reject'](_0x3a09cd);}return _0x467b66[_0xa11d('0x22')]();};}function saveUpdates(_0x18cba7,_0xd5cd7f){return function(_0x4798da){if(_0x4798da){return _0x4798da[_0xa11d('0x23')](_0x18cba7)[_0xa11d('0x24')](function(_0x34104e){return _0x34104e;});}return null;};}function removeEntity(_0x416271,_0x738dc8){return function(_0x4f44b2){if(_0x4f44b2){return _0x4f44b2[_0xa11d('0x25')]()[_0xa11d('0x24')](function(){_0x416271['status'](0xcc)[_0xa11d('0x19')]();});}};}function handleEntityNotFound(_0x3a8957,_0x54a883){return function(_0x22df71){if(!_0x22df71){_0x3a8957['sendStatus'](0x194);}return _0x22df71;};}function handleError(_0x2046b9,_0x255d11){_0x255d11=_0x255d11||0x1f4;return function(_0x1ff8c0){logger[_0xa11d('0x26')](_0x1ff8c0[_0xa11d('0x27')]);if(_0x1ff8c0['name']){delete _0x1ff8c0[_0xa11d('0x28')];}_0x2046b9[_0xa11d('0x18')](_0x255d11)[_0xa11d('0x29')](_0x1ff8c0);};}exports[_0xa11d('0x2a')]=function(_0x23ddd7,_0x438610){var _0x2e2735={},_0x30c712={},_0x38964a={'count':0x0,'rows':[]};var _0x2ea647=_[_0xa11d('0x2b')](db['AnalyticTreeReport'][_0xa11d('0x2c')],function(_0x44c43b){return{'name':_0x44c43b['fieldName'],'type':_0x44c43b[_0xa11d('0x2d')][_0xa11d('0x2e')]};});_0x30c712[_0xa11d('0x2f')]=_['map'](_0x2ea647,_0xa11d('0x28'));_0x30c712[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x23ddd7[_0xa11d('0x30')]);_0x30c712[_0xa11d('0x32')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],_0x30c712[_0xa11d('0x30')]);_0x2e2735[_0xa11d('0x34')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x23ddd7['query'][_0xa11d('0x35')]));_0x2e2735[_0xa11d('0x34')]=_0x2e2735[_0xa11d('0x34')][_0xa11d('0x36')]?_0x2e2735[_0xa11d('0x34')]:_0x30c712['model'];if(!_0x23ddd7['query'][_0xa11d('0x37')](_0xa11d('0x38'))){_0x2e2735[_0xa11d('0x1d')]=qs[_0xa11d('0x1d')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1d')]);_0x2e2735[_0xa11d('0x1b')]=qs[_0xa11d('0x1b')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1b')]);}_0x2e2735[_0xa11d('0x39')]=qs[_0xa11d('0x3a')](_0x23ddd7['query'][_0xa11d('0x3a')]);_0x2e2735[_0xa11d('0x3b')]=qs['filters'](_[_0xa11d('0x3c')](_0x23ddd7[_0xa11d('0x30')],_0x30c712[_0xa11d('0x32')]),_0x2ea647);if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]){_0x2e2735['where']=_[_0xa11d('0x3e')](_0x2e2735[_0xa11d('0x3b')],{'$or':_[_0xa11d('0x2b')](_0x2ea647,function(_0x38b769){if(_0x38b769[_0xa11d('0x2d')]!==_0xa11d('0x3f')){var _0x1f6f92={};_0x1f6f92[_0x38b769[_0xa11d('0x28')]]={'$like':'%'+_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]+'%'};return _0x1f6f92;}})});}_0x2e2735=_['merge']({},_0x2e2735,_0x23ddd7[_0xa11d('0x40')]);var _0xb118c2={'where':_0x2e2735[_0xa11d('0x3b')]};return db[_0xa11d('0x41')][_0xa11d('0x1e')](_0xb118c2)[_0xa11d('0x24')](function(_0x39a95b){_0x38964a[_0xa11d('0x1e')]=_0x39a95b;if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x42')]){_0x2e2735[_0xa11d('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa11d('0x44')](_0x2e2735);})[_0xa11d('0x24')](function(_0x50b96d){_0x38964a['rows']=_0x50b96d;return _0x38964a;})[_0xa11d('0x24')](respondWithFilteredResult(_0x438610,_0x2e2735))[_0xa11d('0x45')](handleError(_0x438610,null));};exports[_0xa11d('0x46')]=function(_0x3dbe5f,_0x15fbd5){var _0x518435={'raw':!![],'where':{'id':_0x3dbe5f[_0xa11d('0x47')]['id']}},_0x440d7e={};_0x440d7e[_0xa11d('0x2f')]=_[_0xa11d('0x31')](db[_0xa11d('0x41')]['rawAttributes']);_0x440d7e[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x3dbe5f[_0xa11d('0x30')]);_0x440d7e[_0xa11d('0x32')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],_0x440d7e[_0xa11d('0x30')]);_0x518435[_0xa11d('0x34')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x3dbe5f[_0xa11d('0x30')]['fields']));_0x518435['attributes']=_0x518435[_0xa11d('0x34')][_0xa11d('0x36')]?_0x518435['attributes']:_0x440d7e[_0xa11d('0x2f')];if(_0x3dbe5f[_0xa11d('0x30')][_0xa11d('0x42')]){_0x518435[_0xa11d('0x43')]=[{'all':!![]}];}_0x518435=_[_0xa11d('0x3e')]({},_0x518435,_0x3dbe5f[_0xa11d('0x40')]);return db[_0xa11d('0x41')][_0xa11d('0x48')](_0x518435)[_0xa11d('0x24')](handleEntityNotFound(_0x15fbd5,null))[_0xa11d('0x24')](respondWithResult(_0x15fbd5,null))[_0xa11d('0x45')](handleError(_0x15fbd5,null));};exports['create']=function(_0x1b759a,_0x33e4bd){return db[_0xa11d('0x41')]['create'](_0x1b759a[_0xa11d('0x49')],{})[_0xa11d('0x24')](respondWithResult(_0x33e4bd,0xc9))['catch'](handleError(_0x33e4bd,null));};exports[_0xa11d('0x23')]=function(_0x25b097,_0x33288c){if(_0x25b097[_0xa11d('0x49')]['id']){delete _0x25b097[_0xa11d('0x49')]['id'];}return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x25b097[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x33288c,null))[_0xa11d('0x24')](saveUpdates(_0x25b097[_0xa11d('0x49')],null))['then'](respondWithResult(_0x33288c,null))[_0xa11d('0x45')](handleError(_0x33288c,null));};exports[_0xa11d('0x25')]=function(_0x4137ff,_0x3eefac){return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x4137ff[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x3eefac,null))[_0xa11d('0x24')](removeEntity(_0x3eefac,null))[_0xa11d('0x45')](handleError(_0x3eefac,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index f2e7da0..818426c 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 _0x022e=['AnalyticTreeReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x470c7f,_0x27dd79){var _0x9c90e0=function(_0x1d6c18){while(--_0x1d6c18){_0x470c7f['push'](_0x470c7f['shift']());}};_0x9c90e0(++_0x27dd79);}(_0x022e,0x1d5));var _0xe022=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x022e[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xe022('0x0'));var util=require(_0xe022('0x1'));var logger=require(_0xe022('0x2'))('api');var moment=require(_0xe022('0x3'));var BPromise=require(_0xe022('0x4'));var rp=require(_0xe022('0x5'));var fs=require('fs');var path=require(_0xe022('0x6'));var rimraf=require(_0xe022('0x7'));var config=require(_0xe022('0x8'));var attributes=require(_0xe022('0x9'));module[_0xe022('0xa')]=function(_0x4762d5,_0x32d1b3){return _0x4762d5[_0xe022('0xb')](_0xe022('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0617=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x0617,0xcb));var _0x7061=function(_0x365d9a,_0x6b8d5f){_0x365d9a=_0x365d9a-0x0;var _0x54161d=_0x0617[_0x365d9a];return _0x54161d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7061('0x0'))(_0x7061('0x1'));var moment=require(_0x7061('0x2'));var BPromise=require(_0x7061('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7061('0x4'));var rimraf=require('rimraf');var config=require(_0x7061('0x5'));var attributes=require(_0x7061('0x6'));module[_0x7061('0x7')]=function(_0x55fe55,_0xe7c0de){return _0x55fe55[_0x7061('0x8')](_0x7061('0x9'),attributes,{'tableName':_0x7061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 4d80a06..d3c9ea4 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4fc476,_0xb7cdfd){var _0x2de7d8=function(_0x5c4f8f){while(--_0x5c4f8f){_0x4fc476['push'](_0x4fc476['shift']());}};_0x2de7d8(++_0xb7cdfd);}(_0xadb5,0xad));var _0x5adb=function(_0x4aafde,_0x5739f4){_0x4aafde=_0x4aafde-0x0;var _0x165fd2=_0xadb5[_0x4aafde];return _0x165fd2;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+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(_0x49b30e,_0x30f431){var _0x4af321=function(_0x6c4fd9){while(--_0x6c4fd9){_0x49b30e['push'](_0x49b30e['shift']());}};_0x4af321(++_0x30f431);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'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 5d28d7c..480e2b4 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 _0x109e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','post','create','/:id','destroy','exports'];(function(_0x57fe5e,_0xafce42){var _0x24ad53=function(_0x386892){while(--_0x386892){_0x57fe5e['push'](_0x57fe5e['shift']());}};_0x24ad53(++_0xafce42);}(_0x109e,0xc3));var _0xe109=function(_0x9eadf8,_0x5d2d9e){_0x9eadf8=_0x9eadf8-0x0;var _0x5ce5eb=_0x109e[_0x9eadf8];return _0x5ce5eb;};'use strict';var multer=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var path=require(_0xe109('0x2'));var timeout=require(_0xe109('0x3'));var express=require(_0xe109('0x4'));var router=express[_0xe109('0x5')]();var fs_extra=require(_0xe109('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe109('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xe109('0x8')]('/',auth[_0xe109('0x9')](),controller['index']);router[_0xe109('0x8')]('/:id',auth[_0xe109('0x9')](),controller['show']);router[_0xe109('0xa')]('/',auth[_0xe109('0x9')](),controller[_0xe109('0xb')]);router['put'](_0xe109('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe109('0xc'),auth[_0xe109('0x9')](),controller[_0xe109('0xd')]);module[_0xe109('0xe')]=router;
\ No newline at end of file
+var _0xdb59=['get','isAuthenticated','/:id','post','put','update','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdb59,0xda));var _0x9db5=function(_0x44d3d7,_0x1c6356){_0x44d3d7=_0x44d3d7-0x0;var _0x1886c0=_0xdb59[_0x44d3d7];return _0x1886c0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9db5('0x0'));var express=require(_0x9db5('0x1'));var router=express['Router']();var fs_extra=require(_0x9db5('0x2'));var auth=require(_0x9db5('0x3'));var interaction=require(_0x9db5('0x4'));var config=require(_0x9db5('0x5'));var controller=require(_0x9db5('0x6'));router[_0x9db5('0x7')]('/',auth[_0x9db5('0x8')](),controller['index']);router[_0x9db5('0x7')](_0x9db5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9db5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9db5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9db5('0xc')]);router['delete'](_0x9db5('0x9'),auth[_0x9db5('0x8')](),controller[_0x9db5('0xd')]);module[_0x9db5('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 88ce3b9..bfea402 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 _0xe198=['sequelize','exports','STRING'];(function(_0x350814,_0x4a1eb6){var _0x4679e7=function(_0x894990){while(--_0x894990){_0x350814['push'](_0x350814['shift']());}};_0x4679e7(++_0x4a1eb6);}(_0xe198,0x6f));var _0x8e19=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe198[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8e19('0x2')]}};
\ No newline at end of file
+var _0xff98=['exports','STRING'];(function(_0x386f0a,_0x3b084a){var _0x32ffa0=function(_0x4cdefd){while(--_0x4cdefd){_0x386f0a['push'](_0x386f0a['shift']());}};_0x32ffa0(++_0x3b084a);}(_0xff98,0x9c));var _0x8ff9=function(_0xdb5d5a,_0x5c857e){_0xdb5d5a=_0xdb5d5a-0x0;var _0x426c3b=_0xff98[_0xdb5d5a];return _0x426c3b;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'name':{'type':Sequelize[_0x8ff9('0x1')]},'basename':{'type':Sequelize[_0x8ff9('0x1')]},'type':{'type':Sequelize[_0x8ff9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6364a14..acbceeb 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 _0xc875=['create','originalname','basename','file','filename','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','Attachment','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','length','find','clone','omit','createdAt','body','updatedAt','update'];(function(_0xe30888,_0x12dcea){var _0x15dfaf=function(_0x39fb7f){while(--_0x39fb7f){_0xe30888['push'](_0xe30888['shift']());}};_0x15dfaf(++_0x12dcea);}(_0xc875,0x111));var _0x5c87=function(_0x5767a6,_0x3053cc){_0x5767a6=_0x5767a6-0x0;var _0x25edd8=_0xc875[_0x5767a6];return _0x25edd8;};'use strict';var emlformat=require(_0x5c87('0x0'));var rimraf=require(_0x5c87('0x1'));var zipdir=require(_0x5c87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c87('0x3'));var moment=require('moment');var BPromise=require(_0x5c87('0x4'));var Mustache=require('mustache');var util=require(_0x5c87('0x5'));var path=require(_0x5c87('0x6'));var sox=require(_0x5c87('0x7'));var csv=require('to-csv');var ejs=require(_0x5c87('0x8'));var fs=require('fs');var fs_extra=require(_0x5c87('0x9'));var _=require(_0x5c87('0xa'));var squel=require(_0x5c87('0xb'));var crypto=require(_0x5c87('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c87('0xd'));var querystring=require(_0x5c87('0xe'));var Papa=require(_0x5c87('0xf'));var Redis=require('ioredis');var authService=require(_0x5c87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5c87('0x11'));var hardwareService=require(_0x5c87('0x12'));var logger=require(_0x5c87('0x13'))(_0x5c87('0x14'));var utils=require(_0x5c87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5c87('0x16'));var db=require(_0x5c87('0x17'))['db'];function respondWithStatusCode(_0x541e2c,_0x46d696){_0x46d696=_0x46d696||0xcc;return function(_0x1ec10b){if(_0x1ec10b){return _0x541e2c['sendStatus'](_0x46d696);}return _0x541e2c[_0x5c87('0x18')](_0x46d696)[_0x5c87('0x19')]();};}function respondWithResult(_0x2eb133,_0x5981ed){_0x5981ed=_0x5981ed||0xc8;return function(_0x2ad650){if(_0x2ad650){return _0x2eb133[_0x5c87('0x18')](_0x5981ed)[_0x5c87('0x1a')](_0x2ad650);}};}function respondWithFilteredResult(_0x58cda1,_0x498418){return function(_0x2f0782){if(_0x2f0782){var _0x4de004=typeof _0x498418[_0x5c87('0x1b')]===_0x5c87('0x1c')&&typeof _0x498418[_0x5c87('0x1d')]===_0x5c87('0x1c');var _0x419b1b=_0x2f0782[_0x5c87('0x1e')];var _0x2a2cee=_0x4de004?0x0:_0x498418[_0x5c87('0x1b')];var _0x4fcd85=_0x4de004?_0x2f0782[_0x5c87('0x1e')]:_0x498418[_0x5c87('0x1b')]+_0x498418[_0x5c87('0x1d')];var _0xf175f9;if(_0x4fcd85>=_0x419b1b){_0x4fcd85=_0x419b1b;_0xf175f9=0xc8;}else{_0xf175f9=0xce;}_0x58cda1[_0x5c87('0x18')](_0xf175f9);return _0x58cda1[_0x5c87('0x1f')](_0x5c87('0x20'),_0x2a2cee+'-'+_0x4fcd85+'/'+_0x419b1b)[_0x5c87('0x1a')](_0x2f0782);}return null;};}function patchUpdates(_0x3e6184){return function(_0xfc4ff0){try{jsonpatch[_0x5c87('0x21')](_0xfc4ff0,_0x3e6184,!![]);}catch(_0x2a72aa){return BPromise[_0x5c87('0x22')](_0x2a72aa);}return _0xfc4ff0[_0x5c87('0x23')]();};}function saveUpdates(_0x2bb028,_0x486a53){return function(_0x508eb4){if(_0x508eb4){return _0x508eb4['update'](_0x2bb028)[_0x5c87('0x24')](function(_0xec656){return _0xec656;});}return null;};}function removeEntity(_0x57892b,_0x2dcc76){return function(_0x5b40bf){if(_0x5b40bf){return _0x5b40bf[_0x5c87('0x25')]()[_0x5c87('0x24')](function(){_0x57892b[_0x5c87('0x18')](0xcc)[_0x5c87('0x19')]();});}};}function handleEntityNotFound(_0x133d2f,_0x56712e){return function(_0xa98e7e){if(!_0xa98e7e){_0x133d2f[_0x5c87('0x26')](0x194);}return _0xa98e7e;};}function handleError(_0x1b85f8,_0x38ea55){_0x38ea55=_0x38ea55||0x1f4;return function(_0x5338f9){logger[_0x5c87('0x27')](_0x5338f9[_0x5c87('0x28')]);if(_0x5338f9['name']){delete _0x5338f9[_0x5c87('0x29')];}_0x1b85f8[_0x5c87('0x18')](_0x38ea55)['send'](_0x5338f9);};}exports[_0x5c87('0x2a')]=function(_0x3f22b1,_0x303e6a){var _0x2efcf9={},_0x5acf1e={},_0x13dec4={'count':0x0,'rows':[]};var _0x19e3ed=_['map'](db[_0x5c87('0x2b')]['rawAttributes'],function(_0x4cbfb8){return{'name':_0x4cbfb8['fieldName'],'type':_0x4cbfb8[_0x5c87('0x2c')][_0x5c87('0x2d')]};});_0x5acf1e[_0x5c87('0x2e')]=_['map'](_0x19e3ed,'name');_0x5acf1e[_0x5c87('0x2f')]=_[_0x5c87('0x30')](_0x3f22b1[_0x5c87('0x2f')]);_0x5acf1e[_0x5c87('0x31')]=_['intersection'](_0x5acf1e['model'],_0x5acf1e[_0x5c87('0x2f')]);_0x2efcf9[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x5acf1e['model'],qs[_0x5c87('0x34')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x34')]));_0x2efcf9[_0x5c87('0x32')]=_0x2efcf9[_0x5c87('0x32')]['length']?_0x2efcf9[_0x5c87('0x32')]:_0x5acf1e[_0x5c87('0x2e')];if(!_0x3f22b1[_0x5c87('0x2f')]['hasOwnProperty']('nolimit')){_0x2efcf9['limit']=qs[_0x5c87('0x1d')](_0x3f22b1[_0x5c87('0x2f')]['limit']);_0x2efcf9['offset']=qs[_0x5c87('0x1b')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x1b')]);}_0x2efcf9[_0x5c87('0x35')]=qs[_0x5c87('0x36')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x36')]);_0x2efcf9[_0x5c87('0x37')]=qs[_0x5c87('0x31')](_[_0x5c87('0x38')](_0x3f22b1[_0x5c87('0x2f')],_0x5acf1e[_0x5c87('0x31')]),_0x19e3ed);if(_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x39')]){_0x2efcf9['where']=_[_0x5c87('0x3a')](_0x2efcf9['where'],{'$or':_[_0x5c87('0x3b')](_0x19e3ed,function(_0x3511ba){if(_0x3511ba[_0x5c87('0x2c')]!=='VIRTUAL'){var _0x26f0bd={};_0x26f0bd[_0x3511ba[_0x5c87('0x29')]]={'$like':'%'+_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x39')]+'%'};return _0x26f0bd;}})});}_0x2efcf9=_['merge']({},_0x2efcf9,_0x3f22b1[_0x5c87('0x3c')]);var _0xf09f7a={'where':_0x2efcf9[_0x5c87('0x37')]};return db[_0x5c87('0x2b')][_0x5c87('0x1e')](_0xf09f7a)['then'](function(_0x289f08){_0x13dec4['count']=_0x289f08;if(_0x3f22b1['query'][_0x5c87('0x3d')]){_0x2efcf9[_0x5c87('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x2efcf9);})[_0x5c87('0x24')](function(_0x1711b1){_0x13dec4[_0x5c87('0x3f')]=_0x1711b1;return _0x13dec4;})[_0x5c87('0x24')](respondWithFilteredResult(_0x303e6a,_0x2efcf9))[_0x5c87('0x40')](handleError(_0x303e6a,null));};exports[_0x5c87('0x41')]=function(_0x2bdde8,_0xe75ab5){var _0x381a03={'raw':!![],'where':{'id':_0x2bdde8[_0x5c87('0x42')]['id']}},_0x54dd73={};_0x54dd73['model']=_[_0x5c87('0x30')](db[_0x5c87('0x2b')]['rawAttributes']);_0x54dd73[_0x5c87('0x2f')]=_[_0x5c87('0x30')](_0x2bdde8[_0x5c87('0x2f')]);_0x54dd73[_0x5c87('0x31')]=_['intersection'](_0x54dd73[_0x5c87('0x2e')],_0x54dd73[_0x5c87('0x2f')]);_0x381a03[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x54dd73[_0x5c87('0x2e')],qs[_0x5c87('0x34')](_0x2bdde8['query'][_0x5c87('0x34')]));_0x381a03['attributes']=_0x381a03[_0x5c87('0x32')][_0x5c87('0x43')]?_0x381a03[_0x5c87('0x32')]:_0x54dd73[_0x5c87('0x2e')];if(_0x2bdde8[_0x5c87('0x2f')]['includeAll']){_0x381a03[_0x5c87('0x3e')]=[{'all':!![]}];}_0x381a03=_[_0x5c87('0x3a')]({},_0x381a03,_0x2bdde8[_0x5c87('0x3c')]);return db[_0x5c87('0x2b')][_0x5c87('0x44')](_0x381a03)['then'](handleEntityNotFound(_0xe75ab5,null))[_0x5c87('0x24')](respondWithResult(_0xe75ab5,null))['catch'](handleError(_0xe75ab5,null));};exports[_0x5c87('0x45')]=function(_0x45a453,_0x2608cd){var _0x5944aa={'where':{'id':_0x45a453[_0x5c87('0x42')]['id']}},_0x2d3a18={};_0x2d3a18[_0x5c87('0x2e')]=_[_0x5c87('0x30')](db[_0x5c87('0x2b')]['rawAttributes']);_0x5944aa[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x2d3a18[_0x5c87('0x2e')],qs[_0x5c87('0x34')](_0x45a453[_0x5c87('0x2f')][_0x5c87('0x34')]));_0x5944aa[_0x5c87('0x32')]=_0x5944aa[_0x5c87('0x32')][_0x5c87('0x43')]?_0x5944aa['attributes']:_0x2d3a18[_0x5c87('0x2e')];if(_0x45a453[_0x5c87('0x2f')]['includeAll']){_0x5944aa['include']=[{'all':!![]}];}_0x5944aa=_['merge']({},_0x5944aa,_0x45a453[_0x5c87('0x3c')]);return db['Attachment'][_0x5c87('0x44')](_0x5944aa)['then'](handleEntityNotFound(_0x2608cd,null))[_0x5c87('0x24')](function(_0x423de5){if(_0x423de5){var _0x4d497e=_0x423de5['get']({'plain':!![]});_0x4d497e=qs[_0x5c87('0x46')](_0x4d497e,['id',_0x5c87('0x47'),'updatedAt']);_0x45a453[_0x5c87('0x48')]=_[_0x5c87('0x46')](_0x45a453[_0x5c87('0x48')],['id','createdAt',_0x5c87('0x49')]);return db['Attachment']['create'](_['merge'](_0x4d497e,_0x45a453[_0x5c87('0x48')]),{'include':_0x45a453[_0x5c87('0x2f')][_0x5c87('0x3d')]?[{'all':!![]}]:undefined});}})[_0x5c87('0x24')](respondWithResult(_0x2608cd,0xc9))['catch'](handleError(_0x2608cd,null));};exports[_0x5c87('0x4a')]=function(_0x5efd92,_0x5ee97d){if(_0x5efd92[_0x5c87('0x48')]['id']){delete _0x5efd92[_0x5c87('0x48')]['id'];}return db[_0x5c87('0x2b')][_0x5c87('0x44')]({'where':{'id':_0x5efd92[_0x5c87('0x42')]['id']}})[_0x5c87('0x24')](handleEntityNotFound(_0x5ee97d,null))[_0x5c87('0x24')](saveUpdates(_0x5efd92[_0x5c87('0x48')],null))[_0x5c87('0x24')](respondWithResult(_0x5ee97d,null))[_0x5c87('0x40')](handleError(_0x5ee97d,null));};exports[_0x5c87('0x25')]=function(_0x4d4336,_0x1d867f){return db[_0x5c87('0x2b')][_0x5c87('0x44')]({'where':{'id':_0x4d4336[_0x5c87('0x42')]['id']}})[_0x5c87('0x24')](handleEntityNotFound(_0x1d867f,null))[_0x5c87('0x24')](removeEntity(_0x1d867f,null))['catch'](handleError(_0x1d867f,null));};exports[_0x5c87('0x4b')]=function(_0x5d2556,_0x5bb663,_0x433bce){_0x5d2556['body'][_0x5c87('0x29')]=_0x5d2556['file'][_0x5c87('0x4c')];_0x5d2556[_0x5c87('0x48')][_0x5c87('0x4d')]=_0x5d2556[_0x5c87('0x4e')][_0x5c87('0x4f')];_0x5d2556['body'][_0x5c87('0x2c')]=_0x5d2556[_0x5c87('0x4e')][_0x5c87('0x50')];return db[_0x5c87('0x2b')][_0x5c87('0x4b')](_0x5d2556[_0x5c87('0x48')])[_0x5c87('0x24')](respondWithResult(_0x5bb663,0xc9))[_0x5c87('0x40')](handleError(_0x5bb663,null));};exports['download']=function(_0x546fce,_0x5e3b20,_0x12cb24){return db[_0x5c87('0x2b')]['findOne']({'where':{'id':_0x546fce['params']['id']},'raw':!![]})[_0x5c87('0x24')](handleEntityNotFound(_0x5e3b20,null))[_0x5c87('0x24')](function(_0x2351a5){if(_0x2351a5){var _0x2d57b6=_0x2351a5[_0x5c87('0x51')]!==null;var _0xec0d02=path['join'](config[_0x5c87('0x52')],_0x5c87('0x53'));if(_0x2d57b6){_0xec0d02=path[_0x5c87('0x54')](_0xec0d02,_0x5c87('0x55'));}var _0x24b763=path['join'](_0xec0d02,_0x2351a5[_0x5c87('0x4d')]);return _0x5e3b20[_0x5c87('0x56')](_0x24b763);}})['catch'](handleError(_0x5e3b20,null));};
\ No newline at end of file
+var _0x280b=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','clone','params','get','omit','body','createdAt','create','find','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','sendStatus','name','send','index','Attachment','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3a428d,_0x4f6232){var _0x1fb723=function(_0x554a39){while(--_0x554a39){_0x3a428d['push'](_0x3a428d['shift']());}};_0x1fb723(++_0x4f6232);}(_0x280b,0x180));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xb280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb280('0x1'));var jsonpatch=require(_0xb280('0x2'));var rp=require(_0xb280('0x3'));var moment=require(_0xb280('0x4'));var BPromise=require(_0xb280('0x5'));var Mustache=require('mustache');var util=require(_0xb280('0x6'));var path=require(_0xb280('0x7'));var sox=require(_0xb280('0x8'));var csv=require(_0xb280('0x9'));var ejs=require(_0xb280('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb280('0xb'));var squel=require(_0xb280('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb280('0x9'));var querystring=require(_0xb280('0xd'));var Papa=require('papaparse');var Redis=require(_0xb280('0xe'));var authService=require(_0xb280('0xf'));var qs=require(_0xb280('0x10'));var as=require(_0xb280('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb280('0x12'))('api');var utils=require(_0xb280('0x13'));var config=require(_0xb280('0x14'));var licenseUtil=require(_0xb280('0x15'));var db=require(_0xb280('0x16'))['db'];function respondWithStatusCode(_0x28c187,_0x1f8e42){_0x1f8e42=_0x1f8e42||0xcc;return function(_0x275188){if(_0x275188){return _0x28c187['sendStatus'](_0x1f8e42);}return _0x28c187[_0xb280('0x17')](_0x1f8e42)[_0xb280('0x18')]();};}function respondWithResult(_0x348798,_0x30134a){_0x30134a=_0x30134a||0xc8;return function(_0x5597ad){if(_0x5597ad){return _0x348798[_0xb280('0x17')](_0x30134a)['json'](_0x5597ad);}};}function respondWithFilteredResult(_0x195575,_0x5e097c){return function(_0x29f14e){if(_0x29f14e){var _0x30f276=typeof _0x5e097c[_0xb280('0x19')]===_0xb280('0x1a')&&typeof _0x5e097c['limit']===_0xb280('0x1a');var _0x414adf=_0x29f14e[_0xb280('0x1b')];var _0x1aef67=_0x30f276?0x0:_0x5e097c[_0xb280('0x19')];var _0x253b5e=_0x30f276?_0x29f14e[_0xb280('0x1b')]:_0x5e097c[_0xb280('0x19')]+_0x5e097c[_0xb280('0x1c')];var _0xc9b5a1;if(_0x253b5e>=_0x414adf){_0x253b5e=_0x414adf;_0xc9b5a1=0xc8;}else{_0xc9b5a1=0xce;}_0x195575[_0xb280('0x17')](_0xc9b5a1);return _0x195575[_0xb280('0x1d')]('Content-Range',_0x1aef67+'-'+_0x253b5e+'/'+_0x414adf)[_0xb280('0x1e')](_0x29f14e);}return null;};}function patchUpdates(_0x38e20e){return function(_0x37e5c2){try{jsonpatch[_0xb280('0x1f')](_0x37e5c2,_0x38e20e,!![]);}catch(_0x10a24d){return BPromise[_0xb280('0x20')](_0x10a24d);}return _0x37e5c2['save']();};}function saveUpdates(_0x559a80,_0x3eabd9){return function(_0x47734c){if(_0x47734c){return _0x47734c[_0xb280('0x21')](_0x559a80)[_0xb280('0x22')](function(_0x25a56d){return _0x25a56d;});}return null;};}function removeEntity(_0x2eb5fe,_0x5e9eae){return function(_0x57b37c){if(_0x57b37c){return _0x57b37c[_0xb280('0x23')]()[_0xb280('0x22')](function(){_0x2eb5fe[_0xb280('0x17')](0xcc)[_0xb280('0x18')]();});}};}function handleEntityNotFound(_0x12ae73,_0x440f4b){return function(_0x44d03c){if(!_0x44d03c){_0x12ae73[_0xb280('0x24')](0x194);}return _0x44d03c;};}function handleError(_0x548676,_0x449bc9){_0x449bc9=_0x449bc9||0x1f4;return function(_0x45f937){logger['error'](_0x45f937['stack']);if(_0x45f937[_0xb280('0x25')]){delete _0x45f937[_0xb280('0x25')];}_0x548676[_0xb280('0x17')](_0x449bc9)[_0xb280('0x26')](_0x45f937);};}exports[_0xb280('0x27')]=function(_0x2ca5ef,_0xcb9ce8){var _0x27a475={},_0xb94030={},_0x440cf1={'count':0x0,'rows':[]};var _0x58b5c8=_['map'](db[_0xb280('0x28')]['rawAttributes'],function(_0x27274b){return{'name':_0x27274b['fieldName'],'type':_0x27274b[_0xb280('0x29')][_0xb280('0x2a')]};});_0xb94030['model']=_['map'](_0x58b5c8,_0xb280('0x25'));_0xb94030[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x2ca5ef[_0xb280('0x2b')]);_0xb94030[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0xb94030[_0xb280('0x2f')],_0xb94030[_0xb280('0x2b')]);_0x27a475[_0xb280('0x30')]=_['intersection'](_0xb94030['model'],qs[_0xb280('0x31')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x31')]));_0x27a475[_0xb280('0x30')]=_0x27a475[_0xb280('0x30')][_0xb280('0x32')]?_0x27a475[_0xb280('0x30')]:_0xb94030[_0xb280('0x2f')];if(!_0x2ca5ef['query']['hasOwnProperty'](_0xb280('0x33'))){_0x27a475[_0xb280('0x1c')]=qs['limit'](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x1c')]);_0x27a475['offset']=qs['offset'](_0x2ca5ef['query'][_0xb280('0x19')]);}_0x27a475[_0xb280('0x34')]=qs[_0xb280('0x35')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x35')]);_0x27a475[_0xb280('0x36')]=qs['filters'](_[_0xb280('0x37')](_0x2ca5ef['query'],_0xb94030[_0xb280('0x2d')]),_0x58b5c8);if(_0x2ca5ef['query'][_0xb280('0x38')]){_0x27a475[_0xb280('0x36')]=_[_0xb280('0x39')](_0x27a475[_0xb280('0x36')],{'$or':_[_0xb280('0x3a')](_0x58b5c8,function(_0x2787f8){if(_0x2787f8[_0xb280('0x29')]!==_0xb280('0x3b')){var _0xe6a22e={};_0xe6a22e[_0x2787f8[_0xb280('0x25')]]={'$like':'%'+_0x2ca5ef[_0xb280('0x2b')]['filter']+'%'};return _0xe6a22e;}})});}_0x27a475=_[_0xb280('0x39')]({},_0x27a475,_0x2ca5ef[_0xb280('0x3c')]);var _0x5cd98c={'where':_0x27a475[_0xb280('0x36')]};return db[_0xb280('0x28')][_0xb280('0x1b')](_0x5cd98c)[_0xb280('0x22')](function(_0x5bf59a){_0x440cf1[_0xb280('0x1b')]=_0x5bf59a;if(_0x2ca5ef['query'][_0xb280('0x3d')]){_0x27a475[_0xb280('0x3e')]=[{'all':!![]}];}return db[_0xb280('0x28')][_0xb280('0x3f')](_0x27a475);})[_0xb280('0x22')](function(_0x430921){_0x440cf1[_0xb280('0x40')]=_0x430921;return _0x440cf1;})[_0xb280('0x22')](respondWithFilteredResult(_0xcb9ce8,_0x27a475))[_0xb280('0x41')](handleError(_0xcb9ce8,null));};exports['show']=function(_0x5dd0cc,_0x2c7831){var _0x11d412={'raw':!![],'where':{'id':_0x5dd0cc['params']['id']}},_0x5b7501={};_0x5b7501[_0xb280('0x2f')]=_['keys'](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5b7501[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x5dd0cc[_0xb280('0x2b')]);_0x5b7501[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0x5b7501[_0xb280('0x2f')],_0x5b7501['query']);_0x11d412[_0xb280('0x30')]=_[_0xb280('0x2e')](_0x5b7501['model'],qs[_0xb280('0x31')](_0x5dd0cc['query'][_0xb280('0x31')]));_0x11d412[_0xb280('0x30')]=_0x11d412['attributes'][_0xb280('0x32')]?_0x11d412[_0xb280('0x30')]:_0x5b7501[_0xb280('0x2f')];if(_0x5dd0cc['query'][_0xb280('0x3d')]){_0x11d412[_0xb280('0x3e')]=[{'all':!![]}];}_0x11d412=_['merge']({},_0x11d412,_0x5dd0cc['options']);return db['Attachment']['find'](_0x11d412)[_0xb280('0x22')](handleEntityNotFound(_0x2c7831,null))[_0xb280('0x22')](respondWithResult(_0x2c7831,null))['catch'](handleError(_0x2c7831,null));};exports[_0xb280('0x43')]=function(_0xe4ff86,_0x25a7cc){var _0x5bd341={'where':{'id':_0xe4ff86[_0xb280('0x44')]['id']}},_0x80f81e={};_0x80f81e[_0xb280('0x2f')]=_[_0xb280('0x2c')](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5bd341['attributes']=_[_0xb280('0x2e')](_0x80f81e[_0xb280('0x2f')],qs[_0xb280('0x31')](_0xe4ff86[_0xb280('0x2b')][_0xb280('0x31')]));_0x5bd341[_0xb280('0x30')]=_0x5bd341[_0xb280('0x30')][_0xb280('0x32')]?_0x5bd341[_0xb280('0x30')]:_0x80f81e['model'];if(_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]){_0x5bd341[_0xb280('0x3e')]=[{'all':!![]}];}_0x5bd341=_[_0xb280('0x39')]({},_0x5bd341,_0xe4ff86['options']);return db[_0xb280('0x28')]['find'](_0x5bd341)[_0xb280('0x22')](handleEntityNotFound(_0x25a7cc,null))[_0xb280('0x22')](function(_0x845a9b){if(_0x845a9b){var _0x1085b6=_0x845a9b[_0xb280('0x45')]({'plain':!![]});_0x1085b6=qs[_0xb280('0x46')](_0x1085b6,['id','createdAt','updatedAt']);_0xe4ff86[_0xb280('0x47')]=_[_0xb280('0x46')](_0xe4ff86['body'],['id',_0xb280('0x48'),'updatedAt']);return db['Attachment'][_0xb280('0x49')](_[_0xb280('0x39')](_0x1085b6,_0xe4ff86[_0xb280('0x47')]),{'include':_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]?[{'all':!![]}]:undefined});}})[_0xb280('0x22')](respondWithResult(_0x25a7cc,0xc9))[_0xb280('0x41')](handleError(_0x25a7cc,null));};exports['update']=function(_0x7fdb22,_0x32468a){if(_0x7fdb22[_0xb280('0x47')]['id']){delete _0x7fdb22[_0xb280('0x47')]['id'];}return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x7fdb22[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x32468a,null))[_0xb280('0x22')](saveUpdates(_0x7fdb22['body'],null))[_0xb280('0x22')](respondWithResult(_0x32468a,null))['catch'](handleError(_0x32468a,null));};exports['destroy']=function(_0x3b1339,_0x55df54){return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x3b1339[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x55df54,null))['then'](removeEntity(_0x55df54,null))[_0xb280('0x41')](handleError(_0x55df54,null));};exports[_0xb280('0x49')]=function(_0x5d0dfd,_0x1485c0,_0x7baf2a){_0x5d0dfd[_0xb280('0x47')][_0xb280('0x25')]=_0x5d0dfd['file'][_0xb280('0x4b')];_0x5d0dfd[_0xb280('0x47')][_0xb280('0x4c')]=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4e')];_0x5d0dfd[_0xb280('0x47')]['type']=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4f')];return db[_0xb280('0x28')][_0xb280('0x49')](_0x5d0dfd[_0xb280('0x47')])[_0xb280('0x22')](respondWithResult(_0x1485c0,0xc9))[_0xb280('0x41')](handleError(_0x1485c0,null));};exports[_0xb280('0x50')]=function(_0x863481,_0x435675,_0x28f28c){return db[_0xb280('0x28')][_0xb280('0x51')]({'where':{'id':_0x863481[_0xb280('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x435675,null))[_0xb280('0x22')](function(_0x54f53b){if(_0x54f53b){var _0x9f5e75=_0x54f53b[_0xb280('0x52')]!==null;var _0x5b35de=path[_0xb280('0x53')](config[_0xb280('0x54')],_0xb280('0x55'));if(_0x9f5e75){_0x5b35de=path[_0xb280('0x53')](_0x5b35de,_0xb280('0x56'));}var _0xca1404=path[_0xb280('0x53')](_0x5b35de,_0x54f53b[_0xb280('0x4c')]);return _0x435675[_0xb280('0x50')](_0xca1404);}})[_0xb280('0x41')](handleError(_0x435675,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 9424116..9ae68aa 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 _0x0835=['api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x25b441,_0x2ee167){var _0x522f83=function(_0x586af2){while(--_0x586af2){_0x25b441['push'](_0x25b441['shift']());}};_0x522f83(++_0x2ee167);}(_0x0835,0x1eb));var _0x5083=function(_0x25da90,_0x2f9eef){_0x25da90=_0x25da90-0x0;var _0x278407=_0x0835[_0x25da90];return _0x278407;};'use strict';var _=require(_0x5083('0x0'));var util=require(_0x5083('0x1'));var logger=require(_0x5083('0x2'))(_0x5083('0x3'));var moment=require('moment');var BPromise=require(_0x5083('0x4'));var rp=require(_0x5083('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5083('0x6'));var config=require(_0x5083('0x7'));var attributes=require(_0x5083('0x8'));module[_0x5083('0x9')]=function(_0x2389e3,_0x243393){return _0x2389e3[_0x5083('0xa')](_0x5083('0xb'),attributes,{'tableName':_0x5083('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7611=['rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x3eb2f4,_0x51516a){var _0x59fb19=function(_0x1ed9d9){while(--_0x1ed9d9){_0x3eb2f4['push'](_0x3eb2f4['shift']());}};_0x59fb19(++_0x51516a);}(_0x7611,0xaf));var _0x1761=function(_0x925658,_0x35e35d){_0x925658=_0x925658-0x0;var _0x2b9837=_0x7611[_0x925658];return _0x2b9837;};'use strict';var _=require(_0x1761('0x0'));var util=require(_0x1761('0x1'));var logger=require(_0x1761('0x2'))(_0x1761('0x3'));var moment=require(_0x1761('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1761('0x5'));var config=require('../../config/environment');var attributes=require(_0x1761('0x6'));module[_0x1761('0x7')]=function(_0x95a1ed,_0x39d234){return _0x95a1ed[_0x1761('0x8')]('Attachment',attributes,{'tableName':_0x1761('0x9'),'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 981b9f8..13bf39c 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 _0xff96=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','catch','body','options','raw','CreateAttachment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xff96,0x179));var _0x6ff9=function(_0x5b360e,_0x494136){_0x5b360e=_0x5b360e-0x0;var _0x1bf752=_0xff96[_0x5b360e];return _0x1bf752;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5509ee,_0x502cf2,_0x4f982b){return new BPromise(function(_0x5d56f4,_0x2b1b7d){return client[_0x6ff9('0xd')](_0x5509ee,_0x4f982b)[_0x6ff9('0xe')](function(_0x1ce5a3){logger[_0x6ff9('0xf')]('Attachment,\x20%s,\x20%s',_0x502cf2,_0x6ff9('0x10'));logger[_0x6ff9('0x11')](_0x6ff9('0x12'),_0x502cf2,_0x6ff9('0x10'),JSON[_0x6ff9('0x13')](_0x1ce5a3));if(_0x1ce5a3[_0x6ff9('0x14')]){if(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x15')]===0x1f4){logger[_0x6ff9('0x14')]('Attachment,\x20%s,\x20%s',_0x502cf2,_0x1ce5a3['error'][_0x6ff9('0x16')]);return _0x2b1b7d(_0x1ce5a3['error'][_0x6ff9('0x16')]);}logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x1ce5a3['error']['message']);return _0x5d56f4(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x16')]);}else{logger[_0x6ff9('0xf')](_0x6ff9('0x17'),_0x502cf2,'request\x20sent');_0x5d56f4(_0x1ce5a3['result'][_0x6ff9('0x16')]);}})[_0x6ff9('0x18')](function(_0x3d4268){logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x3d4268);_0x2b1b7d(_0x3d4268);});});}exports['CreateAttachment']=function(_0xc00da6){var _0x4756be=this;return new Promise(function(_0xc7724f,_0x5b0a94){return db['Attachment']['create'](_0xc00da6[_0x6ff9('0x19')],{'raw':_0xc00da6[_0x6ff9('0x1a')]?_0xc00da6[_0x6ff9('0x1a')][_0x6ff9('0x1b')]===undefined?!![]:![]:!![]})[_0x6ff9('0xe')](function(_0x4e926e){logger[_0x6ff9('0xf')](_0x6ff9('0x1c'),_0xc00da6);logger[_0x6ff9('0x11')](_0x6ff9('0x1c'),_0xc00da6,JSON[_0x6ff9('0x13')](_0x4e926e));_0xc7724f(_0x4e926e);})[_0x6ff9('0x18')](function(_0x50f207){logger[_0x6ff9('0x14')](_0x6ff9('0x1c'),_0x50f207['message'],_0xc00da6);_0x5b0a94(_0x4756be[_0x6ff9('0x14')](0x1f4,_0x50f207[_0x6ff9('0x16')]));});});};
\ No newline at end of file
+var _0x04d0=['../../mysqldb','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x04d0,0x10a));var _0x004d=function(_0x27d1a1,_0x252378){_0x27d1a1=_0x27d1a1-0x0;var _0x1225ad=_0x04d0[_0x27d1a1];return _0x1225ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e8bd,_0x2da158,_0x4d0ae4){return new BPromise(function(_0x1f0efd,_0x58d4f5){return client[_0x004d('0x8')](_0x36e8bd,_0x4d0ae4)[_0x004d('0x9')](function(_0x2d9da5){logger['info'](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));logger['debug'](_0x004d('0xc'),_0x2da158,'request\x20sent',JSON[_0x004d('0xd')](_0x2d9da5));if(_0x2d9da5[_0x004d('0xe')]){if(_0x2d9da5['error'][_0x004d('0xf')]===0x1f4){logger['error'](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);return _0x58d4f5(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')]['message']);return _0x1f0efd(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}else{logger[_0x004d('0x11')](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));_0x1f0efd(_0x2d9da5[_0x004d('0x12')][_0x004d('0x10')]);}})[_0x004d('0x13')](function(_0x5b4f40){logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x5b4f40);_0x58d4f5(_0x5b4f40);});});}exports[_0x004d('0x14')]=function(_0x4b3912){var _0x1adf2a=this;return new Promise(function(_0x583196,_0x40de7e){return db[_0x004d('0x15')][_0x004d('0x16')](_0x4b3912[_0x004d('0x17')],{'raw':_0x4b3912['options']?_0x4b3912[_0x004d('0x18')][_0x004d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x31ac5c){logger[_0x004d('0x11')](_0x004d('0x14'),_0x4b3912);logger[_0x004d('0x1a')]('CreateAttachment',_0x4b3912,JSON[_0x004d('0xd')](_0x31ac5c));_0x583196(_0x31ac5c);})[_0x004d('0x13')](function(_0x2da052){logger[_0x004d('0xe')](_0x004d('0x14'),_0x2da052[_0x004d('0x10')],_0x4b3912);_0x40de7e(_0x1adf2a[_0x004d('0xe')](0x1f4,_0x2da052[_0x004d('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index df50388..2b44543 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3d6a29,_0x37856f){var _0x10e16f=function(_0x4e05f2){while(--_0x4e05f2){_0x3d6a29['push'](_0x3d6a29['shift']());}};_0x10e16f(++_0x37856f);}(_0x2032,0xd9));var _0x2203=function(_0x411232,_0x338d2b){_0x411232=_0x411232-0x0;var _0x3bfcda=_0x2032[_0x411232];return _0x3bfcda;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _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(_0x15ccd9,_0x51a714){var _0x1bd6f3=function(_0x17cc0d){while(--_0x17cc0d){_0x15ccd9['push'](_0x15ccd9['shift']());}};_0x1bd6f3(++_0x51a714);}(_0x757a,0xde));var _0xa757=function(_0xd6c5fa,_0x39d0e3){_0xd6c5fa=_0xd6c5fa-0x0;var _0x35d2a1=_0x757a[_0xd6c5fa];return _0x35d2a1;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index df5cd05..63a3aec 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 _0xc1ea=['catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','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','Setting','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','then','clearBlockUser','getLicense'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc1ea,0x13d));var _0xac1e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc1ea[_0x19950b];return _0x3c6b41;};'use strict';var passport=require(_0xac1e('0x0'));var LocalStrategy=require(_0xac1e('0x1'))[_0xac1e('0x2')];var moment=require(_0xac1e('0x3'));var ActiveDirectory=require(_0xac1e('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xac1e('0x5'));var utils=require(_0xac1e('0x6'));var config=require(_0xac1e('0x7'));var logger=require(_0xac1e('0x8'))('api');function isActiveDirectoryConfigured(_0x244ed6){var _0x46a341=![];if(typeof _0x244ed6['activedirectory']!==_0xac1e('0x9')){_0x46a341=_0x244ed6[_0xac1e('0xa')][_0xac1e('0xb')]&&_0x244ed6['activedirectory']['url']&&_0x244ed6['activedirectory'][_0xac1e('0xc')];}return _0x46a341;}function adAuthenticate(_0x333af4,_0x4ab670,_0x33b8bd){return new BPromise(function(_0x887bc4,_0x1176f2){try{var _0x3fc796=new ActiveDirectory(_0x333af4);_0x3fc796[_0xac1e('0xd')](_0x4ab670,_0x33b8bd,function(_0x187030,_0x2da492){if(_0x187030){logger[_0xac1e('0xe')](_0xac1e('0xf'),_0x4ab670,util['inspect'](_0x187030,{'showHidden':![],'depth':null}));_0x1176f2(_0xac1e('0x10'));}else if(!_0x2da492){logger[_0xac1e('0xe')](_0xac1e('0x11'),_0x4ab670);_0x1176f2(_0xac1e('0x10'));}else{_0x887bc4(_0x2da492);}});}catch(_0x3df19a){_0x1176f2(_0x3df19a);}});}function ActiveDirectoryAuthenticate(_0x354412,_0x103155,_0x1d41f7,_0x1ce20a){var _0x367782,_0x365a20;if(!isActiveDirectoryConfigured(config)){logger[_0xac1e('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x103155);return _0x1ce20a(null,![],{'message':_0xac1e('0x10')});}return db[_0xac1e('0x12')][_0xac1e('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xac1e('0x14')],'raw':!![]})['then'](function(_0x197a25){_0x367782=_0x197a25;if(!_0x367782['adSsoEnabled']){logger[_0xac1e('0xe')](_0xac1e('0x15'),_0x103155);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x354412[_0xac1e('0x13')]({'attributes':['id',_0xac1e('0x16'),_0xac1e('0x17'),_0xac1e('0x18'),_0xac1e('0x19'),_0xac1e('0x1a'),_0xac1e('0x1b'),_0xac1e('0x1c'),_0xac1e('0x1d')],'where':{'name':_0x103155,'role':{'$or':[_0xac1e('0x1e'),_0xac1e('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xac1e('0x20')](function(_0xf78f5c){if(!_0xf78f5c||_0xf78f5c&&_0xf78f5c[_0xac1e('0x16')]!==_0x103155){throw new Error(_0xac1e('0x10'));}_0x365a20=_0xf78f5c;var _0x20004a=_0x365a20[_0xac1e('0x16')]+'@'+config[_0xac1e('0xa')]['domain'];return adAuthenticate(config[_0xac1e('0xa')],_0x20004a,_0x1d41f7);})['then'](function(_0x24e478){if(_0x365a20[_0xac1e('0x1a')]){throw new Error(_0xac1e('0x10'));}if(_0x367782[_0xac1e('0x14')]>0x0){if(_0x365a20[_0xac1e('0x1b')]){if(moment(_0x365a20[_0xac1e('0x1c')])['add'](_0x367782['blockDuration'],'minutes')>moment()){throw new Error(_0xac1e('0x10'));}return utils[_0xac1e('0x21')](_0x365a20,0x0,![],null)[_0xac1e('0x20')](function(){return utils[_0xac1e('0x22')](_0x365a20);})[_0xac1e('0x20')](function(){return _0x1ce20a(null,_0x365a20);});}else{return utils[_0xac1e('0x22')](_0x365a20)[_0xac1e('0x20')](function(){return _0x1ce20a(null,_0x365a20);});}}else{return utils['getLicense'](_0x365a20)['then'](function(){return _0x1ce20a(null,_0x365a20);});}})[_0xac1e('0x23')](function(_0x4d48b3){return _0x1ce20a(null,![],_0x4d48b3);});}function handleError(_0x61c90e,_0x2adb7b,_0x15f529){return _0x61c90e[_0xac1e('0x24')](_0x2adb7b||0x1f4)[_0xac1e('0x25')]({'message':_0x15f529?_0x15f529['message']||_0x15f529:''});}exports[_0xac1e('0x26')]=function(_0x54026f,_0x247191,_0x470e28){passport[_0xac1e('0xd')](_0xac1e('0x27'),function(_0x1670a9,_0x395755,_0x523dda){var _0x2723d6=_0x1670a9||_0x523dda;if(_0x2723d6){return handleError(_0x247191,0x191,_0x2723d6);}if(!_0x395755){return handleError(_0x247191,0x194,{'message':_0xac1e('0x28')});}else{var _0x2b2433={'payload':{'id':_0x395755['id'],'role':_0x395755['role']},'options':{'expiresIn':0x15180}};return authService[_0xac1e('0x29')](_0x2b2433)[_0xac1e('0x20')](function(_0x1584a7){_0x247191[_0xac1e('0x2a')]({'id':_0x395755['id'],'token':_0x1584a7,'statusCall':'','isAlreadyLogged':_0x395755[_0xac1e('0x1d')]});});}})(_0x54026f,_0x247191,_0x470e28);};passport[_0xac1e('0x2b')](_0xac1e('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0xac1e('0x17')},function(_0x157d86,_0x155d15,_0x204ec2){return ActiveDirectoryAuthenticate(db['User'],_0x157d86,_0x155d15,_0x204ec2);}));
\ No newline at end of file
+var _0xa994=['../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled','blocked','online','admin','user','domain','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password','passport-local','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa994,0x150));var _0x4a99=function(_0x2d4963,_0x430e5f){_0x2d4963=_0x2d4963-0x0;var _0x3caa5f=_0xa994[_0x2d4963];return _0x3caa5f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4a99('0x0'))['Strategy'];var moment=require(_0x4a99('0x1'));var ActiveDirectory=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x4a99('0x4'));var utils=require(_0x4a99('0x5'));var config=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));function isActiveDirectoryConfigured(_0x4a0718){var _0x1d03b0=![];if(typeof _0x4a0718[_0x4a99('0x9')]!==_0x4a99('0xa')){_0x1d03b0=_0x4a0718[_0x4a99('0x9')][_0x4a99('0xb')]&&_0x4a0718['activedirectory'][_0x4a99('0xc')]&&_0x4a0718[_0x4a99('0x9')]['domain'];}return _0x1d03b0;}function adAuthenticate(_0xb9ae0b,_0x42b04d,_0x38b46e){return new BPromise(function(_0x2c9291,_0x37ce9b){try{var _0xb6082f=new ActiveDirectory(_0xb9ae0b);_0xb6082f[_0x4a99('0xd')](_0x42b04d,_0x38b46e,function(_0x317ab6,_0xf737c8){if(_0x317ab6){logger[_0x4a99('0xe')](_0x4a99('0xf'),_0x42b04d,util[_0x4a99('0x10')](_0x317ab6,{'showHidden':![],'depth':null}));_0x37ce9b(_0x4a99('0x11'));}else if(!_0xf737c8){logger[_0x4a99('0xe')](_0x4a99('0x12'),_0x42b04d);_0x37ce9b(_0x4a99('0x11'));}else{_0x2c9291(_0xf737c8);}});}catch(_0x450525){_0x37ce9b(_0x450525);}});}function ActiveDirectoryAuthenticate(_0x83eed8,_0x3712bd,_0x4668db,_0x225f5a){var _0x6c53da,_0x1d7861;if(!isActiveDirectoryConfigured(config)){logger[_0x4a99('0xe')](_0x4a99('0x13'),_0x3712bd);return _0x225f5a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4a99('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a99('0x15'),_0x4a99('0x16')],'raw':!![]})[_0x4a99('0x17')](function(_0x3e8f8c){_0x6c53da=_0x3e8f8c;if(!_0x6c53da[_0x4a99('0x15')]){logger[_0x4a99('0xe')](_0x4a99('0x18'),_0x3712bd);throw new Error(_0x4a99('0x11'));}return _0x83eed8[_0x4a99('0x19')]({'attributes':['id',_0x4a99('0x1a'),'password',_0x4a99('0x1b'),_0x4a99('0x1c'),_0x4a99('0x1d'),_0x4a99('0x1e'),'blockedAt',_0x4a99('0x1f')],'where':{'name':_0x3712bd,'role':{'$or':[_0x4a99('0x20'),_0x4a99('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0x4a99('0x17')](function(_0x4ef9bc){if(!_0x4ef9bc||_0x4ef9bc&&_0x4ef9bc[_0x4a99('0x1a')]!==_0x3712bd){throw new Error(_0x4a99('0x11'));}_0x1d7861=_0x4ef9bc;var _0x337f64=_0x1d7861[_0x4a99('0x1a')]+'@'+config['activedirectory'][_0x4a99('0x22')];return adAuthenticate(config[_0x4a99('0x9')],_0x337f64,_0x4668db);})[_0x4a99('0x17')](function(_0x16bb62){if(_0x1d7861[_0x4a99('0x1d')]){throw new Error(_0x4a99('0x11'));}if(_0x6c53da['blockDuration']>0x0){if(_0x1d7861[_0x4a99('0x1e')]){if(moment(_0x1d7861[_0x4a99('0x23')])[_0x4a99('0x24')](_0x6c53da[_0x4a99('0x16')],_0x4a99('0x25'))>moment()){throw new Error(_0x4a99('0x11'));}return utils[_0x4a99('0x26')](_0x1d7861,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1d7861);})['then'](function(){return _0x225f5a(null,_0x1d7861);});}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}})[_0x4a99('0x28')](function(_0x35a67e){return _0x225f5a(null,![],_0x35a67e);});}function handleError(_0x63d9f7,_0x429529,_0x41a01c){return _0x63d9f7['status'](_0x429529||0x1f4)[_0x4a99('0x29')]({'message':_0x41a01c?_0x41a01c[_0x4a99('0x2a')]||_0x41a01c:''});}exports[_0x4a99('0x2b')]=function(_0x45e34f,_0x552851,_0x1e0b64){passport['authenticate'](_0x4a99('0x2c'),function(_0x16f7e8,_0x1e85bc,_0x21b4a3){var _0x4e3670=_0x16f7e8||_0x21b4a3;if(_0x4e3670){return handleError(_0x552851,0x191,_0x4e3670);}if(!_0x1e85bc){return handleError(_0x552851,0x194,{'message':_0x4a99('0x2d')});}else{var _0x325608={'payload':{'id':_0x1e85bc['id'],'role':_0x1e85bc['role']},'options':{'expiresIn':0x15180}};return authService[_0x4a99('0x2e')](_0x325608)[_0x4a99('0x17')](function(_0x423696){_0x552851['json']({'id':_0x1e85bc['id'],'token':_0x423696,'statusCall':'','isAlreadyLogged':_0x1e85bc[_0x4a99('0x1f')]});});}})(_0x45e34f,_0x552851,_0x1e0b64);};passport[_0x4a99('0x2f')](_0x4a99('0x2c'),new LocalStrategy({'usernameField':_0x4a99('0x1a'),'passwordField':_0x4a99('0x30')},function(_0x1ba1a1,_0x30b58a,_0x53cb41){return ActiveDirectoryAuthenticate(db['User'],_0x1ba1a1,_0x30b58a,_0x53cb41);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0b3e35e..172ef51 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 _0x6203=['Router','login','exports'];(function(_0x431d2c,_0x12dac6){var _0x2e86d2=function(_0x3f68a8){while(--_0x3f68a8){_0x431d2c['push'](_0x431d2c['shift']());}};_0x2e86d2(++_0x12dac6);}(_0x6203,0x12c));var _0x3620=function(_0x1ce554,_0x507b9b){_0x1ce554=_0x1ce554-0x0;var _0x4f062a=_0x6203[_0x1ce554];return _0x4f062a;};'use strict';var express=require('express');var router=express[_0x3620('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x3620('0x1')]);module[_0x3620('0x2')]=router;
\ No newline at end of file
+var _0x41fc=['./authActiveDirectory.controller','login','exports'];(function(_0x38c27e,_0x469e85){var _0x370bc6=function(_0x2f92f2){while(--_0x2f92f2){_0x38c27e['push'](_0x38c27e['shift']());}};_0x370bc6(++_0x469e85);}(_0x41fc,0x126));var _0xc41f=function(_0x6fbc58,_0x5a2cf1){_0x6fbc58=_0x6fbc58-0x0;var _0x266f48=_0x41fc[_0x6fbc58];return _0x266f48;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc41f('0x0'));router['post']('/',controller[_0xc41f('0x1')]);module[_0xc41f('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0d5fe97..453381a 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x116597,_0x1067a3){_0x116597=_0x116597-0x0;var _0x25522a=_0x7a54[_0x116597];return _0x25522a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1193,_0x17c294){_0x1c1193=_0x1c1193-0x0;var _0x80047b=_0x7a54[_0x1c1193];return _0x80047b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 022e0f0..095e9e5 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 _0xa7ff=['exports','express','Router','./authGoogle.controller','get','/callback','callback','isMiddleware','login','setTokenCookie'];(function(_0x1d17e1,_0x548a17){var _0x4353c6=function(_0x4b94aa){while(--_0x4b94aa){_0x1d17e1['push'](_0x1d17e1['shift']());}};_0x4353c6(++_0x548a17);}(_0xa7ff,0x169));var _0xfa7f=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xa7ff[_0x580647];return _0x5f0792;};'use strict';var express=require(_0xfa7f('0x0'));var passport=require('passport');var router=express[_0xfa7f('0x1')]();var controller=require(_0xfa7f('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xfa7f('0x3')]('/',controller['login']);router[_0xfa7f('0x3')](_0xfa7f('0x4'),controller[_0xfa7f('0x5')],authService[_0xfa7f('0x6')],userController[_0xfa7f('0x7')],authService[_0xfa7f('0x8')]);module[_0xfa7f('0x9')]=router;
\ No newline at end of file
+var _0x43a1=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43a1,0x138));var _0x143a=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x43a1[_0x21aafd];return _0x9f2800;};'use strict';var express=require(_0x143a('0x0'));var passport=require('passport');var router=express[_0x143a('0x1')]();var controller=require(_0x143a('0x2'));var userController=require(_0x143a('0x3'));var authService=require(_0x143a('0x4'));router[_0x143a('0x5')]('/',controller[_0x143a('0x6')]);router[_0x143a('0x5')](_0x143a('0x7'),controller[_0x143a('0x8')],authService[_0x143a('0x9')],userController[_0x143a('0x6')],authService[_0x143a('0xa')]);module[_0x143a('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 3c8a9f4..f178a99 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 _0xde9f=['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!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','util','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockedAt','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','email','SendMail','format','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0x245de1,_0x35a17a){var _0xfdcc1d=function(_0x4297e8){while(--_0x4297e8){_0x245de1['push'](_0x245de1['shift']());}};_0xfdcc1d(++_0x35a17a);}(_0xde9f,0x118));var _0xfde9=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xde9f[_0xe73080];return _0x12cbc4;};'use strict';var util=require(_0xfde9('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xfde9('0x1')];var jayson=require(_0xfde9('0x2'));var _=require('lodash');var rs=require(_0xfde9('0x3'));var moment=require(_0xfde9('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfde9('0x5'));var utils=require(_0xfde9('0x6'));var client=jayson[_0xfde9('0x7')][_0xfde9('0x8')]({'port':0x232b});function localAuthenticate(_0x5e69c0,_0x4c3e01,_0x179ee0,_0x18a202){var _0x5569c2,_0x19a337;return db[_0xfde9('0x9')][_0xfde9('0xa')]({'where':{'id':0x1},'attributes':[_0xfde9('0xb'),_0xfde9('0xc')],'raw':!![]})[_0xfde9('0xd')](function(_0x3f29cd){_0x5569c2=_0x3f29cd;return _0x5e69c0[_0xfde9('0xa')]({'attributes':['id',_0xfde9('0xe'),_0xfde9('0xf'),_0xfde9('0x10'),_0xfde9('0x11'),_0xfde9('0x12'),_0xfde9('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x4c3e01,'role':{'$or':[_0xfde9('0x14'),_0xfde9('0x15'),_0xfde9('0x16')]}}});})[_0xfde9('0xd')](function(_0x52aacf){if(!_0x52aacf||_0x52aacf&&_0x52aacf['name']!==_0x4c3e01){throw new Error(_0xfde9('0x17'));}else{_0x19a337=_0x52aacf;return _0x19a337;}})[_0xfde9('0xd')](function(){_0x19a337[_0xfde9('0x18')](_0x179ee0,function(_0x5961ae,_0x29fa8a){var _0x489841=_0x19a337[_0xfde9('0x19')]+0x1;if(_0x5961ae){return _0x18a202(_0x5961ae);}else if(!_0x29fa8a){if(_0x19a337[_0xfde9('0x12')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else if(_0x5569c2['allowedLoginAttempts']>0x0){if(_0x19a337[_0xfde9('0x13')]){if(_0x5569c2[_0xfde9('0xc')]>0x0){if(moment(_0x19a337[_0xfde9('0x1a')])['add'](_0x5569c2['blockDuration'],'minutes')>moment()){return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xfde9('0x1b')](_0x19a337,_0x489841,![],null)[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x489841>=_0x5569c2[_0xfde9('0xb')]){return utils[_0xfde9('0x1b')](_0x19a337,0x0,!![],moment())[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':_0xfde9('0x17')});});}else{return utils[_0xfde9('0x1b')](_0x19a337,_0x489841,![],null)[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':_0xfde9('0x17')});});}}}else{return _0x18a202(null,![],{'message':_0xfde9('0x17')});}}else{if(_0x19a337[_0xfde9('0x12')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else if(_0x5569c2[_0xfde9('0xb')]>0x0){if(_0x19a337[_0xfde9('0x13')]){if(_0x5569c2['blockDuration']>0x0){if(moment(_0x19a337[_0xfde9('0x1a')])['add'](_0x5569c2[_0xfde9('0xc')],_0xfde9('0x1c'))>moment()){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else{return utils['clearBlockUser'](_0x19a337,0x0,![],null)[_0xfde9('0xd')](function(){return utils[_0xfde9('0x1d')](_0x19a337);})['then'](function(){return _0x18a202(null,_0x19a337);});}}else{return _0x18a202(null,![],{'message':_0xfde9('0x17')});}}else{return utils[_0xfde9('0x1b')](_0x19a337,0x0,![],null)[_0xfde9('0xd')](function(){return utils[_0xfde9('0x1d')](_0x19a337);})[_0xfde9('0xd')](function(){return _0x18a202(null,_0x19a337);})[_0xfde9('0x1e')](function(_0x1f2e12){return _0x18a202(null,![],_0x1f2e12);});}}else{if(_0x19a337[_0xfde9('0x13')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else{return utils[_0xfde9('0x1d')](_0x19a337)[_0xfde9('0xd')](function(){return _0x18a202(null,_0x19a337);});}}}});})[_0xfde9('0x1e')](function(_0x457402){return _0x18a202(null,![],_0x457402);});}function sendServiceMail(_0x441bba){return db[_0xfde9('0x1f')][_0xfde9('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xfde9('0x21')],'as':_0xfde9('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xfde9('0x23')}]}]})[_0xfde9('0xd')](function(_0x1651e0){if(!_0x1651e0){throw new Error(_0xfde9('0x24'));}var _0x3c8c48=_0x1651e0['getSmtpOptions']();var _0x375b0d={'account':_0x3c8c48,'message':_[_0xfde9('0x25')]({'from':util['format'](_0xfde9('0x26'),_0x1651e0[_0xfde9('0xe')],_0x1651e0[_0xfde9('0x27')]||_0x1651e0[_0xfde9('0x22')][_0xfde9('0x15')])},_0x441bba)};return client['request'](_0xfde9('0x28'),_0x375b0d);})['then'](function(_0x35dfe5){if(_0x35dfe5['error']){throw new Error(util[_0xfde9('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x35dfe5[_0xfde9('0x2a')]['message']||JSON[_0xfde9('0x2b')](_0x35dfe5[_0xfde9('0x2a')])));}return!![];});}function handleError(_0x3f5038,_0x27ad23,_0xdf5264){return _0x3f5038[_0xfde9('0x2c')](_0x27ad23||0x1f4)[_0xfde9('0x2d')]({'message':_0xdf5264?_0xdf5264[_0xfde9('0x2e')]||_0xdf5264:''});}exports[_0xfde9('0x2f')]=function(_0x91a8e9,_0x3f9c43,_0x5310cf){passport[_0xfde9('0x18')](_0xfde9('0x30'),function(_0x20c2a4,_0x304323,_0x4f6b6e){var _0x3cd49c=_0x20c2a4||_0x4f6b6e;if(_0x3cd49c){return handleError(_0x3f9c43,0x191,_0x3cd49c);}if(!_0x304323){return handleError(_0x3f9c43,0x194,{'message':_0xfde9('0x31')});}else{var _0x2cea35={'payload':{'id':_0x304323['id'],'role':_0x304323[_0xfde9('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xfde9('0x32')](_0x2cea35)[_0xfde9('0xd')](function(_0x481488){_0x3f9c43[_0xfde9('0x33')]({'id':_0x304323['id'],'token':_0x481488,'statusCall':'','isAlreadyLogged':_0x304323['online']});});}})(_0x91a8e9,_0x3f9c43,_0x5310cf);};exports[_0xfde9('0x34')]=function(_0x1c57df,_0xbd5dd8){if(!_0x1c57df['body'][_0xfde9('0x27')]){return handleError(_0xbd5dd8,0x1f4,{'message':_0xfde9('0x35')});}var _0x60efca=rs[_0xfde9('0x36')]();_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]=_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]['trim']()[_0xfde9('0x38')]();var _0x3496aa;return db[_0xfde9('0x9')][_0xfde9('0xa')]({'where':{'id':0x1},'attributes':[_0xfde9('0xb'),'blockDuration'],'raw':!![]})[_0xfde9('0xd')](function(_0x266d01){_0x3496aa=_0x266d01;return db['User'][_0xfde9('0x20')]({'where':{'email':_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]}});})['then'](function(_0x510173){if(!_0x510173){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x510173[_0xfde9('0x12')]){throw new Error(_0xfde9('0x39'));}if(_0x510173[_0xfde9('0x13')]){if(moment(_0x510173[_0xfde9('0x1a')])[_0xfde9('0x3a')](_0x3496aa[_0xfde9('0xc')],_0xfde9('0x1c'))>moment()){throw new Error(_0xfde9('0x3b'));}else{_0x510173[_0xfde9('0x13')]=![];_0x510173[_0xfde9('0x1a')]=null;}}_0x510173[_0xfde9('0x3c')]=_0x60efca;_0x510173[_0xfde9('0x3d')]=Date['now']()+0x36ee80;return _0x510173['save']();})['then'](function(){return sendServiceMail({'to':_0x1c57df['body'][_0xfde9('0x27')],'subject':_0xfde9('0x3e'),'text':_0xfde9('0x3f')+_0xfde9('0x40')+_0xfde9('0x41')+_0x1c57df[_0xfde9('0x42')][_0xfde9('0x43')]+_0xfde9('0x44')+_0x60efca+'\x0a\x0a'+_0xfde9('0x45')});})[_0xfde9('0xd')](function(){_0xbd5dd8[_0xfde9('0x2c')](0xc8)[_0xfde9('0x2d')]({'message':_0xfde9('0x46')});})[_0xfde9('0x1e')](function(_0x43f664){return handleError(_0xbd5dd8,0x1f4,_0x43f664);});};exports[_0xfde9('0x47')]=function(_0x3d4ca7,_0xcf7c00){return db[_0xfde9('0x48')]['find']({'where':{'resetPasswordToken':_0x3d4ca7[_0xfde9('0x49')][_0xfde9('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xfde9('0x4b')]()}}})[_0xfde9('0xd')](function(_0x72cf29){if(!_0x72cf29){throw new Error(_0xfde9('0x4c'));}return db['Setting'][_0xfde9('0xa')]({'attributes':['id','securePassword',_0xfde9('0x4d'),'passwordHistoryLimit']})[_0xfde9('0xd')](function(_0x30f12d){if(_0x30f12d[_0xfde9('0x4e')])authService[_0xfde9('0x4f')](_0x3d4ca7[_0xfde9('0x37')]['password']);if(!_0x30f12d[_0xfde9('0x4d')]||!_0x72cf29[_0xfde9('0x50')])return _0x72cf29;authService[_0xfde9('0x51')](_0x3d4ca7[_0xfde9('0x37')][_0xfde9('0xf')],_0x72cf29[_0xfde9('0x50')],_0x30f12d[_0xfde9('0x52')]);return _0x72cf29;})[_0xfde9('0xd')](function(){_0x72cf29[_0xfde9('0xf')]=_0x3d4ca7[_0xfde9('0x37')][_0xfde9('0xf')];_0x72cf29['resetPasswordToken']=null;_0x72cf29[_0xfde9('0x3d')]=null;return _0x72cf29[_0xfde9('0x53')]();});})[_0xfde9('0xd')](function(){_0xcf7c00[_0xfde9('0x2c')](0xc8)[_0xfde9('0x2d')]({'message':_0xfde9('0x54')});})[_0xfde9('0x1e')](function(_0x418fd2){return handleError(_0xcf7c00,0x1f4,_0x418fd2);});};passport[_0xfde9('0x55')](_0xfde9('0x30'),new LocalStrategy({'usernameField':_0xfde9('0xe'),'passwordField':_0xfde9('0xf')},function(_0x18006d,_0x4d8ab1,_0x3a512b){return localAuthenticate(db['User'],_0x18006d,_0x4d8ab1,_0x3a512b);}));
\ No newline at end of file
+var _0xb7a0=['stringify','status','login','local-login','signToken','json','online','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','blockedAt','resetPasswordExpires','save','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://','send','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','findOne','name','password','role','disabled','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb7a0,0x10c));var _0x0b7a=function(_0x330106,_0x4e50d9){_0x330106=_0x330106-0x0;var _0x492d1c=_0xb7a0[_0x330106];return _0x492d1c;};'use strict';var util=require(_0x0b7a('0x0'));var passport=require(_0x0b7a('0x1'));var LocalStrategy=require(_0x0b7a('0x2'))['Strategy'];var jayson=require(_0x0b7a('0x3'));var _=require(_0x0b7a('0x4'));var rs=require(_0x0b7a('0x5'));var moment=require(_0x0b7a('0x6'));var db=require(_0x0b7a('0x7'))['db'];var authService=require(_0x0b7a('0x8'));var utils=require(_0x0b7a('0x9'));var client=jayson[_0x0b7a('0xa')][_0x0b7a('0xb')]({'port':0x232b});function localAuthenticate(_0x6aa89b,_0x2b2f42,_0x1c32ec,_0x49b1a9){var _0x56b29a,_0x596961;return db[_0x0b7a('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x10e314){_0x56b29a=_0x10e314;return _0x6aa89b[_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0xf'),_0x0b7a('0x10'),'salt',_0x0b7a('0x11'),_0x0b7a('0x12'),_0x0b7a('0x13'),'blockedAt',_0x0b7a('0x14')],'where':{'name':_0x2b2f42,'role':{'$or':['admin',_0x0b7a('0x15'),_0x0b7a('0x16')]}}});})[_0x0b7a('0x17')](function(_0x29dcee){if(!_0x29dcee||_0x29dcee&&_0x29dcee['name']!==_0x2b2f42){throw new Error(_0x0b7a('0x18'));}else{_0x596961=_0x29dcee;return _0x596961;}})[_0x0b7a('0x17')](function(){_0x596961[_0x0b7a('0x19')](_0x1c32ec,function(_0xdb3481,_0x5cc395){var _0x38e9b0=_0x596961[_0x0b7a('0x14')]+0x1;if(_0xdb3481){return _0x49b1a9(_0xdb3481);}else if(!_0x5cc395){if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])[_0x0b7a('0x1b')](_0x56b29a[_0x0b7a('0x1a')],'minutes')>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)['then'](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x38e9b0>=_0x56b29a[_0x0b7a('0xd')]){return utils[_0x0b7a('0x1c')](_0x596961,0x0,!![],moment())['then'](function(){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])['add'](_0x56b29a[_0x0b7a('0x1a')],_0x0b7a('0x1d'))>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)[_0x0b7a('0x17')](function(){return utils[_0x0b7a('0x1e')](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}else{return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)['then'](function(){return utils['getLicense'](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);})['catch'](function(_0x3221e8){return _0x49b1a9(null,![],_0x3221e8);});}}else{if(_0x596961[_0x0b7a('0x13')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1e')](_0x596961)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}}});})[_0x0b7a('0x1f')](function(_0x24f52f){return _0x49b1a9(null,![],_0x24f52f);});}function sendServiceMail(_0x3664a2){return db[_0x0b7a('0x20')][_0x0b7a('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x0b7a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x0b7a('0x23'),'include':[{'model':db[_0x0b7a('0x24')],'as':_0x0b7a('0x24')}]}]})[_0x0b7a('0x17')](function(_0x39a742){if(!_0x39a742){throw new Error(_0x0b7a('0x25'));}var _0x1f4e08=_0x39a742['getSmtpOptions']();var _0x55c0ee={'account':_0x1f4e08,'message':_['merge']({'from':util[_0x0b7a('0x26')](_0x0b7a('0x27'),_0x39a742[_0x0b7a('0xf')],_0x39a742['email']||_0x39a742[_0x0b7a('0x23')]['user'])},_0x3664a2)};return client['request'](_0x0b7a('0x28'),_0x55c0ee);})[_0x0b7a('0x17')](function(_0x2d127d){if(_0x2d127d[_0x0b7a('0x29')]){throw new Error(util[_0x0b7a('0x26')](_0x0b7a('0x2a'),_0x2d127d['error'][_0x0b7a('0x2b')]||JSON[_0x0b7a('0x2c')](_0x2d127d[_0x0b7a('0x29')])));}return!![];});}function handleError(_0x101b2c,_0x4605a1,_0x107f6c){return _0x101b2c[_0x0b7a('0x2d')](_0x4605a1||0x1f4)['send']({'message':_0x107f6c?_0x107f6c[_0x0b7a('0x2b')]||_0x107f6c:''});}exports[_0x0b7a('0x2e')]=function(_0x37f9ba,_0x12cd22,_0x4e37d9){passport[_0x0b7a('0x19')](_0x0b7a('0x2f'),function(_0x574d28,_0x14167c,_0x2c9388){var _0x11282d=_0x574d28||_0x2c9388;if(_0x11282d){return handleError(_0x12cd22,0x191,_0x11282d);}if(!_0x14167c){return handleError(_0x12cd22,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x116fa0={'payload':{'id':_0x14167c['id'],'role':_0x14167c[_0x0b7a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0b7a('0x30')](_0x116fa0)[_0x0b7a('0x17')](function(_0x147c2a){_0x12cd22[_0x0b7a('0x31')]({'id':_0x14167c['id'],'token':_0x147c2a,'statusCall':'','isAlreadyLogged':_0x14167c[_0x0b7a('0x32')]});});}})(_0x37f9ba,_0x12cd22,_0x4e37d9);};exports['forgot']=function(_0x4eb8f1,_0x219779){if(!_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]){return handleError(_0x219779,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xff414a=rs[_0x0b7a('0x34')]();_0x4eb8f1[_0x0b7a('0x33')]['email']=_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')][_0x0b7a('0x35')]()['toLowerCase']();var _0x44f3a5;return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),_0x0b7a('0x1a')],'raw':!![]})['then'](function(_0x37d0a1){_0x44f3a5=_0x37d0a1;return db[_0x0b7a('0x36')]['find']({'where':{'email':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]}});})['then'](function(_0x24d53e){if(!_0x24d53e){throw new Error(_0x0b7a('0x37'));}if(_0x24d53e['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x24d53e[_0x0b7a('0x13')]){if(moment(_0x24d53e['blockedAt'])[_0x0b7a('0x1b')](_0x44f3a5['blockDuration'],_0x0b7a('0x1d'))>moment()){throw new Error(_0x0b7a('0x38'));}else{_0x24d53e[_0x0b7a('0x13')]=![];_0x24d53e[_0x0b7a('0x39')]=null;}}_0x24d53e['resetPasswordToken']=_0xff414a;_0x24d53e[_0x0b7a('0x3a')]=Date['now']()+0x36ee80;return _0x24d53e[_0x0b7a('0x3b')]();})[_0x0b7a('0x17')](function(){return sendServiceMail({'to':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0b7a('0x3c')+_0x0b7a('0x3d')+_0x0b7a('0x3e')+_0x4eb8f1['headers']['host']+'/reset/'+_0xff414a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0b7a('0x17')](function(){_0x219779[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b7a('0x1f')](function(_0xf3d61d){return handleError(_0x219779,0x1f4,_0xf3d61d);});};exports[_0x0b7a('0x40')]=function(_0x32db6b,_0x5e99c2){return db[_0x0b7a('0x36')][_0x0b7a('0x21')]({'where':{'resetPasswordToken':_0x32db6b[_0x0b7a('0x41')][_0x0b7a('0x42')],'resetPasswordExpires':{'$gt':Date[_0x0b7a('0x43')]()}}})[_0x0b7a('0x17')](function(_0x13c8f0){if(!_0x13c8f0){throw new Error(_0x0b7a('0x44'));}return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0x45'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x0b7a('0x17')](function(_0x59ad57){if(_0x59ad57[_0x0b7a('0x45')])authService[_0x0b7a('0x46')](_0x32db6b[_0x0b7a('0x33')]['password']);if(!_0x59ad57[_0x0b7a('0x47')]||!_0x13c8f0[_0x0b7a('0x48')])return _0x13c8f0;authService[_0x0b7a('0x49')](_0x32db6b['body'][_0x0b7a('0x10')],_0x13c8f0[_0x0b7a('0x48')],_0x59ad57[_0x0b7a('0x4a')]);return _0x13c8f0;})[_0x0b7a('0x17')](function(){_0x13c8f0[_0x0b7a('0x10')]=_0x32db6b['body'][_0x0b7a('0x10')];_0x13c8f0[_0x0b7a('0x4b')]=null;_0x13c8f0[_0x0b7a('0x3a')]=null;return _0x13c8f0['save']();});})['then'](function(){_0x5e99c2[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':_0x0b7a('0x4c')});})['catch'](function(_0x2c1b85){return handleError(_0x5e99c2,0x1f4,_0x2c1b85);});};passport[_0x0b7a('0x4d')](_0x0b7a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x561a3c,_0x4cfcde,_0x2ceddb){return localAuthenticate(db['User'],_0x561a3c,_0x4cfcde,_0x2ceddb);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b910df5..21d45e5 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 _0x19a1=['/forgot','forgot','post','reset','exports','express','login'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x19a1,0xfa));var _0x119a=function(_0x5a5ffb,_0x3aaf44){_0x5a5ffb=_0x5a5ffb-0x0;var _0x12d821=_0x19a1[_0x5a5ffb];return _0x12d821;};'use strict';var express=require(_0x119a('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x119a('0x1')]);router['post'](_0x119a('0x2'),controller[_0x119a('0x3')]);router[_0x119a('0x4')]('/reset/:token',controller[_0x119a('0x5')]);module[_0x119a('0x6')]=router;
\ No newline at end of file
+var _0x2724=['Router','post','/forgot','forgot','reset','express'];(function(_0x36e492,_0x1d8453){var _0x4c8f23=function(_0x22978f){while(--_0x22978f){_0x36e492['push'](_0x36e492['shift']());}};_0x4c8f23(++_0x1d8453);}(_0x2724,0xe9));var _0x4272=function(_0xd42c57,_0x295663){_0xd42c57=_0xd42c57-0x0;var _0x43e989=_0x2724[_0xd42c57];return _0x43e989;};'use strict';var express=require(_0x4272('0x0'));var router=express[_0x4272('0x1')]();var controller=require('./authLocal.controller');router[_0x4272('0x2')]('/',controller['login']);router[_0x4272('0x2')](_0x4272('0x3'),controller[_0x4272('0x4')]);router[_0x4272('0x2')]('/reset/:token',controller[_0x4272('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 35927e2..9c1e68b 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 _0xb1ea=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5e04b9,_0x3a19f3){var _0x2b94e6=function(_0x5d8149){while(--_0x5d8149){_0x5e04b9['push'](_0x5e04b9['shift']());}};_0x2b94e6(++_0x3a19f3);}(_0xb1ea,0x1a2));var _0xab1e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xb1ea[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0xab1e('0x0'));module[_0xab1e('0x1')]={'name':{'type':Sequelize[_0xab1e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xab1e('0x2')]},'description':{'type':Sequelize[_0xab1e('0x2')]},'status':{'type':Sequelize[_0xab1e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xab1e('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x92b5=['STRING','INTEGER','exports'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x92b5,0x6b));var _0x592b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x92b5[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module[_0x592b('0x0')]={'name':{'type':Sequelize[_0x592b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x592b('0x1')]},'description':{'type':Sequelize[_0x592b('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x592b('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 f41bc10..b49400d 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 _0xe8dd=['include','findAll','rows','catch','params','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Automation','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x230d24,_0x43b946){var _0x13e159=function(_0x550f26){while(--_0x550f26){_0x230d24['push'](_0x230d24['shift']());}};_0x13e159(++_0x43b946);}(_0xe8dd,0x15d));var _0xde8d=function(_0x31c685,_0x28fba8){_0x31c685=_0x31c685-0x0;var _0xebeefb=_0xe8dd[_0x31c685];return _0xebeefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde8d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde8d('0x1'));var rp=require('request-promise');var moment=require(_0xde8d('0x2'));var BPromise=require(_0xde8d('0x3'));var Mustache=require(_0xde8d('0x4'));var util=require(_0xde8d('0x5'));var path=require(_0xde8d('0x6'));var sox=require(_0xde8d('0x7'));var csv=require(_0xde8d('0x8'));var ejs=require(_0xde8d('0x9'));var fs=require('fs');var fs_extra=require(_0xde8d('0xa'));var _=require(_0xde8d('0xb'));var squel=require(_0xde8d('0xc'));var crypto=require(_0xde8d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xde8d('0xe'));var toCsv=require(_0xde8d('0x8'));var querystring=require(_0xde8d('0xf'));var Papa=require(_0xde8d('0x10'));var Redis=require(_0xde8d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde8d('0x12'));var hardwareService=require(_0xde8d('0x13'));var logger=require(_0xde8d('0x14'))('api');var utils=require(_0xde8d('0x15'));var config=require(_0xde8d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xde8d('0x17'))['db'];function respondWithStatusCode(_0x9ddeda,_0x43eaf3){_0x43eaf3=_0x43eaf3||0xcc;return function(_0x2d1564){if(_0x2d1564){return _0x9ddeda[_0xde8d('0x18')](_0x43eaf3);}return _0x9ddeda[_0xde8d('0x19')](_0x43eaf3)[_0xde8d('0x1a')]();};}function respondWithResult(_0x2b65bc,_0x3c3b71){_0x3c3b71=_0x3c3b71||0xc8;return function(_0x600ac0){if(_0x600ac0){return _0x2b65bc[_0xde8d('0x19')](_0x3c3b71)[_0xde8d('0x1b')](_0x600ac0);}};}function respondWithFilteredResult(_0x3abad5,_0x126911){return function(_0x46d62a){if(_0x46d62a){var _0x49ff8d=typeof _0x126911[_0xde8d('0x1c')]===_0xde8d('0x1d')&&typeof _0x126911[_0xde8d('0x1e')]===_0xde8d('0x1d');var _0x2da832=_0x46d62a[_0xde8d('0x1f')];var _0x5527c2=_0x49ff8d?0x0:_0x126911[_0xde8d('0x1c')];var _0x1225d6=_0x49ff8d?_0x46d62a[_0xde8d('0x1f')]:_0x126911[_0xde8d('0x1c')]+_0x126911[_0xde8d('0x1e')];var _0x2402ae;if(_0x1225d6>=_0x2da832){_0x1225d6=_0x2da832;_0x2402ae=0xc8;}else{_0x2402ae=0xce;}_0x3abad5['status'](_0x2402ae);return _0x3abad5[_0xde8d('0x20')](_0xde8d('0x21'),_0x5527c2+'-'+_0x1225d6+'/'+_0x2da832)[_0xde8d('0x1b')](_0x46d62a);}return null;};}function patchUpdates(_0x31546d){return function(_0x5d6716){try{jsonpatch[_0xde8d('0x22')](_0x5d6716,_0x31546d,!![]);}catch(_0x99210e){return BPromise[_0xde8d('0x23')](_0x99210e);}return _0x5d6716[_0xde8d('0x24')]();};}function saveUpdates(_0x14aea3,_0x18b8f4){return function(_0x5aa85a){if(_0x5aa85a){return _0x5aa85a[_0xde8d('0x25')](_0x14aea3)[_0xde8d('0x26')](function(_0xf05460){return _0xf05460;});}return null;};}function removeEntity(_0x442d84,_0xf96c64){return function(_0x48bb8d){if(_0x48bb8d){return _0x48bb8d['destroy']()[_0xde8d('0x26')](function(){_0x442d84[_0xde8d('0x19')](0xcc)[_0xde8d('0x1a')]();});}};}function handleEntityNotFound(_0x1c39ab,_0x1cdb83){return function(_0x740863){if(!_0x740863){_0x1c39ab['sendStatus'](0x194);}return _0x740863;};}function handleError(_0x30573c,_0x9e5c3e){_0x9e5c3e=_0x9e5c3e||0x1f4;return function(_0x5702fb){logger[_0xde8d('0x27')](_0x5702fb['stack']);if(_0x5702fb[_0xde8d('0x28')]){delete _0x5702fb[_0xde8d('0x28')];}_0x30573c[_0xde8d('0x19')](_0x9e5c3e)[_0xde8d('0x29')](_0x5702fb);};}exports[_0xde8d('0x2a')]=function(_0x4f9910,_0x3e433d){var _0x28220b={},_0x512f39={},_0x346d26={'count':0x0,'rows':[]};var _0x52f23a=_[_0xde8d('0x2b')](db[_0xde8d('0x2c')][_0xde8d('0x2d')],function(_0x466730){return{'name':_0x466730[_0xde8d('0x2e')],'type':_0x466730['type']['key']};});_0x512f39['model']=_[_0xde8d('0x2b')](_0x52f23a,'name');_0x512f39[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0x4f9910[_0xde8d('0x2f')]);_0x512f39[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x512f39[_0xde8d('0x33')],_0x512f39[_0xde8d('0x2f')]);_0x28220b[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x512f39[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0x4f9910[_0xde8d('0x2f')]['fields']));_0x28220b[_0xde8d('0x34')]=_0x28220b[_0xde8d('0x34')][_0xde8d('0x36')]?_0x28220b[_0xde8d('0x34')]:_0x512f39[_0xde8d('0x33')];if(!_0x4f9910[_0xde8d('0x2f')][_0xde8d('0x37')](_0xde8d('0x38'))){_0x28220b[_0xde8d('0x1e')]=qs[_0xde8d('0x1e')](_0x4f9910['query'][_0xde8d('0x1e')]);_0x28220b[_0xde8d('0x1c')]=qs[_0xde8d('0x1c')](_0x4f9910['query'][_0xde8d('0x1c')]);}_0x28220b[_0xde8d('0x39')]=qs[_0xde8d('0x3a')](_0x4f9910['query'][_0xde8d('0x3a')]);_0x28220b[_0xde8d('0x3b')]=qs[_0xde8d('0x31')](_[_0xde8d('0x3c')](_0x4f9910['query'],_0x512f39[_0xde8d('0x31')]),_0x52f23a);if(_0x4f9910['query'][_0xde8d('0x3d')]){_0x28220b[_0xde8d('0x3b')]=_[_0xde8d('0x3e')](_0x28220b[_0xde8d('0x3b')],{'$or':_[_0xde8d('0x2b')](_0x52f23a,function(_0x52d65f){if(_0x52d65f[_0xde8d('0x3f')]!==_0xde8d('0x40')){var _0x55a2ab={};_0x55a2ab[_0x52d65f[_0xde8d('0x28')]]={'$like':'%'+_0x4f9910['query'][_0xde8d('0x3d')]+'%'};return _0x55a2ab;}})});}_0x28220b=_[_0xde8d('0x3e')]({},_0x28220b,_0x4f9910[_0xde8d('0x41')]);var _0x540429={'where':_0x28220b['where']};return db['Automation'][_0xde8d('0x1f')](_0x540429)['then'](function(_0x1a9ef2){_0x346d26['count']=_0x1a9ef2;if(_0x4f9910[_0xde8d('0x2f')]['includeAll']){_0x28220b[_0xde8d('0x42')]=[{'all':!![]}];}return db[_0xde8d('0x2c')][_0xde8d('0x43')](_0x28220b);})['then'](function(_0x13b9f2){_0x346d26[_0xde8d('0x44')]=_0x13b9f2;return _0x346d26;})[_0xde8d('0x26')](respondWithFilteredResult(_0x3e433d,_0x28220b))[_0xde8d('0x45')](handleError(_0x3e433d,null));};exports['show']=function(_0xae52ef,_0x53451c){var _0x32dfdc={'raw':![],'where':{'id':_0xae52ef[_0xde8d('0x46')]['id']}},_0x26406a={};_0x26406a[_0xde8d('0x33')]=_[_0xde8d('0x30')](db[_0xde8d('0x2c')][_0xde8d('0x2d')]);_0x26406a[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0xae52ef[_0xde8d('0x2f')]);_0x26406a[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x26406a[_0xde8d('0x33')],_0x26406a[_0xde8d('0x2f')]);_0x32dfdc[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x26406a[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0xae52ef[_0xde8d('0x2f')][_0xde8d('0x35')]));_0x32dfdc['attributes']=_0x32dfdc[_0xde8d('0x34')][_0xde8d('0x36')]?_0x32dfdc[_0xde8d('0x34')]:_0x26406a[_0xde8d('0x33')];if(_0xae52ef[_0xde8d('0x2f')]['includeAll']){_0x32dfdc['include']=[{'all':!![]}];}_0x32dfdc=_[_0xde8d('0x3e')]({},_0x32dfdc,_0xae52ef[_0xde8d('0x41')]);return db[_0xde8d('0x2c')][_0xde8d('0x47')](_0x32dfdc)[_0xde8d('0x26')](handleEntityNotFound(_0x53451c,null))[_0xde8d('0x26')](respondWithResult(_0x53451c,null))[_0xde8d('0x45')](handleError(_0x53451c,null));};exports['create']=function(_0x25ed0e,_0x4275c1){return db['Automation'][_0xde8d('0x48')](_0x25ed0e[_0xde8d('0x49')],{})[_0xde8d('0x26')](respondWithResult(_0x4275c1,0xc9))[_0xde8d('0x45')](handleError(_0x4275c1,null));};exports['update']=function(_0x24ac1f,_0x20bc0c){if(_0x24ac1f[_0xde8d('0x49')]['id']){delete _0x24ac1f['body']['id'];}return db['Automation']['find']({'where':{'id':_0x24ac1f['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x20bc0c,null))[_0xde8d('0x26')](saveUpdates(_0x24ac1f[_0xde8d('0x49')],null))[_0xde8d('0x26')](respondWithResult(_0x20bc0c,null))['catch'](handleError(_0x20bc0c,null));};exports[_0xde8d('0x4a')]=function(_0x2021a5,_0xa70b61){return db[_0xde8d('0x2c')][_0xde8d('0x47')]({'where':{'id':_0x2021a5['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0xa70b61,null))['then'](removeEntity(_0xa70b61,null))['catch'](handleError(_0xa70b61,null));};exports[_0xde8d('0x4b')]=function(_0x5e0f9c,_0x37544a,_0x4e89d7){return db[_0xde8d('0x4c')][_0xde8d('0x47')]({'where':{'id':_0x5e0f9c['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x37544a,null))[_0xde8d('0x26')](function(_0x16b7e6){if(_0x16b7e6){return _0x16b7e6[_0xde8d('0x4b')](_0x5e0f9c[_0xde8d('0x49')][_0xde8d('0x4d')],_[_0xde8d('0x4e')](_0x5e0f9c[_0xde8d('0x49')],[_0xde8d('0x4d'),'id'])||{});}})[_0xde8d('0x26')](respondWithResult(_0x37544a,null))[_0xde8d('0x45')](handleError(_0x37544a,null));};exports[_0xde8d('0x4f')]=function(_0x42109c,_0xc3de02,_0x1e3891){var _0x569895={};var _0x370cb1={};var _0x1fdc48;var _0x41c371;return db[_0xde8d('0x2c')][_0xde8d('0x50')]({'where':{'id':_0x42109c[_0xde8d('0x46')]['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0xc3de02,null))[_0xde8d('0x26')](function(_0x4f356f){if(_0x4f356f){_0x1fdc48=_0x4f356f;_0x370cb1[_0xde8d('0x33')]=_['keys'](db[_0xde8d('0x4c')][_0xde8d('0x2d')]);_0x370cb1[_0xde8d('0x2f')]=_['keys'](_0x42109c[_0xde8d('0x2f')]);_0x370cb1[_0xde8d('0x31')]=_['intersection'](_0x370cb1['model'],_0x370cb1[_0xde8d('0x2f')]);_0x569895[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x370cb1[_0xde8d('0x33')],qs['fields'](_0x42109c[_0xde8d('0x2f')][_0xde8d('0x35')]));_0x569895[_0xde8d('0x34')]=_0x569895[_0xde8d('0x34')][_0xde8d('0x36')]?_0x569895[_0xde8d('0x34')]:_0x370cb1[_0xde8d('0x33')];_0x569895[_0xde8d('0x39')]=qs[_0xde8d('0x3a')](_0x42109c[_0xde8d('0x2f')][_0xde8d('0x3a')]);_0x569895[_0xde8d('0x3b')]=qs[_0xde8d('0x31')](_[_0xde8d('0x3c')](_0x42109c['query'],_0x370cb1[_0xde8d('0x31')]));if(_0x42109c['query']['filter']){_0x569895[_0xde8d('0x3b')]=_[_0xde8d('0x3e')](_0x569895[_0xde8d('0x3b')],{'$or':_[_0xde8d('0x2b')](_0x569895['attributes'],function(_0x144d53){var _0x3fdecd={};_0x3fdecd[_0x144d53]={'$like':'%'+_0x42109c[_0xde8d('0x2f')][_0xde8d('0x3d')]+'%'};return _0x3fdecd;})});}_0x569895=_[_0xde8d('0x3e')]({},_0x569895,_0x42109c[_0xde8d('0x41')]);return _0x1fdc48[_0xde8d('0x4f')](_0x569895);}})['then'](function(_0x9a95ae){if(_0x9a95ae){_0x41c371=_0x9a95ae[_0xde8d('0x36')];if(!_0x42109c['query'][_0xde8d('0x37')]('nolimit')){_0x569895['limit']=qs[_0xde8d('0x1e')](_0x42109c[_0xde8d('0x2f')]['limit']);_0x569895[_0xde8d('0x1c')]=qs['offset'](_0x42109c[_0xde8d('0x2f')]['offset']);}return _0x1fdc48[_0xde8d('0x4f')](_0x569895);}})[_0xde8d('0x26')](function(_0x554962){if(_0x554962){return _0x554962?{'count':_0x41c371,'rows':_0x554962}:null;}})[_0xde8d('0x26')](respondWithResult(_0xc3de02,null))[_0xde8d('0x45')](handleError(_0xc3de02,null));};exports[_0xde8d('0x51')]=function(_0x365762,_0x5afa5d,_0x2f0e87){return db['Action']['find']({'where':{'id':_0x365762[_0xde8d('0x46')]['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x5afa5d,null))[_0xde8d('0x26')](function(_0x5d2efa){if(_0x5d2efa){return _0x5d2efa['addActions'](_0x365762[_0xde8d('0x49')][_0xde8d('0x4d')],_[_0xde8d('0x4e')](_0x365762['body'],[_0xde8d('0x4d'),'id'])||{});}})[_0xde8d('0x26')](respondWithResult(_0x5afa5d,null))['catch'](handleError(_0x5afa5d,null));};exports[_0xde8d('0x52')]=function(_0x1b7368,_0x2ee78e,_0x29388e){var _0xaed2c7={};var _0x25db87={};var _0x1b54bc;var _0x27e115;return db['Automation'][_0xde8d('0x50')]({'where':{'id':_0x1b7368['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x2ee78e,null))[_0xde8d('0x26')](function(_0x386044){if(_0x386044){_0x1b54bc=_0x386044;_0x25db87[_0xde8d('0x33')]=_['keys'](db['Action']['rawAttributes']);_0x25db87[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0x1b7368[_0xde8d('0x2f')]);_0x25db87[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x25db87[_0xde8d('0x33')],_0x25db87[_0xde8d('0x2f')]);_0xaed2c7['attributes']=_[_0xde8d('0x32')](_0x25db87[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0x1b7368['query']['fields']));_0xaed2c7[_0xde8d('0x34')]=_0xaed2c7['attributes']['length']?_0xaed2c7['attributes']:_0x25db87[_0xde8d('0x33')];_0xaed2c7[_0xde8d('0x39')]=qs['sort'](_0x1b7368['query'][_0xde8d('0x3a')]);_0xaed2c7['where']=qs['filters'](_[_0xde8d('0x3c')](_0x1b7368[_0xde8d('0x2f')],_0x25db87[_0xde8d('0x31')]));if(_0x1b7368['query']['filter']){_0xaed2c7[_0xde8d('0x3b')]=_['merge'](_0xaed2c7['where'],{'$or':_[_0xde8d('0x2b')](_0xaed2c7[_0xde8d('0x34')],function(_0x4caf72){var _0x39dc36={};_0x39dc36[_0x4caf72]={'$like':'%'+_0x1b7368['query']['filter']+'%'};return _0x39dc36;})});}_0xaed2c7=_[_0xde8d('0x3e')]({},_0xaed2c7,_0x1b7368['options']);return _0x1b54bc[_0xde8d('0x52')](_0xaed2c7);}})['then'](function(_0x34f44c){if(_0x34f44c){_0x27e115=_0x34f44c[_0xde8d('0x36')];if(!_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x37')](_0xde8d('0x38'))){_0xaed2c7[_0xde8d('0x1e')]=qs[_0xde8d('0x1e')](_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x1e')]);_0xaed2c7[_0xde8d('0x1c')]=qs['offset'](_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x1c')]);}return _0x1b54bc[_0xde8d('0x52')](_0xaed2c7);}})[_0xde8d('0x26')](function(_0x31e72e){if(_0x31e72e){return _0x31e72e?{'count':_0x27e115,'rows':_0x31e72e}:null;}})[_0xde8d('0x26')](respondWithResult(_0x2ee78e,null))['catch'](handleError(_0x2ee78e,null));};
\ No newline at end of file
+var _0x687f=['index','Automation','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','addConditions','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','stack','name','send'];(function(_0x2a3506,_0x4c72c2){var _0x268978=function(_0x365b64){while(--_0x365b64){_0x2a3506['push'](_0x2a3506['shift']());}};_0x268978(++_0x4c72c2);}(_0x687f,0x167));var _0xf687=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x687f[_0x3ba422];return _0x20b5dd;};'use strict';var emlformat=require(_0xf687('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf687('0x1'));var rp=require(_0xf687('0x2'));var moment=require(_0xf687('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf687('0x4'));var util=require(_0xf687('0x5'));var path=require(_0xf687('0x6'));var sox=require(_0xf687('0x7'));var csv=require(_0xf687('0x8'));var ejs=require(_0xf687('0x9'));var fs=require('fs');var fs_extra=require(_0xf687('0xa'));var _=require(_0xf687('0xb'));var squel=require(_0xf687('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf687('0x8'));var querystring=require(_0xf687('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf687('0xe'));var qs=require(_0xf687('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf687('0x10'))('api');var utils=require(_0xf687('0x11'));var config=require(_0xf687('0x12'));var licenseUtil=require(_0xf687('0x13'));var db=require(_0xf687('0x14'))['db'];function respondWithStatusCode(_0x3cbcfc,_0x20ed3b){_0x20ed3b=_0x20ed3b||0xcc;return function(_0x435085){if(_0x435085){return _0x3cbcfc[_0xf687('0x15')](_0x20ed3b);}return _0x3cbcfc['status'](_0x20ed3b)['end']();};}function respondWithResult(_0x2c3e63,_0x52ecce){_0x52ecce=_0x52ecce||0xc8;return function(_0x2c33c8){if(_0x2c33c8){return _0x2c3e63[_0xf687('0x16')](_0x52ecce)[_0xf687('0x17')](_0x2c33c8);}};}function respondWithFilteredResult(_0x199411,_0x3612d8){return function(_0x11428a){if(_0x11428a){var _0x2208f9=typeof _0x3612d8[_0xf687('0x18')]===_0xf687('0x19')&&typeof _0x3612d8['limit']===_0xf687('0x19');var _0x5baf08=_0x11428a[_0xf687('0x1a')];var _0x1ebc99=_0x2208f9?0x0:_0x3612d8['offset'];var _0x289f08=_0x2208f9?_0x11428a[_0xf687('0x1a')]:_0x3612d8[_0xf687('0x18')]+_0x3612d8['limit'];var _0x7fd230;if(_0x289f08>=_0x5baf08){_0x289f08=_0x5baf08;_0x7fd230=0xc8;}else{_0x7fd230=0xce;}_0x199411['status'](_0x7fd230);return _0x199411[_0xf687('0x1b')]('Content-Range',_0x1ebc99+'-'+_0x289f08+'/'+_0x5baf08)[_0xf687('0x17')](_0x11428a);}return null;};}function patchUpdates(_0x208a9a){return function(_0x334449){try{jsonpatch[_0xf687('0x1c')](_0x334449,_0x208a9a,!![]);}catch(_0x4bf07f){return BPromise['reject'](_0x4bf07f);}return _0x334449[_0xf687('0x1d')]();};}function saveUpdates(_0x23c0c0,_0x378ca5){return function(_0x493030){if(_0x493030){return _0x493030[_0xf687('0x1e')](_0x23c0c0)[_0xf687('0x1f')](function(_0x2d326c){return _0x2d326c;});}return null;};}function removeEntity(_0x1b2c4e,_0xa2054a){return function(_0x5dd8c2){if(_0x5dd8c2){return _0x5dd8c2[_0xf687('0x20')]()['then'](function(){_0x1b2c4e[_0xf687('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfb30,_0x2a0ac8){return function(_0x2ce8d7){if(!_0x2ce8d7){_0x1dfb30[_0xf687('0x15')](0x194);}return _0x2ce8d7;};}function handleError(_0x3efcb4,_0x57b2e0){_0x57b2e0=_0x57b2e0||0x1f4;return function(_0x107bf5){logger['error'](_0x107bf5[_0xf687('0x21')]);if(_0x107bf5[_0xf687('0x22')]){delete _0x107bf5[_0xf687('0x22')];}_0x3efcb4[_0xf687('0x16')](_0x57b2e0)[_0xf687('0x23')](_0x107bf5);};}exports[_0xf687('0x24')]=function(_0x194969,_0x4c8b85){var _0x5ae822={},_0xa7796={},_0x115aac={'count':0x0,'rows':[]};var _0x4c27d3=_['map'](db[_0xf687('0x25')][_0xf687('0x26')],function(_0x1a570f){return{'name':_0x1a570f[_0xf687('0x27')],'type':_0x1a570f['type'][_0xf687('0x28')]};});_0xa7796[_0xf687('0x29')]=_[_0xf687('0x2a')](_0x4c27d3,_0xf687('0x22'));_0xa7796[_0xf687('0x2b')]=_[_0xf687('0x2c')](_0x194969[_0xf687('0x2b')]);_0xa7796['filters']=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],_0xa7796[_0xf687('0x2b')]);_0x5ae822[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],qs[_0xf687('0x2f')](_0x194969[_0xf687('0x2b')]['fields']));_0x5ae822[_0xf687('0x2e')]=_0x5ae822[_0xf687('0x2e')][_0xf687('0x30')]?_0x5ae822[_0xf687('0x2e')]:_0xa7796[_0xf687('0x29')];if(!_0x194969[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x5ae822['limit']=qs[_0xf687('0x33')](_0x194969[_0xf687('0x2b')][_0xf687('0x33')]);_0x5ae822[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x194969[_0xf687('0x2b')][_0xf687('0x18')]);}_0x5ae822[_0xf687('0x34')]=qs[_0xf687('0x35')](_0x194969['query'][_0xf687('0x35')]);_0x5ae822['where']=qs[_0xf687('0x36')](_['pick'](_0x194969[_0xf687('0x2b')],_0xa7796['filters']),_0x4c27d3);if(_0x194969[_0xf687('0x2b')][_0xf687('0x37')]){_0x5ae822[_0xf687('0x38')]=_[_0xf687('0x39')](_0x5ae822[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x4c27d3,function(_0x87d5ef){if(_0x87d5ef[_0xf687('0x3a')]!==_0xf687('0x3b')){var _0x14c6e6={};_0x14c6e6[_0x87d5ef[_0xf687('0x22')]]={'$like':'%'+_0x194969['query'][_0xf687('0x37')]+'%'};return _0x14c6e6;}})});}_0x5ae822=_[_0xf687('0x39')]({},_0x5ae822,_0x194969[_0xf687('0x3c')]);var _0x2ed544={'where':_0x5ae822[_0xf687('0x38')]};return db[_0xf687('0x25')][_0xf687('0x1a')](_0x2ed544)[_0xf687('0x1f')](function(_0x3c6769){_0x115aac['count']=_0x3c6769;if(_0x194969['query'][_0xf687('0x3d')]){_0x5ae822[_0xf687('0x3e')]=[{'all':!![]}];}return db[_0xf687('0x25')][_0xf687('0x3f')](_0x5ae822);})[_0xf687('0x1f')](function(_0x39f98c){_0x115aac['rows']=_0x39f98c;return _0x115aac;})['then'](respondWithFilteredResult(_0x4c8b85,_0x5ae822))['catch'](handleError(_0x4c8b85,null));};exports[_0xf687('0x40')]=function(_0x197489,_0xbfd120){var _0x481639={'raw':![],'where':{'id':_0x197489[_0xf687('0x41')]['id']}},_0x9a13ba={};_0x9a13ba['model']=_[_0xf687('0x2c')](db['Automation'][_0xf687('0x26')]);_0x9a13ba['query']=_[_0xf687('0x2c')](_0x197489['query']);_0x9a13ba[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x9a13ba[_0xf687('0x29')],_0x9a13ba[_0xf687('0x2b')]);_0x481639['attributes']=_[_0xf687('0x2d')](_0x9a13ba['model'],qs[_0xf687('0x2f')](_0x197489[_0xf687('0x2b')][_0xf687('0x2f')]));_0x481639['attributes']=_0x481639[_0xf687('0x2e')][_0xf687('0x30')]?_0x481639[_0xf687('0x2e')]:_0x9a13ba['model'];if(_0x197489[_0xf687('0x2b')]['includeAll']){_0x481639[_0xf687('0x3e')]=[{'all':!![]}];}_0x481639=_[_0xf687('0x39')]({},_0x481639,_0x197489[_0xf687('0x3c')]);return db[_0xf687('0x25')]['find'](_0x481639)['then'](handleEntityNotFound(_0xbfd120,null))[_0xf687('0x1f')](respondWithResult(_0xbfd120,null))[_0xf687('0x42')](handleError(_0xbfd120,null));};exports['create']=function(_0x3fcd53,_0x51c72e){return db['Automation'][_0xf687('0x43')](_0x3fcd53[_0xf687('0x44')],{})['then'](respondWithResult(_0x51c72e,0xc9))['catch'](handleError(_0x51c72e,null));};exports['update']=function(_0xe74dbb,_0x23beb9){if(_0xe74dbb[_0xf687('0x44')]['id']){delete _0xe74dbb[_0xf687('0x44')]['id'];}return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0xe74dbb[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x23beb9,null))[_0xf687('0x1f')](saveUpdates(_0xe74dbb[_0xf687('0x44')],null))[_0xf687('0x1f')](respondWithResult(_0x23beb9,null))[_0xf687('0x42')](handleError(_0x23beb9,null));};exports[_0xf687('0x20')]=function(_0x334ce5,_0x5c9020){return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0x334ce5[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5c9020,null))[_0xf687('0x1f')](removeEntity(_0x5c9020,null))[_0xf687('0x42')](handleError(_0x5c9020,null));};exports[_0xf687('0x46')]=function(_0x195eca,_0x495825,_0xe5ea9b){return db['Condition'][_0xf687('0x45')]({'where':{'id':_0x195eca[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x495825,null))[_0xf687('0x1f')](function(_0x488a89){if(_0x488a89){return _0x488a89[_0xf687('0x46')](_0x195eca[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x195eca[_0xf687('0x44')],['ids','id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x495825,null))[_0xf687('0x42')](handleError(_0x495825,null));};exports[_0xf687('0x49')]=function(_0x384fce,_0x1f9c87,_0x37b234){var _0x3dab11={};var _0x5151ed={};var _0xa04736;var _0x49d8bc;return db[_0xf687('0x25')][_0xf687('0x4a')]({'where':{'id':_0x384fce['params']['id']}})['then'](handleEntityNotFound(_0x1f9c87,null))[_0xf687('0x1f')](function(_0x5ed6e2){if(_0x5ed6e2){_0xa04736=_0x5ed6e2;_0x5151ed[_0xf687('0x29')]=_[_0xf687('0x2c')](db['Condition'][_0xf687('0x26')]);_0x5151ed[_0xf687('0x2b')]=_['keys'](_0x384fce[_0xf687('0x2b')]);_0x5151ed['filters']=_[_0xf687('0x2d')](_0x5151ed[_0xf687('0x29')],_0x5151ed[_0xf687('0x2b')]);_0x3dab11[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x5151ed['model'],qs[_0xf687('0x2f')](_0x384fce[_0xf687('0x2b')][_0xf687('0x2f')]));_0x3dab11[_0xf687('0x2e')]=_0x3dab11[_0xf687('0x2e')][_0xf687('0x30')]?_0x3dab11[_0xf687('0x2e')]:_0x5151ed['model'];_0x3dab11[_0xf687('0x34')]=qs['sort'](_0x384fce[_0xf687('0x2b')][_0xf687('0x35')]);_0x3dab11[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0x384fce['query'],_0x5151ed['filters']));if(_0x384fce[_0xf687('0x2b')][_0xf687('0x37')]){_0x3dab11[_0xf687('0x38')]=_[_0xf687('0x39')](_0x3dab11[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x3dab11[_0xf687('0x2e')],function(_0x44491b){var _0x204728={};_0x204728[_0x44491b]={'$like':'%'+_0x384fce[_0xf687('0x2b')]['filter']+'%'};return _0x204728;})});}_0x3dab11=_['merge']({},_0x3dab11,_0x384fce[_0xf687('0x3c')]);return _0xa04736[_0xf687('0x49')](_0x3dab11);}})[_0xf687('0x1f')](function(_0x20b53b){if(_0x20b53b){_0x49d8bc=_0x20b53b[_0xf687('0x30')];if(!_0x384fce['query'][_0xf687('0x31')](_0xf687('0x32'))){_0x3dab11[_0xf687('0x33')]=qs['limit'](_0x384fce[_0xf687('0x2b')][_0xf687('0x33')]);_0x3dab11[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x384fce['query']['offset']);}return _0xa04736[_0xf687('0x49')](_0x3dab11);}})['then'](function(_0x27080f){if(_0x27080f){return _0x27080f?{'count':_0x49d8bc,'rows':_0x27080f}:null;}})['then'](respondWithResult(_0x1f9c87,null))[_0xf687('0x42')](handleError(_0x1f9c87,null));};exports['addActions']=function(_0x5ba658,_0x310e79,_0x410be7){return db['Action'][_0xf687('0x45')]({'where':{'id':_0x5ba658[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x310e79,null))[_0xf687('0x1f')](function(_0x4ad68e){if(_0x4ad68e){return _0x4ad68e[_0xf687('0x4c')](_0x5ba658[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x5ba658[_0xf687('0x44')],[_0xf687('0x47'),'id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x310e79,null))[_0xf687('0x42')](handleError(_0x310e79,null));};exports['getActions']=function(_0xae8767,_0x5aac27,_0x2013c6){var _0x7d75f={};var _0x226f40={};var _0xee152b;var _0x3102fa;return db[_0xf687('0x25')]['findOne']({'where':{'id':_0xae8767[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5aac27,null))[_0xf687('0x1f')](function(_0x5cf5d0){if(_0x5cf5d0){_0xee152b=_0x5cf5d0;_0x226f40['model']=_[_0xf687('0x2c')](db[_0xf687('0x4d')][_0xf687('0x26')]);_0x226f40[_0xf687('0x2b')]=_['keys'](_0xae8767['query']);_0x226f40[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],_0x226f40['query']);_0x7d75f[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],qs[_0xf687('0x2f')](_0xae8767[_0xf687('0x2b')][_0xf687('0x2f')]));_0x7d75f['attributes']=_0x7d75f[_0xf687('0x2e')][_0xf687('0x30')]?_0x7d75f['attributes']:_0x226f40['model'];_0x7d75f[_0xf687('0x34')]=qs['sort'](_0xae8767['query']['sort']);_0x7d75f[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0xae8767[_0xf687('0x2b')],_0x226f40['filters']));if(_0xae8767[_0xf687('0x2b')]['filter']){_0x7d75f[_0xf687('0x38')]=_[_0xf687('0x39')](_0x7d75f[_0xf687('0x38')],{'$or':_['map'](_0x7d75f[_0xf687('0x2e')],function(_0x13f12c){var _0x1e5083={};_0x1e5083[_0x13f12c]={'$like':'%'+_0xae8767[_0xf687('0x2b')][_0xf687('0x37')]+'%'};return _0x1e5083;})});}_0x7d75f=_['merge']({},_0x7d75f,_0xae8767[_0xf687('0x3c')]);return _0xee152b[_0xf687('0x4e')](_0x7d75f);}})['then'](function(_0x5ba918){if(_0x5ba918){_0x3102fa=_0x5ba918[_0xf687('0x30')];if(!_0xae8767[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x7d75f['limit']=qs['limit'](_0xae8767[_0xf687('0x2b')][_0xf687('0x33')]);_0x7d75f[_0xf687('0x18')]=qs[_0xf687('0x18')](_0xae8767['query'][_0xf687('0x18')]);}return _0xee152b['getActions'](_0x7d75f);}})[_0xf687('0x1f')](function(_0x46e88a){if(_0x46e88a){return _0x46e88a?{'count':_0x3102fa,'rows':_0x46e88a}:null;}})[_0xf687('0x1f')](respondWithResult(_0x5aac27,null))[_0xf687('0x42')](handleError(_0x5aac27,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 815a104..3913064 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 _0x0763=['moment','bluebird','../../config/environment','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x1913a5,_0x18c610){var _0x58b6af=function(_0xdb7927){while(--_0xdb7927){_0x1913a5['push'](_0x1913a5['shift']());}};_0x58b6af(++_0x18c610);}(_0x0763,0x15a));var _0x3076=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x0763[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x3076('0x0'));var util=require(_0x3076('0x1'));var logger=require(_0x3076('0x2'))(_0x3076('0x3'));var moment=require(_0x3076('0x4'));var BPromise=require(_0x3076('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3076('0x6'));var attributes=require('./automation.attributes');module[_0x3076('0x7')]=function(_0x54a25c,_0x136a1d){return _0x54a25c[_0x3076('0x8')]('Automation',attributes,{'tableName':_0x3076('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc38=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xdc38,0x92));var _0x8dc3=function(_0x35a097,_0x42c39f){_0x35a097=_0x35a097-0x0;var _0x5ebefc=_0xdc38[_0x35a097];return _0x5ebefc;};'use strict';var _=require('lodash');var util=require(_0x8dc3('0x0'));var logger=require(_0x8dc3('0x1'))(_0x8dc3('0x2'));var moment=require(_0x8dc3('0x3'));var BPromise=require(_0x8dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dc3('0x5'));var rimraf=require(_0x8dc3('0x6'));var config=require(_0x8dc3('0x7'));var attributes=require(_0x8dc3('0x8'));module['exports']=function(_0xaf7ad9,_0x3e832f){return _0xaf7ad9[_0x8dc3('0x9')](_0x8dc3('0xa'),attributes,{'tableName':_0x8dc3('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 761c3cf..7e05180 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 _0xcb9c=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0xd2d81,_0x8ffa71){var _0x226112=function(_0x1f250a){while(--_0x1f250a){_0xd2d81['push'](_0xd2d81['shift']());}};_0x226112(++_0x8ffa71);}(_0xcb9c,0x110));var _0xccb9=function(_0x95da03,_0x1b5bd4){_0x95da03=_0x95da03-0x0;var _0x331f15=_0xcb9c[_0x95da03];return _0x331f15;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var moment=require(_0xccb9('0x2'));var BPromise=require(_0xccb9('0x3'));var rs=require(_0xccb9('0x4'));var fs=require('fs');var Redis=require(_0xccb9('0x5'));var db=require(_0xccb9('0x6'))['db'];var utils=require(_0xccb9('0x7'));var logger=require('../../config/logger')(_0xccb9('0x8'));var config=require(_0xccb9('0x9'));var jayson=require(_0xccb9('0xa'));var client=jayson['client'][_0xccb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114fa3,_0x1d807e,_0x54e899){return new BPromise(function(_0x3dfe21,_0x378d39){return client[_0xccb9('0xc')](_0x114fa3,_0x54e899)[_0xccb9('0xd')](function(_0x47889f){logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,_0xccb9('0x10'));logger[_0xccb9('0x11')](_0xccb9('0x12'),_0x1d807e,'request\x20sent',JSON[_0xccb9('0x13')](_0x47889f));if(_0x47889f[_0xccb9('0x14')]){if(_0x47889f[_0xccb9('0x14')]['code']===0x1f4){logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x378d39(_0x47889f['error'][_0xccb9('0x15')]);}logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x3dfe21(_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);}else{logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,'request\x20sent');_0x3dfe21(_0x47889f[_0xccb9('0x16')][_0xccb9('0x15')]);}})[_0xccb9('0x17')](function(_0x561ca6){logger['error'](_0xccb9('0xf'),_0x1d807e,_0x561ca6);_0x378d39(_0x561ca6);});});}
\ No newline at end of file
+var _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ba3,0x140));var _0x35ba=function(_0x73c797,_0x2817e6){_0x73c797=_0x73c797-0x0;var _0x28bd51=_0x5ba3[_0x73c797];return _0x28bd51;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c4546a3..e32df0c 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 _0x10d8=['create','post','/:id/conditions','addConditions','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/actions','getActions'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x10d8,0xee));var _0x810d=function(_0x282bc0,_0x15ea2a){_0x282bc0=_0x282bc0-0x0;var _0x154fec=_0x10d8[_0x282bc0];return _0x154fec;};'use strict';var multer=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var path=require(_0x810d('0x2'));var timeout=require('connect-timeout');var express=require(_0x810d('0x3'));var router=express[_0x810d('0x4')]();var fs_extra=require(_0x810d('0x5'));var auth=require(_0x810d('0x6'));var interaction=require(_0x810d('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x810d('0x8')]('/',auth[_0x810d('0x9')](),controller[_0x810d('0xa')]);router[_0x810d('0x8')](_0x810d('0xb'),auth[_0x810d('0x9')](),controller[_0x810d('0xc')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x810d('0x8')](_0x810d('0xd'),auth[_0x810d('0x9')](),controller[_0x810d('0xe')]);router['post']('/',auth[_0x810d('0x9')](),controller[_0x810d('0xf')]);router[_0x810d('0x10')](_0x810d('0x11'),auth['isAuthenticated'](),controller[_0x810d('0x12')]);router['post']('/:id/actions',auth[_0x810d('0x9')](),controller['addActions']);router[_0x810d('0x13')](_0x810d('0xb'),auth['isAuthenticated'](),controller[_0x810d('0x14')]);router[_0x810d('0x15')](_0x810d('0xb'),auth[_0x810d('0x9')](),controller[_0x810d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x21d1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','delete','destroy','exports','multer','util','path'];(function(_0x4b5456,_0x42dfc1){var _0x2c103d=function(_0x143563){while(--_0x143563){_0x4b5456['push'](_0x4b5456['shift']());}};_0x2c103d(++_0x42dfc1);}(_0x21d1,0x1c9));var _0x121d=function(_0x41058e,_0xf056ef){_0x41058e=_0x41058e-0x0;var _0xebf413=_0x21d1[_0x41058e];return _0xebf413;};'use strict';var multer=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var path=require(_0x121d('0x2'));var timeout=require(_0x121d('0x3'));var express=require(_0x121d('0x4'));var router=express[_0x121d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var controller=require(_0x121d('0x8'));router[_0x121d('0x9')]('/',auth[_0x121d('0xa')](),controller['index']);router[_0x121d('0x9')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0xc')]);router[_0x121d('0x9')](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0xe')]);router[_0x121d('0x9')](_0x121d('0xf'),auth['isAuthenticated'](),controller[_0x121d('0x10')]);router[_0x121d('0x11')]('/',auth[_0x121d('0xa')](),controller['create']);router['post'](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0x12')]);router['post']('/:id/actions',auth[_0x121d('0xa')](),controller['addActions']);router[_0x121d('0x13')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['update']);router[_0x121d('0x14')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0x15')]);module[_0x121d('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 918f49f..f216426 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 _0xab64=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab64,0xa0));var _0x4ab6=function(_0x417e85,_0x1bdf19){_0x417e85=_0x417e85-0x0;var _0x8f3539=_0xab64[_0x417e85];return _0x8f3539;};'use strict';var Sequelize=require(_0x4ab6('0x0'));module[_0x4ab6('0x1')]={'name':{'type':Sequelize[_0x4ab6('0x2')],'unique':_0x4ab6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4ab6('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4ab6('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4ab6('0x5')},'limitCalls':{'type':Sequelize[_0x4ab6('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4ab6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4ab6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4ab6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4ab6('0xd')},'dialTimezone':{'type':Sequelize[_0x4ab6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4ab6('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x4ab6('0xf')]('always',_0x4ab6('0x10'),_0x4ab6('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4ab6('0x12')],'defaultValue':0x0,'comment':_0x4ab6('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4ab6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4ab6('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4ab6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4ab6('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4ab6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4ab6('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4ab6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4ab6('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4ab6('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ab6('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4ab6('0x1b'),_0x4ab6('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x4ab6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x24')}};
\ No newline at end of file
+var _0xb111=['#AMD\x20Greeting','#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','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x47d32d,_0x4ad6e4){var _0xfe59b5=function(_0x448cd5){while(--_0x448cd5){_0x47d32d['push'](_0x47d32d['shift']());}};_0xfe59b5(++_0x4ad6e4);}(_0xb111,0x149));var _0x1b11=function(_0x30a0c7,_0x2e8020){_0x30a0c7=_0x30a0c7-0x0;var _0x14a010=_0xb111[_0x30a0c7];return _0x14a010;};'use strict';var Sequelize=require('sequelize');module[_0x1b11('0x0')]={'name':{'type':Sequelize[_0x1b11('0x1')],'unique':_0x1b11('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x4')),'allowNull':![],'defaultValue':_0x1b11('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':_0x1b11('0x6')},'limitCalls':{'type':Sequelize[_0x1b11('0x7')](0x4)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1b11('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b11('0x10')},'dialTimezone':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':_0x1b11('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x12'),_0x1b11('0x13'),_0x1b11('0x14')),'defaultValue':_0x1b11('0x12')},'dialAMDActive':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b11('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b11('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b11('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b11('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b11('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1b11('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1b11('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x1d'),'ASC'),'defaultValue':_0x1b11('0x1d')},'dialPrefix':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b11('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 43bbb5d..ac709b6 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 _0x20a3=['getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','select','cm_contacts','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','status','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','merge','omit','createdAt','updatedAt','role','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','CmHopperHistory','CampaignId','findAll','rows','getHopperFinals','CmHopperFinal'];(function(_0x469b1a,_0x1b9cc3){var _0xbca5f5=function(_0x56f9b2){while(--_0x56f9b2){_0x469b1a['push'](_0x469b1a['shift']());}};_0xbca5f5(++_0x1b9cc3);}(_0x20a3,0x15b));var _0x320a=function(_0x3489af,_0x265469){_0x3489af=_0x3489af-0x0;var _0x3debc0=_0x20a3[_0x3489af];return _0x3debc0;};'use strict';var emlformat=require(_0x320a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x320a('0x1'));var jsonpatch=require(_0x320a('0x2'));var rp=require(_0x320a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x320a('0x4'));var path=require(_0x320a('0x5'));var sox=require(_0x320a('0x6'));var csv=require(_0x320a('0x7'));var ejs=require(_0x320a('0x8'));var fs=require('fs');var fs_extra=require(_0x320a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x320a('0xa'));var jsforce=require(_0x320a('0xb'));var deskjs=require(_0x320a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x320a('0xd'));var Redis=require('ioredis');var authService=require(_0x320a('0xe'));var qs=require(_0x320a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x320a('0x10'));var logger=require(_0x320a('0x11'))('api');var utils=require(_0x320a('0x12'));var config=require(_0x320a('0x13'));var licenseUtil=require(_0x320a('0x14'));var db=require(_0x320a('0x15'))['db'];function respondWithStatusCode(_0x570693,_0x3a6cb0){_0x3a6cb0=_0x3a6cb0||0xcc;return function(_0x42b8dc){if(_0x42b8dc){return _0x570693[_0x320a('0x16')](_0x3a6cb0);}return _0x570693['status'](_0x3a6cb0)[_0x320a('0x17')]();};}function respondWithResult(_0x35ec33,_0x4d1ab9){_0x4d1ab9=_0x4d1ab9||0xc8;return function(_0x1cbd26){if(_0x1cbd26){return _0x35ec33['status'](_0x4d1ab9)[_0x320a('0x18')](_0x1cbd26);}};}function respondWithFilteredResult(_0x2e8124,_0xfe4b71){return function(_0x44a628){if(_0x44a628){var _0x501cd2=typeof _0xfe4b71[_0x320a('0x19')]==='undefined'&&typeof _0xfe4b71['limit']===_0x320a('0x1a');var _0x59733d=_0x44a628[_0x320a('0x1b')];var _0x3a1911=_0x501cd2?0x0:_0xfe4b71[_0x320a('0x19')];var _0x45bb6b=_0x501cd2?_0x44a628[_0x320a('0x1b')]:_0xfe4b71['offset']+_0xfe4b71[_0x320a('0x1c')];var _0x147c7f;if(_0x45bb6b>=_0x59733d){_0x45bb6b=_0x59733d;_0x147c7f=0xc8;}else{_0x147c7f=0xce;}_0x2e8124['status'](_0x147c7f);return _0x2e8124[_0x320a('0x1d')](_0x320a('0x1e'),_0x3a1911+'-'+_0x45bb6b+'/'+_0x59733d)[_0x320a('0x18')](_0x44a628);}return null;};}function patchUpdates(_0x37b0ae){return function(_0x18514b){try{jsonpatch[_0x320a('0x1f')](_0x18514b,_0x37b0ae,!![]);}catch(_0x1471aa){return BPromise[_0x320a('0x20')](_0x1471aa);}return _0x18514b[_0x320a('0x21')]();};}function saveUpdates(_0x4e5c99,_0x9001c0){return function(_0x20f59d){if(_0x20f59d){return _0x20f59d[_0x320a('0x22')](_0x4e5c99)['then'](function(_0x3974bd){return _0x3974bd;});}return null;};}function removeEntity(_0x207748,_0x3981d5){return function(_0x17fd84){if(_0x17fd84){return _0x17fd84[_0x320a('0x23')]()[_0x320a('0x24')](function(){var _0x40af50=_0x17fd84[_0x320a('0x25')]({'plain':!![]});var _0x8b4862='IvrCampaigns';return db[_0x320a('0x26')][_0x320a('0x23')]({'where':{'type':_0x8b4862,'resourceId':_0x40af50['id']}})[_0x320a('0x24')](function(){return _0x17fd84;});})[_0x320a('0x24')](function(){_0x207748[_0x320a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536f35,_0x560173){return function(_0x8457e3){if(!_0x8457e3){_0x536f35[_0x320a('0x16')](0x194);}return _0x8457e3;};}function handleError(_0x225f02,_0x64bbda){_0x64bbda=_0x64bbda||0x1f4;return function(_0x213b4e){logger[_0x320a('0x28')](_0x213b4e[_0x320a('0x29')]);if(_0x213b4e['name']){delete _0x213b4e[_0x320a('0x2a')];}_0x225f02[_0x320a('0x27')](_0x64bbda)[_0x320a('0x2b')](_0x213b4e);};}exports[_0x320a('0x2c')]=function(_0x5dbdca,_0x5cd3cc){var _0x43fe81={},_0x33e764={},_0x13565f={'count':0x0,'rows':[]};var _0x4bfd3a=_[_0x320a('0x2d')](db[_0x320a('0x2e')][_0x320a('0x2f')],function(_0x16d2f6){return{'name':_0x16d2f6[_0x320a('0x30')],'type':_0x16d2f6[_0x320a('0x31')][_0x320a('0x32')]};});_0x33e764[_0x320a('0x33')]=_['map'](_0x4bfd3a,'name');_0x33e764[_0x320a('0x34')]=_[_0x320a('0x35')](_0x5dbdca[_0x320a('0x34')]);_0x33e764['filters']=_[_0x320a('0x36')](_0x33e764[_0x320a('0x33')],_0x33e764[_0x320a('0x34')]);_0x43fe81[_0x320a('0x37')]=_[_0x320a('0x36')](_0x33e764['model'],qs['fields'](_0x5dbdca['query'][_0x320a('0x38')]));_0x43fe81[_0x320a('0x37')]=_0x43fe81[_0x320a('0x37')][_0x320a('0x39')]?_0x43fe81[_0x320a('0x37')]:_0x33e764[_0x320a('0x33')];if(!_0x5dbdca[_0x320a('0x34')]['hasOwnProperty'](_0x320a('0x3a'))){_0x43fe81['limit']=qs[_0x320a('0x1c')](_0x5dbdca[_0x320a('0x34')][_0x320a('0x1c')]);_0x43fe81[_0x320a('0x19')]=qs['offset'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x19')]);}_0x43fe81[_0x320a('0x3b')]=qs['sort'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x3c')]);_0x43fe81[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x5dbdca[_0x320a('0x34')],_0x33e764[_0x320a('0x3e')]),_0x4bfd3a);if(_0x5dbdca[_0x320a('0x34')][_0x320a('0x40')]){_0x43fe81['where']=_['merge'](_0x43fe81['where'],{'$or':_['map'](_0x4bfd3a,function(_0x742cb3){if(_0x742cb3[_0x320a('0x31')]!==_0x320a('0x41')){var _0xe86caf={};_0xe86caf[_0x742cb3[_0x320a('0x2a')]]={'$like':'%'+_0x5dbdca[_0x320a('0x34')]['filter']+'%'};return _0xe86caf;}})});}_0x43fe81=_['merge']({},_0x43fe81,_0x5dbdca['options']);var _0x3e39af={'where':_0x43fe81[_0x320a('0x3d')]};return db[_0x320a('0x2e')][_0x320a('0x1b')](_0x3e39af)[_0x320a('0x24')](function(_0x1f9ce6){_0x13565f[_0x320a('0x1b')]=_0x1f9ce6;if(_0x5dbdca['query'][_0x320a('0x42')]){_0x43fe81[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x2e')]['findAll'](_0x43fe81);})[_0x320a('0x24')](function(_0x44dabf){_0x13565f['rows']=_0x44dabf;return _0x13565f;})['then'](respondWithFilteredResult(_0x5cd3cc,_0x43fe81))[_0x320a('0x44')](handleError(_0x5cd3cc,null));};exports[_0x320a('0x45')]=function(_0x25fb77,_0x581372){var _0x3a68de={'raw':![],'where':{'id':_0x25fb77[_0x320a('0x46')]['id']}},_0x139d4c={};_0x139d4c[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x139d4c[_0x320a('0x34')]=_[_0x320a('0x35')](_0x25fb77[_0x320a('0x34')]);_0x139d4c[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],_0x139d4c['query']);_0x3a68de[_0x320a('0x37')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],qs[_0x320a('0x38')](_0x25fb77[_0x320a('0x34')]['fields']));_0x3a68de[_0x320a('0x37')]=_0x3a68de[_0x320a('0x37')][_0x320a('0x39')]?_0x3a68de[_0x320a('0x37')]:_0x139d4c[_0x320a('0x33')];if(_0x25fb77['query'][_0x320a('0x42')]){_0x3a68de['include']=[{'all':!![]}];}_0x3a68de=_['merge']({},_0x3a68de,_0x25fb77[_0x320a('0x47')]);return db[_0x320a('0x2e')][_0x320a('0x48')](_0x3a68de)[_0x320a('0x24')](handleEntityNotFound(_0x581372,null))[_0x320a('0x24')](respondWithResult(_0x581372,null))[_0x320a('0x44')](handleError(_0x581372,null));};exports[_0x320a('0x49')]=function(_0x465d26,_0x236158){return db['Campaign'][_0x320a('0x49')](_0x465d26[_0x320a('0x4a')],{})[_0x320a('0x24')](function(_0x2010fc){var _0x4ed622=_0x465d26['user'][_0x320a('0x25')]({'plain':!![]});if(!_0x4ed622)throw new Error(_0x320a('0x4b'));if(_0x4ed622['role']===_0x320a('0x4c')){var _0x42afe0=_0x2010fc['get']({'plain':!![]});var _0x839c0d=_0x320a('0x4d');return db[_0x320a('0x4e')]['find']({'where':{'name':_0x839c0d,'userProfileId':_0x4ed622[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x2b927d){if(_0x2b927d&&_0x2b927d['autoAssociation']===0x0){return db[_0x320a('0x26')]['create']({'name':_0x42afe0['name'],'resourceId':_0x42afe0['id'],'type':_0x2b927d[_0x320a('0x2a')],'sectionId':_0x2b927d['id']},{})['then'](function(){return _0x2010fc;});}else{return _0x2010fc;}})[_0x320a('0x44')](function(_0x36c65e){logger[_0x320a('0x28')](_0x320a('0x50'),_0x36c65e);throw _0x36c65e;});}return _0x2010fc;})[_0x320a('0x24')](respondWithResult(_0x236158,0xc9))['catch'](handleError(_0x236158,null));};exports['clone']=function(_0x13cbca,_0x21d02f){var _0x4bb56b={'where':{'id':_0x13cbca['params']['id']}},_0x4deb6b={};_0x4deb6b['model']=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x4bb56b[_0x320a('0x37')]=_[_0x320a('0x36')](_0x4deb6b[_0x320a('0x33')],qs[_0x320a('0x38')](_0x13cbca[_0x320a('0x34')][_0x320a('0x38')]));_0x4bb56b['attributes']=_0x4bb56b['attributes']['length']?_0x4bb56b[_0x320a('0x37')]:_0x4deb6b[_0x320a('0x33')];if(_0x13cbca['query'][_0x320a('0x42')]){_0x4bb56b[_0x320a('0x43')]=[{'all':!![]}];}_0x4bb56b=_[_0x320a('0x51')]({},_0x4bb56b,_0x13cbca[_0x320a('0x47')]);return db[_0x320a('0x2e')]['find'](_0x4bb56b)[_0x320a('0x24')](handleEntityNotFound(_0x21d02f,null))[_0x320a('0x24')](function(_0x208a56){if(_0x208a56){var _0x279227=_0x208a56[_0x320a('0x25')]({'plain':!![]});_0x279227=qs[_0x320a('0x52')](_0x279227,['id',_0x320a('0x53'),'updatedAt']);_0x13cbca[_0x320a('0x4a')]=_[_0x320a('0x52')](_0x13cbca['body'],['id',_0x320a('0x53'),_0x320a('0x54')]);return db[_0x320a('0x2e')][_0x320a('0x49')](_[_0x320a('0x51')](_0x279227,_0x13cbca[_0x320a('0x4a')]),{'include':_0x13cbca['query'][_0x320a('0x42')]?[{'all':!![]}]:undefined})[_0x320a('0x24')](function(_0x514b22){var _0x5cfbcd=_0x13cbca[_0x320a('0x4c')][_0x320a('0x25')]({'plain':!![]});if(!_0x5cfbcd)throw new Error(_0x320a('0x4b'));if(_0x5cfbcd[_0x320a('0x55')]==='user'){var _0x3e6119=_0x514b22[_0x320a('0x25')]({'plain':!![]});var _0x29b207=_0x320a('0x4d');return db['UserProfileSection'][_0x320a('0x48')]({'where':{'name':_0x29b207,'userProfileId':_0x5cfbcd[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x409961){if(_0x409961&&_0x409961[_0x320a('0x56')]===0x0){return db[_0x320a('0x26')]['create']({'name':_0x3e6119[_0x320a('0x2a')],'resourceId':_0x3e6119['id'],'type':_0x409961[_0x320a('0x2a')],'sectionId':_0x409961['id']},{})['then'](function(){return _0x514b22;});}else{return _0x514b22;}})[_0x320a('0x44')](function(_0x406e78){logger['error'](_0x320a('0x50'),_0x406e78);throw _0x406e78;});}return _0x514b22;});}})[_0x320a('0x24')](respondWithResult(_0x21d02f,0xc9))[_0x320a('0x44')](handleError(_0x21d02f,null));};exports[_0x320a('0x22')]=function(_0x30769c,_0x5c57da){if(_0x30769c[_0x320a('0x4a')]['id']){delete _0x30769c[_0x320a('0x4a')]['id'];}return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x30769c[_0x320a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c57da,null))[_0x320a('0x24')](saveUpdates(_0x30769c[_0x320a('0x4a')],null))[_0x320a('0x24')](respondWithResult(_0x5c57da,null))[_0x320a('0x44')](handleError(_0x5c57da,null));};exports[_0x320a('0x23')]=function(_0x16dd77,_0x37ba87){return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x16dd77[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x37ba87,null))[_0x320a('0x24')](removeEntity(_0x37ba87,null))[_0x320a('0x44')](handleError(_0x37ba87,null));};exports[_0x320a('0x57')]=function(_0x261eb8,_0x42aa05,_0x2373e1){var _0x50a700={'raw':!![],'where':{}};var _0x5618f3={};var _0x265204={'count':0x0,'rows':[]};return db['Campaign'][_0x320a('0x58')]({'where':{'id':_0x261eb8[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x42aa05,null))['then'](function(_0x51193d){if(_0x51193d){_0x5618f3[_0x320a('0x33')]=_['keys'](db[_0x320a('0x59')]['rawAttributes']);_0x5618f3[_0x320a('0x34')]=_[_0x320a('0x35')](_0x261eb8['query']);_0x5618f3[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x5618f3[_0x320a('0x33')],_0x5618f3['query']);_0x50a700[_0x320a('0x37')]=_['intersection'](_0x5618f3[_0x320a('0x33')],qs[_0x320a('0x38')](_0x261eb8[_0x320a('0x34')]['fields']));_0x50a700['attributes']=_0x50a700[_0x320a('0x37')][_0x320a('0x39')]?_0x50a700['attributes']:_0x5618f3['model'];if(!_0x261eb8[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x50a700[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x261eb8[_0x320a('0x34')][_0x320a('0x1c')]);_0x50a700[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x261eb8[_0x320a('0x34')][_0x320a('0x19')]);}_0x50a700[_0x320a('0x3b')]=qs['sort'](_0x261eb8[_0x320a('0x34')][_0x320a('0x3c')]);_0x50a700[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_['pick'](_0x261eb8[_0x320a('0x34')],_0x5618f3['filters']));_0x50a700[_0x320a('0x3d')]['CampaignId']=_0x51193d['id'];if(_0x261eb8['query'][_0x320a('0x40')]){_0x50a700[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x50a700[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x50a700[_0x320a('0x37')],function(_0xc30f24){var _0x2e1a4e={};_0x2e1a4e[_0xc30f24]={'$like':'%'+_0x261eb8[_0x320a('0x34')]['filter']+'%'};return _0x2e1a4e;})});}_0x50a700=_[_0x320a('0x51')]({},_0x50a700,_0x261eb8[_0x320a('0x47')]);return db['CmHopper']['count']({'where':_0x50a700[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x280235){_0x265204[_0x320a('0x1b')]=_0x280235;if(_0x261eb8[_0x320a('0x34')][_0x320a('0x42')]){_0x50a700['include']=[{'all':!![]}];}return db[_0x320a('0x59')]['findAll'](_0x50a700);})[_0x320a('0x24')](function(_0x120268){_0x265204['rows']=_0x120268;return _0x265204;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x42aa05,_0x50a700))['catch'](handleError(_0x42aa05,null));};exports['getHopperHistories']=function(_0x1e4080,_0xdd2b5e,_0x155894){var _0x3b239d={'raw':!![],'where':{}};var _0x3f94={};var _0x19a2d6={'count':0x0,'rows':[]};return db[_0x320a('0x2e')][_0x320a('0x58')]({'where':{'id':_0x1e4080[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xdd2b5e,null))[_0x320a('0x24')](function(_0x2b6471){if(_0x2b6471){_0x3f94[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x5b')][_0x320a('0x2f')]);_0x3f94[_0x320a('0x34')]=_['keys'](_0x1e4080[_0x320a('0x34')]);_0x3f94['filters']=_['intersection'](_0x3f94['model'],_0x3f94[_0x320a('0x34')]);_0x3b239d[_0x320a('0x37')]=_['intersection'](_0x3f94['model'],qs['fields'](_0x1e4080[_0x320a('0x34')][_0x320a('0x38')]));_0x3b239d[_0x320a('0x37')]=_0x3b239d[_0x320a('0x37')][_0x320a('0x39')]?_0x3b239d[_0x320a('0x37')]:_0x3f94[_0x320a('0x33')];if(!_0x1e4080[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x3b239d[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x1c')]);_0x3b239d[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x1e4080[_0x320a('0x34')][_0x320a('0x19')]);}_0x3b239d[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x3c')]);_0x3b239d[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x1e4080[_0x320a('0x34')],_0x3f94[_0x320a('0x3e')]));_0x3b239d[_0x320a('0x3d')][_0x320a('0x5c')]=_0x2b6471['id'];if(_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]){_0x3b239d['where']=_[_0x320a('0x51')](_0x3b239d[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x3b239d[_0x320a('0x37')],function(_0x404c34){var _0x4383fb={};_0x4383fb[_0x404c34]={'$like':'%'+_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]+'%'};return _0x4383fb;})});}_0x3b239d=_['merge']({},_0x3b239d,_0x1e4080[_0x320a('0x47')]);return db[_0x320a('0x5b')]['count']({'where':_0x3b239d[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x2bf93b){_0x19a2d6[_0x320a('0x1b')]=_0x2bf93b;if(_0x1e4080['query'][_0x320a('0x42')]){_0x3b239d[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x5b')][_0x320a('0x5d')](_0x3b239d);})[_0x320a('0x24')](function(_0x2635b9){_0x19a2d6[_0x320a('0x5e')]=_0x2635b9;return _0x19a2d6;});}})['then'](respondWithFilteredResult(_0xdd2b5e,_0x3b239d))[_0x320a('0x44')](handleError(_0xdd2b5e,null));};exports[_0x320a('0x5f')]=function(_0x4fcffc,_0x5237a0,_0x1cd5c1){var _0x4fdfe1={'raw':!![],'where':{}};var _0x2d1d00={};var _0x3506ed={'count':0x0,'rows':[]};return db[_0x320a('0x2e')]['findOne']({'where':{'id':_0x4fcffc[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x5237a0,null))[_0x320a('0x24')](function(_0xed6b90){if(_0xed6b90){_0x2d1d00[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x60')][_0x320a('0x2f')]);_0x2d1d00[_0x320a('0x34')]=_['keys'](_0x4fcffc[_0x320a('0x34')]);_0x2d1d00[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x2d1d00[_0x320a('0x33')],_0x2d1d00[_0x320a('0x34')]);_0x4fdfe1[_0x320a('0x37')]=_[_0x320a('0x36')](_0x2d1d00[_0x320a('0x33')],qs[_0x320a('0x38')](_0x4fcffc[_0x320a('0x34')][_0x320a('0x38')]));_0x4fdfe1[_0x320a('0x37')]=_0x4fdfe1['attributes'][_0x320a('0x39')]?_0x4fdfe1[_0x320a('0x37')]:_0x2d1d00[_0x320a('0x33')];if(!_0x4fcffc[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x4fdfe1[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x4fcffc[_0x320a('0x34')]['limit']);_0x4fdfe1['offset']=qs['offset'](_0x4fcffc['query']['offset']);}_0x4fdfe1[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x4fcffc[_0x320a('0x34')][_0x320a('0x3c')]);_0x4fdfe1[_0x320a('0x3d')]=qs['filters'](_[_0x320a('0x3f')](_0x4fcffc['query'],_0x2d1d00[_0x320a('0x3e')]));_0x4fdfe1[_0x320a('0x3d')]['CampaignId']=_0xed6b90['id'];if(_0x4fcffc['query'][_0x320a('0x40')]){_0x4fdfe1[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x4fdfe1[_0x320a('0x3d')],{'$or':_['map'](_0x4fdfe1[_0x320a('0x37')],function(_0x11bbf4){var _0x48fe4b={};_0x48fe4b[_0x11bbf4]={'$like':'%'+_0x4fcffc['query']['filter']+'%'};return _0x48fe4b;})});}_0x4fdfe1=_[_0x320a('0x51')]({},_0x4fdfe1,_0x4fcffc['options']);return db[_0x320a('0x60')][_0x320a('0x1b')]({'where':_0x4fdfe1[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x3e9574){_0x3506ed[_0x320a('0x1b')]=_0x3e9574;if(_0x4fcffc[_0x320a('0x34')][_0x320a('0x42')]){_0x4fdfe1[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x60')][_0x320a('0x5d')](_0x4fdfe1);})[_0x320a('0x24')](function(_0x3ebf0b){_0x3506ed['rows']=_0x3ebf0b;return _0x3506ed;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x5237a0,_0x4fdfe1))[_0x320a('0x44')](handleError(_0x5237a0,null));};exports[_0x320a('0x61')]=function(_0x46be5a,_0x843a79,_0x503d22){var _0x257af5={'raw':!![],'where':{}};var _0x1e046b={};var _0x46e8d5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x46be5a[_0x320a('0x46')]['id']}})['then'](handleEntityNotFound(_0x843a79,null))[_0x320a('0x24')](function(_0x2f67db){if(_0x2f67db){_0x1e046b[_0x320a('0x33')]=_['keys'](db[_0x320a('0x62')]['rawAttributes']);_0x1e046b[_0x320a('0x34')]=_[_0x320a('0x35')](_0x46be5a['query']);_0x1e046b[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x1e046b[_0x320a('0x33')],_0x1e046b['query']);_0x257af5[_0x320a('0x37')]=_['intersection'](_0x1e046b[_0x320a('0x33')],qs['fields'](_0x46be5a[_0x320a('0x34')][_0x320a('0x38')]));_0x257af5[_0x320a('0x37')]=_0x257af5[_0x320a('0x37')][_0x320a('0x39')]?_0x257af5[_0x320a('0x37')]:_0x1e046b[_0x320a('0x33')];if(!_0x46be5a[_0x320a('0x34')]['hasOwnProperty'](_0x320a('0x3a'))){_0x257af5[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x46be5a[_0x320a('0x34')]['limit']);_0x257af5[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x46be5a['query']['offset']);}_0x257af5[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x46be5a['query']['sort']);_0x257af5['where']=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x46be5a[_0x320a('0x34')],_0x1e046b[_0x320a('0x3e')]));_0x257af5[_0x320a('0x3d')][_0x320a('0x5c')]=_0x2f67db['id'];if(_0x46be5a[_0x320a('0x34')][_0x320a('0x40')]){_0x257af5[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x257af5[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x257af5[_0x320a('0x37')],function(_0x562138){var _0x4d5d46={};_0x4d5d46[_0x562138]={'$like':'%'+_0x46be5a['query']['filter']+'%'};return _0x4d5d46;})});}_0x257af5=_['merge']({},_0x257af5,_0x46be5a[_0x320a('0x47')]);return db['CmHopperBlack'][_0x320a('0x1b')]({'where':_0x257af5['where']})[_0x320a('0x24')](function(_0x466788){_0x46e8d5[_0x320a('0x1b')]=_0x466788;if(_0x46be5a[_0x320a('0x34')][_0x320a('0x42')]){_0x257af5[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x62')]['findAll'](_0x257af5);})['then'](function(_0x8a0ca6){_0x46e8d5[_0x320a('0x5e')]=_0x8a0ca6;return _0x46e8d5;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x843a79,_0x257af5))[_0x320a('0x44')](handleError(_0x843a79,null));};exports['getLists']=function(_0x4b6c7a,_0xcc8225,_0x5cab1f){var _0x1c2293={};var _0x5b9f0e={};var _0x25a0e3;var _0x50e7e9;return db[_0x320a('0x2e')][_0x320a('0x58')]({'where':{'id':_0x4b6c7a['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xcc8225,null))[_0x320a('0x24')](function(_0x40b992){if(_0x40b992){_0x25a0e3=_0x40b992;_0x5b9f0e[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x63')][_0x320a('0x2f')]);_0x5b9f0e[_0x320a('0x34')]=_[_0x320a('0x35')](_0x4b6c7a[_0x320a('0x34')]);_0x5b9f0e[_0x320a('0x3e')]=_['intersection'](_0x5b9f0e[_0x320a('0x33')],_0x5b9f0e['query']);_0x1c2293[_0x320a('0x37')]=_[_0x320a('0x36')](_0x5b9f0e[_0x320a('0x33')],qs['fields'](_0x4b6c7a['query'][_0x320a('0x38')]));_0x1c2293[_0x320a('0x37')]=_0x1c2293[_0x320a('0x37')]['length']?_0x1c2293[_0x320a('0x37')]:_0x5b9f0e[_0x320a('0x33')];_0x1c2293['order']=qs[_0x320a('0x3c')](_0x4b6c7a['query'][_0x320a('0x3c')]);_0x1c2293[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x4b6c7a[_0x320a('0x34')],_0x5b9f0e[_0x320a('0x3e')]));if(_0x4b6c7a['query'][_0x320a('0x40')]){_0x1c2293[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x1c2293[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x1c2293['attributes'],function(_0x3bda28){var _0x36bf9f={};_0x36bf9f[_0x3bda28]={'$like':'%'+_0x4b6c7a['query'][_0x320a('0x40')]+'%'};return _0x36bf9f;})});}_0x1c2293=_[_0x320a('0x51')]({},_0x1c2293,_0x4b6c7a[_0x320a('0x47')]);return _0x25a0e3[_0x320a('0x64')](_0x1c2293);}})['then'](function(_0x242d3f){if(_0x242d3f){_0x50e7e9=_0x242d3f[_0x320a('0x39')];if(!_0x4b6c7a[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x1c2293['limit']=qs['limit'](_0x4b6c7a[_0x320a('0x34')]['limit']);_0x1c2293[_0x320a('0x19')]=qs['offset'](_0x4b6c7a['query']['offset']);}return _0x25a0e3[_0x320a('0x64')](_0x1c2293);}})[_0x320a('0x24')](function(_0x20286e){if(_0x20286e){return _0x20286e?{'count':_0x50e7e9,'rows':_0x20286e}:null;}})[_0x320a('0x24')](respondWithResult(_0xcc8225,null))[_0x320a('0x44')](handleError(_0xcc8225,null));};exports[_0x320a('0x65')]=function(_0x6569a1,_0x511f17,_0x48f016){var _0x3ed4de,_0x23e70e;var _0x29b021=[];var _0x4f262f=moment()['format'](_0x320a('0x66'));return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x6569a1[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x511f17,null))['then'](function(_0x431e4d){if(_0x431e4d){_0x23e70e=_0x431e4d;return _0x431e4d[_0x320a('0x65')](_0x6569a1[_0x320a('0x4a')]['ids'],_[_0x320a('0x52')](_0x6569a1['body'],[_0x320a('0x67'),'id'])||{});}return null;})['spread'](function(_0xf35daf){var _0x181627;var _0x218aa6;_0x3ed4de=_0xf35daf||[];var _0x1e8123=[];if(_0xf35daf){for(var _0x4ee444=0x0;_0x4ee444<_0xf35daf[_0x320a('0x39')];_0x4ee444+=0x1){var _0x3e2eba=_0xf35daf[_0x4ee444][_0x320a('0x25')]({'plain':!![]});_0x23e70e['dialCheckDuplicateType']=_0x6569a1['body'][_0x320a('0x68')]?_0x6569a1['body'][_0x320a('0x68')]:_0x23e70e[_0x320a('0x68')];switch(_0x23e70e['dialCheckDuplicateType']){case _0x320a('0x69'):_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),'createdAt','updatedAt'],squel['select']()[_0x320a('0x72')](_0x320a('0x6e'),'phone')[_0x320a('0x72')](_0x320a('0x73'),_0x320a('0x6f'))[_0x320a('0x72')]('id',_0x320a('0x70'))['field'](_0x3e2eba[_0x320a('0x74')]['toString'](),'ListId')[_0x320a('0x72')](_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from']('cm_contacts')['where'](_0x320a('0x76'))['where'](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x78'))[_0x320a('0x3d')](_0x320a('0x79'),squel['select']()[_0x320a('0x72')](_0x320a('0x7a'))[_0x320a('0x7b')](_0x320a('0x7c'))[_0x320a('0x3d')](_0x320a('0x7d'),_0x6569a1['params']['id']['toString']()))[_0x320a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x320a('0x72')](_0x320a('0x7e'))[_0x320a('0x7b')](_0x320a('0x6c'))['where'](_0x320a('0x7d'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())))[_0x320a('0x75')]();break;case _0x320a('0x7f'):_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),_0x320a('0x53'),'updatedAt'],squel[_0x320a('0x80')]()['field']('phone',_0x320a('0x6e'))['field']('NOW()',_0x320a('0x6f'))[_0x320a('0x72')]('id',_0x320a('0x70'))[_0x320a('0x72')](_0x3e2eba[_0x320a('0x74')]['toString'](),_0x320a('0x71'))[_0x320a('0x72')](_0x6569a1['params']['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27','createdAt')[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from']('cm_contacts')[_0x320a('0x3d')](_0x320a('0x76'))[_0x320a('0x3d')](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')]['toString']())[_0x320a('0x3d')](_0x320a('0x78'))['where'](_0x320a('0x79'),squel[_0x320a('0x80')]()[_0x320a('0x72')](_0x320a('0x7e'))['from'](_0x320a('0x6c'))[_0x320a('0x3d')](_0x320a('0x7d'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())))[_0x320a('0x75')]();break;default:_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))['fromQuery']([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),'CampaignId','createdAt',_0x320a('0x54')],squel['select']()[_0x320a('0x72')](_0x320a('0x6e'),_0x320a('0x6e'))['field']('NOW()','scheduledAt')[_0x320a('0x72')]('id',_0x320a('0x70'))['field'](_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')](),_0x320a('0x71'))[_0x320a('0x72')](_0x6569a1['params']['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))['field']('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from'](_0x320a('0x81'))[_0x320a('0x3d')]('deletedAt\x20IS\x20NULL')[_0x320a('0x3d')](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x320a('0x75')]();}_0x218aa6=squel['insert']()['into'](_0x320a('0x82'))[_0x320a('0x6d')]([_0x320a('0x83'),_0x320a('0x6f'),'phone','OrderBy',_0x320a('0x53'),_0x320a('0x54')],squel[_0x320a('0x80')]()[_0x320a('0x72')]('h.id','id')['field'](_0x320a('0x73'),'scheduledAt')['field'](_0x320a('0x84'),_0x320a('0x6e'))[_0x320a('0x72')](_0x320a('0x85'),_0x320a('0x86'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))['field']('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))[_0x320a('0x7b')](_0x320a('0x87'),'ci')['join']('cm_hopper','h',_0x320a('0x88'))[_0x320a('0x3d')](_0x320a('0x89'),_0x3e2eba['CmListId'][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x8a'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())['where']('h.createdAt\x20=\x20?',_0x4f262f))[_0x320a('0x75')]();_0x1e8123[_0x320a('0x8b')](db[_0x320a('0x8c')][_0x320a('0x34')](_0x181627));_0x29b021['push'](db[_0x320a('0x8c')]['query'](_0x218aa6));}return BPromise[_0x320a('0x8d')](_0x1e8123);}})[_0x320a('0x24')](function(){return BPromise[_0x320a('0x8d')](_0x29b021);})[_0x320a('0x24')](function(){return _0x3ed4de;})[_0x320a('0x24')](respondWithResult(_0x511f17,null))['catch'](handleError(_0x511f17,null));};exports[_0x320a('0x8e')]=function(_0x5d347e,_0x3c882c,_0x538b9f){return db[_0x320a('0x2e')]['find']({'where':{'id':_0x5d347e[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x3c882c,null))[_0x320a('0x24')](function(_0x9052d7){if(_0x9052d7){return _0x9052d7[_0x320a('0x8e')](_0x5d347e[_0x320a('0x34')]['ids']);}})[_0x320a('0x24')](function(_0x47e688){if(_0x47e688){return db[_0x320a('0x59')][_0x320a('0x23')]({'where':{'ListId':_0x5d347e['query'][_0x320a('0x67')],'CampaignId':_0x5d347e[_0x320a('0x46')]['id']}})[_0x320a('0x24')](function(){return _0x47e688;});}})[_0x320a('0x24')](respondWithStatusCode(_0x3c882c,null))['catch'](handleError(_0x3c882c,null));};exports[_0x320a('0x8f')]=function(_0x5521e6,_0x1a88cf,_0x3d0132){var _0xfd9dd3={};var _0x31ab9c={};var _0x2ff6a4;var _0x477761;return db['Campaign'][_0x320a('0x58')]({'where':{'id':_0x5521e6['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x1a88cf,null))[_0x320a('0x24')](function(_0x33fb29){if(_0x33fb29){_0x2ff6a4=_0x33fb29;_0x31ab9c[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x63')][_0x320a('0x2f')]);_0x31ab9c[_0x320a('0x34')]=_[_0x320a('0x35')](_0x5521e6[_0x320a('0x34')]);_0x31ab9c[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x31ab9c[_0x320a('0x33')],_0x31ab9c[_0x320a('0x34')]);_0xfd9dd3[_0x320a('0x37')]=_['intersection'](_0x31ab9c[_0x320a('0x33')],qs[_0x320a('0x38')](_0x5521e6['query'][_0x320a('0x38')]));_0xfd9dd3[_0x320a('0x37')]=_0xfd9dd3[_0x320a('0x37')][_0x320a('0x39')]?_0xfd9dd3[_0x320a('0x37')]:_0x31ab9c[_0x320a('0x33')];_0xfd9dd3[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x5521e6[_0x320a('0x34')][_0x320a('0x3c')]);_0xfd9dd3[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x5521e6[_0x320a('0x34')],_0x31ab9c['filters']));if(_0x5521e6[_0x320a('0x34')][_0x320a('0x40')]){_0xfd9dd3[_0x320a('0x3d')]=_[_0x320a('0x51')](_0xfd9dd3[_0x320a('0x3d')],{'$or':_['map'](_0xfd9dd3['attributes'],function(_0x9bfa81){var _0x3b6af3={};_0x3b6af3[_0x9bfa81]={'$like':'%'+_0x5521e6['query'][_0x320a('0x40')]+'%'};return _0x3b6af3;})});}_0xfd9dd3=_[_0x320a('0x51')]({},_0xfd9dd3,_0x5521e6[_0x320a('0x47')]);return _0x2ff6a4[_0x320a('0x8f')](_0xfd9dd3);}})['then'](function(_0x365c1c){if(_0x365c1c){_0x477761=_0x365c1c[_0x320a('0x39')];if(!_0x5521e6[_0x320a('0x34')][_0x320a('0x5a')]('nolimit')){_0xfd9dd3[_0x320a('0x1c')]=qs['limit'](_0x5521e6[_0x320a('0x34')][_0x320a('0x1c')]);_0xfd9dd3['offset']=qs['offset'](_0x5521e6[_0x320a('0x34')]['offset']);}return _0x2ff6a4[_0x320a('0x8f')](_0xfd9dd3);}})[_0x320a('0x24')](function(_0x2c728c){if(_0x2c728c){return _0x2c728c?{'count':_0x477761,'rows':_0x2c728c}:null;}})[_0x320a('0x24')](respondWithResult(_0x1a88cf,null))[_0x320a('0x44')](handleError(_0x1a88cf,null));};exports[_0x320a('0x90')]=function(_0x10f737,_0x1c8ad2,_0xdc8083){var _0x3d8b57,_0x4122ba;var _0x1f7c92=[];var _0x16f2b1=moment()[_0x320a('0x91')](_0x320a('0x66'));return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x10f737['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x1c8ad2,null))[_0x320a('0x24')](function(_0xa645e5){if(_0xa645e5){_0x4122ba=_0xa645e5;return _0xa645e5[_0x320a('0x90')](_0x10f737[_0x320a('0x4a')][_0x320a('0x67')],_[_0x320a('0x52')](_0x10f737[_0x320a('0x4a')],[_0x320a('0x67'),'id'])||{});}return null;})['spread'](function(_0x68d8b0){var _0x858b7a;var _0x56d4d1;_0x3d8b57=_0x68d8b0||[];var _0x125c95=[];if(_0x68d8b0){for(var _0x19964b=0x0;_0x19964b<_0x68d8b0[_0x320a('0x39')];_0x19964b+=0x1){var _0x4bc12a=_0x68d8b0[_0x19964b]['get']({'plain':!![]});_0x858b7a=squel[_0x320a('0x6a')]()['into'](_0x320a('0x92'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),_0x320a('0x53'),'updatedAt'],squel[_0x320a('0x80')]()[_0x320a('0x72')](_0x320a('0x6e'),_0x320a('0x6e'))['field']('id',_0x320a('0x70'))[_0x320a('0x72')](_0x4bc12a[_0x320a('0x74')][_0x320a('0x75')](),_0x320a('0x71'))[_0x320a('0x72')](_0x10f737[_0x320a('0x46')]['id'][_0x320a('0x75')](),_0x320a('0x5c'))['field'](_0x320a('0x73'),_0x320a('0x53'))[_0x320a('0x72')]('NOW()','updatedAt')[_0x320a('0x7b')](_0x320a('0x81'))['where'](_0x320a('0x76'))[_0x320a('0x3d')]('ListId\x20=\x20?',_0x4bc12a[_0x320a('0x74')][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x78')))[_0x320a('0x75')]();_0x125c95[_0x320a('0x8b')](db[_0x320a('0x8c')][_0x320a('0x34')](_0x858b7a));}return BPromise[_0x320a('0x8d')](_0x125c95);}})[_0x320a('0x24')](function(){return _0x3d8b57;})[_0x320a('0x24')](respondWithResult(_0x1c8ad2,null))[_0x320a('0x44')](handleError(_0x1c8ad2,null));};exports[_0x320a('0x93')]=function(_0x4b90c8,_0xb47771,_0x3fbb42){return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x4b90c8[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xb47771,null))[_0x320a('0x24')](function(_0xea3af5){if(_0xea3af5){return _0xea3af5['removeBlackLists'](_0x4b90c8[_0x320a('0x34')][_0x320a('0x67')]);}})['then'](function(_0xb1141a){if(_0xb1141a){return db[_0x320a('0x62')][_0x320a('0x23')]({'where':{'ListId':_0x4b90c8[_0x320a('0x34')]['ids'],'CampaignId':_0x4b90c8['params']['id']}})['then'](function(){return _0xb1141a;});}})[_0x320a('0x24')](respondWithStatusCode(_0xb47771,null))[_0x320a('0x44')](handleError(_0xb47771,null));};
\ No newline at end of file
+var _0xe773=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','NOW()','cm_contacts','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json'];(function(_0x2d5341,_0x590e15){var _0x3c87a5=function(_0x5ecdd5){while(--_0x5ecdd5){_0x2d5341['push'](_0x2d5341['shift']());}};_0x3c87a5(++_0x590e15);}(_0xe773,0x19a));var _0x3e77=function(_0x5b51dc,_0x4a4b33){_0x5b51dc=_0x5b51dc-0x0;var _0x315a48=_0xe773[_0x5b51dc];return _0x315a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e77('0x0'));var zipdir=require(_0x3e77('0x1'));var jsonpatch=require(_0x3e77('0x2'));var rp=require('request-promise');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var Mustache=require(_0x3e77('0x5'));var util=require(_0x3e77('0x6'));var path=require(_0x3e77('0x7'));var sox=require('sox');var csv=require(_0x3e77('0x8'));var ejs=require(_0x3e77('0x9'));var fs=require('fs');var fs_extra=require(_0x3e77('0xa'));var _=require(_0x3e77('0xb'));var squel=require(_0x3e77('0xc'));var crypto=require(_0x3e77('0xd'));var jsforce=require(_0x3e77('0xe'));var deskjs=require(_0x3e77('0xf'));var toCsv=require(_0x3e77('0x8'));var querystring=require(_0x3e77('0x10'));var Papa=require(_0x3e77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e77('0x12'));var as=require(_0x3e77('0x13'));var hardwareService=require(_0x3e77('0x14'));var logger=require(_0x3e77('0x15'))(_0x3e77('0x16'));var utils=require('../../config/utils');var config=require(_0x3e77('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa8a5,_0x4a1d09){_0x4a1d09=_0x4a1d09||0xcc;return function(_0x5b0f11){if(_0x5b0f11){return _0x1aa8a5[_0x3e77('0x18')](_0x4a1d09);}return _0x1aa8a5[_0x3e77('0x19')](_0x4a1d09)[_0x3e77('0x1a')]();};}function respondWithResult(_0x53188b,_0xb9208c){_0xb9208c=_0xb9208c||0xc8;return function(_0x55610c){if(_0x55610c){return _0x53188b[_0x3e77('0x19')](_0xb9208c)[_0x3e77('0x1b')](_0x55610c);}};}function respondWithFilteredResult(_0x4a48c8,_0x3fc41f){return function(_0x11d14b){if(_0x11d14b){var _0x39ec03=typeof _0x3fc41f[_0x3e77('0x1c')]===_0x3e77('0x1d')&&typeof _0x3fc41f[_0x3e77('0x1e')]==='undefined';var _0x1c2260=_0x11d14b[_0x3e77('0x1f')];var _0x35d890=_0x39ec03?0x0:_0x3fc41f[_0x3e77('0x1c')];var _0x58b8ee=_0x39ec03?_0x11d14b['count']:_0x3fc41f[_0x3e77('0x1c')]+_0x3fc41f['limit'];var _0x1eb346;if(_0x58b8ee>=_0x1c2260){_0x58b8ee=_0x1c2260;_0x1eb346=0xc8;}else{_0x1eb346=0xce;}_0x4a48c8[_0x3e77('0x19')](_0x1eb346);return _0x4a48c8[_0x3e77('0x20')](_0x3e77('0x21'),_0x35d890+'-'+_0x58b8ee+'/'+_0x1c2260)[_0x3e77('0x1b')](_0x11d14b);}return null;};}function patchUpdates(_0x19c4e1){return function(_0x4b2101){try{jsonpatch[_0x3e77('0x22')](_0x4b2101,_0x19c4e1,!![]);}catch(_0x96b07){return BPromise[_0x3e77('0x23')](_0x96b07);}return _0x4b2101[_0x3e77('0x24')]();};}function saveUpdates(_0x2a384a,_0x289c3d){return function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0x3e77('0x25')](_0x2a384a)['then'](function(_0x45762f){return _0x45762f;});}return null;};}function removeEntity(_0x317f32,_0x3ef7cf){return function(_0x1b2ce6){if(_0x1b2ce6){return _0x1b2ce6['destroy']()[_0x3e77('0x26')](function(){var _0x320144=_0x1b2ce6[_0x3e77('0x27')]({'plain':!![]});var _0x1efc1a=_0x3e77('0x28');return db[_0x3e77('0x29')][_0x3e77('0x2a')]({'where':{'type':_0x1efc1a,'resourceId':_0x320144['id']}})[_0x3e77('0x26')](function(){return _0x1b2ce6;});})[_0x3e77('0x26')](function(){_0x317f32[_0x3e77('0x19')](0xcc)[_0x3e77('0x1a')]();});}};}function handleEntityNotFound(_0x472a9e,_0x5cfc73){return function(_0x30e81f){if(!_0x30e81f){_0x472a9e[_0x3e77('0x18')](0x194);}return _0x30e81f;};}function handleError(_0x4fc072,_0x581719){_0x581719=_0x581719||0x1f4;return function(_0x3c4f6a){logger[_0x3e77('0x2b')](_0x3c4f6a[_0x3e77('0x2c')]);if(_0x3c4f6a[_0x3e77('0x2d')]){delete _0x3c4f6a['name'];}_0x4fc072[_0x3e77('0x19')](_0x581719)['send'](_0x3c4f6a);};}exports[_0x3e77('0x2e')]=function(_0x3333f1,_0x27cce5){var _0x577599={},_0x513d5c={},_0x2e42a1={'count':0x0,'rows':[]};var _0x2276f4=_[_0x3e77('0x2f')](db[_0x3e77('0x30')][_0x3e77('0x31')],function(_0x7c3a3c){return{'name':_0x7c3a3c[_0x3e77('0x32')],'type':_0x7c3a3c['type'][_0x3e77('0x33')]};});_0x513d5c[_0x3e77('0x34')]=_['map'](_0x2276f4,_0x3e77('0x2d'));_0x513d5c[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3333f1['query']);_0x513d5c[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],_0x513d5c[_0x3e77('0x35')]);_0x577599[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],qs['fields'](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x577599[_0x3e77('0x39')]=_0x577599[_0x3e77('0x39')]['length']?_0x577599[_0x3e77('0x39')]:_0x513d5c[_0x3e77('0x34')];if(!_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x577599['limit']=qs[_0x3e77('0x1e')](_0x3333f1[_0x3e77('0x35')]['limit']);_0x577599[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x577599[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x577599[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3333f1['query'],_0x513d5c[_0x3e77('0x37')]),_0x2276f4);if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]){_0x577599['where']=_[_0x3e77('0x42')](_0x577599[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x2276f4,function(_0x18a3f5){if(_0x18a3f5[_0x3e77('0x43')]!==_0x3e77('0x44')){var _0x39894b={};_0x39894b[_0x18a3f5['name']]={'$like':'%'+_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x39894b;}})});}_0x577599=_[_0x3e77('0x42')]({},_0x577599,_0x3333f1[_0x3e77('0x45')]);var _0x288df3={'where':_0x577599[_0x3e77('0x3f')]};return db[_0x3e77('0x30')]['count'](_0x288df3)[_0x3e77('0x26')](function(_0x48396b){_0x2e42a1[_0x3e77('0x1f')]=_0x48396b;if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x46')]){_0x577599[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x30')]['findAll'](_0x577599);})[_0x3e77('0x26')](function(_0x58cfe4){_0x2e42a1[_0x3e77('0x48')]=_0x58cfe4;return _0x2e42a1;})[_0x3e77('0x26')](respondWithFilteredResult(_0x27cce5,_0x577599))[_0x3e77('0x49')](handleError(_0x27cce5,null));};exports[_0x3e77('0x4a')]=function(_0x155210,_0x3c59ae){var _0x4d6a9d={'raw':![],'where':{'id':_0x155210[_0x3e77('0x4b')]['id']}},_0x4d51cd={};_0x4d51cd[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x4d51cd[_0x3e77('0x35')]=_['keys'](_0x155210['query']);_0x4d51cd[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],_0x4d51cd[_0x3e77('0x35')]);_0x4d6a9d[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x155210[_0x3e77('0x35')]['fields']));_0x4d6a9d[_0x3e77('0x39')]=_0x4d6a9d[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x4d6a9d[_0x3e77('0x39')]:_0x4d51cd[_0x3e77('0x34')];if(_0x155210['query'][_0x3e77('0x46')]){_0x4d6a9d[_0x3e77('0x47')]=[{'all':!![]}];}_0x4d6a9d=_[_0x3e77('0x42')]({},_0x4d6a9d,_0x155210[_0x3e77('0x45')]);return db[_0x3e77('0x30')][_0x3e77('0x4d')](_0x4d6a9d)[_0x3e77('0x26')](handleEntityNotFound(_0x3c59ae,null))[_0x3e77('0x26')](respondWithResult(_0x3c59ae,null))[_0x3e77('0x49')](handleError(_0x3c59ae,null));};exports[_0x3e77('0x4e')]=function(_0x598971,_0x2e28f7){return db[_0x3e77('0x30')][_0x3e77('0x4e')](_0x598971[_0x3e77('0x4f')],{})['then'](function(_0x3022f6){var _0x36ba43=_0x598971[_0x3e77('0x50')]['get']({'plain':!![]});if(!_0x36ba43)throw new Error(_0x3e77('0x51'));if(_0x36ba43[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1b6046=_0x3022f6[_0x3e77('0x27')]({'plain':!![]});var _0x5ae2cd=_0x3e77('0x28');return db[_0x3e77('0x53')][_0x3e77('0x4d')]({'where':{'name':_0x5ae2cd,'userProfileId':_0x36ba43[_0x3e77('0x54')]},'raw':!![]})[_0x3e77('0x26')](function(_0x30c4ea){if(_0x30c4ea&&_0x30c4ea[_0x3e77('0x55')]===0x0){return db['UserProfileResource'][_0x3e77('0x4e')]({'name':_0x1b6046['name'],'resourceId':_0x1b6046['id'],'type':_0x30c4ea[_0x3e77('0x2d')],'sectionId':_0x30c4ea['id']},{})[_0x3e77('0x26')](function(){return _0x3022f6;});}else{return _0x3022f6;}})[_0x3e77('0x49')](function(_0x1e3c3a){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x1e3c3a);throw _0x1e3c3a;});}return _0x3022f6;})[_0x3e77('0x26')](respondWithResult(_0x2e28f7,0xc9))[_0x3e77('0x49')](handleError(_0x2e28f7,null));};exports[_0x3e77('0x57')]=function(_0x595879,_0x24346a){var _0x126d4c={'where':{'id':_0x595879[_0x3e77('0x4b')]['id']}},_0xe54e0={};_0xe54e0[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x126d4c[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xe54e0[_0x3e77('0x34')],qs['fields'](_0x595879[_0x3e77('0x35')]['fields']));_0x126d4c[_0x3e77('0x39')]=_0x126d4c['attributes'][_0x3e77('0x4c')]?_0x126d4c[_0x3e77('0x39')]:_0xe54e0[_0x3e77('0x34')];if(_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]){_0x126d4c[_0x3e77('0x47')]=[{'all':!![]}];}_0x126d4c=_[_0x3e77('0x42')]({},_0x126d4c,_0x595879['options']);return db['Campaign'][_0x3e77('0x4d')](_0x126d4c)['then'](handleEntityNotFound(_0x24346a,null))[_0x3e77('0x26')](function(_0x3e61bf){if(_0x3e61bf){var _0x512fda=_0x3e61bf[_0x3e77('0x27')]({'plain':!![]});_0x512fda=qs[_0x3e77('0x58')](_0x512fda,['id',_0x3e77('0x59'),_0x3e77('0x5a')]);_0x595879[_0x3e77('0x4f')]=_[_0x3e77('0x58')](_0x595879[_0x3e77('0x4f')],['id','createdAt',_0x3e77('0x5a')]);return db[_0x3e77('0x30')][_0x3e77('0x4e')](_[_0x3e77('0x42')](_0x512fda,_0x595879[_0x3e77('0x4f')]),{'include':_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x4de4c4){var _0x1ebdc6=_0x595879[_0x3e77('0x50')][_0x3e77('0x27')]({'plain':!![]});if(!_0x1ebdc6)throw new Error(_0x3e77('0x51'));if(_0x1ebdc6[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1890b5=_0x4de4c4['get']({'plain':!![]});var _0x26bd0c=_0x3e77('0x28');return db[_0x3e77('0x53')]['find']({'where':{'name':_0x26bd0c,'userProfileId':_0x1ebdc6['userProfileId']},'raw':!![]})[_0x3e77('0x26')](function(_0x532df3){if(_0x532df3&&_0x532df3['autoAssociation']===0x0){return db[_0x3e77('0x29')]['create']({'name':_0x1890b5[_0x3e77('0x2d')],'resourceId':_0x1890b5['id'],'type':_0x532df3[_0x3e77('0x2d')],'sectionId':_0x532df3['id']},{})[_0x3e77('0x26')](function(){return _0x4de4c4;});}else{return _0x4de4c4;}})[_0x3e77('0x49')](function(_0x58623b){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x58623b);throw _0x58623b;});}return _0x4de4c4;});}})[_0x3e77('0x26')](respondWithResult(_0x24346a,0xc9))['catch'](handleError(_0x24346a,null));};exports['update']=function(_0x293c2e,_0x2c4bc2){if(_0x293c2e[_0x3e77('0x4f')]['id']){delete _0x293c2e[_0x3e77('0x4f')]['id'];}return db[_0x3e77('0x30')]['find']({'where':{'id':_0x293c2e[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c4bc2,null))['then'](saveUpdates(_0x293c2e[_0x3e77('0x4f')],null))['then'](respondWithResult(_0x2c4bc2,null))['catch'](handleError(_0x2c4bc2,null));};exports['destroy']=function(_0x207da1,_0x18cedd){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x207da1[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18cedd,null))['then'](removeEntity(_0x18cedd,null))[_0x3e77('0x49')](handleError(_0x18cedd,null));};exports[_0x3e77('0x5b')]=function(_0x3c174a,_0x248266,_0x3d4973){var _0x117abc={'raw':!![],'where':{}};var _0x1647f5={};var _0xf4a464={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c174a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x248266,null))[_0x3e77('0x26')](function(_0x110d3f){if(_0x110d3f){_0x1647f5[_0x3e77('0x34')]=_['keys'](db[_0x3e77('0x5c')][_0x3e77('0x31')]);_0x1647f5[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3c174a[_0x3e77('0x35')]);_0x1647f5[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],_0x1647f5[_0x3e77('0x35')]);_0x117abc[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x117abc['attributes']=_0x117abc[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x117abc[_0x3e77('0x39')]:_0x1647f5[_0x3e77('0x34')];if(!_0x3c174a['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x117abc[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3c174a[_0x3e77('0x35')]['limit']);_0x117abc['offset']=qs[_0x3e77('0x1c')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x117abc[_0x3e77('0x3d')]=qs['sort'](_0x3c174a[_0x3e77('0x35')]['sort']);_0x117abc[_0x3e77('0x3f')]=qs['filters'](_[_0x3e77('0x40')](_0x3c174a[_0x3e77('0x35')],_0x1647f5['filters']));_0x117abc[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x110d3f['id'];if(_0x3c174a['query'][_0x3e77('0x41')]){_0x117abc['where']=_['merge'](_0x117abc[_0x3e77('0x3f')],{'$or':_['map'](_0x117abc[_0x3e77('0x39')],function(_0x5e1400){var _0x5b6150={};_0x5b6150[_0x5e1400]={'$like':'%'+_0x3c174a[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x5b6150;})});}_0x117abc=_[_0x3e77('0x42')]({},_0x117abc,_0x3c174a[_0x3e77('0x45')]);return db[_0x3e77('0x5c')][_0x3e77('0x1f')]({'where':_0x117abc[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x10c9ef){_0xf4a464[_0x3e77('0x1f')]=_0x10c9ef;if(_0x3c174a[_0x3e77('0x35')][_0x3e77('0x46')]){_0x117abc[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x5c')][_0x3e77('0x5e')](_0x117abc);})[_0x3e77('0x26')](function(_0x24566a){_0xf4a464[_0x3e77('0x48')]=_0x24566a;return _0xf4a464;});}})['then'](respondWithFilteredResult(_0x248266,_0x117abc))[_0x3e77('0x49')](handleError(_0x248266,null));};exports[_0x3e77('0x5f')]=function(_0x74c95f,_0xa03927,_0x4206d0){var _0x5269f5={'raw':!![],'where':{}};var _0x26eb34={};var _0x15e0c5={'count':0x0,'rows':[]};return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x74c95f[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xa03927,null))[_0x3e77('0x26')](function(_0x41d433){if(_0x41d433){_0x26eb34[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmHopperHistory']['rawAttributes']);_0x26eb34[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x74c95f['query']);_0x26eb34[_0x3e77('0x37')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],_0x26eb34['query']);_0x5269f5[_0x3e77('0x39')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x5269f5[_0x3e77('0x39')]=_0x5269f5[_0x3e77('0x39')]['length']?_0x5269f5[_0x3e77('0x39')]:_0x26eb34['model'];if(!_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3b')]('nolimit')){_0x5269f5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x1e')]);_0x5269f5[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x74c95f[_0x3e77('0x35')]['offset']);}_0x5269f5[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x74c95f[_0x3e77('0x35')]['sort']);_0x5269f5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x74c95f[_0x3e77('0x35')],_0x26eb34[_0x3e77('0x37')]));_0x5269f5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x41d433['id'];if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x41')]){_0x5269f5[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x5269f5['where'],{'$or':_[_0x3e77('0x2f')](_0x5269f5['attributes'],function(_0x510cf6){var _0x1c1965={};_0x1c1965[_0x510cf6]={'$like':'%'+_0x74c95f['query'][_0x3e77('0x41')]+'%'};return _0x1c1965;})});}_0x5269f5=_['merge']({},_0x5269f5,_0x74c95f[_0x3e77('0x45')]);return db[_0x3e77('0x61')][_0x3e77('0x1f')]({'where':_0x5269f5[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x1b0f7c){_0x15e0c5[_0x3e77('0x1f')]=_0x1b0f7c;if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x46')]){_0x5269f5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3e77('0x5e')](_0x5269f5);})['then'](function(_0x14a786){_0x15e0c5[_0x3e77('0x48')]=_0x14a786;return _0x15e0c5;});}})['then'](respondWithFilteredResult(_0xa03927,_0x5269f5))['catch'](handleError(_0xa03927,null));};exports[_0x3e77('0x62')]=function(_0x3fbea2,_0x578e79,_0x25aa11){var _0xfb07c5={'raw':!![],'where':{}};var _0x173c5d={};var _0x4ed6ed={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x3fbea2['params']['id']}})['then'](handleEntityNotFound(_0x578e79,null))[_0x3e77('0x26')](function(_0x284b55){if(_0x284b55){_0x173c5d[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x63')][_0x3e77('0x31')]);_0x173c5d[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3fbea2['query']);_0x173c5d[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],_0x173c5d[_0x3e77('0x35')]);_0xfb07c5[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3fbea2['query'][_0x3e77('0x3a')]));_0xfb07c5[_0x3e77('0x39')]=_0xfb07c5[_0x3e77('0x39')][_0x3e77('0x4c')]?_0xfb07c5[_0x3e77('0x39')]:_0x173c5d[_0x3e77('0x34')];if(!_0x3fbea2['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0xfb07c5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1e')]);_0xfb07c5[_0x3e77('0x1c')]=qs['offset'](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0xfb07c5['order']=qs['sort'](_0x3fbea2['query']['sort']);_0xfb07c5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3fbea2[_0x3e77('0x35')],_0x173c5d['filters']));_0xfb07c5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x284b55['id'];if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x41')]){_0xfb07c5['where']=_[_0x3e77('0x42')](_0xfb07c5[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0xfb07c5[_0x3e77('0x39')],function(_0x4443e7){var _0x2db50a={};_0x2db50a[_0x4443e7]={'$like':'%'+_0x3fbea2[_0x3e77('0x35')]['filter']+'%'};return _0x2db50a;})});}_0xfb07c5=_[_0x3e77('0x42')]({},_0xfb07c5,_0x3fbea2[_0x3e77('0x45')]);return db[_0x3e77('0x63')]['count']({'where':_0xfb07c5['where']})[_0x3e77('0x26')](function(_0x461587){_0x4ed6ed[_0x3e77('0x1f')]=_0x461587;if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x46')]){_0xfb07c5[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x63')]['findAll'](_0xfb07c5);})[_0x3e77('0x26')](function(_0x2d842f){_0x4ed6ed[_0x3e77('0x48')]=_0x2d842f;return _0x4ed6ed;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x578e79,_0xfb07c5))[_0x3e77('0x49')](handleError(_0x578e79,null));};exports[_0x3e77('0x64')]=function(_0x4f1814,_0x10e034,_0x149463){var _0x44b60f={'raw':!![],'where':{}};var _0x423886={};var _0x38d154={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x4f1814[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x10e034,null))[_0x3e77('0x26')](function(_0x50e433){if(_0x50e433){_0x423886[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x65')]['rawAttributes']);_0x423886[_0x3e77('0x35')]=_['keys'](_0x4f1814[_0x3e77('0x35')]);_0x423886[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],_0x423886[_0x3e77('0x35')]);_0x44b60f[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x4f1814['query'][_0x3e77('0x3a')]));_0x44b60f['attributes']=_0x44b60f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44b60f[_0x3e77('0x39')]:_0x423886[_0x3e77('0x34')];if(!_0x4f1814['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44b60f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x4f1814['query'][_0x3e77('0x1e')]);_0x44b60f[_0x3e77('0x1c')]=qs['offset'](_0x4f1814[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x44b60f['order']=qs[_0x3e77('0x3e')](_0x4f1814['query']['sort']);_0x44b60f['where']=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x4f1814[_0x3e77('0x35')],_0x423886[_0x3e77('0x37')]));_0x44b60f[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x50e433['id'];if(_0x4f1814['query'][_0x3e77('0x41')]){_0x44b60f['where']=_[_0x3e77('0x42')](_0x44b60f['where'],{'$or':_[_0x3e77('0x2f')](_0x44b60f[_0x3e77('0x39')],function(_0x1baf86){var _0x3564fd={};_0x3564fd[_0x1baf86]={'$like':'%'+_0x4f1814[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x3564fd;})});}_0x44b60f=_['merge']({},_0x44b60f,_0x4f1814['options']);return db[_0x3e77('0x65')][_0x3e77('0x1f')]({'where':_0x44b60f['where']})[_0x3e77('0x26')](function(_0x15ee01){_0x38d154[_0x3e77('0x1f')]=_0x15ee01;if(_0x4f1814[_0x3e77('0x35')]['includeAll']){_0x44b60f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3e77('0x5e')](_0x44b60f);})[_0x3e77('0x26')](function(_0x1c58fd){_0x38d154['rows']=_0x1c58fd;return _0x38d154;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x10e034,_0x44b60f))[_0x3e77('0x49')](handleError(_0x10e034,null));};exports[_0x3e77('0x66')]=function(_0x97a639,_0x2fdbc9,_0xa91b28){var _0x2def37={};var _0xd2cce2={};var _0x3ca480;var _0xad1adb;return db['Campaign'][_0x3e77('0x60')]({'where':{'id':_0x97a639[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x2fdbc9,null))[_0x3e77('0x26')](function(_0x159cc1){if(_0x159cc1){_0x3ca480=_0x159cc1;_0xd2cce2[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmList'][_0x3e77('0x31')]);_0xd2cce2[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x97a639[_0x3e77('0x35')]);_0xd2cce2[_0x3e77('0x37')]=_['intersection'](_0xd2cce2[_0x3e77('0x34')],_0xd2cce2[_0x3e77('0x35')]);_0x2def37[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xd2cce2['model'],qs[_0x3e77('0x3a')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x2def37[_0x3e77('0x39')]=_0x2def37['attributes'][_0x3e77('0x4c')]?_0x2def37[_0x3e77('0x39')]:_0xd2cce2[_0x3e77('0x34')];_0x2def37['order']=qs[_0x3e77('0x3e')](_0x97a639['query']['sort']);_0x2def37[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x97a639[_0x3e77('0x35')],_0xd2cce2[_0x3e77('0x37')]));if(_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]){_0x2def37[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x2def37[_0x3e77('0x3f')],{'$or':_['map'](_0x2def37[_0x3e77('0x39')],function(_0x554c5f){var _0x9a8dd3={};_0x9a8dd3[_0x554c5f]={'$like':'%'+_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x9a8dd3;})});}_0x2def37=_[_0x3e77('0x42')]({},_0x2def37,_0x97a639[_0x3e77('0x45')]);return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x58b9c0){if(_0x58b9c0){_0xad1adb=_0x58b9c0[_0x3e77('0x4c')];if(!_0x97a639[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x2def37[_0x3e77('0x1e')]=qs['limit'](_0x97a639['query'][_0x3e77('0x1e')]);_0x2def37[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x154844){if(_0x154844){return _0x154844?{'count':_0xad1adb,'rows':_0x154844}:null;}})[_0x3e77('0x26')](respondWithResult(_0x2fdbc9,null))[_0x3e77('0x49')](handleError(_0x2fdbc9,null));};exports[_0x3e77('0x67')]=function(_0x36d358,_0x10fd5b,_0x354ede){var _0x3a104e,_0x5a224c;var _0x25b353=[];var _0x40394f=moment()['format'](_0x3e77('0x68'));return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x36d358[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10fd5b,null))[_0x3e77('0x26')](function(_0x1aa56b){if(_0x1aa56b){_0x5a224c=_0x1aa56b;return _0x1aa56b[_0x3e77('0x67')](_0x36d358['body'][_0x3e77('0x69')],_['omit'](_0x36d358[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x2a621f){var _0x4cab54;var _0xd69c2d;_0x3a104e=_0x2a621f||[];var _0xbf12ac=[];if(_0x2a621f){for(var _0x80aa0e=0x0;_0x80aa0e<_0x2a621f['length'];_0x80aa0e+=0x1){var _0x3b18e9=_0x2a621f[_0x80aa0e][_0x3e77('0x27')]({'plain':!![]});_0x5a224c[_0x3e77('0x6b')]=_0x36d358['body'][_0x3e77('0x6b')]?_0x36d358[_0x3e77('0x4f')]['dialCheckDuplicateType']:_0x5a224c[_0x3e77('0x6b')];switch(_0x5a224c['dialCheckDuplicateType']){case'always':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field'](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()',_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27','createdAt')[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')]('cm_contacts')['where'](_0x3e77('0x79'))[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7c'))[_0x3e77('0x78')](_0x3e77('0x7d'))['where']('CampaignId\x20=\x20?',_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]()))[_0x3e77('0x3f')](_0x3e77('0x7e'),squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')](_0x3e77('0x6e'))[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())))[_0x3e77('0x77')]();break;case'onlyIfOpen':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))['fromQuery']([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),'ListId',_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()[_0x3e77('0x75')](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),_0x3e77('0x73'))[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')]('cm_hopper')[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id']['toString']())))[_0x3e77('0x77')]();break;default:_0x4cab54=squel[_0x3e77('0x6c')]()['into'](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field']('phone',_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()','scheduledAt')[_0x3e77('0x75')]('id','ContactId')[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')]['toString']())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();}_0xd69c2d=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')]('cm_hopper_additional_phones')[_0x3e77('0x6f')](['cmHopperId',_0x3e77('0x71'),_0x3e77('0x70'),'OrderBy',_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()['field']('h.id','id')[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))[_0x3e77('0x75')](_0x3e77('0x83'),_0x3e77('0x70'))[_0x3e77('0x75')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x84'),'ci')[_0x3e77('0x85')](_0x3e77('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x3e77('0x86'),_0x3b18e9['CmListId'][_0x3e77('0x77')]())['where'](_0x3e77('0x87'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x88'),_0x40394f))[_0x3e77('0x77')]();_0xbf12ac[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x4cab54));_0x25b353[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0xd69c2d));}return BPromise[_0x3e77('0x8b')](_0xbf12ac);}})[_0x3e77('0x26')](function(){return BPromise['all'](_0x25b353);})[_0x3e77('0x26')](function(){return _0x3a104e;})['then'](respondWithResult(_0x10fd5b,null))[_0x3e77('0x49')](handleError(_0x10fd5b,null));};exports[_0x3e77('0x8c')]=function(_0x22c41a,_0xfbe6a0,_0x57dd35){return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xfbe6a0,null))['then'](function(_0xc34e57){if(_0xc34e57){return _0xc34e57[_0x3e77('0x8c')](_0x22c41a['query'][_0x3e77('0x69')]);}})[_0x3e77('0x26')](function(_0x5dd70c){if(_0x5dd70c){return db[_0x3e77('0x5c')][_0x3e77('0x2a')]({'where':{'ListId':_0x22c41a[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x5dd70c;});}})[_0x3e77('0x26')](respondWithStatusCode(_0xfbe6a0,null))[_0x3e77('0x49')](handleError(_0xfbe6a0,null));};exports[_0x3e77('0x8d')]=function(_0x33a8ac,_0x18a735,_0x4cdce9){var _0x44ab7f={};var _0x12e4ed={};var _0x4260bf;var _0x2f72a0;return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x33a8ac[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18a735,null))[_0x3e77('0x26')](function(_0xef7ec9){if(_0xef7ec9){_0x4260bf=_0xef7ec9;_0x12e4ed[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x8e')][_0x3e77('0x31')]);_0x12e4ed['query']=_['keys'](_0x33a8ac[_0x3e77('0x35')]);_0x12e4ed[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],_0x12e4ed[_0x3e77('0x35')]);_0x44ab7f['attributes']=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],qs['fields'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x44ab7f['attributes']=_0x44ab7f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44ab7f['attributes']:_0x12e4ed[_0x3e77('0x34')];_0x44ab7f[_0x3e77('0x3d')]=qs['sort'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x44ab7f[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x33a8ac[_0x3e77('0x35')],_0x12e4ed[_0x3e77('0x37')]));if(_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]){_0x44ab7f['where']=_[_0x3e77('0x42')](_0x44ab7f[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x44ab7f[_0x3e77('0x39')],function(_0x59b408){var _0x506a73={};_0x506a73[_0x59b408]={'$like':'%'+_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x506a73;})});}_0x44ab7f=_['merge']({},_0x44ab7f,_0x33a8ac[_0x3e77('0x45')]);return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})['then'](function(_0x4a56ea){if(_0x4a56ea){_0x2f72a0=_0x4a56ea[_0x3e77('0x4c')];if(!_0x33a8ac['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44ab7f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x33a8ac['query']['limit']);_0x44ab7f['offset']=qs[_0x3e77('0x1c')](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})[_0x3e77('0x26')](function(_0x3c88ec){if(_0x3c88ec){return _0x3c88ec?{'count':_0x2f72a0,'rows':_0x3c88ec}:null;}})['then'](respondWithResult(_0x18a735,null))[_0x3e77('0x49')](handleError(_0x18a735,null));};exports[_0x3e77('0x8f')]=function(_0x475079,_0x50c60e,_0x252d72){var _0x27b586,_0x4855cd;var _0x5ad1d7=[];var _0x4a6f7e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3e77('0x30')]['find']({'where':{'id':_0x475079[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x50c60e,null))[_0x3e77('0x26')](function(_0x524d1c){if(_0x524d1c){_0x4855cd=_0x524d1c;return _0x524d1c[_0x3e77('0x8f')](_0x475079[_0x3e77('0x4f')][_0x3e77('0x69')],_[_0x3e77('0x58')](_0x475079[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x5b1585){var _0x121e28;var _0x129c74;_0x27b586=_0x5b1585||[];var _0x7f34af=[];if(_0x5b1585){for(var _0x458b59=0x0;_0x458b59<_0x5b1585[_0x3e77('0x4c')];_0x458b59+=0x1){var _0x2f5f44=_0x5b1585[_0x458b59][_0x3e77('0x27')]({'plain':!![]});_0x121e28=squel['insert']()[_0x3e77('0x6d')](_0x3e77('0x90'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()[_0x3e77('0x75')]('phone',_0x3e77('0x70'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x2f5f44[_0x3e77('0x76')][_0x3e77('0x77')](),_0x3e77('0x73'))['field'](_0x475079['params']['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x59'))['field'](_0x3e77('0x81'),'updatedAt')['from'](_0x3e77('0x82'))[_0x3e77('0x3f')](_0x3e77('0x79'))['where'](_0x3e77('0x7a'),_0x2f5f44['CmListId'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();_0x7f34af['push'](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x121e28));}return BPromise['all'](_0x7f34af);}})[_0x3e77('0x26')](function(){return _0x27b586;})['then'](respondWithResult(_0x50c60e,null))['catch'](handleError(_0x50c60e,null));};exports[_0x3e77('0x91')]=function(_0x5f4d01,_0x5237f2,_0x56e17f){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x5237f2,null))[_0x3e77('0x26')](function(_0x3980db){if(_0x3980db){return _0x3980db[_0x3e77('0x91')](_0x5f4d01['query'][_0x3e77('0x69')]);}})['then'](function(_0x434ebb){if(_0x434ebb){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5f4d01[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x434ebb;});}})[_0x3e77('0x26')](respondWithStatusCode(_0x5237f2,null))[_0x3e77('0x49')](handleError(_0x5237f2,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f503d92..7770169 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x7a54,0x106));var _0x47a5=function(_0x1148c4,_0x490d09){_0x1148c4=_0x1148c4-0x0;var _0x4abd1d=_0x7a54[_0x1148c4];return _0x4abd1d;};'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 9b1e634..9036268 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 _0xb7fc=['include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','findAll','options','attributes','limit'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x1cbecb,_0x505e33){_0x1cbecb=_0x1cbecb-0x0;var _0x4112c4=_0xb7fc[_0x1cbecb];return _0x4112c4;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});}exports[_0xcb7f('0x16')]=function(_0x5d43b6){var _0x2430b3=this;return new Promise(function(_0x1d1d4c,_0x57274b){return db['Campaign'][_0xcb7f('0x17')]({'raw':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d43b6['options']?_0x5d43b6[_0xcb7f('0x18')]['where']||null:null,'attributes':_0x5d43b6['options']?_0x5d43b6['options'][_0xcb7f('0x19')]||null:null,'limit':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6['options'][_0xcb7f('0x1a')]||null:null,'include':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')][_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x5d43b6[_0xcb7f('0x18')]['include'],function(_0x588a4b){return{'model':db[_0x588a4b[_0xcb7f('0x1d')]],'as':_0x588a4b['as'],'attributes':_0x588a4b[_0xcb7f('0x19')],'include':_0x588a4b[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x588a4b[_0xcb7f('0x1b')],function(_0x2a1a8c){return{'model':db[_0x2a1a8c['model']],'as':_0x2a1a8c['as'],'attributes':_0x2a1a8c[_0xcb7f('0x19')],'include':_0x2a1a8c[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x2a1a8c['include'],function(_0x30ecb7){return{'model':db[_0x30ecb7[_0xcb7f('0x1d')]],'as':_0x30ecb7['as'],'attributes':_0x30ecb7[_0xcb7f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8879a1){logger['info'](_0xcb7f('0x16'),_0x5d43b6);logger['debug'](_0xcb7f('0x16'),_0x5d43b6,JSON[_0xcb7f('0x11')](_0x8879a1));_0x1d1d4c(_0x8879a1);})['catch'](function(_0x597a82){logger['error'](_0xcb7f('0x16'),_0x597a82[_0xcb7f('0x13')],_0x5d43b6);_0x57274b(_0x2430b3['error'](0x1f4,_0x597a82[_0xcb7f('0x13')]));});});};
\ No newline at end of file
+var _0x4ef1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','bluebird'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x4ef1,0xeb));var _0x14ef=function(_0x5a6dc5,_0x4a7a46){_0x5a6dc5=_0x5a6dc5-0x0;var _0x2b6dcd=_0x4ef1[_0x5a6dc5];return _0x2b6dcd;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var moment=require('moment');var BPromise=require(_0x14ef('0x2'));var rs=require(_0x14ef('0x3'));var fs=require('fs');var Redis=require(_0x14ef('0x4'));var db=require(_0x14ef('0x5'))['db'];var utils=require(_0x14ef('0x6'));var logger=require(_0x14ef('0x7'))(_0x14ef('0x8'));var config=require(_0x14ef('0x9'));var jayson=require(_0x14ef('0xa'));var client=jayson[_0x14ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261fa2,_0x2dc335,_0x5b75ad){return new BPromise(function(_0x4175e7,_0x2ab217){return client[_0x14ef('0xc')](_0x261fa2,_0x5b75ad)[_0x14ef('0xd')](function(_0x17acc1){logger['info'](_0x14ef('0xe'),_0x2dc335,'request\x20sent');logger[_0x14ef('0xf')](_0x14ef('0x10'),_0x2dc335,_0x14ef('0x11'),JSON[_0x14ef('0x12')](_0x17acc1));if(_0x17acc1['error']){if(_0x17acc1['error'][_0x14ef('0x13')]===0x1f4){logger[_0x14ef('0x14')]('Campaign,\x20%s,\x20%s',_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x2ab217(_0x17acc1[_0x14ef('0x14')]['message']);}logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x4175e7(_0x17acc1['error'][_0x14ef('0x15')]);}else{logger[_0x14ef('0x16')](_0x14ef('0xe'),_0x2dc335,_0x14ef('0x11'));_0x4175e7(_0x17acc1['result'][_0x14ef('0x15')]);}})[_0x14ef('0x17')](function(_0x24556b){logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x24556b);_0x2ab217(_0x24556b);});});}exports[_0x14ef('0x18')]=function(_0x17f63a){var _0x1acc0a=this;return new Promise(function(_0x19b2cb,_0x3b5b23){return db[_0x14ef('0x19')][_0x14ef('0x1a')]({'raw':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1c')]||null:null,'attributes':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1d')]||null:null,'limit':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1e')]||null:null,'include':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')]['include']?_['map'](_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1f')],function(_0x37bb6f){return{'model':db[_0x37bb6f[_0x14ef('0x20')]],'as':_0x37bb6f['as'],'attributes':_0x37bb6f[_0x14ef('0x1d')],'include':_0x37bb6f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x37bb6f[_0x14ef('0x1f')],function(_0x45105f){return{'model':db[_0x45105f[_0x14ef('0x20')]],'as':_0x45105f['as'],'attributes':_0x45105f['attributes'],'include':_0x45105f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x45105f[_0x14ef('0x1f')],function(_0x21a176){return{'model':db[_0x21a176[_0x14ef('0x20')]],'as':_0x21a176['as'],'attributes':_0x21a176[_0x14ef('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0178d){logger['info']('GetCampaign',_0x17f63a);logger[_0x14ef('0xf')](_0x14ef('0x18'),_0x17f63a,JSON[_0x14ef('0x12')](_0xa0178d));_0x19b2cb(_0xa0178d);})[_0x14ef('0x17')](function(_0x38f5e9){logger[_0x14ef('0x14')](_0x14ef('0x18'),_0x38f5e9[_0x14ef('0x15')],_0x17f63a);_0x3b5b23(_0x1acc0a['error'](0x1f4,_0x38f5e9[_0x14ef('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index cad6504..7dd31ea 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 _0x2c81=['removeLists','removeBlackLists','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x2c81,0x1d1));var _0x12c8=function(_0x39390d,_0x32eb2a){_0x39390d=_0x39390d-0x0;var _0x55a311=_0x2c81[_0x39390d];return _0x55a311;};'use strict';var multer=require(_0x12c8('0x0'));var util=require(_0x12c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x12c8('0x2'));var router=express['Router']();var fs_extra=require(_0x12c8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x12c8('0x4'));var config=require(_0x12c8('0x5'));var controller=require(_0x12c8('0x6'));router['get']('/',auth[_0x12c8('0x7')](),controller[_0x12c8('0x8')]);router[_0x12c8('0x9')](_0x12c8('0xa'),auth[_0x12c8('0x7')](),controller[_0x12c8('0xb')]);router[_0x12c8('0x9')](_0x12c8('0xc'),auth[_0x12c8('0x7')](),controller[_0x12c8('0xd')]);router[_0x12c8('0x9')](_0x12c8('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x12c8('0x9')](_0x12c8('0xf'),auth[_0x12c8('0x7')](),controller['getHopperFinals']);router[_0x12c8('0x9')](_0x12c8('0x10'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x11')]);router['get'](_0x12c8('0x12'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x13')]);router[_0x12c8('0x9')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x15')]);router[_0x12c8('0x16')]('/',auth[_0x12c8('0x7')](),controller[_0x12c8('0x17')]);router[_0x12c8('0x16')](_0x12c8('0x18'),auth['isAuthenticated'](),controller['clone']);router[_0x12c8('0x16')]('/:id/lists',auth['isAuthenticated'](),controller[_0x12c8('0x19')]);router[_0x12c8('0x16')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1a')]);router[_0x12c8('0x1b')]('/:id',auth[_0x12c8('0x7')](),controller['update']);router[_0x12c8('0x1c')](_0x12c8('0xa'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1d')]);router[_0x12c8('0x1c')](_0x12c8('0x12'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1e')]);router[_0x12c8('0x1c')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1f')]);module[_0x12c8('0x20')]=router;
\ No newline at end of file
+var _0xfeff=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2c47d7,_0x42b567){var _0x41ca0b=function(_0x45e9ba){while(--_0x45e9ba){_0x2c47d7['push'](_0x2c47d7['shift']());}};_0x41ca0b(++_0x42b567);}(_0xfeff,0xe5));var _0xffef=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfeff[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffef('0x3'));var interaction=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var controller=require(_0xffef('0x6'));router[_0xffef('0x7')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x9')]);router['get'](_0xffef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xffef('0x7')](_0xffef('0xb'),auth['isAuthenticated'](),controller[_0xffef('0xc')]);router[_0xffef('0x7')](_0xffef('0xd'),auth['isAuthenticated'](),controller[_0xffef('0xe')]);router[_0xffef('0x7')](_0xffef('0xf'),auth[_0xffef('0x8')](),controller['getHopperFinals']);router['get'](_0xffef('0x10'),auth[_0xffef('0x8')](),controller[_0xffef('0x11')]);router['get'](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x13')]);router['get'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x15')]);router[_0xffef('0x16')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x17')]);router[_0xffef('0x16')](_0xffef('0x18'),auth[_0xffef('0x8')](),controller['clone']);router[_0xffef('0x16')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x19')]);router['post'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1a')]);router['put']('/:id',auth[_0xffef('0x8')](),controller[_0xffef('0x1b')]);router[_0xffef('0x1c')](_0xffef('0xa'),auth[_0xffef('0x8')](),controller[_0xffef('0x1d')]);router[_0xffef('0x1c')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x1e')]);router[_0xffef('0x1c')](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1f')]);module[_0xffef('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ba2f04f..0f12e20 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 _0x0a40=['exports','STRING','medium','VIRTUAL','key','sequelize'];(function(_0x3d6b07,_0x3054af){var _0x3657a1=function(_0x267a77){while(--_0x267a77){_0x3d6b07['push'](_0x3d6b07['shift']());}};_0x3657a1(++_0x3054af);}(_0x0a40,0x1e5));var _0x00a4=function(_0x224a21,_0x2a65e2){_0x224a21=_0x224a21-0x0;var _0xea2db1=_0x0a40[_0x224a21];return _0xea2db1;};'use strict';var Sequelize=require(_0x00a4('0x0'));module[_0x00a4('0x1')]={'key':{'type':Sequelize[_0x00a4('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x00a4('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x00a4('0x4')],'get':function(){return this['getDataValue'](_0x00a4('0x5'));}}};
\ No newline at end of file
+var _0x9470=['exports','STRING','TEXT','getDataValue','key'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x9470,0x118));var _0x0947=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9470[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');module[_0x0947('0x0')]={'key':{'type':Sequelize[_0x0947('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x0947('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x0947('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0947('0x3')](_0x0947('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c07726a..04020a0 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 _0x8d42=['order','sort','filter','merge','where','includeAll','include','findAll','rows','catch','show','params','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','apply','reject','save','destroy','then','get','CannedAnswers','sendStatus','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit'];(function(_0x40f378,_0x4d39ec){var _0x2e42f6=function(_0x3c0996){while(--_0x3c0996){_0x40f378['push'](_0x40f378['shift']());}};_0x2e42f6(++_0x4d39ec);}(_0x8d42,0x184));var _0x28d4=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x8d42[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x28d4('0x0'));var rimraf=require(_0x28d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28d4('0x2'));var rp=require('request-promise');var moment=require(_0x28d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28d4('0x4'));var util=require(_0x28d4('0x5'));var path=require('path');var sox=require(_0x28d4('0x6'));var csv=require(_0x28d4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28d4('0x8'));var _=require(_0x28d4('0x9'));var squel=require(_0x28d4('0xa'));var crypto=require(_0x28d4('0xb'));var jsforce=require(_0x28d4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28d4('0xd'));var Papa=require(_0x28d4('0xe'));var Redis=require(_0x28d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x28d4('0x10'));var as=require(_0x28d4('0x11'));var hardwareService=require(_0x28d4('0x12'));var logger=require('../../config/logger')(_0x28d4('0x13'));var utils=require(_0x28d4('0x14'));var config=require(_0x28d4('0x15'));var licenseUtil=require(_0x28d4('0x16'));var db=require(_0x28d4('0x17'))['db'];function respondWithStatusCode(_0x58e7fe,_0x54ae29){_0x54ae29=_0x54ae29||0xcc;return function(_0x1a708c){if(_0x1a708c){return _0x58e7fe['sendStatus'](_0x54ae29);}return _0x58e7fe[_0x28d4('0x18')](_0x54ae29)[_0x28d4('0x19')]();};}function respondWithResult(_0x41ec1c,_0x6395aa){_0x6395aa=_0x6395aa||0xc8;return function(_0x17f9fd){if(_0x17f9fd){return _0x41ec1c[_0x28d4('0x18')](_0x6395aa)[_0x28d4('0x1a')](_0x17f9fd);}};}function respondWithFilteredResult(_0x45b8e5,_0x3a738b){return function(_0x4f386c){if(_0x4f386c){var _0x438eb6=typeof _0x3a738b['offset']==='undefined'&&typeof _0x3a738b[_0x28d4('0x1b')]===_0x28d4('0x1c');var _0x68a363=_0x4f386c[_0x28d4('0x1d')];var _0xe86166=_0x438eb6?0x0:_0x3a738b['offset'];var _0x16acac=_0x438eb6?_0x4f386c['count']:_0x3a738b[_0x28d4('0x1e')]+_0x3a738b['limit'];var _0x5b8c5e;if(_0x16acac>=_0x68a363){_0x16acac=_0x68a363;_0x5b8c5e=0xc8;}else{_0x5b8c5e=0xce;}_0x45b8e5[_0x28d4('0x18')](_0x5b8c5e);return _0x45b8e5['set']('Content-Range',_0xe86166+'-'+_0x16acac+'/'+_0x68a363)['json'](_0x4f386c);}return null;};}function patchUpdates(_0xb19687){return function(_0x51f11a){try{jsonpatch[_0x28d4('0x1f')](_0x51f11a,_0xb19687,!![]);}catch(_0x2368dc){return BPromise[_0x28d4('0x20')](_0x2368dc);}return _0x51f11a[_0x28d4('0x21')]();};}function saveUpdates(_0x46dd90,_0x125110){return function(_0x514748){if(_0x514748){return _0x514748['update'](_0x46dd90)['then'](function(_0x4c334f){return _0x4c334f;});}return null;};}function removeEntity(_0x2f2cf3,_0x41bce9){return function(_0x3d2c59){if(_0x3d2c59){return _0x3d2c59[_0x28d4('0x22')]()[_0x28d4('0x23')](function(){var _0x5a15a1=_0x3d2c59[_0x28d4('0x24')]({'plain':!![]});var _0x209c62=_0x28d4('0x25');return db['UserProfileResource'][_0x28d4('0x22')]({'where':{'type':_0x209c62,'resourceId':_0x5a15a1['id']}})[_0x28d4('0x23')](function(){return _0x3d2c59;});})[_0x28d4('0x23')](function(){_0x2f2cf3[_0x28d4('0x18')](0xcc)[_0x28d4('0x19')]();});}};}function handleEntityNotFound(_0x17986d,_0x56bb0c){return function(_0x539b9a){if(!_0x539b9a){_0x17986d[_0x28d4('0x26')](0x194);}return _0x539b9a;};}function handleError(_0x3a4786,_0x17ec21){_0x17ec21=_0x17ec21||0x1f4;return function(_0xf212a3){logger['error'](_0xf212a3[_0x28d4('0x27')]);if(_0xf212a3['name']){delete _0xf212a3[_0x28d4('0x28')];}_0x3a4786[_0x28d4('0x18')](_0x17ec21)[_0x28d4('0x29')](_0xf212a3);};}exports['index']=function(_0x91646f,_0xe14d9e){var _0x435814={},_0x53d12d={},_0xcb68a3={'count':0x0,'rows':[]};var _0xc51348=_['map'](db[_0x28d4('0x2a')][_0x28d4('0x2b')],function(_0x151702){return{'name':_0x151702[_0x28d4('0x2c')],'type':_0x151702[_0x28d4('0x2d')][_0x28d4('0x2e')]};});_0x53d12d['model']=_[_0x28d4('0x2f')](_0xc51348,_0x28d4('0x28'));_0x53d12d['query']=_[_0x28d4('0x30')](_0x91646f[_0x28d4('0x31')]);_0x53d12d[_0x28d4('0x32')]=_[_0x28d4('0x33')](_0x53d12d['model'],_0x53d12d[_0x28d4('0x31')]);_0x435814[_0x28d4('0x34')]=_[_0x28d4('0x33')](_0x53d12d[_0x28d4('0x35')],qs[_0x28d4('0x36')](_0x91646f['query'][_0x28d4('0x36')]));_0x435814[_0x28d4('0x34')]=_0x435814[_0x28d4('0x34')]['length']?_0x435814[_0x28d4('0x34')]:_0x53d12d[_0x28d4('0x35')];if(!_0x91646f['query'][_0x28d4('0x37')](_0x28d4('0x38'))){_0x435814[_0x28d4('0x1b')]=qs[_0x28d4('0x1b')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x1b')]);_0x435814[_0x28d4('0x1e')]=qs[_0x28d4('0x1e')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x1e')]);}_0x435814[_0x28d4('0x39')]=qs[_0x28d4('0x3a')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x3a')]);_0x435814['where']=qs[_0x28d4('0x32')](_['pick'](_0x91646f[_0x28d4('0x31')],_0x53d12d['filters']),_0xc51348);if(_0x91646f[_0x28d4('0x31')][_0x28d4('0x3b')]){_0x435814['where']=_[_0x28d4('0x3c')](_0x435814[_0x28d4('0x3d')],{'$or':[{'key':{'$like':'%'+_0x91646f[_0x28d4('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x91646f[_0x28d4('0x31')]['filter']+'%'}}]});}_0x435814=_[_0x28d4('0x3c')]({},_0x435814,_0x91646f['options']);var _0x48f023={'where':_0x435814[_0x28d4('0x3d')]};return db[_0x28d4('0x2a')]['count'](_0x48f023)[_0x28d4('0x23')](function(_0x4785d4){_0xcb68a3['count']=_0x4785d4;if(_0x91646f[_0x28d4('0x31')][_0x28d4('0x3e')]){_0x435814[_0x28d4('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x28d4('0x40')](_0x435814);})[_0x28d4('0x23')](function(_0x5bec9e){_0xcb68a3[_0x28d4('0x41')]=_0x5bec9e;return _0xcb68a3;})[_0x28d4('0x23')](respondWithFilteredResult(_0xe14d9e,_0x435814))[_0x28d4('0x42')](handleError(_0xe14d9e,null));};exports[_0x28d4('0x43')]=function(_0xe7b043,_0x48c34a){var _0x32ad5a={'raw':!![],'where':{'id':_0xe7b043[_0x28d4('0x44')]['id']}},_0xba3f19={};_0xba3f19['model']=_['keys'](db[_0x28d4('0x2a')][_0x28d4('0x2b')]);_0xba3f19['query']=_['keys'](_0xe7b043[_0x28d4('0x31')]);_0xba3f19[_0x28d4('0x32')]=_[_0x28d4('0x33')](_0xba3f19[_0x28d4('0x35')],_0xba3f19[_0x28d4('0x31')]);_0x32ad5a[_0x28d4('0x34')]=_[_0x28d4('0x33')](_0xba3f19['model'],qs[_0x28d4('0x36')](_0xe7b043['query'][_0x28d4('0x36')]));_0x32ad5a[_0x28d4('0x34')]=_0x32ad5a['attributes']['length']?_0x32ad5a[_0x28d4('0x34')]:_0xba3f19[_0x28d4('0x35')];if(_0xe7b043[_0x28d4('0x31')]['includeAll']){_0x32ad5a[_0x28d4('0x3f')]=[{'all':!![]}];}_0x32ad5a=_[_0x28d4('0x3c')]({},_0x32ad5a,_0xe7b043[_0x28d4('0x45')]);return db[_0x28d4('0x2a')][_0x28d4('0x46')](_0x32ad5a)[_0x28d4('0x23')](handleEntityNotFound(_0x48c34a,null))[_0x28d4('0x23')](respondWithResult(_0x48c34a,null))['catch'](handleError(_0x48c34a,null));};exports[_0x28d4('0x47')]=function(_0x55789d,_0x5ec8da){if(_0x55789d[_0x28d4('0x48')]['id']){delete _0x55789d[_0x28d4('0x48')]['id'];}return db[_0x28d4('0x2a')]['find']({'where':{'id':_0x55789d[_0x28d4('0x44')]['id']}})[_0x28d4('0x23')](handleEntityNotFound(_0x5ec8da,null))[_0x28d4('0x23')](saveUpdates(_0x55789d['body'],null))[_0x28d4('0x23')](respondWithResult(_0x5ec8da,null))['catch'](handleError(_0x5ec8da,null));};exports[_0x28d4('0x22')]=function(_0x243d1b,_0x4653c6){return db[_0x28d4('0x2a')]['find']({'where':{'id':_0x243d1b[_0x28d4('0x44')]['id']}})[_0x28d4('0x23')](handleEntityNotFound(_0x4653c6,null))['then'](removeEntity(_0x4653c6,null))[_0x28d4('0x42')](handleError(_0x4653c6,null));};exports[_0x28d4('0x49')]=function(_0x124a91,_0x5b293f){var _0x4df358={'key':_0x124a91['body']['key']};if(_0x124a91[_0x28d4('0x48')]['MailAccountId']){_0x4df358[_0x28d4('0x4a')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4a')];}else if(_0x124a91['body'][_0x28d4('0x4b')]){_0x4df358[_0x28d4('0x4b')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4b')];}else if(_0x124a91[_0x28d4('0x48')]['OpenchannelAccountId']){_0x4df358[_0x28d4('0x4c')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4c')];}else if(_0x124a91[_0x28d4('0x48')][_0x28d4('0x4d')]){_0x4df358[_0x28d4('0x4d')]=_0x124a91[_0x28d4('0x48')]['ChatWebsiteId'];}return db[_0x28d4('0x2a')][_0x28d4('0x46')]({'where':_0x4df358})['then'](function(_0x47ba35){if(_0x47ba35){throw new db[(_0x28d4('0x4e'))][(_0x28d4('0x4f'))](_0x28d4('0x50'));}return db[_0x28d4('0x2a')][_0x28d4('0x49')](_0x124a91[_0x28d4('0x48')]);})[_0x28d4('0x23')](function(_0x4ccdb3){var _0x518837=_0x124a91[_0x28d4('0x51')][_0x28d4('0x24')]({'plain':!![]});if(!_0x518837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x518837[_0x28d4('0x52')]===_0x28d4('0x51')){var _0x177239=_0x4ccdb3[_0x28d4('0x24')]({'plain':!![]});return db[_0x28d4('0x53')][_0x28d4('0x46')]({'where':{'name':_0x28d4('0x25'),'userProfileId':_0x518837[_0x28d4('0x54')]},'raw':!![]})[_0x28d4('0x23')](function(_0x25e439){if(_0x25e439&&_0x25e439[_0x28d4('0x55')]===0x0){return db[_0x28d4('0x56')]['create']({'name':_0x177239[_0x28d4('0x28')],'resourceId':_0x177239['id'],'type':_0x25e439['name'],'sectionId':_0x25e439['id']},{})[_0x28d4('0x23')](function(){return _0x4ccdb3;});}else{return _0x4ccdb3;}})[_0x28d4('0x42')](function(_0x139dff){logger[_0x28d4('0x57')](_0x28d4('0x58'),_0x139dff);throw _0x139dff;});}return _0x4ccdb3;})[_0x28d4('0x23')](respondWithResult(_0x5b293f,0xc9))[_0x28d4('0x42')](handleError(_0x5b293f,null));};
\ No newline at end of file
+var _0xca06=['key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','name','send','index','fieldName','type'];(function(_0x22a2b2,_0xa9f5b3){var _0x1ee264=function(_0x1ccc7f){while(--_0x1ccc7f){_0x22a2b2['push'](_0x22a2b2['shift']());}};_0x1ee264(++_0xa9f5b3);}(_0xca06,0x1d7));var _0x6ca0=function(_0xa0b91b,_0x2e2a5d){_0xa0b91b=_0xa0b91b-0x0;var _0x23196b=_0xca06[_0xa0b91b];return _0x23196b;};'use strict';var emlformat=require(_0x6ca0('0x0'));var rimraf=require(_0x6ca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ca0('0x2'));var moment=require('moment');var BPromise=require(_0x6ca0('0x3'));var Mustache=require(_0x6ca0('0x4'));var util=require(_0x6ca0('0x5'));var path=require('path');var sox=require(_0x6ca0('0x6'));var csv=require('to-csv');var ejs=require(_0x6ca0('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca0('0x8'));var _=require(_0x6ca0('0x9'));var squel=require(_0x6ca0('0xa'));var crypto=require(_0x6ca0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ca0('0xc'));var toCsv=require(_0x6ca0('0xd'));var querystring=require(_0x6ca0('0xe'));var Papa=require(_0x6ca0('0xf'));var Redis=require(_0x6ca0('0x10'));var authService=require(_0x6ca0('0x11'));var qs=require(_0x6ca0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ca0('0x13'));var logger=require(_0x6ca0('0x14'))('api');var utils=require(_0x6ca0('0x15'));var config=require(_0x6ca0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca0('0x17'))['db'];function respondWithStatusCode(_0xc52007,_0x19b662){_0x19b662=_0x19b662||0xcc;return function(_0x1d4ff4){if(_0x1d4ff4){return _0xc52007[_0x6ca0('0x18')](_0x19b662);}return _0xc52007[_0x6ca0('0x19')](_0x19b662)['end']();};}function respondWithResult(_0x3a008f,_0x1a27eb){_0x1a27eb=_0x1a27eb||0xc8;return function(_0x59e607){if(_0x59e607){return _0x3a008f[_0x6ca0('0x19')](_0x1a27eb)[_0x6ca0('0x1a')](_0x59e607);}};}function respondWithFilteredResult(_0x57aa6a,_0xfb12cd){return function(_0x3b7926){if(_0x3b7926){var _0x450696=typeof _0xfb12cd['offset']===_0x6ca0('0x1b')&&typeof _0xfb12cd[_0x6ca0('0x1c')]==='undefined';var _0xd26cec=_0x3b7926['count'];var _0x1a1ded=_0x450696?0x0:_0xfb12cd[_0x6ca0('0x1d')];var _0x47a189=_0x450696?_0x3b7926[_0x6ca0('0x1e')]:_0xfb12cd[_0x6ca0('0x1d')]+_0xfb12cd['limit'];var _0x1c0d22;if(_0x47a189>=_0xd26cec){_0x47a189=_0xd26cec;_0x1c0d22=0xc8;}else{_0x1c0d22=0xce;}_0x57aa6a[_0x6ca0('0x19')](_0x1c0d22);return _0x57aa6a[_0x6ca0('0x1f')](_0x6ca0('0x20'),_0x1a1ded+'-'+_0x47a189+'/'+_0xd26cec)[_0x6ca0('0x1a')](_0x3b7926);}return null;};}function patchUpdates(_0x5e9d62){return function(_0x116a2c){try{jsonpatch['apply'](_0x116a2c,_0x5e9d62,!![]);}catch(_0x554c25){return BPromise[_0x6ca0('0x21')](_0x554c25);}return _0x116a2c['save']();};}function saveUpdates(_0x33126d,_0x5ebff6){return function(_0x5ba278){if(_0x5ba278){return _0x5ba278[_0x6ca0('0x22')](_0x33126d)[_0x6ca0('0x23')](function(_0x3601e3){return _0x3601e3;});}return null;};}function removeEntity(_0x128bc8,_0x357394){return function(_0x5098fd){if(_0x5098fd){return _0x5098fd[_0x6ca0('0x24')]()[_0x6ca0('0x23')](function(){var _0x26f0be=_0x5098fd[_0x6ca0('0x25')]({'plain':!![]});var _0x32e64b='CannedAnswers';return db[_0x6ca0('0x26')][_0x6ca0('0x24')]({'where':{'type':_0x32e64b,'resourceId':_0x26f0be['id']}})[_0x6ca0('0x23')](function(){return _0x5098fd;});})[_0x6ca0('0x23')](function(){_0x128bc8[_0x6ca0('0x19')](0xcc)[_0x6ca0('0x27')]();});}};}function handleEntityNotFound(_0xa198d8,_0x1d2258){return function(_0x2da691){if(!_0x2da691){_0xa198d8[_0x6ca0('0x18')](0x194);}return _0x2da691;};}function handleError(_0x1b54cd,_0x4e745f){_0x4e745f=_0x4e745f||0x1f4;return function(_0x2eae5e){logger['error'](_0x2eae5e['stack']);if(_0x2eae5e[_0x6ca0('0x28')]){delete _0x2eae5e['name'];}_0x1b54cd[_0x6ca0('0x19')](_0x4e745f)[_0x6ca0('0x29')](_0x2eae5e);};}exports[_0x6ca0('0x2a')]=function(_0x163369,_0x10c112){var _0x1bf32d={},_0x3dd149={},_0xd1db2={'count':0x0,'rows':[]};var _0x358047=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x14ae83){return{'name':_0x14ae83[_0x6ca0('0x2b')],'type':_0x14ae83[_0x6ca0('0x2c')][_0x6ca0('0x2d')]};});_0x3dd149[_0x6ca0('0x2e')]=_['map'](_0x358047,'name');_0x3dd149['query']=_[_0x6ca0('0x2f')](_0x163369['query']);_0x3dd149['filters']=_[_0x6ca0('0x30')](_0x3dd149[_0x6ca0('0x2e')],_0x3dd149[_0x6ca0('0x31')]);_0x1bf32d[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x3dd149['model'],qs['fields'](_0x163369['query'][_0x6ca0('0x33')]));_0x1bf32d[_0x6ca0('0x32')]=_0x1bf32d[_0x6ca0('0x32')][_0x6ca0('0x34')]?_0x1bf32d[_0x6ca0('0x32')]:_0x3dd149[_0x6ca0('0x2e')];if(!_0x163369['query'][_0x6ca0('0x35')](_0x6ca0('0x36'))){_0x1bf32d['limit']=qs[_0x6ca0('0x1c')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x1c')]);_0x1bf32d[_0x6ca0('0x1d')]=qs[_0x6ca0('0x1d')](_0x163369['query'][_0x6ca0('0x1d')]);}_0x1bf32d[_0x6ca0('0x37')]=qs[_0x6ca0('0x38')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x38')]);_0x1bf32d[_0x6ca0('0x39')]=qs[_0x6ca0('0x3a')](_[_0x6ca0('0x3b')](_0x163369[_0x6ca0('0x31')],_0x3dd149[_0x6ca0('0x3a')]),_0x358047);if(_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]){_0x1bf32d['where']=_[_0x6ca0('0x3d')](_0x1bf32d[_0x6ca0('0x39')],{'$or':[{'key':{'$like':'%'+_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]+'%'}},{'value':{'$like':'%'+_0x163369['query'][_0x6ca0('0x3c')]+'%'}}]});}_0x1bf32d=_[_0x6ca0('0x3d')]({},_0x1bf32d,_0x163369[_0x6ca0('0x3e')]);var _0x4dbeeb={'where':_0x1bf32d[_0x6ca0('0x39')]};return db[_0x6ca0('0x3f')]['count'](_0x4dbeeb)[_0x6ca0('0x23')](function(_0x405e79){_0xd1db2['count']=_0x405e79;if(_0x163369['query'][_0x6ca0('0x40')]){_0x1bf32d['include']=[{'all':!![]}];}return db[_0x6ca0('0x3f')][_0x6ca0('0x41')](_0x1bf32d);})['then'](function(_0xcc9c93){_0xd1db2[_0x6ca0('0x42')]=_0xcc9c93;return _0xd1db2;})[_0x6ca0('0x23')](respondWithFilteredResult(_0x10c112,_0x1bf32d))[_0x6ca0('0x43')](handleError(_0x10c112,null));};exports[_0x6ca0('0x44')]=function(_0x497f06,_0x5a59e4){var _0x48be61={'raw':!![],'where':{'id':_0x497f06[_0x6ca0('0x45')]['id']}},_0x1c02be={};_0x1c02be[_0x6ca0('0x2e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1c02be['query']=_[_0x6ca0('0x2f')](_0x497f06[_0x6ca0('0x31')]);_0x1c02be['filters']=_['intersection'](_0x1c02be[_0x6ca0('0x2e')],_0x1c02be[_0x6ca0('0x31')]);_0x48be61[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x1c02be[_0x6ca0('0x2e')],qs[_0x6ca0('0x33')](_0x497f06[_0x6ca0('0x31')]['fields']));_0x48be61[_0x6ca0('0x32')]=_0x48be61[_0x6ca0('0x32')]['length']?_0x48be61['attributes']:_0x1c02be[_0x6ca0('0x2e')];if(_0x497f06['query']['includeAll']){_0x48be61[_0x6ca0('0x46')]=[{'all':!![]}];}_0x48be61=_[_0x6ca0('0x3d')]({},_0x48be61,_0x497f06['options']);return db[_0x6ca0('0x3f')][_0x6ca0('0x47')](_0x48be61)[_0x6ca0('0x23')](handleEntityNotFound(_0x5a59e4,null))[_0x6ca0('0x23')](respondWithResult(_0x5a59e4,null))[_0x6ca0('0x43')](handleError(_0x5a59e4,null));};exports[_0x6ca0('0x22')]=function(_0x9387d9,_0x50c096){if(_0x9387d9[_0x6ca0('0x48')]['id']){delete _0x9387d9[_0x6ca0('0x48')]['id'];}return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0x9387d9[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x50c096,null))['then'](saveUpdates(_0x9387d9[_0x6ca0('0x48')],null))[_0x6ca0('0x23')](respondWithResult(_0x50c096,null))[_0x6ca0('0x43')](handleError(_0x50c096,null));};exports[_0x6ca0('0x24')]=function(_0xe30141,_0x19264e){return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0xe30141[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x19264e,null))[_0x6ca0('0x23')](removeEntity(_0x19264e,null))['catch'](handleError(_0x19264e,null));};exports[_0x6ca0('0x49')]=function(_0x556224,_0x32e632){var _0x1577bf={'key':_0x556224['body']['key']};if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')]){_0x1577bf[_0x6ca0('0x4a')]=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4b')]){_0x1577bf[_0x6ca0('0x4b')]=_0x556224[_0x6ca0('0x48')]['SmsAccountId'];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4c')]){_0x1577bf[_0x6ca0('0x4c')]=_0x556224['body'][_0x6ca0('0x4c')];}else if(_0x556224['body'][_0x6ca0('0x4d')]){_0x1577bf['ChatWebsiteId']=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4d')];}return db['CannedAnswer'][_0x6ca0('0x47')]({'where':_0x1577bf})['then'](function(_0x2f7d2a){if(_0x2f7d2a){throw new db['Sequelize'][(_0x6ca0('0x4e'))](_0x6ca0('0x4f'));}return db[_0x6ca0('0x3f')][_0x6ca0('0x49')](_0x556224[_0x6ca0('0x48')]);})[_0x6ca0('0x23')](function(_0x254a26){var _0x5eaeac=_0x556224['user'][_0x6ca0('0x25')]({'plain':!![]});if(!_0x5eaeac)throw new Error(_0x6ca0('0x50'));if(_0x5eaeac[_0x6ca0('0x51')]===_0x6ca0('0x52')){var _0x247bbf=_0x254a26[_0x6ca0('0x25')]({'plain':!![]});return db[_0x6ca0('0x53')][_0x6ca0('0x47')]({'where':{'name':_0x6ca0('0x54'),'userProfileId':_0x5eaeac['userProfileId']},'raw':!![]})[_0x6ca0('0x23')](function(_0x43d2aa){if(_0x43d2aa&&_0x43d2aa['autoAssociation']===0x0){return db[_0x6ca0('0x26')][_0x6ca0('0x49')]({'name':_0x247bbf[_0x6ca0('0x28')],'resourceId':_0x247bbf['id'],'type':_0x43d2aa[_0x6ca0('0x28')],'sectionId':_0x43d2aa['id']},{})[_0x6ca0('0x23')](function(){return _0x254a26;});}else{return _0x254a26;}})['catch'](function(_0x4bfd60){logger['error'](_0x6ca0('0x55'),_0x4bfd60);throw _0x4bfd60;});}return _0x254a26;})[_0x6ca0('0x23')](respondWithResult(_0x32e632,0xc9))[_0x6ca0('0x43')](handleError(_0x32e632,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index c3de25a..65da8d3 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 _0x7653=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x7653,0x102));var _0x3765=function(_0x539ce1,_0x4a65eb){_0x539ce1=_0x539ce1-0x0;var _0x20be8e=_0x7653[_0x539ce1];return _0x20be8e;};'use strict';var _=require(_0x3765('0x0'));var util=require(_0x3765('0x1'));var logger=require('../../config/logger')(_0x3765('0x2'));var moment=require(_0x3765('0x3'));var BPromise=require('bluebird');var rp=require(_0x3765('0x4'));var fs=require('fs');var path=require(_0x3765('0x5'));var rimraf=require(_0x3765('0x6'));var config=require('../../config/environment');var attributes=require(_0x3765('0x7'));module[_0x3765('0x8')]=function(_0x627087,_0x35ff41){return _0x627087[_0x3765('0x9')](_0x3765('0xa'),attributes,{'tableName':_0x3765('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3765('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x81df=['api','moment','bluebird','request-promise','path','rimraf','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3554de,_0x1c1680){var _0x469d4b=function(_0x402f44){while(--_0x402f44){_0x3554de['push'](_0x3554de['shift']());}};_0x469d4b(++_0x1c1680);}(_0x81df,0xb3));var _0xf81d=function(_0x112e86,_0x2cc9b0){_0x112e86=_0x112e86-0x0;var _0xf6b5d9=_0x81df[_0x112e86];return _0xf6b5d9;};'use strict';var _=require(_0xf81d('0x0'));var util=require(_0xf81d('0x1'));var logger=require(_0xf81d('0x2'))(_0xf81d('0x3'));var moment=require(_0xf81d('0x4'));var BPromise=require(_0xf81d('0x5'));var rp=require(_0xf81d('0x6'));var fs=require('fs');var path=require(_0xf81d('0x7'));var rimraf=require(_0xf81d('0x8'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xf81d('0x9')]=function(_0x4678d9,_0x18a5a1){return _0x4678d9['define'](_0xf81d('0xa'),attributes,{'tableName':_0xf81d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf81d('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 85855c0..9e717d7 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(_0x1ac98e,_0x9466e1){var _0x4c074b=function(_0xc79b7){while(--_0xc79b7){_0x1ac98e['push'](_0x1ac98e['shift']());}};_0x4c074b(++_0x9466e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x1bb67e,_0x4b021d){var _0x83a82e=function(_0x1e4bab){while(--_0x1e4bab){_0x1bb67e['push'](_0x1bb67e['shift']());}};_0x83a82e(++_0x4b021d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 121cce4..b030f78 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 _0x4dbf=['put','update','delete','multer','path','connect-timeout','fs-extra','../../config/environment','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x8d6c7a,_0x2d4c3c){var _0x2c305a=function(_0x388014){while(--_0x388014){_0x8d6c7a['push'](_0x8d6c7a['shift']());}};_0x2c305a(++_0x2d4c3c);}(_0x4dbf,0xc6));var _0xf4db=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x4dbf[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xf4db('0x0'));var util=require('util');var path=require(_0xf4db('0x1'));var timeout=require(_0xf4db('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf4db('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4db('0x4'));var controller=require('./cannedAnswer.controller');router[_0xf4db('0x5')]('/',auth['isAuthenticated'](),controller[_0xf4db('0x6')]);router[_0xf4db('0x5')](_0xf4db('0x7'),auth['isAuthenticated'](),controller[_0xf4db('0x8')]);router[_0xf4db('0x9')]('/',auth[_0xf4db('0xa')](),controller[_0xf4db('0xb')]);router[_0xf4db('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xf4db('0xd')]);router[_0xf4db('0xe')]('/:id',auth[_0xf4db('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7531=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x7531,0x67));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require('util');var path=require(_0x1753('0x1'));var timeout=require(_0x1753('0x2'));var express=require(_0x1753('0x3'));var router=express[_0x1753('0x4')]();var fs_extra=require(_0x1753('0x5'));var auth=require(_0x1753('0x6'));var interaction=require(_0x1753('0x7'));var config=require(_0x1753('0x8'));var controller=require('./cannedAnswer.controller');router[_0x1753('0x9')]('/',auth[_0x1753('0xa')](),controller['index']);router[_0x1753('0x9')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0xc')]);router[_0x1753('0xd')]('/',auth['isAuthenticated'](),controller[_0x1753('0xe')]);router[_0x1753('0xf')]('/:id',auth[_0x1753('0xa')](),controller[_0x1753('0x10')]);router[_0x1753('0x11')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 55a33ce..52dede7 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 _0x6a00=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x47583b,_0x422882){var _0x369034=function(_0x274f6f){while(--_0x274f6f){_0x47583b['push'](_0x47583b['shift']());}};_0x369034(++_0x422882);}(_0x6a00,0xc9));var _0x06a0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6a00[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x06a0('0x0'));module[_0x06a0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x06a0('0x2')},'clid':{'type':Sequelize[_0x06a0('0x3')]},'src':{'type':Sequelize[_0x06a0('0x3')]},'dst':{'type':Sequelize[_0x06a0('0x3')]},'dcontext':{'type':Sequelize[_0x06a0('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x06a0('0x3')]},'lastdata':{'type':Sequelize[_0x06a0('0x3')]},'duration':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x06a0('0x3')]},'amaflags':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x06a0('0x3')]},'uniqueid':{'type':Sequelize[_0x06a0('0x3')]},'linkedid':{'type':Sequelize[_0x06a0('0x3')]},'sequence':{'type':Sequelize[_0x06a0('0x3')]},'peeraccount':{'type':Sequelize[_0x06a0('0x3')]},'type':{'type':Sequelize[_0x06a0('0x3')]},'tag':{'type':Sequelize[_0x06a0('0x3')]}};
\ No newline at end of file
+var _0x34e5=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x3fd6fd,_0x2ac441){var _0x3849f3=function(_0x19d13a){while(--_0x19d13a){_0x3fd6fd['push'](_0x3fd6fd['shift']());}};_0x3849f3(++_0x2ac441);}(_0x34e5,0x172));var _0x534e=function(_0x51d50a,_0x501b7e){_0x51d50a=_0x51d50a-0x0;var _0x46295a=_0x34e5[_0x51d50a];return _0x46295a;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x534e('0x1')},'clid':{'type':Sequelize[_0x534e('0x2')]},'src':{'type':Sequelize[_0x534e('0x2')]},'dst':{'type':Sequelize[_0x534e('0x2')]},'dcontext':{'type':Sequelize[_0x534e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x534e('0x2')]},'lastapp':{'type':Sequelize[_0x534e('0x2')]},'lastdata':{'type':Sequelize[_0x534e('0x2')]},'duration':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x534e('0x2')]},'amaflags':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x534e('0x2')]},'uniqueid':{'type':Sequelize[_0x534e('0x2')]},'linkedid':{'type':Sequelize[_0x534e('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x534e('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 36f77f1..169b49f 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 _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x46aaaa,_0x3af897){var _0x26d04e=function(_0x4373ba){while(--_0x4373ba){_0x46aaaa['push'](_0x46aaaa['shift']());}};_0x26d04e(++_0x3af897);}(_0x8375,0xa8));var _0x5837=function(_0x45a106,_0x40f99f){_0x45a106=_0x45a106-0x0;var _0x318090=_0x8375[_0x45a106];return _0x318090;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));};
\ No newline at end of file
+var _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x58bb02,_0x1558dc){var _0xd6a0ad=function(_0x139f4a){while(--_0x139f4a){_0x58bb02['push'](_0x58bb02['shift']());}};_0xd6a0ad(++_0x1558dc);}(_0x4ab0,0xd5));var _0x04ab=function(_0x558eed,_0x4cd4f3){_0x558eed=_0x558eed-0x0;var _0xf8fb7=_0x4ab0[_0x558eed];return _0xf8fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 8334c00..e2b0612 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(_0x22cd7c,_0x1d86fa){var _0x36096c=function(_0x1fbbcb){while(--_0x1fbbcb){_0x22cd7c['push'](_0x22cd7c['shift']());}};_0x36096c(++_0x1d86fa);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x49856d,_0x1c47bc){var _0x19976d=function(_0x351f98){while(--_0x351f98){_0x49856d['push'](_0x49856d['shift']());}};_0x19976d(++_0x1c47bc);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff227,_0x3a8351){_0x3ff227=_0x3ff227-0x0;var _0x3fae84=_0x7a54[_0x3ff227];return _0x3fae84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index e7fac43..a41d34e 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 _0x31f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird'];(function(_0x2a9b81,_0x5ea35d){var _0xc5f927=function(_0x49b4bc){while(--_0x49b4bc){_0x2a9b81['push'](_0x2a9b81['shift']());}};_0xc5f927(++_0x5ea35d);}(_0x31f6,0x102));var _0x631f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x31f6[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x631f('0x0'));var moment=require('moment');var BPromise=require(_0x631f('0x1'));var rs=require(_0x631f('0x2'));var fs=require('fs');var Redis=require(_0x631f('0x3'));var db=require(_0x631f('0x4'))['db'];var utils=require(_0x631f('0x5'));var logger=require(_0x631f('0x6'))(_0x631f('0x7'));var config=require(_0x631f('0x8'));var jayson=require(_0x631f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x152a64,_0x3d812a,_0x1742a7){return new BPromise(function(_0x2cf71e,_0x188cdc){return client[_0x631f('0xa')](_0x152a64,_0x1742a7)[_0x631f('0xb')](function(_0xe3048c){logger['info'](_0x631f('0xc'),_0x3d812a,_0x631f('0xd'));logger['debug'](_0x631f('0xe'),_0x3d812a,_0x631f('0xd'),JSON[_0x631f('0xf')](_0xe3048c));if(_0xe3048c['error']){if(_0xe3048c[_0x631f('0x10')][_0x631f('0x11')]===0x1f4){logger[_0x631f('0x10')](_0x631f('0xc'),_0x3d812a,_0xe3048c[_0x631f('0x10')][_0x631f('0x12')]);return _0x188cdc(_0xe3048c['error'][_0x631f('0x12')]);}logger[_0x631f('0x10')]('Cdr,\x20%s,\x20%s',_0x3d812a,_0xe3048c[_0x631f('0x10')][_0x631f('0x12')]);return _0x2cf71e(_0xe3048c['error'][_0x631f('0x12')]);}else{logger['info'](_0x631f('0xc'),_0x3d812a,_0x631f('0xd'));_0x2cf71e(_0xe3048c['result']['message']);}})[_0x631f('0x13')](function(_0x446108){logger[_0x631f('0x10')](_0x631f('0xc'),_0x3d812a,_0x446108);_0x188cdc(_0x446108);});});}
\ No newline at end of file
+var _0x1d5e=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5f3466,_0x15e4d3){var _0x21b9a6=function(_0x15a04b){while(--_0x15a04b){_0x5f3466['push'](_0x5f3466['shift']());}};_0x21b9a6(++_0x15e4d3);}(_0x1d5e,0x11b));var _0xe1d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1d5e[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xe1d5('0x0'));var moment=require('moment');var BPromise=require(_0xe1d5('0x1'));var rs=require(_0xe1d5('0x2'));var fs=require('fs');var Redis=require(_0xe1d5('0x3'));var db=require(_0xe1d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe1d5('0x5'));var jayson=require(_0xe1d5('0x6'));var client=jayson[_0xe1d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464db5,_0xe682c4,_0x436702){return new BPromise(function(_0x4bbf8f,_0xe8872b){return client[_0xe1d5('0x8')](_0x464db5,_0x436702)[_0xe1d5('0x9')](function(_0x1219c8){logger[_0xe1d5('0xa')]('Cdr,\x20%s,\x20%s',_0xe682c4,_0xe1d5('0xb'));logger[_0xe1d5('0xc')](_0xe1d5('0xd'),_0xe682c4,_0xe1d5('0xb'),JSON[_0xe1d5('0xe')](_0x1219c8));if(_0x1219c8[_0xe1d5('0xf')]){if(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xe682c4,_0x1219c8[_0xe1d5('0xf')]['message']);return _0xe8872b(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);}logger['error'](_0xe1d5('0x12'),_0xe682c4,_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);return _0x4bbf8f(_0x1219c8['error'][_0xe1d5('0x11')]);}else{logger[_0xe1d5('0xa')](_0xe1d5('0x12'),_0xe682c4,'request\x20sent');_0x4bbf8f(_0x1219c8[_0xe1d5('0x13')][_0xe1d5('0x11')]);}})[_0xe1d5('0x14')](function(_0x354e4e){logger[_0xe1d5('0xf')](_0xe1d5('0x12'),_0xe682c4,_0x354e4e);_0xe8872b(_0x354e4e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 6e3fcfb..0d650bf 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x45bfbc,_0x1ff15e){var _0x407018=function(_0x22f0f0){while(--_0x22f0f0){_0x45bfbc['push'](_0x45bfbc['shift']());}};_0x407018(++_0x1ff15e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 7048ae9..d423ba9 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 _0x0a8c=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1bb501,_0x3fedaf){var _0x502e3e=function(_0x3688ac){while(--_0x3688ac){_0x1bb501['push'](_0x1bb501['shift']());}};_0x502e3e(++_0x3fedaf);}(_0x0a8c,0x1aa));var _0xc0a8=function(_0x223655,_0x55480f){_0x223655=_0x223655-0x0;var _0x17b991=_0x0a8c[_0x223655];return _0x17b991;};'use strict';var Sequelize=require(_0xc0a8('0x0'));module[_0xc0a8('0x1')]={'priority':{'type':Sequelize[_0xc0a8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc0a8('0x3')],'allowNull':![],'defaultValue':_0xc0a8('0x4')},'appdata':{'type':Sequelize[_0xc0a8('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc0a8('0x3')],'defaultValue':_0xc0a8('0x6')}};
\ No newline at end of file
+var _0x987f=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x127cfa,_0x1f028c){var _0x2a6dcb=function(_0x49af9c){while(--_0x49af9c){_0x127cfa['push'](_0x127cfa['shift']());}};_0x2a6dcb(++_0x1f028c);}(_0x987f,0xf9));var _0xf987=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0x987f[_0x2c1101];return _0x56f52f;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'priority':{'type':Sequelize[_0xf987('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf987('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf987('0x4')]()},'description':{'type':Sequelize[_0xf987('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf987('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f609379..883b244 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 _0x81a4=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','filters','intersection','attributes','query','fields','length','includeAll','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x32c33a,_0x143ab9){var _0x466b2e=function(_0x56211e){while(--_0x56211e){_0x32c33a['push'](_0x32c33a['shift']());}};_0x466b2e(++_0x143ab9);}(_0x81a4,0x1a6));var _0x481a=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x81a4[_0x1ca9eb];return _0x2e284e;};'use strict';var emlformat=require(_0x481a('0x0'));var rimraf=require(_0x481a('0x1'));var zipdir=require(_0x481a('0x2'));var jsonpatch=require(_0x481a('0x3'));var rp=require('request-promise');var moment=require(_0x481a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x481a('0x5'));var util=require(_0x481a('0x6'));var path=require(_0x481a('0x7'));var sox=require('sox');var csv=require(_0x481a('0x8'));var ejs=require(_0x481a('0x9'));var fs=require('fs');var fs_extra=require(_0x481a('0xa'));var _=require(_0x481a('0xb'));var squel=require('squel');var crypto=require(_0x481a('0xc'));var jsforce=require(_0x481a('0xd'));var deskjs=require(_0x481a('0xe'));var toCsv=require(_0x481a('0x8'));var querystring=require(_0x481a('0xf'));var Papa=require(_0x481a('0x10'));var Redis=require('ioredis');var authService=require(_0x481a('0x11'));var qs=require(_0x481a('0x12'));var as=require(_0x481a('0x13'));var hardwareService=require(_0x481a('0x14'));var logger=require(_0x481a('0x15'))(_0x481a('0x16'));var utils=require(_0x481a('0x17'));var config=require(_0x481a('0x18'));var licenseUtil=require(_0x481a('0x19'));var db=require(_0x481a('0x1a'))['db'];function respondWithStatusCode(_0x507233,_0x5838af){_0x5838af=_0x5838af||0xcc;return function(_0x28a189){if(_0x28a189){return _0x507233[_0x481a('0x1b')](_0x5838af);}return _0x507233[_0x481a('0x1c')](_0x5838af)[_0x481a('0x1d')]();};}function respondWithResult(_0x44700a,_0x2e520b){_0x2e520b=_0x2e520b||0xc8;return function(_0x5637bd){if(_0x5637bd){return _0x44700a[_0x481a('0x1c')](_0x2e520b)['json'](_0x5637bd);}};}function respondWithFilteredResult(_0x238f3d,_0x1410c1){return function(_0x40f691){if(_0x40f691){var _0x507a5b=typeof _0x1410c1['offset']===_0x481a('0x1e')&&typeof _0x1410c1[_0x481a('0x1f')]===_0x481a('0x1e');var _0x152483=_0x40f691[_0x481a('0x20')];var _0x3186e3=_0x507a5b?0x0:_0x1410c1[_0x481a('0x21')];var _0x2e6d4e=_0x507a5b?_0x40f691[_0x481a('0x20')]:_0x1410c1[_0x481a('0x21')]+_0x1410c1['limit'];var _0x243883;if(_0x2e6d4e>=_0x152483){_0x2e6d4e=_0x152483;_0x243883=0xc8;}else{_0x243883=0xce;}_0x238f3d[_0x481a('0x1c')](_0x243883);return _0x238f3d[_0x481a('0x22')](_0x481a('0x23'),_0x3186e3+'-'+_0x2e6d4e+'/'+_0x152483)[_0x481a('0x24')](_0x40f691);}return null;};}function patchUpdates(_0x4a3a10){return function(_0x2e3549){try{jsonpatch[_0x481a('0x25')](_0x2e3549,_0x4a3a10,!![]);}catch(_0x248e88){return BPromise[_0x481a('0x26')](_0x248e88);}return _0x2e3549['save']();};}function saveUpdates(_0xce4b34,_0x1afd59){return function(_0x44673f){if(_0x44673f){return _0x44673f[_0x481a('0x27')](_0xce4b34)[_0x481a('0x28')](function(_0x17534e){return _0x17534e;});}return null;};}function removeEntity(_0x336ea1,_0x6a554b){return function(_0x56dc8f){if(_0x56dc8f){return _0x56dc8f[_0x481a('0x29')]()[_0x481a('0x28')](function(){_0x336ea1['status'](0xcc)[_0x481a('0x1d')]();});}};}function handleEntityNotFound(_0x4916fa,_0x1f7c7d){return function(_0x2ab2ed){if(!_0x2ab2ed){_0x4916fa[_0x481a('0x1b')](0x194);}return _0x2ab2ed;};}function handleError(_0xa86211,_0x542639){_0x542639=_0x542639||0x1f4;return function(_0x42acf4){logger[_0x481a('0x2a')](_0x42acf4[_0x481a('0x2b')]);if(_0x42acf4[_0x481a('0x2c')]){delete _0x42acf4[_0x481a('0x2c')];}_0xa86211[_0x481a('0x1c')](_0x542639)['send'](_0x42acf4);};}exports[_0x481a('0x2d')]=function(_0x33306a,_0xde418d){var _0x428e55={'raw':!![],'where':{'id':_0x33306a[_0x481a('0x2e')]['id']}},_0x4e9d26={};_0x4e9d26[_0x481a('0x2f')]=_[_0x481a('0x30')](db[_0x481a('0x31')]['rawAttributes']);_0x4e9d26['query']=_['keys'](_0x33306a['query']);_0x4e9d26[_0x481a('0x32')]=_[_0x481a('0x33')](_0x4e9d26[_0x481a('0x2f')],_0x4e9d26['query']);_0x428e55[_0x481a('0x34')]=_[_0x481a('0x33')](_0x4e9d26[_0x481a('0x2f')],qs['fields'](_0x33306a[_0x481a('0x35')][_0x481a('0x36')]));_0x428e55['attributes']=_0x428e55['attributes'][_0x481a('0x37')]?_0x428e55[_0x481a('0x34')]:_0x4e9d26[_0x481a('0x2f')];if(_0x33306a[_0x481a('0x35')][_0x481a('0x38')]){_0x428e55['include']=[{'all':!![]}];}_0x428e55=_[_0x481a('0x39')]({},_0x428e55,_0x33306a[_0x481a('0x3a')]);return db[_0x481a('0x31')][_0x481a('0x3b')](_0x428e55)['then'](handleEntityNotFound(_0xde418d,null))['then'](respondWithResult(_0xde418d,null))['catch'](handleError(_0xde418d,null));};exports[_0x481a('0x27')]=function(_0x95e744,_0x4ce97e){if(_0x95e744[_0x481a('0x3c')]['id']){delete _0x95e744[_0x481a('0x3c')]['id'];}return db['ChatApplication'][_0x481a('0x3b')]({'where':{'id':_0x95e744['params']['id']}})['then'](handleEntityNotFound(_0x4ce97e,null))['then'](saveUpdates(_0x95e744[_0x481a('0x3c')],null))['then'](respondWithResult(_0x4ce97e,null))[_0x481a('0x3d')](handleError(_0x4ce97e,null));};exports[_0x481a('0x29')]=function(_0x239955,_0x36b9ff){return db['ChatApplication'][_0x481a('0x3b')]({'where':{'id':_0x239955[_0x481a('0x2e')]['id']}})[_0x481a('0x28')](handleEntityNotFound(_0x36b9ff,null))[_0x481a('0x28')](removeEntity(_0x36b9ff,null))[_0x481a('0x3d')](handleError(_0x36b9ff,null));};
\ No newline at end of file
+var _0x639a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','options','find','catch','update','body','ChatApplication'];(function(_0x15fcee,_0x5ca682){var _0x42c080=function(_0x4d1332){while(--_0x4d1332){_0x15fcee['push'](_0x15fcee['shift']());}};_0x42c080(++_0x5ca682);}(_0x639a,0xec));var _0xa639=function(_0x33ec4b,_0x30cdd9){_0x33ec4b=_0x33ec4b-0x0;var _0x48027a=_0x639a[_0x33ec4b];return _0x48027a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba862,_0x2bf30f){_0x2bf30f=_0x2bf30f||0xcc;return function(_0xbd7aec){if(_0xbd7aec){return _0x5ba862['sendStatus'](_0x2bf30f);}return _0x5ba862['status'](_0x2bf30f)[_0xa639('0x1b')]();};}function respondWithResult(_0x1bdc46,_0x4d4b66){_0x4d4b66=_0x4d4b66||0xc8;return function(_0x1df5dd){if(_0x1df5dd){return _0x1bdc46[_0xa639('0x1c')](_0x4d4b66)[_0xa639('0x1d')](_0x1df5dd);}};}function respondWithFilteredResult(_0x49e770,_0xb15138){return function(_0x24f1a9){if(_0x24f1a9){var _0x96a92f=typeof _0xb15138[_0xa639('0x1e')]===_0xa639('0x1f')&&typeof _0xb15138['limit']===_0xa639('0x1f');var _0x4c6311=_0x24f1a9[_0xa639('0x20')];var _0x2e23a9=_0x96a92f?0x0:_0xb15138[_0xa639('0x1e')];var _0x229545=_0x96a92f?_0x24f1a9[_0xa639('0x20')]:_0xb15138['offset']+_0xb15138['limit'];var _0x2a36df;if(_0x229545>=_0x4c6311){_0x229545=_0x4c6311;_0x2a36df=0xc8;}else{_0x2a36df=0xce;}_0x49e770[_0xa639('0x1c')](_0x2a36df);return _0x49e770[_0xa639('0x21')](_0xa639('0x22'),_0x2e23a9+'-'+_0x229545+'/'+_0x4c6311)[_0xa639('0x1d')](_0x24f1a9);}return null;};}function patchUpdates(_0x52500b){return function(_0x5a939f){try{jsonpatch[_0xa639('0x23')](_0x5a939f,_0x52500b,!![]);}catch(_0x5d732c){return BPromise['reject'](_0x5d732c);}return _0x5a939f['save']();};}function saveUpdates(_0x43f85f,_0x28a11c){return function(_0x13592d){if(_0x13592d){return _0x13592d['update'](_0x43f85f)[_0xa639('0x24')](function(_0x562d03){return _0x562d03;});}return null;};}function removeEntity(_0xe89eb9,_0x351a33){return function(_0x55189d){if(_0x55189d){return _0x55189d['destroy']()['then'](function(){_0xe89eb9[_0xa639('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b5d8,_0x3d6e0c){return function(_0x237da8){if(!_0x237da8){_0x42b5d8[_0xa639('0x25')](0x194);}return _0x237da8;};}function handleError(_0x5ded72,_0x314e07){_0x314e07=_0x314e07||0x1f4;return function(_0x1a0d4e){logger[_0xa639('0x26')](_0x1a0d4e[_0xa639('0x27')]);if(_0x1a0d4e[_0xa639('0x28')]){delete _0x1a0d4e[_0xa639('0x28')];}_0x5ded72[_0xa639('0x1c')](_0x314e07)[_0xa639('0x29')](_0x1a0d4e);};}exports[_0xa639('0x2a')]=function(_0x3cda24,_0x4b7f2c){var _0x2d315f={'raw':!![],'where':{'id':_0x3cda24[_0xa639('0x2b')]['id']}},_0x38ff11={};_0x38ff11[_0xa639('0x2c')]=_[_0xa639('0x2d')](db['ChatApplication'][_0xa639('0x2e')]);_0x38ff11[_0xa639('0x2f')]=_['keys'](_0x3cda24[_0xa639('0x2f')]);_0x38ff11[_0xa639('0x30')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],_0x38ff11[_0xa639('0x2f')]);_0x2d315f[_0xa639('0x32')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],qs['fields'](_0x3cda24[_0xa639('0x2f')]['fields']));_0x2d315f[_0xa639('0x32')]=_0x2d315f[_0xa639('0x32')]['length']?_0x2d315f[_0xa639('0x32')]:_0x38ff11['model'];if(_0x3cda24[_0xa639('0x2f')]['includeAll']){_0x2d315f[_0xa639('0x33')]=[{'all':!![]}];}_0x2d315f=_[_0xa639('0x34')]({},_0x2d315f,_0x3cda24[_0xa639('0x35')]);return db['ChatApplication'][_0xa639('0x36')](_0x2d315f)[_0xa639('0x24')](handleEntityNotFound(_0x4b7f2c,null))[_0xa639('0x24')](respondWithResult(_0x4b7f2c,null))[_0xa639('0x37')](handleError(_0x4b7f2c,null));};exports[_0xa639('0x38')]=function(_0x2c69fa,_0xa34d5c){if(_0x2c69fa[_0xa639('0x39')]['id']){delete _0x2c69fa['body']['id'];}return db[_0xa639('0x3a')]['find']({'where':{'id':_0x2c69fa[_0xa639('0x2b')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0xa34d5c,null))['then'](saveUpdates(_0x2c69fa[_0xa639('0x39')],null))[_0xa639('0x24')](respondWithResult(_0xa34d5c,null))[_0xa639('0x37')](handleError(_0xa34d5c,null));};exports['destroy']=function(_0x4ce86c,_0x16d74d){return db[_0xa639('0x3a')]['find']({'where':{'id':_0x4ce86c['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x16d74d,null))[_0xa639('0x24')](removeEntity(_0x16d74d,null))['catch'](handleError(_0x16d74d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8ccd63d..ff4fd32 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 _0xa2cf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa94872,_0x4ec3b0){var _0x597214=function(_0x18354d){while(--_0x18354d){_0xa94872['push'](_0xa94872['shift']());}};_0x597214(++_0x4ec3b0);}(_0xa2cf,0x15c));var _0xfa2c=function(_0x50800a,_0x217ed5){_0x50800a=_0x50800a-0x0;var _0x4639c8=_0xa2cf[_0x50800a];return _0x4639c8;};'use strict';var _=require(_0xfa2c('0x0'));var util=require(_0xfa2c('0x1'));var logger=require(_0xfa2c('0x2'))('api');var moment=require(_0xfa2c('0x3'));var BPromise=require(_0xfa2c('0x4'));var rp=require(_0xfa2c('0x5'));var fs=require('fs');var path=require(_0xfa2c('0x6'));var rimraf=require(_0xfa2c('0x7'));var config=require(_0xfa2c('0x8'));var attributes=require(_0xfa2c('0x9'));module[_0xfa2c('0xa')]=function(_0x5e8a1b,_0xe1ad7e){return _0x5e8a1b[_0xfa2c('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa2c('0xc'),'collate':_0xfa2c('0xd')});};
\ No newline at end of file
+var _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0xb1f8d9,_0x595b62){var _0x1c72da=function(_0x511a0c){while(--_0x511a0c){_0xb1f8d9['push'](_0xb1f8d9['shift']());}};_0x1c72da(++_0x595b62);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xe4bba1,_0x4cae3a){_0xe4bba1=_0xe4bba1-0x0;var _0x4a7fcf=_0xf0cc[_0xe4bba1];return _0x4a7fcf;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 1c00286..4691932 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 _0x12d6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0x12d6,0x16e));var _0x612d=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x12d6[_0x46361e];return _0x14e302;};'use strict';var _=require(_0x612d('0x0'));var util=require(_0x612d('0x1'));var moment=require(_0x612d('0x2'));var BPromise=require(_0x612d('0x3'));var rs=require(_0x612d('0x4'));var fs=require('fs');var Redis=require(_0x612d('0x5'));var db=require(_0x612d('0x6'))['db'];var utils=require(_0x612d('0x7'));var logger=require('../../config/logger')(_0x612d('0x8'));var config=require(_0x612d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x612d('0xa')][_0x612d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11f58a,_0x965f0b,_0x61c54c){return new BPromise(function(_0x391b79,_0x23f66e){return client['request'](_0x11f58a,_0x61c54c)[_0x612d('0xc')](function(_0x4d0874){logger[_0x612d('0xd')](_0x612d('0xe'),_0x965f0b,'request\x20sent');logger[_0x612d('0xf')](_0x612d('0x10'),_0x965f0b,_0x612d('0x11'),JSON[_0x612d('0x12')](_0x4d0874));if(_0x4d0874[_0x612d('0x13')]){if(_0x4d0874['error']['code']===0x1f4){logger[_0x612d('0x13')]('ChatApplication,\x20%s,\x20%s',_0x965f0b,_0x4d0874[_0x612d('0x13')][_0x612d('0x14')]);return _0x23f66e(_0x4d0874[_0x612d('0x13')]['message']);}logger[_0x612d('0x13')](_0x612d('0xe'),_0x965f0b,_0x4d0874[_0x612d('0x13')][_0x612d('0x14')]);return _0x391b79(_0x4d0874[_0x612d('0x13')]['message']);}else{logger['info'](_0x612d('0xe'),_0x965f0b,_0x612d('0x11'));_0x391b79(_0x4d0874[_0x612d('0x15')][_0x612d('0x14')]);}})[_0x612d('0x16')](function(_0x1f595d){logger[_0x612d('0x13')]('ChatApplication,\x20%s,\x20%s',_0x965f0b,_0x1f595d);_0x23f66e(_0x1f595d);});});}
\ No newline at end of file
+var _0x0541=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1f2314,_0x38e139){var _0x515db4=function(_0x41f99d){while(--_0x41f99d){_0x1f2314['push'](_0x1f2314['shift']());}};_0x515db4(++_0x38e139);}(_0x0541,0x155));var _0x1054=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0541[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1054('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1054('0x3'))['db'];var utils=require(_0x1054('0x4'));var logger=require(_0x1054('0x5'))(_0x1054('0x6'));var config=require(_0x1054('0x7'));var jayson=require(_0x1054('0x8'));var client=jayson[_0x1054('0x9')][_0x1054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189527,_0x4dbedb,_0x4e478e){return new BPromise(function(_0x466374,_0x39217b){return client[_0x1054('0xb')](_0x189527,_0x4e478e)[_0x1054('0xc')](function(_0x26d170){logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));logger[_0x1054('0x10')](_0x1054('0x11'),_0x4dbedb,_0x1054('0xf'),JSON['stringify'](_0x26d170));if(_0x26d170['error']){if(_0x26d170[_0x1054('0x12')]['code']===0x1f4){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170['error'][_0x1054('0x13')]);return _0x39217b(_0x26d170[_0x1054('0x12')]['message']);}logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);return _0x466374(_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);}else{logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));_0x466374(_0x26d170['result'][_0x1054('0x13')]);}})[_0x1054('0x14')](function(_0x30dbe6){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x30dbe6);_0x39217b(_0x30dbe6);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index aae2e9b..3d9d525 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 _0x6e15=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','isAuthenticated','update','delete'];(function(_0x303deb,_0x48fb44){var _0x12dba5=function(_0x2ff8dd){while(--_0x2ff8dd){_0x303deb['push'](_0x303deb['shift']());}};_0x12dba5(++_0x48fb44);}(_0x6e15,0x1d6));var _0x56e1=function(_0x3d4674,_0x2734af){_0x3d4674=_0x3d4674-0x0;var _0x3a3070=_0x6e15[_0x3d4674];return _0x3a3070;};'use strict';var multer=require(_0x56e1('0x0'));var util=require('util');var path=require(_0x56e1('0x1'));var timeout=require(_0x56e1('0x2'));var express=require(_0x56e1('0x3'));var router=express[_0x56e1('0x4')]();var fs_extra=require(_0x56e1('0x5'));var auth=require(_0x56e1('0x6'));var interaction=require(_0x56e1('0x7'));var config=require(_0x56e1('0x8'));var controller=require(_0x56e1('0x9'));router['get'](_0x56e1('0xa'),auth['isAuthenticated'](),controller[_0x56e1('0xb')]);router[_0x56e1('0xc')](_0x56e1('0xa'),auth[_0x56e1('0xd')](),controller[_0x56e1('0xe')]);router[_0x56e1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x56e1('0x10')]);module[_0x56e1('0x11')]=router;
\ No newline at end of file
+var _0xfdf2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x29887d,_0x36d8e9){var _0xe5a96a=function(_0x845060){while(--_0x845060){_0x29887d['push'](_0x29887d['shift']());}};_0xe5a96a(++_0x36d8e9);}(_0xfdf2,0x1aa));var _0x2fdf=function(_0x3b194f,_0x4b5a3e){_0x3b194f=_0x3b194f-0x0;var _0x1dce17=_0xfdf2[_0x3b194f];return _0x1dce17;};'use strict';var multer=require('multer');var util=require(_0x2fdf('0x0'));var path=require(_0x2fdf('0x1'));var timeout=require(_0x2fdf('0x2'));var express=require(_0x2fdf('0x3'));var router=express[_0x2fdf('0x4')]();var fs_extra=require(_0x2fdf('0x5'));var auth=require(_0x2fdf('0x6'));var interaction=require(_0x2fdf('0x7'));var config=require(_0x2fdf('0x8'));var controller=require('./chatApplication.controller');router[_0x2fdf('0x9')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xb')]);router[_0x2fdf('0xc')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xd')]);router[_0x2fdf('0xe')](_0x2fdf('0xf'),auth[_0x2fdf('0xa')](),controller[_0x2fdf('0x10')]);module[_0x2fdf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 6e25b26..7a49579 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 _0xc23e=['STRING','BOOLEAN','exports'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0xc23e,0x68));var _0xec23=function(_0x312e2d,_0x1e5162){_0x312e2d=_0x312e2d-0x0;var _0x3cfc1a=_0xc23e[_0x312e2d];return _0x3cfc1a;};'use strict';var Sequelize=require('sequelize');module[_0xec23('0x0')]={'name':{'type':Sequelize[_0xec23('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xec23('0x1')]},'write':{'type':Sequelize[_0xec23('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xafec=['STRING','BOOLEAN','exports'];(function(_0x1c5042,_0x1ff338){var _0x20aa36=function(_0x4f97e8){while(--_0x4f97e8){_0x1c5042['push'](_0x1c5042['shift']());}};_0x20aa36(++_0x1ff338);}(_0xafec,0x161));var _0xcafe=function(_0xf0abc0,_0x3d3cdc){_0xf0abc0=_0xf0abc0-0x0;var _0x29fd55=_0xafec[_0xf0abc0];return _0x29fd55;};'use strict';var Sequelize=require('sequelize');module[_0xcafe('0x0')]={'name':{'type':Sequelize[_0xcafe('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcafe('0x1')]},'write':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 920866f..35f7caa 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 _0xc320=['findOne','User','order','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers'];(function(_0x6adc7e,_0x268c4d){var _0x46234a=function(_0x553cb5){while(--_0x553cb5){_0x6adc7e['push'](_0x6adc7e['shift']());}};_0x46234a(++_0x268c4d);}(_0xc320,0x12e));var _0x0c32=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xc320[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x0c32('0x0'));var rimraf=require(_0x0c32('0x1'));var zipdir=require(_0x0c32('0x2'));var jsonpatch=require(_0x0c32('0x3'));var rp=require(_0x0c32('0x4'));var moment=require('moment');var BPromise=require(_0x0c32('0x5'));var Mustache=require('mustache');var util=require(_0x0c32('0x6'));var path=require(_0x0c32('0x7'));var sox=require(_0x0c32('0x8'));var csv=require(_0x0c32('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c32('0xa'));var _=require('lodash');var squel=require(_0x0c32('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c32('0xc'));var deskjs=require(_0x0c32('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c32('0xe'));var Redis=require(_0x0c32('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c32('0x10'));var logger=require(_0x0c32('0x11'))(_0x0c32('0x12'));var utils=require(_0x0c32('0x13'));var config=require(_0x0c32('0x14'));var licenseUtil=require(_0x0c32('0x15'));var db=require(_0x0c32('0x16'))['db'];config[_0x0c32('0x17')]=_[_0x0c32('0x18')](config[_0x0c32('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c32('0x17')]));require(_0x0c32('0x19'))[_0x0c32('0x1a')](socket);function respondWithStatusCode(_0x17ce46,_0x1702b3){_0x1702b3=_0x1702b3||0xcc;return function(_0x4d784b){if(_0x4d784b){return _0x17ce46[_0x0c32('0x1b')](_0x1702b3);}return _0x17ce46[_0x0c32('0x1c')](_0x1702b3)[_0x0c32('0x1d')]();};}function respondWithResult(_0x489ce9,_0x454b4d){_0x454b4d=_0x454b4d||0xc8;return function(_0x455bc8){if(_0x455bc8){return _0x489ce9[_0x0c32('0x1c')](_0x454b4d)[_0x0c32('0x1e')](_0x455bc8);}};}function respondWithFilteredResult(_0x36385d,_0xb5a351){return function(_0x8109b3){if(_0x8109b3){var _0x2a33de=typeof _0xb5a351[_0x0c32('0x1f')]===_0x0c32('0x20')&&typeof _0xb5a351[_0x0c32('0x21')]===_0x0c32('0x20');var _0x5c5926=_0x8109b3[_0x0c32('0x22')];var _0x1ef731=_0x2a33de?0x0:_0xb5a351[_0x0c32('0x1f')];var _0x286846=_0x2a33de?_0x8109b3[_0x0c32('0x22')]:_0xb5a351[_0x0c32('0x1f')]+_0xb5a351[_0x0c32('0x21')];var _0x26cbcb;if(_0x286846>=_0x5c5926){_0x286846=_0x5c5926;_0x26cbcb=0xc8;}else{_0x26cbcb=0xce;}_0x36385d[_0x0c32('0x1c')](_0x26cbcb);return _0x36385d[_0x0c32('0x23')](_0x0c32('0x24'),_0x1ef731+'-'+_0x286846+'/'+_0x5c5926)[_0x0c32('0x1e')](_0x8109b3);}return null;};}function patchUpdates(_0x2f6d3f){return function(_0x767bcf){try{jsonpatch[_0x0c32('0x25')](_0x767bcf,_0x2f6d3f,!![]);}catch(_0x4487a2){return BPromise['reject'](_0x4487a2);}return _0x767bcf[_0x0c32('0x26')]();};}function saveUpdates(_0x754249,_0x4376f6){return function(_0x535e2e){if(_0x535e2e){return _0x535e2e[_0x0c32('0x27')](_0x754249)[_0x0c32('0x28')](function(_0x2b9fa5){return _0x2b9fa5;});}return null;};}function removeEntity(_0x5d3eb7,_0x3aa679){return function(_0x2b2997){if(_0x2b2997){return _0x2b2997[_0x0c32('0x29')]()['then'](function(){_0x5d3eb7['status'](0xcc)[_0x0c32('0x1d')]();});}};}function handleEntityNotFound(_0x518e93,_0x5dca0d){return function(_0x26aa15){if(!_0x26aa15){_0x518e93['sendStatus'](0x194);}return _0x26aa15;};}function handleError(_0x4206f7,_0x2acdcc){_0x2acdcc=_0x2acdcc||0x1f4;return function(_0x56bfe2){logger[_0x0c32('0x2a')](_0x56bfe2[_0x0c32('0x2b')]);if(_0x56bfe2['name']){delete _0x56bfe2[_0x0c32('0x2c')];}_0x4206f7[_0x0c32('0x1c')](_0x2acdcc)[_0x0c32('0x2d')](_0x56bfe2);};}exports[_0x0c32('0x2e')]=function(_0x22b29b,_0x2a9ff6){var _0x47f6d2={},_0x224b38={},_0x58f899={'count':0x0,'rows':[]};var _0x246801=_['map'](db[_0x0c32('0x2f')][_0x0c32('0x30')],function(_0x250307){return{'name':_0x250307[_0x0c32('0x31')],'type':_0x250307[_0x0c32('0x32')]['key']};});_0x224b38['model']=_[_0x0c32('0x33')](_0x246801,'name');_0x224b38[_0x0c32('0x34')]=_[_0x0c32('0x35')](_0x22b29b[_0x0c32('0x34')]);_0x224b38['filters']=_[_0x0c32('0x36')](_0x224b38[_0x0c32('0x37')],_0x224b38[_0x0c32('0x34')]);_0x47f6d2[_0x0c32('0x38')]=_['intersection'](_0x224b38[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x22b29b[_0x0c32('0x34')][_0x0c32('0x39')]));_0x47f6d2[_0x0c32('0x38')]=_0x47f6d2['attributes'][_0x0c32('0x3a')]?_0x47f6d2[_0x0c32('0x38')]:_0x224b38[_0x0c32('0x37')];if(!_0x22b29b[_0x0c32('0x34')][_0x0c32('0x3b')](_0x0c32('0x3c'))){_0x47f6d2['limit']=qs[_0x0c32('0x21')](_0x22b29b[_0x0c32('0x34')]['limit']);_0x47f6d2[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0x22b29b[_0x0c32('0x34')][_0x0c32('0x1f')]);}_0x47f6d2['order']=qs[_0x0c32('0x3d')](_0x22b29b['query'][_0x0c32('0x3d')]);_0x47f6d2[_0x0c32('0x3e')]=qs['filters'](_[_0x0c32('0x3f')](_0x22b29b[_0x0c32('0x34')],_0x224b38[_0x0c32('0x40')]),_0x246801);if(_0x22b29b[_0x0c32('0x34')]['filter']){_0x47f6d2[_0x0c32('0x3e')]=_[_0x0c32('0x41')](_0x47f6d2[_0x0c32('0x3e')],{'$or':_[_0x0c32('0x33')](_0x246801,function(_0x2738c8){if(_0x2738c8[_0x0c32('0x32')]!==_0x0c32('0x42')){var _0x56b2d0={};_0x56b2d0[_0x2738c8[_0x0c32('0x2c')]]={'$like':'%'+_0x22b29b[_0x0c32('0x34')][_0x0c32('0x43')]+'%'};return _0x56b2d0;}})});}_0x47f6d2=_[_0x0c32('0x41')]({},_0x47f6d2,_0x22b29b[_0x0c32('0x44')]);var _0x317b1e={'where':_0x47f6d2['where']};return db['ChatGroup']['count'](_0x317b1e)[_0x0c32('0x28')](function(_0x595dff){_0x58f899[_0x0c32('0x22')]=_0x595dff;if(_0x22b29b[_0x0c32('0x34')][_0x0c32('0x45')]){_0x47f6d2[_0x0c32('0x46')]=[{'all':!![]}];}return db[_0x0c32('0x2f')][_0x0c32('0x47')](_0x47f6d2);})[_0x0c32('0x28')](function(_0x3e43a9){_0x58f899[_0x0c32('0x48')]=_0x3e43a9;return _0x58f899;})[_0x0c32('0x28')](respondWithFilteredResult(_0x2a9ff6,_0x47f6d2))[_0x0c32('0x49')](handleError(_0x2a9ff6,null));};exports[_0x0c32('0x4a')]=function(_0x2b9d47,_0x3a527c){var _0x276db1={'raw':!![],'where':{'id':_0x2b9d47[_0x0c32('0x4b')]['id']}},_0x381332={};_0x381332[_0x0c32('0x37')]=_[_0x0c32('0x35')](db[_0x0c32('0x2f')][_0x0c32('0x30')]);_0x381332[_0x0c32('0x34')]=_[_0x0c32('0x35')](_0x2b9d47[_0x0c32('0x34')]);_0x381332[_0x0c32('0x40')]=_[_0x0c32('0x36')](_0x381332[_0x0c32('0x37')],_0x381332['query']);_0x276db1[_0x0c32('0x38')]=_[_0x0c32('0x36')](_0x381332[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x2b9d47['query'][_0x0c32('0x39')]));_0x276db1[_0x0c32('0x38')]=_0x276db1[_0x0c32('0x38')]['length']?_0x276db1[_0x0c32('0x38')]:_0x381332[_0x0c32('0x37')];if(_0x2b9d47['query'][_0x0c32('0x45')]){_0x276db1['include']=[{'all':!![]}];}_0x276db1=_['merge']({},_0x276db1,_0x2b9d47[_0x0c32('0x44')]);return db[_0x0c32('0x2f')]['find'](_0x276db1)[_0x0c32('0x28')](handleEntityNotFound(_0x3a527c,null))['then'](respondWithResult(_0x3a527c,null))[_0x0c32('0x49')](handleError(_0x3a527c,null));};exports[_0x0c32('0x4c')]=function(_0x5d02f0,_0x3e9ac8){return db[_0x0c32('0x2f')]['create'](_0x5d02f0[_0x0c32('0x4d')],{})[_0x0c32('0x28')](respondWithResult(_0x3e9ac8,0xc9))[_0x0c32('0x49')](handleError(_0x3e9ac8,null));};exports[_0x0c32('0x27')]=function(_0x478a48,_0x410b5e){if(_0x478a48['body']['id']){delete _0x478a48[_0x0c32('0x4d')]['id'];}return db[_0x0c32('0x2f')][_0x0c32('0x4e')]({'where':{'id':_0x478a48[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x410b5e,null))[_0x0c32('0x28')](saveUpdates(_0x478a48[_0x0c32('0x4d')],null))[_0x0c32('0x28')](respondWithResult(_0x410b5e,null))['catch'](handleError(_0x410b5e,null));};exports[_0x0c32('0x29')]=function(_0x179521,_0x12e0ff){return db[_0x0c32('0x2f')]['find']({'where':{'id':_0x179521[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x12e0ff,null))[_0x0c32('0x28')](removeEntity(_0x12e0ff,null))['catch'](handleError(_0x12e0ff,null));};exports['describe']=function(_0x3a94d8,_0x49cf03){return db[_0x0c32('0x2f')][_0x0c32('0x4f')]()['then'](respondWithResult(_0x49cf03,null))[_0x0c32('0x49')](handleError(_0x49cf03,null));};exports['getUnread']=function(_0x55f322,_0x4a695b,_0x4a709){return db[_0x0c32('0x50')][_0x0c32('0x22')]({'where':{'ChatGroupId':_0x55f322[_0x0c32('0x4b')]['id'],'ToId':_0x55f322[_0x0c32('0x51')]['id'],'read':![]}})['then'](function(_0x7bf34d){return{'id':_[_0x0c32('0x52')](_0x55f322['params']['id']),'count':_0x7bf34d};})[_0x0c32('0x28')](respondWithResult(_0x4a695b,null))[_0x0c32('0x49')](handleError(_0x4a695b,null));};exports['addMembers']=function(_0x46c6bb,_0x2adfb5,_0x4422b0){return db[_0x0c32('0x2f')][_0x0c32('0x4e')]({'where':{'id':_0x46c6bb[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x2adfb5,null))['then'](function(_0x5d323b){if(_0x5d323b){return _0x5d323b[_0x0c32('0x53')](_0x46c6bb['body'][_0x0c32('0x54')],_['omit'](_0x46c6bb['body'],[_0x0c32('0x54'),'id'])||{});}})[_0x0c32('0x28')](respondWithResult(_0x2adfb5,null))['catch'](handleError(_0x2adfb5,null));};exports[_0x0c32('0x55')]=function(_0xc88af4,_0x53a3b4,_0x18b8ea){var _0x11048b={};var _0x2797e4={};var _0x29b80f;var _0x4bacc5;return db[_0x0c32('0x2f')][_0x0c32('0x56')]({'where':{'id':_0xc88af4[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x53a3b4,null))[_0x0c32('0x28')](function(_0xd03317){if(_0xd03317){_0x29b80f=_0xd03317;_0x2797e4['model']=_['keys'](db[_0x0c32('0x57')]['rawAttributes']);_0x2797e4['query']=_[_0x0c32('0x35')](_0xc88af4['query']);_0x2797e4[_0x0c32('0x40')]=_[_0x0c32('0x36')](_0x2797e4['model'],_0x2797e4['query']);_0x11048b[_0x0c32('0x38')]=_[_0x0c32('0x36')](_0x2797e4[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0xc88af4[_0x0c32('0x34')][_0x0c32('0x39')]));_0x11048b[_0x0c32('0x38')]=_0x11048b[_0x0c32('0x38')]['length']?_0x11048b[_0x0c32('0x38')]:_0x2797e4[_0x0c32('0x37')];_0x11048b[_0x0c32('0x58')]=qs['sort'](_0xc88af4['query'][_0x0c32('0x3d')]);_0x11048b[_0x0c32('0x3e')]=qs[_0x0c32('0x40')](_[_0x0c32('0x3f')](_0xc88af4[_0x0c32('0x34')],_0x2797e4[_0x0c32('0x40')]));if(_0xc88af4[_0x0c32('0x34')]['filter']){_0x11048b[_0x0c32('0x3e')]=_[_0x0c32('0x41')](_0x11048b['where'],{'$or':_[_0x0c32('0x33')](_0x11048b[_0x0c32('0x38')],function(_0x3c69ed){var _0x43f3a6={};_0x43f3a6[_0x3c69ed]={'$like':'%'+_0xc88af4[_0x0c32('0x34')]['filter']+'%'};return _0x43f3a6;})});}_0x11048b=_['merge']({},_0x11048b,_0xc88af4[_0x0c32('0x44')]);return _0x29b80f[_0x0c32('0x55')](_0x11048b);}})['then'](function(_0x475ab4){if(_0x475ab4){_0x4bacc5=_0x475ab4[_0x0c32('0x3a')];if(!_0xc88af4['query'][_0x0c32('0x3b')](_0x0c32('0x3c'))){_0x11048b[_0x0c32('0x21')]=qs[_0x0c32('0x21')](_0xc88af4[_0x0c32('0x34')]['limit']);_0x11048b[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0xc88af4[_0x0c32('0x34')][_0x0c32('0x1f')]);}return _0x29b80f[_0x0c32('0x55')](_0x11048b);}})[_0x0c32('0x28')](function(_0x2decc7){if(_0x2decc7){return _0x2decc7?{'count':_0x4bacc5,'rows':_0x2decc7}:null;}})['then'](respondWithResult(_0x53a3b4,null))[_0x0c32('0x49')](handleError(_0x53a3b4,null));};exports['removeMembers']=function(_0x204089,_0x26f319,_0x7e51a6){return db['ChatGroup'][_0x0c32('0x4e')]({'where':{'id':_0x204089[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x26f319,null))[_0x0c32('0x28')](function(_0x100474){if(_0x100474){return _0x100474[_0x0c32('0x59')](_0x204089[_0x0c32('0x34')][_0x0c32('0x54')]);}})[_0x0c32('0x28')](respondWithStatusCode(_0x26f319,null))['catch'](handleError(_0x26f319,null));};exports[_0x0c32('0x5a')]=function(_0x16d7a7,_0x4d9560,_0x1aa3d9){if(_0x16d7a7[_0x0c32('0x4d')]['id']){delete _0x16d7a7[_0x0c32('0x4d')]['id'];}return db[_0x0c32('0x2f')]['find']({'where':{'id':_0x16d7a7[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x4d9560,null))[_0x0c32('0x28')](function(_0x141f6e){if(_0x141f6e){_0x16d7a7['body'][_0x0c32('0x5b')]=_0x141f6e['id'];return db['ChatInternalMessage'][_0x0c32('0x4c')](_0x16d7a7[_0x0c32('0x4d')]);}})[_0x0c32('0x28')](respondWithResult(_0x4d9560,null))[_0x0c32('0x49')](handleError(_0x4d9560,null));};exports[_0x0c32('0x5c')]=function(_0x1a3f55,_0x39e04e,_0x3f77ce){var _0x3cff58={};var _0x21b898={};var _0x57be18;var _0x2d1e26;return db[_0x0c32('0x2f')][_0x0c32('0x56')]({'where':{'id':_0x1a3f55['params']['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x39e04e,null))[_0x0c32('0x28')](function(_0x22a127){if(_0x22a127){_0x57be18=_0x22a127;_0x21b898[_0x0c32('0x37')]=_['keys'](db[_0x0c32('0x50')][_0x0c32('0x30')]);_0x21b898['query']=_['keys'](_0x1a3f55[_0x0c32('0x34')]);_0x21b898['filters']=_['intersection'](_0x21b898[_0x0c32('0x37')],_0x21b898[_0x0c32('0x34')]);_0x3cff58['attributes']=_[_0x0c32('0x36')](_0x21b898[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x39')]));_0x3cff58[_0x0c32('0x38')]=_0x3cff58[_0x0c32('0x38')][_0x0c32('0x3a')]?_0x3cff58[_0x0c32('0x38')]:_0x21b898[_0x0c32('0x37')];_0x3cff58['order']=qs[_0x0c32('0x3d')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x3d')]);_0x3cff58[_0x0c32('0x3e')]=qs['filters'](_[_0x0c32('0x3f')](_0x1a3f55[_0x0c32('0x34')],_0x21b898[_0x0c32('0x40')]));if(_0x1a3f55['query']['filter']){_0x3cff58['where']=_[_0x0c32('0x41')](_0x3cff58[_0x0c32('0x3e')],{'$or':_[_0x0c32('0x33')](_0x3cff58[_0x0c32('0x38')],function(_0x367cb5){var _0x4ed609={};_0x4ed609[_0x367cb5]={'$like':'%'+_0x1a3f55[_0x0c32('0x34')]['filter']+'%'};return _0x4ed609;})});}if(_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x5d')]){var _0x315207=_0x1a3f55['query']['$gte'][_0x0c32('0x5e')](',');var _0x317d9d={};_0x317d9d[_0x315207[0x0]]={'$gte':moment(_0x315207[0x1])[_0x0c32('0x5f')](_0x0c32('0x60'))};_0x3cff58[_0x0c32('0x3e')]=_['merge'](_0x3cff58['where'],_0x317d9d);}_0x3cff58=_['merge']({},_0x3cff58,_0x1a3f55[_0x0c32('0x44')]);return _0x57be18[_0x0c32('0x5c')](_0x3cff58);}})[_0x0c32('0x28')](function(_0x3304b1){if(_0x3304b1){_0x2d1e26=_0x3304b1['length'];if(!_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x3b')]('nolimit')){_0x3cff58[_0x0c32('0x21')]=qs[_0x0c32('0x21')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x21')]);_0x3cff58[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x1f')]);}return _0x57be18[_0x0c32('0x5c')](_0x3cff58);}})[_0x0c32('0x28')](function(_0x3dc57c){if(_0x3dc57c){return _0x3dc57c?{'count':_0x2d1e26,'rows':_0x3dc57c}:null;}})[_0x0c32('0x28')](respondWithResult(_0x39e04e,null))[_0x0c32('0x49')](handleError(_0x39e04e,null));};
\ No newline at end of file
+var _0x793f=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','save','update','then','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','model','length','include','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x793f,0x15a));var _0xf793=function(_0x257c53,_0x2cddf8){_0x257c53=_0x257c53-0x0;var _0x6f5365=_0x793f[_0x257c53];return _0x6f5365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf793('0x1'));var rp=require(_0xf793('0x2'));var moment=require('moment');var BPromise=require(_0xf793('0x3'));var Mustache=require('mustache');var util=require(_0xf793('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf793('0x5'));var ejs=require(_0xf793('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf793('0x7'));var squel=require(_0xf793('0x8'));var crypto=require(_0xf793('0x9'));var jsforce=require(_0xf793('0xa'));var deskjs=require(_0xf793('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf793('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf793('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf793('0xe'));var logger=require('../../config/logger')(_0xf793('0xf'));var utils=require('../../config/utils');var config=require(_0xf793('0x10'));var licenseUtil=require(_0xf793('0x11'));var db=require(_0xf793('0x12'))['db'];config['redis']=_['defaults'](config[_0xf793('0x13')],{'host':_0xf793('0x14'),'port':0x18eb});var socket=require(_0xf793('0x15'))(new Redis(config[_0xf793('0x13')]));require('./chatGroup.socket')[_0xf793('0x16')](socket);function respondWithStatusCode(_0x43859c,_0x24c62f){_0x24c62f=_0x24c62f||0xcc;return function(_0x23ba38){if(_0x23ba38){return _0x43859c[_0xf793('0x17')](_0x24c62f);}return _0x43859c['status'](_0x24c62f)[_0xf793('0x18')]();};}function respondWithResult(_0x583148,_0x114925){_0x114925=_0x114925||0xc8;return function(_0x4b8f58){if(_0x4b8f58){return _0x583148['status'](_0x114925)['json'](_0x4b8f58);}};}function respondWithFilteredResult(_0x19bc06,_0x54188a){return function(_0x22335a){if(_0x22335a){var _0x31d5e1=typeof _0x54188a[_0xf793('0x19')]===_0xf793('0x1a')&&typeof _0x54188a[_0xf793('0x1b')]==='undefined';var _0x3bc25b=_0x22335a[_0xf793('0x1c')];var _0x1ed3a2=_0x31d5e1?0x0:_0x54188a['offset'];var _0x536eda=_0x31d5e1?_0x22335a[_0xf793('0x1c')]:_0x54188a[_0xf793('0x19')]+_0x54188a[_0xf793('0x1b')];var _0x552fbb;if(_0x536eda>=_0x3bc25b){_0x536eda=_0x3bc25b;_0x552fbb=0xc8;}else{_0x552fbb=0xce;}_0x19bc06[_0xf793('0x1d')](_0x552fbb);return _0x19bc06['set'](_0xf793('0x1e'),_0x1ed3a2+'-'+_0x536eda+'/'+_0x3bc25b)[_0xf793('0x1f')](_0x22335a);}return null;};}function patchUpdates(_0x41cfc7){return function(_0x59cd26){try{jsonpatch['apply'](_0x59cd26,_0x41cfc7,!![]);}catch(_0x571c46){return BPromise['reject'](_0x571c46);}return _0x59cd26[_0xf793('0x20')]();};}function saveUpdates(_0x450e39,_0x4be66b){return function(_0x20210d){if(_0x20210d){return _0x20210d[_0xf793('0x21')](_0x450e39)['then'](function(_0x53dbd6){return _0x53dbd6;});}return null;};}function removeEntity(_0x682f1b,_0x2806f9){return function(_0x4d7193){if(_0x4d7193){return _0x4d7193['destroy']()[_0xf793('0x22')](function(){_0x682f1b[_0xf793('0x1d')](0xcc)[_0xf793('0x18')]();});}};}function handleEntityNotFound(_0x2658d6,_0x30808a){return function(_0x5a332b){if(!_0x5a332b){_0x2658d6[_0xf793('0x17')](0x194);}return _0x5a332b;};}function handleError(_0x2135f2,_0x23d344){_0x23d344=_0x23d344||0x1f4;return function(_0x221e3a){logger[_0xf793('0x23')](_0x221e3a[_0xf793('0x24')]);if(_0x221e3a['name']){delete _0x221e3a[_0xf793('0x25')];}_0x2135f2[_0xf793('0x1d')](_0x23d344)[_0xf793('0x26')](_0x221e3a);};}exports['index']=function(_0x1b0fec,_0x1f038f){var _0x5c5180={},_0x3dbc29={},_0xa5fd34={'count':0x0,'rows':[]};var _0x9698a0=_['map'](db[_0xf793('0x27')][_0xf793('0x28')],function(_0x4423cc){return{'name':_0x4423cc[_0xf793('0x29')],'type':_0x4423cc[_0xf793('0x2a')][_0xf793('0x2b')]};});_0x3dbc29['model']=_[_0xf793('0x2c')](_0x9698a0,_0xf793('0x25'));_0x3dbc29[_0xf793('0x2d')]=_[_0xf793('0x2e')](_0x1b0fec[_0xf793('0x2d')]);_0x3dbc29[_0xf793('0x2f')]=_['intersection'](_0x3dbc29['model'],_0x3dbc29[_0xf793('0x2d')]);_0x5c5180[_0xf793('0x30')]=_[_0xf793('0x31')](_0x3dbc29['model'],qs['fields'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x32')]));_0x5c5180[_0xf793('0x30')]=_0x5c5180[_0xf793('0x30')]['length']?_0x5c5180['attributes']:_0x3dbc29['model'];if(!_0x1b0fec[_0xf793('0x2d')]['hasOwnProperty'](_0xf793('0x33'))){_0x5c5180[_0xf793('0x1b')]=qs[_0xf793('0x1b')](_0x1b0fec['query'][_0xf793('0x1b')]);_0x5c5180[_0xf793('0x19')]=qs['offset'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x19')]);}_0x5c5180['order']=qs[_0xf793('0x34')](_0x1b0fec['query'][_0xf793('0x34')]);_0x5c5180[_0xf793('0x35')]=qs['filters'](_[_0xf793('0x36')](_0x1b0fec[_0xf793('0x2d')],_0x3dbc29[_0xf793('0x2f')]),_0x9698a0);if(_0x1b0fec['query'][_0xf793('0x37')]){_0x5c5180[_0xf793('0x35')]=_[_0xf793('0x38')](_0x5c5180[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0x9698a0,function(_0x2ac7e6){if(_0x2ac7e6['type']!==_0xf793('0x39')){var _0x2c558e={};_0x2c558e[_0x2ac7e6[_0xf793('0x25')]]={'$like':'%'+_0x1b0fec[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x2c558e;}})});}_0x5c5180=_[_0xf793('0x38')]({},_0x5c5180,_0x1b0fec[_0xf793('0x3a')]);var _0x44daf7={'where':_0x5c5180['where']};return db[_0xf793('0x27')][_0xf793('0x1c')](_0x44daf7)[_0xf793('0x22')](function(_0x4ae4b6){_0xa5fd34[_0xf793('0x1c')]=_0x4ae4b6;if(_0x1b0fec[_0xf793('0x2d')][_0xf793('0x3b')]){_0x5c5180['include']=[{'all':!![]}];}return db[_0xf793('0x27')]['findAll'](_0x5c5180);})[_0xf793('0x22')](function(_0x4ee1af){_0xa5fd34[_0xf793('0x3c')]=_0x4ee1af;return _0xa5fd34;})[_0xf793('0x22')](respondWithFilteredResult(_0x1f038f,_0x5c5180))['catch'](handleError(_0x1f038f,null));};exports[_0xf793('0x3d')]=function(_0x4a6f50,_0x29c5d5){var _0x5680de={'raw':!![],'where':{'id':_0x4a6f50[_0xf793('0x3e')]['id']}},_0x13a4e6={};_0x13a4e6[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x27')][_0xf793('0x28')]);_0x13a4e6[_0xf793('0x2d')]=_['keys'](_0x4a6f50['query']);_0x13a4e6['filters']=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],_0x13a4e6['query']);_0x5680de[_0xf793('0x30')]=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x4a6f50['query']['fields']));_0x5680de['attributes']=_0x5680de[_0xf793('0x30')][_0xf793('0x40')]?_0x5680de[_0xf793('0x30')]:_0x13a4e6[_0xf793('0x3f')];if(_0x4a6f50[_0xf793('0x2d')]['includeAll']){_0x5680de[_0xf793('0x41')]=[{'all':!![]}];}_0x5680de=_[_0xf793('0x38')]({},_0x5680de,_0x4a6f50[_0xf793('0x3a')]);return db[_0xf793('0x27')][_0xf793('0x42')](_0x5680de)['then'](handleEntityNotFound(_0x29c5d5,null))[_0xf793('0x22')](respondWithResult(_0x29c5d5,null))[_0xf793('0x43')](handleError(_0x29c5d5,null));};exports['create']=function(_0x57fe6d,_0x22ae8e){return db[_0xf793('0x27')][_0xf793('0x44')](_0x57fe6d[_0xf793('0x45')],{})[_0xf793('0x22')](respondWithResult(_0x22ae8e,0xc9))[_0xf793('0x43')](handleError(_0x22ae8e,null));};exports[_0xf793('0x21')]=function(_0x11be05,_0x279d9d){if(_0x11be05['body']['id']){delete _0x11be05[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x11be05[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x279d9d,null))[_0xf793('0x22')](saveUpdates(_0x11be05['body'],null))[_0xf793('0x22')](respondWithResult(_0x279d9d,null))[_0xf793('0x43')](handleError(_0x279d9d,null));};exports[_0xf793('0x46')]=function(_0x515caf,_0x2c408e){return db['ChatGroup'][_0xf793('0x42')]({'where':{'id':_0x515caf[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x2c408e,null))[_0xf793('0x22')](removeEntity(_0x2c408e,null))[_0xf793('0x43')](handleError(_0x2c408e,null));};exports[_0xf793('0x47')]=function(_0x316f20,_0x35e024){return db[_0xf793('0x27')]['describe']()[_0xf793('0x22')](respondWithResult(_0x35e024,null))[_0xf793('0x43')](handleError(_0x35e024,null));};exports[_0xf793('0x48')]=function(_0x5d9a42,_0x31aecf,_0x495379){return db[_0xf793('0x49')]['count']({'where':{'ChatGroupId':_0x5d9a42[_0xf793('0x3e')]['id'],'ToId':_0x5d9a42[_0xf793('0x4a')]['id'],'read':![]}})[_0xf793('0x22')](function(_0x5eb283){return{'id':_[_0xf793('0x4b')](_0x5d9a42[_0xf793('0x3e')]['id']),'count':_0x5eb283};})[_0xf793('0x22')](respondWithResult(_0x31aecf,null))[_0xf793('0x43')](handleError(_0x31aecf,null));};exports[_0xf793('0x4c')]=function(_0x101876,_0x333e54,_0x63b614){return db[_0xf793('0x27')]['find']({'where':{'id':_0x101876[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x333e54,null))[_0xf793('0x22')](function(_0x3d0e06){if(_0x3d0e06){return _0x3d0e06['addMembers'](_0x101876['body']['ids'],_[_0xf793('0x4d')](_0x101876['body'],[_0xf793('0x4e'),'id'])||{});}})[_0xf793('0x22')](respondWithResult(_0x333e54,null))[_0xf793('0x43')](handleError(_0x333e54,null));};exports[_0xf793('0x4f')]=function(_0x36a031,_0x4c5734,_0x43e446){var _0xeeacd9={};var _0x458774={};var _0x54de26;var _0x2c42f8;return db[_0xf793('0x27')][_0xf793('0x50')]({'where':{'id':_0x36a031[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x4c5734,null))[_0xf793('0x22')](function(_0x4585dd){if(_0x4585dd){_0x54de26=_0x4585dd;_0x458774[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x51')][_0xf793('0x28')]);_0x458774[_0xf793('0x2d')]=_['keys'](_0x36a031[_0xf793('0x2d')]);_0x458774[_0xf793('0x2f')]=_['intersection'](_0x458774['model'],_0x458774[_0xf793('0x2d')]);_0xeeacd9[_0xf793('0x30')]=_['intersection'](_0x458774[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x36a031[_0xf793('0x2d')]['fields']));_0xeeacd9['attributes']=_0xeeacd9[_0xf793('0x30')][_0xf793('0x40')]?_0xeeacd9[_0xf793('0x30')]:_0x458774[_0xf793('0x3f')];_0xeeacd9['order']=qs[_0xf793('0x34')](_0x36a031['query'][_0xf793('0x34')]);_0xeeacd9[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x36a031[_0xf793('0x2d')],_0x458774['filters']));if(_0x36a031[_0xf793('0x2d')]['filter']){_0xeeacd9['where']=_['merge'](_0xeeacd9[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0xeeacd9[_0xf793('0x30')],function(_0x1c7f76){var _0x50772c={};_0x50772c[_0x1c7f76]={'$like':'%'+_0x36a031[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x50772c;})});}_0xeeacd9=_[_0xf793('0x38')]({},_0xeeacd9,_0x36a031[_0xf793('0x3a')]);return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})[_0xf793('0x22')](function(_0x1266ed){if(_0x1266ed){_0x2c42f8=_0x1266ed[_0xf793('0x40')];if(!_0x36a031['query']['hasOwnProperty'](_0xf793('0x33'))){_0xeeacd9[_0xf793('0x1b')]=qs['limit'](_0x36a031[_0xf793('0x2d')][_0xf793('0x1b')]);_0xeeacd9[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x36a031[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})['then'](function(_0x1bc456){if(_0x1bc456){return _0x1bc456?{'count':_0x2c42f8,'rows':_0x1bc456}:null;}})[_0xf793('0x22')](respondWithResult(_0x4c5734,null))[_0xf793('0x43')](handleError(_0x4c5734,null));};exports[_0xf793('0x52')]=function(_0x2e9eb0,_0x2ccc6c,_0x28487b){return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2e9eb0[_0xf793('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ccc6c,null))['then'](function(_0x54def8){if(_0x54def8){return _0x54def8[_0xf793('0x52')](_0x2e9eb0['query']['ids']);}})[_0xf793('0x22')](respondWithStatusCode(_0x2ccc6c,null))[_0xf793('0x43')](handleError(_0x2ccc6c,null));};exports[_0xf793('0x53')]=function(_0x2adce5,_0x30bcc1,_0x342eae){if(_0x2adce5['body']['id']){delete _0x2adce5[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2adce5[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x30bcc1,null))[_0xf793('0x22')](function(_0x2ce0b5){if(_0x2ce0b5){_0x2adce5[_0xf793('0x45')][_0xf793('0x54')]=_0x2ce0b5['id'];return db[_0xf793('0x49')][_0xf793('0x44')](_0x2adce5[_0xf793('0x45')]);}})['then'](respondWithResult(_0x30bcc1,null))[_0xf793('0x43')](handleError(_0x30bcc1,null));};exports[_0xf793('0x55')]=function(_0x43f3ad,_0x522715,_0x55e392){var _0x52fb76={};var _0x1ff0bf={};var _0x3022b1;var _0x3ba91e;return db['ChatGroup'][_0xf793('0x50')]({'where':{'id':_0x43f3ad[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x522715,null))['then'](function(_0xe40850){if(_0xe40850){_0x3022b1=_0xe40850;_0x1ff0bf[_0xf793('0x3f')]=_['keys'](db[_0xf793('0x49')][_0xf793('0x28')]);_0x1ff0bf['query']=_[_0xf793('0x2e')](_0x43f3ad[_0xf793('0x2d')]);_0x1ff0bf['filters']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],_0x1ff0bf[_0xf793('0x2d')]);_0x52fb76['attributes']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x32')]));_0x52fb76[_0xf793('0x30')]=_0x52fb76['attributes'][_0xf793('0x40')]?_0x52fb76[_0xf793('0x30')]:_0x1ff0bf[_0xf793('0x3f')];_0x52fb76['order']=qs[_0xf793('0x34')](_0x43f3ad[_0xf793('0x2d')]['sort']);_0x52fb76[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x43f3ad[_0xf793('0x2d')],_0x1ff0bf[_0xf793('0x2f')]));if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x37')]){_0x52fb76['where']=_[_0xf793('0x38')](_0x52fb76['where'],{'$or':_[_0xf793('0x2c')](_0x52fb76[_0xf793('0x30')],function(_0x111f8a){var _0x1b9193={};_0x1b9193[_0x111f8a]={'$like':'%'+_0x43f3ad[_0xf793('0x2d')]['filter']+'%'};return _0x1b9193;})});}if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')]){var _0x3d1608=_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')][_0xf793('0x57')](',');var _0x37a9da={};_0x37a9da[_0x3d1608[0x0]]={'$gte':moment(_0x3d1608[0x1])[_0xf793('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x52fb76[_0xf793('0x35')]=_[_0xf793('0x38')](_0x52fb76[_0xf793('0x35')],_0x37a9da);}_0x52fb76=_['merge']({},_0x52fb76,_0x43f3ad[_0xf793('0x3a')]);return _0x3022b1['getMessages'](_0x52fb76);}})[_0xf793('0x22')](function(_0x1cbc07){if(_0x1cbc07){_0x3ba91e=_0x1cbc07[_0xf793('0x40')];if(!_0x43f3ad[_0xf793('0x2d')]['hasOwnProperty']('nolimit')){_0x52fb76[_0xf793('0x1b')]=qs['limit'](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x1b')]);_0x52fb76[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x3022b1[_0xf793('0x55')](_0x52fb76);}})[_0xf793('0x22')](function(_0x506d0b){if(_0x506d0b){return _0x506d0b?{'count':_0x3ba91e,'rows':_0x506d0b}:null;}})[_0xf793('0x22')](respondWithResult(_0x522715,null))['catch'](handleError(_0x522715,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 09f7de0..5f8204e 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 _0xa8be=['remove','emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x4eb4df,_0x49715b){var _0x13bbed=function(_0x5e46c1){while(--_0x5e46c1){_0x4eb4df['push'](_0x4eb4df['shift']());}};_0x13bbed(++_0x49715b);}(_0xa8be,0x9b));var _0xea8b=function(_0x174cd4,_0x1f2196){_0x174cd4=_0x174cd4-0x0;var _0x48d5b6=_0xa8be[_0x174cd4];return _0x48d5b6;};'use strict';var EventEmitter=require(_0xea8b('0x0'));var ChatGroup=require(_0xea8b('0x1'))['db'][_0xea8b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xea8b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea8b('0x4'),'afterDestroy':_0xea8b('0x5')};function emitEvent(_0x463f9f){return function(_0x3fba27,_0x1da649,_0x205514){ChatGroupEvents[_0xea8b('0x6')](_0x463f9f+':'+_0x3fba27['id'],_0x3fba27);ChatGroupEvents[_0xea8b('0x6')](_0x463f9f,_0x3fba27);_0x205514(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xea8b('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x6e12=['ChatGroup','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x6e12,0x1d4));var _0x26e1=function(_0x13a14b,_0x52d0e0){_0x13a14b=_0x13a14b-0x0;var _0x6c505b=_0x6e12[_0x13a14b];return _0x6c505b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x26e1('0x0'))['db'][_0x26e1('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26e1('0x2'),'afterUpdate':_0x26e1('0x3'),'afterDestroy':_0x26e1('0x4')};function emitEvent(_0x2d8a27){return function(_0x2dba5a,_0x4aca8e,_0x5c985b){ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27+':'+_0x2dba5a['id'],_0x2dba5a);ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27,_0x2dba5a);_0x5c985b(null);};}for(var e in events){if(events[_0x26e1('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c9d4345..3b6fb55 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 _0x40bc=['../../config/logger','moment','bluebird','request-promise','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x2257dc,_0x2c6f7b){var _0x440821=function(_0x1f67b6){while(--_0x1f67b6){_0x2257dc['push'](_0x2257dc['shift']());}};_0x440821(++_0x2c6f7b);}(_0x40bc,0xda));var _0xc40b=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x40bc[_0x1098db];return _0x14f090;};'use strict';var _=require(_0xc40b('0x0'));var util=require(_0xc40b('0x1'));var logger=require(_0xc40b('0x2'))('api');var moment=require(_0xc40b('0x3'));var BPromise=require(_0xc40b('0x4'));var rp=require(_0xc40b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xc40b('0x6')]=function(_0x3b9d4b,_0x19512f){return _0x3b9d4b[_0xc40b('0x7')](_0xc40b('0x8'),attributes,{'tableName':_0xc40b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb684=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','../../config/logger'];(function(_0x35588f,_0x43053e){var _0x5656e7=function(_0x473e4c){while(--_0x473e4c){_0x35588f['push'](_0x35588f['shift']());}};_0x5656e7(++_0x43053e);}(_0xb684,0x83));var _0x4b68=function(_0x553378,_0x1c2756){_0x553378=_0x553378-0x0;var _0x44caca=_0xb684[_0x553378];return _0x44caca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b68('0x0'))(_0x4b68('0x1'));var moment=require(_0x4b68('0x2'));var BPromise=require(_0x4b68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b68('0x4'));var rimraf=require(_0x4b68('0x5'));var config=require(_0x4b68('0x6'));var attributes=require(_0x4b68('0x7'));module[_0x4b68('0x8')]=function(_0x4d58b9,_0x1261d6){return _0x4d58b9['define'](_0x4b68('0x9'),attributes,{'tableName':_0x4b68('0xa'),'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 492427a..52f4a07 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 _0x4f82=['ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','stringify','error','code'];(function(_0xd4352b,_0x5e12d3){var _0x3126a4=function(_0x3599f9){while(--_0x3599f9){_0xd4352b['push'](_0xd4352b['shift']());}};_0x3126a4(++_0x5e12d3);}(_0x4f82,0xbc));var _0x24f8=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x4f82[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x24f8('0x0'));var util=require(_0x24f8('0x1'));var moment=require('moment');var BPromise=require(_0x24f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24f8('0x4'));var logger=require('../../config/logger')(_0x24f8('0x5'));var config=require(_0x24f8('0x6'));var jayson=require(_0x24f8('0x7'));var client=jayson[_0x24f8('0x8')]['http']({'port':0x232a});config[_0x24f8('0x9')]=_[_0x24f8('0xa')](config[_0x24f8('0x9')],{'host':_0x24f8('0xb'),'port':0x18eb});var socket=require(_0x24f8('0xc'))(new Redis(config[_0x24f8('0x9')]));require('./chatGroup.socket')[_0x24f8('0xd')](socket);function respondWithRpcPromise(_0x2b1417,_0x2d15f1,_0x302c5a){return new BPromise(function(_0x4eba51,_0x2b735e){return client['request'](_0x2b1417,_0x302c5a)['then'](function(_0x4b4e82){logger[_0x24f8('0xe')]('ChatGroup,\x20%s,\x20%s',_0x2d15f1,_0x24f8('0xf'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2d15f1,_0x24f8('0xf'),JSON[_0x24f8('0x10')](_0x4b4e82));if(_0x4b4e82[_0x24f8('0x11')]){if(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x12')]===0x1f4){logger[_0x24f8('0x11')](_0x24f8('0x13'),_0x2d15f1,_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);return _0x2b735e(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);}logger['error'](_0x24f8('0x13'),_0x2d15f1,_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);return _0x4eba51(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);}else{logger[_0x24f8('0xe')](_0x24f8('0x13'),_0x2d15f1,_0x24f8('0xf'));_0x4eba51(_0x4b4e82[_0x24f8('0x15')][_0x24f8('0x14')]);}})[_0x24f8('0x16')](function(_0x244af5){logger['error'](_0x24f8('0x13'),_0x2d15f1,_0x244af5);_0x2b735e(_0x244af5);});});}
\ No newline at end of file
+var _0xb56f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xd76732,_0x5f4e32){var _0x342534=function(_0x10c3cb){while(--_0x10c3cb){_0xd76732['push'](_0xd76732['shift']());}};_0x342534(++_0x5f4e32);}(_0xb56f,0x113));var _0xfb56=function(_0x4aec74,_0xbecf13){_0x4aec74=_0x4aec74-0x0;var _0x19cf6d=_0xb56f[_0x4aec74];return _0x19cf6d;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require(_0xfb56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb56('0x3'));var fs=require('fs');var Redis=require(_0xfb56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))('rpc');var config=require(_0xfb56('0x7'));var jayson=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232a});config[_0xfb56('0xb')]=_[_0xfb56('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb56('0xd'))(new Redis(config[_0xfb56('0xb')]));require(_0xfb56('0xe'))[_0xfb56('0xf')](socket);function respondWithRpcPromise(_0x311b0e,_0x3a168f,_0x134442){return new BPromise(function(_0x5e49b3,_0x5db511){return client['request'](_0x311b0e,_0x134442)[_0xfb56('0x10')](function(_0x537d40){logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));logger[_0xfb56('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a168f,_0xfb56('0x13'),JSON[_0xfb56('0x15')](_0x537d40));if(_0x537d40[_0xfb56('0x16')]){if(_0x537d40['error'][_0xfb56('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5db511(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}logger[_0xfb56('0x16')](_0xfb56('0x12'),_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5e49b3(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}else{logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));_0x5e49b3(_0x537d40[_0xfb56('0x19')][_0xfb56('0x18')]);}})[_0xfb56('0x1a')](function(_0x586436){logger['error'](_0xfb56('0x12'),_0x3a168f,_0x586436);_0x5db511(_0x586436);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 725b0e3..56bf1ac 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 _0x2451=['emit','removeListener','register','./chatGroup.events','save','remove','update'];(function(_0x220928,_0x5511a5){var _0x42f8fe=function(_0x2c7bec){while(--_0x2c7bec){_0x220928['push'](_0x220928['shift']());}};_0x42f8fe(++_0x5511a5);}(_0x2451,0x8f));var _0x1245=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x2451[_0x3cb3ca];return _0x214366;};'use strict';var ChatGroupEvents=require(_0x1245('0x0'));var events=[_0x1245('0x1'),_0x1245('0x2'),_0x1245('0x3')];function createListener(_0x20d3c1,_0x9eb573){return function(_0x55fc24){_0x9eb573[_0x1245('0x4')](_0x20d3c1,_0x55fc24);};}function removeListener(_0x38ab35,_0x45f412){return function(){ChatGroupEvents[_0x1245('0x5')](_0x38ab35,_0x45f412);};}exports[_0x1245('0x6')]=function(_0x1899ff){for(var _0x27a5a6=0x0,_0x5597b1=events['length'];_0x27a5a6<_0x5597b1;_0x27a5a6++){var _0x11b1b9=events[_0x27a5a6];var _0x596b38=createListener('chatGroup:'+_0x11b1b9,_0x1899ff);ChatGroupEvents['on'](_0x11b1b9,_0x596b38);}};
\ No newline at end of file
+var _0x9f74=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x9f74,0x163));var _0x49f7=function(_0xa3ec8e,_0x35f872){_0xa3ec8e=_0xa3ec8e-0x0;var _0x388a9c=_0x9f74[_0xa3ec8e];return _0x388a9c;};'use strict';var ChatGroupEvents=require(_0x49f7('0x0'));var events=[_0x49f7('0x1'),_0x49f7('0x2'),'update'];function createListener(_0x3baaa0,_0x4f94d0){return function(_0x947981){_0x4f94d0[_0x49f7('0x3')](_0x3baaa0,_0x947981);};}function removeListener(_0x4f3a07,_0xb6f3d0){return function(){ChatGroupEvents[_0x49f7('0x4')](_0x4f3a07,_0xb6f3d0);};}exports[_0x49f7('0x5')]=function(_0x2b9c50){for(var _0x2f59de=0x0,_0xb97a18=events[_0x49f7('0x6')];_0x2f59de<_0xb97a18;_0x2f59de++){var _0x2e627d=events[_0x2f59de];var _0x592dbd=createListener(_0x49f7('0x7')+_0x2e627d,_0x2b9c50);ChatGroupEvents['on'](_0x2e627d,_0x592dbd);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index a171ec5..96f4f7a 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 _0xb951=['addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMembers'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb951,0x7b));var _0x1b95=function(_0x225e86,_0x36d4c5){_0x225e86=_0x225e86-0x0;var _0x4d72c6=_0xb951[_0x225e86];return _0x4d72c6;};'use strict';var multer=require(_0x1b95('0x0'));var util=require(_0x1b95('0x1'));var path=require(_0x1b95('0x2'));var timeout=require(_0x1b95('0x3'));var express=require(_0x1b95('0x4'));var router=express[_0x1b95('0x5')]();var fs_extra=require(_0x1b95('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1b95('0x7'));var config=require(_0x1b95('0x8'));var controller=require(_0x1b95('0x9'));router[_0x1b95('0xa')]('/',auth[_0x1b95('0xb')](),controller['index']);router[_0x1b95('0xa')](_0x1b95('0xc'),auth['isAuthenticated'](),controller[_0x1b95('0xd')]);router[_0x1b95('0xa')](_0x1b95('0xe'),auth[_0x1b95('0xb')](),controller[_0x1b95('0xf')]);router[_0x1b95('0xa')](_0x1b95('0x10'),auth[_0x1b95('0xb')](),controller['getUnread']);router[_0x1b95('0xa')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x12')]);router[_0x1b95('0xa')](_0x1b95('0x13'),auth[_0x1b95('0xb')](),controller['getMessages']);router[_0x1b95('0x14')]('/',auth[_0x1b95('0xb')](),controller['create']);router[_0x1b95('0x14')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x15')]);router[_0x1b95('0x14')](_0x1b95('0x13'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x16')]);router[_0x1b95('0x17')](_0x1b95('0xe'),auth['isAuthenticated'](),controller[_0x1b95('0x18')]);router[_0x1b95('0x19')](_0x1b95('0xe'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x1a')]);router[_0x1b95('0x19')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x1b')]);module[_0x1b95('0x1c')]=router;
\ No newline at end of file
+var _0xe02a=['get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMembers','getMessages','create','addMembers','post','addMessage','put','/:id','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x308351,_0x184653){var _0x2def07=function(_0x2a30a4){while(--_0x2a30a4){_0x308351['push'](_0x308351['shift']());}};_0x2def07(++_0x184653);}(_0xe02a,0x1dd));var _0xae02=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe02a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var path=require(_0xae02('0x2'));var timeout=require('connect-timeout');var express=require(_0xae02('0x3'));var router=express[_0xae02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae02('0x5'));var interaction=require(_0xae02('0x6'));var config=require(_0xae02('0x7'));var controller=require(_0xae02('0x8'));router[_0xae02('0x9')]('/',auth[_0xae02('0xa')](),controller[_0xae02('0xb')]);router[_0xae02('0x9')](_0xae02('0xc'),auth['isAuthenticated'](),controller[_0xae02('0xd')]);router[_0xae02('0x9')]('/:id',auth[_0xae02('0xa')](),controller[_0xae02('0xe')]);router[_0xae02('0x9')](_0xae02('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0xae02('0x9')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller[_0xae02('0x11')]);router[_0xae02('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae02('0x12')]);router['post']('/',auth[_0xae02('0xa')](),controller[_0xae02('0x13')]);router['post'](_0xae02('0x10'),auth['isAuthenticated'](),controller[_0xae02('0x14')]);router[_0xae02('0x15')]('/:id/messages',auth[_0xae02('0xa')](),controller[_0xae02('0x16')]);router[_0xae02('0x17')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller['update']);router[_0xae02('0x19')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller[_0xae02('0x1a')]);router[_0xae02('0x19')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e47a239..4d8e48f 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 _0x9465=['DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0x9465,0x88));var _0x5946=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x9465[_0x1b6563];return _0xdea7b8;};'use strict';var Sequelize=require(_0x5946('0x0'));module[_0x5946('0x1')]={'closed':{'type':Sequelize[_0x5946('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5946('0x3')]},'ratingType':{'type':Sequelize[_0x5946('0x4')](_0x5946('0x5'),_0x5946('0x6')),'defaultValue':_0x5946('0x5')},'ratingMessage':{'type':Sequelize[_0x5946('0x7')]},'pathTranscript':{'type':Sequelize[_0x5946('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5946('0x8')]},'disposition':{'type':Sequelize[_0x5946('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5946('0x9')]},'note':{'type':Sequelize[_0x5946('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5946('0x9')]},'osName':{'type':Sequelize[_0x5946('0x9')]},'osVersion':{'type':Sequelize[_0x5946('0x9')]},'deviceModel':{'type':Sequelize[_0x5946('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x5946('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5946('0x9')]},'formData':{'type':Sequelize['TEXT'](_0x5946('0xa'))},'read1stAt':{'type':Sequelize[_0x5946('0x8')]},'lastMsgAt':{'type':Sequelize[_0x5946('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x5946('0x4')]('in',_0x5946('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5946('0x9')]},'customerPort':{'type':Sequelize[_0x5946('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x80f6=['TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x80f6,0x66));var _0x680f=function(_0x1f1a8e,_0x5f09d0){_0x1f1a8e=_0x1f1a8e-0x0;var _0x5b28a0=_0x80f6[_0x1f1a8e];return _0x5b28a0;};'use strict';var Sequelize=require(_0x680f('0x0'));module[_0x680f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x680f('0x2')]},'ratingType':{'type':Sequelize[_0x680f('0x3')](_0x680f('0x4'),_0x680f('0x5')),'defaultValue':_0x680f('0x4')},'ratingMessage':{'type':Sequelize[_0x680f('0x6')]},'pathTranscript':{'type':Sequelize[_0x680f('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x680f('0x7')]},'disposition':{'type':Sequelize[_0x680f('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x680f('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x680f('0x8')]},'browserVersion':{'type':Sequelize[_0x680f('0x8')]},'osName':{'type':Sequelize[_0x680f('0x8')]},'osVersion':{'type':Sequelize[_0x680f('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x680f('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x680f('0x6')]},'customerIp':{'type':Sequelize[_0x680f('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x680f('0x9'))},'read1stAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x680f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x680f('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x680f('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x680f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f50c7d2..b8cc09c 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 _0xe8ac=['update','destroy','end','stack','name','send','body','contact','agent','interaction','account','index','map','rawAttributes','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','format','agentIdentifier','website_alias','%s%d','agentAlias','agent_alias','fullname','System','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','order','includeAgent','push','alias','setTags','Tag','color','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','createdAt','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','limit','count','offset'];(function(_0x2fe81c,_0x47463a){var _0x120bf4=function(_0x2eb5f4){while(--_0x2eb5f4){_0x2fe81c['push'](_0x2fe81c['shift']());}};_0x120bf4(++_0x47463a);}(_0xe8ac,0x17f));var _0xce8a=function(_0x3dd8c7,_0x487c5c){_0x3dd8c7=_0x3dd8c7-0x0;var _0x4b7788=_0xe8ac[_0x3dd8c7];return _0x4b7788;};'use strict';var rimraf=require(_0xce8a('0x0'));var zipdir=require(_0xce8a('0x1'));var rp=require(_0xce8a('0x2'));var moment=require(_0xce8a('0x3'));var BPromise=require(_0xce8a('0x4'));var Mustache=require('mustache');var util=require(_0xce8a('0x5'));var path=require(_0xce8a('0x6'));var ejs=require(_0xce8a('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xce8a('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xce8a('0x9'));var logger=require(_0xce8a('0xa'))(_0xce8a('0xb'));var config=require(_0xce8a('0xc'));var db=require(_0xce8a('0xd'))['db'];config[_0xce8a('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xce8a('0xf'))(new Redis(config['redis']));require(_0xce8a('0x10'))[_0xce8a('0x11')](socket);var jayson=require(_0xce8a('0x12'));var client=jayson[_0xce8a('0x13')][_0xce8a('0x14')]({'port':0x232b});var client9004=jayson[_0xce8a('0x13')][_0xce8a('0x14')]({'port':0x232c});function respondWithRpcPromise(_0xa26d3f,_0xbdfef3,_0x26af7a,_0x20592c){return new BPromise(function(_0x331ab0,_0x303f41){var _0x5ef494=_0x20592c||client;return _0x5ef494[_0xce8a('0x15')](_0xa26d3f,_0x26af7a)[_0xce8a('0x16')](function(_0x2f822e){logger[_0xce8a('0x17')](_0xce8a('0x18'),_0xbdfef3,_0xce8a('0x19'));logger[_0xce8a('0x1a')](_0xce8a('0x1b'),_0xbdfef3,_0xce8a('0x19'),JSON[_0xce8a('0x1c')](_0x2f822e));if(_0x2f822e[_0xce8a('0x1d')]){if(_0x2f822e['error'][_0xce8a('0x1e')]===0x1f4){logger[_0xce8a('0x1d')](_0xce8a('0x18'),_0xbdfef3,_0x2f822e[_0xce8a('0x1d')][_0xce8a('0x1f')]);return _0x303f41(_0x2f822e['error'][_0xce8a('0x1f')]);}logger[_0xce8a('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0xbdfef3,_0x2f822e['error'][_0xce8a('0x1f')]);return _0x331ab0(_0x2f822e[_0xce8a('0x1d')]['message']);}else{logger[_0xce8a('0x17')](_0xce8a('0x18'),_0xbdfef3,'request\x20sent');_0x331ab0(_0x2f822e[_0xce8a('0x20')][_0xce8a('0x1f')]);}})['catch'](function(_0x18f0e8){logger[_0xce8a('0x1d')](_0xce8a('0x18'),_0xbdfef3,_0x18f0e8);_0x303f41(_0x18f0e8);});});}function respondWithStatusCode(_0x1ec911,_0x24d533){_0x24d533=_0x24d533||0xcc;return function(_0x548c4a){if(_0x548c4a){return _0x1ec911['sendStatus'](_0x24d533);}return _0x1ec911[_0xce8a('0x21')](_0x24d533)['end']();};}function respondWithResult(_0x4dc282,_0x23bf72){_0x23bf72=_0x23bf72||0xc8;return function(_0x2859cf){if(_0x2859cf){return _0x4dc282['status'](_0x23bf72)[_0xce8a('0x22')](_0x2859cf);}};}function respondWithFilteredResult(_0x1c2bc9,_0x35156e){return function(_0x1fca40){if(_0x1fca40){var _0x1eebe3=typeof _0x35156e['offset']===_0xce8a('0x23')&&typeof _0x35156e[_0xce8a('0x24')]===_0xce8a('0x23');var _0x2cf954=_0x1fca40[_0xce8a('0x25')];var _0x55f759=_0x1eebe3?0x0:_0x35156e[_0xce8a('0x26')];var _0x567b9b=_0x1eebe3?_0x1fca40[_0xce8a('0x25')]:_0x35156e[_0xce8a('0x26')]+_0x35156e[_0xce8a('0x24')];var _0x2d419c;if(_0x567b9b>=_0x2cf954){_0x567b9b=_0x2cf954;_0x2d419c=0xc8;}else{_0x2d419c=0xce;}_0x1c2bc9['status'](_0x2d419c);return _0x1c2bc9['set']('Content-Range',_0x55f759+'-'+_0x567b9b+'/'+_0x2cf954)[_0xce8a('0x22')](_0x1fca40);}return null;};}function saveUpdates(_0x22b237){return function(_0xf724ea){if(_0xf724ea){return _0xf724ea[_0xce8a('0x27')](_0x22b237)[_0xce8a('0x16')](function(_0x42c8d2){return _0x42c8d2;});}return null;};}function removeEntity(_0x980eb5){return function(_0x219078){if(_0x219078){return _0x219078[_0xce8a('0x28')]()[_0xce8a('0x16')](function(){_0x980eb5[_0xce8a('0x21')](0xcc)[_0xce8a('0x29')]();});}};}function handleEntityNotFound(_0x51ed9f){return function(_0x4f0cd3){if(!_0x4f0cd3){_0x51ed9f['sendStatus'](0x194);}return _0x4f0cd3;};}function handleError(_0x57738f,_0x5b7398){_0x5b7398=_0x5b7398||0x1f4;return function(_0x463ed9){logger[_0xce8a('0x1d')](_0x463ed9[_0xce8a('0x2a')]);if(_0x463ed9['name']){delete _0x463ed9[_0xce8a('0x2b')];}_0x57738f['status'](_0x5b7398)[_0xce8a('0x2c')](_0x463ed9);};}function getMustacheRender(_0x3a91d9,_0x428272){return Mustache['render'](_0x3a91d9,_['merge'](_0x428272[_0xce8a('0x2d')],{'contact':_0x428272[_0xce8a('0x2e')],'message':_0x428272[_0xce8a('0x1f')],'agent':_0x428272[_0xce8a('0x2f')],'interaction':_0x428272[_0xce8a('0x30')],'account':_0x428272[_0xce8a('0x31')]}))||'';}exports[_0xce8a('0x32')]=function(_0x2348fa,_0x2044ee){var _0x2b6725={};var _0x3095aa=_[_0xce8a('0x33')](db['ChatInteraction'][_0xce8a('0x34')],function(_0x1be212){return{'name':_0x1be212['fieldName'],'type':_0x1be212['type'][_0xce8a('0x35')]};});_0x2b6725=qs[_0xce8a('0x36')](_0x3095aa,_0x2348fa);return interaction[_0xce8a('0x37')](_0xce8a('0x38'),_0x2348fa[_0xce8a('0x39')],_0x2348fa[_0xce8a('0x3a')],_0x2b6725,_0x3095aa)['then'](respondWithFilteredResult(_0x2044ee,_0x2b6725))['catch'](handleError(_0x2044ee,null));};exports[_0xce8a('0x3b')]=function(_0x1a2dbf,_0x284d2e){var _0x920dd0={'raw':![],'where':{'id':_0x1a2dbf[_0xce8a('0x3c')]['id']}},_0x1b0d62={};_0x1b0d62[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db[_0xce8a('0x3f')][_0xce8a('0x34')]);_0x1b0d62['query']=_[_0xce8a('0x3e')](_0x1a2dbf[_0xce8a('0x39')]);_0x1b0d62['filters']=_['intersection'](_0x1b0d62['model'],_0x1b0d62[_0xce8a('0x39')]);_0x920dd0[_0xce8a('0x40')]=_[_0xce8a('0x41')](_0x1b0d62[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x1a2dbf['query']['fields']));_0x920dd0[_0xce8a('0x40')]=_0x920dd0[_0xce8a('0x40')][_0xce8a('0x43')]?_0x920dd0[_0xce8a('0x40')]:_0x1b0d62[_0xce8a('0x3d')];if(_0x1a2dbf[_0xce8a('0x39')][_0xce8a('0x44')]){_0x920dd0[_0xce8a('0x45')]=[{'all':!![]}];}_0x920dd0=_[_0xce8a('0x46')]({},_0x920dd0,_0x1a2dbf[_0xce8a('0x47')]);return db[_0xce8a('0x3f')][_0xce8a('0x48')](_0x920dd0)[_0xce8a('0x16')](handleEntityNotFound(_0x284d2e,null))[_0xce8a('0x16')](respondWithResult(_0x284d2e,null))[_0xce8a('0x49')](handleError(_0x284d2e,null));};exports['create']=function(_0x5716fa,_0x5665de){return db[_0xce8a('0x3f')][_0xce8a('0x4a')](_0x5716fa[_0xce8a('0x2d')],{})[_0xce8a('0x16')](respondWithResult(_0x5665de,0xc9))['catch'](handleError(_0x5665de,null));};exports[_0xce8a('0x27')]=function(_0x47c6b5,_0x4843e7){if(_0x47c6b5[_0xce8a('0x2d')]['id']){delete _0x47c6b5[_0xce8a('0x2d')]['id'];}return db[_0xce8a('0x3f')]['find']({'where':{'id':_0x47c6b5[_0xce8a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4843e7,null))[_0xce8a('0x16')](saveUpdates(_0x47c6b5['body'],null))[_0xce8a('0x16')](respondWithResult(_0x4843e7,null))[_0xce8a('0x49')](handleError(_0x4843e7,null));};exports['destroy']=function(_0x5745e4,_0x2f799c){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x5745e4[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x2f799c,null))['then'](removeEntity(_0x2f799c,null))[_0xce8a('0x49')](handleError(_0x2f799c,null));};exports[_0xce8a('0x4b')]=function(_0x24868b,_0x19a79c){return db['ChatInteraction'][_0xce8a('0x4b')]()[_0xce8a('0x16')](respondWithResult(_0x19a79c,null))[_0xce8a('0x49')](handleError(_0x19a79c,null));};exports[_0xce8a('0x4c')]=function(_0x51763f,_0x4f7eaf){var _0x448f68=_0x51763f[_0xce8a('0x3c')]['id'];var _0x30e6c3;var _0x5d0f18;var _0x2f585b;return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x448f68}})[_0xce8a('0x16')](function(_0x29c341){_0x30e6c3=_0x29c341;return db[_0xce8a('0x4e')][_0xce8a('0x4d')]({'where':{'id':_0x29c341['ChatWebsiteId']},'attributes':['id',_0xce8a('0x4f'),_0xce8a('0x50'),_0xce8a('0x51'),_0xce8a('0x52'),_0xce8a('0x53')],'raw':!![]});})[_0xce8a('0x16')](function(_0x3f7dd6){if(_0x3f7dd6&&_0x3f7dd6[_0xce8a('0x4f')]&&_0x3f7dd6[_0xce8a('0x50')]){_0x5d0f18=_0x3f7dd6;var _0x32e63={'interaction':{'id':_0x448f68},'agent':{'id':_0x51763f[_0xce8a('0x3a')]['id'],'name':_0x51763f['user']['name'],'fullname':_0x51763f['user']['fullname'],'email':_0x51763f['user']['email']},'contact':_0x51763f['body'][_0xce8a('0x2e')],'account':_0x51763f[_0xce8a('0x2d')][_0xce8a('0x31')]};var _0x306d9b={'rejectUnauthorized':![],'method':_0xce8a('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3f7dd6['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51763f[_0xce8a('0x3a')][_0xce8a('0x55')]],'buttons':null,'topic':_0x5d0f18[_0xce8a('0x51')],'note':_['isNull'](_0x5d0f18[_0xce8a('0x52')])?null:getMustacheRender(_0x5d0f18['vidaooNote'],_0x32e63),'metadata':null},'redirect':_0xce8a('0x56'),'json':!![]};try{if(!_[_0xce8a('0x57')](_0x5d0f18['vidaooMetadata'])){var _0x144fbb=getMustacheRender(_0x5d0f18['vidaooMetadata'],_0x32e63);var _0x3d4053=JSON['parse'](_0x144fbb);_0x306d9b['body'][_0xce8a('0x58')]=_0x3d4053;}}catch(_0xb36072){throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x306d9b);}else{throw new db[(_0xce8a('0x59'))]['ValidationError'](_0xce8a('0x5b'));}})['then'](function(_0x171a38){_0x2f585b=_0x171a38;if(_0x2f585b['id']){var _0x345046={'body':_0x2f585b[_0xce8a('0x5c')],'ChatWebsiteId':_0x5d0f18['id'],'ChatInteractionId':_0x30e6c3['id'],'direction':_0xce8a('0x5d'),'UserId':_0x51763f['user']['id']};return db[_0xce8a('0x5e')][_0xce8a('0x4a')](_0x345046,{});}else{throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))](_0xce8a('0x5f'));}})[_0xce8a('0x16')](function(){return _0x30e6c3[_0xce8a('0x60')]({'vidaooSessionId':_0x2f585b['id']});})[_0xce8a('0x16')](respondWithResult(_0x4f7eaf,null))['catch'](handleError(_0x4f7eaf,null));};exports[_0xce8a('0x61')]=function(_0x28ce7f,_0x32071a){if(_0x28ce7f[_0xce8a('0x2d')]['id']){delete _0x28ce7f['body']['id'];}return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x28ce7f[_0xce8a('0x3c')]['id']},'include':[{'model':db[_0xce8a('0x62')],'as':'Contact'}]})[_0xce8a('0x16')](handleEntityNotFound(_0x32071a,null))['then'](saveUpdates(_0x28ce7f['body'],null))[_0xce8a('0x16')](respondWithResult(_0x32071a,null))['catch'](handleError(_0x32071a,null));};exports[_0xce8a('0x63')]=function(_0xdf54d3,_0x434a9b){if(_0xdf54d3[_0xce8a('0x2d')]['id']){delete _0xdf54d3[_0xce8a('0x2d')]['id'];}return db['ChatInteraction'][_0xce8a('0x48')]({'where':{'id':_0xdf54d3[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](function(_0x2ef8ae){if(!_0x2ef8ae){logger[_0xce8a('0x1d')](_0xce8a('0x64'),'abandon',0x194,_0xce8a('0x65'));_0x434a9b[_0xce8a('0x66')](0x194);}else{if(_0x2ef8ae[_0xce8a('0x67')]){throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))](_0xce8a('0x68'));}}return _0x2ef8ae;})[_0xce8a('0x16')](function(_0x439d46){if(_0x439d46){return _0x439d46['update']({'closed':_0xdf54d3[_0xce8a('0x2d')][_0xce8a('0x69')],'disposition':_0xdf54d3['body']['disposition']})[_0xce8a('0x16')](function(_0x4b52aa){return _0x4b52aa;});}})['then'](function(){return respondWithRpcPromise(_0xce8a('0x6a'),_0xce8a('0x63'),_0xdf54d3[_0xce8a('0x2d')],client9004);})[_0xce8a('0x16')](respondWithResult(_0x434a9b,null))['catch'](handleError(_0x434a9b,null));};exports[_0xce8a('0x6b')]=function(_0x46eeae,_0x12945a){_0x46eeae[_0xce8a('0x2d')][_0xce8a('0x2b')]=_0x46eeae['file'][_0xce8a('0x6c')];_0x46eeae[_0xce8a('0x2d')][_0xce8a('0x6d')]=_0x46eeae[_0xce8a('0x6e')][_0xce8a('0x6f')];_0x46eeae[_0xce8a('0x2d')]['type']=_0x46eeae[_0xce8a('0x6e')][_0xce8a('0x70')];return db[_0xce8a('0x71')][_0xce8a('0x4a')](_0x46eeae[_0xce8a('0x2d')])['then'](respondWithResult(_0x12945a,0xc9))[_0xce8a('0x49')](handleError(_0x12945a,null));};exports[_0xce8a('0x72')]=function(_0x540ce9,_0x45c224){return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x540ce9['params']['id']},'raw':!![]})[_0xce8a('0x16')](handleEntityNotFound(_0x45c224,null))[_0xce8a('0x16')](function(_0x53e056){if(_0x53e056){if(_0x53e056['closed']){return _0x45c224[_0xce8a('0x21')](0x193)['json']({'status':0x193,'message':_0xce8a('0x73')});}return db[_0xce8a('0x71')][_0xce8a('0x4d')]({'where':{'id':_0x540ce9[_0xce8a('0x39')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x45c224,null));}})[_0xce8a('0x16')](function(_0x476fe1){if(_0x476fe1){var _0x2647f0=_0x476fe1[_0xce8a('0x74')]!==null;var _0x303c4b=path[_0xce8a('0x75')](config[_0xce8a('0x76')],_0xce8a('0x77'));if(_0x2647f0){_0x303c4b=path[_0xce8a('0x75')](_0x303c4b,_0xce8a('0x78'));}var _0x2ed522=path[_0xce8a('0x75')](_0x303c4b,_0x476fe1[_0xce8a('0x6d')]);return _0x45c224[_0xce8a('0x79')](_0x2ed522);}})[_0xce8a('0x49')](handleError(_0x45c224,null));};exports[_0xce8a('0x7a')]=function(_0x49fead,_0x3cd97f){var _0x52e827=null;var _0x59fd95=null;var _0x182f87=null;if(_0x49fead[_0xce8a('0x2d')]['id']){delete _0x49fead[_0xce8a('0x2d')]['id'];}if(_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')]){_0x182f87=path[_0xce8a('0x75')](config[_0xce8a('0x76')],_0xce8a('0x7c'),util['format'](_0xce8a('0x7d'),Date[_0xce8a('0x7e')]()));_0x49fead['body'][_0xce8a('0x7f')]=_0x182f87;}return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x49fead['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xce8a('0x80'),'include':[{'model':db[_0xce8a('0x81')],'as':_0xce8a('0x81')}]}]})['then'](handleEntityNotFound(_0x3cd97f,null))[_0xce8a('0x16')](saveUpdates(_0x49fead[_0xce8a('0x2d')],null))[_0xce8a('0x16')](function(_0x2bd406){if(_0x2bd406){_0x52e827=_0x2bd406;return db[_0xce8a('0x4e')][_0xce8a('0x48')]({'where':{'id':_0x52e827[_0xce8a('0x82')]}});}})['then'](function(_0x40b332){if(_0x40b332){_0x59fd95=_0x40b332;return db[_0xce8a('0x62')][_0xce8a('0x48')]({'where':{'id':_0x52e827[_0xce8a('0x83')]}});}})[_0xce8a('0x16')](function(_0x25aad1){if(_0x25aad1){if(_0x182f87){var _0x1f37e4=null;for(var _0x43de1e=0x1;_0x43de1e<_0x52e827[_0xce8a('0x80')][_0xce8a('0x43')];++_0x43de1e){_0x1f37e4=_0x52e827[_0xce8a('0x80')][_0x43de1e];var _0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util[_0xce8a('0x84')]('%s%d',_0x59fd95['agentAlias'],_0x1f37e4[_0xce8a('0x67')]):'System';var _0x37cc54=_0x49fead[_0xce8a('0x2d')]['customer']||util[_0xce8a('0x84')]('%s%d','Visitor',_0x1f37e4[_0xce8a('0x83')]);switch(_0x59fd95[_0xce8a('0x85')]){case _0xce8a('0x86'):_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util['format'](_0xce8a('0x87'),_0x59fd95[_0xce8a('0x88')],_0x1f37e4[_0xce8a('0x67')]):'System';break;case _0xce8a('0x89'):_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?_0x1f37e4['User']['alias']||_0x1f37e4[_0xce8a('0x81')][_0xce8a('0x8a')]:'System';break;case'agent_fullname':_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?_0x1f37e4[_0xce8a('0x81')]['fullname']:'System';break;default:_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util[_0xce8a('0x84')](_0xce8a('0x87'),_0x59fd95[_0xce8a('0x88')],_0x1f37e4[_0xce8a('0x67')]):_0xce8a('0x8b');}var _0x1695d0=util[_0xce8a('0x84')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f37e4['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x1f37e4[_0xce8a('0x8c')]==='in'?_0x37cc54:_0x21ee17,_0x1f37e4[_0xce8a('0x2d')]);if(!_0x1f37e4[_0xce8a('0x8d')]){fs[_0xce8a('0x8e')](_0x182f87,_0x1695d0);}}return db['MailAccount'][_0xce8a('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0xce8a('0x8f')],'as':_0xce8a('0x90'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xce8a('0x91'),'raw':!![]}]}]});}}})[_0xce8a('0x16')](function(_0x283f52){if(!_0x283f52||!_0x283f52[_0xce8a('0x90')]||!_0x49fead[_0xce8a('0x2d')])return _0x52e827;var _0x4d097c=_0x283f52[_0xce8a('0x92')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x4d097c,'message':{'from':util['format'](_0xce8a('0x93'),_0x283f52[_0xce8a('0x2b')],_0x283f52[_0xce8a('0x55')]||_0x283f52[_0xce8a('0x90')][_0xce8a('0x3a')]),'to':_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')],'subject':'Mail\x20Transcript','text':util[_0xce8a('0x84')](_0xce8a('0x94'),_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')]),'attachments':[{'path':_0x182f87}]}})[_0xce8a('0x16')](function(){return _0x52e827;})[_0xce8a('0x49')](function(_0x4c27ca){logger[_0xce8a('0x1d')](_0x4c27ca);});})['then'](respondWithStatusCode(_0x3cd97f,0xc8))['catch'](handleError(_0x3cd97f,null));};exports['addMessage']=function(_0x4a8b43,_0x14ad30){return db[_0xce8a('0x5e')][_0xce8a('0x48')]({'where':{'id':_0x4a8b43[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x14ad30,null))[_0xce8a('0x16')](function(_0x5367c1){if(_0x5367c1){return _0x5367c1[_0xce8a('0x95')](_0x4a8b43[_0xce8a('0x2d')][_0xce8a('0x96')],_[_0xce8a('0x97')](_0x4a8b43[_0xce8a('0x2d')],[_0xce8a('0x96'),'id'])||{});}})[_0xce8a('0x16')](respondWithResult(_0x14ad30,null))['catch'](handleError(_0x14ad30,null));};exports[_0xce8a('0x98')]=function(_0x59eb86,_0x341062){var _0x3463f7={'raw':![],'where':{}};var _0x891358={};var _0x35f290={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x59eb86[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x341062,null))[_0xce8a('0x16')](function(_0x5619a9){if(_0x5619a9){_0x891358[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db[_0xce8a('0x5e')][_0xce8a('0x34')]);_0x891358['query']=_['keys'](_0x59eb86[_0xce8a('0x39')]);_0x891358[_0xce8a('0x99')]=_[_0xce8a('0x41')](_0x891358[_0xce8a('0x3d')],_0x891358['query']);_0x3463f7[_0xce8a('0x40')]=_['intersection'](_0x891358[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x59eb86[_0xce8a('0x39')]['fields']));_0x3463f7[_0xce8a('0x40')]=_0x3463f7[_0xce8a('0x40')][_0xce8a('0x43')]?_0x3463f7['attributes']:_0x891358[_0xce8a('0x3d')];if(!_0x59eb86['query'][_0xce8a('0x9a')](_0xce8a('0x9b'))){_0x3463f7['limit']=qs[_0xce8a('0x24')](_0x59eb86['query']['limit']);_0x3463f7['offset']=qs[_0xce8a('0x26')](_0x59eb86[_0xce8a('0x39')][_0xce8a('0x26')]);}_0x3463f7['order']=qs[_0xce8a('0x9c')](_0x59eb86[_0xce8a('0x39')]['sort']);_0x3463f7[_0xce8a('0x9d')]=qs[_0xce8a('0x99')](_[_0xce8a('0x9e')](_0x59eb86['query'],_0x891358[_0xce8a('0x99')]));_0x3463f7[_0xce8a('0x9d')][_0xce8a('0x9f')]=_0x5619a9['id'];if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa0')]){_0x3463f7['where']=_[_0xce8a('0x46')](_0x3463f7['where'],{'$or':_['map'](_0x3463f7[_0xce8a('0x40')],function(_0x19d659){var _0x5ac5f4={};_0x5ac5f4[_0x19d659]={'$like':'%'+_0x59eb86['query'][_0xce8a('0xa0')]+'%'};return _0x5ac5f4;})});}if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa1')]){var _0x57baaa=_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa1')][_0xce8a('0xa2')](',');var _0x22752f={};_0x22752f[_0x57baaa[0x0]]={'$gte':moment(_0x57baaa[0x1])['format'](_0xce8a('0xa3'))};_0x3463f7[_0xce8a('0x9d')]=_[_0xce8a('0x46')](_0x3463f7[_0xce8a('0x9d')],_0x22752f);}_0x3463f7=_[_0xce8a('0x46')]({},_0x3463f7,_0x59eb86['options']);return db[_0xce8a('0x5e')][_0xce8a('0x25')]({'where':_0x3463f7[_0xce8a('0x9d')]})['then'](function(_0x11a96){_0x35f290[_0xce8a('0x25')]=_0x11a96;if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0x44')]){_0x3463f7[_0xce8a('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0xce8a('0x37')](_0x3463f7);})[_0xce8a('0x16')](function(_0x1c3e74){_0x35f290[_0xce8a('0xa4')]=_0x1c3e74;return _0x35f290;});}})[_0xce8a('0x16')](respondWithFilteredResult(_0x341062,_0x3463f7))[_0xce8a('0x49')](handleError(_0x341062,null));};exports[_0xce8a('0xa5')]=function(_0x502111,_0x2c6b45){var _0x54597b={'where':{}},_0x11504f={},_0x5253e9={'count':0x0,'rows':[]};return db[_0xce8a('0x3f')][_0xce8a('0x4d')]({'where':{'id':_0x502111[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x2c6b45,null))['then'](function(_0x1bbc62){if(_0x1bbc62){_0x11504f[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db['ChatMessage'][_0xce8a('0x34')]);_0x11504f[_0xce8a('0x39')]=_['keys'](_0x502111[_0xce8a('0x39')]);_0x11504f[_0xce8a('0x99')]=_[_0xce8a('0x41')](_0x11504f[_0xce8a('0x3d')],_0x11504f['query']);_0x54597b[_0xce8a('0x40')]=_[_0xce8a('0x41')](_0x11504f[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x502111[_0xce8a('0x39')][_0xce8a('0x42')]));_0x54597b['attributes']=_0x54597b['attributes'][_0xce8a('0x43')]?_0x54597b[_0xce8a('0x40')]:_0x11504f[_0xce8a('0x3d')];if(!_0x502111['query'][_0xce8a('0x9a')]('nolimit')){_0x54597b[_0xce8a('0x24')]=qs[_0xce8a('0x24')](_0x502111[_0xce8a('0x39')][_0xce8a('0x24')]);_0x54597b[_0xce8a('0x26')]=qs[_0xce8a('0x26')](_0x502111[_0xce8a('0x39')][_0xce8a('0x26')]);}_0x54597b[_0xce8a('0xa6')]=qs[_0xce8a('0x9c')](_0x502111[_0xce8a('0x39')][_0xce8a('0x9c')]);_0x54597b[_0xce8a('0x9d')]=qs[_0xce8a('0x99')](_['pick'](_0x502111[_0xce8a('0x39')],_0x11504f[_0xce8a('0x99')]));_0x54597b[_0xce8a('0x9d')]['ChatInteractionId']=_0x1bbc62['id'];if(_0x502111[_0xce8a('0x39')][_0xce8a('0xa0')]){_0x54597b[_0xce8a('0x9d')]=_[_0xce8a('0x46')](_0x54597b[_0xce8a('0x9d')],{'$or':_['map'](_0x54597b[_0xce8a('0x40')],function(_0x4dc83b){var _0x343cc4={};_0x343cc4[_0x4dc83b]={'$like':'%'+_0x502111[_0xce8a('0x39')][_0xce8a('0xa0')]+'%'};return _0x343cc4;})});}_0x54597b['where'][_0xce8a('0x8d')]=![];if(_0x502111[_0xce8a('0x39')]['id']){_0x54597b[_0xce8a('0x9d')]['id']={'$gt':_0x502111[_0xce8a('0x39')]['id']};}_0x54597b=_[_0xce8a('0x46')]({},_0x54597b,_0x502111[_0xce8a('0x47')]);return db[_0xce8a('0x5e')][_0xce8a('0x25')]({'where':_0x54597b[_0xce8a('0x9d')]})[_0xce8a('0x16')](function(_0x10f102){_0x5253e9[_0xce8a('0x25')]=_0x10f102;_0x54597b['include']=[];if(_0x502111[_0xce8a('0x39')][_0xce8a('0xa7')]){_0x54597b[_0xce8a('0x45')][_0xce8a('0xa8')]({'model':db[_0xce8a('0x81')],'as':'User','attributes':['id',_0xce8a('0x8a'),_0xce8a('0xa9')]});}if(_0x502111[_0xce8a('0x39')][_0xce8a('0x44')]){_0x54597b['include']=[{'all':!![]}];}return db[_0xce8a('0x5e')][_0xce8a('0x37')](_0x54597b);})[_0xce8a('0x16')](function(_0x2641d8){_0x5253e9['rows']=_0x2641d8;return _0x5253e9;});}})[_0xce8a('0x16')](respondWithFilteredResult(_0x2c6b45,_0x54597b))['catch'](handleError(_0x2c6b45,null));};exports['addTags']=function(_0x4900f5,_0x3976f7){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x4900f5[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x3976f7,null))[_0xce8a('0x16')](function(_0x393b63){if(_0x393b63){return _0x393b63[_0xce8a('0xaa')](_0x4900f5[_0xce8a('0x2d')][_0xce8a('0x96')],_[_0xce8a('0x97')](_0x4900f5[_0xce8a('0x2d')],[_0xce8a('0x96'),'id'])||{})['spread'](function(){return db[_0xce8a('0xab')][_0xce8a('0x37')]({'attributes':['id',_0xce8a('0x2b'),_0xce8a('0xac')],'where':{'id':_0x4900f5[_0xce8a('0x2d')][_0xce8a('0x96')]}});})[_0xce8a('0x16')](function(_0x3e1021){socket['emit'](_0xce8a('0xad'),{'id':Number(_0x4900f5[_0xce8a('0x3c')]['id']),'tags':_0x3e1021||[]});return{'id':Number(_0x4900f5['params']['id']),'tags':_0x3e1021||[]};});}})[_0xce8a('0x16')](respondWithResult(_0x3976f7,null))['catch'](handleError(_0x3976f7,null));};exports['removeTags']=function(_0x3eceed,_0x95655c){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x3eceed[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x95655c,null))[_0xce8a('0x16')](function(_0x155861){if(_0x155861){return _0x155861[_0xce8a('0xae')](_0x3eceed[_0xce8a('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x95655c,null))['catch'](handleError(_0x95655c,null));};exports['download']=function(_0x4b7b6e,_0x58a171){var _0x41b9b1=moment()[_0xce8a('0xaf')]()[_0xce8a('0xb0')]();var _0x5e1d22=path[_0xce8a('0x75')](config['root'],_0xce8a('0xb1'),_0xce8a('0xb2'),_0xce8a('0xb3'));var _0x185db5=path['join'](config['root'],'server',_0xce8a('0xb2'),_0xce8a('0xb4'));var _0x7d74da=path[_0xce8a('0x75')](_0x5e1d22,_0x41b9b1);var _0x5bcd0a=util[_0xce8a('0x84')](_0xce8a('0xb5'),_0x4b7b6e[_0xce8a('0x3c')]['id'],_0x41b9b1);var _0x2ebec7=path[_0xce8a('0x75')](_0x5e1d22,_0x5bcd0a);var _0x3aefd9=[];_0x3aefd9['push']({'model':db[_0xce8a('0x81')],'as':_0xce8a('0x81'),'attributes':['id',_0xce8a('0x8a')],'raw':!![]});_0x3aefd9[_0xce8a('0xa8')]({'model':db['CmContact'],'as':_0xce8a('0xb6'),'attributes':['id',_0xce8a('0xb7'),_0xce8a('0xb8')],'raw':!![]});if(_0x4b7b6e[_0xce8a('0x39')][_0xce8a('0xb4')]){_0x3aefd9[_0xce8a('0xa8')]({'model':db['Attachment'],'as':_0xce8a('0x71'),'raw':!![]});}var _0x59770e=[{'model':db[_0xce8a('0x5e')],'as':_0xce8a('0x80'),'attributes':['id',_0xce8a('0x2d'),_0xce8a('0xb9'),_0xce8a('0x8c'),_0xce8a('0x8d'),'read'],'include':_0x3aefd9}];_0x59770e[_0xce8a('0xa8')]({'model':db[_0xce8a('0x4e')],'as':_0xce8a('0xba'),'attributes':['id',_0xce8a('0x2b')]});_0x59770e[_0xce8a('0xa8')]({'model':db[_0xce8a('0x81')],'as':_0xce8a('0xbb'),'attributes':['id',_0xce8a('0x8a')]});return db[_0xce8a('0x3f')]['find']({'where':{'id':_0x4b7b6e[_0xce8a('0x3c')]['id']},'include':_0x59770e})[_0xce8a('0x16')](handleEntityNotFound(_0x58a171,null))[_0xce8a('0x16')](function(_0x2209e8){if(_0x2209e8){var _0x4efe54=_0x2209e8['get']({'plain':!![]});fs[_0xce8a('0xbc')](_0x7d74da);var _0x2d9f22={'channel':_0xce8a('0xbd'),'account':_0x4efe54[_0xce8a('0xba')][_0xce8a('0x2b')],'agent':_0x4efe54[_0xce8a('0xbb')]?_0x4efe54[_0xce8a('0xbb')][_0xce8a('0x8a')]:_0xce8a('0xbe'),'createdAt':moment(_0x4efe54[_0xce8a('0xb9')])['format'](_0xce8a('0xa3'))['toString'](),'closedAt':_0x4efe54[_0xce8a('0x69')]?moment(_0x4efe54[_0xce8a('0xbf')])[_0xce8a('0x84')](_0xce8a('0xa3'))[_0xce8a('0xb0')]():'','disposition':_0x4efe54[_0xce8a('0xc0')],'chatInfo':{'browser':_0x4efe54[_0xce8a('0xc1')],'os':_0x4efe54[_0xce8a('0xc2')],'referer':_0x4efe54[_0xce8a('0xc3')],'customerIp':_0x4efe54[_0xce8a('0xc4')],'customerPort':_0x4efe54['customerPort']?_0x4efe54[_0xce8a('0xc5')]:_0xce8a('0xbe')},'messages':_(_0x4efe54[_0xce8a('0x80')])[_0xce8a('0xc6')]()[_0xce8a('0xa0')]({'secret':![]})[_0xce8a('0x33')](function(_0x2f4a9c){if(_0x2f4a9c[_0xce8a('0x71')]){var _0x161f7f=path[_0xce8a('0x75')](_0x185db5,_0x2f4a9c[_0xce8a('0x71')]['basename']);if(fs[_0xce8a('0xc7')](_0x161f7f)){fs[_0xce8a('0xc8')](_0x161f7f)['pipe'](fs[_0xce8a('0xc9')](path[_0xce8a('0x75')](_0x7d74da,_0x2f4a9c[_0xce8a('0x71')]['basename'])));}}return{'date':moment(_0x2f4a9c[_0xce8a('0xb9')])[_0xce8a('0x84')](_0xce8a('0xa3'))['toString'](),'sender':_0x2f4a9c[_0xce8a('0x8c')]===_0xce8a('0x5d')?_0x2f4a9c['User']?_0x2f4a9c[_0xce8a('0x81')][_0xce8a('0x8a')]:_0xce8a('0x8b'):_0x2f4a9c[_0xce8a('0xb6')][_0xce8a('0xb7')]+(_0x2f4a9c[_0xce8a('0xb6')]['lastName']?'\x20'+_0x2f4a9c[_0xce8a('0xb6')][_0xce8a('0xb8')]:''),'body':_0x2f4a9c[_0xce8a('0x71')]?_0x2f4a9c['Attachment'][_0xce8a('0x6d')]:_0x2f4a9c[_0xce8a('0x2d')],'direction':_0x2f4a9c['direction']===_0xce8a('0x5d')?'A':'C','secret':_0x2f4a9c['secret'],'read':_0x2f4a9c[_0xce8a('0xca')],'attachment':_0x2f4a9c[_0xce8a('0x71')]};})[_0xce8a('0xcb')]()};return ejs[_0xce8a('0xcc')](path[_0xce8a('0x75')](config['root'],_0xce8a('0xb1'),_0xce8a('0xcd'),_0xce8a('0xce')),{'interaction':_0x2d9f22})[_0xce8a('0x16')](function(_0x4d7b40){var _0x3c2038=path['join'](_0x7d74da,'transcript-'+_0x4efe54['id']+'-'+_0x41b9b1+_0xce8a('0xcf'));var _0x50223a={'path':_0x3c2038,'channel':_0xce8a('0xbd'),'interactionId':_0x4efe54['id']};return pdf[_0xce8a('0xd0')](_0x4d7b40,_0x50223a);})[_0xce8a('0x16')](function(){return new Promise(function(_0xfb8d42,_0x147e9e){zipdir(_0x7d74da,{'saveTo':_0x2ebec7},function(_0x31428e,_0x5e9026){if(_0x31428e)return _0x147e9e(_0x31428e);return _0xfb8d42(_0x5e9026);});})[_0xce8a('0x16')](function(){return new BPromise(function(_0x5b5ed9,_0x1b3376){rimraf(_0x7d74da,function(_0x1354e5){if(_0x1354e5)_0x1b3376(_0x1354e5);return _0x5b5ed9();});});})[_0xce8a('0x16')](function(){return _0x58a171[_0xce8a('0x79')](_0x2ebec7,_0x5bcd0a,function(_0x126675){if(_0x126675){logger[_0xce8a('0x1d')](_0xce8a('0xd1'),_0x126675);}else{fs[_0xce8a('0xd2')](_0x2ebec7);}});});});}else{return _0x58a171[_0xce8a('0x66')](0xc8);}})[_0xce8a('0x49')](handleError(_0x58a171,null));};
\ No newline at end of file
+var _0x1fc4=['sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','order','sort','filters','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','hasOwnProperty','includeAgent','push','rows','addTags','setTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','name','send','render','merge','body','contact','agent','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','agentAlias','customer','Visitor','agentIdentifier','website_alias','%s%d','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0x1fc4,0x1ed));var _0x41fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1fc4[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0x41fc('0x0'));var zipdir=require('zip-dir');var rp=require(_0x41fc('0x1'));var moment=require(_0x41fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x41fc('0x3'));var util=require(_0x41fc('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x41fc('0x5'));var qs=require(_0x41fc('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x41fc('0x7'))(_0x41fc('0x8'));var config=require(_0x41fc('0x9'));var db=require(_0x41fc('0xa'))['db'];config[_0x41fc('0xb')]=_[_0x41fc('0xc')](config['redis'],{'host':_0x41fc('0xd'),'port':0x18eb});var socket=require(_0x41fc('0xe'))(new Redis(config[_0x41fc('0xb')]));require('./chatInteraction.socket')[_0x41fc('0xf')](socket);var jayson=require(_0x41fc('0x10'));var client=jayson[_0x41fc('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x41fc('0x11')][_0x41fc('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x57572a,_0x40774b,_0x55c2b7,_0x11773c){return new BPromise(function(_0x247247,_0x50bfbd){var _0x32385f=_0x11773c||client;return _0x32385f[_0x41fc('0x13')](_0x57572a,_0x55c2b7)[_0x41fc('0x14')](function(_0x24b132){logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));logger['debug'](_0x41fc('0x17'),_0x40774b,'request\x20sent',JSON['stringify'](_0x24b132));if(_0x24b132['error']){if(_0x24b132[_0x41fc('0x18')][_0x41fc('0x19')]===0x1f4){logger['error'](_0x41fc('0x15'),_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x50bfbd(_0x24b132[_0x41fc('0x18')]['message']);}logger[_0x41fc('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x247247(_0x24b132['error'][_0x41fc('0x1a')]);}else{logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));_0x247247(_0x24b132[_0x41fc('0x1b')][_0x41fc('0x1a')]);}})[_0x41fc('0x1c')](function(_0x1112c2){logger['error'](_0x41fc('0x15'),_0x40774b,_0x1112c2);_0x50bfbd(_0x1112c2);});});}function respondWithStatusCode(_0x4559ef,_0x2ea987){_0x2ea987=_0x2ea987||0xcc;return function(_0x4539d4){if(_0x4539d4){return _0x4559ef[_0x41fc('0x1d')](_0x2ea987);}return _0x4559ef[_0x41fc('0x1e')](_0x2ea987)[_0x41fc('0x1f')]();};}function respondWithResult(_0x119a13,_0x13c8d4){_0x13c8d4=_0x13c8d4||0xc8;return function(_0x27e716){if(_0x27e716){return _0x119a13[_0x41fc('0x1e')](_0x13c8d4)[_0x41fc('0x20')](_0x27e716);}};}function respondWithFilteredResult(_0x5e1811,_0x541d32){return function(_0x5dc5e6){if(_0x5dc5e6){var _0x13f10c=typeof _0x541d32[_0x41fc('0x21')]===_0x41fc('0x22')&&typeof _0x541d32[_0x41fc('0x23')]===_0x41fc('0x22');var _0x4a5bea=_0x5dc5e6[_0x41fc('0x24')];var _0x2bb7cd=_0x13f10c?0x0:_0x541d32['offset'];var _0x63be2=_0x13f10c?_0x5dc5e6[_0x41fc('0x24')]:_0x541d32[_0x41fc('0x21')]+_0x541d32[_0x41fc('0x23')];var _0x7e7e81;if(_0x63be2>=_0x4a5bea){_0x63be2=_0x4a5bea;_0x7e7e81=0xc8;}else{_0x7e7e81=0xce;}_0x5e1811['status'](_0x7e7e81);return _0x5e1811[_0x41fc('0x25')]('Content-Range',_0x2bb7cd+'-'+_0x63be2+'/'+_0x4a5bea)[_0x41fc('0x20')](_0x5dc5e6);}return null;};}function saveUpdates(_0x4256ea){return function(_0x4f6f88){if(_0x4f6f88){return _0x4f6f88['update'](_0x4256ea)[_0x41fc('0x14')](function(_0x127c62){return _0x127c62;});}return null;};}function removeEntity(_0x119145){return function(_0x599f36){if(_0x599f36){return _0x599f36[_0x41fc('0x26')]()[_0x41fc('0x14')](function(){_0x119145['status'](0xcc)[_0x41fc('0x1f')]();});}};}function handleEntityNotFound(_0x5d4660){return function(_0x3eccd9){if(!_0x3eccd9){_0x5d4660[_0x41fc('0x1d')](0x194);}return _0x3eccd9;};}function handleError(_0x5429f6,_0x17979c){_0x17979c=_0x17979c||0x1f4;return function(_0x39c588){logger['error'](_0x39c588['stack']);if(_0x39c588[_0x41fc('0x27')]){delete _0x39c588[_0x41fc('0x27')];}_0x5429f6[_0x41fc('0x1e')](_0x17979c)[_0x41fc('0x28')](_0x39c588);};}function getMustacheRender(_0x10e80a,_0x293f59){return Mustache[_0x41fc('0x29')](_0x10e80a,_[_0x41fc('0x2a')](_0x293f59[_0x41fc('0x2b')],{'contact':_0x293f59[_0x41fc('0x2c')],'message':_0x293f59['message'],'agent':_0x293f59[_0x41fc('0x2d')],'interaction':_0x293f59['interaction'],'account':_0x293f59[_0x41fc('0x2e')]}))||'';}exports[_0x41fc('0x2f')]=function(_0x3eca15,_0x138023){var _0x329a74={};var _0x3180fb=_[_0x41fc('0x30')](db['ChatInteraction'][_0x41fc('0x31')],function(_0x3c1a20){return{'name':_0x3c1a20[_0x41fc('0x32')],'type':_0x3c1a20[_0x41fc('0x33')][_0x41fc('0x34')]};});_0x329a74=qs[_0x41fc('0x35')](_0x3180fb,_0x3eca15);return interaction[_0x41fc('0x36')](_0x41fc('0x37'),_0x3eca15[_0x41fc('0x38')],_0x3eca15[_0x41fc('0x39')],_0x329a74,_0x3180fb)[_0x41fc('0x14')](respondWithFilteredResult(_0x138023,_0x329a74))[_0x41fc('0x1c')](handleError(_0x138023,null));};exports[_0x41fc('0x3a')]=function(_0x3c6d89,_0x46c5d0){var _0xd5e05b={'raw':![],'where':{'id':_0x3c6d89[_0x41fc('0x3b')]['id']}},_0x24e2b5={};_0x24e2b5[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x3e')][_0x41fc('0x31')]);_0x24e2b5[_0x41fc('0x38')]=_['keys'](_0x3c6d89[_0x41fc('0x38')]);_0x24e2b5['filters']=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],_0x24e2b5[_0x41fc('0x38')]);_0xd5e05b[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x41')]));_0xd5e05b[_0x41fc('0x40')]=_0xd5e05b[_0x41fc('0x40')][_0x41fc('0x42')]?_0xd5e05b[_0x41fc('0x40')]:_0x24e2b5[_0x41fc('0x3c')];if(_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x43')]){_0xd5e05b['include']=[{'all':!![]}];}_0xd5e05b=_[_0x41fc('0x2a')]({},_0xd5e05b,_0x3c6d89[_0x41fc('0x44')]);return db['ChatInteraction'][_0x41fc('0x45')](_0xd5e05b)[_0x41fc('0x14')](handleEntityNotFound(_0x46c5d0,null))[_0x41fc('0x14')](respondWithResult(_0x46c5d0,null))[_0x41fc('0x1c')](handleError(_0x46c5d0,null));};exports[_0x41fc('0x46')]=function(_0x5d5251,_0x26c961){return db['ChatInteraction'][_0x41fc('0x46')](_0x5d5251[_0x41fc('0x2b')],{})['then'](respondWithResult(_0x26c961,0xc9))[_0x41fc('0x1c')](handleError(_0x26c961,null));};exports[_0x41fc('0x47')]=function(_0x267cae,_0x396158){if(_0x267cae[_0x41fc('0x2b')]['id']){delete _0x267cae[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x267cae[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x396158,null))[_0x41fc('0x14')](saveUpdates(_0x267cae['body'],null))[_0x41fc('0x14')](respondWithResult(_0x396158,null))[_0x41fc('0x1c')](handleError(_0x396158,null));};exports['destroy']=function(_0xacd39f,_0x52509b){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0xacd39f[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x52509b,null))[_0x41fc('0x14')](removeEntity(_0x52509b,null))['catch'](handleError(_0x52509b,null));};exports[_0x41fc('0x48')]=function(_0x200068,_0x338acb){return db[_0x41fc('0x3e')][_0x41fc('0x48')]()[_0x41fc('0x14')](respondWithResult(_0x338acb,null))[_0x41fc('0x1c')](handleError(_0x338acb,null));};exports[_0x41fc('0x49')]=function(_0x2f6d7d,_0x5e3dcd){var _0x13294c=_0x2f6d7d['params']['id'];var _0x4a5810;var _0x1d78c6;var _0x505c60;return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x13294c}})['then'](function(_0x3743d2){_0x4a5810=_0x3743d2;return db[_0x41fc('0x4b')][_0x41fc('0x4a')]({'where':{'id':_0x3743d2[_0x41fc('0x4c')]},'attributes':['id',_0x41fc('0x4d'),_0x41fc('0x4e'),_0x41fc('0x4f'),_0x41fc('0x50'),_0x41fc('0x51')],'raw':!![]});})[_0x41fc('0x14')](function(_0x37ce77){if(_0x37ce77&&_0x37ce77['vidaooApiKey']&&_0x37ce77[_0x41fc('0x4e')]){_0x1d78c6=_0x37ce77;var _0xf64fa8={'interaction':{'id':_0x13294c},'agent':{'id':_0x2f6d7d[_0x41fc('0x39')]['id'],'name':_0x2f6d7d['user']['name'],'fullname':_0x2f6d7d[_0x41fc('0x39')][_0x41fc('0x52')],'email':_0x2f6d7d[_0x41fc('0x39')]['email']},'contact':_0x2f6d7d['body'][_0x41fc('0x2c')],'account':_0x2f6d7d[_0x41fc('0x2b')][_0x41fc('0x2e')]};var _0x35abac={'rejectUnauthorized':![],'method':_0x41fc('0x53'),'url':_0x41fc('0x54'),'headers':{'X-APIKEY':_0x37ce77[_0x41fc('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2f6d7d[_0x41fc('0x39')]['email']],'buttons':null,'topic':_0x1d78c6[_0x41fc('0x4f')],'note':_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x50')])?null:getMustacheRender(_0x1d78c6[_0x41fc('0x50')],_0xf64fa8),'metadata':null},'redirect':_0x41fc('0x56'),'json':!![]};try{if(!_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x51')])){var _0x54adbb=getMustacheRender(_0x1d78c6[_0x41fc('0x51')],_0xf64fa8);var _0x250ab2=JSON[_0x41fc('0x57')](_0x54adbb);_0x35abac[_0x41fc('0x2b')][_0x41fc('0x58')]=_0x250ab2;}}catch(_0x2dc50b){throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5b'));}return rp(_0x35abac);}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5c'));}})[_0x41fc('0x14')](function(_0x4046b9){_0x505c60=_0x4046b9;if(_0x505c60['id']){var _0x5c1f31={'body':_0x505c60[_0x41fc('0x5d')],'ChatWebsiteId':_0x1d78c6['id'],'ChatInteractionId':_0x4a5810['id'],'direction':'out','UserId':_0x2f6d7d['user']['id']};return db['ChatMessage']['create'](_0x5c1f31,{});}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5e'));}})['then'](function(){return _0x4a5810['updateAttributes']({'vidaooSessionId':_0x505c60['id']});})['then'](respondWithResult(_0x5e3dcd,null))[_0x41fc('0x1c')](handleError(_0x5e3dcd,null));};exports[_0x41fc('0x5f')]=function(_0x582077,_0x2e889d){if(_0x582077[_0x41fc('0x2b')]['id']){delete _0x582077['body']['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x582077['params']['id']},'include':[{'model':db['CmContact'],'as':_0x41fc('0x60')}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2e889d,null))[_0x41fc('0x14')](saveUpdates(_0x582077[_0x41fc('0x2b')],null))[_0x41fc('0x14')](respondWithResult(_0x2e889d,null))['catch'](handleError(_0x2e889d,null));};exports[_0x41fc('0x61')]=function(_0x430220,_0x5bd368){if(_0x430220[_0x41fc('0x2b')]['id']){delete _0x430220[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')]['find']({'where':{'id':_0x430220[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](function(_0x501a48){if(!_0x501a48){logger[_0x41fc('0x18')](_0x41fc('0x62'),_0x41fc('0x61'),0x194,_0x41fc('0x63'));_0x5bd368[_0x41fc('0x1d')](0x194);}else{if(_0x501a48[_0x41fc('0x64')]){throw new db['Sequelize']['ValidationError'](_0x41fc('0x65'));}}return _0x501a48;})[_0x41fc('0x14')](function(_0xa9454){if(_0xa9454){return _0xa9454['update']({'closed':_0x430220[_0x41fc('0x2b')]['closed'],'disposition':_0x430220[_0x41fc('0x2b')][_0x41fc('0x66')]})[_0x41fc('0x14')](function(_0x18e7d9){return _0x18e7d9;});}})['then'](function(){return respondWithRpcPromise(_0x41fc('0x67'),_0x41fc('0x61'),_0x430220[_0x41fc('0x2b')],client9004);})[_0x41fc('0x14')](respondWithResult(_0x5bd368,null))[_0x41fc('0x1c')](handleError(_0x5bd368,null));};exports[_0x41fc('0x68')]=function(_0x2f3b84,_0xc3ed0){_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x27')]=_0x2f3b84[_0x41fc('0x69')][_0x41fc('0x6a')];_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x6b')]=_0x2f3b84[_0x41fc('0x69')]['filename'];_0x2f3b84[_0x41fc('0x2b')]['type']=_0x2f3b84['file'][_0x41fc('0x6c')];return db[_0x41fc('0x6d')][_0x41fc('0x46')](_0x2f3b84[_0x41fc('0x2b')])['then'](respondWithResult(_0xc3ed0,0xc9))['catch'](handleError(_0xc3ed0,null));};exports[_0x41fc('0x6e')]=function(_0x43f567,_0x2ca377){return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43f567[_0x41fc('0x3b')]['id']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null))[_0x41fc('0x14')](function(_0x21ed99){if(_0x21ed99){if(_0x21ed99[_0x41fc('0x6f')]){return _0x2ca377['status'](0x193)[_0x41fc('0x20')]({'status':0x193,'message':_0x41fc('0x70')});}return db[_0x41fc('0x6d')][_0x41fc('0x4a')]({'where':{'id':_0x43f567['query']['attachId']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null));}})[_0x41fc('0x14')](function(_0x5d8d59){if(_0x5d8d59){var _0x4f4cb3=_0x5d8d59[_0x41fc('0x71')]!==null;var _0x3f3b7e=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x74'));if(_0x4f4cb3){_0x3f3b7e=path[_0x41fc('0x72')](_0x3f3b7e,_0x41fc('0x75'));}var _0xb5c435=path[_0x41fc('0x72')](_0x3f3b7e,_0x5d8d59[_0x41fc('0x6b')]);return _0x2ca377[_0x41fc('0x76')](_0xb5c435);}})[_0x41fc('0x1c')](handleError(_0x2ca377,null));};exports['close']=function(_0x280911,_0x2a8278){var _0x153f21=null;var _0x45cd04=null;var _0x3eb16f=null;if(_0x280911[_0x41fc('0x2b')]['id']){delete _0x280911[_0x41fc('0x2b')]['id'];}if(_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')]){_0x3eb16f=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x78'),util[_0x41fc('0x79')](_0x41fc('0x7a'),Date[_0x41fc('0x7b')]()));_0x280911[_0x41fc('0x2b')][_0x41fc('0x7c')]=_0x3eb16f;}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x280911[_0x41fc('0x3b')]['id']},'include':[{'model':db[_0x41fc('0x7d')],'as':_0x41fc('0x7e'),'include':[{'model':db[_0x41fc('0x7f')],'as':_0x41fc('0x7f')}]}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8278,null))[_0x41fc('0x14')](saveUpdates(_0x280911[_0x41fc('0x2b')],null))[_0x41fc('0x14')](function(_0x5239d5){if(_0x5239d5){_0x153f21=_0x5239d5;return db['ChatWebsite'][_0x41fc('0x45')]({'where':{'id':_0x153f21['ChatWebsiteId']}});}})[_0x41fc('0x14')](function(_0x244ecb){if(_0x244ecb){_0x45cd04=_0x244ecb;return db[_0x41fc('0x80')][_0x41fc('0x45')]({'where':{'id':_0x153f21[_0x41fc('0x81')]}});}})[_0x41fc('0x14')](function(_0x5acbc7){if(_0x5acbc7){if(_0x3eb16f){var _0x317625=null;for(var _0xd99007=0x1;_0xd99007<_0x153f21['Messages'][_0x41fc('0x42')];++_0xd99007){_0x317625=_0x153f21[_0x41fc('0x7e')][_0xd99007];var _0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')]('%s%d',_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):'System';var _0xf58b49=_0x280911[_0x41fc('0x2b')][_0x41fc('0x83')]||util['format']('%s%d',_0x41fc('0x84'),_0x317625['ContactId']);switch(_0x45cd04[_0x41fc('0x85')]){case _0x41fc('0x86'):_0x1d9947=_0x317625[_0x41fc('0x64')]?util['format'](_0x41fc('0x87'),_0x45cd04['agentAlias'],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');break;case'agent_alias':_0x1d9947=_0x317625[_0x41fc('0x64')]?_0x317625[_0x41fc('0x7f')][_0x41fc('0x89')]||_0x317625['User'][_0x41fc('0x52')]:'System';break;case _0x41fc('0x8a'):_0x1d9947=_0x317625['UserId']?_0x317625['User']['fullname']:_0x41fc('0x88');break;default:_0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')](_0x41fc('0x87'),_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');}var _0x4b5c37=util[_0x41fc('0x79')](_0x41fc('0x8b'),moment(_0x317625[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0x8d')),_0x317625['direction']==='in'?_0xf58b49:_0x1d9947,_0x317625[_0x41fc('0x2b')]);if(!_0x317625[_0x41fc('0x8e')]){fs[_0x41fc('0x8f')](_0x3eb16f,_0x4b5c37);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x41fc('0x90')],'as':_0x41fc('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x41fc('0x92'),'raw':!![]}]}]});}}})[_0x41fc('0x14')](function(_0x2f09ce){if(!_0x2f09ce||!_0x2f09ce['Smtp']||!_0x280911[_0x41fc('0x2b')])return _0x153f21;var _0x3058dc=_0x2f09ce[_0x41fc('0x93')]();return respondWithRpcPromise(_0x41fc('0x94'),_0x41fc('0x95'),{'account':_0x3058dc,'message':{'from':util[_0x41fc('0x79')](_0x41fc('0x96'),_0x2f09ce[_0x41fc('0x27')],_0x2f09ce[_0x41fc('0x97')]||_0x2f09ce['Smtp'][_0x41fc('0x39')]),'to':_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')],'subject':_0x41fc('0x98'),'text':util['format'](_0x41fc('0x99'),_0x280911['body'][_0x41fc('0x77')]),'attachments':[{'path':_0x3eb16f}]}})['then'](function(){return _0x153f21;})[_0x41fc('0x1c')](function(_0xe43fb9){logger[_0x41fc('0x18')](_0xe43fb9);});})[_0x41fc('0x14')](respondWithStatusCode(_0x2a8278,0xc8))[_0x41fc('0x1c')](handleError(_0x2a8278,null));};exports['addMessage']=function(_0x4a501d,_0x2a8b6b){return db[_0x41fc('0x7d')][_0x41fc('0x45')]({'where':{'id':_0x4a501d[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8b6b,null))[_0x41fc('0x14')](function(_0x368769){if(_0x368769){return _0x368769[_0x41fc('0x9a')](_0x4a501d[_0x41fc('0x2b')][_0x41fc('0x9b')],_['omit'](_0x4a501d[_0x41fc('0x2b')],[_0x41fc('0x9b'),'id'])||{});}})[_0x41fc('0x14')](respondWithResult(_0x2a8b6b,null))[_0x41fc('0x1c')](handleError(_0x2a8b6b,null));};exports['getMessages']=function(_0x28d988,_0x2306b1){var _0x499387={'raw':![],'where':{}};var _0x5c2fcc={};var _0x48c3ec={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')]['findOne']({'where':{'id':_0x28d988[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2306b1,null))[_0x41fc('0x14')](function(_0x1d0462){if(_0x1d0462){_0x5c2fcc[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x5c2fcc[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x28d988['query']);_0x5c2fcc['filters']=_[_0x41fc('0x3f')](_0x5c2fcc['model'],_0x5c2fcc['query']);_0x499387['attributes']=_[_0x41fc('0x3f')](_0x5c2fcc[_0x41fc('0x3c')],qs['fields'](_0x28d988[_0x41fc('0x38')][_0x41fc('0x41')]));_0x499387[_0x41fc('0x40')]=_0x499387[_0x41fc('0x40')]['length']?_0x499387[_0x41fc('0x40')]:_0x5c2fcc[_0x41fc('0x3c')];if(!_0x28d988['query']['hasOwnProperty'](_0x41fc('0x9c'))){_0x499387[_0x41fc('0x23')]=qs[_0x41fc('0x23')](_0x28d988[_0x41fc('0x38')]['limit']);_0x499387[_0x41fc('0x21')]=qs['offset'](_0x28d988['query'][_0x41fc('0x21')]);}_0x499387[_0x41fc('0x9d')]=qs[_0x41fc('0x9e')](_0x28d988['query'][_0x41fc('0x9e')]);_0x499387['where']=qs[_0x41fc('0x9f')](_[_0x41fc('0xa0')](_0x28d988[_0x41fc('0x38')],_0x5c2fcc[_0x41fc('0x9f')]));_0x499387['where'][_0x41fc('0xa1')]=_0x1d0462['id'];if(_0x28d988['query']['filter']){_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x499387[_0x41fc('0x40')],function(_0x5d153a){var _0x3766ea={};_0x3766ea[_0x5d153a]={'$like':'%'+_0x28d988[_0x41fc('0x38')][_0x41fc('0xa3')]+'%'};return _0x3766ea;})});}if(_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')]){var _0x12d710=_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')][_0x41fc('0xa5')](',');var _0x5784e5={};_0x5784e5[_0x12d710[0x0]]={'$gte':moment(_0x12d710[0x1])[_0x41fc('0x79')](_0x41fc('0xa6'))};_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],_0x5784e5);}_0x499387=_[_0x41fc('0x2a')]({},_0x499387,_0x28d988[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x499387[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x3508a5){_0x48c3ec['count']=_0x3508a5;if(_0x28d988[_0x41fc('0x38')][_0x41fc('0x43')]){_0x499387[_0x41fc('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0x41fc('0x36')](_0x499387);})['then'](function(_0x24a09a){_0x48c3ec['rows']=_0x24a09a;return _0x48c3ec;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2306b1,_0x499387))[_0x41fc('0x1c')](handleError(_0x2306b1,null));};exports[_0x41fc('0xa8')]=function(_0x43fd16,_0x2999d4){var _0x12bb76={'where':{}},_0x53ddc0={},_0xfe031b={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43fd16[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2999d4,null))['then'](function(_0x52658f){if(_0x52658f){_0x53ddc0[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x53ddc0[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x43fd16[_0x41fc('0x38')]);_0x53ddc0['filters']=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],_0x53ddc0[_0x41fc('0x38')]);_0x12bb76[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x41')]));_0x12bb76[_0x41fc('0x40')]=_0x12bb76[_0x41fc('0x40')][_0x41fc('0x42')]?_0x12bb76[_0x41fc('0x40')]:_0x53ddc0[_0x41fc('0x3c')];if(!_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa9')]('nolimit')){_0x12bb76['limit']=qs[_0x41fc('0x23')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x23')]);_0x12bb76[_0x41fc('0x21')]=qs[_0x41fc('0x21')](_0x43fd16['query'][_0x41fc('0x21')]);}_0x12bb76['order']=qs[_0x41fc('0x9e')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x9e')]);_0x12bb76[_0x41fc('0xa2')]=qs['filters'](_['pick'](_0x43fd16[_0x41fc('0x38')],_0x53ddc0[_0x41fc('0x9f')]));_0x12bb76[_0x41fc('0xa2')][_0x41fc('0xa1')]=_0x52658f['id'];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa3')]){_0x12bb76[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x12bb76[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x12bb76['attributes'],function(_0x2db164){var _0x9c8f40={};_0x9c8f40[_0x2db164]={'$like':'%'+_0x43fd16[_0x41fc('0x38')]['filter']+'%'};return _0x9c8f40;})});}_0x12bb76[_0x41fc('0xa2')]['secret']=![];if(_0x43fd16[_0x41fc('0x38')]['id']){_0x12bb76[_0x41fc('0xa2')]['id']={'$gt':_0x43fd16[_0x41fc('0x38')]['id']};}_0x12bb76=_['merge']({},_0x12bb76,_0x43fd16[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x12bb76[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x1edbc8){_0xfe031b[_0x41fc('0x24')]=_0x1edbc8;_0x12bb76['include']=[];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xaa')]){_0x12bb76[_0x41fc('0xa7')][_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id',_0x41fc('0x52'),_0x41fc('0x89')]});}if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0x43')]){_0x12bb76[_0x41fc('0xa7')]=[{'all':!![]}];}return db[_0x41fc('0x7d')][_0x41fc('0x36')](_0x12bb76);})[_0x41fc('0x14')](function(_0x4870e8){_0xfe031b[_0x41fc('0xac')]=_0x4870e8;return _0xfe031b;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2999d4,_0x12bb76))[_0x41fc('0x1c')](handleError(_0x2999d4,null));};exports[_0x41fc('0xad')]=function(_0x18b8a4,_0xb4a7a3){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0x18b8a4['params']['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0xb4a7a3,null))['then'](function(_0x400ab6){if(_0x400ab6){return _0x400ab6[_0x41fc('0xae')](_0x18b8a4[_0x41fc('0x2b')][_0x41fc('0x9b')],_[_0x41fc('0xaf')](_0x18b8a4['body'],[_0x41fc('0x9b'),'id'])||{})[_0x41fc('0xb0')](function(){return db[_0x41fc('0xb1')]['findAll']({'attributes':['id',_0x41fc('0x27'),_0x41fc('0xb2')],'where':{'id':_0x18b8a4[_0x41fc('0x2b')]['ids']}});})[_0x41fc('0x14')](function(_0xf0330a){socket['emit'](_0x41fc('0xb3'),{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]});return{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]};});}})[_0x41fc('0x14')](respondWithResult(_0xb4a7a3,null))[_0x41fc('0x1c')](handleError(_0xb4a7a3,null));};exports[_0x41fc('0xb4')]=function(_0x1bdb9b,_0x12bf27){return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x1bdb9b[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x12bf27,null))['then'](function(_0x10df5b){if(_0x10df5b){return _0x10df5b[_0x41fc('0xb4')](_0x1bdb9b[_0x41fc('0x38')]['ids']);}})[_0x41fc('0x14')](respondWithStatusCode(_0x12bf27,null))[_0x41fc('0x1c')](handleError(_0x12bf27,null));};exports[_0x41fc('0x76')]=function(_0x5574e7,_0x5489d6){var _0x5d0428=moment()[_0x41fc('0xb5')]()['toString']();var _0x1a89fb=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),_0x41fc('0xb8'));var _0x7e95ef=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),'attachments');var _0x288038=path[_0x41fc('0x72')](_0x1a89fb,_0x5d0428);var _0x3a0ccb=util[_0x41fc('0x79')](_0x41fc('0xb9'),_0x5574e7['params']['id'],_0x5d0428);var _0x511650=path['join'](_0x1a89fb,_0x3a0ccb);var _0x3231ef=[];_0x3231ef[_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x3231ef[_0x41fc('0xab')]({'model':db[_0x41fc('0x80')],'as':_0x41fc('0x60'),'attributes':['id','firstName',_0x41fc('0xba')],'raw':!![]});if(_0x5574e7[_0x41fc('0x38')][_0x41fc('0xbb')]){_0x3231ef[_0x41fc('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x271260=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x41fc('0xbc'),_0x41fc('0x8e'),_0x41fc('0xbd')],'include':_0x3231ef}];_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x4b')],'as':_0x41fc('0xbe'),'attributes':['id',_0x41fc('0x27')]});_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x7f')],'as':_0x41fc('0xbf'),'attributes':['id',_0x41fc('0x52')]});return db['ChatInteraction']['find']({'where':{'id':_0x5574e7[_0x41fc('0x3b')]['id']},'include':_0x271260})[_0x41fc('0x14')](handleEntityNotFound(_0x5489d6,null))[_0x41fc('0x14')](function(_0x4fc3d3){if(_0x4fc3d3){var _0x106fa2=_0x4fc3d3[_0x41fc('0xc0')]({'plain':!![]});fs[_0x41fc('0xc1')](_0x288038);var _0x61dfdb={'channel':_0x41fc('0xc2'),'account':_0x106fa2[_0x41fc('0xbe')][_0x41fc('0x27')],'agent':_0x106fa2[_0x41fc('0xbf')]?_0x106fa2[_0x41fc('0xbf')]['fullname']:_0x41fc('0xc3'),'createdAt':moment(_0x106fa2[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'closedAt':_0x106fa2[_0x41fc('0x6f')]?moment(_0x106fa2[_0x41fc('0xc5')])[_0x41fc('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x106fa2[_0x41fc('0x66')],'chatInfo':{'browser':_0x106fa2['browserName'],'os':_0x106fa2['osName'],'referer':_0x106fa2[_0x41fc('0xc6')],'customerIp':_0x106fa2[_0x41fc('0xc7')],'customerPort':_0x106fa2[_0x41fc('0xc8')]?_0x106fa2[_0x41fc('0xc8')]:'N.A.'},'messages':_(_0x106fa2[_0x41fc('0x7e')])[_0x41fc('0xc9')]()[_0x41fc('0xa3')]({'secret':![]})[_0x41fc('0x30')](function(_0x374c93){if(_0x374c93[_0x41fc('0x6d')]){var _0x5cf940=path[_0x41fc('0x72')](_0x7e95ef,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]);if(fs['existsSync'](_0x5cf940)){fs[_0x41fc('0xca')](_0x5cf940)[_0x41fc('0xcb')](fs['createWriteStream'](path[_0x41fc('0x72')](_0x288038,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')])));}}return{'date':moment(_0x374c93[_0x41fc('0x8c')])['format'](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'sender':_0x374c93['direction']===_0x41fc('0xcc')?_0x374c93['User']?_0x374c93[_0x41fc('0x7f')][_0x41fc('0x52')]:'System':_0x374c93[_0x41fc('0x60')][_0x41fc('0xcd')]+(_0x374c93['Contact']['lastName']?'\x20'+_0x374c93[_0x41fc('0x60')][_0x41fc('0xba')]:''),'body':_0x374c93[_0x41fc('0x6d')]?_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]:_0x374c93[_0x41fc('0x2b')],'direction':_0x374c93[_0x41fc('0xbc')]===_0x41fc('0xcc')?'A':'C','secret':_0x374c93[_0x41fc('0x8e')],'read':_0x374c93[_0x41fc('0xbd')],'attachment':_0x374c93[_0x41fc('0x6d')]};})[_0x41fc('0xce')]()};return ejs['renderFile'](path[_0x41fc('0x72')](config['root'],'server',_0x41fc('0xcf'),_0x41fc('0xd0')),{'interaction':_0x61dfdb})[_0x41fc('0x14')](function(_0x152607){var _0x6c976c=path['join'](_0x288038,_0x41fc('0xd1')+_0x106fa2['id']+'-'+_0x5d0428+_0x41fc('0xd2'));var _0x1debfc={'path':_0x6c976c,'channel':_0x41fc('0xc2'),'interactionId':_0x106fa2['id']};return pdf[_0x41fc('0xd3')](_0x152607,_0x1debfc);})['then'](function(){return new Promise(function(_0x335804,_0x46183a){zipdir(_0x288038,{'saveTo':_0x511650},function(_0x2497d3,_0x4f4538){if(_0x2497d3)return _0x46183a(_0x2497d3);return _0x335804(_0x4f4538);});})['then'](function(){return new BPromise(function(_0x1246de,_0xfaec57){rimraf(_0x288038,function(_0x5d7888){if(_0x5d7888)_0xfaec57(_0x5d7888);return _0x1246de();});});})['then'](function(){return _0x5489d6[_0x41fc('0x76')](_0x511650,_0x3a0ccb,function(_0x26a894){if(_0x26a894){logger[_0x41fc('0x18')](_0x41fc('0xd4'),_0x26a894);}else{fs[_0x41fc('0xd5')](_0x511650);}});});});}else{return _0x5489d6[_0x41fc('0x1d')](0xc8);}})[_0x41fc('0x1c')](handleError(_0x5489d6,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index c785d1a..77d7837 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 _0x69db=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69db,0x185));var _0xb69d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x69db[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xb69d('0x0'));var ChatInteraction=require(_0xb69d('0x1'))['db'][_0xb69d('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb69d('0x3')](0x0);var events={'afterCreate':_0xb69d('0x4'),'afterUpdate':_0xb69d('0x5'),'afterDestroy':_0xb69d('0x6')};function emitEvent(_0x1b1c22){return function(_0x5398b6,_0x280b4c,_0x9cd51b){_0x5398b6[_0xb69d('0x7')]({'attributes':['id'],'raw':!![]})[_0xb69d('0x8')](function(_0x486a07){_0x5398b6[_0xb69d('0x9')](_0xb69d('0xa'),_0x486a07[_0xb69d('0xb')](function(_0x1e70ac){return{'id':_0x1e70ac['id']};}));return ChatMessage[_0xb69d('0xc')]({'where':{'ChatInteractionId':_0x5398b6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb69d('0x8')](function(_0x2aad93){_0x5398b6[_0xb69d('0x9')](_0xb69d('0xd'),_0x2aad93[_0xb69d('0xe')]);ChatInteractionEvents[_0xb69d('0xf')](_0x1b1c22+':'+_0x5398b6['id'],_0x5398b6);ChatInteractionEvents[_0xb69d('0xf')](_0x1b1c22,_0x5398b6);_0x9cd51b(null);})[_0xb69d('0x10')](_0x9cd51b(null));};}for(var e in events){if(events[_0xb69d('0x11')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb69d('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe714=['getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x313112,_0x4af4a4){var _0x422beb=function(_0x545c94){while(--_0x545c94){_0x313112['push'](_0x313112['shift']());}};_0x422beb(++_0x4af4a4);}(_0xe714,0xad));var _0x4e71=function(_0x1f9426,_0x4d0b55){_0x1f9426=_0x1f9426-0x0;var _0xd40e25=_0xe714[_0x1f9426];return _0xd40e25;};'use strict';var EventEmitter=require(_0x4e71('0x0'));var ChatInteraction=require(_0x4e71('0x1'))['db'][_0x4e71('0x2')];var ChatMessage=require(_0x4e71('0x1'))['db'][_0x4e71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4e71('0x4')](0x0);var events={'afterCreate':_0x4e71('0x5'),'afterUpdate':'update','afterDestroy':_0x4e71('0x6')};function emitEvent(_0x4f297f){return function(_0x47d817,_0x3b0084,_0x232a3e){_0x47d817[_0x4e71('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37bf78){_0x47d817[_0x4e71('0x8')](_0x4e71('0x9'),_0x37bf78['map'](function(_0x734cc){return{'id':_0x734cc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x47d817['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e71('0xa')](function(_0x5c2c9a){_0x47d817['setDataValue'](_0x4e71('0xb'),_0x5c2c9a[_0x4e71('0xc')]);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f+':'+_0x47d817['id'],_0x47d817);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f,_0x47d817);_0x232a3e(null);})[_0x4e71('0xe')](_0x232a3e(null));};}for(var e in events){if(events[_0x4e71('0xf')](e)){var event=events[e];ChatInteraction[_0x4e71('0x10')](e,emitEvent(event));}}module[_0x4e71('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 dbd2cf1..d71efb7 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 _0xbeb7=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x5376e2,_0x2d1ee2){var _0x117f76=function(_0x2bfb70){while(--_0x2bfb70){_0x5376e2['push'](_0x5376e2['shift']());}};_0x117f76(++_0x2d1ee2);}(_0xbeb7,0x153));var _0x7beb=function(_0x1adae4,_0x212915){_0x1adae4=_0x1adae4-0x0;var _0x163927=_0xbeb7[_0x1adae4];return _0x163927;};'use strict';var _=require('lodash');var util=require(_0x7beb('0x0'));var logger=require(_0x7beb('0x1'))('api');var moment=require(_0x7beb('0x2'));var BPromise=require(_0x7beb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7beb('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x7beb('0x5')]=function(_0x21a955,_0x56efdc){return _0x21a955['define'](_0x7beb('0x6'),attributes,{'tableName':_0x7beb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x419ce2,_0x4c3d04,_0x39c0cc){if(_0x419ce2[_0x7beb('0x8')](_0x7beb('0x9'))){_0x419ce2[_0x7beb('0xa')]=moment()[_0x7beb('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39c0cc(null,_0x419ce2);}},'charset':'utf8mb4','collate':_0x7beb('0xc')});};
\ No newline at end of file
+var _0x3e2c=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird'];(function(_0x19c967,_0x4d538e){var _0x386e76=function(_0x5678e8){while(--_0x5678e8){_0x19c967['push'](_0x19c967['shift']());}};_0x386e76(++_0x4d538e);}(_0x3e2c,0x1b6));var _0xc3e2=function(_0x23b7e4,_0x1c9417){_0x23b7e4=_0x23b7e4-0x0;var _0x40d91b=_0x3e2c[_0x23b7e4];return _0x40d91b;};'use strict';var _=require(_0xc3e2('0x0'));var util=require(_0xc3e2('0x1'));var logger=require(_0xc3e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e2('0x4'));var rimraf=require(_0xc3e2('0x5'));var config=require(_0xc3e2('0x6'));var attributes=require(_0xc3e2('0x7'));module[_0xc3e2('0x8')]=function(_0xfffadc,_0x3e4644){return _0xfffadc['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a095a,_0x37bff2,_0x4f87bc){if(_0x1a095a['changed'](_0xc3e2('0x9'))){_0x1a095a[_0xc3e2('0xa')]=moment()[_0xc3e2('0xb')](_0xc3e2('0xc'));}_0x4f87bc(null,_0x1a095a);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 56f6bf2..72fd8d1 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 _0x29d2=['register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x51318d,_0x61f162){var _0x47552d=function(_0x20ca74){while(--_0x20ca74){_0x51318d['push'](_0x51318d['shift']());}};_0x47552d(++_0x61f162);}(_0x29d2,0x17d));var _0x229d=function(_0x4d585d,_0x45fe07){_0x4d585d=_0x4d585d-0x0;var _0x371652=_0x29d2[_0x4d585d];return _0x371652;};'use strict';var _=require('lodash');var util=require(_0x229d('0x0'));var moment=require(_0x229d('0x1'));var BPromise=require('bluebird');var rs=require(_0x229d('0x2'));var fs=require('fs');var Redis=require(_0x229d('0x3'));var db=require(_0x229d('0x4'))['db'];var utils=require(_0x229d('0x5'));var logger=require(_0x229d('0x6'))(_0x229d('0x7'));var config=require(_0x229d('0x8'));var jayson=require(_0x229d('0x9'));var client=jayson[_0x229d('0xa')]['http']({'port':0x232a});config['redis']=_[_0x229d('0xb')](config[_0x229d('0xc')],{'host':_0x229d('0xd'),'port':0x18eb});var socket=require(_0x229d('0xe'))(new Redis(config[_0x229d('0xc')]));require('./chatInteraction.socket')[_0x229d('0xf')](socket);function respondWithRpcPromise(_0x444034,_0x594b58,_0x15dbba){return new BPromise(function(_0x1b3eb5,_0x41ba97){return client[_0x229d('0x10')](_0x444034,_0x15dbba)[_0x229d('0x11')](function(_0x358651){logger[_0x229d('0x12')](_0x229d('0x13'),_0x594b58,_0x229d('0x14'));logger[_0x229d('0x15')](_0x229d('0x16'),_0x594b58,_0x229d('0x14'),JSON['stringify'](_0x358651));if(_0x358651[_0x229d('0x17')]){if(_0x358651[_0x229d('0x17')][_0x229d('0x18')]===0x1f4){logger[_0x229d('0x17')](_0x229d('0x13'),_0x594b58,_0x358651[_0x229d('0x17')][_0x229d('0x19')]);return _0x41ba97(_0x358651['error'][_0x229d('0x19')]);}logger[_0x229d('0x17')](_0x229d('0x13'),_0x594b58,_0x358651[_0x229d('0x17')][_0x229d('0x19')]);return _0x1b3eb5(_0x358651[_0x229d('0x17')]['message']);}else{logger[_0x229d('0x12')](_0x229d('0x13'),_0x594b58,_0x229d('0x14'));_0x1b3eb5(_0x358651[_0x229d('0x1a')][_0x229d('0x19')]);}})[_0x229d('0x1b')](function(_0xf084e2){logger[_0x229d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x594b58,_0xf084e2);_0x41ba97(_0xf084e2);});});}exports[_0x229d('0x1c')]=function(_0x1ed8a9){var _0x11b29e=this;return new Promise(function(_0x2dc5bf,_0x4c90e1){return db['ChatInteraction'][_0x229d('0x1d')](_0x1ed8a9[_0x229d('0x1e')],{'raw':_0x1ed8a9['options']?_0x1ed8a9['options'][_0x229d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x21')]||null:null,'attributes':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x22')]||null:null,'limit':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x23')]||null:null})[_0x229d('0x11')](function(_0x3e7cd2){logger[_0x229d('0x12')](_0x229d('0x1c'),_0x1ed8a9);logger[_0x229d('0x15')]('UpdateChatInteraction',_0x1ed8a9,JSON[_0x229d('0x24')](_0x3e7cd2));_0x2dc5bf(_0x3e7cd2);})[_0x229d('0x1b')](function(_0x13f1b1){logger[_0x229d('0x17')]('UpdateChatInteraction',_0x13f1b1[_0x229d('0x19')],_0x1ed8a9);_0x4c90e1(_0x11b29e[_0x229d('0x17')](0x1f4,_0x13f1b1[_0x229d('0x19')]));});});};exports[_0x229d('0x25')]=function(_0x4cc219){return new Promise(function(_0x35c56c,_0x4c3f38){return db['ChatInteraction'][_0x229d('0x26')]({'where':_0x4cc219['options']?_0x4cc219['options']['where']||null:null})[_0x229d('0x11')](function(_0x4ba141){if(_0x4ba141){return _0x4ba141[_0x229d('0x27')](_0x4cc219[_0x229d('0x1e')][_0x229d('0x28')],_[_0x229d('0x29')](_0x4cc219[_0x229d('0x1e')],['ids','id'])||{});}})[_0x229d('0x2a')](function(_0x47abe3){logger[_0x229d('0x12')](_0x229d('0x2b'),_0x4cc219);logger[_0x229d('0x15')]('AddTags',_0x4cc219,JSON[_0x229d('0x24')](_0x47abe3));_0x35c56c(_0x47abe3);})[_0x229d('0x1b')](function(_0x1cc8bc){logger[_0x229d('0x17')](_0x229d('0x2b'),_0x1cc8bc[_0x229d('0x19')],_0x4cc219);_0x4c3f38(_this[_0x229d('0x17')](0x1f4,_0x1cc8bc[_0x229d('0x19')]));});});};
\ No newline at end of file
+var _0x9f0e=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x38709e,_0x674239){var _0x5b4fa3=function(_0x132443){while(--_0x132443){_0x38709e['push'](_0x38709e['shift']());}};_0x5b4fa3(++_0x674239);}(_0x9f0e,0x115));var _0xe9f0=function(_0x2fce43,_0x1d9626){_0x2fce43=_0x2fce43-0x0;var _0x537102=_0x9f0e[_0x2fce43];return _0x537102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9f0('0x0'));var BPromise=require(_0xe9f0('0x1'));var rs=require(_0xe9f0('0x2'));var fs=require('fs');var Redis=require(_0xe9f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x4'));var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9f0('0x6'));var client=jayson[_0xe9f0('0x7')][_0xe9f0('0x8')]({'port':0x232a});config[_0xe9f0('0x9')]=_[_0xe9f0('0xa')](config[_0xe9f0('0x9')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x242147,_0x5ce997,_0x2c688d){return new BPromise(function(_0x25533b,_0x2cbd7d){return client['request'](_0x242147,_0x2c688d)['then'](function(_0x2f9d7b){logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,_0xe9f0('0x10'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5ce997,'request\x20sent',JSON['stringify'](_0x2f9d7b));if(_0x2f9d7b[_0xe9f0('0x11')]){if(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x12')]===0x1f4){logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x2cbd7d(_0x2f9d7b[_0xe9f0('0x11')]['message']);}logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x25533b(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x13')]);}else{logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,'request\x20sent');_0x25533b(_0x2f9d7b[_0xe9f0('0x14')][_0xe9f0('0x13')]);}})[_0xe9f0('0x15')](function(_0x43e3a8){logger[_0xe9f0('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5ce997,_0x43e3a8);_0x2cbd7d(_0x43e3a8);});});}exports[_0xe9f0('0x16')]=function(_0xd7ecd0){var _0x4708d8=this;return new Promise(function(_0xa1df12,_0x347b0a){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0xd7ecd0[_0xe9f0('0x19')],{'raw':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null,'attributes':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0['options'][_0xe9f0('0x1d')]||null:null,'limit':_0xd7ecd0['options']?_0xd7ecd0['options'][_0xe9f0('0x1e')]||null:null})[_0xe9f0('0x1f')](function(_0x369677){logger[_0xe9f0('0xe')](_0xe9f0('0x16'),_0xd7ecd0);logger[_0xe9f0('0x20')]('UpdateChatInteraction',_0xd7ecd0,JSON[_0xe9f0('0x21')](_0x369677));_0xa1df12(_0x369677);})[_0xe9f0('0x15')](function(_0x26e661){logger[_0xe9f0('0x11')](_0xe9f0('0x16'),_0x26e661['message'],_0xd7ecd0);_0x347b0a(_0x4708d8['error'](0x1f4,_0x26e661[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x22')]=function(_0x17f797){return new Promise(function(_0x8ac026,_0x505f93){return db[_0xe9f0('0x17')][_0xe9f0('0x23')]({'where':_0x17f797[_0xe9f0('0x1a')]?_0x17f797[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0x1f')](function(_0x3014fa){if(_0x3014fa){return _0x3014fa[_0xe9f0('0x24')](_0x17f797[_0xe9f0('0x19')][_0xe9f0('0x25')],_[_0xe9f0('0x26')](_0x17f797[_0xe9f0('0x19')],[_0xe9f0('0x25'),'id'])||{});}})[_0xe9f0('0x27')](function(_0x5c9772){logger[_0xe9f0('0xe')](_0xe9f0('0x28'),_0x17f797);logger[_0xe9f0('0x20')](_0xe9f0('0x28'),_0x17f797,JSON['stringify'](_0x5c9772));_0x8ac026(_0x5c9772);})[_0xe9f0('0x15')](function(_0x582148){logger[_0xe9f0('0x11')](_0xe9f0('0x28'),_0x582148[_0xe9f0('0x13')],_0x17f797);_0x505f93(_this[_0xe9f0('0x11')](0x1f4,_0x582148['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 64b2c35..2711d69 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 _0xe39c=['./chatInteraction.events','save','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x2d79b0,_0x29c6e9){var _0x323161=function(_0x170ae4){while(--_0x170ae4){_0x2d79b0['push'](_0x2d79b0['shift']());}};_0x323161(++_0x29c6e9);}(_0xe39c,0x98));var _0xce39=function(_0x3c582f,_0x223d44){_0x3c582f=_0x3c582f-0x0;var _0x37ba55=_0xe39c[_0x3c582f];return _0x37ba55;};'use strict';var ChatInteractionEvents=require(_0xce39('0x0'));var events=[_0xce39('0x1'),_0xce39('0x2'),_0xce39('0x3')];function createListener(_0x328df2,_0x3ad6da){return function(_0x47ecce){_0x3ad6da[_0xce39('0x4')](_0x328df2,_0x47ecce);};}function removeListener(_0x24b05e,_0x1870d2){return function(){ChatInteractionEvents[_0xce39('0x5')](_0x24b05e,_0x1870d2);};}exports[_0xce39('0x6')]=function(_0x11591c){for(var _0x577a4f=0x0,_0x55cf3c=events['length'];_0x577a4f<_0x55cf3c;_0x577a4f++){var _0xaf6c32=events[_0x577a4f];var _0x2a299d=createListener(_0xce39('0x7')+_0xaf6c32,_0x11591c);ChatInteractionEvents['on'](_0xaf6c32,_0x2a299d);}};
\ No newline at end of file
+var _0x6332=['remove','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x184ae4,_0x511d97){var _0x5bb118=function(_0x2af1c3){while(--_0x2af1c3){_0x184ae4['push'](_0x184ae4['shift']());}};_0x5bb118(++_0x511d97);}(_0x6332,0x133));var _0x2633=function(_0x88d014,_0x3daebb){_0x88d014=_0x88d014-0x0;var _0x373690=_0x6332[_0x88d014];return _0x373690;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2633('0x0'),_0x2633('0x1'),'update'];function createListener(_0x1e1e15,_0x5b3fca){return function(_0x34a09c){_0x5b3fca[_0x2633('0x2')](_0x1e1e15,_0x34a09c);};}function removeListener(_0x1fe5c2,_0x5174b7){return function(){ChatInteractionEvents[_0x2633('0x3')](_0x1fe5c2,_0x5174b7);};}exports[_0x2633('0x4')]=function(_0x45a63a){for(var _0x58f938=0x0,_0x25f01f=events[_0x2633('0x5')];_0x58f938<_0x25f01f;_0x58f938++){var _0x59d641=events[_0x58f938];var _0x522213=createListener(_0x2633('0x6')+_0x59d641,_0x45a63a);ChatInteractionEvents['on'](_0x59d641,_0x522213);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 40852a9..8152993 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 _0x4758=['chat','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/close','close','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','/:id/vidaoo','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags'];(function(_0x38b7a5,_0x12ae0e){var _0x117680=function(_0x17e970){while(--_0x17e970){_0x38b7a5['push'](_0x38b7a5['shift']());}};_0x117680(++_0x12ae0e);}(_0x4758,0x12b));var _0x8475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4758[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8475('0x0'));var util=require(_0x8475('0x1'));var path=require('path');var timeout=require(_0x8475('0x2'));var express=require(_0x8475('0x3'));var router=express[_0x8475('0x4')]();var fs_extra=require(_0x8475('0x5'));var auth=require(_0x8475('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8475('0x7'));var controller=require(_0x8475('0x8'));router[_0x8475('0x9')]('/',auth[_0x8475('0xa')](),controller[_0x8475('0xb')]);router['get'](_0x8475('0xc'),auth[_0x8475('0xa')](),controller[_0x8475('0xd')]);router[_0x8475('0x9')](_0x8475('0xe'),auth[_0x8475('0xf')](),controller[_0x8475('0x10')]);router['get'](_0x8475('0x11'),auth[_0x8475('0xf')](),controller[_0x8475('0x12')]);router['get'](_0x8475('0x13'),auth['isAuthenticated'](),controller[_0x8475('0x14')]);router[_0x8475('0x9')]('/:id/my_messages',auth[_0x8475('0xf')](),controller[_0x8475('0x15')]);router[_0x8475('0x9')](_0x8475('0x16'),auth[_0x8475('0xa')](),controller['download']);router[_0x8475('0x17')]('/',auth[_0x8475('0xa')](),controller[_0x8475('0x18')]);router[_0x8475('0x17')](_0x8475('0x19'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14b721,_0x36fa0e,_0x1a36ed){_0x1a36ed(null,path['join'](config[_0x8475('0x1a')],_0x8475('0x1b')));},'filename':function(_0x5a38b6,_0x408b98,_0x25333f){_0x25333f(null,util['format'](_0x8475('0x1c'),Date[_0x8475('0x1d')](),_0x408b98[_0x8475('0x1e')][_0x8475('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8475('0x17')](_0x8475('0x20'),upload[_0x8475('0x21')](_0x8475('0x22')),controller[_0x8475('0x23')]);router['post'](_0x8475('0x13'),auth[_0x8475('0xf')](),controller['addMessage']);router[_0x8475('0x17')](_0x8475('0x24'),auth[_0x8475('0xa')](),interaction['tracked'](_0x8475('0x25'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0x8475('0xe'),auth['isAuthenticated'](),interaction[_0x8475('0x26')](_0x8475('0x25'),_0x8475('0x27')),controller[_0x8475('0x28')]);router[_0x8475('0x29')](_0x8475('0x2a'),controller[_0x8475('0x2b')]);router[_0x8475('0x29')]('/:id/abandon',auth[_0x8475('0xf')](),controller['abandon']);router[_0x8475('0x29')](_0x8475('0x2c'),controller[_0x8475('0x2d')]);router[_0x8475('0x2e')](_0x8475('0xe'),auth[_0x8475('0xa')](),interaction['tracked'](_0x8475('0x25'),'chatinteraction:destroy'),controller['destroy']);router[_0x8475('0x2e')](_0x8475('0x24'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8475('0x2f')]=router;
\ No newline at end of file
+var _0x8ce6=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','destroy','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ce6,0xa0));var _0x68ce=function(_0x51bebf,_0x22aa21){_0x51bebf=_0x51bebf-0x0;var _0x95197d=_0x8ce6[_0x51bebf];return _0x95197d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x68ce('0x0'));var timeout=require(_0x68ce('0x1'));var express=require('express');var router=express[_0x68ce('0x2')]();var fs_extra=require(_0x68ce('0x3'));var auth=require(_0x68ce('0x4'));var interaction=require(_0x68ce('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x68ce('0x6')](),controller['index']);router['get'](_0x68ce('0x7'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x8')]);router[_0x68ce('0x9')](_0x68ce('0xa'),auth[_0x68ce('0xb')](),controller['show']);router['get'](_0x68ce('0xc'),auth[_0x68ce('0xb')](),controller[_0x68ce('0xd')]);router['get'](_0x68ce('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x68ce('0xf'),auth[_0x68ce('0xb')](),controller['getMyMessages']);router[_0x68ce('0x9')](_0x68ce('0x10'),auth[_0x68ce('0x6')](),controller['download']);router[_0x68ce('0x11')]('/',auth[_0x68ce('0x6')](),controller['create']);router[_0x68ce('0x11')](_0x68ce('0x12'),auth['isAuthenticated'](),controller[_0x68ce('0x13')]);var upload=multer({'storage':multer[_0x68ce('0x14')]({'destination':function(_0x44f36f,_0x4564f5,_0x38b1cf){_0x38b1cf(null,path[_0x68ce('0x15')](config[_0x68ce('0x16')],_0x68ce('0x17')));},'filename':function(_0x3852a9,_0x19b9e5,_0x3c589e){_0x3c589e(null,util[_0x68ce('0x18')](_0x68ce('0x19'),Date[_0x68ce('0x1a')](),_0x19b9e5[_0x68ce('0x1b')][_0x68ce('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68ce('0x11')]('/:id/attachment_upload',upload[_0x68ce('0x1d')](_0x68ce('0x1e')),controller[_0x68ce('0x1f')]);router[_0x68ce('0x11')]('/:id/messages',auth[_0x68ce('0xb')](),controller[_0x68ce('0x20')]);router[_0x68ce('0x11')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),interaction['tracked'](_0x68ce('0x22'),_0x68ce('0x23')),controller[_0x68ce('0x24')]);router[_0x68ce('0x25')](_0x68ce('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x68ce('0x26')),controller[_0x68ce('0x27')]);router['put'](_0x68ce('0x28'),controller[_0x68ce('0x29')]);router['put'](_0x68ce('0x2a'),auth[_0x68ce('0xb')](),controller[_0x68ce('0x2b')]);router[_0x68ce('0x25')](_0x68ce('0x2c'),controller['close']);router[_0x68ce('0x2d')](_0x68ce('0xa'),auth[_0x68ce('0x6')](),interaction[_0x68ce('0x2e')](_0x68ce('0x22'),'chatinteraction:destroy'),controller[_0x68ce('0x2f')]);router[_0x68ce('0x2d')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x30')]);module[_0x68ce('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 842ac9c..56f33ec 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 _0x4968=['BOOLEAN','INTEGER','sequelize','exports'];(function(_0x19da4d,_0x260981){var _0xc71c77=function(_0x4edb82){while(--_0x4edb82){_0x19da4d['push'](_0x19da4d['shift']());}};_0xc71c77(++_0x260981);}(_0x4968,0xea));var _0x8496=function(_0x2a3316,_0xe22ce9){_0x2a3316=_0x2a3316-0x0;var _0xd2f9e4=_0x4968[_0x2a3316];return _0xd2f9e4;};'use strict';var Sequelize=require(_0x8496('0x0'));module[_0x8496('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8496('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8496('0x3')]}};
\ No newline at end of file
+var _0x07a2=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x07a2,0x13d));var _0x207a=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x07a2[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x207a('0x0')]={'body':{'type':Sequelize[_0x207a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x207a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x207a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 5994580..3b78a9e 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 _0x8ea6=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','send','index','ChatInternalMessage','fieldName','key','model','map','name'];(function(_0x1d1a11,_0x471250){var _0x122a3c=function(_0x31dee5){while(--_0x31dee5){_0x1d1a11['push'](_0x1d1a11['shift']());}};_0x122a3c(++_0x471250);}(_0x8ea6,0x11a));var _0x68ea=function(_0x2096aa,_0x5c595d){_0x2096aa=_0x2096aa-0x0;var _0x3fc62d=_0x8ea6[_0x2096aa];return _0x3fc62d;};'use strict';var emlformat=require(_0x68ea('0x0'));var rimraf=require(_0x68ea('0x1'));var zipdir=require(_0x68ea('0x2'));var jsonpatch=require(_0x68ea('0x3'));var rp=require(_0x68ea('0x4'));var moment=require(_0x68ea('0x5'));var BPromise=require(_0x68ea('0x6'));var Mustache=require(_0x68ea('0x7'));var util=require(_0x68ea('0x8'));var path=require('path');var sox=require(_0x68ea('0x9'));var csv=require(_0x68ea('0xa'));var ejs=require(_0x68ea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ea('0xc'));var squel=require(_0x68ea('0xd'));var crypto=require(_0x68ea('0xe'));var jsforce=require(_0x68ea('0xf'));var deskjs=require(_0x68ea('0x10'));var toCsv=require(_0x68ea('0xa'));var querystring=require(_0x68ea('0x11'));var Papa=require(_0x68ea('0x12'));var Redis=require(_0x68ea('0x13'));var authService=require(_0x68ea('0x14'));var qs=require(_0x68ea('0x15'));var as=require(_0x68ea('0x16'));var hardwareService=require(_0x68ea('0x17'));var logger=require(_0x68ea('0x18'))(_0x68ea('0x19'));var utils=require(_0x68ea('0x1a'));var config=require(_0x68ea('0x1b'));var licenseUtil=require(_0x68ea('0x1c'));var db=require(_0x68ea('0x1d'))['db'];config['redis']=_['defaults'](config[_0x68ea('0x1e')],{'host':_0x68ea('0x1f'),'port':0x18eb});var socket=require(_0x68ea('0x20'))(new Redis(config[_0x68ea('0x1e')]));require(_0x68ea('0x21'))[_0x68ea('0x22')](socket);function respondWithStatusCode(_0x99e0c0,_0x3c41d1){_0x3c41d1=_0x3c41d1||0xcc;return function(_0x114533){if(_0x114533){return _0x99e0c0['sendStatus'](_0x3c41d1);}return _0x99e0c0[_0x68ea('0x23')](_0x3c41d1)['end']();};}function respondWithResult(_0xab966a,_0x343694){_0x343694=_0x343694||0xc8;return function(_0xdae5f8){if(_0xdae5f8){return _0xab966a[_0x68ea('0x23')](_0x343694)[_0x68ea('0x24')](_0xdae5f8);}};}function respondWithFilteredResult(_0x28819d,_0x251835){return function(_0x1c16a7){if(_0x1c16a7){var _0x4ad021=typeof _0x251835[_0x68ea('0x25')]===_0x68ea('0x26')&&typeof _0x251835['limit']===_0x68ea('0x26');var _0x2b66af=_0x1c16a7[_0x68ea('0x27')];var _0x2db301=_0x4ad021?0x0:_0x251835[_0x68ea('0x25')];var _0x2e54d3=_0x4ad021?_0x1c16a7['count']:_0x251835[_0x68ea('0x25')]+_0x251835[_0x68ea('0x28')];var _0x383c88;if(_0x2e54d3>=_0x2b66af){_0x2e54d3=_0x2b66af;_0x383c88=0xc8;}else{_0x383c88=0xce;}_0x28819d[_0x68ea('0x23')](_0x383c88);return _0x28819d[_0x68ea('0x29')](_0x68ea('0x2a'),_0x2db301+'-'+_0x2e54d3+'/'+_0x2b66af)['json'](_0x1c16a7);}return null;};}function patchUpdates(_0x2b9b86){return function(_0x364815){try{jsonpatch[_0x68ea('0x2b')](_0x364815,_0x2b9b86,!![]);}catch(_0x203c83){return BPromise[_0x68ea('0x2c')](_0x203c83);}return _0x364815[_0x68ea('0x2d')]();};}function saveUpdates(_0x2a8539,_0x25972a){return function(_0x5e76a8){if(_0x5e76a8){return _0x5e76a8[_0x68ea('0x2e')](_0x2a8539)[_0x68ea('0x2f')](function(_0x54f4b2){return _0x54f4b2;});}return null;};}function removeEntity(_0x228579,_0x505549){return function(_0x50e7f5){if(_0x50e7f5){return _0x50e7f5['destroy']()[_0x68ea('0x2f')](function(){_0x228579[_0x68ea('0x23')](0xcc)[_0x68ea('0x30')]();});}};}function handleEntityNotFound(_0x1af729,_0x53bcc8){return function(_0x2e778a){if(!_0x2e778a){_0x1af729[_0x68ea('0x31')](0x194);}return _0x2e778a;};}function handleError(_0x41f751,_0x45be7b){_0x45be7b=_0x45be7b||0x1f4;return function(_0x203ad4){logger[_0x68ea('0x32')](_0x203ad4[_0x68ea('0x33')]);if(_0x203ad4['name']){delete _0x203ad4['name'];}_0x41f751[_0x68ea('0x23')](_0x45be7b)[_0x68ea('0x34')](_0x203ad4);};}exports[_0x68ea('0x35')]=function(_0x2b58b7,_0x32b32f){var _0xb784b5={},_0xa97096={},_0x3207f1={'count':0x0,'rows':[]};var _0x554a62=_['map'](db[_0x68ea('0x36')]['rawAttributes'],function(_0x589d3d){return{'name':_0x589d3d[_0x68ea('0x37')],'type':_0x589d3d['type'][_0x68ea('0x38')]};});_0xa97096[_0x68ea('0x39')]=_[_0x68ea('0x3a')](_0x554a62,_0x68ea('0x3b'));_0xa97096[_0x68ea('0x3c')]=_[_0x68ea('0x3d')](_0x2b58b7[_0x68ea('0x3c')]);_0xa97096[_0x68ea('0x3e')]=_[_0x68ea('0x3f')](_0xa97096[_0x68ea('0x39')],_0xa97096[_0x68ea('0x3c')]);_0xb784b5[_0x68ea('0x40')]=_[_0x68ea('0x3f')](_0xa97096[_0x68ea('0x39')],qs[_0x68ea('0x41')](_0x2b58b7[_0x68ea('0x3c')]['fields']));_0xb784b5[_0x68ea('0x40')]=_0xb784b5[_0x68ea('0x40')][_0x68ea('0x42')]?_0xb784b5[_0x68ea('0x40')]:_0xa97096['model'];if(!_0x2b58b7['query']['hasOwnProperty'](_0x68ea('0x43'))){_0xb784b5[_0x68ea('0x28')]=qs[_0x68ea('0x28')](_0x2b58b7[_0x68ea('0x3c')]['limit']);_0xb784b5[_0x68ea('0x25')]=qs[_0x68ea('0x25')](_0x2b58b7[_0x68ea('0x3c')]['offset']);}_0xb784b5[_0x68ea('0x44')]=qs[_0x68ea('0x45')](_0x2b58b7['query'][_0x68ea('0x45')]);_0xb784b5[_0x68ea('0x46')]=qs[_0x68ea('0x3e')](_['pick'](_0x2b58b7[_0x68ea('0x3c')],_0xa97096['filters']),_0x554a62);if(_0x2b58b7[_0x68ea('0x3c')]['filter']){_0xb784b5[_0x68ea('0x46')]=_[_0x68ea('0x47')](_0xb784b5[_0x68ea('0x46')],{'$or':_['map'](_0x554a62,function(_0x3a4284){if(_0x3a4284[_0x68ea('0x48')]!==_0x68ea('0x49')){var _0x1b71f6={};_0x1b71f6[_0x3a4284['name']]={'$like':'%'+_0x2b58b7['query'][_0x68ea('0x4a')]+'%'};return _0x1b71f6;}})});}_0xb784b5=_[_0x68ea('0x47')]({},_0xb784b5,_0x2b58b7['options']);var _0x148b36={'where':_0xb784b5[_0x68ea('0x46')]};return db['ChatInternalMessage'][_0x68ea('0x27')](_0x148b36)['then'](function(_0x33de74){_0x3207f1[_0x68ea('0x27')]=_0x33de74;if(_0x2b58b7['query'][_0x68ea('0x4b')]){_0xb784b5[_0x68ea('0x4c')]=[{'all':!![]}];}return db[_0x68ea('0x36')][_0x68ea('0x4d')](_0xb784b5);})[_0x68ea('0x2f')](function(_0x25b266){_0x3207f1['rows']=_0x25b266;return _0x3207f1;})[_0x68ea('0x2f')](respondWithFilteredResult(_0x32b32f,_0xb784b5))[_0x68ea('0x4e')](handleError(_0x32b32f,null));};exports['show']=function(_0x1f8323,_0x17c32f){var _0xdd3bea={'raw':!![],'where':{'id':_0x1f8323[_0x68ea('0x4f')]['id']}},_0x17a7e3={};_0x17a7e3[_0x68ea('0x39')]=_[_0x68ea('0x3d')](db[_0x68ea('0x36')][_0x68ea('0x50')]);_0x17a7e3['query']=_[_0x68ea('0x3d')](_0x1f8323['query']);_0x17a7e3['filters']=_[_0x68ea('0x3f')](_0x17a7e3[_0x68ea('0x39')],_0x17a7e3['query']);_0xdd3bea[_0x68ea('0x40')]=_[_0x68ea('0x3f')](_0x17a7e3['model'],qs[_0x68ea('0x41')](_0x1f8323[_0x68ea('0x3c')][_0x68ea('0x41')]));_0xdd3bea[_0x68ea('0x40')]=_0xdd3bea[_0x68ea('0x40')][_0x68ea('0x42')]?_0xdd3bea[_0x68ea('0x40')]:_0x17a7e3['model'];if(_0x1f8323['query'][_0x68ea('0x4b')]){_0xdd3bea['include']=[{'all':!![]}];}_0xdd3bea=_['merge']({},_0xdd3bea,_0x1f8323['options']);return db[_0x68ea('0x36')][_0x68ea('0x51')](_0xdd3bea)[_0x68ea('0x2f')](handleEntityNotFound(_0x17c32f,null))[_0x68ea('0x2f')](respondWithResult(_0x17c32f,null))['catch'](handleError(_0x17c32f,null));};exports[_0x68ea('0x52')]=function(_0x84088a,_0x30d6da){return db[_0x68ea('0x36')]['create'](_0x84088a[_0x68ea('0x53')],{})['then'](respondWithResult(_0x30d6da,0xc9))[_0x68ea('0x4e')](handleError(_0x30d6da,null));};exports[_0x68ea('0x2e')]=function(_0x633241,_0x408daf){if(_0x633241['body']['id']){delete _0x633241[_0x68ea('0x53')]['id'];}return db['ChatInternalMessage'][_0x68ea('0x51')]({'where':{'id':_0x633241[_0x68ea('0x4f')]['id']}})[_0x68ea('0x2f')](handleEntityNotFound(_0x408daf,null))['then'](saveUpdates(_0x633241[_0x68ea('0x53')],null))['then'](respondWithResult(_0x408daf,null))[_0x68ea('0x4e')](handleError(_0x408daf,null));};exports['destroy']=function(_0x3f3123,_0x5eb16e){return db[_0x68ea('0x36')][_0x68ea('0x51')]({'where':{'id':_0x3f3123[_0x68ea('0x4f')]['id']}})[_0x68ea('0x2f')](handleEntityNotFound(_0x5eb16e,null))[_0x68ea('0x2f')](removeEntity(_0x5eb16e,null))['catch'](handleError(_0x5eb16e,null));};exports['describe']=function(_0x3312d4,_0x246ece){return db['ChatInternalMessage']['describe']()[_0x68ea('0x2f')](respondWithResult(_0x246ece,null))['catch'](handleError(_0x246ece,null));};function wrapUser(_0x5f4258){return function(_0x368da5){var _0xab1ca2=_0x5f4258[_0x68ea('0x54')]({'plain':!![]});_0xab1ca2[_0x68ea('0x55')]=[];if(_0x368da5){_0xab1ca2[_0x68ea('0x56')]=_0x368da5[_0x68ea('0x57')];_0xab1ca2[_0x68ea('0x58')]=_0x368da5;}else{_0xab1ca2[_0x68ea('0x56')]=moment(0x0)[_0x68ea('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0xab1ca2['lastMessage']={};}return _0xab1ca2;};}exports['getUsers']=function(_0xdb673a,_0x378d5b,_0x154032){var _0x59a648=[];return db[_0x68ea('0x5a')][_0x68ea('0x4d')]({'where':{'role':[_0x68ea('0x5b'),_0x68ea('0x5c'),_0x68ea('0x5d')]},'attributes':['id',_0x68ea('0x5e'),_0x68ea('0x3b'),_0x68ea('0x5f'),'userpic',_0x68ea('0x60'),_0x68ea('0x61'),_0x68ea('0x62'),_0x68ea('0x63'),'showWebBar'],'order':qs['sort'](_0x68ea('0x64')),'include':[{'model':db[_0x68ea('0x65')],'as':'VoiceQueues','attributes':['id','name',_0x68ea('0x48')],'through':{'attributes':[]}}]})[_0x68ea('0x2f')](function(_0x43d0ea){if(_0x43d0ea){var _0x4af248=_0xdb673a[_0x68ea('0x5d')][_0x68ea('0x54')]({'plain':!![]});if(!_0x4af248)throw new Error(_0x68ea('0x66'));if(_0x4af248[_0x68ea('0x5f')]===_0x68ea('0x5d')){return db[_0x68ea('0x67')]['find']({'where':{'name':_0x68ea('0x68'),'userProfileId':_0x4af248[_0x68ea('0x69')]},'raw':!![]})['then'](function(_0x167c1e){if(_0x167c1e){if(_0x167c1e['autoAssociation']===0x0){return db[_0x68ea('0x6a')][_0x68ea('0x4d')]({'where':{'sectionId':_0x167c1e['id']},'raw':!![]})[_0x68ea('0x2f')](function(_0x2fdea5){var _0x39375d=[];if(_[_0x68ea('0x6b')](_0x2fdea5)){_0x39375d=_['filter'](_0x43d0ea,function(_0x2a7fbd){if(_0x2a7fbd['role']!=='agent'){return _0x2a7fbd;}});return _0x39375d;}else{for(var _0x42aae8=0x0;_0x42aae8<_0x43d0ea['length'];_0x42aae8++){var _0x5d2e5a=_0x43d0ea[_0x42aae8];if(_0x5d2e5a[_0x68ea('0x5f')]==='agent'){var _0x5cad3b=_[_0x68ea('0x51')](_0x2fdea5,function(_0x42b072){return _0x42b072[_0x68ea('0x6c')]===_0x5d2e5a['id'];});if(_0x5cad3b)_0x39375d[_0x68ea('0x6d')](_0x5d2e5a);}else{_0x39375d[_0x68ea('0x6d')](_0x5d2e5a);}}return _0x39375d;}});}else{return _0x43d0ea;}}else{var _0x5286a2=_[_0x68ea('0x4a')](_0x43d0ea,function(_0x40e57b){if(_0x40e57b[_0x68ea('0x5f')]!==_0x68ea('0x5b')){return _0x40e57b;}});return _0x5286a2;}});}else{return _0x43d0ea;}}})[_0x68ea('0x2f')](function(_0x54de30){var _0x337d1b=[];if(_0x54de30){_0x59a648=_0x54de30;for(var _0x1b98d0=0x0;_0x1b98d0<_0x54de30[_0x68ea('0x42')];_0x1b98d0+=0x1){_0x59a648[_0x1b98d0][_0x68ea('0x55')]=[];_0x337d1b[_0x68ea('0x6d')](db[_0x68ea('0x36')][_0x68ea('0x51')]({'where':{'FromId':[_0xdb673a[_0x68ea('0x5d')]['id'],_0x54de30[_0x1b98d0]['id']],'ToId':[_0xdb673a[_0x68ea('0x5d')]['id'],_0x54de30[_0x1b98d0]['id']],'ChatGroupId':null},'attributes':['id',_0x68ea('0x57'),_0x68ea('0x6e'),_0x68ea('0x6f'),_0x68ea('0x70'),_0x68ea('0x53')],'order':qs[_0x68ea('0x45')](_0x68ea('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x68ea('0x2f')](wrapUser(_0x54de30[_0x1b98d0])));}return BPromise['all'](_0x337d1b);}return[];})[_0x68ea('0x2f')](function(_0x2dac15){return{'rows':_0x2dac15,'count':_0x2dac15[_0x68ea('0x42')]};})[_0x68ea('0x2f')](respondWithResult(_0x378d5b,null))['catch'](handleError(_0x378d5b,null));};
\ No newline at end of file
+var _0x1f50=['intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x254974,_0x2c8a95){var _0x3e95f9=function(_0x128bef){while(--_0x128bef){_0x254974['push'](_0x254974['shift']());}};_0x3e95f9(++_0x2c8a95);}(_0x1f50,0x104));var _0x01f5=function(_0x5695a0,_0x3963d2){_0x5695a0=_0x5695a0-0x0;var _0x83dbf7=_0x1f50[_0x5695a0];return _0x83dbf7;};'use strict';var emlformat=require(_0x01f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01f5('0x1'));var jsonpatch=require(_0x01f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01f5('0x3'));var path=require(_0x01f5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f5('0x5'));var fs=require('fs');var fs_extra=require(_0x01f5('0x6'));var _=require(_0x01f5('0x7'));var squel=require(_0x01f5('0x8'));var crypto=require(_0x01f5('0x9'));var jsforce=require(_0x01f5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x01f5('0xb'));var querystring=require(_0x01f5('0xc'));var Papa=require(_0x01f5('0xd'));var Redis=require(_0x01f5('0xe'));var authService=require(_0x01f5('0xf'));var qs=require(_0x01f5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f5('0x11'))(_0x01f5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x01f5('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x01f5('0x14')](config['redis'],{'host':_0x01f5('0x15'),'port':0x18eb});var socket=require(_0x01f5('0x16'))(new Redis(config[_0x01f5('0x17')]));require('./chatInternalMessage.socket')[_0x01f5('0x18')](socket);function respondWithStatusCode(_0x1e3f1c,_0x4ecfff){_0x4ecfff=_0x4ecfff||0xcc;return function(_0x3ea4bd){if(_0x3ea4bd){return _0x1e3f1c[_0x01f5('0x19')](_0x4ecfff);}return _0x1e3f1c[_0x01f5('0x1a')](_0x4ecfff)[_0x01f5('0x1b')]();};}function respondWithResult(_0x38d41d,_0x190fda){_0x190fda=_0x190fda||0xc8;return function(_0x902895){if(_0x902895){return _0x38d41d[_0x01f5('0x1a')](_0x190fda)[_0x01f5('0x1c')](_0x902895);}};}function respondWithFilteredResult(_0x2a0be0,_0xa2abf9){return function(_0x125851){if(_0x125851){var _0x38c1b9=typeof _0xa2abf9[_0x01f5('0x1d')]===_0x01f5('0x1e')&&typeof _0xa2abf9[_0x01f5('0x1f')]===_0x01f5('0x1e');var _0x198eca=_0x125851[_0x01f5('0x20')];var _0x4de33e=_0x38c1b9?0x0:_0xa2abf9[_0x01f5('0x1d')];var _0x4dd194=_0x38c1b9?_0x125851[_0x01f5('0x20')]:_0xa2abf9['offset']+_0xa2abf9[_0x01f5('0x1f')];var _0x1eb156;if(_0x4dd194>=_0x198eca){_0x4dd194=_0x198eca;_0x1eb156=0xc8;}else{_0x1eb156=0xce;}_0x2a0be0[_0x01f5('0x1a')](_0x1eb156);return _0x2a0be0['set']('Content-Range',_0x4de33e+'-'+_0x4dd194+'/'+_0x198eca)[_0x01f5('0x1c')](_0x125851);}return null;};}function patchUpdates(_0x380a4c){return function(_0x10a040){try{jsonpatch['apply'](_0x10a040,_0x380a4c,!![]);}catch(_0x6f446b){return BPromise[_0x01f5('0x21')](_0x6f446b);}return _0x10a040[_0x01f5('0x22')]();};}function saveUpdates(_0x31478d,_0x5386c1){return function(_0x47e82b){if(_0x47e82b){return _0x47e82b[_0x01f5('0x23')](_0x31478d)[_0x01f5('0x24')](function(_0x3e904a){return _0x3e904a;});}return null;};}function removeEntity(_0x5ad70a,_0x45d595){return function(_0x22176e){if(_0x22176e){return _0x22176e[_0x01f5('0x25')]()[_0x01f5('0x24')](function(){_0x5ad70a[_0x01f5('0x1a')](0xcc)[_0x01f5('0x1b')]();});}};}function handleEntityNotFound(_0x323763,_0x3336bf){return function(_0x5b7f47){if(!_0x5b7f47){_0x323763[_0x01f5('0x19')](0x194);}return _0x5b7f47;};}function handleError(_0xd0d190,_0x5df797){_0x5df797=_0x5df797||0x1f4;return function(_0x2d3a87){logger[_0x01f5('0x26')](_0x2d3a87[_0x01f5('0x27')]);if(_0x2d3a87[_0x01f5('0x28')]){delete _0x2d3a87['name'];}_0xd0d190[_0x01f5('0x1a')](_0x5df797)['send'](_0x2d3a87);};}exports[_0x01f5('0x29')]=function(_0x54fbc3,_0x284f93){var _0x1970e9={},_0x4ff97b={},_0x204c6f={'count':0x0,'rows':[]};var _0x3fd842=_[_0x01f5('0x2a')](db[_0x01f5('0x2b')][_0x01f5('0x2c')],function(_0x1916bf){return{'name':_0x1916bf[_0x01f5('0x2d')],'type':_0x1916bf[_0x01f5('0x2e')][_0x01f5('0x2f')]};});_0x4ff97b[_0x01f5('0x30')]=_['map'](_0x3fd842,_0x01f5('0x28'));_0x4ff97b['query']=_['keys'](_0x54fbc3[_0x01f5('0x31')]);_0x4ff97b[_0x01f5('0x32')]=_['intersection'](_0x4ff97b[_0x01f5('0x30')],_0x4ff97b['query']);_0x1970e9[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x4ff97b[_0x01f5('0x30')],qs[_0x01f5('0x35')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x35')]));_0x1970e9[_0x01f5('0x33')]=_0x1970e9['attributes'][_0x01f5('0x36')]?_0x1970e9[_0x01f5('0x33')]:_0x4ff97b[_0x01f5('0x30')];if(!_0x54fbc3['query'][_0x01f5('0x37')]('nolimit')){_0x1970e9[_0x01f5('0x1f')]=qs[_0x01f5('0x1f')](_0x54fbc3[_0x01f5('0x31')]['limit']);_0x1970e9['offset']=qs[_0x01f5('0x1d')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x1d')]);}_0x1970e9[_0x01f5('0x38')]=qs[_0x01f5('0x39')](_0x54fbc3['query'][_0x01f5('0x39')]);_0x1970e9['where']=qs[_0x01f5('0x32')](_[_0x01f5('0x3a')](_0x54fbc3[_0x01f5('0x31')],_0x4ff97b[_0x01f5('0x32')]),_0x3fd842);if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]){_0x1970e9['where']=_[_0x01f5('0x3c')](_0x1970e9[_0x01f5('0x3d')],{'$or':_[_0x01f5('0x2a')](_0x3fd842,function(_0x323e94){if(_0x323e94[_0x01f5('0x2e')]!==_0x01f5('0x3e')){var _0x51405c={};_0x51405c[_0x323e94[_0x01f5('0x28')]]={'$like':'%'+_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]+'%'};return _0x51405c;}})});}_0x1970e9=_[_0x01f5('0x3c')]({},_0x1970e9,_0x54fbc3['options']);var _0x30f79={'where':_0x1970e9[_0x01f5('0x3d')]};return db[_0x01f5('0x2b')]['count'](_0x30f79)[_0x01f5('0x24')](function(_0xb04d96){_0x204c6f['count']=_0xb04d96;if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x1970e9[_0x01f5('0x40')]=[{'all':!![]}];}return db[_0x01f5('0x2b')]['findAll'](_0x1970e9);})['then'](function(_0x482850){_0x204c6f[_0x01f5('0x41')]=_0x482850;return _0x204c6f;})[_0x01f5('0x24')](respondWithFilteredResult(_0x284f93,_0x1970e9))[_0x01f5('0x42')](handleError(_0x284f93,null));};exports[_0x01f5('0x43')]=function(_0xc986f1,_0x3de016){var _0x3182d0={'raw':!![],'where':{'id':_0xc986f1['params']['id']}},_0x23109f={};_0x23109f[_0x01f5('0x30')]=_[_0x01f5('0x44')](db[_0x01f5('0x2b')][_0x01f5('0x2c')]);_0x23109f[_0x01f5('0x31')]=_[_0x01f5('0x44')](_0xc986f1['query']);_0x23109f['filters']=_[_0x01f5('0x34')](_0x23109f[_0x01f5('0x30')],_0x23109f['query']);_0x3182d0[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x23109f['model'],qs[_0x01f5('0x35')](_0xc986f1[_0x01f5('0x31')][_0x01f5('0x35')]));_0x3182d0['attributes']=_0x3182d0[_0x01f5('0x33')]['length']?_0x3182d0[_0x01f5('0x33')]:_0x23109f['model'];if(_0xc986f1[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x3182d0['include']=[{'all':!![]}];}_0x3182d0=_[_0x01f5('0x3c')]({},_0x3182d0,_0xc986f1[_0x01f5('0x45')]);return db[_0x01f5('0x2b')][_0x01f5('0x46')](_0x3182d0)['then'](handleEntityNotFound(_0x3de016,null))[_0x01f5('0x24')](respondWithResult(_0x3de016,null))[_0x01f5('0x42')](handleError(_0x3de016,null));};exports[_0x01f5('0x47')]=function(_0x11f81a,_0xc63c91){return db[_0x01f5('0x2b')][_0x01f5('0x47')](_0x11f81a[_0x01f5('0x48')],{})[_0x01f5('0x24')](respondWithResult(_0xc63c91,0xc9))[_0x01f5('0x42')](handleError(_0xc63c91,null));};exports['update']=function(_0xa90d74,_0x303cf1){if(_0xa90d74['body']['id']){delete _0xa90d74[_0x01f5('0x48')]['id'];}return db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'id':_0xa90d74[_0x01f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x303cf1,null))[_0x01f5('0x24')](saveUpdates(_0xa90d74[_0x01f5('0x48')],null))['then'](respondWithResult(_0x303cf1,null))[_0x01f5('0x42')](handleError(_0x303cf1,null));};exports[_0x01f5('0x25')]=function(_0x20509a,_0x4c38af){return db[_0x01f5('0x2b')]['find']({'where':{'id':_0x20509a['params']['id']}})['then'](handleEntityNotFound(_0x4c38af,null))[_0x01f5('0x24')](removeEntity(_0x4c38af,null))[_0x01f5('0x42')](handleError(_0x4c38af,null));};exports['describe']=function(_0x29fd7d,_0x4f2a7f){return db[_0x01f5('0x2b')][_0x01f5('0x4a')]()[_0x01f5('0x24')](respondWithResult(_0x4f2a7f,null))[_0x01f5('0x42')](handleError(_0x4f2a7f,null));};function wrapUser(_0x2b288a){return function(_0x10261f){var _0x56dd0d=_0x2b288a['get']({'plain':!![]});_0x56dd0d['messages']=[];if(_0x10261f){_0x56dd0d['lastMessageAt']=_0x10261f[_0x01f5('0x4b')];_0x56dd0d['lastMessage']=_0x10261f;}else{_0x56dd0d[_0x01f5('0x4c')]=moment(0x0)['format'](_0x01f5('0x4d'));_0x56dd0d['lastMessage']={};}return _0x56dd0d;};}exports[_0x01f5('0x4e')]=function(_0x228537,_0x2e5dbb,_0xe964da){var _0xfc4e96=[];return db['User'][_0x01f5('0x4f')]({'where':{'role':['agent',_0x01f5('0x50'),_0x01f5('0x51')]},'attributes':['id',_0x01f5('0x52'),_0x01f5('0x28'),_0x01f5('0x53'),_0x01f5('0x54'),_0x01f5('0x55'),'online',_0x01f5('0x56'),'allowmessenger',_0x01f5('0x57')],'order':qs[_0x01f5('0x39')](_0x01f5('0x58')),'include':[{'model':db[_0x01f5('0x59')],'as':_0x01f5('0x5a'),'attributes':['id',_0x01f5('0x28'),'type'],'through':{'attributes':[]}}]})[_0x01f5('0x24')](function(_0x1e0940){if(_0x1e0940){var _0x1df495=_0x228537[_0x01f5('0x51')]['get']({'plain':!![]});if(!_0x1df495)throw new Error(_0x01f5('0x5b'));if(_0x1df495[_0x01f5('0x53')]===_0x01f5('0x51')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x1df495[_0x01f5('0x5c')]},'raw':!![]})[_0x01f5('0x24')](function(_0x5909ab){if(_0x5909ab){if(_0x5909ab[_0x01f5('0x5d')]===0x0){return db[_0x01f5('0x5e')]['findAll']({'where':{'sectionId':_0x5909ab['id']},'raw':!![]})[_0x01f5('0x24')](function(_0x38db76){var _0x1ccb05=[];if(_[_0x01f5('0x5f')](_0x38db76)){_0x1ccb05=_[_0x01f5('0x3b')](_0x1e0940,function(_0x34bed0){if(_0x34bed0[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x34bed0;}});return _0x1ccb05;}else{for(var _0x445ae7=0x0;_0x445ae7<_0x1e0940[_0x01f5('0x36')];_0x445ae7++){var _0x1eabaa=_0x1e0940[_0x445ae7];if(_0x1eabaa['role']===_0x01f5('0x60')){var _0x4b8610=_[_0x01f5('0x46')](_0x38db76,function(_0x509d65){return _0x509d65[_0x01f5('0x61')]===_0x1eabaa['id'];});if(_0x4b8610)_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}else{_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}}return _0x1ccb05;}});}else{return _0x1e0940;}}else{var _0x45cfe6=_[_0x01f5('0x3b')](_0x1e0940,function(_0x1073cc){if(_0x1073cc[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x1073cc;}});return _0x45cfe6;}});}else{return _0x1e0940;}}})[_0x01f5('0x24')](function(_0x268101){var _0x38473d=[];if(_0x268101){_0xfc4e96=_0x268101;for(var _0x2417af=0x0;_0x2417af<_0x268101[_0x01f5('0x36')];_0x2417af+=0x1){_0xfc4e96[_0x2417af][_0x01f5('0x63')]=[];_0x38473d[_0x01f5('0x62')](db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'FromId':[_0x228537[_0x01f5('0x51')]['id'],_0x268101[_0x2417af]['id']],'ToId':[_0x228537['user']['id'],_0x268101[_0x2417af]['id']],'ChatGroupId':null},'attributes':['id',_0x01f5('0x4b'),_0x01f5('0x64'),_0x01f5('0x65'),_0x01f5('0x66'),_0x01f5('0x48')],'order':qs[_0x01f5('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x268101[_0x2417af])));}return BPromise[_0x01f5('0x67')](_0x38473d);}return[];})['then'](function(_0xd4e087){return{'rows':_0xd4e087,'count':_0xd4e087['length']};})[_0x01f5('0x24')](respondWithResult(_0x2e5dbb,null))[_0x01f5('0x42')](handleError(_0x2e5dbb,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d2be053..fe38dd5 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 _0xd876=['emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','remove'];(function(_0x84d9dd,_0x13db4b){var _0x58587b=function(_0x28937d){while(--_0x28937d){_0x84d9dd['push'](_0x84d9dd['shift']());}};_0x58587b(++_0x13db4b);}(_0xd876,0x11b));var _0x6d87=function(_0x235ea7,_0x58b6d7){_0x235ea7=_0x235ea7-0x0;var _0x367ab0=_0xd876[_0x235ea7];return _0x367ab0;};'use strict';var EventEmitter=require(_0x6d87('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6d87('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6d87('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6d87('0x3')};function emitEvent(_0x103e0b){return function(_0x3d239a,_0x3e4359,_0x7df2e1){ChatInternalMessageEvents[_0x6d87('0x4')](_0x103e0b+':'+_0x3d239a['id'],_0x3d239a);ChatInternalMessageEvents[_0x6d87('0x4')](_0x103e0b,_0x3d239a);_0x7df2e1(null);};}for(var e in events){if(events[_0x6d87('0x5')](e)){var event=events[e];ChatInternalMessage[_0x6d87('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb435=['emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x5c6f36,_0xbd2a45){var _0x19569f=function(_0xa98b75){while(--_0xa98b75){_0x5c6f36['push'](_0x5c6f36['shift']());}};_0x19569f(++_0xbd2a45);}(_0xb435,0x13e));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x5b43('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x5b43('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5b43('0x2')](0x0);var events={'afterCreate':_0x5b43('0x3'),'afterUpdate':_0x5b43('0x4'),'afterDestroy':_0x5b43('0x5')};function emitEvent(_0x224c11){return function(_0x41afcd,_0x328b1d,_0x55c9b2){ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11+':'+_0x41afcd['id'],_0x41afcd);ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11,_0x41afcd);_0x55c9b2(null);};}for(var e in events){if(events[_0x5b43('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5b43('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d94d038..cc62a9d 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 _0xcc94=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xcc94,0x84));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4cc9('0x0'));var util=require(_0x4cc9('0x1'));var logger=require(_0x4cc9('0x2'))('api');var moment=require(_0x4cc9('0x3'));var BPromise=require(_0x4cc9('0x4'));var rp=require(_0x4cc9('0x5'));var fs=require('fs');var path=require(_0x4cc9('0x6'));var rimraf=require(_0x4cc9('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x5c6db2,_0x13cfa1){return _0x5c6db2[_0x4cc9('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x4cc9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4cc9('0xa')});};
\ No newline at end of file
+var _0x555b=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x555b,0xe1));var _0xb555=function(_0xbd499f,_0x315793){_0xbd499f=_0xbd499f-0x0;var _0x2d2d12=_0x555b[_0xbd499f];return _0x2d2d12;};'use strict';var _=require(_0xb555('0x0'));var util=require(_0xb555('0x1'));var logger=require(_0xb555('0x2'))(_0xb555('0x3'));var moment=require(_0xb555('0x4'));var BPromise=require(_0xb555('0x5'));var rp=require(_0xb555('0x6'));var fs=require('fs');var path=require(_0xb555('0x7'));var rimraf=require(_0xb555('0x8'));var config=require('../../config/environment');var attributes=require(_0xb555('0x9'));module[_0xb555('0xa')]=function(_0x4638b8,_0x131e43){return _0x4638b8[_0xb555('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 8eca7e8..15d2274 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 _0x08bb=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x3acb89,_0x2ca05e){var _0x4d38f2=function(_0x4cb6a9){while(--_0x4cb6a9){_0x3acb89['push'](_0x3acb89['shift']());}};_0x4d38f2(++_0x2ca05e);}(_0x08bb,0x177));var _0xb08b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x08bb[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xb08b('0x0'));var util=require(_0xb08b('0x1'));var moment=require('moment');var BPromise=require(_0xb08b('0x2'));var rs=require(_0xb08b('0x3'));var fs=require('fs');var Redis=require(_0xb08b('0x4'));var db=require(_0xb08b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb08b('0x6'))(_0xb08b('0x7'));var config=require(_0xb08b('0x8'));var jayson=require(_0xb08b('0x9'));var client=jayson[_0xb08b('0xa')][_0xb08b('0xb')]({'port':0x232a});config[_0xb08b('0xc')]=_['defaults'](config[_0xb08b('0xc')],{'host':_0xb08b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb08b('0xc')]));require(_0xb08b('0xe'))[_0xb08b('0xf')](socket);function respondWithRpcPromise(_0x4b7f9b,_0x4c3727,_0x3205f5){return new BPromise(function(_0x40b9cf,_0x5b41f2){return client['request'](_0x4b7f9b,_0x3205f5)[_0xb08b('0x10')](function(_0x53a4d2){logger[_0xb08b('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c3727,_0xb08b('0x12'));logger[_0xb08b('0x13')](_0xb08b('0x14'),_0x4c3727,_0xb08b('0x12'),JSON['stringify'](_0x53a4d2));if(_0x53a4d2[_0xb08b('0x15')]){if(_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x16')]===0x1f4){logger[_0xb08b('0x15')](_0xb08b('0x17'),_0x4c3727,_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);return _0x5b41f2(_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);}logger[_0xb08b('0x15')](_0xb08b('0x17'),_0x4c3727,_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);return _0x40b9cf(_0x53a4d2['error'][_0xb08b('0x18')]);}else{logger[_0xb08b('0x11')](_0xb08b('0x17'),_0x4c3727,'request\x20sent');_0x40b9cf(_0x53a4d2[_0xb08b('0x19')][_0xb08b('0x18')]);}})[_0xb08b('0x1a')](function(_0x2f3625){logger['error'](_0xb08b('0x17'),_0x4c3727,_0x2f3625);_0x5b41f2(_0x2f3625);});});}
\ No newline at end of file
+var _0x7721=['client','http','localhost','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xebb209,_0x5b286c){var _0x5f3a20=function(_0x49e974){while(--_0x49e974){_0xebb209['push'](_0xebb209['shift']());}};_0x5f3a20(++_0x5b286c);}(_0x7721,0x115));var _0x1772=function(_0x57c27c,_0x4496ac){_0x57c27c=_0x57c27c-0x0;var _0x2f356e=_0x7721[_0x57c27c];return _0x2f356e;};'use strict';var _=require(_0x1772('0x0'));var util=require(_0x1772('0x1'));var moment=require(_0x1772('0x2'));var BPromise=require(_0x1772('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1772('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1772('0x5'))(_0x1772('0x6'));var config=require(_0x1772('0x7'));var jayson=require(_0x1772('0x8'));var client=jayson[_0x1772('0x9')][_0x1772('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1772('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1772('0xc')]));require(_0x1772('0xd'))[_0x1772('0xe')](socket);function respondWithRpcPromise(_0xd6e82a,_0xd65598,_0x2b6e89){return new BPromise(function(_0x4630cc,_0x3ffa84){return client[_0x1772('0xf')](_0xd6e82a,_0x2b6e89)[_0x1772('0x10')](function(_0xfb07a8){logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,'request\x20sent');logger[_0x1772('0x13')](_0x1772('0x14'),_0xd65598,_0x1772('0x15'),JSON['stringify'](_0xfb07a8));if(_0xfb07a8[_0x1772('0x16')]){if(_0xfb07a8['error']['code']===0x1f4){logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x3ffa84(_0xfb07a8[_0x1772('0x16')]['message']);}logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x4630cc(_0xfb07a8['error'][_0x1772('0x17')]);}else{logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,_0x1772('0x15'));_0x4630cc(_0xfb07a8[_0x1772('0x18')]['message']);}})[_0x1772('0x19')](function(_0xd2fdd5){logger['error'](_0x1772('0x12'),_0xd65598,_0xd2fdd5);_0x3ffa84(_0xd2fdd5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4e419f1..86b4808 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 _0xba00=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x22909b,_0x4a8a54){var _0x16b258=function(_0xd96eae){while(--_0xd96eae){_0x22909b['push'](_0x22909b['shift']());}};_0x16b258(++_0x4a8a54);}(_0xba00,0x1eb));var _0x0ba0=function(_0x58fda8,_0x247b57){_0x58fda8=_0x58fda8-0x0;var _0x3a9b61=_0xba00[_0x58fda8];return _0x3a9b61;};'use strict';var ChatInternalMessageEvents=require(_0x0ba0('0x0'));var events=[_0x0ba0('0x1'),'remove','update'];function createListener(_0x428bba,_0x2e32a2){return function(_0x597ed9){_0x2e32a2[_0x0ba0('0x2')](_0x428bba,_0x597ed9);};}function removeListener(_0x566090,_0x2378f4){return function(){ChatInternalMessageEvents[_0x0ba0('0x3')](_0x566090,_0x2378f4);};}exports[_0x0ba0('0x4')]=function(_0x4bffbc){for(var _0x4783a7=0x0,_0x425e2e=events[_0x0ba0('0x5')];_0x4783a7<_0x425e2e;_0x4783a7++){var _0x21e32e=events[_0x4783a7];var _0x4441f2=createListener(_0x0ba0('0x6')+_0x21e32e,_0x4bffbc);ChatInternalMessageEvents['on'](_0x21e32e,_0x4441f2);}};
\ No newline at end of file
+var _0x2a91=['./chatInternalMessage.events','remove','update','removeListener'];(function(_0x5ee5ef,_0x2267eb){var _0x1e608d=function(_0x34cf1e){while(--_0x34cf1e){_0x5ee5ef['push'](_0x5ee5ef['shift']());}};_0x1e608d(++_0x2267eb);}(_0x2a91,0x1cc));var _0x12a9=function(_0x3a55a6,_0x4a8738){_0x3a55a6=_0x3a55a6-0x0;var _0xc40765=_0x2a91[_0x3a55a6];return _0xc40765;};'use strict';var ChatInternalMessageEvents=require(_0x12a9('0x0'));var events=['save',_0x12a9('0x1'),_0x12a9('0x2')];function createListener(_0x4c6841,_0x758e24){return function(_0xd4eb28){_0x758e24['emit'](_0x4c6841,_0xd4eb28);};}function removeListener(_0x334c06,_0xe010e){return function(){ChatInternalMessageEvents[_0x12a9('0x3')](_0x334c06,_0xe010e);};}exports['register']=function(_0x548905){for(var _0x3acb73=0x0,_0x4aa20e=events['length'];_0x3acb73<_0x4aa20e;_0x3acb73++){var _0xcb25=events[_0x3acb73];var _0x477274=createListener('chatInternalMessage:'+_0xcb25,_0x548905);ChatInternalMessageEvents['on'](_0xcb25,_0x477274);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d6aceb2..1fbcaf9 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 _0x4cbe=['put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','post','create'];(function(_0x56d3a2,_0x5f191b){var _0x2c14d0=function(_0xb776e2){while(--_0xb776e2){_0x56d3a2['push'](_0x56d3a2['shift']());}};_0x2c14d0(++_0x5f191b);}(_0x4cbe,0x16e));var _0xe4cb=function(_0x5f22de,_0x4cd696){_0x5f22de=_0x5f22de-0x0;var _0x5c54a0=_0x4cbe[_0x5f22de];return _0x5c54a0;};'use strict';var multer=require(_0xe4cb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe4cb('0x1'));var router=express[_0xe4cb('0x2')]();var fs_extra=require(_0xe4cb('0x3'));var auth=require(_0xe4cb('0x4'));var interaction=require(_0xe4cb('0x5'));var config=require(_0xe4cb('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe4cb('0x7')]('/',auth[_0xe4cb('0x8')](),controller[_0xe4cb('0x9')]);router[_0xe4cb('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xe4cb('0xa')]);router[_0xe4cb('0x7')](_0xe4cb('0xb'),auth[_0xe4cb('0x8')](),controller['getUsers']);router[_0xe4cb('0x7')]('/:id',auth[_0xe4cb('0x8')](),controller['show']);router[_0xe4cb('0xc')]('/',auth['isAuthenticated'](),controller[_0xe4cb('0xd')]);router[_0xe4cb('0xe')](_0xe4cb('0xf'),controller[_0xe4cb('0x10')]);router[_0xe4cb('0x11')](_0xe4cb('0xf'),auth[_0xe4cb('0x8')](),controller[_0xe4cb('0x12')]);module[_0xe4cb('0x13')]=router;
\ No newline at end of file
+var _0xbe58=['index','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xbe58,0x90));var _0x8be5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbe58[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x8be5('0x0'));var util=require(_0x8be5('0x1'));var path=require(_0x8be5('0x2'));var timeout=require('connect-timeout');var express=require(_0x8be5('0x3'));var router=express[_0x8be5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8be5('0x5'));var interaction=require(_0x8be5('0x6'));var config=require('../../config/environment');var controller=require(_0x8be5('0x7'));router[_0x8be5('0x8')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0xa')]);router['get']('/describe',auth[_0x8be5('0x9')](),controller[_0x8be5('0xb')]);router[_0x8be5('0x8')](_0x8be5('0xc'),auth['isAuthenticated'](),controller[_0x8be5('0xd')]);router[_0x8be5('0x8')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0xf')]);router[_0x8be5('0x10')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0x11')]);router[_0x8be5('0x12')](_0x8be5('0xe'),controller[_0x8be5('0x13')]);router[_0x8be5('0x14')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 087563a..b83517c 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 _0x80ed=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x1d489f,_0x4afab7){var _0x1d7643=function(_0x18b771){while(--_0x18b771){_0x1d489f['push'](_0x1d489f['shift']());}};_0x1d7643(++_0x4afab7);}(_0x80ed,0x11c));var _0xd80e=function(_0x28271b,_0x418cf3){_0x28271b=_0x28271b-0x0;var _0x3593bd=_0x80ed[_0x28271b];return _0x3593bd;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'body':{'type':Sequelize[_0xd80e('0x1')](_0xd80e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd80e('0x4')]('in',_0xd80e('0x5')),'defaultValue':_0xd80e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd80e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd80e('0x1')]}};
\ No newline at end of file
+var _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3a9b70,_0x3b362a){var _0x11d6b5=function(_0x87a9db){while(--_0x87a9db){_0x3a9b70['push'](_0x3a9b70['shift']());}};_0x11d6b5(++_0x3b362a);}(_0xfd6f,0x19d));var _0xffd6=function(_0x225d7e,_0x1e8eed){_0x225d7e=_0x225d7e-0x0;var _0x3924d4=_0xfd6f[_0x225d7e];return _0x3924d4;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index f3575b4..531e169 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 _0x7c0f=['index','ChatMessage','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','filters','find','create','body','describe','../../config/logger','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x7c0f,0x1d3));var _0xf7c0=function(_0x1fb86c,_0x1889de){_0x1fb86c=_0x1fb86c-0x0;var _0x43e97f=_0x7c0f[_0x1fb86c];return _0x43e97f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7c0('0x0'));var zipdir=require(_0xf7c0('0x1'));var jsonpatch=require(_0xf7c0('0x2'));var rp=require('request-promise');var moment=require(_0xf7c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf7c0('0x4'));var util=require(_0xf7c0('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf7c0('0x6'));var ejs=require(_0xf7c0('0x7'));var fs=require('fs');var fs_extra=require(_0xf7c0('0x8'));var _=require('lodash');var squel=require(_0xf7c0('0x9'));var crypto=require(_0xf7c0('0xa'));var jsforce=require(_0xf7c0('0xb'));var deskjs=require(_0xf7c0('0xc'));var toCsv=require(_0xf7c0('0x6'));var querystring=require(_0xf7c0('0xd'));var Papa=require(_0xf7c0('0xe'));var Redis=require(_0xf7c0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7c0('0x10'));var hardwareService=require(_0xf7c0('0x11'));var logger=require('../../config/logger')(_0xf7c0('0x12'));var utils=require(_0xf7c0('0x13'));var config=require(_0xf7c0('0x14'));var licenseUtil=require(_0xf7c0('0x15'));var db=require('../../mysqldb')['db'];config[_0xf7c0('0x16')]=_[_0xf7c0('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf7c0('0x18'))(new Redis(config[_0xf7c0('0x16')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xf7c0('0x19'));var client=jayson[_0xf7c0('0x1a')][_0xf7c0('0x1b')]({'port':0x232c});var client9002=jayson[_0xf7c0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34c681,_0x2f4577,_0x5c0c7b,_0x5e052b){return new BPromise(function(_0x10ff1e,_0x113555){var _0x45b790=_0x5e052b||client;return _0x45b790[_0xf7c0('0x1c')](_0x34c681,_0x5c0c7b)['then'](function(_0x1f8a45){logger[_0xf7c0('0x1d')](_0xf7c0('0x1e'),_0x2f4577,_0xf7c0('0x1f'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2f4577,_0xf7c0('0x1f'),JSON['stringify'](_0x1f8a45));if(_0x1f8a45['error']){if(_0x1f8a45[_0xf7c0('0x20')][_0xf7c0('0x21')]===0x1f4){logger['error'](_0xf7c0('0x1e'),_0x2f4577,_0x1f8a45[_0xf7c0('0x20')][_0xf7c0('0x22')]);return _0x113555(_0x1f8a45[_0xf7c0('0x20')]['message']);}logger[_0xf7c0('0x20')](_0xf7c0('0x1e'),_0x2f4577,_0x1f8a45['error'][_0xf7c0('0x22')]);return _0x10ff1e(_0x1f8a45['error'][_0xf7c0('0x22')]);}else{logger[_0xf7c0('0x1d')](_0xf7c0('0x1e'),_0x2f4577,_0xf7c0('0x1f'));_0x10ff1e(_0x1f8a45[_0xf7c0('0x23')][_0xf7c0('0x22')]);}})['catch'](function(_0x32b8fe){logger[_0xf7c0('0x20')]('ChatMessage,\x20%s,\x20%s',_0x2f4577,_0x32b8fe);_0x113555(_0x32b8fe);});});}function respondWithStatusCode(_0xb9eb96,_0x56787c){_0x56787c=_0x56787c||0xcc;return function(_0xb460e5){if(_0xb460e5){return _0xb9eb96[_0xf7c0('0x24')](_0x56787c);}return _0xb9eb96[_0xf7c0('0x25')](_0x56787c)[_0xf7c0('0x26')]();};}function respondWithResult(_0x7099d9,_0x33d56c){_0x33d56c=_0x33d56c||0xc8;return function(_0x27ba6f){if(_0x27ba6f){return _0x7099d9['status'](_0x33d56c)[_0xf7c0('0x27')](_0x27ba6f);}};}function respondWithFilteredResult(_0x181422,_0x573eea){return function(_0x18e392){if(_0x18e392){var _0x3bf426=typeof _0x573eea[_0xf7c0('0x28')]===_0xf7c0('0x29')&&typeof _0x573eea[_0xf7c0('0x2a')]===_0xf7c0('0x29');var _0x48ade2=_0x18e392['count'];var _0x5388b7=_0x3bf426?0x0:_0x573eea[_0xf7c0('0x28')];var _0x237ec7=_0x3bf426?_0x18e392[_0xf7c0('0x2b')]:_0x573eea[_0xf7c0('0x28')]+_0x573eea['limit'];var _0x593ff6;if(_0x237ec7>=_0x48ade2){_0x237ec7=_0x48ade2;_0x593ff6=0xc8;}else{_0x593ff6=0xce;}_0x181422[_0xf7c0('0x25')](_0x593ff6);return _0x181422[_0xf7c0('0x2c')]('Content-Range',_0x5388b7+'-'+_0x237ec7+'/'+_0x48ade2)['json'](_0x18e392);}return null;};}function patchUpdates(_0xd4bcc7){return function(_0x4be604){try{jsonpatch[_0xf7c0('0x2d')](_0x4be604,_0xd4bcc7,!![]);}catch(_0x2ccb7b){return BPromise[_0xf7c0('0x2e')](_0x2ccb7b);}return _0x4be604[_0xf7c0('0x2f')]();};}function saveUpdates(_0x29c641,_0x4fabf1){return function(_0x2b8864){if(_0x2b8864){return _0x2b8864[_0xf7c0('0x30')](_0x29c641)[_0xf7c0('0x31')](function(_0x62a976){return _0x62a976;});}return null;};}function removeEntity(_0x35f014,_0xd97313){return function(_0x3406d3){if(_0x3406d3){return _0x3406d3[_0xf7c0('0x32')]()['then'](function(){_0x35f014[_0xf7c0('0x25')](0xcc)[_0xf7c0('0x26')]();});}};}function handleEntityNotFound(_0x385e9d,_0x2ea24a){return function(_0x4cd118){if(!_0x4cd118){_0x385e9d[_0xf7c0('0x24')](0x194);}return _0x4cd118;};}function handleError(_0x518b63,_0x134ff1){_0x134ff1=_0x134ff1||0x1f4;return function(_0x4496ab){logger['error'](_0x4496ab['stack']);if(_0x4496ab[_0xf7c0('0x33')]){delete _0x4496ab['name'];}_0x518b63['status'](_0x134ff1)[_0xf7c0('0x34')](_0x4496ab);};}exports[_0xf7c0('0x35')]=function(_0x468a3d,_0x349918){var _0x420865={},_0x166cdc={},_0x2c049a={'count':0x0,'rows':[]};var _0x5e64f1=_['map'](db[_0xf7c0('0x36')][_0xf7c0('0x37')],function(_0x3b1f7c){return{'name':_0x3b1f7c[_0xf7c0('0x38')],'type':_0x3b1f7c[_0xf7c0('0x39')]['key']};});_0x166cdc[_0xf7c0('0x3a')]=_[_0xf7c0('0x3b')](_0x5e64f1,'name');_0x166cdc['query']=_[_0xf7c0('0x3c')](_0x468a3d[_0xf7c0('0x3d')]);_0x166cdc['filters']=_[_0xf7c0('0x3e')](_0x166cdc[_0xf7c0('0x3a')],_0x166cdc['query']);_0x420865[_0xf7c0('0x3f')]=_[_0xf7c0('0x3e')](_0x166cdc[_0xf7c0('0x3a')],qs[_0xf7c0('0x40')](_0x468a3d[_0xf7c0('0x3d')]['fields']));_0x420865[_0xf7c0('0x3f')]=_0x420865[_0xf7c0('0x3f')][_0xf7c0('0x41')]?_0x420865[_0xf7c0('0x3f')]:_0x166cdc[_0xf7c0('0x3a')];if(!_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x42')]('nolimit')){_0x420865[_0xf7c0('0x2a')]=qs[_0xf7c0('0x2a')](_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x2a')]);_0x420865[_0xf7c0('0x28')]=qs[_0xf7c0('0x28')](_0x468a3d['query']['offset']);}_0x420865[_0xf7c0('0x43')]=qs[_0xf7c0('0x44')](_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x44')]);_0x420865[_0xf7c0('0x45')]=qs['filters'](_[_0xf7c0('0x46')](_0x468a3d[_0xf7c0('0x3d')],_0x166cdc['filters']),_0x5e64f1);if(_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x47')]){_0x420865[_0xf7c0('0x45')]=_[_0xf7c0('0x48')](_0x420865[_0xf7c0('0x45')],{'$or':_['map'](_0x5e64f1,function(_0xa1d2f7){if(_0xa1d2f7[_0xf7c0('0x39')]!==_0xf7c0('0x49')){var _0x2db270={};_0x2db270[_0xa1d2f7['name']]={'$like':'%'+_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x47')]+'%'};return _0x2db270;}})});}_0x420865=_[_0xf7c0('0x48')]({},_0x420865,_0x468a3d[_0xf7c0('0x4a')]);var _0x2cbdd0={'where':_0x420865[_0xf7c0('0x45')]};return db['ChatMessage'][_0xf7c0('0x2b')](_0x2cbdd0)[_0xf7c0('0x31')](function(_0x159447){_0x2c049a['count']=_0x159447;if(_0x468a3d['query']['includeAll']){_0x420865[_0xf7c0('0x4b')]=[{'all':!![]}];}return db[_0xf7c0('0x36')][_0xf7c0('0x4c')](_0x420865);})[_0xf7c0('0x31')](function(_0x5d08bf){_0x2c049a[_0xf7c0('0x4d')]=_0x5d08bf;return _0x2c049a;})[_0xf7c0('0x31')](respondWithFilteredResult(_0x349918,_0x420865))[_0xf7c0('0x4e')](handleError(_0x349918,null));};exports['show']=function(_0xb918de,_0x1fd66f){var _0x27860b={'raw':!![],'where':{'id':_0xb918de[_0xf7c0('0x4f')]['id']}},_0x52a124={};_0x52a124['model']=_[_0xf7c0('0x3c')](db[_0xf7c0('0x36')]['rawAttributes']);_0x52a124['query']=_[_0xf7c0('0x3c')](_0xb918de[_0xf7c0('0x3d')]);_0x52a124[_0xf7c0('0x50')]=_[_0xf7c0('0x3e')](_0x52a124[_0xf7c0('0x3a')],_0x52a124[_0xf7c0('0x3d')]);_0x27860b[_0xf7c0('0x3f')]=_[_0xf7c0('0x3e')](_0x52a124['model'],qs['fields'](_0xb918de[_0xf7c0('0x3d')]['fields']));_0x27860b[_0xf7c0('0x3f')]=_0x27860b[_0xf7c0('0x3f')][_0xf7c0('0x41')]?_0x27860b[_0xf7c0('0x3f')]:_0x52a124['model'];if(_0xb918de[_0xf7c0('0x3d')]['includeAll']){_0x27860b[_0xf7c0('0x4b')]=[{'all':!![]}];}_0x27860b=_['merge']({},_0x27860b,_0xb918de[_0xf7c0('0x4a')]);return db['ChatMessage'][_0xf7c0('0x51')](_0x27860b)[_0xf7c0('0x31')](handleEntityNotFound(_0x1fd66f,null))[_0xf7c0('0x31')](respondWithResult(_0x1fd66f,null))[_0xf7c0('0x4e')](handleError(_0x1fd66f,null));};exports[_0xf7c0('0x52')]=function(_0x59e018,_0x3da340){return db[_0xf7c0('0x36')]['create'](_0x59e018[_0xf7c0('0x53')],{})[_0xf7c0('0x31')](respondWithResult(_0x3da340,0xc9))[_0xf7c0('0x4e')](handleError(_0x3da340,null));};exports[_0xf7c0('0x30')]=function(_0x411164,_0x2d46da){if(_0x411164[_0xf7c0('0x53')]['id']){delete _0x411164[_0xf7c0('0x53')]['id'];}return db['ChatMessage'][_0xf7c0('0x51')]({'where':{'id':_0x411164['params']['id']}})['then'](handleEntityNotFound(_0x2d46da,null))[_0xf7c0('0x31')](saveUpdates(_0x411164[_0xf7c0('0x53')],null))['then'](respondWithResult(_0x2d46da,null))[_0xf7c0('0x4e')](handleError(_0x2d46da,null));};exports[_0xf7c0('0x32')]=function(_0x43237d,_0x216666){return db[_0xf7c0('0x36')][_0xf7c0('0x51')]({'where':{'id':_0x43237d[_0xf7c0('0x4f')]['id']}})[_0xf7c0('0x31')](handleEntityNotFound(_0x216666,null))[_0xf7c0('0x31')](removeEntity(_0x216666,null))[_0xf7c0('0x4e')](handleError(_0x216666,null));};exports[_0xf7c0('0x54')]=function(_0x23dfa0,_0x41c0aa){return db['ChatMessage'][_0xf7c0('0x54')]()[_0xf7c0('0x31')](respondWithResult(_0x41c0aa,null))[_0xf7c0('0x4e')](handleError(_0x41c0aa,null));};var interaction_log=require(_0xf7c0('0x55'))('chat-interactions');exports[_0xf7c0('0x56')]=function(_0x5c8735,_0x928707,_0x159bcc){var _0x598805={'agent':{},'channel':_0xf7c0('0x57')};if(_0x5c8735['body']['id']){delete _0x5c8735[_0xf7c0('0x53')]['id'];}_0x5c8735['body'][_0xf7c0('0x58')]=!![];_0x5c8735['body'][_0xf7c0('0x59')]=moment()[_0xf7c0('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8735['body'][_0xf7c0('0x5b')]=_0x5c8735[_0xf7c0('0x53')][_0xf7c0('0x5b')]||_0x5c8735[_0xf7c0('0x5c')]['id'];_0x598805[_0xf7c0('0x5d')]['id']=_0x5c8735['body'][_0xf7c0('0x5b')];return db[_0xf7c0('0x36')][_0xf7c0('0x51')]({'where':{'id':_0x5c8735['params']['id'],'UserId':null}})[_0xf7c0('0x31')](handleEntityNotFound(_0x928707,null))[_0xf7c0('0x31')](saveUpdates(_0x5c8735['body'],null))[_0xf7c0('0x31')](function(_0x1e72d6){if(_0x1e72d6){_0x598805['message']=_0x1e72d6[_0xf7c0('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0xf7c0('0x51')]({'where':{'id':_0x1e72d6[_0xf7c0('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x928707,null))['then'](function(_0x542903){if(_0x542903){return _0x542903['update']({'UserId':_0x5c8735['body']['UserId'],'read1stAt':_[_0xf7c0('0x60')](_0x542903['read1stAt'])?moment()['format'](_0xf7c0('0x61')):undefined});}return null;})['then'](function(_0x494800){if(_0x494800){_0x598805['interaction']=_0x494800[_0xf7c0('0x5e')]({'plain':!![]});interaction_log[_0xf7c0('0x1d')](_0xf7c0('0x62'),_0x5c8735[_0xf7c0('0x5c')]['id'],_0x5c8735[_0xf7c0('0x5c')][_0xf7c0('0x33')],_0x5c8735[_0xf7c0('0x5c')][_0xf7c0('0x63')],_0x598805[_0xf7c0('0x64')]['id'],_0x5c8735[_0xf7c0('0x53')]?JSON['stringify'](_0x5c8735[_0xf7c0('0x53')]):_0xf7c0('0x65'));return respondWithRpcPromise(_0xf7c0('0x66'),'acceptMessage',_0x598805);}return null;})[_0xf7c0('0x31')](function(_0x1a0df7){var _0x44fb81=_0xf7c0('0x67')+_0x1a0df7[_0xf7c0('0x22')][_0xf7c0('0x68')];return db[_0xf7c0('0x69')][_0xf7c0('0x3d')](_0x44fb81,{'type':db[_0xf7c0('0x6a')][_0xf7c0('0x6b')][_0xf7c0('0x6c')],'raw':!![]})[_0xf7c0('0x31')](function(_0x20800e){return _0x20800e;});})[_0xf7c0('0x31')](function(_0x170174){if(_0x170174){_0x598805[_0xf7c0('0x22')][_0xf7c0('0x6d')]=_0x170174[0x0];if(!_0x5c8735[_0xf7c0('0x53')]['UserId'])return;return db[_0xf7c0('0x6e')][_0xf7c0('0x51')]({'where':{'id':_0x5c8735['body']['UserId'],'role':_0xf7c0('0x5d')},'attributes':['id',_0xf7c0('0x33'),'fullname','email',_0xf7c0('0x6f')],'raw':!![]});}return null;})['then'](function(_0x10645f){if(!_0x10645f)return null;_0x598805[_0xf7c0('0x22')][_0xf7c0('0x5d')]=_0x10645f;return _0x598805;})[_0xf7c0('0x31')](function(_0x4beb52){if(_0x4beb52){if(_0x5c8735['body'][_0xf7c0('0x70')]){_0x598805['message'][_0xf7c0('0x71')]=util[_0xf7c0('0x5a')](_0xf7c0('0x72'),_0x5c8735['user']['name']);_0x598805['message'][_0xf7c0('0x73')]=_0x598805['channel'];_0x598805[_0xf7c0('0x22')][_0xf7c0('0x74')]=_0x598805[_0xf7c0('0x73')];_0x598805[_0xf7c0('0x22')][_0xf7c0('0x75')]='accept';return respondWithRpcPromise(_0xf7c0('0x76'),_0xf7c0('0x76'),{'event':_0xf7c0('0x77'),'message':_[_0xf7c0('0x48')](_0x598805[_0xf7c0('0x22')],JSON[_0xf7c0('0x78')](_0x598805[_0xf7c0('0x64')]['formData']))},client9002)[_0xf7c0('0x31')](function(){return _0x598805;});}return _0x598805;}return null;})[_0xf7c0('0x31')](respondWithResult(_0x928707,null))[_0xf7c0('0x4e')](handleError(_0x928707,null));};var interaction_log=require(_0xf7c0('0x55'))(_0xf7c0('0x79'));exports[_0xf7c0('0x2e')]=function(_0x14cfac,_0x27655a,_0x32467a){var _0x4f4072={'agent':{},'channel':_0xf7c0('0x57')};if(_0x14cfac[_0xf7c0('0x53')]['id']){delete _0x14cfac['body']['id'];}_0x14cfac[_0xf7c0('0x53')]['UserId']=_0x14cfac[_0xf7c0('0x53')]['UserId']||_0x14cfac[_0xf7c0('0x5c')]['id'];_0x4f4072['agent']['id']=_0x14cfac[_0xf7c0('0x53')]['UserId'];return db['ChatMessage'][_0xf7c0('0x51')]({'where':{'id':_0x14cfac[_0xf7c0('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27655a,null))[_0xf7c0('0x31')](function(_0x36f230){if(_0x36f230){_0x4f4072[_0xf7c0('0x22')]=_0x36f230[_0xf7c0('0x5e')]({'plain':!![]});return db[_0xf7c0('0x7a')][_0xf7c0('0x51')]({'where':{'id':_0x36f230[_0xf7c0('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x27655a,null))[_0xf7c0('0x31')](function(_0x453588){if(_0x453588){_0x4f4072['interaction']=_0x453588[_0xf7c0('0x5e')]({'plain':!![]});interaction_log[_0xf7c0('0x1d')](_0xf7c0('0x7b'),_0x14cfac[_0xf7c0('0x5c')]['id'],_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x33')],_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x63')],_0x4f4072[_0xf7c0('0x64')]['id'],_0x14cfac[_0xf7c0('0x53')]?JSON['stringify'](_0x14cfac[_0xf7c0('0x53')]):_0xf7c0('0x65'));return respondWithRpcPromise(_0xf7c0('0x7c'),_0xf7c0('0x7d'),_0x4f4072);}return null;})[_0xf7c0('0x31')](function(_0x14bde2){var _0x3ec09d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14bde2[_0xf7c0('0x22')]['ContactId'];return db[_0xf7c0('0x69')]['query'](_0x3ec09d,{'type':db[_0xf7c0('0x6a')][_0xf7c0('0x6b')][_0xf7c0('0x6c')],'raw':!![]})[_0xf7c0('0x31')](function(_0x406cc3){return _0x406cc3;});})[_0xf7c0('0x31')](function(_0x2eac95){if(_0x2eac95){_0x4f4072[_0xf7c0('0x22')][_0xf7c0('0x6d')]=_0x2eac95[0x0];if(!_0x14cfac[_0xf7c0('0x53')]['UserId'])return;return db[_0xf7c0('0x6e')][_0xf7c0('0x51')]({'where':{'id':_0x14cfac['body'][_0xf7c0('0x5b')],'role':_0xf7c0('0x5d')},'attributes':['id',_0xf7c0('0x33'),_0xf7c0('0x7e'),_0xf7c0('0x7f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x180dc4){if(!_0x180dc4)return null;_0x4f4072[_0xf7c0('0x22')][_0xf7c0('0x5d')]=_0x180dc4;return _0x4f4072;})['then'](function(_0x5d08d8){if(_0x5d08d8){_0x5d08d8[_0xf7c0('0x22')]['interface']=util[_0xf7c0('0x5a')](_0xf7c0('0x72'),_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x33')]);_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x73')]=_0x4f4072[_0xf7c0('0x73')];_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x74')]=_0x4f4072['channel'];_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x75')]=_0xf7c0('0x2e');respondWithRpcPromise(_0xf7c0('0x76'),_0xf7c0('0x76'),{'event':_0xf7c0('0x80'),'message':_[_0xf7c0('0x48')](_0x4f4072[_0xf7c0('0x22')],JSON[_0xf7c0('0x78')](_0x4f4072[_0xf7c0('0x64')][_0xf7c0('0x81')]))},client9002);return _0x4f4072;}return null;})[_0xf7c0('0x31')](respondWithResult(_0x27655a,null))[_0xf7c0('0x4e')](handleError(_0x27655a,null));};
\ No newline at end of file
+var _0x0bb7=['order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','ChatMessage','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','reject','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x409afc,_0x1f3328){var _0x12f0ff=function(_0x2c7882){while(--_0x2c7882){_0x409afc['push'](_0x409afc['shift']());}};_0x12f0ff(++_0x1f3328);}(_0x0bb7,0x14c));var _0x70bb=function(_0x34cf01,_0x4b9987){_0x34cf01=_0x34cf01-0x0;var _0x24b81a=_0x0bb7[_0x34cf01];return _0x24b81a;};'use strict';var emlformat=require(_0x70bb('0x0'));var rimraf=require(_0x70bb('0x1'));var zipdir=require(_0x70bb('0x2'));var jsonpatch=require(_0x70bb('0x3'));var rp=require(_0x70bb('0x4'));var moment=require('moment');var BPromise=require(_0x70bb('0x5'));var Mustache=require('mustache');var util=require(_0x70bb('0x6'));var path=require(_0x70bb('0x7'));var sox=require('sox');var csv=require(_0x70bb('0x8'));var ejs=require(_0x70bb('0x9'));var fs=require('fs');var fs_extra=require(_0x70bb('0xa'));var _=require(_0x70bb('0xb'));var squel=require(_0x70bb('0xc'));var crypto=require(_0x70bb('0xd'));var jsforce=require(_0x70bb('0xe'));var deskjs=require(_0x70bb('0xf'));var toCsv=require(_0x70bb('0x8'));var querystring=require(_0x70bb('0x10'));var Papa=require(_0x70bb('0x11'));var Redis=require(_0x70bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70bb('0x13'));var as=require(_0x70bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70bb('0x15'))('api');var utils=require(_0x70bb('0x16'));var config=require(_0x70bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x70bb('0x18'))['db'];config[_0x70bb('0x19')]=_[_0x70bb('0x1a')](config['redis'],{'host':_0x70bb('0x1b'),'port':0x18eb});var socket=require(_0x70bb('0x1c'))(new Redis(config[_0x70bb('0x19')]));require(_0x70bb('0x1d'))[_0x70bb('0x1e')](socket);var jayson=require(_0x70bb('0x1f'));var client=jayson[_0x70bb('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x70bb('0x20')][_0x70bb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1e1c0c,_0x16fe3a,_0x5f044e,_0x1e319a){return new BPromise(function(_0x3d26f3,_0x3c6ad6){var _0x454cea=_0x1e319a||client;return _0x454cea[_0x70bb('0x22')](_0x1e1c0c,_0x5f044e)['then'](function(_0x281ca7){logger['info'](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');logger[_0x70bb('0x24')](_0x70bb('0x25'),_0x16fe3a,_0x70bb('0x26'),JSON[_0x70bb('0x27')](_0x281ca7));if(_0x281ca7[_0x70bb('0x28')]){if(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x29')]===0x1f4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3c6ad6(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3d26f3(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}else{logger[_0x70bb('0x2b')](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');_0x3d26f3(_0x281ca7[_0x70bb('0x2c')][_0x70bb('0x2a')]);}})[_0x70bb('0x2d')](function(_0x5d2cb4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x5d2cb4);_0x3c6ad6(_0x5d2cb4);});});}function respondWithStatusCode(_0x27a511,_0x225518){_0x225518=_0x225518||0xcc;return function(_0x167d5a){if(_0x167d5a){return _0x27a511[_0x70bb('0x2e')](_0x225518);}return _0x27a511['status'](_0x225518)[_0x70bb('0x2f')]();};}function respondWithResult(_0x43745f,_0x2cc13c){_0x2cc13c=_0x2cc13c||0xc8;return function(_0x40c0f7){if(_0x40c0f7){return _0x43745f[_0x70bb('0x30')](_0x2cc13c)['json'](_0x40c0f7);}};}function respondWithFilteredResult(_0x4c50bd,_0x415f10){return function(_0x3079e0){if(_0x3079e0){var _0x36c4c8=typeof _0x415f10[_0x70bb('0x31')]===_0x70bb('0x32')&&typeof _0x415f10[_0x70bb('0x33')]===_0x70bb('0x32');var _0x9600c8=_0x3079e0[_0x70bb('0x34')];var _0x2d87c1=_0x36c4c8?0x0:_0x415f10[_0x70bb('0x31')];var _0x1e4769=_0x36c4c8?_0x3079e0[_0x70bb('0x34')]:_0x415f10['offset']+_0x415f10[_0x70bb('0x33')];var _0x58532b;if(_0x1e4769>=_0x9600c8){_0x1e4769=_0x9600c8;_0x58532b=0xc8;}else{_0x58532b=0xce;}_0x4c50bd[_0x70bb('0x30')](_0x58532b);return _0x4c50bd[_0x70bb('0x35')](_0x70bb('0x36'),_0x2d87c1+'-'+_0x1e4769+'/'+_0x9600c8)[_0x70bb('0x37')](_0x3079e0);}return null;};}function patchUpdates(_0x43102d){return function(_0x3e990c){try{jsonpatch[_0x70bb('0x38')](_0x3e990c,_0x43102d,!![]);}catch(_0x501d56){return BPromise['reject'](_0x501d56);}return _0x3e990c[_0x70bb('0x39')]();};}function saveUpdates(_0x16669c,_0x29ca30){return function(_0x1554c8){if(_0x1554c8){return _0x1554c8[_0x70bb('0x3a')](_0x16669c)[_0x70bb('0x3b')](function(_0xb5dc32){return _0xb5dc32;});}return null;};}function removeEntity(_0x1e27e4,_0x39753e){return function(_0x165427){if(_0x165427){return _0x165427[_0x70bb('0x3c')]()['then'](function(){_0x1e27e4['status'](0xcc)[_0x70bb('0x2f')]();});}};}function handleEntityNotFound(_0x3299a6,_0x33d85e){return function(_0x41d561){if(!_0x41d561){_0x3299a6[_0x70bb('0x2e')](0x194);}return _0x41d561;};}function handleError(_0x358b05,_0x704ce5){_0x704ce5=_0x704ce5||0x1f4;return function(_0x58d741){logger['error'](_0x58d741[_0x70bb('0x3d')]);if(_0x58d741['name']){delete _0x58d741['name'];}_0x358b05['status'](_0x704ce5)[_0x70bb('0x3e')](_0x58d741);};}exports[_0x70bb('0x3f')]=function(_0x291be7,_0x4f2ad6){var _0x282162={},_0x4bd656={},_0x1ec123={'count':0x0,'rows':[]};var _0x7f445d=_['map'](db['ChatMessage'][_0x70bb('0x40')],function(_0x32c509){return{'name':_0x32c509['fieldName'],'type':_0x32c509[_0x70bb('0x41')][_0x70bb('0x42')]};});_0x4bd656[_0x70bb('0x43')]=_[_0x70bb('0x44')](_0x7f445d,_0x70bb('0x45'));_0x4bd656[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x291be7[_0x70bb('0x46')]);_0x4bd656[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],_0x4bd656['query']);_0x282162['attributes']=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x291be7['query'][_0x70bb('0x4a')]));_0x282162[_0x70bb('0x4b')]=_0x282162[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x282162['attributes']:_0x4bd656['model'];if(!_0x291be7[_0x70bb('0x46')][_0x70bb('0x4d')](_0x70bb('0x4e'))){_0x282162[_0x70bb('0x33')]=qs[_0x70bb('0x33')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x33')]);_0x282162['offset']=qs[_0x70bb('0x31')](_0x291be7['query'][_0x70bb('0x31')]);}_0x282162[_0x70bb('0x4f')]=qs[_0x70bb('0x50')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x50')]);_0x282162[_0x70bb('0x51')]=qs[_0x70bb('0x48')](_[_0x70bb('0x52')](_0x291be7['query'],_0x4bd656[_0x70bb('0x48')]),_0x7f445d);if(_0x291be7[_0x70bb('0x46')]['filter']){_0x282162[_0x70bb('0x51')]=_[_0x70bb('0x53')](_0x282162['where'],{'$or':_[_0x70bb('0x44')](_0x7f445d,function(_0x365fb4){if(_0x365fb4[_0x70bb('0x41')]!==_0x70bb('0x54')){var _0x559a3a={};_0x559a3a[_0x365fb4['name']]={'$like':'%'+_0x291be7[_0x70bb('0x46')][_0x70bb('0x55')]+'%'};return _0x559a3a;}})});}_0x282162=_['merge']({},_0x282162,_0x291be7[_0x70bb('0x56')]);var _0x37d2ab={'where':_0x282162[_0x70bb('0x51')]};return db['ChatMessage']['count'](_0x37d2ab)[_0x70bb('0x3b')](function(_0xe06b59){_0x1ec123[_0x70bb('0x34')]=_0xe06b59;if(_0x291be7['query']['includeAll']){_0x282162[_0x70bb('0x57')]=[{'all':!![]}];}return db['ChatMessage'][_0x70bb('0x58')](_0x282162);})[_0x70bb('0x3b')](function(_0x3540bd){_0x1ec123['rows']=_0x3540bd;return _0x1ec123;})[_0x70bb('0x3b')](respondWithFilteredResult(_0x4f2ad6,_0x282162))[_0x70bb('0x2d')](handleError(_0x4f2ad6,null));};exports['show']=function(_0x26f2f2,_0x3f4929){var _0x59d619={'raw':!![],'where':{'id':_0x26f2f2[_0x70bb('0x59')]['id']}},_0x11d815={};_0x11d815[_0x70bb('0x43')]=_[_0x70bb('0x47')](db[_0x70bb('0x5a')][_0x70bb('0x40')]);_0x11d815[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x26f2f2['query']);_0x11d815[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x11d815[_0x70bb('0x43')],_0x11d815[_0x70bb('0x46')]);_0x59d619[_0x70bb('0x4b')]=_['intersection'](_0x11d815[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x26f2f2[_0x70bb('0x46')]['fields']));_0x59d619['attributes']=_0x59d619[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x59d619[_0x70bb('0x4b')]:_0x11d815[_0x70bb('0x43')];if(_0x26f2f2[_0x70bb('0x46')]['includeAll']){_0x59d619[_0x70bb('0x57')]=[{'all':!![]}];}_0x59d619=_[_0x70bb('0x53')]({},_0x59d619,_0x26f2f2[_0x70bb('0x56')]);return db[_0x70bb('0x5a')][_0x70bb('0x5b')](_0x59d619)[_0x70bb('0x3b')](handleEntityNotFound(_0x3f4929,null))[_0x70bb('0x3b')](respondWithResult(_0x3f4929,null))['catch'](handleError(_0x3f4929,null));};exports['create']=function(_0x31f3c3,_0x30ee14){return db[_0x70bb('0x5a')][_0x70bb('0x5c')](_0x31f3c3[_0x70bb('0x5d')],{})[_0x70bb('0x3b')](respondWithResult(_0x30ee14,0xc9))[_0x70bb('0x2d')](handleError(_0x30ee14,null));};exports[_0x70bb('0x3a')]=function(_0x3f1b6c,_0x170e1a){if(_0x3f1b6c[_0x70bb('0x5d')]['id']){delete _0x3f1b6c[_0x70bb('0x5d')]['id'];}return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x3f1b6c[_0x70bb('0x59')]['id']}})[_0x70bb('0x3b')](handleEntityNotFound(_0x170e1a,null))['then'](saveUpdates(_0x3f1b6c[_0x70bb('0x5d')],null))[_0x70bb('0x3b')](respondWithResult(_0x170e1a,null))[_0x70bb('0x2d')](handleError(_0x170e1a,null));};exports['destroy']=function(_0x30d89d,_0x37a9f2){return db[_0x70bb('0x5a')]['find']({'where':{'id':_0x30d89d[_0x70bb('0x59')]['id']}})['then'](handleEntityNotFound(_0x37a9f2,null))[_0x70bb('0x3b')](removeEntity(_0x37a9f2,null))[_0x70bb('0x2d')](handleError(_0x37a9f2,null));};exports['describe']=function(_0x21f2cd,_0x31a43f){return db[_0x70bb('0x5a')][_0x70bb('0x5e')]()[_0x70bb('0x3b')](respondWithResult(_0x31a43f,null))[_0x70bb('0x2d')](handleError(_0x31a43f,null));};var interaction_log=require('../../config/logger')(_0x70bb('0x5f'));exports[_0x70bb('0x60')]=function(_0x522c58,_0x7d50ce,_0x55891c){var _0x10594a={'agent':{},'channel':_0x70bb('0x61')};if(_0x522c58[_0x70bb('0x5d')]['id']){delete _0x522c58[_0x70bb('0x5d')]['id'];}_0x522c58['body'][_0x70bb('0x62')]=!![];_0x522c58[_0x70bb('0x5d')][_0x70bb('0x63')]=moment()['format'](_0x70bb('0x64'));_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x522c58[_0x70bb('0x66')]['id'];_0x10594a[_0x70bb('0x67')]['id']=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7d50ce,null))[_0x70bb('0x3b')](saveUpdates(_0x522c58[_0x70bb('0x5d')],null))['then'](function(_0x12e70d){if(_0x12e70d){_0x10594a[_0x70bb('0x2a')]=_0x12e70d['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x12e70d['ChatInteractionId']}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x7d50ce,null))['then'](function(_0x221aaa){if(_0x221aaa){return _0x221aaa[_0x70bb('0x3a')]({'UserId':_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')],'read1stAt':_[_0x70bb('0x68')](_0x221aaa['read1stAt'])?moment()[_0x70bb('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c616c){if(_0x1c616c){_0x10594a[_0x70bb('0x6a')]=_0x1c616c['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x522c58[_0x70bb('0x66')]['id'],_0x522c58[_0x70bb('0x66')]['name'],_0x522c58[_0x70bb('0x66')][_0x70bb('0x6b')],_0x10594a[_0x70bb('0x6a')]['id'],_0x522c58['body']?JSON[_0x70bb('0x27')](_0x522c58['body']):_0x70bb('0x6c'));return respondWithRpcPromise(_0x70bb('0x6d'),_0x70bb('0x6e'),_0x10594a);}return null;})[_0x70bb('0x3b')](function(_0x5bf286){var _0x20c56a=_0x70bb('0x6f')+_0x5bf286[_0x70bb('0x2a')][_0x70bb('0x70')];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x20c56a,{'type':db['Sequelize']['QueryTypes'][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x4fbba7){return _0x4fbba7;});})['then'](function(_0x318e30){if(_0x318e30){_0x10594a[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x318e30[0x0];if(!_0x522c58[_0x70bb('0x5d')]['UserId'])return;return db[_0x70bb('0x74')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),'fullname',_0x70bb('0x75'),'internal'],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x42bb8a){if(!_0x42bb8a)return null;_0x10594a['message']['agent']=_0x42bb8a;return _0x10594a;})[_0x70bb('0x3b')](function(_0x57029e){if(_0x57029e){if(_0x522c58['body']['manual']){_0x10594a['message'][_0x70bb('0x76')]=util[_0x70bb('0x69')](_0x70bb('0x77'),_0x522c58[_0x70bb('0x66')][_0x70bb('0x45')]);_0x10594a['message']['channel']=_0x10594a[_0x70bb('0x78')];_0x10594a[_0x70bb('0x2a')]['motionChannel']=_0x10594a['channel'];_0x10594a[_0x70bb('0x2a')][_0x70bb('0x79')]='accept';return respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x7b'),'message':_[_0x70bb('0x53')](_0x10594a[_0x70bb('0x2a')],JSON['parse'](_0x10594a[_0x70bb('0x6a')][_0x70bb('0x7c')]))},client9002)['then'](function(){return _0x10594a;});}return _0x10594a;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x7d50ce,null))[_0x70bb('0x2d')](handleError(_0x7d50ce,null));};var interaction_log=require(_0x70bb('0x15'))(_0x70bb('0x5f'));exports[_0x70bb('0x7d')]=function(_0x5777a0,_0x58f136,_0x352986){var _0x52916d={'agent':{},'channel':_0x70bb('0x61')};if(_0x5777a0[_0x70bb('0x5d')]['id']){delete _0x5777a0['body']['id'];}_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x5777a0['user']['id'];_0x52916d[_0x70bb('0x67')]['id']=_0x5777a0['body']['UserId'];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x5777a0[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x3c67fd){if(_0x3c67fd){_0x52916d[_0x70bb('0x2a')]=_0x3c67fd[_0x70bb('0x7e')]({'plain':!![]});return db['ChatInteraction'][_0x70bb('0x5b')]({'where':{'id':_0x3c67fd[_0x70bb('0x7f')]}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x1aa14f){if(_0x1aa14f){_0x52916d['interaction']=_0x1aa14f[_0x70bb('0x7e')]({'plain':!![]});interaction_log[_0x70bb('0x2b')](_0x70bb('0x80'),_0x5777a0['user']['id'],_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')],_0x5777a0[_0x70bb('0x66')]['role'],_0x52916d[_0x70bb('0x6a')]['id'],_0x5777a0[_0x70bb('0x5d')]?JSON[_0x70bb('0x27')](_0x5777a0[_0x70bb('0x5d')]):'null');return respondWithRpcPromise(_0x70bb('0x81'),_0x70bb('0x82'),_0x52916d);}return null;})[_0x70bb('0x3b')](function(_0x3334a8){var _0x449c9c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3334a8[_0x70bb('0x2a')]['ContactId'];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x449c9c,{'type':db[_0x70bb('0x83')][_0x70bb('0x84')][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x3a161c){return _0x3a161c;});})[_0x70bb('0x3b')](function(_0x182186){if(_0x182186){_0x52916d[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x182186[0x0];if(!_0x5777a0['body'][_0x70bb('0x65')])return;return db[_0x70bb('0x74')]['find']({'where':{'id':_0x5777a0[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),_0x70bb('0x85'),_0x70bb('0x75'),_0x70bb('0x86')],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x110b42){if(!_0x110b42)return null;_0x52916d[_0x70bb('0x2a')][_0x70bb('0x67')]=_0x110b42;return _0x52916d;})[_0x70bb('0x3b')](function(_0x537598){if(_0x537598){_0x537598[_0x70bb('0x2a')][_0x70bb('0x76')]=util['format'](_0x70bb('0x77'),_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')]);_0x537598[_0x70bb('0x2a')][_0x70bb('0x78')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x87')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x79')]=_0x70bb('0x7d');respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x88'),'message':_[_0x70bb('0x53')](_0x52916d[_0x70bb('0x2a')],JSON['parse'](_0x52916d[_0x70bb('0x6a')]['formData']))},client9002);return _0x52916d;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x58f136,null))[_0x70bb('0x2d')](handleError(_0x58f136,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index f1dfce9..5021504 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 _0xf5df=['save','remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x358d5b,_0x34d08a){var _0x30b7a0=function(_0x4f6865){while(--_0x4f6865){_0x358d5b['push'](_0x358d5b['shift']());}};_0x30b7a0(++_0x34d08a);}(_0xf5df,0x154));var _0xff5d=function(_0x3b5feb,_0x1b8b43){_0x3b5feb=_0x3b5feb-0x0;var _0x1fbbfd=_0xf5df[_0x3b5feb];return _0x1fbbfd;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xff5d('0x0'))['db'][_0xff5d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xff5d('0x2')](0x0);var events={'afterCreate':_0xff5d('0x3'),'afterUpdate':'update','afterDestroy':_0xff5d('0x4')};function emitEvent(_0x3f9113){return function(_0x4f6a7a,_0x2daf31,_0x3cd38f){ChatMessageEvents[_0xff5d('0x5')](_0x3f9113+':'+_0x4f6a7a['id'],_0x4f6a7a);ChatMessageEvents[_0xff5d('0x5')](_0x3f9113,_0x4f6a7a);_0x3cd38f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xff5d('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x73e6=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty'];(function(_0x5440ba,_0xf350cc){var _0x54e377=function(_0x26c67a){while(--_0x26c67a){_0x5440ba['push'](_0x5440ba['shift']());}};_0x54e377(++_0xf350cc);}(_0x73e6,0x11d));var _0x673e=function(_0x5dcce1,_0x5c8a64){_0x5dcce1=_0x5dcce1-0x0;var _0x554d28=_0x73e6[_0x5dcce1];return _0x554d28;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x673e('0x0'))['db'][_0x673e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x673e('0x2')};function emitEvent(_0x2d503b){return function(_0x1f992f,_0x4749fc,_0x2e2bd1){ChatMessageEvents[_0x673e('0x3')](_0x2d503b+':'+_0x1f992f['id'],_0x1f992f);ChatMessageEvents[_0x673e('0x3')](_0x2d503b,_0x1f992f);_0x2e2bd1(null);};}for(var e in events){if(events[_0x673e('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 84ee3e1..d9a6e26 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 _0x9c70=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','error','lodash','util','../../config/logger','api'];(function(_0x3e2896,_0x1da662){var _0x4817fe=function(_0x5b12e2){while(--_0x5b12e2){_0x3e2896['push'](_0x3e2896['shift']());}};_0x4817fe(++_0x1da662);}(_0x9c70,0xd4));var _0x09c7=function(_0x5c9008,_0x4bb3a6){_0x5c9008=_0x5c9008-0x0;var _0x31a5e0=_0x9c70[_0x5c9008];return _0x31a5e0;};'use strict';var _=require(_0x09c7('0x0'));var util=require(_0x09c7('0x1'));var logger=require(_0x09c7('0x2'))(_0x09c7('0x3'));var moment=require('moment');var BPromise=require(_0x09c7('0x4'));var rp=require(_0x09c7('0x5'));var fs=require('fs');var path=require(_0x09c7('0x6'));var rimraf=require(_0x09c7('0x7'));var config=require(_0x09c7('0x8'));var attributes=require(_0x09c7('0x9'));module['exports']=function(_0x11fb6f,_0x57a7cc){return _0x11fb6f['define'](_0x09c7('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x09c7('0xb'),'fields':[_0x09c7('0xc')],'type':_0x09c7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x366a03,_0x22c8a,_0x235407){var _0x206886=_0x11fb6f[_0x09c7('0xe')];var _0x499942=_0x366a03[_0x09c7('0xf')]({'plain':!![]});if(_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()==='in'||_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()===_0x09c7('0x12')&&!_0x499942[_0x09c7('0x13')]&&!_[_0x09c7('0x14')](_0x499942[_0x09c7('0x15')])){_0x206886[_0x09c7('0x16')]['findOne']({'where':{'id':_0x499942[_0x09c7('0x17')]}})['then'](function(_0x4742ea){if(_0x4742ea){_0x4742ea['update']({'lastMsgAt':_0x499942[_0x09c7('0x18')],'lastMsgDirection':_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()});}})[_0x09c7('0x19')](function(_0x99ea01){console[_0x09c7('0x1a')](_0x99ea01);});}_0x235407();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe697=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','findOne','ChatInteractionId','update','createdAt','catch'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe697,0x1cf));var _0x7e69=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xe697[_0x5447aa];return _0xb21e53;};'use strict';var _=require('lodash');var util=require(_0x7e69('0x0'));var logger=require(_0x7e69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rp=require(_0x7e69('0x3'));var fs=require('fs');var path=require(_0x7e69('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x56dca7,_0x5c893a){return _0x56dca7[_0x7e69('0x5')]('ChatMessage',attributes,{'tableName':_0x7e69('0x6'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e69('0x7')],'type':_0x7e69('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x210b71,_0x564857,_0xf9f2fa){var _0x13f5ea=_0x56dca7[_0x7e69('0x9')];var _0x288df0=_0x210b71[_0x7e69('0xa')]({'plain':!![]});if(_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='in'||_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='out'&&!_0x288df0[_0x7e69('0xd')]&&!_[_0x7e69('0xe')](_0x288df0['UserId'])){_0x13f5ea['ChatInteraction'][_0x7e69('0xf')]({'where':{'id':_0x288df0[_0x7e69('0x10')]}})['then'](function(_0x4be24c){if(_0x4be24c){_0x4be24c[_0x7e69('0x11')]({'lastMsgAt':_0x288df0[_0x7e69('0x12')],'lastMsgDirection':_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()});}})[_0x7e69('0x13')](function(_0x40ef2a){console[_0x7e69('0x14')](_0x40ef2a);});}_0xf9f2fa();}},'charset':_0x7e69('0x15'),'collate':_0x7e69('0x16')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 3b4810f..ed9c315 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 _0xfea2=['request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xfea2,0x156));var _0x2fea=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0xfea2[_0x2300c7];return _0x23f720;};'use strict';var _=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var moment=require(_0x2fea('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fea('0x3'));var fs=require('fs');var Redis=require(_0x2fea('0x4'));var db=require(_0x2fea('0x5'))['db'];var utils=require(_0x2fea('0x6'));var logger=require(_0x2fea('0x7'))(_0x2fea('0x8'));var config=require(_0x2fea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2fea('0xa')][_0x2fea('0xb')]({'port':0x232a});config['redis']=_[_0x2fea('0xc')](config[_0x2fea('0xd')],{'host':_0x2fea('0xe'),'port':0x18eb});var socket=require(_0x2fea('0xf'))(new Redis(config[_0x2fea('0xd')]));require(_0x2fea('0x10'))[_0x2fea('0x11')](socket);function respondWithRpcPromise(_0x23a4db,_0x5d0200,_0x2a3fd9){return new BPromise(function(_0x33b252,_0x51a364){return client[_0x2fea('0x12')](_0x23a4db,_0x2a3fd9)['then'](function(_0x409ac7){logger[_0x2fea('0x13')](_0x2fea('0x14'),_0x5d0200,'request\x20sent');logger['debug'](_0x2fea('0x15'),_0x5d0200,_0x2fea('0x16'),JSON[_0x2fea('0x17')](_0x409ac7));if(_0x409ac7[_0x2fea('0x18')]){if(_0x409ac7[_0x2fea('0x18')][_0x2fea('0x19')]===0x1f4){logger['error'](_0x2fea('0x14'),_0x5d0200,_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);return _0x51a364(_0x409ac7['error'][_0x2fea('0x1a')]);}logger[_0x2fea('0x18')](_0x2fea('0x14'),_0x5d0200,_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);return _0x33b252(_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);}else{logger[_0x2fea('0x13')](_0x2fea('0x14'),_0x5d0200,_0x2fea('0x16'));_0x33b252(_0x409ac7[_0x2fea('0x1b')][_0x2fea('0x1a')]);}})[_0x2fea('0x1c')](function(_0x215ce9){logger[_0x2fea('0x18')]('ChatMessage,\x20%s,\x20%s',_0x5d0200,_0x215ce9);_0x51a364(_0x215ce9);});});}exports[_0x2fea('0x1d')]=function(_0x5d48ee){var _0x59de1e=this;return new Promise(function(_0x534feb,_0x4fa5ce){return db[_0x2fea('0x1e')]['create'](_0x5d48ee[_0x2fea('0x1f')],{'raw':_0x5d48ee[_0x2fea('0x20')]?_0x5d48ee[_0x2fea('0x20')][_0x2fea('0x21')]===undefined?!![]:![]:!![]})[_0x2fea('0x22')](function(_0x245ec8){logger['info'](_0x2fea('0x1d'),_0x5d48ee);logger[_0x2fea('0x23')](_0x2fea('0x1d'),_0x5d48ee,JSON[_0x2fea('0x17')](_0x245ec8));_0x534feb(_0x245ec8);})[_0x2fea('0x1c')](function(_0x3cfe7b){logger[_0x2fea('0x18')](_0x2fea('0x1d'),_0x3cfe7b[_0x2fea('0x1a')],_0x5d48ee);_0x4fa5ce(_0x59de1e[_0x2fea('0x18')](0x1f4,_0x3cfe7b[_0x2fea('0x1a')]));});});};
\ No newline at end of file
+var _0xb4c9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x43a88c,_0x452929){_0x43a88c=_0x43a88c-0x0;var _0x5f267f=_0xb4c9[_0x43a88c];return _0x5f267f;};'use strict';var _=require('lodash');var util=require(_0x9b4c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9b4c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b4c('0x2'));var logger=require(_0x9b4c('0x3'))(_0x9b4c('0x4'));var config=require(_0x9b4c('0x5'));var jayson=require(_0x9b4c('0x6'));var client=jayson[_0x9b4c('0x7')][_0x9b4c('0x8')]({'port':0x232a});config[_0x9b4c('0x9')]=_[_0x9b4c('0xa')](config[_0x9b4c('0x9')],{'host':_0x9b4c('0xb'),'port':0x18eb});var socket=require(_0x9b4c('0xc'))(new Redis(config[_0x9b4c('0x9')]));require('./chatMessage.socket')[_0x9b4c('0xd')](socket);function respondWithRpcPromise(_0x300a7a,_0x23210b,_0x315437){return new BPromise(function(_0x46e6f5,_0xe7b36d){return client[_0x9b4c('0xe')](_0x300a7a,_0x315437)[_0x9b4c('0xf')](function(_0xb27041){logger[_0x9b4c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'));logger[_0x9b4c('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'),JSON['stringify'](_0xb27041));if(_0xb27041[_0x9b4c('0x13')]){if(_0xb27041['error'][_0x9b4c('0x14')]===0x1f4){logger[_0x9b4c('0x13')](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')][_0x9b4c('0x16')]);return _0xe7b36d(_0xb27041[_0x9b4c('0x13')]['message']);}logger['error'](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')]['message']);return _0x46e6f5(_0xb27041['error'][_0x9b4c('0x16')]);}else{logger['info'](_0x9b4c('0x15'),_0x23210b,_0x9b4c('0x11'));_0x46e6f5(_0xb27041[_0x9b4c('0x17')][_0x9b4c('0x16')]);}})[_0x9b4c('0x18')](function(_0x3c797d){logger[_0x9b4c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x3c797d);_0xe7b36d(_0x3c797d);});});}exports['CreateChatMessage']=function(_0xd03081){var _0x27ee27=this;return new Promise(function(_0x2916c9,_0x1cbf69){return db[_0x9b4c('0x19')][_0x9b4c('0x1a')](_0xd03081[_0x9b4c('0x1b')],{'raw':_0xd03081['options']?_0xd03081[_0x9b4c('0x1c')][_0x9b4c('0x1d')]===undefined?!![]:![]:!![]})[_0x9b4c('0xf')](function(_0x34f82c){logger[_0x9b4c('0x10')](_0x9b4c('0x1e'),_0xd03081);logger[_0x9b4c('0x12')]('CreateChatMessage',_0xd03081,JSON[_0x9b4c('0x1f')](_0x34f82c));_0x2916c9(_0x34f82c);})[_0x9b4c('0x18')](function(_0x53c6a3){logger[_0x9b4c('0x13')](_0x9b4c('0x1e'),_0x53c6a3[_0x9b4c('0x16')],_0xd03081);_0x1cbf69(_0x27ee27['error'](0x1f4,_0x53c6a3[_0x9b4c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index e323497..69faa2d 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 _0xe132=['remove','update','length','chatMessage:','./chatMessage.events'];(function(_0x1c07e4,_0x15188d){var _0x3b9942=function(_0x1a7dca){while(--_0x1a7dca){_0x1c07e4['push'](_0x1c07e4['shift']());}};_0x3b9942(++_0x15188d);}(_0xe132,0x162));var _0x2e13=function(_0x529364,_0xd4d4c7){_0x529364=_0x529364-0x0;var _0x1eefdf=_0xe132[_0x529364];return _0x1eefdf;};'use strict';var ChatMessageEvents=require(_0x2e13('0x0'));var events=['save',_0x2e13('0x1'),_0x2e13('0x2')];function createListener(_0x21dfef,_0x2c2bdd){return function(_0x2a5250){_0x2c2bdd['emit'](_0x21dfef,_0x2a5250);};}function removeListener(_0x1ae6a9,_0x3f01fe){return function(){ChatMessageEvents['removeListener'](_0x1ae6a9,_0x3f01fe);};}exports['register']=function(_0x260dc1){for(var _0x2f9d00=0x0,_0x1c670b=events[_0x2e13('0x3')];_0x2f9d00<_0x1c670b;_0x2f9d00++){var _0x3be5dc=events[_0x2f9d00];var _0x2d9487=createListener(_0x2e13('0x4')+_0x3be5dc,_0x260dc1);ChatMessageEvents['on'](_0x3be5dc,_0x2d9487);}};
\ No newline at end of file
+var _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x39ec63,_0x346199){var _0x5802e1=function(_0x286585){while(--_0x286585){_0x39ec63['push'](_0x39ec63['shift']());}};_0x5802e1(++_0x346199);}(_0x7c09,0x102));var _0x97c0=function(_0x4f39ad,_0x1cd3be){_0x4f39ad=_0x4f39ad-0x0;var _0x6da4ff=_0x7c09[_0x4f39ad];return _0x6da4ff;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6667439..1c2c249 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 _0x380f=['create','put','update','/:id/accept','accept','reject','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','tracked','chatmessage:create'];(function(_0x3005bb,_0xe9520d){var _0x2f866b=function(_0x10c253){while(--_0x10c253){_0x3005bb['push'](_0x3005bb['shift']());}};_0x2f866b(++_0xe9520d);}(_0x380f,0xae));var _0xf380=function(_0x26f975,_0x9473ed){_0x26f975=_0x26f975-0x0;var _0x3680e0=_0x380f[_0x26f975];return _0x3680e0;};'use strict';var multer=require(_0xf380('0x0'));var util=require('util');var path=require(_0xf380('0x1'));var timeout=require(_0xf380('0x2'));var express=require(_0xf380('0x3'));var router=express[_0xf380('0x4')]();var fs_extra=require(_0xf380('0x5'));var auth=require(_0xf380('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf380('0x7'));var controller=require('./chatMessage.controller');router[_0xf380('0x8')]('/',auth[_0xf380('0x9')](),controller[_0xf380('0xa')]);router[_0xf380('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf380('0x8')](_0xf380('0xb'),auth[_0xf380('0x9')](),controller[_0xf380('0xc')]);router['post']('/',auth[_0xf380('0x9')](),interaction[_0xf380('0xd')]('chat',_0xf380('0xe')),controller[_0xf380('0xf')]);router[_0xf380('0x10')](_0xf380('0xb'),controller[_0xf380('0x11')]);router[_0xf380('0x10')](_0xf380('0x12'),auth[_0xf380('0x9')](),controller[_0xf380('0x13')]);router[_0xf380('0x10')]('/:id/reject',auth[_0xf380('0x9')](),controller[_0xf380('0x14')]);router['delete'](_0xf380('0xb'),auth[_0xf380('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xecd9=['./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x154b29,_0x4aab17){var _0x48b5c6=function(_0x3ac71a){while(--_0x3ac71a){_0x154b29['push'](_0x154b29['shift']());}};_0x48b5c6(++_0x4aab17);}(_0xecd9,0x162));var _0x9ecd=function(_0x24143b,_0x536f6d){_0x24143b=_0x24143b-0x0;var _0x324c9a=_0xecd9[_0x24143b];return _0x324c9a;};'use strict';var multer=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var path=require(_0x9ecd('0x2'));var timeout=require(_0x9ecd('0x3'));var express=require(_0x9ecd('0x4'));var router=express[_0x9ecd('0x5')]();var fs_extra=require(_0x9ecd('0x6'));var auth=require(_0x9ecd('0x7'));var interaction=require(_0x9ecd('0x8'));var config=require(_0x9ecd('0x9'));var controller=require(_0x9ecd('0xa'));router[_0x9ecd('0xb')]('/',auth[_0x9ecd('0xc')](),controller['index']);router['get'](_0x9ecd('0xd'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xe')]);router[_0x9ecd('0xb')]('/:id',auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xf')]);router[_0x9ecd('0x10')]('/',auth[_0x9ecd('0xc')](),interaction[_0x9ecd('0x11')](_0x9ecd('0x12'),_0x9ecd('0x13')),controller[_0x9ecd('0x14')]);router[_0x9ecd('0x15')]('/:id',controller[_0x9ecd('0x16')]);router['put']('/:id/accept',auth[_0x9ecd('0xc')](),controller['accept']);router[_0x9ecd('0x15')](_0x9ecd('0x17'),auth['isAuthenticated'](),controller[_0x9ecd('0x18')]);router['delete'](_0x9ecd('0x19'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0x1a')]);module[_0x9ecd('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4755c8c..da45158 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x4d685a,_0x5422c2){var _0x4c80ea=function(_0x293780){while(--_0x293780){_0x4d685a['push'](_0x4d685a['shift']());}};_0x4c80ea(++_0x5422c2);}(_0xdb28,0x106));var _0x8db2=function(_0x287a33,_0x3d170d){_0x287a33=_0x287a33-0x0;var _0xa6e1cc=_0xdb28[_0x287a33];return _0xa6e1cc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x596cc0,_0x4e1a74){var _0x37dc4f=function(_0x47a0dd){while(--_0x47a0dd){_0x596cc0['push'](_0x596cc0['shift']());}};_0x37dc4f(++_0x4e1a74);}(_0xb10b,0x12a));var _0xbb10=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xb10b[_0x11d684];return _0x78a301;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7e56e74..1fbe08e 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3facbf,_0xd5bd98){var _0x53ab80=function(_0x21572d){while(--_0x21572d){_0x3facbf['push'](_0x3facbf['shift']());}};_0x53ab80(++_0xd5bd98);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf785,_0x3158dc){_0x4cf785=_0x4cf785-0x0;var _0x2c8d9c=_0x7a54[_0x4cf785];return _0x2c8d9c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index ab28c0b..f24f1c6 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 _0x34be=['exports','../../mysqldb','emit','hasOwnProperty'];(function(_0x4c8be7,_0x2d1f9f){var _0x13b337=function(_0x5e9292){while(--_0x5e9292){_0x4c8be7['push'](_0x4c8be7['shift']());}};_0x13b337(++_0x2d1f9f);}(_0x34be,0x139));var _0xe34b=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x34be[_0x55daf2];return _0x1c8500;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xe34b('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5359be){return function(_0x83c7c,_0x3e57f7,_0x4ce5f2){ChatOfflineMessageEvents[_0xe34b('0x1')](_0x5359be+':'+_0x83c7c['id'],_0x83c7c);ChatOfflineMessageEvents['emit'](_0x5359be,_0x83c7c);_0x4ce5f2(null);};}for(var e in events){if(events[_0xe34b('0x2')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xe34b('0x3')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xf02c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x2bfe2d,_0x694d7f){var _0x489188=function(_0x56b625){while(--_0x56b625){_0x2bfe2d['push'](_0x2bfe2d['shift']());}};_0x489188(++_0x694d7f);}(_0xf02c,0x92));var _0xcf02=function(_0xb48270,_0x536ef3){_0xb48270=_0xb48270-0x0;var _0x457510=_0xf02c[_0xb48270];return _0x457510;};'use strict';var EventEmitter=require(_0xcf02('0x0'));var ChatOfflineMessage=require(_0xcf02('0x1'))['db'][_0xcf02('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcf02('0x3')](0x0);var events={'afterCreate':_0xcf02('0x4'),'afterUpdate':_0xcf02('0x5'),'afterDestroy':_0xcf02('0x6')};function emitEvent(_0x378e8b){return function(_0x3abde3,_0x354198,_0x3e8829){ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b+':'+_0x3abde3['id'],_0x3abde3);ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b,_0x3abde3);_0x3e8829(null);};}for(var e in events){if(events[_0xcf02('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xcf02('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 d1f438d..cd6f30c 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 _0x4438=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4438,0x9a));var _0x8443=function(_0x931e6b,_0x96f9a6){_0x931e6b=_0x931e6b-0x0;var _0x599365=_0x4438[_0x931e6b];return _0x599365;};'use strict';var attributes=require(_0x8443('0x0'));module[_0x8443('0x1')]=function(_0x400337){return _0x400337[_0x8443('0x2')](_0x8443('0x3'),attributes,{'tableName':_0x8443('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8443('0x5'),'collate':_0x8443('0x6')});};
\ No newline at end of file
+var _0x7506=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x37044b,_0x1351f1){var _0x7c82f2=function(_0x4d6504){while(--_0x4d6504){_0x37044b['push'](_0x37044b['shift']());}};_0x7c82f2(++_0x1351f1);}(_0x7506,0x184));var _0x6750=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x7506[_0x341e0f];return _0x59555a;};'use strict';var attributes=require(_0x6750('0x0'));module[_0x6750('0x1')]=function(_0x25f152){return _0x25f152[_0x6750('0x2')](_0x6750('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6750('0x4'),'collate':_0x6750('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 9c9a58e..1566149 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 _0x74d6=['../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ioredis','../../config/utils','../../config/logger'];(function(_0x58fa2b,_0x3ab810){var _0x109ba0=function(_0x272205){while(--_0x272205){_0x58fa2b['push'](_0x58fa2b['shift']());}};_0x109ba0(++_0x3ab810);}(_0x74d6,0xeb));var _0x674d=function(_0x3d30a7,_0x27127d){_0x3d30a7=_0x3d30a7-0x0;var _0x4d433e=_0x74d6[_0x3d30a7];return _0x4d433e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x674d('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x674d('0x1'));var logger=require(_0x674d('0x2'))('rpc');var config=require(_0x674d('0x3'));var jayson=require(_0x674d('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b4ae0,_0x343348,_0x5061b7){return new BPromise(function(_0x4d37f7,_0x58c3ec){return client[_0x674d('0x5')](_0x4b4ae0,_0x5061b7)[_0x674d('0x6')](function(_0x175908){logger[_0x674d('0x7')](_0x674d('0x8'),_0x343348,'request\x20sent');logger['debug'](_0x674d('0x9'),_0x343348,'request\x20sent',JSON[_0x674d('0xa')](_0x175908));if(_0x175908['error']){if(_0x175908[_0x674d('0xb')][_0x674d('0xc')]===0x1f4){logger[_0x674d('0xb')](_0x674d('0x8'),_0x343348,_0x175908[_0x674d('0xb')][_0x674d('0xd')]);return _0x58c3ec(_0x175908[_0x674d('0xb')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x343348,_0x175908[_0x674d('0xb')][_0x674d('0xd')]);return _0x4d37f7(_0x175908['error'][_0x674d('0xd')]);}else{logger[_0x674d('0x7')]('ChatOfflineMessage,\x20%s,\x20%s',_0x343348,_0x674d('0xe'));_0x4d37f7(_0x175908[_0x674d('0xf')][_0x674d('0xd')]);}})[_0x674d('0x10')](function(_0x21a369){logger[_0x674d('0xb')](_0x674d('0x8'),_0x343348,_0x21a369);_0x58c3ec(_0x21a369);});});}
\ No newline at end of file
+var _0x2809=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36ded5,_0x4351bd){var _0x582ca6=function(_0x538838){while(--_0x538838){_0x36ded5['push'](_0x36ded5['shift']());}};_0x582ca6(++_0x4351bd);}(_0x2809,0x190));var _0x9280=function(_0x9aad68,_0x45377){_0x9aad68=_0x9aad68-0x0;var _0x281340=_0x2809[_0x9aad68];return _0x281340;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var moment=require(_0x9280('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9280('0x3'));var db=require(_0x9280('0x4'))['db'];var utils=require(_0x9280('0x5'));var logger=require(_0x9280('0x6'))(_0x9280('0x7'));var config=require(_0x9280('0x8'));var jayson=require(_0x9280('0x9'));var client=jayson[_0x9280('0xa')][_0x9280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188f08,_0x22c1ac,_0x2d2345){return new BPromise(function(_0x5af08e,_0x86f0bc){return client[_0x9280('0xc')](_0x188f08,_0x2d2345)[_0x9280('0xd')](function(_0x45dd4e){logger[_0x9280('0xe')](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));logger[_0x9280('0x11')](_0x9280('0x12'),_0x22c1ac,_0x9280('0x10'),JSON[_0x9280('0x13')](_0x45dd4e));if(_0x45dd4e[_0x9280('0x14')]){if(_0x45dd4e[_0x9280('0x14')]['code']===0x1f4){logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x86f0bc(_0x45dd4e[_0x9280('0x14')]['message']);}logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x5af08e(_0x45dd4e[_0x9280('0x14')][_0x9280('0x15')]);}else{logger['info'](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));_0x5af08e(_0x45dd4e[_0x9280('0x16')][_0x9280('0x15')]);}})[_0x9280('0x17')](function(_0x1cb4cd){logger['error'](_0x9280('0xf'),_0x22c1ac,_0x1cb4cd);_0x86f0bc(_0x1cb4cd);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 179a28b..b64e104 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 _0x6f21=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','put','destroy','exports','util','connect-timeout'];(function(_0x22b06a,_0x50da1f){var _0x46e0ac=function(_0xcff734){while(--_0xcff734){_0x22b06a['push'](_0x22b06a['shift']());}};_0x46e0ac(++_0x50da1f);}(_0x6f21,0xfa));var _0x16f2=function(_0x517db2,_0x22e5f6){_0x517db2=_0x517db2-0x0;var _0x636271=_0x6f21[_0x517db2];return _0x636271;};'use strict';var multer=require('multer');var util=require(_0x16f2('0x0'));var path=require('path');var timeout=require(_0x16f2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x16f2('0x2'));var interaction=require(_0x16f2('0x3'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x16f2('0x4')]('/',auth[_0x16f2('0x5')](),controller['index']);router[_0x16f2('0x4')]('/describe',auth[_0x16f2('0x5')](),controller[_0x16f2('0x6')]);router[_0x16f2('0x4')](_0x16f2('0x7'),auth[_0x16f2('0x5')](),controller[_0x16f2('0x8')]);router['post']('/',auth[_0x16f2('0x5')](),controller['create']);router[_0x16f2('0x9')](_0x16f2('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x16f2('0x7'),auth[_0x16f2('0x5')](),controller[_0x16f2('0xa')]);module[_0x16f2('0xb')]=router;
\ No newline at end of file
+var _0x14c4=['isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x207aa7,_0x191d10){var _0x2617b4=function(_0x4e70e7){while(--_0x4e70e7){_0x207aa7['push'](_0x207aa7['shift']());}};_0x2617b4(++_0x191d10);}(_0x14c4,0x9d));var _0x414c=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0x14c4[_0x1c0e91];return _0x34322c;};'use strict';var multer=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var path=require(_0x414c('0x2'));var timeout=require('connect-timeout');var express=require(_0x414c('0x3'));var router=express[_0x414c('0x4')]();var fs_extra=require(_0x414c('0x5'));var auth=require(_0x414c('0x6'));var interaction=require(_0x414c('0x7'));var config=require(_0x414c('0x8'));var controller=require(_0x414c('0x9'));router[_0x414c('0xa')]('/',auth[_0x414c('0xb')](),controller[_0x414c('0xc')]);router[_0x414c('0xa')](_0x414c('0xd'),auth[_0x414c('0xb')](),controller[_0x414c('0xe')]);router[_0x414c('0xa')](_0x414c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x414c('0x10')]('/',auth[_0x414c('0xb')](),controller['create']);router[_0x414c('0x11')](_0x414c('0xf'),auth[_0x414c('0xb')](),controller['update']);router[_0x414c('0x12')](_0x414c('0xf'),auth['isAuthenticated'](),controller[_0x414c('0x13')]);module[_0x414c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c0bda41..dc3e059 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 _0x2616=['sequelize','exports','mouseOver'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2616,0xcf));var _0x6261=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x2616[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0x6261('0x0'));module[_0x6261('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6261('0x2'),'timeout'),'defaultValue':_0x6261('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x870e=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3f6cc0,_0x432b00){var _0xfc7086=function(_0x34f4af){while(--_0x34f4af){_0x3f6cc0['push'](_0x3f6cc0['shift']());}};_0xfc7086(++_0x432b00);}(_0x870e,0x17a));var _0xe870=function(_0x5d3f47,_0x1bce6f){_0x5d3f47=_0x5d3f47-0x0;var _0x3628e7=_0x870e[_0x5d3f47];return _0x3628e7;};'use strict';var Sequelize=require(_0xe870('0x0'));module[_0xe870('0x1')]={'name':{'type':Sequelize[_0xe870('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe870('0x3'),_0xe870('0x4')),'defaultValue':_0xe870('0x3')},'selector':{'type':Sequelize[_0xe870('0x2')]},'timeout':{'type':Sequelize[_0xe870('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4a594f7..faa1079 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 _0xeea0=['error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','count','limit','status','Content-Range','json','apply','reject','then','destroy','end'];(function(_0x4bd124,_0x49e42e){var _0xc072b8=function(_0x3a2331){while(--_0x3a2331){_0x4bd124['push'](_0x4bd124['shift']());}};_0xc072b8(++_0x49e42e);}(_0xeea0,0x91));var _0x0eea=function(_0x46ccc7,_0x3af10f){_0x46ccc7=_0x46ccc7-0x0;var _0x12cf2b=_0xeea0[_0x46ccc7];return _0x12cf2b;};'use strict';var emlformat=require(_0x0eea('0x0'));var rimraf=require(_0x0eea('0x1'));var zipdir=require(_0x0eea('0x2'));var jsonpatch=require(_0x0eea('0x3'));var rp=require(_0x0eea('0x4'));var moment=require('moment');var BPromise=require(_0x0eea('0x5'));var Mustache=require(_0x0eea('0x6'));var util=require(_0x0eea('0x7'));var path=require(_0x0eea('0x8'));var sox=require(_0x0eea('0x9'));var csv=require(_0x0eea('0xa'));var ejs=require(_0x0eea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eea('0xc'));var squel=require(_0x0eea('0xd'));var crypto=require(_0x0eea('0xe'));var jsforce=require(_0x0eea('0xf'));var deskjs=require(_0x0eea('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0eea('0x11'));var Papa=require(_0x0eea('0x12'));var Redis=require(_0x0eea('0x13'));var authService=require(_0x0eea('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eea('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0eea('0x16'));var config=require(_0x0eea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0eea('0x18'))['db'];function respondWithStatusCode(_0x560d03,_0xd28ad5){_0xd28ad5=_0xd28ad5||0xcc;return function(_0x5e99b7){if(_0x5e99b7){return _0x560d03[_0x0eea('0x19')](_0xd28ad5);}return _0x560d03['status'](_0xd28ad5)['end']();};}function respondWithResult(_0xd9993f,_0xdf39bd){_0xdf39bd=_0xdf39bd||0xc8;return function(_0x5f2d5c){if(_0x5f2d5c){return _0xd9993f['status'](_0xdf39bd)['json'](_0x5f2d5c);}};}function respondWithFilteredResult(_0x174f0c,_0x1f5fbc){return function(_0x2aa745){if(_0x2aa745){var _0x2255ed=typeof _0x1f5fbc[_0x0eea('0x1a')]===_0x0eea('0x1b')&&typeof _0x1f5fbc['limit']===_0x0eea('0x1b');var _0x3a26cb=_0x2aa745[_0x0eea('0x1c')];var _0x108416=_0x2255ed?0x0:_0x1f5fbc['offset'];var _0x2c05e8=_0x2255ed?_0x2aa745[_0x0eea('0x1c')]:_0x1f5fbc[_0x0eea('0x1a')]+_0x1f5fbc[_0x0eea('0x1d')];var _0x515af2;if(_0x2c05e8>=_0x3a26cb){_0x2c05e8=_0x3a26cb;_0x515af2=0xc8;}else{_0x515af2=0xce;}_0x174f0c[_0x0eea('0x1e')](_0x515af2);return _0x174f0c['set'](_0x0eea('0x1f'),_0x108416+'-'+_0x2c05e8+'/'+_0x3a26cb)[_0x0eea('0x20')](_0x2aa745);}return null;};}function patchUpdates(_0x57f7ec){return function(_0x36e670){try{jsonpatch[_0x0eea('0x21')](_0x36e670,_0x57f7ec,!![]);}catch(_0x277e48){return BPromise[_0x0eea('0x22')](_0x277e48);}return _0x36e670['save']();};}function saveUpdates(_0x36fe84,_0x578576){return function(_0x3b1856){if(_0x3b1856){return _0x3b1856['update'](_0x36fe84)[_0x0eea('0x23')](function(_0xb9cf20){return _0xb9cf20;});}return null;};}function removeEntity(_0x2e2a7b,_0x5af003){return function(_0x4fd7f7){if(_0x4fd7f7){return _0x4fd7f7[_0x0eea('0x24')]()[_0x0eea('0x23')](function(){_0x2e2a7b[_0x0eea('0x1e')](0xcc)[_0x0eea('0x25')]();});}};}function handleEntityNotFound(_0x527ce6,_0x5f79c5){return function(_0x364bb8){if(!_0x364bb8){_0x527ce6[_0x0eea('0x19')](0x194);}return _0x364bb8;};}function handleError(_0x14e831,_0x124058){_0x124058=_0x124058||0x1f4;return function(_0x22db32){logger[_0x0eea('0x26')](_0x22db32[_0x0eea('0x27')]);if(_0x22db32[_0x0eea('0x28')]){delete _0x22db32[_0x0eea('0x28')];}_0x14e831[_0x0eea('0x1e')](_0x124058)[_0x0eea('0x29')](_0x22db32);};}exports[_0x0eea('0x2a')]=function(_0xb30d46,_0x134ead){var _0x15269c={'raw':!![],'where':{'id':_0xb30d46['params']['id']}},_0x1c8d8d={};_0x1c8d8d[_0x0eea('0x2b')]=_[_0x0eea('0x2c')](db[_0x0eea('0x2d')][_0x0eea('0x2e')]);_0x1c8d8d[_0x0eea('0x2f')]=_[_0x0eea('0x2c')](_0xb30d46[_0x0eea('0x2f')]);_0x1c8d8d[_0x0eea('0x30')]=_['intersection'](_0x1c8d8d['model'],_0x1c8d8d[_0x0eea('0x2f')]);_0x15269c[_0x0eea('0x31')]=_[_0x0eea('0x32')](_0x1c8d8d[_0x0eea('0x2b')],qs[_0x0eea('0x33')](_0xb30d46['query']['fields']));_0x15269c['attributes']=_0x15269c[_0x0eea('0x31')]['length']?_0x15269c[_0x0eea('0x31')]:_0x1c8d8d['model'];if(_0xb30d46['query'][_0x0eea('0x34')]){_0x15269c[_0x0eea('0x35')]=[{'all':!![]}];}_0x15269c=_[_0x0eea('0x36')]({},_0x15269c,_0xb30d46[_0x0eea('0x37')]);return db['ChatProactiveAction'][_0x0eea('0x38')](_0x15269c)[_0x0eea('0x23')](handleEntityNotFound(_0x134ead,null))[_0x0eea('0x23')](respondWithResult(_0x134ead,null))[_0x0eea('0x39')](handleError(_0x134ead,null));};exports[_0x0eea('0x3a')]=function(_0x288b06,_0x300876){return db[_0x0eea('0x2d')][_0x0eea('0x3a')](_0x288b06[_0x0eea('0x3b')],{})['then'](respondWithResult(_0x300876,0xc9))['catch'](handleError(_0x300876,null));};exports['update']=function(_0xc7d3ed,_0x1a2dd4){if(_0xc7d3ed[_0x0eea('0x3b')]['id']){delete _0xc7d3ed[_0x0eea('0x3b')]['id'];}return db[_0x0eea('0x2d')]['find']({'where':{'id':_0xc7d3ed[_0x0eea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a2dd4,null))[_0x0eea('0x23')](saveUpdates(_0xc7d3ed['body'],null))['then'](respondWithResult(_0x1a2dd4,null))[_0x0eea('0x39')](handleError(_0x1a2dd4,null));};exports[_0x0eea('0x24')]=function(_0x18fa0a,_0x46d777){return db[_0x0eea('0x2d')][_0x0eea('0x38')]({'where':{'id':_0x18fa0a[_0x0eea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46d777,null))[_0x0eea('0x23')](removeEntity(_0x46d777,null))[_0x0eea('0x39')](handleError(_0x46d777,null));};
\ No newline at end of file
+var _0x1c88=['filters','model','attributes','intersection','fields','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c88,0x1a9));var _0x81c8=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x1c88[_0x52e68e];return _0x3211a4;};'use strict';var emlformat=require(_0x81c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81c8('0x1'));var jsonpatch=require(_0x81c8('0x2'));var rp=require(_0x81c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81c8('0x4'));var util=require(_0x81c8('0x5'));var path=require(_0x81c8('0x6'));var sox=require(_0x81c8('0x7'));var csv=require(_0x81c8('0x8'));var ejs=require(_0x81c8('0x9'));var fs=require('fs');var fs_extra=require(_0x81c8('0xa'));var _=require(_0x81c8('0xb'));var squel=require(_0x81c8('0xc'));var crypto=require(_0x81c8('0xd'));var jsforce=require(_0x81c8('0xe'));var deskjs=require(_0x81c8('0xf'));var toCsv=require(_0x81c8('0x8'));var querystring=require('querystring');var Papa=require(_0x81c8('0x10'));var Redis=require(_0x81c8('0x11'));var authService=require(_0x81c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81c8('0x13'));var logger=require(_0x81c8('0x14'))(_0x81c8('0x15'));var utils=require('../../config/utils');var config=require(_0x81c8('0x16'));var licenseUtil=require(_0x81c8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40061f,_0x1d0a15){_0x1d0a15=_0x1d0a15||0xcc;return function(_0x1d71f3){if(_0x1d71f3){return _0x40061f[_0x81c8('0x18')](_0x1d0a15);}return _0x40061f['status'](_0x1d0a15)[_0x81c8('0x19')]();};}function respondWithResult(_0x28b41f,_0x147d9e){_0x147d9e=_0x147d9e||0xc8;return function(_0x5e9a80){if(_0x5e9a80){return _0x28b41f[_0x81c8('0x1a')](_0x147d9e)[_0x81c8('0x1b')](_0x5e9a80);}};}function respondWithFilteredResult(_0x136cde,_0x55d438){return function(_0x10732c){if(_0x10732c){var _0x43a548=typeof _0x55d438[_0x81c8('0x1c')]===_0x81c8('0x1d')&&typeof _0x55d438[_0x81c8('0x1e')]==='undefined';var _0x3f7bf3=_0x10732c[_0x81c8('0x1f')];var _0x573a83=_0x43a548?0x0:_0x55d438[_0x81c8('0x1c')];var _0x1b74d1=_0x43a548?_0x10732c[_0x81c8('0x1f')]:_0x55d438[_0x81c8('0x1c')]+_0x55d438[_0x81c8('0x1e')];var _0x330ef2;if(_0x1b74d1>=_0x3f7bf3){_0x1b74d1=_0x3f7bf3;_0x330ef2=0xc8;}else{_0x330ef2=0xce;}_0x136cde[_0x81c8('0x1a')](_0x330ef2);return _0x136cde[_0x81c8('0x20')](_0x81c8('0x21'),_0x573a83+'-'+_0x1b74d1+'/'+_0x3f7bf3)['json'](_0x10732c);}return null;};}function patchUpdates(_0x2af7b6){return function(_0x5662c7){try{jsonpatch['apply'](_0x5662c7,_0x2af7b6,!![]);}catch(_0x5821d4){return BPromise['reject'](_0x5821d4);}return _0x5662c7[_0x81c8('0x22')]();};}function saveUpdates(_0x513d85,_0x147382){return function(_0x42fb26){if(_0x42fb26){return _0x42fb26[_0x81c8('0x23')](_0x513d85)[_0x81c8('0x24')](function(_0xcccbc){return _0xcccbc;});}return null;};}function removeEntity(_0x32c98a,_0x43d9f2){return function(_0x24674b){if(_0x24674b){return _0x24674b[_0x81c8('0x25')]()[_0x81c8('0x24')](function(){_0x32c98a[_0x81c8('0x1a')](0xcc)[_0x81c8('0x19')]();});}};}function handleEntityNotFound(_0x490d58,_0x52ff11){return function(_0xb71afc){if(!_0xb71afc){_0x490d58[_0x81c8('0x18')](0x194);}return _0xb71afc;};}function handleError(_0x3f06e7,_0x2174f2){_0x2174f2=_0x2174f2||0x1f4;return function(_0x5ac31d){logger[_0x81c8('0x26')](_0x5ac31d['stack']);if(_0x5ac31d[_0x81c8('0x27')]){delete _0x5ac31d[_0x81c8('0x27')];}_0x3f06e7[_0x81c8('0x1a')](_0x2174f2)[_0x81c8('0x28')](_0x5ac31d);};}exports[_0x81c8('0x29')]=function(_0x3ac0e4,_0xbe3e16){var _0xd4514={'raw':!![],'where':{'id':_0x3ac0e4[_0x81c8('0x2a')]['id']}},_0x5a2929={};_0x5a2929['model']=_[_0x81c8('0x2b')](db[_0x81c8('0x2c')][_0x81c8('0x2d')]);_0x5a2929[_0x81c8('0x2e')]=_[_0x81c8('0x2b')](_0x3ac0e4[_0x81c8('0x2e')]);_0x5a2929[_0x81c8('0x2f')]=_['intersection'](_0x5a2929[_0x81c8('0x30')],_0x5a2929['query']);_0xd4514[_0x81c8('0x31')]=_[_0x81c8('0x32')](_0x5a2929[_0x81c8('0x30')],qs['fields'](_0x3ac0e4[_0x81c8('0x2e')][_0x81c8('0x33')]));_0xd4514['attributes']=_0xd4514[_0x81c8('0x31')]['length']?_0xd4514[_0x81c8('0x31')]:_0x5a2929['model'];if(_0x3ac0e4[_0x81c8('0x2e')]['includeAll']){_0xd4514[_0x81c8('0x34')]=[{'all':!![]}];}_0xd4514=_[_0x81c8('0x35')]({},_0xd4514,_0x3ac0e4[_0x81c8('0x36')]);return db[_0x81c8('0x2c')][_0x81c8('0x37')](_0xd4514)[_0x81c8('0x24')](handleEntityNotFound(_0xbe3e16,null))[_0x81c8('0x24')](respondWithResult(_0xbe3e16,null))[_0x81c8('0x38')](handleError(_0xbe3e16,null));};exports['create']=function(_0x21584b,_0x599751){return db[_0x81c8('0x2c')][_0x81c8('0x39')](_0x21584b[_0x81c8('0x3a')],{})[_0x81c8('0x24')](respondWithResult(_0x599751,0xc9))[_0x81c8('0x38')](handleError(_0x599751,null));};exports['update']=function(_0x3b6eda,_0x5f5c42){if(_0x3b6eda[_0x81c8('0x3a')]['id']){delete _0x3b6eda[_0x81c8('0x3a')]['id'];}return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x3b6eda[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x5f5c42,null))['then'](saveUpdates(_0x3b6eda[_0x81c8('0x3a')],null))[_0x81c8('0x24')](respondWithResult(_0x5f5c42,null))[_0x81c8('0x38')](handleError(_0x5f5c42,null));};exports[_0x81c8('0x25')]=function(_0x2e27ad,_0x1cd895){return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x2e27ad[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x1cd895,null))['then'](removeEntity(_0x1cd895,null))[_0x81c8('0x38')](handleError(_0x1cd895,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c160328..b3aa3f1 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 _0x9430=['path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0xf77a53,_0x22522b){var _0x1fb79b=function(_0x7e2283){while(--_0x7e2283){_0xf77a53['push'](_0xf77a53['shift']());}};_0x1fb79b(++_0x22522b);}(_0x9430,0xe3));var _0x0943=function(_0x300afe,_0x55a3fc){_0x300afe=_0x300afe-0x0;var _0x1d6cb6=_0x9430[_0x300afe];return _0x1d6cb6;};'use strict';var _=require(_0x0943('0x0'));var util=require('util');var logger=require(_0x0943('0x1'))(_0x0943('0x2'));var moment=require(_0x0943('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0943('0x4'));var rimraf=require(_0x0943('0x5'));var config=require(_0x0943('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x0943('0x7')]=function(_0x331337,_0x1d146b){return _0x331337[_0x0943('0x8')](_0x0943('0x9'),attributes,{'tableName':_0x0943('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8b6=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe8b6,0x98));var _0x6e8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe8b6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6e8b('0x0'));var util=require('util');var logger=require(_0x6e8b('0x1'))(_0x6e8b('0x2'));var moment=require(_0x6e8b('0x3'));var BPromise=require(_0x6e8b('0x4'));var rp=require(_0x6e8b('0x5'));var fs=require('fs');var path=require(_0x6e8b('0x6'));var rimraf=require(_0x6e8b('0x7'));var config=require(_0x6e8b('0x8'));var attributes=require(_0x6e8b('0x9'));module[_0x6e8b('0xa')]=function(_0x59ec43,_0x2bce18){return _0x59ec43[_0x6e8b('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x6e8b('0xc'),'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 d33420b..a2147bf 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 _0x8671=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x2ef9c3,_0x3c1f07){var _0x816f73=function(_0x12e513){while(--_0x12e513){_0x2ef9c3['push'](_0x2ef9c3['shift']());}};_0x816f73(++_0x3c1f07);}(_0x8671,0x131));var _0x1867=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8671[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x1867('0x0'));var util=require(_0x1867('0x1'));var moment=require(_0x1867('0x2'));var BPromise=require(_0x1867('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1867('0x4'));var db=require(_0x1867('0x5'))['db'];var utils=require(_0x1867('0x6'));var logger=require(_0x1867('0x7'))(_0x1867('0x8'));var config=require('../../config/environment');var jayson=require(_0x1867('0x9'));var client=jayson[_0x1867('0xa')][_0x1867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc3a57e,_0x37925f,_0x4f2842){return new BPromise(function(_0x126339,_0x3c9566){return client[_0x1867('0xc')](_0xc3a57e,_0x4f2842)[_0x1867('0xd')](function(_0x23e026){logger[_0x1867('0xe')](_0x1867('0xf'),_0x37925f,_0x1867('0x10'));logger['debug'](_0x1867('0x11'),_0x37925f,'request\x20sent',JSON['stringify'](_0x23e026));if(_0x23e026[_0x1867('0x12')]){if(_0x23e026['error'][_0x1867('0x13')]===0x1f4){logger[_0x1867('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x37925f,_0x23e026['error']['message']);return _0x3c9566(_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);}logger[_0x1867('0x12')](_0x1867('0xf'),_0x37925f,_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);return _0x126339(_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);}else{logger['info'](_0x1867('0xf'),_0x37925f,_0x1867('0x10'));_0x126339(_0x23e026[_0x1867('0x15')][_0x1867('0x14')]);}})[_0x1867('0x16')](function(_0x2b8849){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x37925f,_0x2b8849);_0x3c9566(_0x2b8849);});});}
\ No newline at end of file
+var _0xc3d1=['moment','bluebird','randomstring','ioredis','rpc','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xc3d1,0xbd));var _0x1c3d=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0xc3d1[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x1c3d('0x0'));var util=require('util');var moment=require(_0x1c3d('0x1'));var BPromise=require(_0x1c3d('0x2'));var rs=require(_0x1c3d('0x3'));var fs=require('fs');var Redis=require(_0x1c3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c3d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c3d('0x6')][_0x1c3d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c0d41,_0x4fbabd,_0x19440e){return new BPromise(function(_0x598dd1,_0x31041f){return client[_0x1c3d('0x8')](_0x3c0d41,_0x19440e)[_0x1c3d('0x9')](function(_0x498c38){logger['info'](_0x1c3d('0xa'),_0x4fbabd,'request\x20sent');logger[_0x1c3d('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4fbabd,'request\x20sent',JSON[_0x1c3d('0xc')](_0x498c38));if(_0x498c38[_0x1c3d('0xd')]){if(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xe')]===0x1f4){logger[_0x1c3d('0xd')](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x31041f(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xf')]);}logger['error'](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x598dd1(_0x498c38['error'][_0x1c3d('0xf')]);}else{logger['info'](_0x1c3d('0xa'),_0x4fbabd,_0x1c3d('0x10'));_0x598dd1(_0x498c38[_0x1c3d('0x11')][_0x1c3d('0xf')]);}})[_0x1c3d('0x12')](function(_0x3ce38e){logger[_0x1c3d('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fbabd,_0x3ce38e);_0x31041f(_0x3ce38e);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7d8747e..76e830b 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x164f82,_0xcf43b1){var _0x28e375=function(_0x2a920e){while(--_0x2a920e){_0x164f82['push'](_0x164f82['shift']());}};_0x28e375(++_0xcf43b1);}(_0x53ec,0x192));var _0xc53e=function(_0x2f8512,_0x271ada){_0x2f8512=_0x2f8512-0x0;var _0x53374e=_0x53ec[_0x2f8512];return _0x53374e;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x1b8f36,_0x5ce399){var _0x4ff650=function(_0xc87da0){while(--_0xc87da0){_0x1b8f36['push'](_0x1b8f36['shift']());}};_0x4ff650(++_0x5ce399);}(_0x33c5,0xe6));var _0x533c=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x33c5[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9a359e4..ff388d2 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 _0xb90b=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x553c2a,_0x592c23){var _0x37988b=function(_0x5ccdf1){while(--_0x5ccdf1){_0x553c2a['push'](_0x553c2a['shift']());}};_0x37988b(++_0x592c23);}(_0xb90b,0x11c));var _0xbb90=function(_0xd19698,_0x369612){_0xd19698=_0xd19698-0x0;var _0x5950e7=_0xb90b[_0xd19698];return _0x5950e7;};'use strict';var Sequelize=require(_0xbb90('0x0'));module[_0xbb90('0x1')]={'name':{'type':Sequelize[_0xbb90('0x2')],'unique':_0xbb90('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb90('0x2')]},'timeout':{'type':Sequelize[_0xbb90('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb90('0x5')](_0xbb90('0x6'),_0xbb90('0x7'),_0xbb90('0x8'))}};
\ No newline at end of file
+var _0xb970=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xb970,0x99));var _0x0b97=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb970[_0x454018];return _0x24697d;};'use strict';var Sequelize=require('sequelize');module[_0x0b97('0x0')]={'name':{'type':Sequelize[_0x0b97('0x1')],'unique':_0x0b97('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b97('0x1')]},'timeout':{'type':Sequelize[_0x0b97('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b97('0x4')]('rrmemory',_0x0b97('0x5'),_0x0b97('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 3f2a632..dabeb90 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 _0xadfa=['status','json','limit','undefined','count','offset','set','Content-Range','update','then','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','describe','getMembers','UserChatQueue','order','sort','ChatQueueId','filter','findAll','User','findAndCountAll','agent','updatedAt','createdAt','SIP','chatPause','getTeams','Team','pick','hasOwnProperty','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','findOne','nolimit','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','socket.io-emitter','register','end'];(function(_0x483545,_0x37b37a){var _0xde7c23=function(_0x1fb7b0){while(--_0x1fb7b0){_0x483545['push'](_0x483545['shift']());}};_0xde7c23(++_0x37b37a);}(_0xadfa,0x1cd));var _0xaadf=function(_0x1bf303,_0x94963){_0x1bf303=_0x1bf303-0x0;var _0x41af3b=_0xadfa[_0x1bf303];return _0x41af3b;};'use strict';var BPromise=require(_0xaadf('0x0'));var util=require('util');var _=require(_0xaadf('0x1'));var squel=require('squel');var Redis=require(_0xaadf('0x2'));var qs=require(_0xaadf('0x3'));var logger=require(_0xaadf('0x4'))('api');var config=require(_0xaadf('0x5'));var db=require(_0xaadf('0x6'))['db'];config['redis']=_[_0xaadf('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaadf('0x8'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xaadf('0x9')](socket);function respondWithStatusCode(_0x404085,_0x4afddc){_0x4afddc=_0x4afddc||0xcc;return function(_0x6abf62){if(_0x6abf62){return _0x404085['sendStatus'](_0x4afddc);}return _0x404085['status'](_0x4afddc)[_0xaadf('0xa')]();};}function respondWithResult(_0x2eb09e,_0x1965a9){_0x1965a9=_0x1965a9||0xc8;return function(_0x5952e2){if(_0x5952e2){return _0x2eb09e[_0xaadf('0xb')](_0x1965a9)[_0xaadf('0xc')](_0x5952e2);}};}function respondWithFilteredResult(_0x325521,_0x5a2c3a){return function(_0x3ef6de){if(_0x3ef6de){var _0x66fd74=typeof _0x5a2c3a['offset']==='undefined'&&typeof _0x5a2c3a[_0xaadf('0xd')]===_0xaadf('0xe');var _0x4a6ee1=_0x3ef6de[_0xaadf('0xf')];var _0x2fd0cc=_0x66fd74?0x0:_0x5a2c3a[_0xaadf('0x10')];var _0x23c153=_0x66fd74?_0x3ef6de[_0xaadf('0xf')]:_0x5a2c3a[_0xaadf('0x10')]+_0x5a2c3a[_0xaadf('0xd')];var _0x55dbae;if(_0x23c153>=_0x4a6ee1){_0x23c153=_0x4a6ee1;_0x55dbae=0xc8;}else{_0x55dbae=0xce;}_0x325521[_0xaadf('0xb')](_0x55dbae);return _0x325521[_0xaadf('0x11')](_0xaadf('0x12'),_0x2fd0cc+'-'+_0x23c153+'/'+_0x4a6ee1)[_0xaadf('0xc')](_0x3ef6de);}return null;};}function saveUpdates(_0x5e9505){return function(_0xb3485d){if(_0xb3485d){return _0xb3485d[_0xaadf('0x13')](_0x5e9505)[_0xaadf('0x14')](function(_0x11ec48){return _0x11ec48;});}return null;};}function removeEntity(_0x22676d){return function(_0x26f3bb){if(_0x26f3bb){return _0x26f3bb['destroy']()[_0xaadf('0x14')](function(){var _0x5de3b9=_0x26f3bb['get']({'plain':!![]});var _0x492a99=_0xaadf('0x15');return db[_0xaadf('0x16')][_0xaadf('0x17')]({'where':{'type':_0x492a99,'resourceId':_0x5de3b9['id']}})[_0xaadf('0x14')](function(){return _0x26f3bb;});})['then'](function(){_0x22676d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x325bc1){return function(_0x4532c3){if(!_0x4532c3){_0x325bc1[_0xaadf('0x18')](0x194);}return _0x4532c3;};}function handleError(_0x262e37,_0x198f94){_0x198f94=_0x198f94||0x1f4;return function(_0x1ab57a){logger['error'](_0x1ab57a[_0xaadf('0x19')]);if(_0x1ab57a[_0xaadf('0x1a')]){delete _0x1ab57a[_0xaadf('0x1a')];}_0x262e37[_0xaadf('0xb')](_0x198f94)[_0xaadf('0x1b')](_0x1ab57a);};}exports[_0xaadf('0x1c')]=function(_0x31f6dc,_0x5b712d){var _0xc83fc={};var _0xdede13={'count':0x0,'rows':[]};var _0x54a2bf=_[_0xaadf('0x1d')](db[_0xaadf('0x1e')][_0xaadf('0x1f')],function(_0x5df83a){return{'name':_0x5df83a[_0xaadf('0x20')],'type':_0x5df83a[_0xaadf('0x21')][_0xaadf('0x22')]};});_0xc83fc=qs[_0xaadf('0x23')](_0x54a2bf,_0x31f6dc);var _0x6aaf6e={'where':_0xc83fc[_0xaadf('0x24')]};return db[_0xaadf('0x1e')][_0xaadf('0xf')](_0x6aaf6e)[_0xaadf('0x14')](function(_0x25e594){_0xdede13[_0xaadf('0xf')]=_0x25e594;_0xc83fc[_0xaadf('0x25')]=qs['include'](_0x31f6dc[_0xaadf('0x26')]);return db[_0xaadf('0x1e')]['findAll'](_0xc83fc);})[_0xaadf('0x14')](function(_0x208b8d){_0xdede13[_0xaadf('0x27')]=_0x208b8d;return _0xdede13;})[_0xaadf('0x14')](respondWithFilteredResult(_0x5b712d,_0xc83fc))['catch'](handleError(_0x5b712d,null));};exports['show']=function(_0xa414c9,_0x52aa58){var _0x3f444e={'raw':!![],'where':{'id':_0xa414c9[_0xaadf('0x28')]['id']}},_0x4bbf60={};_0x4bbf60[_0xaadf('0x29')]=_['keys'](db['ChatQueue'][_0xaadf('0x1f')]);_0x4bbf60[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0xa414c9[_0xaadf('0x26')]);_0x4bbf60[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x4bbf60[_0xaadf('0x29')],_0x4bbf60['query']);_0x3f444e[_0xaadf('0x2d')]=_[_0xaadf('0x2c')](_0x4bbf60[_0xaadf('0x29')],qs[_0xaadf('0x2e')](_0xa414c9[_0xaadf('0x26')][_0xaadf('0x2e')]));_0x3f444e[_0xaadf('0x2d')]=_0x3f444e[_0xaadf('0x2d')][_0xaadf('0x2f')]?_0x3f444e[_0xaadf('0x2d')]:_0x4bbf60[_0xaadf('0x29')];if(_0xa414c9[_0xaadf('0x26')][_0xaadf('0x30')]){_0x3f444e[_0xaadf('0x25')]=[{'all':!![]}];}_0x3f444e=_[_0xaadf('0x31')]({},_0x3f444e,_0xa414c9[_0xaadf('0x32')]);return db['ChatQueue'][_0xaadf('0x33')](_0x3f444e)[_0xaadf('0x14')](handleEntityNotFound(_0x52aa58,null))[_0xaadf('0x14')](respondWithResult(_0x52aa58,null))[_0xaadf('0x34')](handleError(_0x52aa58,null));};exports[_0xaadf('0x35')]=function(_0x31b448,_0x19709e){return db[_0xaadf('0x1e')]['create'](_0x31b448[_0xaadf('0x36')],{})[_0xaadf('0x14')](function(_0x2b00da){var _0x40aa05=_0x31b448[_0xaadf('0x37')][_0xaadf('0x38')]({'plain':!![]});if(!_0x40aa05)throw new Error(_0xaadf('0x39'));if(_0x40aa05[_0xaadf('0x3a')]===_0xaadf('0x37')){var _0x5e0003=_0x2b00da['get']({'plain':!![]});var _0x3d1e84=_0xaadf('0x15');return db[_0xaadf('0x3b')][_0xaadf('0x33')]({'where':{'name':_0x3d1e84,'userProfileId':_0x40aa05[_0xaadf('0x3c')]},'raw':!![]})[_0xaadf('0x14')](function(_0x3fcd6a){if(_0x3fcd6a&&_0x3fcd6a['autoAssociation']===0x0){return db[_0xaadf('0x16')][_0xaadf('0x35')]({'name':_0x5e0003[_0xaadf('0x1a')],'resourceId':_0x5e0003['id'],'type':_0x3fcd6a[_0xaadf('0x1a')],'sectionId':_0x3fcd6a['id']},{})[_0xaadf('0x14')](function(){return _0x2b00da;});}else{return _0x2b00da;}})[_0xaadf('0x34')](function(_0x10585a){logger[_0xaadf('0x3d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10585a);throw _0x10585a;});}return _0x2b00da;})[_0xaadf('0x14')](respondWithResult(_0x19709e,0xc9))[_0xaadf('0x34')](handleError(_0x19709e,null));};exports[_0xaadf('0x13')]=function(_0x154c83,_0x201b22){if(_0x154c83[_0xaadf('0x36')]['id']){delete _0x154c83[_0xaadf('0x36')]['id'];}return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x154c83[_0xaadf('0x28')]['id']}})['then'](handleEntityNotFound(_0x201b22,null))[_0xaadf('0x14')](saveUpdates(_0x154c83[_0xaadf('0x36')],null))[_0xaadf('0x14')](respondWithResult(_0x201b22,null))[_0xaadf('0x34')](handleError(_0x201b22,null));};exports['destroy']=function(_0x138e68,_0x4f0b78){return db['ChatQueue']['find']({'where':{'id':_0x138e68[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x4f0b78,null))['then'](removeEntity(_0x4f0b78,null))[_0xaadf('0x34')](handleError(_0x4f0b78,null));};exports[_0xaadf('0x3e')]=function(_0x2b0ae8,_0x2d672c){return db[_0xaadf('0x1e')][_0xaadf('0x3e')]()[_0xaadf('0x14')](respondWithResult(_0x2d672c,null))[_0xaadf('0x34')](handleError(_0x2d672c,null));};exports[_0xaadf('0x3f')]=function(_0x1a2419,_0x17219a){var _0x34811b={'raw':!![],'where':{}},_0x353e0f={},_0x49b5fe;return db[_0xaadf('0x1e')]['findOne']({'where':{'id':_0x1a2419[_0xaadf('0x28')]['id']}})['then'](handleEntityNotFound(_0x17219a,null))['then'](function(_0x2d970c){if(_0x2d970c){_0x49b5fe=_0x2d970c[_0xaadf('0x38')]({'plain':!![]});_0x353e0f[_0xaadf('0x29')]=_[_0xaadf('0x2a')](db[_0xaadf('0x40')][_0xaadf('0x1f')]);_0x353e0f[_0xaadf('0x26')]=_['keys'](_0x1a2419['query']);_0x353e0f[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x353e0f[_0xaadf('0x29')],_0x353e0f[_0xaadf('0x26')]);_0x34811b['attributes']=_[_0xaadf('0x2c')](_0x353e0f[_0xaadf('0x29')],qs['fields'](_0x1a2419[_0xaadf('0x26')][_0xaadf('0x2e')]));_0x34811b[_0xaadf('0x2d')]=_0x34811b[_0xaadf('0x2d')]['length']?_0x34811b[_0xaadf('0x2d')]:_0x353e0f[_0xaadf('0x29')];if(!_0x1a2419[_0xaadf('0x26')]['hasOwnProperty']('nolimit')){_0x34811b[_0xaadf('0xd')]=qs[_0xaadf('0xd')](_0x1a2419['query']['limit']);_0x34811b['offset']=qs[_0xaadf('0x10')](_0x1a2419[_0xaadf('0x26')]['offset']);}_0x34811b[_0xaadf('0x41')]=qs[_0xaadf('0x42')](_0x1a2419[_0xaadf('0x26')]['sort']);_0x34811b[_0xaadf('0x24')]=qs['filters'](_['pick'](_0x1a2419[_0xaadf('0x26')],_0x353e0f[_0xaadf('0x2b')]));_0x34811b['where'][_0xaadf('0x43')]=_0x2d970c['id'];if(_0x1a2419[_0xaadf('0x26')][_0xaadf('0x44')]){_0x34811b['where']=_[_0xaadf('0x31')](_0x34811b[_0xaadf('0x24')],{'$or':_[_0xaadf('0x1d')](_0x34811b['attributes'],function(_0x2d4cf0){var _0x5cd68a={};_0x5cd68a[_0x2d4cf0]={'$like':'%'+_0x1a2419[_0xaadf('0x26')]['filter']+'%'};return _0x5cd68a;})});}_0x34811b=_[_0xaadf('0x31')]({},_0x34811b,_0x1a2419[_0xaadf('0x32')]);return db['UserChatQueue'][_0xaadf('0x45')](_0x34811b);}})[_0xaadf('0x14')](function(_0x52e2d9){if(_0x52e2d9){return db[_0xaadf('0x46')][_0xaadf('0x47')]({'where':{'id':_[_0xaadf('0x1d')](_0x52e2d9,'UserId'),'role':_0xaadf('0x48')},'attributes':['id',_0xaadf('0x1a'),'chatPause',_0xaadf('0x49'),_0xaadf('0x4a')]});}})[_0xaadf('0x14')](function(_0x83f3db){if(_0x83f3db){return{'count':_0x83f3db[_0xaadf('0xf')],'rows':_[_0xaadf('0x1d')](_0x83f3db[_0xaadf('0x27')],function(_0x54afb0){return{'membername':_0x54afb0['name'],'UserId':_0x54afb0['id'],'queue_name':_0x49b5fe['name'],'ChatQueueId':_0x49b5fe['id'],'interface':util['format']('%s/%s',_0xaadf('0x4b'),_0x54afb0[_0xaadf('0x1a')]),'penalty':0x0,'paused':_0x54afb0[_0xaadf('0x4c')],'createdAt':_0x54afb0[_0xaadf('0x4a')],'updatedAt':_0x54afb0[_0xaadf('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17219a,_0x34811b))['catch'](handleError(_0x17219a,null));};exports[_0xaadf('0x4d')]=function(_0x42f55c,_0x124db0){var _0x3814dc={};var _0x1da2a9={};var _0x53fd76;var _0x1d88ef;return db['ChatQueue']['findOne']({'where':{'id':_0x42f55c[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x124db0,null))[_0xaadf('0x14')](function(_0x26184d){if(_0x26184d){_0x53fd76=_0x26184d;_0x1da2a9['model']=_[_0xaadf('0x2a')](db[_0xaadf('0x4e')][_0xaadf('0x1f')]);_0x1da2a9[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0x42f55c['query']);_0x1da2a9[_0xaadf('0x2b')]=_['intersection'](_0x1da2a9[_0xaadf('0x29')],_0x1da2a9[_0xaadf('0x26')]);_0x3814dc['attributes']=_[_0xaadf('0x2c')](_0x1da2a9['model'],qs[_0xaadf('0x2e')](_0x42f55c['query'][_0xaadf('0x2e')]));_0x3814dc[_0xaadf('0x2d')]=_0x3814dc[_0xaadf('0x2d')][_0xaadf('0x2f')]?_0x3814dc['attributes']:_0x1da2a9[_0xaadf('0x29')];_0x3814dc[_0xaadf('0x41')]=qs['sort'](_0x42f55c['query'][_0xaadf('0x42')]);_0x3814dc[_0xaadf('0x24')]=qs['filters'](_[_0xaadf('0x4f')](_0x42f55c[_0xaadf('0x26')],_0x1da2a9['filters']));if(_0x42f55c['query'][_0xaadf('0x44')]){_0x3814dc[_0xaadf('0x24')]=_[_0xaadf('0x31')](_0x3814dc['where'],{'$or':_[_0xaadf('0x1d')](_0x3814dc['attributes'],function(_0x58c24c){var _0x1e4107={};_0x1e4107[_0x58c24c]={'$like':'%'+_0x42f55c[_0xaadf('0x26')]['filter']+'%'};return _0x1e4107;})});}_0x3814dc=_['merge']({},_0x3814dc,_0x42f55c[_0xaadf('0x32')]);return _0x53fd76['getTeams'](_0x3814dc);}})['then'](function(_0x3f8b8f){if(_0x3f8b8f){_0x1d88ef=_0x3f8b8f[_0xaadf('0x2f')];if(!_0x42f55c[_0xaadf('0x26')][_0xaadf('0x50')]('nolimit')){_0x3814dc[_0xaadf('0xd')]=qs['limit'](_0x42f55c[_0xaadf('0x26')][_0xaadf('0xd')]);_0x3814dc['offset']=qs[_0xaadf('0x10')](_0x42f55c[_0xaadf('0x26')]['offset']);}return _0x53fd76[_0xaadf('0x4d')](_0x3814dc);}})['then'](function(_0xf13376){if(_0xf13376){return _0xf13376?{'count':_0x1d88ef,'rows':_0xf13376}:null;}})[_0xaadf('0x14')](respondWithResult(_0x124db0,null))[_0xaadf('0x34')](handleError(_0x124db0,null));};exports['addTeams']=function(_0x6c8976,_0x2d8b95){var _0x1c4970=_0x6c8976[_0xaadf('0x36')][_0xaadf('0x51')];return db[_0xaadf('0x4e')]['findAll']({'where':{'id':_0x1c4970},'attributes':['id'],'include':[{'model':db[_0xaadf('0x46')],'as':_0xaadf('0x52'),'attributes':['id',_0xaadf('0x1a'),_0xaadf('0x53'),_0xaadf('0x54'),_0xaadf('0x55')],'raw':!![]}]})['then'](function(_0x335ac5){if(_0x335ac5){var _0x5e343e=_[_0xaadf('0x56')](_0x335ac5,function(_0x321f89){var _0x29d138=_0x321f89[_0xaadf('0x38')]({'plain':!![]});return _0x29d138[_0xaadf('0x52')];});return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x6c8976[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](function(_0x1be2cd){return db[_0xaadf('0x57')][_0xaadf('0x58')](function(_0x37ee55){return _0x1be2cd[_0xaadf('0x59')](_0x1c4970,{'transaction':_0x37ee55})['then'](function(){return BPromise['each'](_0x5e343e,function(_0x2b26df){return db[_0xaadf('0x40')][_0xaadf('0x5a')]({'where':{'UserId':_0x2b26df['id'],'ChatQueueId':_0x6c8976[_0xaadf('0x28')]['id']},'transaction':_0x37ee55});});})[_0xaadf('0x14')](function(){_0x5e343e['forEach'](function(_0x5bed3b){socket[_0xaadf('0x5b')](_0xaadf('0x5c'),{'UserId':_0x5bed3b['id'],'ChatQueueId':_0x1be2cd['id']});});});});});}})[_0xaadf('0x14')](respondWithStatusCode(_0x2d8b95,null))[_0xaadf('0x34')](handleError(_0x2d8b95,null));};exports[_0xaadf('0x5d')]=function(_0x5a9fd4,_0x3ccbc4){return db[_0xaadf('0x4e')][_0xaadf('0x45')]({'where':{'id':_0x5a9fd4[_0xaadf('0x26')][_0xaadf('0x51')]},'attributes':['id'],'include':[{'model':db[_0xaadf('0x46')],'as':_0xaadf('0x52'),'attributes':['id'],'raw':!![]}]})[_0xaadf('0x14')](handleEntityNotFound(_0x3ccbc4,null))[_0xaadf('0x14')](function(_0x2a332a){var _0x59d95b=_[_0xaadf('0x1d')](_0x2a332a,'id');var _0xb28c2c=[];var _0xc321ec=[];var _0x1679c4=squel[_0xaadf('0x5e')]();_0x1679c4['field'](_0xaadf('0x5f'))[_0xaadf('0x60')](_0xaadf('0x61'),'tq')[_0xaadf('0x62')]('user_has_teams','ut',_0xaadf('0x63'))[_0xaadf('0x24')](_0xaadf('0x64'),_0x5a9fd4[_0xaadf('0x28')]['id']);for(var _0x25863b=0x0;_0x25863b<_0x2a332a[_0xaadf('0x2f')];_0x25863b+=0x1){let _0x48bbb6=_0x2a332a[_0x25863b];for(var _0x3be26e=0x0;_0x3be26e<_0x48bbb6[_0xaadf('0x52')][_0xaadf('0x2f')];_0x3be26e+=0x1){let _0x2809aa=_0x48bbb6[_0xaadf('0x52')][_0x3be26e];var _0x4dd86d=_0x1679c4['clone']();_0x4dd86d['where'](_0xaadf('0x65'),_0x2809aa['id']);_0xc321ec['push'](db[_0xaadf('0x57')][_0xaadf('0x26')](_0x4dd86d[_0xaadf('0x66')](),{'type':db[_0xaadf('0x57')][_0xaadf('0x67')][_0xaadf('0x68')]})[_0xaadf('0x14')](function(_0x1f1efb){if(_0x1f1efb['length']===0x1){return _0x2809aa['id'];}else{var _0x7bee47=_['every'](_['map'](_0x1f1efb,'TeamId'),function(_0x3087b9){return _['includes'](_0x59d95b,_0x3087b9);});if(_0x7bee47){return _0x2809aa['id'];}}}));}}return BPromise[_0xaadf('0x69')](_0xc321ec)['then'](function(_0x2b00e5){_0xb28c2c=_(_0xb28c2c)[_0xaadf('0x6a')](_0x2b00e5)[_0xaadf('0x6b')]()[_0xaadf('0x6c')]();return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x5a9fd4['params']['id']}})['then'](function(_0x18c545){return db[_0xaadf('0x57')]['transaction'](function(_0x381402){return _0x18c545['removeTeams'](_0x5a9fd4[_0xaadf('0x26')][_0xaadf('0x51')],{'transaction':_0x381402})[_0xaadf('0x14')](function(){if(!_['isEmpty'](_0xb28c2c)){return _0x18c545[_0xaadf('0x6d')](_0xb28c2c,{'transaction':_0x381402});}})['then'](function(){_0xb28c2c[_0xaadf('0x6e')](function(_0x49043e){socket[_0xaadf('0x5b')](_0xaadf('0x6f'),{'UserId':_0x49043e,'ChatQueueId':_0x18c545['id']});});});});});});})[_0xaadf('0x14')](respondWithStatusCode(_0x3ccbc4,null))['catch'](handleError(_0x3ccbc4,null));};exports[_0xaadf('0x70')]=function(_0xbaf086,_0x49b93c){return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0xbaf086['params']['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x49b93c,null))[_0xaadf('0x14')](function(_0x4ced53){if(_0x4ced53){return _0x4ced53['addAgents'](_0xbaf086['body'][_0xaadf('0x51')],_[_0xaadf('0x71')](_0xbaf086[_0xaadf('0x36')],['ids','id'])||{})['spread'](function(_0xd418a3){for(var _0x43b93d=0x0;_0x43b93d<_0xbaf086[_0xaadf('0x36')][_0xaadf('0x51')]['length'];_0x43b93d+=0x1){socket[_0xaadf('0x5b')](_0xaadf('0x5c'),{'UserId':Number(_0xbaf086['body']['ids'][_0x43b93d]),'ChatQueueId':Number(_0xbaf086[_0xaadf('0x28')]['id'])});}return _0xd418a3;});}})[_0xaadf('0x14')](respondWithResult(_0x49b93c,null))[_0xaadf('0x34')](handleError(_0x49b93c,null));};exports['removeAgents']=function(_0x2c9c23,_0x26043c){return db['ChatQueue'][_0xaadf('0x33')]({'where':{'id':_0x2c9c23[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x26043c,null))['then'](function(_0x5eeb76){if(_0x5eeb76){return _0x5eeb76[_0xaadf('0x6d')](_0x2c9c23['query'][_0xaadf('0x51')])['then'](function(){if(_[_0xaadf('0x72')](_0x2c9c23[_0xaadf('0x26')]['ids'])){for(var _0x455fd3=0x0;_0x455fd3<_0x2c9c23[_0xaadf('0x26')]['ids'][_0xaadf('0x2f')];_0x455fd3+=0x1){socket[_0xaadf('0x5b')]('userChatQueue:remove',{'UserId':Number(_0x2c9c23['query'][_0xaadf('0x51')][_0x455fd3]),'ChatQueueId':Number(_0x2c9c23[_0xaadf('0x28')]['id'])});}}else{socket[_0xaadf('0x5b')](_0xaadf('0x6f'),{'UserId':Number(_0x2c9c23['query']['ids']),'ChatQueueId':Number(_0x2c9c23[_0xaadf('0x28')]['id'])});}});}})[_0xaadf('0x14')](respondWithStatusCode(_0x26043c,null))['catch'](handleError(_0x26043c,null));};exports[_0xaadf('0x73')]=function(_0x3eba4a,_0xf4245c){var _0x4020e6={};var _0x46ae03={};var _0x1b16bc;var _0x4dcddb;return db[_0xaadf('0x1e')][_0xaadf('0x74')]({'where':{'id':_0x3eba4a[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0xf4245c,null))['then'](function(_0x17a49b){if(_0x17a49b){_0x1b16bc=_0x17a49b;_0x46ae03[_0xaadf('0x29')]=_[_0xaadf('0x2a')](db[_0xaadf('0x46')][_0xaadf('0x1f')]);_0x46ae03[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0x3eba4a[_0xaadf('0x26')]);_0x46ae03[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x46ae03[_0xaadf('0x29')],_0x46ae03['query']);_0x4020e6[_0xaadf('0x2d')]=_[_0xaadf('0x2c')](_0x46ae03[_0xaadf('0x29')],qs[_0xaadf('0x2e')](_0x3eba4a[_0xaadf('0x26')]['fields']));_0x4020e6[_0xaadf('0x2d')]=_0x4020e6[_0xaadf('0x2d')]['length']?_0x4020e6[_0xaadf('0x2d')]:_0x46ae03[_0xaadf('0x29')];_0x4020e6[_0xaadf('0x41')]=qs[_0xaadf('0x42')](_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x42')]);_0x4020e6[_0xaadf('0x24')]=qs[_0xaadf('0x2b')](_[_0xaadf('0x4f')](_0x3eba4a[_0xaadf('0x26')],_0x46ae03[_0xaadf('0x2b')]));if(_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x44')]){_0x4020e6[_0xaadf('0x24')]=_[_0xaadf('0x31')](_0x4020e6[_0xaadf('0x24')],{'$or':_['map'](_0x4020e6['attributes'],function(_0x5f2d02){var _0x20a5df={};_0x20a5df[_0x5f2d02]={'$like':'%'+_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x44')]+'%'};return _0x20a5df;})});}_0x4020e6=_['merge']({},_0x4020e6,_0x3eba4a[_0xaadf('0x32')]);return _0x1b16bc[_0xaadf('0x73')](_0x4020e6);}})[_0xaadf('0x14')](function(_0x3b6512){if(_0x3b6512){_0x4dcddb=_0x3b6512[_0xaadf('0x2f')];if(!_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x50')](_0xaadf('0x75'))){_0x4020e6[_0xaadf('0xd')]=qs[_0xaadf('0xd')](_0x3eba4a[_0xaadf('0x26')][_0xaadf('0xd')]);_0x4020e6[_0xaadf('0x10')]=qs[_0xaadf('0x10')](_0x3eba4a['query']['offset']);}return _0x1b16bc[_0xaadf('0x73')](_0x4020e6);}})[_0xaadf('0x14')](function(_0x490686){if(_0x490686){return _0x490686?{'count':_0x4dcddb,'rows':_0x490686}:null;}})[_0xaadf('0x14')](respondWithResult(_0xf4245c,null))[_0xaadf('0x34')](handleError(_0xf4245c,null));};
\ No newline at end of file
+var _0xa02d=['value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','ChatQueue','key','getOptions','where','query','findAll','rows','catch','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','options','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId'];(function(_0x273cb0,_0xc7b288){var _0x50241a=function(_0x49b206){while(--_0x49b206){_0x273cb0['push'](_0x273cb0['shift']());}};_0x50241a(++_0xc7b288);}(_0xa02d,0x161));var _0xda02=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xa02d[_0x3f993e];return _0x39c135;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xda02('0x0'));var squel=require(_0xda02('0x1'));var Redis=require(_0xda02('0x2'));var qs=require(_0xda02('0x3'));var logger=require(_0xda02('0x4'))(_0xda02('0x5'));var config=require(_0xda02('0x6'));var db=require('../../mysqldb')['db'];config[_0xda02('0x7')]=_[_0xda02('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda02('0x9'))(new Redis(config[_0xda02('0x7')]));require('./chatQueue.socket')[_0xda02('0xa')](socket);function respondWithStatusCode(_0x458752,_0x49de04){_0x49de04=_0x49de04||0xcc;return function(_0x3119d9){if(_0x3119d9){return _0x458752['sendStatus'](_0x49de04);}return _0x458752['status'](_0x49de04)[_0xda02('0xb')]();};}function respondWithResult(_0x4618a9,_0x353b43){_0x353b43=_0x353b43||0xc8;return function(_0x1ea9e0){if(_0x1ea9e0){return _0x4618a9[_0xda02('0xc')](_0x353b43)[_0xda02('0xd')](_0x1ea9e0);}};}function respondWithFilteredResult(_0x371a6e,_0x3c8b07){return function(_0x48c3d0){if(_0x48c3d0){var _0x40a1aa=typeof _0x3c8b07[_0xda02('0xe')]===_0xda02('0xf')&&typeof _0x3c8b07['limit']===_0xda02('0xf');var _0x2510ef=_0x48c3d0['count'];var _0x3eb5a9=_0x40a1aa?0x0:_0x3c8b07['offset'];var _0x1b01de=_0x40a1aa?_0x48c3d0[_0xda02('0x10')]:_0x3c8b07['offset']+_0x3c8b07[_0xda02('0x11')];var _0x29a5a9;if(_0x1b01de>=_0x2510ef){_0x1b01de=_0x2510ef;_0x29a5a9=0xc8;}else{_0x29a5a9=0xce;}_0x371a6e[_0xda02('0xc')](_0x29a5a9);return _0x371a6e[_0xda02('0x12')]('Content-Range',_0x3eb5a9+'-'+_0x1b01de+'/'+_0x2510ef)[_0xda02('0xd')](_0x48c3d0);}return null;};}function saveUpdates(_0x5ef94e){return function(_0x14ab6a){if(_0x14ab6a){return _0x14ab6a[_0xda02('0x13')](_0x5ef94e)[_0xda02('0x14')](function(_0x478720){return _0x478720;});}return null;};}function removeEntity(_0x2bc895){return function(_0x530c7d){if(_0x530c7d){return _0x530c7d['destroy']()['then'](function(){var _0x3b2553=_0x530c7d[_0xda02('0x15')]({'plain':!![]});var _0x527973=_0xda02('0x16');return db[_0xda02('0x17')][_0xda02('0x18')]({'where':{'type':_0x527973,'resourceId':_0x3b2553['id']}})['then'](function(){return _0x530c7d;});})[_0xda02('0x14')](function(){_0x2bc895[_0xda02('0xc')](0xcc)[_0xda02('0xb')]();});}};}function handleEntityNotFound(_0x48604d){return function(_0x5f19c2){if(!_0x5f19c2){_0x48604d[_0xda02('0x19')](0x194);}return _0x5f19c2;};}function handleError(_0xd3b7ce,_0x511a6f){_0x511a6f=_0x511a6f||0x1f4;return function(_0x1df5e4){logger[_0xda02('0x1a')](_0x1df5e4[_0xda02('0x1b')]);if(_0x1df5e4['name']){delete _0x1df5e4[_0xda02('0x1c')];}_0xd3b7ce['status'](_0x511a6f)['send'](_0x1df5e4);};}exports[_0xda02('0x1d')]=function(_0x10998b,_0x67aa73){var _0x13057d={};var _0x21c71d={'count':0x0,'rows':[]};var _0x526df5=_[_0xda02('0x1e')](db[_0xda02('0x1f')]['rawAttributes'],function(_0x4ecae6){return{'name':_0x4ecae6['fieldName'],'type':_0x4ecae6['type'][_0xda02('0x20')]};});_0x13057d=qs[_0xda02('0x21')](_0x526df5,_0x10998b);var _0xec0f63={'where':_0x13057d[_0xda02('0x22')]};return db[_0xda02('0x1f')][_0xda02('0x10')](_0xec0f63)[_0xda02('0x14')](function(_0x39d496){_0x21c71d[_0xda02('0x10')]=_0x39d496;_0x13057d['include']=qs['include'](_0x10998b[_0xda02('0x23')]);return db[_0xda02('0x1f')][_0xda02('0x24')](_0x13057d);})[_0xda02('0x14')](function(_0x2b1115){_0x21c71d[_0xda02('0x25')]=_0x2b1115;return _0x21c71d;})[_0xda02('0x14')](respondWithFilteredResult(_0x67aa73,_0x13057d))[_0xda02('0x26')](handleError(_0x67aa73,null));};exports[_0xda02('0x27')]=function(_0x2b45a5,_0x1cb4a2){var _0x1d79a8={'raw':!![],'where':{'id':_0x2b45a5['params']['id']}},_0x278cc9={};_0x278cc9[_0xda02('0x28')]=_[_0xda02('0x29')](db[_0xda02('0x1f')][_0xda02('0x2a')]);_0x278cc9[_0xda02('0x23')]=_[_0xda02('0x29')](_0x2b45a5[_0xda02('0x23')]);_0x278cc9[_0xda02('0x2b')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],_0x278cc9['query']);_0x1d79a8[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x2b45a5[_0xda02('0x23')][_0xda02('0x2e')]));_0x1d79a8[_0xda02('0x2d')]=_0x1d79a8['attributes'][_0xda02('0x2f')]?_0x1d79a8[_0xda02('0x2d')]:_0x278cc9[_0xda02('0x28')];if(_0x2b45a5[_0xda02('0x23')]['includeAll']){_0x1d79a8[_0xda02('0x30')]=[{'all':!![]}];}_0x1d79a8=_['merge']({},_0x1d79a8,_0x2b45a5['options']);return db['ChatQueue'][_0xda02('0x31')](_0x1d79a8)[_0xda02('0x14')](handleEntityNotFound(_0x1cb4a2,null))[_0xda02('0x14')](respondWithResult(_0x1cb4a2,null))[_0xda02('0x26')](handleError(_0x1cb4a2,null));};exports[_0xda02('0x32')]=function(_0x3fbc98,_0x14023c){return db[_0xda02('0x1f')][_0xda02('0x32')](_0x3fbc98[_0xda02('0x33')],{})[_0xda02('0x14')](function(_0x1ab94c){var _0x4e5a8e=_0x3fbc98[_0xda02('0x34')][_0xda02('0x15')]({'plain':!![]});if(!_0x4e5a8e)throw new Error(_0xda02('0x35'));if(_0x4e5a8e[_0xda02('0x36')]===_0xda02('0x34')){var _0x30c9c4=_0x1ab94c[_0xda02('0x15')]({'plain':!![]});var _0x34a1bb='ChatQueues';return db[_0xda02('0x37')][_0xda02('0x31')]({'where':{'name':_0x34a1bb,'userProfileId':_0x4e5a8e['userProfileId']},'raw':!![]})[_0xda02('0x14')](function(_0xdf9b1a){if(_0xdf9b1a&&_0xdf9b1a[_0xda02('0x38')]===0x0){return db[_0xda02('0x17')][_0xda02('0x32')]({'name':_0x30c9c4[_0xda02('0x1c')],'resourceId':_0x30c9c4['id'],'type':_0xdf9b1a['name'],'sectionId':_0xdf9b1a['id']},{})[_0xda02('0x14')](function(){return _0x1ab94c;});}else{return _0x1ab94c;}})[_0xda02('0x26')](function(_0x1aab09){logger[_0xda02('0x1a')](_0xda02('0x39'),_0x1aab09);throw _0x1aab09;});}return _0x1ab94c;})[_0xda02('0x14')](respondWithResult(_0x14023c,0xc9))[_0xda02('0x26')](handleError(_0x14023c,null));};exports[_0xda02('0x13')]=function(_0x434293,_0x35456c){if(_0x434293[_0xda02('0x33')]['id']){delete _0x434293[_0xda02('0x33')]['id'];}return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x434293[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x35456c,null))[_0xda02('0x14')](saveUpdates(_0x434293['body'],null))[_0xda02('0x14')](respondWithResult(_0x35456c,null))[_0xda02('0x26')](handleError(_0x35456c,null));};exports['destroy']=function(_0x3b7935,_0x2ae886){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x3b7935[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x2ae886,null))[_0xda02('0x14')](removeEntity(_0x2ae886,null))[_0xda02('0x26')](handleError(_0x2ae886,null));};exports[_0xda02('0x3b')]=function(_0x53810e,_0x39faac){return db[_0xda02('0x1f')][_0xda02('0x3b')]()['then'](respondWithResult(_0x39faac,null))[_0xda02('0x26')](handleError(_0x39faac,null));};exports['getMembers']=function(_0x5ddd0f,_0x3a449a){var _0x231136={'raw':!![],'where':{}},_0x40b4e1={},_0x5ea3c8;return db['ChatQueue'][_0xda02('0x3c')]({'where':{'id':_0x5ddd0f[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x3a449a,null))[_0xda02('0x14')](function(_0x58fd37){if(_0x58fd37){_0x5ea3c8=_0x58fd37[_0xda02('0x15')]({'plain':!![]});_0x40b4e1[_0xda02('0x28')]=_['keys'](db['UserChatQueue'][_0xda02('0x2a')]);_0x40b4e1[_0xda02('0x23')]=_[_0xda02('0x29')](_0x5ddd0f[_0xda02('0x23')]);_0x40b4e1[_0xda02('0x2b')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],_0x40b4e1[_0xda02('0x23')]);_0x231136[_0xda02('0x2d')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x5ddd0f[_0xda02('0x23')]['fields']));_0x231136[_0xda02('0x2d')]=_0x231136['attributes'][_0xda02('0x2f')]?_0x231136['attributes']:_0x40b4e1[_0xda02('0x28')];if(!_0x5ddd0f[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x231136['limit']=qs['limit'](_0x5ddd0f[_0xda02('0x23')][_0xda02('0x11')]);_0x231136[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x5ddd0f[_0xda02('0x23')][_0xda02('0xe')]);}_0x231136['order']=qs[_0xda02('0x3f')](_0x5ddd0f[_0xda02('0x23')]['sort']);_0x231136[_0xda02('0x22')]=qs['filters'](_[_0xda02('0x40')](_0x5ddd0f[_0xda02('0x23')],_0x40b4e1[_0xda02('0x2b')]));_0x231136[_0xda02('0x22')][_0xda02('0x41')]=_0x58fd37['id'];if(_0x5ddd0f[_0xda02('0x23')][_0xda02('0x42')]){_0x231136['where']=_[_0xda02('0x43')](_0x231136[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x231136[_0xda02('0x2d')],function(_0x268e65){var _0x18f866={};_0x18f866[_0x268e65]={'$like':'%'+_0x5ddd0f[_0xda02('0x23')]['filter']+'%'};return _0x18f866;})});}_0x231136=_['merge']({},_0x231136,_0x5ddd0f[_0xda02('0x44')]);return db[_0xda02('0x45')][_0xda02('0x24')](_0x231136);}})[_0xda02('0x14')](function(_0x24f08f){if(_0x24f08f){return db[_0xda02('0x46')][_0xda02('0x47')]({'where':{'id':_[_0xda02('0x1e')](_0x24f08f,'UserId'),'role':_0xda02('0x48')},'attributes':['id',_0xda02('0x1c'),_0xda02('0x49'),_0xda02('0x4a'),_0xda02('0x4b')]});}})[_0xda02('0x14')](function(_0x2efd5e){if(_0x2efd5e){return{'count':_0x2efd5e['count'],'rows':_[_0xda02('0x1e')](_0x2efd5e[_0xda02('0x25')],function(_0x849382){return{'membername':_0x849382[_0xda02('0x1c')],'UserId':_0x849382['id'],'queue_name':_0x5ea3c8[_0xda02('0x1c')],'ChatQueueId':_0x5ea3c8['id'],'interface':util[_0xda02('0x4c')](_0xda02('0x4d'),_0xda02('0x4e'),_0x849382[_0xda02('0x1c')]),'penalty':0x0,'paused':_0x849382['chatPause'],'createdAt':_0x849382[_0xda02('0x4b')],'updatedAt':_0x849382[_0xda02('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a449a,_0x231136))['catch'](handleError(_0x3a449a,null));};exports[_0xda02('0x4f')]=function(_0x214b23,_0x106487){var _0x286018={};var _0x5100dc={};var _0x4462f5;var _0x11adda;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x214b23[_0xda02('0x3a')]['id']}})['then'](handleEntityNotFound(_0x106487,null))[_0xda02('0x14')](function(_0x16f917){if(_0x16f917){_0x4462f5=_0x16f917;_0x5100dc[_0xda02('0x28')]=_['keys'](db['Team'][_0xda02('0x2a')]);_0x5100dc['query']=_[_0xda02('0x29')](_0x214b23['query']);_0x5100dc['filters']=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],_0x5100dc[_0xda02('0x23')]);_0x286018[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x214b23[_0xda02('0x23')]['fields']));_0x286018[_0xda02('0x2d')]=_0x286018[_0xda02('0x2d')][_0xda02('0x2f')]?_0x286018['attributes']:_0x5100dc[_0xda02('0x28')];_0x286018['order']=qs['sort'](_0x214b23['query'][_0xda02('0x3f')]);_0x286018[_0xda02('0x22')]=qs[_0xda02('0x2b')](_['pick'](_0x214b23[_0xda02('0x23')],_0x5100dc[_0xda02('0x2b')]));if(_0x214b23['query'][_0xda02('0x42')]){_0x286018[_0xda02('0x22')]=_[_0xda02('0x43')](_0x286018[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x286018[_0xda02('0x2d')],function(_0x22bc78){var _0x5b3c85={};_0x5b3c85[_0x22bc78]={'$like':'%'+_0x214b23[_0xda02('0x23')][_0xda02('0x42')]+'%'};return _0x5b3c85;})});}_0x286018=_[_0xda02('0x43')]({},_0x286018,_0x214b23[_0xda02('0x44')]);return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x14e7e4){if(_0x14e7e4){_0x11adda=_0x14e7e4[_0xda02('0x2f')];if(!_0x214b23[_0xda02('0x23')][_0xda02('0x3d')]('nolimit')){_0x286018[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x214b23[_0xda02('0x23')][_0xda02('0x11')]);_0x286018[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x214b23['query']['offset']);}return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x1c255e){if(_0x1c255e){return _0x1c255e?{'count':_0x11adda,'rows':_0x1c255e}:null;}})['then'](respondWithResult(_0x106487,null))['catch'](handleError(_0x106487,null));};exports[_0xda02('0x50')]=function(_0x5be91c,_0x135144){var _0x15ec45=_0x5be91c['body'][_0xda02('0x51')];return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x15ec45},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id','name',_0xda02('0x54'),'voicePause','interface'],'raw':!![]}]})[_0xda02('0x14')](function(_0x3c91a8){if(_0x3c91a8){var _0x390836=_['flatMap'](_0x3c91a8,function(_0x555d24){var _0x321fa7=_0x555d24[_0xda02('0x15')]({'plain':!![]});return _0x321fa7[_0xda02('0x53')];});return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x5be91c[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x331ed5){return db[_0xda02('0x55')][_0xda02('0x56')](function(_0x428d1b){return _0x331ed5['addTeams'](_0x15ec45,{'transaction':_0x428d1b})[_0xda02('0x14')](function(){return BPromise['each'](_0x390836,function(_0x4755de){return db['UserChatQueue'][_0xda02('0x57')]({'where':{'UserId':_0x4755de['id'],'ChatQueueId':_0x5be91c['params']['id']},'transaction':_0x428d1b});});})[_0xda02('0x14')](function(){_0x390836[_0xda02('0x58')](function(_0x1ab5b5){socket['emit'](_0xda02('0x59'),{'UserId':_0x1ab5b5['id'],'ChatQueueId':_0x331ed5['id']});});});});});}})['then'](respondWithStatusCode(_0x135144,null))[_0xda02('0x26')](handleError(_0x135144,null));};exports['removeTeams']=function(_0x57a443,_0x7e8e70){return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x57a443[_0xda02('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id'],'raw':!![]}]})[_0xda02('0x14')](handleEntityNotFound(_0x7e8e70,null))[_0xda02('0x14')](function(_0x5e75a2){var _0x4f887a=_[_0xda02('0x1e')](_0x5e75a2,'id');var _0x731a2e=[];var _0x3dd3ed=[];var _0x2f0661=squel[_0xda02('0x5a')]();_0x2f0661['field'](_0xda02('0x5b'))['from'](_0xda02('0x5c'),'tq')[_0xda02('0x5d')](_0xda02('0x5e'),'ut',_0xda02('0x5f'))[_0xda02('0x22')](_0xda02('0x60'),_0x57a443[_0xda02('0x3a')]['id']);for(var _0x33f177=0x0;_0x33f177<_0x5e75a2['length'];_0x33f177+=0x1){let _0x54535d=_0x5e75a2[_0x33f177];for(var _0xfe746c=0x0;_0xfe746c<_0x54535d[_0xda02('0x53')][_0xda02('0x2f')];_0xfe746c+=0x1){let _0x38f2bc=_0x54535d['Agents'][_0xfe746c];var _0x61022d=_0x2f0661[_0xda02('0x61')]();_0x61022d[_0xda02('0x22')](_0xda02('0x62'),_0x38f2bc['id']);_0x3dd3ed[_0xda02('0x63')](db[_0xda02('0x55')][_0xda02('0x23')](_0x61022d['toString'](),{'type':db[_0xda02('0x55')][_0xda02('0x64')]['SELECT']})[_0xda02('0x14')](function(_0x113249){if(_0x113249[_0xda02('0x2f')]===0x1){return _0x38f2bc['id'];}else{var _0x3adaa6=_[_0xda02('0x65')](_[_0xda02('0x1e')](_0x113249,_0xda02('0x66')),function(_0x209fb9){return _['includes'](_0x4f887a,_0x209fb9);});if(_0x3adaa6){return _0x38f2bc['id'];}}}));}}return BPromise['all'](_0x3dd3ed)[_0xda02('0x14')](function(_0x22af9d){_0x731a2e=_(_0x731a2e)['union'](_0x22af9d)['compact']()[_0xda02('0x67')]();return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x57a443[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x216ffb){return db['sequelize']['transaction'](function(_0x433699){return _0x216ffb[_0xda02('0x68')](_0x57a443[_0xda02('0x23')]['ids'],{'transaction':_0x433699})[_0xda02('0x14')](function(){if(!_[_0xda02('0x69')](_0x731a2e)){return _0x216ffb[_0xda02('0x6a')](_0x731a2e,{'transaction':_0x433699});}})[_0xda02('0x14')](function(){_0x731a2e[_0xda02('0x58')](function(_0x37ddd7){socket[_0xda02('0x6b')](_0xda02('0x6c'),{'UserId':_0x37ddd7,'ChatQueueId':_0x216ffb['id']});});});});});});})['then'](respondWithStatusCode(_0x7e8e70,null))[_0xda02('0x26')](handleError(_0x7e8e70,null));};exports['addAgents']=function(_0x4cdedd,_0x1ac8d1){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x4cdedd[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x1ac8d1,null))['then'](function(_0x2c5b2f){if(_0x2c5b2f){return _0x2c5b2f[_0xda02('0x6d')](_0x4cdedd[_0xda02('0x33')]['ids'],_[_0xda02('0x6e')](_0x4cdedd['body'],['ids','id'])||{})['spread'](function(_0x3e428e){for(var _0x104703=0x0;_0x104703<_0x4cdedd['body'][_0xda02('0x51')][_0xda02('0x2f')];_0x104703+=0x1){socket[_0xda02('0x6b')](_0xda02('0x59'),{'UserId':Number(_0x4cdedd[_0xda02('0x33')]['ids'][_0x104703]),'ChatQueueId':Number(_0x4cdedd[_0xda02('0x3a')]['id'])});}return _0x3e428e;});}})[_0xda02('0x14')](respondWithResult(_0x1ac8d1,null))[_0xda02('0x26')](handleError(_0x1ac8d1,null));};exports['removeAgents']=function(_0x46a107,_0x512b0e){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x46a107[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x512b0e,null))[_0xda02('0x14')](function(_0x420b41){if(_0x420b41){return _0x420b41[_0xda02('0x6a')](_0x46a107[_0xda02('0x23')][_0xda02('0x51')])[_0xda02('0x14')](function(){if(_[_0xda02('0x6f')](_0x46a107['query'][_0xda02('0x51')])){for(var _0x30495f=0x0;_0x30495f<_0x46a107[_0xda02('0x23')][_0xda02('0x51')][_0xda02('0x2f')];_0x30495f+=0x1){socket[_0xda02('0x6b')]('userChatQueue:remove',{'UserId':Number(_0x46a107['query'][_0xda02('0x51')][_0x30495f]),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x46a107[_0xda02('0x23')]['ids']),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}});}})[_0xda02('0x14')](respondWithStatusCode(_0x512b0e,null))['catch'](handleError(_0x512b0e,null));};exports[_0xda02('0x70')]=function(_0x3b9efb,_0x4d08b0){var _0x59fedc={};var _0x472670={};var _0x48da1b;var _0x2a8650;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x3b9efb[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x4d08b0,null))[_0xda02('0x14')](function(_0x531949){if(_0x531949){_0x48da1b=_0x531949;_0x472670[_0xda02('0x28')]=_[_0xda02('0x29')](db['User'][_0xda02('0x2a')]);_0x472670[_0xda02('0x23')]=_[_0xda02('0x29')](_0x3b9efb[_0xda02('0x23')]);_0x472670['filters']=_['intersection'](_0x472670[_0xda02('0x28')],_0x472670[_0xda02('0x23')]);_0x59fedc[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x472670[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x3b9efb[_0xda02('0x23')]['fields']));_0x59fedc[_0xda02('0x2d')]=_0x59fedc[_0xda02('0x2d')][_0xda02('0x2f')]?_0x59fedc[_0xda02('0x2d')]:_0x472670[_0xda02('0x28')];_0x59fedc[_0xda02('0x71')]=qs[_0xda02('0x3f')](_0x3b9efb[_0xda02('0x23')]['sort']);_0x59fedc[_0xda02('0x22')]=qs[_0xda02('0x2b')](_[_0xda02('0x40')](_0x3b9efb['query'],_0x472670[_0xda02('0x2b')]));if(_0x3b9efb[_0xda02('0x23')]['filter']){_0x59fedc['where']=_[_0xda02('0x43')](_0x59fedc[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x59fedc['attributes'],function(_0x280276){var _0xd2c136={};_0xd2c136[_0x280276]={'$like':'%'+_0x3b9efb[_0xda02('0x23')]['filter']+'%'};return _0xd2c136;})});}_0x59fedc=_['merge']({},_0x59fedc,_0x3b9efb['options']);return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2ed8ea){if(_0x2ed8ea){_0x2a8650=_0x2ed8ea[_0xda02('0x2f')];if(!_0x3b9efb[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x59fedc[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x3b9efb[_0xda02('0x23')][_0xda02('0x11')]);_0x59fedc[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x3b9efb[_0xda02('0x23')][_0xda02('0xe')]);}return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2f0ce4){if(_0x2f0ce4){return _0x2f0ce4?{'count':_0x2a8650,'rows':_0x2f0ce4}:null;}})['then'](respondWithResult(_0x4d08b0,null))[_0xda02('0x26')](handleError(_0x4d08b0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index a34ace6..dcac9d3 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 _0x3ea0=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x5d8ca7,_0x3cbe6c){var _0x24218a=function(_0x7e742c){while(--_0x7e742c){_0x5d8ca7['push'](_0x5d8ca7['shift']());}};_0x24218a(++_0x3cbe6c);}(_0x3ea0,0xf4));var _0x03ea=function(_0x3dc264,_0x209b9c){_0x3dc264=_0x3dc264-0x0;var _0x1b4bad=_0x3ea0[_0x3dc264];return _0x1b4bad;};'use strict';var EventEmitter=require(_0x03ea('0x0'));var ChatQueue=require(_0x03ea('0x1'))['db'][_0x03ea('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x03ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x03ea('0x4')};function emitEvent(_0x201c0f){return function(_0x55e26b,_0x2e2a75,_0x5db044){ChatQueueEvents[_0x03ea('0x5')](_0x201c0f+':'+_0x55e26b['id'],_0x55e26b);ChatQueueEvents['emit'](_0x201c0f,_0x55e26b);_0x5db044(null);};}for(var e in events){if(events[_0x03ea('0x6')](e)){var event=events[e];ChatQueue[_0x03ea('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x8bad=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4e66b2,_0x1d0c56){var _0x265d82=function(_0x17cdcb){while(--_0x17cdcb){_0x4e66b2['push'](_0x4e66b2['shift']());}};_0x265d82(++_0x1d0c56);}(_0x8bad,0x124));var _0xd8ba=function(_0x53400c,_0x25337d){_0x53400c=_0x53400c-0x0;var _0x259fe5=_0x8bad[_0x53400c];return _0x259fe5;};'use strict';var EventEmitter=require(_0xd8ba('0x0'));var ChatQueue=require(_0xd8ba('0x1'))['db'][_0xd8ba('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd8ba('0x3')](0x0);var events={'afterCreate':_0xd8ba('0x4'),'afterUpdate':_0xd8ba('0x5'),'afterDestroy':_0xd8ba('0x6')};function emitEvent(_0x385e50){return function(_0x42969b,_0x55d8d5,_0x224bb6){ChatQueueEvents[_0xd8ba('0x7')](_0x385e50+':'+_0x42969b['id'],_0x42969b);ChatQueueEvents[_0xd8ba('0x7')](_0x385e50,_0x42969b);_0x224bb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd8ba('0x8')](e,emitEvent(event));}}module[_0xd8ba('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index f13e85e..6889fc2 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 _0xaf73=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','request-promise','path'];(function(_0xdf90c0,_0x16e899){var _0x52b20e=function(_0x320dec){while(--_0x320dec){_0xdf90c0['push'](_0xdf90c0['shift']());}};_0x52b20e(++_0x16e899);}(_0xaf73,0xa3));var _0x3af7=function(_0x454f96,_0x1801b5){_0x454f96=_0x454f96-0x0;var _0x21b928=_0xaf73[_0x454f96];return _0x21b928;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require('../../config/logger')(_0x3af7('0x2'));var moment=require(_0x3af7('0x3'));var BPromise=require('bluebird');var rp=require(_0x3af7('0x4'));var fs=require('fs');var path=require(_0x3af7('0x5'));var rimraf=require(_0x3af7('0x6'));var config=require(_0x3af7('0x7'));var attributes=require(_0x3af7('0x8'));module[_0x3af7('0x9')]=function(_0x21423b,_0x148409){return _0x21423b[_0x3af7('0xa')](_0x3af7('0xb'),attributes,{'tableName':_0x3af7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f86=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x8ffa8e,_0x56f5c6){var _0x9d972a=function(_0x2cdced){while(--_0x2cdced){_0x8ffa8e['push'](_0x8ffa8e['shift']());}};_0x9d972a(++_0x56f5c6);}(_0x1f86,0xbc));var _0x61f8=function(_0x19cfe5,_0x4d1bcf){_0x19cfe5=_0x19cfe5-0x0;var _0x15b837=_0x1f86[_0x19cfe5];return _0x15b837;};'use strict';var _=require(_0x61f8('0x0'));var util=require(_0x61f8('0x1'));var logger=require(_0x61f8('0x2'))(_0x61f8('0x3'));var moment=require(_0x61f8('0x4'));var BPromise=require(_0x61f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f8('0x6'));var rimraf=require(_0x61f8('0x7'));var config=require(_0x61f8('0x8'));var attributes=require(_0x61f8('0x9'));module[_0x61f8('0xa')]=function(_0x36e52f,_0x2df5b2){return _0x36e52f[_0x61f8('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 4fe39b4..795e1fb 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 _0x49db=['where','attributes','limit','include','map','model','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','raw'];(function(_0x2ecc84,_0x28111d){var _0x3afb11=function(_0x474064){while(--_0x474064){_0x2ecc84['push'](_0x2ecc84['shift']());}};_0x3afb11(++_0x28111d);}(_0x49db,0xc5));var _0xb49d=function(_0x556fa0,_0x4e4a90){_0x556fa0=_0x556fa0-0x0;var _0x4b2cf7=_0x49db[_0x556fa0];return _0x4b2cf7;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});config[_0xb49d('0xa')]=_[_0xb49d('0xb')](config['redis'],{'host':_0xb49d('0xc'),'port':0x18eb});var socket=require(_0xb49d('0xd'))(new Redis(config[_0xb49d('0xa')]));require(_0xb49d('0xe'))[_0xb49d('0xf')](socket);function respondWithRpcPromise(_0x66c2be,_0x54f285,_0x5106c9){return new BPromise(function(_0x3f21e3,_0x3422e0){return client[_0xb49d('0x10')](_0x66c2be,_0x5106c9)[_0xb49d('0x11')](function(_0x2c9c16){logger[_0xb49d('0x12')](_0xb49d('0x13'),_0x54f285,_0xb49d('0x14'));logger[_0xb49d('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x54f285,_0xb49d('0x14'),JSON[_0xb49d('0x16')](_0x2c9c16));if(_0x2c9c16[_0xb49d('0x17')]){if(_0x2c9c16[_0xb49d('0x17')]['code']===0x1f4){logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0x2c9c16['error'][_0xb49d('0x18')]);return _0x3422e0(_0x2c9c16[_0xb49d('0x17')][_0xb49d('0x18')]);}logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0x2c9c16[_0xb49d('0x17')][_0xb49d('0x18')]);return _0x3f21e3(_0x2c9c16['error'][_0xb49d('0x18')]);}else{logger[_0xb49d('0x12')](_0xb49d('0x13'),_0x54f285,_0xb49d('0x14'));_0x3f21e3(_0x2c9c16['result']['message']);}})[_0xb49d('0x19')](function(_0xa65038){logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0xa65038);_0x3422e0(_0xa65038);});});}exports[_0xb49d('0x1a')]=function(_0x510f22){var _0x18547b=this;return new Promise(function(_0x47626f,_0x3bf7a2){return db[_0xb49d('0x1b')][_0xb49d('0x1c')]({'raw':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x1e')]===undefined?!![]:![]:!![],'where':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x1f')]||null:null,'attributes':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x20')]||null:null,'limit':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x21')]||null:null,'include':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x510f22[_0xb49d('0x1d')]['include'],function(_0x227305){return{'model':db[_0x227305['model']],'as':_0x227305['as'],'attributes':_0x227305[_0xb49d('0x20')],'include':_0x227305[_0xb49d('0x22')]?_['map'](_0x227305[_0xb49d('0x22')],function(_0x1cd841){return{'model':db[_0x1cd841[_0xb49d('0x24')]],'as':_0x1cd841['as'],'attributes':_0x1cd841[_0xb49d('0x20')],'include':_0x1cd841[_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x1cd841['include'],function(_0x3930fe){return{'model':db[_0x3930fe[_0xb49d('0x24')]],'as':_0x3930fe['as'],'attributes':_0x3930fe[_0xb49d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb49d('0x11')](function(_0x420e63){logger[_0xb49d('0x12')](_0xb49d('0x1a'),_0x510f22);logger['debug'](_0xb49d('0x1a'),_0x510f22,JSON['stringify'](_0x420e63));_0x47626f(_0x420e63);})[_0xb49d('0x19')](function(_0x2fbcfa){logger[_0xb49d('0x17')](_0xb49d('0x1a'),_0x2fbcfa[_0xb49d('0x18')],_0x510f22);_0x3bf7a2(_0x18547b[_0xb49d('0x17')](0x1f4,_0x2fbcfa[_0xb49d('0x18')]));});});};exports['ShowChatQueue']=function(_0x3802c8){var _0x463852=this;return new Promise(function(_0xf0da2b,_0x5e0f70){return db['ChatQueue'][_0xb49d('0x25')]({'raw':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x1f')]||null:null,'attributes':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8['options']['attributes']||null:null,'include':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8['options']['include']?_['map'](_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x22')],function(_0x3964ec){return{'model':db[_0x3964ec[_0xb49d('0x24')]],'as':_0x3964ec['as'],'attributes':_0x3964ec[_0xb49d('0x20')],'include':_0x3964ec[_0xb49d('0x22')]?_['map'](_0x3964ec[_0xb49d('0x22')],function(_0x15c53f){return{'model':db[_0x15c53f['model']],'as':_0x15c53f['as'],'attributes':_0x15c53f[_0xb49d('0x20')],'include':_0x15c53f[_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x15c53f['include'],function(_0x47e9ec){return{'model':db[_0x47e9ec[_0xb49d('0x24')]],'as':_0x47e9ec['as'],'attributes':_0x47e9ec[_0xb49d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f497){logger['info']('ShowChatQueue',_0x3802c8);logger['debug']('ShowChatQueue',_0x3802c8,JSON[_0xb49d('0x16')](_0x45f497));_0xf0da2b(_0x45f497);})[_0xb49d('0x19')](function(_0x47150a){logger[_0xb49d('0x17')]('ShowChatQueue',_0x47150a['message'],_0x3802c8);_0x5e0f70(_0x463852[_0xb49d('0x17')](0x1f4,_0x47150a[_0xb49d('0x18')]));});});};
\ No newline at end of file
+var _0x7035=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','catch','ShowChatQueue','lodash'];(function(_0x5f4ab1,_0x1cbb88){var _0x5e553d=function(_0x35ff48){while(--_0x35ff48){_0x5f4ab1['push'](_0x5f4ab1['shift']());}};_0x5e553d(++_0x1cbb88);}(_0x7035,0x15e));var _0x5703=function(_0x3aa92c,_0x3a10a0){_0x3aa92c=_0x3aa92c-0x0;var _0x2b1300=_0x7035[_0x3aa92c];return _0x2b1300;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var moment=require(_0x5703('0x1'));var BPromise=require(_0x5703('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5703('0x3'));var db=require(_0x5703('0x4'))['db'];var utils=require(_0x5703('0x5'));var logger=require(_0x5703('0x6'))(_0x5703('0x7'));var config=require('../../config/environment');var jayson=require(_0x5703('0x8'));var client=jayson[_0x5703('0x9')]['http']({'port':0x232a});config[_0x5703('0xa')]=_[_0x5703('0xb')](config[_0x5703('0xa')],{'host':_0x5703('0xc'),'port':0x18eb});var socket=require(_0x5703('0xd'))(new Redis(config[_0x5703('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x169e83,_0x5775d8,_0x4f1db7){return new BPromise(function(_0x5c36a5,_0x522449){return client[_0x5703('0xe')](_0x169e83,_0x4f1db7)[_0x5703('0xf')](function(_0xfcbc9e){logger['info'](_0x5703('0x10'),_0x5775d8,'request\x20sent');logger[_0x5703('0x11')](_0x5703('0x12'),_0x5775d8,_0x5703('0x13'),JSON[_0x5703('0x14')](_0xfcbc9e));if(_0xfcbc9e[_0x5703('0x15')]){if(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x16')]===0x1f4){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x522449(_0xfcbc9e['error'][_0x5703('0x17')]);}logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x5c36a5(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);}else{logger[_0x5703('0x18')](_0x5703('0x10'),_0x5775d8,'request\x20sent');_0x5c36a5(_0xfcbc9e[_0x5703('0x19')][_0x5703('0x17')]);}})['catch'](function(_0x579097){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0x579097);_0x522449(_0x579097);});});}exports['GetChatQueue']=function(_0x240cb8){var _0x59e065=this;return new Promise(function(_0x43cdbf,_0x33d30a){return db[_0x5703('0x1a')][_0x5703('0x1b')]({'raw':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x240cb8['options']?_0x240cb8['options'][_0x5703('0x1e')]||null:null,'attributes':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x1f')]||null:null,'limit':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x20')]||null:null,'include':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')]['include']?_['map'](_0x240cb8['options'][_0x5703('0x21')],function(_0x495db2){return{'model':db[_0x495db2[_0x5703('0x22')]],'as':_0x495db2['as'],'attributes':_0x495db2[_0x5703('0x1f')],'include':_0x495db2[_0x5703('0x21')]?_[_0x5703('0x23')](_0x495db2[_0x5703('0x21')],function(_0x57964d){return{'model':db[_0x57964d[_0x5703('0x22')]],'as':_0x57964d['as'],'attributes':_0x57964d['attributes'],'include':_0x57964d[_0x5703('0x21')]?_[_0x5703('0x23')](_0x57964d[_0x5703('0x21')],function(_0x4b23ed){return{'model':db[_0x4b23ed[_0x5703('0x22')]],'as':_0x4b23ed['as'],'attributes':_0x4b23ed[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bd1f7){logger[_0x5703('0x18')](_0x5703('0x24'),_0x240cb8);logger[_0x5703('0x11')]('GetChatQueue',_0x240cb8,JSON['stringify'](_0x3bd1f7));_0x43cdbf(_0x3bd1f7);})[_0x5703('0x25')](function(_0x28a460){logger[_0x5703('0x15')](_0x5703('0x24'),_0x28a460[_0x5703('0x17')],_0x240cb8);_0x33d30a(_0x59e065[_0x5703('0x15')](0x1f4,_0x28a460[_0x5703('0x17')]));});});};exports[_0x5703('0x26')]=function(_0x3508e8){var _0x2fb0c0=this;return new Promise(function(_0x2af3c3,_0x3fadcc){return db[_0x5703('0x1a')]['find']({'raw':_0x3508e8['options']?_0x3508e8['options'][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')][_0x5703('0x1e')]||null:null,'attributes':_0x3508e8[_0x5703('0x1c')]?_0x3508e8['options'][_0x5703('0x1f')]||null:null,'include':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')]['include']?_[_0x5703('0x23')](_0x3508e8[_0x5703('0x1c')][_0x5703('0x21')],function(_0x2eab10){return{'model':db[_0x2eab10['model']],'as':_0x2eab10['as'],'attributes':_0x2eab10[_0x5703('0x1f')],'include':_0x2eab10[_0x5703('0x21')]?_['map'](_0x2eab10[_0x5703('0x21')],function(_0x1f08ba){return{'model':db[_0x1f08ba[_0x5703('0x22')]],'as':_0x1f08ba['as'],'attributes':_0x1f08ba['attributes'],'include':_0x1f08ba[_0x5703('0x21')]?_['map'](_0x1f08ba[_0x5703('0x21')],function(_0x319aa6){return{'model':db[_0x319aa6[_0x5703('0x22')]],'as':_0x319aa6['as'],'attributes':_0x319aa6[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495a7c){logger[_0x5703('0x18')](_0x5703('0x26'),_0x3508e8);logger[_0x5703('0x11')](_0x5703('0x26'),_0x3508e8,JSON[_0x5703('0x14')](_0x495a7c));_0x2af3c3(_0x495a7c);})['catch'](function(_0x5c0ae3){logger[_0x5703('0x15')](_0x5703('0x26'),_0x5c0ae3[_0x5703('0x17')],_0x3508e8);_0x3fadcc(_0x2fb0c0[_0x5703('0x15')](0x1f4,_0x5c0ae3[_0x5703('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6d305c2..ad7e3ab 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 _0x668b=['./chatQueue.events','save','update','removeListener','length'];(function(_0x11a92b,_0x15b34c){var _0x1e82f1=function(_0xb2e02d){while(--_0xb2e02d){_0x11a92b['push'](_0x11a92b['shift']());}};_0x1e82f1(++_0x15b34c);}(_0x668b,0x140));var _0xb668=function(_0xa2b098,_0x461a08){_0xa2b098=_0xa2b098-0x0;var _0x29502e=_0x668b[_0xa2b098];return _0x29502e;};'use strict';var ChatQueueEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),'remove',_0xb668('0x2')];function createListener(_0x2c30c1,_0x49a53b){return function(_0x336ba4){_0x49a53b['emit'](_0x2c30c1,_0x336ba4);};}function removeListener(_0x2fab11,_0x4092a6){return function(){ChatQueueEvents[_0xb668('0x3')](_0x2fab11,_0x4092a6);};}exports['register']=function(_0x9b99a8){for(var _0x296fa9=0x0,_0x3be92e=events[_0xb668('0x4')];_0x296fa9<_0x3be92e;_0x296fa9++){var _0x20b749=events[_0x296fa9];var _0x3f01bc=createListener('chatQueue:'+_0x20b749,_0x9b99a8);ChatQueueEvents['on'](_0x20b749,_0x3f01bc);}};
\ No newline at end of file
+var _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x5e6c25,_0x29046e){var _0x8d0c63=function(_0x509bff){while(--_0x509bff){_0x5e6c25['push'](_0x5e6c25['shift']());}};_0x8d0c63(++_0x29046e);}(_0xb458,0x103));var _0x8b45=function(_0x1024ca,_0x2562fe){_0x1024ca=_0x1024ca-0x0;var _0x390f5c=_0xb458[_0x1024ca];return _0x390f5c;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ca7f30c..dd6c5ec 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 _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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x1a9443,_0x2284ef){_0x1a9443=_0x1a9443-0x0;var _0x10135b=_0x3e74[_0x1a9443];return _0x10135b;};'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
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x455a9c,_0x4235c6){var _0x112350=function(_0x5a044d){while(--_0x5a044d){_0x455a9c['push'](_0x455a9c['shift']());}};_0x112350(++_0x4235c6);}(_0x814b,0x1a2));var _0xb814=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x814b[_0x263f9d];return _0x4c4efa;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index d6c9dfe..2aeefab 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 _0x7f90=['sequelize','STRING','DATE'];(function(_0x24ef90,_0x5d3d10){var _0x5cdded=function(_0x198fbf){while(--_0x198fbf){_0x24ef90['push'](_0x24ef90['shift']());}};_0x5cdded(++_0x5d3d10);}(_0x7f90,0x1c5));var _0x07f9=function(_0x7ed9e9,_0x35fb5d){_0x7ed9e9=_0x7ed9e9-0x0;var _0x383437=_0x7f90[_0x7ed9e9];return _0x383437;};'use strict';var moment=require('moment');var Sequelize=require(_0x07f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x07f9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f9('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x07f9('0x2')]},'reason':{'type':Sequelize[_0x07f9('0x1')]}};
\ No newline at end of file
+var _0x20da=['exports','STRING','DATE','moment','sequelize'];(function(_0x2add1c,_0x50f7c7){var _0x304af0=function(_0x324103){while(--_0x324103){_0x2add1c['push'](_0x2add1c['shift']());}};_0x304af0(++_0x50f7c7);}(_0x20da,0xcb));var _0xa20d=function(_0x58deaf,_0x4d4bde){_0x58deaf=_0x58deaf-0x0;var _0x23ee59=_0x20da[_0x58deaf];return _0x23ee59;};'use strict';var moment=require(_0xa20d('0x0'));var Sequelize=require(_0xa20d('0x1'));module[_0xa20d('0x2')]={'uniqueid':{'type':Sequelize[_0xa20d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa20d('0x4')]},'leaveAt':{'type':Sequelize[_0xa20d('0x4')]},'acceptAt':{'type':Sequelize[_0xa20d('0x4')]},'exitAt':{'type':Sequelize[_0xa20d('0x4')]},'reason':{'type':Sequelize[_0xa20d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 66dce1a..2947fad 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 _0x9bd9=['ChatQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','name','index'];(function(_0x23ebcf,_0x732dee){var _0x1f3f3f=function(_0x1f7abf){while(--_0x1f7abf){_0x23ebcf['push'](_0x23ebcf['shift']());}};_0x1f3f3f(++_0x732dee);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x4a2b3c,_0xc69f59){_0x4a2b3c=_0x4a2b3c-0x0;var _0x4b081b=_0x9bd9[_0x4a2b3c];return _0x4b081b;};'use strict';var emlformat=require(_0x99bd('0x0'));var rimraf=require(_0x99bd('0x1'));var zipdir=require(_0x99bd('0x2'));var jsonpatch=require(_0x99bd('0x3'));var rp=require(_0x99bd('0x4'));var moment=require(_0x99bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99bd('0x6'));var util=require('util');var path=require(_0x99bd('0x7'));var sox=require(_0x99bd('0x8'));var csv=require('to-csv');var ejs=require(_0x99bd('0x9'));var fs=require('fs');var fs_extra=require(_0x99bd('0xa'));var _=require(_0x99bd('0xb'));var squel=require(_0x99bd('0xc'));var crypto=require(_0x99bd('0xd'));var jsforce=require(_0x99bd('0xe'));var deskjs=require(_0x99bd('0xf'));var toCsv=require(_0x99bd('0x10'));var querystring=require(_0x99bd('0x11'));var Papa=require(_0x99bd('0x12'));var Redis=require(_0x99bd('0x13'));var authService=require(_0x99bd('0x14'));var qs=require(_0x99bd('0x15'));var as=require(_0x99bd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bd('0x17'))('api');var utils=require(_0x99bd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x99bd('0x19'));var db=require(_0x99bd('0x1a'))['db'];function respondWithStatusCode(_0x4a8bd9,_0x22237c){_0x22237c=_0x22237c||0xcc;return function(_0x500cd2){if(_0x500cd2){return _0x4a8bd9[_0x99bd('0x1b')](_0x22237c);}return _0x4a8bd9['status'](_0x22237c)[_0x99bd('0x1c')]();};}function respondWithResult(_0x401299,_0x141159){_0x141159=_0x141159||0xc8;return function(_0x4a9770){if(_0x4a9770){return _0x401299[_0x99bd('0x1d')](_0x141159)[_0x99bd('0x1e')](_0x4a9770);}};}function respondWithFilteredResult(_0x2d918a,_0x42b619){return function(_0x65a2e5){if(_0x65a2e5){var _0x491d9=typeof _0x42b619[_0x99bd('0x1f')]===_0x99bd('0x20')&&typeof _0x42b619[_0x99bd('0x21')]==='undefined';var _0x378079=_0x65a2e5[_0x99bd('0x22')];var _0x2fe078=_0x491d9?0x0:_0x42b619['offset'];var _0x4b98fc=_0x491d9?_0x65a2e5[_0x99bd('0x22')]:_0x42b619[_0x99bd('0x1f')]+_0x42b619[_0x99bd('0x21')];var _0xfa6227;if(_0x4b98fc>=_0x378079){_0x4b98fc=_0x378079;_0xfa6227=0xc8;}else{_0xfa6227=0xce;}_0x2d918a[_0x99bd('0x1d')](_0xfa6227);return _0x2d918a['set'](_0x99bd('0x23'),_0x2fe078+'-'+_0x4b98fc+'/'+_0x378079)['json'](_0x65a2e5);}return null;};}function patchUpdates(_0x10f2fb){return function(_0x3085df){try{jsonpatch[_0x99bd('0x24')](_0x3085df,_0x10f2fb,!![]);}catch(_0x1d937b){return BPromise[_0x99bd('0x25')](_0x1d937b);}return _0x3085df['save']();};}function saveUpdates(_0x27c551,_0x229322){return function(_0x3e339c){if(_0x3e339c){return _0x3e339c['update'](_0x27c551)[_0x99bd('0x26')](function(_0x5e6081){return _0x5e6081;});}return null;};}function removeEntity(_0x4d3ebb,_0x1c5b82){return function(_0xfdc455){if(_0xfdc455){return _0xfdc455['destroy']()[_0x99bd('0x26')](function(){_0x4d3ebb[_0x99bd('0x1d')](0xcc)[_0x99bd('0x1c')]();});}};}function handleEntityNotFound(_0x3f7bf4,_0x51ff34){return function(_0x12daac){if(!_0x12daac){_0x3f7bf4['sendStatus'](0x194);}return _0x12daac;};}function handleError(_0x550b7f,_0x10d5cd){_0x10d5cd=_0x10d5cd||0x1f4;return function(_0x5ebeeb){logger[_0x99bd('0x27')](_0x5ebeeb['stack']);if(_0x5ebeeb[_0x99bd('0x28')]){delete _0x5ebeeb[_0x99bd('0x28')];}_0x550b7f['status'](_0x10d5cd)['send'](_0x5ebeeb);};}exports[_0x99bd('0x29')]=function(_0x1af1e6,_0x1eabb9){var _0x5903aa={},_0x957d48={},_0x1d0642={'count':0x0,'rows':[]};var _0x2250d8=_['map'](db[_0x99bd('0x2a')][_0x99bd('0x2b')],function(_0x4c5493){return{'name':_0x4c5493[_0x99bd('0x2c')],'type':_0x4c5493[_0x99bd('0x2d')][_0x99bd('0x2e')]};});_0x957d48[_0x99bd('0x2f')]=_['map'](_0x2250d8,_0x99bd('0x28'));_0x957d48[_0x99bd('0x30')]=_['keys'](_0x1af1e6[_0x99bd('0x30')]);_0x957d48['filters']=_['intersection'](_0x957d48['model'],_0x957d48[_0x99bd('0x30')]);_0x5903aa[_0x99bd('0x31')]=_[_0x99bd('0x32')](_0x957d48[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x33')]));_0x5903aa[_0x99bd('0x31')]=_0x5903aa[_0x99bd('0x31')][_0x99bd('0x34')]?_0x5903aa['attributes']:_0x957d48[_0x99bd('0x2f')];if(!_0x1af1e6['query'][_0x99bd('0x35')]('nolimit')){_0x5903aa['limit']=qs['limit'](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x21')]);_0x5903aa[_0x99bd('0x1f')]=qs[_0x99bd('0x1f')](_0x1af1e6['query'][_0x99bd('0x1f')]);}_0x5903aa[_0x99bd('0x36')]=qs[_0x99bd('0x37')](_0x1af1e6[_0x99bd('0x30')]['sort']);_0x5903aa[_0x99bd('0x38')]=qs[_0x99bd('0x39')](_[_0x99bd('0x3a')](_0x1af1e6[_0x99bd('0x30')],_0x957d48['filters']),_0x2250d8);if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]){_0x5903aa[_0x99bd('0x38')]=_[_0x99bd('0x3c')](_0x5903aa['where'],{'$or':_[_0x99bd('0x3d')](_0x2250d8,function(_0x3d2b0f){if(_0x3d2b0f[_0x99bd('0x2d')]!==_0x99bd('0x3e')){var _0x7e29ec={};_0x7e29ec[_0x3d2b0f[_0x99bd('0x28')]]={'$like':'%'+_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]+'%'};return _0x7e29ec;}})});}_0x5903aa=_[_0x99bd('0x3c')]({},_0x5903aa,_0x1af1e6[_0x99bd('0x3f')]);var _0x2fcf71={'where':_0x5903aa[_0x99bd('0x38')]};return db[_0x99bd('0x2a')]['count'](_0x2fcf71)[_0x99bd('0x26')](function(_0x1ecdd6){_0x1d0642[_0x99bd('0x22')]=_0x1ecdd6;if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x40')]){_0x5903aa[_0x99bd('0x41')]=[{'all':!![]}];}return db[_0x99bd('0x2a')][_0x99bd('0x42')](_0x5903aa);})[_0x99bd('0x26')](function(_0x7e84b1){_0x1d0642[_0x99bd('0x43')]=_0x7e84b1;return _0x1d0642;})[_0x99bd('0x26')](respondWithFilteredResult(_0x1eabb9,_0x5903aa))[_0x99bd('0x44')](handleError(_0x1eabb9,null));};exports[_0x99bd('0x45')]=function(_0xb0ffe5,_0x2d91be){var _0x369fb5={'raw':!![],'where':{'id':_0xb0ffe5[_0x99bd('0x46')]['id']}},_0x5a4a96={};_0x5a4a96[_0x99bd('0x2f')]=_[_0x99bd('0x47')](db[_0x99bd('0x2a')][_0x99bd('0x2b')]);_0x5a4a96[_0x99bd('0x30')]=_[_0x99bd('0x47')](_0xb0ffe5[_0x99bd('0x30')]);_0x5a4a96['filters']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],_0x5a4a96[_0x99bd('0x30')]);_0x369fb5['attributes']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0xb0ffe5['query'][_0x99bd('0x33')]));_0x369fb5['attributes']=_0x369fb5['attributes']['length']?_0x369fb5[_0x99bd('0x31')]:_0x5a4a96[_0x99bd('0x2f')];if(_0xb0ffe5[_0x99bd('0x30')]['includeAll']){_0x369fb5[_0x99bd('0x41')]=[{'all':!![]}];}_0x369fb5=_[_0x99bd('0x3c')]({},_0x369fb5,_0xb0ffe5[_0x99bd('0x3f')]);return db['ChatQueueReport'][_0x99bd('0x48')](_0x369fb5)[_0x99bd('0x26')](handleEntityNotFound(_0x2d91be,null))['then'](respondWithResult(_0x2d91be,null))['catch'](handleError(_0x2d91be,null));};exports[_0x99bd('0x49')]=function(_0x1d7ec0,_0x3487c6){return db['ChatQueueReport']['create'](_0x1d7ec0[_0x99bd('0x4a')],{})[_0x99bd('0x26')](respondWithResult(_0x3487c6,0xc9))[_0x99bd('0x44')](handleError(_0x3487c6,null));};exports['update']=function(_0x3fa8e1,_0x4e71b3){if(_0x3fa8e1[_0x99bd('0x4a')]['id']){delete _0x3fa8e1[_0x99bd('0x4a')]['id'];}return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x3fa8e1[_0x99bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e71b3,null))[_0x99bd('0x26')](saveUpdates(_0x3fa8e1['body'],null))[_0x99bd('0x26')](respondWithResult(_0x4e71b3,null))[_0x99bd('0x44')](handleError(_0x4e71b3,null));};exports[_0x99bd('0x4b')]=function(_0x1912ac,_0x2100c7){return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x1912ac['params']['id']}})['then'](handleEntityNotFound(_0x2100c7,null))[_0x99bd('0x26')](removeEntity(_0x2100c7,null))[_0x99bd('0x44')](handleError(_0x2100c7,null));};exports[_0x99bd('0x4c')]=function(_0x2f0fb7,_0x25c67d){return db[_0x99bd('0x2a')][_0x99bd('0x4c')]()['then'](respondWithResult(_0x25c67d,null))['catch'](handleError(_0x25c67d,null));};
\ No newline at end of file
+var _0xbccd=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','ChatQueueReport','findAll','params','keys','length','find','create','catch','body','describe'];(function(_0x444af1,_0x117b28){var _0x3f137f=function(_0x4a8d06){while(--_0x4a8d06){_0x444af1['push'](_0x444af1['shift']());}};_0x3f137f(++_0x117b28);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbccd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xdbcc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbcc('0x1'));var rp=require(_0xdbcc('0x2'));var moment=require(_0xdbcc('0x3'));var BPromise=require(_0xdbcc('0x4'));var Mustache=require(_0xdbcc('0x5'));var util=require(_0xdbcc('0x6'));var path=require('path');var sox=require(_0xdbcc('0x7'));var csv=require(_0xdbcc('0x8'));var ejs=require(_0xdbcc('0x9'));var fs=require('fs');var fs_extra=require(_0xdbcc('0xa'));var _=require(_0xdbcc('0xb'));var squel=require(_0xdbcc('0xc'));var crypto=require(_0xdbcc('0xd'));var jsforce=require(_0xdbcc('0xe'));var deskjs=require(_0xdbcc('0xf'));var toCsv=require(_0xdbcc('0x8'));var querystring=require(_0xdbcc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbcc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbcc('0x12'));var hardwareService=require(_0xdbcc('0x13'));var logger=require(_0xdbcc('0x14'))(_0xdbcc('0x15'));var utils=require(_0xdbcc('0x16'));var config=require(_0xdbcc('0x17'));var licenseUtil=require(_0xdbcc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fbd02,_0x4c8384){_0x4c8384=_0x4c8384||0xcc;return function(_0x52b3bf){if(_0x52b3bf){return _0x2fbd02['sendStatus'](_0x4c8384);}return _0x2fbd02[_0xdbcc('0x19')](_0x4c8384)[_0xdbcc('0x1a')]();};}function respondWithResult(_0x290b93,_0xa799eb){_0xa799eb=_0xa799eb||0xc8;return function(_0x381f22){if(_0x381f22){return _0x290b93[_0xdbcc('0x19')](_0xa799eb)[_0xdbcc('0x1b')](_0x381f22);}};}function respondWithFilteredResult(_0x4649d2,_0x5c53a1){return function(_0x5688ce){if(_0x5688ce){var _0x2b189a=typeof _0x5c53a1[_0xdbcc('0x1c')]===_0xdbcc('0x1d')&&typeof _0x5c53a1[_0xdbcc('0x1e')]===_0xdbcc('0x1d');var _0x2df00c=_0x5688ce[_0xdbcc('0x1f')];var _0x3bfeb0=_0x2b189a?0x0:_0x5c53a1[_0xdbcc('0x1c')];var _0x3d9bda=_0x2b189a?_0x5688ce[_0xdbcc('0x1f')]:_0x5c53a1[_0xdbcc('0x1c')]+_0x5c53a1[_0xdbcc('0x1e')];var _0x4dd404;if(_0x3d9bda>=_0x2df00c){_0x3d9bda=_0x2df00c;_0x4dd404=0xc8;}else{_0x4dd404=0xce;}_0x4649d2['status'](_0x4dd404);return _0x4649d2[_0xdbcc('0x20')](_0xdbcc('0x21'),_0x3bfeb0+'-'+_0x3d9bda+'/'+_0x2df00c)['json'](_0x5688ce);}return null;};}function patchUpdates(_0x447f70){return function(_0x47990b){try{jsonpatch[_0xdbcc('0x22')](_0x47990b,_0x447f70,!![]);}catch(_0x500ec4){return BPromise['reject'](_0x500ec4);}return _0x47990b[_0xdbcc('0x23')]();};}function saveUpdates(_0x3c321f,_0x40d7d0){return function(_0x6eee38){if(_0x6eee38){return _0x6eee38[_0xdbcc('0x24')](_0x3c321f)[_0xdbcc('0x25')](function(_0x2d797a){return _0x2d797a;});}return null;};}function removeEntity(_0x18d47f,_0x591962){return function(_0x343523){if(_0x343523){return _0x343523['destroy']()[_0xdbcc('0x25')](function(){_0x18d47f[_0xdbcc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d76d,_0xb2a8b4){return function(_0x2df594){if(!_0x2df594){_0x18d76d['sendStatus'](0x194);}return _0x2df594;};}function handleError(_0x50e23c,_0xbe9ba3){_0xbe9ba3=_0xbe9ba3||0x1f4;return function(_0x17e223){logger[_0xdbcc('0x26')](_0x17e223['stack']);if(_0x17e223[_0xdbcc('0x27')]){delete _0x17e223[_0xdbcc('0x27')];}_0x50e23c['status'](_0xbe9ba3)[_0xdbcc('0x28')](_0x17e223);};}exports[_0xdbcc('0x29')]=function(_0x26cf3a,_0x59b175){var _0x31412c={},_0x548047={},_0x1b4425={'count':0x0,'rows':[]};var _0x57d722=_[_0xdbcc('0x2a')](db['ChatQueueReport'][_0xdbcc('0x2b')],function(_0x38b9ac){return{'name':_0x38b9ac[_0xdbcc('0x2c')],'type':_0x38b9ac[_0xdbcc('0x2d')][_0xdbcc('0x2e')]};});_0x548047[_0xdbcc('0x2f')]=_[_0xdbcc('0x2a')](_0x57d722,'name');_0x548047[_0xdbcc('0x30')]=_['keys'](_0x26cf3a[_0xdbcc('0x30')]);_0x548047['filters']=_['intersection'](_0x548047[_0xdbcc('0x2f')],_0x548047[_0xdbcc('0x30')]);_0x31412c['attributes']=_[_0xdbcc('0x31')](_0x548047['model'],qs[_0xdbcc('0x32')](_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x32')]));_0x31412c[_0xdbcc('0x33')]=_0x31412c[_0xdbcc('0x33')]['length']?_0x31412c[_0xdbcc('0x33')]:_0x548047[_0xdbcc('0x2f')];if(!_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x34')]('nolimit')){_0x31412c['limit']=qs[_0xdbcc('0x1e')](_0x26cf3a['query']['limit']);_0x31412c[_0xdbcc('0x1c')]=qs[_0xdbcc('0x1c')](_0x26cf3a[_0xdbcc('0x30')]['offset']);}_0x31412c['order']=qs[_0xdbcc('0x35')](_0x26cf3a[_0xdbcc('0x30')]['sort']);_0x31412c['where']=qs[_0xdbcc('0x36')](_[_0xdbcc('0x37')](_0x26cf3a[_0xdbcc('0x30')],_0x548047[_0xdbcc('0x36')]),_0x57d722);if(_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]){_0x31412c[_0xdbcc('0x39')]=_['merge'](_0x31412c[_0xdbcc('0x39')],{'$or':_['map'](_0x57d722,function(_0x2826d5){if(_0x2826d5[_0xdbcc('0x2d')]!=='VIRTUAL'){var _0xfc5684={};_0xfc5684[_0x2826d5[_0xdbcc('0x27')]]={'$like':'%'+_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]+'%'};return _0xfc5684;}})});}_0x31412c=_[_0xdbcc('0x3a')]({},_0x31412c,_0x26cf3a[_0xdbcc('0x3b')]);var _0x193651={'where':_0x31412c[_0xdbcc('0x39')]};return db['ChatQueueReport'][_0xdbcc('0x1f')](_0x193651)[_0xdbcc('0x25')](function(_0x298e63){_0x1b4425[_0xdbcc('0x1f')]=_0x298e63;if(_0x26cf3a['query'][_0xdbcc('0x3c')]){_0x31412c[_0xdbcc('0x3d')]=[{'all':!![]}];}return db[_0xdbcc('0x3e')][_0xdbcc('0x3f')](_0x31412c);})[_0xdbcc('0x25')](function(_0x24b4d5){_0x1b4425['rows']=_0x24b4d5;return _0x1b4425;})[_0xdbcc('0x25')](respondWithFilteredResult(_0x59b175,_0x31412c))['catch'](handleError(_0x59b175,null));};exports['show']=function(_0x3d4371,_0x3de65f){var _0x1c1ea8={'raw':!![],'where':{'id':_0x3d4371[_0xdbcc('0x40')]['id']}},_0x5c32db={};_0x5c32db['model']=_[_0xdbcc('0x41')](db[_0xdbcc('0x3e')][_0xdbcc('0x2b')]);_0x5c32db['query']=_[_0xdbcc('0x41')](_0x3d4371[_0xdbcc('0x30')]);_0x5c32db[_0xdbcc('0x36')]=_['intersection'](_0x5c32db[_0xdbcc('0x2f')],_0x5c32db[_0xdbcc('0x30')]);_0x1c1ea8['attributes']=_[_0xdbcc('0x31')](_0x5c32db[_0xdbcc('0x2f')],qs[_0xdbcc('0x32')](_0x3d4371['query'][_0xdbcc('0x32')]));_0x1c1ea8[_0xdbcc('0x33')]=_0x1c1ea8[_0xdbcc('0x33')][_0xdbcc('0x42')]?_0x1c1ea8['attributes']:_0x5c32db[_0xdbcc('0x2f')];if(_0x3d4371[_0xdbcc('0x30')]['includeAll']){_0x1c1ea8[_0xdbcc('0x3d')]=[{'all':!![]}];}_0x1c1ea8=_[_0xdbcc('0x3a')]({},_0x1c1ea8,_0x3d4371[_0xdbcc('0x3b')]);return db['ChatQueueReport'][_0xdbcc('0x43')](_0x1c1ea8)[_0xdbcc('0x25')](handleEntityNotFound(_0x3de65f,null))[_0xdbcc('0x25')](respondWithResult(_0x3de65f,null))['catch'](handleError(_0x3de65f,null));};exports[_0xdbcc('0x44')]=function(_0x301f00,_0x2b2172){return db[_0xdbcc('0x3e')]['create'](_0x301f00['body'],{})[_0xdbcc('0x25')](respondWithResult(_0x2b2172,0xc9))[_0xdbcc('0x45')](handleError(_0x2b2172,null));};exports[_0xdbcc('0x24')]=function(_0x5da133,_0x16f783){if(_0x5da133[_0xdbcc('0x46')]['id']){delete _0x5da133[_0xdbcc('0x46')]['id'];}return db[_0xdbcc('0x3e')]['find']({'where':{'id':_0x5da133[_0xdbcc('0x40')]['id']}})[_0xdbcc('0x25')](handleEntityNotFound(_0x16f783,null))[_0xdbcc('0x25')](saveUpdates(_0x5da133[_0xdbcc('0x46')],null))[_0xdbcc('0x25')](respondWithResult(_0x16f783,null))[_0xdbcc('0x45')](handleError(_0x16f783,null));};exports['destroy']=function(_0x534063,_0x1470e9){return db['ChatQueueReport'][_0xdbcc('0x43')]({'where':{'id':_0x534063['params']['id']}})['then'](handleEntityNotFound(_0x1470e9,null))[_0xdbcc('0x25')](removeEntity(_0x1470e9,null))['catch'](handleError(_0x1470e9,null));};exports[_0xdbcc('0x47')]=function(_0xe005aa,_0x5e2656){return db[_0xdbcc('0x3e')][_0xdbcc('0x47')]()['then'](respondWithResult(_0x5e2656,null))[_0xdbcc('0x45')](handleError(_0x5e2656,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 98198dc..2977911 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xc471d2,_0x26ab16){var _0x334c68=function(_0x2deae4){while(--_0x2deae4){_0xc471d2['push'](_0xc471d2['shift']());}};_0x334c68(++_0x26ab16);}(_0xe706,0xa3));var _0x6e70=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xe706[_0x3747ae];return _0x339035;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x31f5b0,_0x3ceb60){var _0x25dfd3=function(_0x4f81da){while(--_0x4f81da){_0x31f5b0['push'](_0x31f5b0['shift']());}};_0x25dfd3(++_0x3ceb60);}(_0xe706,0xa3));var _0x6e70=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xe706[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 68ed440..db24446 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 _0x502a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','limit','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x502a,0x1df));var _0xa502=function(_0xb0b376,_0x4bc0a3){_0xb0b376=_0xb0b376-0x0;var _0xe274=_0x502a[_0xb0b376];return _0xe274;};'use strict';var _=require('lodash');var util=require(_0xa502('0x0'));var moment=require(_0xa502('0x1'));var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require(_0xa502('0x4'));var db=require(_0xa502('0x5'))['db'];var utils=require(_0xa502('0x6'));var logger=require(_0xa502('0x7'))(_0xa502('0x8'));var config=require(_0xa502('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa502('0xa')][_0xa502('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39df41,_0x1e5600,_0x2e102b){return new BPromise(function(_0x5f463a,_0x2a70f3){return client['request'](_0x39df41,_0x2e102b)[_0xa502('0xc')](function(_0x305a4b){logger['info'](_0xa502('0xd'),_0x1e5600,_0xa502('0xe'));logger[_0xa502('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1e5600,'request\x20sent',JSON[_0xa502('0x10')](_0x305a4b));if(_0x305a4b[_0xa502('0x11')]){if(_0x305a4b[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1e5600,_0x305a4b['error'][_0xa502('0x13')]);return _0x2a70f3(_0x305a4b[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')](_0xa502('0xd'),_0x1e5600,_0x305a4b[_0xa502('0x11')]['message']);return _0x5f463a(_0x305a4b['error'][_0xa502('0x13')]);}else{logger[_0xa502('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x1e5600,_0xa502('0xe'));_0x5f463a(_0x305a4b['result'][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x2e37f8){logger[_0xa502('0x11')](_0xa502('0xd'),_0x1e5600,_0x2e37f8);_0x2a70f3(_0x2e37f8);});});}exports[_0xa502('0x16')]=function(_0x69ac3b){var _0x3b7719=this;return new Promise(function(_0x377739,_0xe4fe73){return db[_0xa502('0x17')][_0xa502('0x18')](_0x69ac3b[_0xa502('0x19')],{'raw':_0x69ac3b[_0xa502('0x1a')]?_0x69ac3b['options']['raw']===undefined?!![]:![]:!![]})[_0xa502('0xc')](function(_0x2d9060){logger['info'](_0xa502('0x16'),_0x69ac3b);logger['debug'](_0xa502('0x16'),_0x69ac3b,JSON[_0xa502('0x10')](_0x2d9060));_0x377739(_0x2d9060);})[_0xa502('0x15')](function(_0x3459e4){logger[_0xa502('0x11')]('CreateChatQueueReport',_0x3459e4[_0xa502('0x13')],_0x69ac3b);_0xe4fe73(_0x3b7719['error'](0x1f4,_0x3459e4[_0xa502('0x13')]));});});};exports[_0xa502('0x1b')]=function(_0x3492c6){var _0x2819e1=this;return new Promise(function(_0x9c55fb,_0x405ae0){return db[_0xa502('0x17')][_0xa502('0x1c')](_0x3492c6[_0xa502('0x19')],{'raw':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1e')]||null:null,'attributes':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')]['attributes']||null:null,'limit':_0x3492c6[_0xa502('0x1a')]?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1f')]||null:null})['then'](function(_0x577861){logger['info']('UpdateChatQueueReport',_0x3492c6);logger['debug']('UpdateChatQueueReport',_0x3492c6,JSON['stringify'](_0x577861));_0x9c55fb(_0x577861);})[_0xa502('0x15')](function(_0x13c432){logger[_0xa502('0x11')](_0xa502('0x1b'),_0x13c432['message'],_0x3492c6);_0x405ae0(_0x2819e1[_0xa502('0x11')](0x1f4,_0x13c432[_0xa502('0x13')]));});});};
\ No newline at end of file
+var _0xdc91=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0xdc91,0x10c));var _0x1dc9=function(_0x2da629,_0x1b1f12){_0x2da629=_0x2da629-0x0;var _0x34b6f7=_0xdc91[_0x2da629];return _0x34b6f7;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require(_0x1dc9('0x2'));var BPromise=require(_0x1dc9('0x3'));var rs=require(_0x1dc9('0x4'));var fs=require('fs');var Redis=require(_0x1dc9('0x5'));var db=require(_0x1dc9('0x6'))['db'];var utils=require(_0x1dc9('0x7'));var logger=require(_0x1dc9('0x8'))(_0x1dc9('0x9'));var config=require(_0x1dc9('0xa'));var jayson=require(_0x1dc9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x358946,_0x3323f,_0x598916){return new BPromise(function(_0x549f73,_0xf6e540){return client[_0x1dc9('0xc')](_0x358946,_0x598916)[_0x1dc9('0xd')](function(_0x3c074b){logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));logger[_0x1dc9('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3323f,_0x1dc9('0x10'),JSON[_0x1dc9('0x12')](_0x3c074b));if(_0x3c074b[_0x1dc9('0x13')]){if(_0x3c074b['error'][_0x1dc9('0x14')]===0x1f4){logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')][_0x1dc9('0x15')]);return _0xf6e540(_0x3c074b['error'][_0x1dc9('0x15')]);}logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')]['message']);return _0x549f73(_0x3c074b['error'][_0x1dc9('0x15')]);}else{logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));_0x549f73(_0x3c074b[_0x1dc9('0x16')][_0x1dc9('0x15')]);}})[_0x1dc9('0x17')](function(_0x30f908){logger[_0x1dc9('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x3323f,_0x30f908);_0xf6e540(_0x30f908);});});}exports[_0x1dc9('0x18')]=function(_0x460bae){var _0x4b7123=this;return new Promise(function(_0x230148,_0x5553d6){return db[_0x1dc9('0x19')]['create'](_0x460bae['body'],{'raw':_0x460bae[_0x1dc9('0x1a')]?_0x460bae['options'][_0x1dc9('0x1b')]===undefined?!![]:![]:!![]})[_0x1dc9('0xd')](function(_0x197e1c){logger[_0x1dc9('0xe')](_0x1dc9('0x18'),_0x460bae);logger[_0x1dc9('0x11')]('CreateChatQueueReport',_0x460bae,JSON['stringify'](_0x197e1c));_0x230148(_0x197e1c);})[_0x1dc9('0x17')](function(_0x586886){logger[_0x1dc9('0x13')](_0x1dc9('0x18'),_0x586886[_0x1dc9('0x15')],_0x460bae);_0x5553d6(_0x4b7123[_0x1dc9('0x13')](0x1f4,_0x586886[_0x1dc9('0x15')]));});});};exports[_0x1dc9('0x1c')]=function(_0x27011a){var _0x1a2dd4=this;return new Promise(function(_0x5babc9,_0x2159c7){return db[_0x1dc9('0x19')][_0x1dc9('0x1d')](_0x27011a[_0x1dc9('0x1e')],{'raw':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1f')]||null:null,'attributes':_0x27011a['options']?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x20')]||null:null,'limit':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x21')]||null:null})['then'](function(_0x2a6893){logger[_0x1dc9('0xe')]('UpdateChatQueueReport',_0x27011a);logger[_0x1dc9('0x11')](_0x1dc9('0x1c'),_0x27011a,JSON['stringify'](_0x2a6893));_0x5babc9(_0x2a6893);})[_0x1dc9('0x17')](function(_0x3d4a94){logger[_0x1dc9('0x13')](_0x1dc9('0x1c'),_0x3d4a94[_0x1dc9('0x15')],_0x27011a);_0x2159c7(_0x1a2dd4['error'](0x1f4,_0x3d4a94[_0x1dc9('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 20fbc9e..ac145e3 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 _0x735f=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x556f1f,_0x2897d){var _0x3ade22=function(_0x1c8284){while(--_0x1c8284){_0x556f1f['push'](_0x556f1f['shift']());}};_0x3ade22(++_0x2897d);}(_0x735f,0x179));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf735('0x0'));var util=require(_0xf735('0x1'));var path=require(_0xf735('0x2'));var timeout=require(_0xf735('0x3'));var express=require(_0xf735('0x4'));var router=express[_0xf735('0x5')]();var fs_extra=require(_0xf735('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf735('0x7'));var config=require(_0xf735('0x8'));var controller=require(_0xf735('0x9'));router[_0xf735('0xa')]('/',auth[_0xf735('0xb')](),controller[_0xf735('0xc')]);router[_0xf735('0xa')](_0xf735('0xd'),auth[_0xf735('0xb')](),controller[_0xf735('0xe')]);router[_0xf735('0xa')](_0xf735('0xf'),auth[_0xf735('0xb')](),controller[_0xf735('0x10')]);router[_0xf735('0x11')]('/',auth[_0xf735('0xb')](),controller[_0xf735('0x12')]);router[_0xf735('0x13')](_0xf735('0xf'),auth[_0xf735('0xb')](),controller[_0xf735('0x14')]);router[_0xf735('0x15')](_0xf735('0xf'),auth['isAuthenticated'](),controller[_0xf735('0x16')]);module[_0xf735('0x17')]=router;
\ No newline at end of file
+var _0x56da=['delete','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x562bc8,_0x1b1c19){var _0x2a37d3=function(_0x180ba9){while(--_0x180ba9){_0x562bc8['push'](_0x562bc8['shift']());}};_0x2a37d3(++_0x1b1c19);}(_0x56da,0x1e1));var _0xa56d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x56da[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0xa56d('0x0'));var path=require('path');var timeout=require(_0xa56d('0x1'));var express=require(_0xa56d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa56d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa56d('0x4'));var controller=require(_0xa56d('0x5'));router[_0xa56d('0x6')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0x8')]);router[_0xa56d('0x6')]('/describe',auth[_0xa56d('0x7')](),controller['describe']);router[_0xa56d('0x6')]('/:id',auth[_0xa56d('0x7')](),controller[_0xa56d('0x9')]);router[_0xa56d('0xa')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0xb')]);router[_0xa56d('0xc')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 6e8cb4f..0fcd93d 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2933d1,_0x34a4e5){var _0x45134e=function(_0x341d04){while(--_0x341d04){_0x2933d1['push'](_0x2933d1['shift']());}};_0x45134e(++_0x34a4e5);}(_0x70e0,0x17b));var _0x070e=function(_0xe5708b,_0x45df1c){_0xe5708b=_0xe5708b-0x0;var _0x41bad8=_0x70e0[_0xe5708b];return _0x41bad8;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4918c6,_0x5cc45a){var _0x585f66=function(_0xfacd7f){while(--_0xfacd7f){_0x4918c6['push'](_0x4918c6['shift']());}};_0x585f66(++_0x5cc45a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xf3cd[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index a6df224..608bf99 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 _0x6d38=['fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','limit','count','offset','json','apply','reject','save','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatTransferReport','rows','show','params','includeAll','include','find','catch','create','body','update','describe','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4f3f94,_0x386c38){var _0xbb95d5=function(_0x15cba5){while(--_0x15cba5){_0x4f3f94['push'](_0x4f3f94['shift']());}};_0xbb95d5(++_0x386c38);}(_0x6d38,0xc4));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86d3('0x0'));var rp=require('request-promise');var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var Mustache=require(_0x86d3('0x3'));var util=require('util');var path=require(_0x86d3('0x4'));var sox=require(_0x86d3('0x5'));var csv=require(_0x86d3('0x6'));var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require('lodash');var squel=require(_0x86d3('0x9'));var crypto=require(_0x86d3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x86d3('0xc'));var Papa=require(_0x86d3('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x86d3('0xe'));var hardwareService=require(_0x86d3('0xf'));var logger=require('../../config/logger')(_0x86d3('0x10'));var utils=require(_0x86d3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x86d3('0x12'));var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0xbcf7b4,_0xc3c0a5){_0xc3c0a5=_0xc3c0a5||0xcc;return function(_0x1c37f1){if(_0x1c37f1){return _0xbcf7b4['sendStatus'](_0xc3c0a5);}return _0xbcf7b4[_0x86d3('0x14')](_0xc3c0a5)[_0x86d3('0x15')]();};}function respondWithResult(_0x563f0b,_0x2983e2){_0x2983e2=_0x2983e2||0xc8;return function(_0x20ee25){if(_0x20ee25){return _0x563f0b[_0x86d3('0x14')](_0x2983e2)['json'](_0x20ee25);}};}function respondWithFilteredResult(_0x488c57,_0x58f969){return function(_0x361ac8){if(_0x361ac8){var _0x47814a=typeof _0x58f969['offset']==='undefined'&&typeof _0x58f969[_0x86d3('0x16')]==='undefined';var _0x495cd6=_0x361ac8[_0x86d3('0x17')];var _0x1c75d=_0x47814a?0x0:_0x58f969[_0x86d3('0x18')];var _0x12e428=_0x47814a?_0x361ac8['count']:_0x58f969[_0x86d3('0x18')]+_0x58f969['limit'];var _0x1d622f;if(_0x12e428>=_0x495cd6){_0x12e428=_0x495cd6;_0x1d622f=0xc8;}else{_0x1d622f=0xce;}_0x488c57['status'](_0x1d622f);return _0x488c57['set']('Content-Range',_0x1c75d+'-'+_0x12e428+'/'+_0x495cd6)[_0x86d3('0x19')](_0x361ac8);}return null;};}function patchUpdates(_0x202497){return function(_0x3d18a6){try{jsonpatch[_0x86d3('0x1a')](_0x3d18a6,_0x202497,!![]);}catch(_0x525360){return BPromise[_0x86d3('0x1b')](_0x525360);}return _0x3d18a6[_0x86d3('0x1c')]();};}function saveUpdates(_0x268fff,_0x5f41af){return function(_0x1c68c9){if(_0x1c68c9){return _0x1c68c9['update'](_0x268fff)[_0x86d3('0x1d')](function(_0x12b7f2){return _0x12b7f2;});}return null;};}function removeEntity(_0x2988fd,_0x3fd4a6){return function(_0x3864c0){if(_0x3864c0){return _0x3864c0[_0x86d3('0x1e')]()[_0x86d3('0x1d')](function(){_0x2988fd[_0x86d3('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb0a5d7,_0x17d02b){return function(_0x1a700d){if(!_0x1a700d){_0xb0a5d7[_0x86d3('0x1f')](0x194);}return _0x1a700d;};}function handleError(_0x42741c,_0x40c2b9){_0x40c2b9=_0x40c2b9||0x1f4;return function(_0x16d5aa){logger[_0x86d3('0x20')](_0x16d5aa['stack']);if(_0x16d5aa['name']){delete _0x16d5aa[_0x86d3('0x21')];}_0x42741c[_0x86d3('0x14')](_0x40c2b9)['send'](_0x16d5aa);};}exports[_0x86d3('0x22')]=function(_0x355dd1,_0x10e170){var _0xfd4e95={},_0x22c288={},_0xc2b227={'count':0x0,'rows':[]};var _0x22d52f=_[_0x86d3('0x23')](db['ChatTransferReport'][_0x86d3('0x24')],function(_0x5686db){return{'name':_0x5686db[_0x86d3('0x25')],'type':_0x5686db[_0x86d3('0x26')][_0x86d3('0x27')]};});_0x22c288[_0x86d3('0x28')]=_[_0x86d3('0x23')](_0x22d52f,_0x86d3('0x21'));_0x22c288[_0x86d3('0x29')]=_[_0x86d3('0x2a')](_0x355dd1['query']);_0x22c288[_0x86d3('0x2b')]=_[_0x86d3('0x2c')](_0x22c288[_0x86d3('0x28')],_0x22c288[_0x86d3('0x29')]);_0xfd4e95[_0x86d3('0x2d')]=_['intersection'](_0x22c288['model'],qs[_0x86d3('0x2e')](_0x355dd1['query']['fields']));_0xfd4e95[_0x86d3('0x2d')]=_0xfd4e95['attributes'][_0x86d3('0x2f')]?_0xfd4e95['attributes']:_0x22c288['model'];if(!_0x355dd1['query'][_0x86d3('0x30')](_0x86d3('0x31'))){_0xfd4e95[_0x86d3('0x16')]=qs[_0x86d3('0x16')](_0x355dd1[_0x86d3('0x29')][_0x86d3('0x16')]);_0xfd4e95['offset']=qs[_0x86d3('0x18')](_0x355dd1['query'][_0x86d3('0x18')]);}_0xfd4e95['order']=qs[_0x86d3('0x32')](_0x355dd1[_0x86d3('0x29')][_0x86d3('0x32')]);_0xfd4e95[_0x86d3('0x33')]=qs[_0x86d3('0x2b')](_[_0x86d3('0x34')](_0x355dd1['query'],_0x22c288[_0x86d3('0x2b')]),_0x22d52f);if(_0x355dd1[_0x86d3('0x29')][_0x86d3('0x35')]){_0xfd4e95['where']=_[_0x86d3('0x36')](_0xfd4e95[_0x86d3('0x33')],{'$or':_[_0x86d3('0x23')](_0x22d52f,function(_0x3f4365){if(_0x3f4365['type']!=='VIRTUAL'){var _0x43fff6={};_0x43fff6[_0x3f4365['name']]={'$like':'%'+_0x355dd1[_0x86d3('0x29')][_0x86d3('0x35')]+'%'};return _0x43fff6;}})});}_0xfd4e95=_[_0x86d3('0x36')]({},_0xfd4e95,_0x355dd1[_0x86d3('0x37')]);var _0x3db251={'where':_0xfd4e95[_0x86d3('0x33')]};return db[_0x86d3('0x38')][_0x86d3('0x17')](_0x3db251)[_0x86d3('0x1d')](function(_0x1baef4){_0xc2b227[_0x86d3('0x17')]=_0x1baef4;if(_0x355dd1[_0x86d3('0x29')]['includeAll']){_0xfd4e95['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0xfd4e95);})[_0x86d3('0x1d')](function(_0x4a148e){_0xc2b227[_0x86d3('0x39')]=_0x4a148e;return _0xc2b227;})[_0x86d3('0x1d')](respondWithFilteredResult(_0x10e170,_0xfd4e95))['catch'](handleError(_0x10e170,null));};exports[_0x86d3('0x3a')]=function(_0x20b48a,_0x46c557){var _0x32b7a0={'raw':!![],'where':{'id':_0x20b48a[_0x86d3('0x3b')]['id']}},_0x1993ab={};_0x1993ab[_0x86d3('0x28')]=_[_0x86d3('0x2a')](db[_0x86d3('0x38')][_0x86d3('0x24')]);_0x1993ab[_0x86d3('0x29')]=_[_0x86d3('0x2a')](_0x20b48a[_0x86d3('0x29')]);_0x1993ab[_0x86d3('0x2b')]=_['intersection'](_0x1993ab['model'],_0x1993ab[_0x86d3('0x29')]);_0x32b7a0[_0x86d3('0x2d')]=_[_0x86d3('0x2c')](_0x1993ab['model'],qs['fields'](_0x20b48a['query'][_0x86d3('0x2e')]));_0x32b7a0[_0x86d3('0x2d')]=_0x32b7a0[_0x86d3('0x2d')]['length']?_0x32b7a0['attributes']:_0x1993ab[_0x86d3('0x28')];if(_0x20b48a['query'][_0x86d3('0x3c')]){_0x32b7a0[_0x86d3('0x3d')]=[{'all':!![]}];}_0x32b7a0=_['merge']({},_0x32b7a0,_0x20b48a[_0x86d3('0x37')]);return db[_0x86d3('0x38')][_0x86d3('0x3e')](_0x32b7a0)[_0x86d3('0x1d')](handleEntityNotFound(_0x46c557,null))[_0x86d3('0x1d')](respondWithResult(_0x46c557,null))[_0x86d3('0x3f')](handleError(_0x46c557,null));};exports[_0x86d3('0x40')]=function(_0x231a46,_0x2ee6a6){return db[_0x86d3('0x38')][_0x86d3('0x40')](_0x231a46[_0x86d3('0x41')],{})['then'](respondWithResult(_0x2ee6a6,0xc9))[_0x86d3('0x3f')](handleError(_0x2ee6a6,null));};exports[_0x86d3('0x42')]=function(_0x50987d,_0x2d9b4d){if(_0x50987d[_0x86d3('0x41')]['id']){delete _0x50987d['body']['id'];}return db[_0x86d3('0x38')][_0x86d3('0x3e')]({'where':{'id':_0x50987d['params']['id']}})[_0x86d3('0x1d')](handleEntityNotFound(_0x2d9b4d,null))['then'](saveUpdates(_0x50987d[_0x86d3('0x41')],null))[_0x86d3('0x1d')](respondWithResult(_0x2d9b4d,null))[_0x86d3('0x3f')](handleError(_0x2d9b4d,null));};exports[_0x86d3('0x1e')]=function(_0x9c3996,_0x58864e){return db['ChatTransferReport']['find']({'where':{'id':_0x9c3996[_0x86d3('0x3b')]['id']}})[_0x86d3('0x1d')](handleEntityNotFound(_0x58864e,null))[_0x86d3('0x1d')](removeEntity(_0x58864e,null))['catch'](handleError(_0x58864e,null));};exports['describe']=function(_0x1b7f13,_0xdadb50){return db[_0x86d3('0x38')][_0x86d3('0x43')]()[_0x86d3('0x1d')](respondWithResult(_0xdadb50,null))['catch'](handleError(_0xdadb50,null));};
\ No newline at end of file
+var _0x0a3b=['util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3ae3fe,_0x2f1ea3){var _0xf25a7f=function(_0x51c3cc){while(--_0x51c3cc){_0x3ae3fe['push'](_0x3ae3fe['shift']());}};_0xf25a7f(++_0x2f1ea3);}(_0x0a3b,0xdc));var _0xb0a3=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x0a3b[_0x43b06b];return _0x2c555b;};'use strict';var emlformat=require(_0xb0a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0a3('0x1'));var jsonpatch=require(_0xb0a3('0x2'));var rp=require(_0xb0a3('0x3'));var moment=require(_0xb0a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0a3('0x5'));var path=require('path');var sox=require(_0xb0a3('0x6'));var csv=require(_0xb0a3('0x7'));var ejs=require(_0xb0a3('0x8'));var fs=require('fs');var fs_extra=require(_0xb0a3('0x9'));var _=require(_0xb0a3('0xa'));var squel=require('squel');var crypto=require(_0xb0a3('0xb'));var jsforce=require(_0xb0a3('0xc'));var deskjs=require(_0xb0a3('0xd'));var toCsv=require(_0xb0a3('0x7'));var querystring=require(_0xb0a3('0xe'));var Papa=require(_0xb0a3('0xf'));var Redis=require(_0xb0a3('0x10'));var authService=require(_0xb0a3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb0a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0a3('0x13'))(_0xb0a3('0x14'));var utils=require(_0xb0a3('0x15'));var config=require(_0xb0a3('0x16'));var licenseUtil=require(_0xb0a3('0x17'));var db=require(_0xb0a3('0x18'))['db'];function respondWithStatusCode(_0xd7d198,_0x35cbde){_0x35cbde=_0x35cbde||0xcc;return function(_0x537270){if(_0x537270){return _0xd7d198[_0xb0a3('0x19')](_0x35cbde);}return _0xd7d198['status'](_0x35cbde)[_0xb0a3('0x1a')]();};}function respondWithResult(_0x30b411,_0x1afb35){_0x1afb35=_0x1afb35||0xc8;return function(_0x5857df){if(_0x5857df){return _0x30b411[_0xb0a3('0x1b')](_0x1afb35)[_0xb0a3('0x1c')](_0x5857df);}};}function respondWithFilteredResult(_0x4280b9,_0x393752){return function(_0x3eb554){if(_0x3eb554){var _0x17f04f=typeof _0x393752[_0xb0a3('0x1d')]===_0xb0a3('0x1e')&&typeof _0x393752['limit']===_0xb0a3('0x1e');var _0x10d5de=_0x3eb554['count'];var _0x5d76ca=_0x17f04f?0x0:_0x393752['offset'];var _0x59d0ad=_0x17f04f?_0x3eb554[_0xb0a3('0x1f')]:_0x393752[_0xb0a3('0x1d')]+_0x393752['limit'];var _0x211c1d;if(_0x59d0ad>=_0x10d5de){_0x59d0ad=_0x10d5de;_0x211c1d=0xc8;}else{_0x211c1d=0xce;}_0x4280b9[_0xb0a3('0x1b')](_0x211c1d);return _0x4280b9[_0xb0a3('0x20')]('Content-Range',_0x5d76ca+'-'+_0x59d0ad+'/'+_0x10d5de)['json'](_0x3eb554);}return null;};}function patchUpdates(_0x5b1d72){return function(_0x3db119){try{jsonpatch[_0xb0a3('0x21')](_0x3db119,_0x5b1d72,!![]);}catch(_0x76acfc){return BPromise[_0xb0a3('0x22')](_0x76acfc);}return _0x3db119['save']();};}function saveUpdates(_0x399d33,_0x3403c4){return function(_0x40ca0f){if(_0x40ca0f){return _0x40ca0f[_0xb0a3('0x23')](_0x399d33)[_0xb0a3('0x24')](function(_0x522d49){return _0x522d49;});}return null;};}function removeEntity(_0x8c48d5,_0x26fbdf){return function(_0x56a1ba){if(_0x56a1ba){return _0x56a1ba[_0xb0a3('0x25')]()[_0xb0a3('0x24')](function(){_0x8c48d5['status'](0xcc)[_0xb0a3('0x1a')]();});}};}function handleEntityNotFound(_0xdd5a77,_0x5f47f6){return function(_0x209034){if(!_0x209034){_0xdd5a77[_0xb0a3('0x19')](0x194);}return _0x209034;};}function handleError(_0x1791cc,_0x4b08ab){_0x4b08ab=_0x4b08ab||0x1f4;return function(_0x2507aa){logger[_0xb0a3('0x26')](_0x2507aa['stack']);if(_0x2507aa[_0xb0a3('0x27')]){delete _0x2507aa[_0xb0a3('0x27')];}_0x1791cc['status'](_0x4b08ab)[_0xb0a3('0x28')](_0x2507aa);};}exports[_0xb0a3('0x29')]=function(_0x49a7d8,_0x3d2321){var _0x41fb72={},_0xc29a1b={},_0x4f17b1={'count':0x0,'rows':[]};var _0x967090=_[_0xb0a3('0x2a')](db[_0xb0a3('0x2b')][_0xb0a3('0x2c')],function(_0xd79238){return{'name':_0xd79238[_0xb0a3('0x2d')],'type':_0xd79238[_0xb0a3('0x2e')][_0xb0a3('0x2f')]};});_0xc29a1b[_0xb0a3('0x30')]=_[_0xb0a3('0x2a')](_0x967090,_0xb0a3('0x27'));_0xc29a1b['query']=_[_0xb0a3('0x31')](_0x49a7d8['query']);_0xc29a1b[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0xc29a1b[_0xb0a3('0x30')],_0xc29a1b[_0xb0a3('0x34')]);_0x41fb72['attributes']=_['intersection'](_0xc29a1b[_0xb0a3('0x30')],qs[_0xb0a3('0x35')](_0x49a7d8[_0xb0a3('0x34')]['fields']));_0x41fb72[_0xb0a3('0x36')]=_0x41fb72['attributes'][_0xb0a3('0x37')]?_0x41fb72['attributes']:_0xc29a1b['model'];if(!_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x38')](_0xb0a3('0x39'))){_0x41fb72[_0xb0a3('0x3a')]=qs[_0xb0a3('0x3a')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3a')]);_0x41fb72['offset']=qs[_0xb0a3('0x1d')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x1d')]);}_0x41fb72[_0xb0a3('0x3b')]=qs[_0xb0a3('0x3c')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3c')]);_0x41fb72[_0xb0a3('0x3d')]=qs['filters'](_['pick'](_0x49a7d8[_0xb0a3('0x34')],_0xc29a1b[_0xb0a3('0x32')]),_0x967090);if(_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3e')]){_0x41fb72[_0xb0a3('0x3d')]=_[_0xb0a3('0x3f')](_0x41fb72[_0xb0a3('0x3d')],{'$or':_[_0xb0a3('0x2a')](_0x967090,function(_0xaf9027){if(_0xaf9027[_0xb0a3('0x2e')]!==_0xb0a3('0x40')){var _0x36ecf9={};_0x36ecf9[_0xaf9027['name']]={'$like':'%'+_0x49a7d8[_0xb0a3('0x34')]['filter']+'%'};return _0x36ecf9;}})});}_0x41fb72=_['merge']({},_0x41fb72,_0x49a7d8['options']);var _0xc092c9={'where':_0x41fb72['where']};return db['ChatTransferReport'][_0xb0a3('0x1f')](_0xc092c9)[_0xb0a3('0x24')](function(_0x4aca30){_0x4f17b1[_0xb0a3('0x1f')]=_0x4aca30;if(_0x49a7d8['query']['includeAll']){_0x41fb72[_0xb0a3('0x41')]=[{'all':!![]}];}return db[_0xb0a3('0x2b')][_0xb0a3('0x42')](_0x41fb72);})[_0xb0a3('0x24')](function(_0xf98837){_0x4f17b1[_0xb0a3('0x43')]=_0xf98837;return _0x4f17b1;})[_0xb0a3('0x24')](respondWithFilteredResult(_0x3d2321,_0x41fb72))[_0xb0a3('0x44')](handleError(_0x3d2321,null));};exports['show']=function(_0x32e9d9,_0x88ae47){var _0xc5cd32={'raw':!![],'where':{'id':_0x32e9d9['params']['id']}},_0x5a1ed2={};_0x5a1ed2[_0xb0a3('0x30')]=_[_0xb0a3('0x31')](db[_0xb0a3('0x2b')]['rawAttributes']);_0x5a1ed2['query']=_[_0xb0a3('0x31')](_0x32e9d9[_0xb0a3('0x34')]);_0x5a1ed2[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0x5a1ed2[_0xb0a3('0x30')],_0x5a1ed2[_0xb0a3('0x34')]);_0xc5cd32[_0xb0a3('0x36')]=_[_0xb0a3('0x33')](_0x5a1ed2['model'],qs[_0xb0a3('0x35')](_0x32e9d9[_0xb0a3('0x34')][_0xb0a3('0x35')]));_0xc5cd32[_0xb0a3('0x36')]=_0xc5cd32['attributes'][_0xb0a3('0x37')]?_0xc5cd32[_0xb0a3('0x36')]:_0x5a1ed2[_0xb0a3('0x30')];if(_0x32e9d9['query'][_0xb0a3('0x45')]){_0xc5cd32[_0xb0a3('0x41')]=[{'all':!![]}];}_0xc5cd32=_[_0xb0a3('0x3f')]({},_0xc5cd32,_0x32e9d9['options']);return db['ChatTransferReport'][_0xb0a3('0x46')](_0xc5cd32)['then'](handleEntityNotFound(_0x88ae47,null))['then'](respondWithResult(_0x88ae47,null))[_0xb0a3('0x44')](handleError(_0x88ae47,null));};exports[_0xb0a3('0x47')]=function(_0x47117e,_0x59d274){return db[_0xb0a3('0x2b')][_0xb0a3('0x47')](_0x47117e['body'],{})[_0xb0a3('0x24')](respondWithResult(_0x59d274,0xc9))[_0xb0a3('0x44')](handleError(_0x59d274,null));};exports[_0xb0a3('0x23')]=function(_0x260c7b,_0x57c294){if(_0x260c7b[_0xb0a3('0x48')]['id']){delete _0x260c7b['body']['id'];}return db[_0xb0a3('0x2b')][_0xb0a3('0x46')]({'where':{'id':_0x260c7b[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x57c294,null))[_0xb0a3('0x24')](saveUpdates(_0x260c7b[_0xb0a3('0x48')],null))[_0xb0a3('0x24')](respondWithResult(_0x57c294,null))[_0xb0a3('0x44')](handleError(_0x57c294,null));};exports[_0xb0a3('0x25')]=function(_0x3e3b85,_0x252da1){return db[_0xb0a3('0x2b')]['find']({'where':{'id':_0x3e3b85[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x252da1,null))['then'](removeEntity(_0x252da1,null))['catch'](handleError(_0x252da1,null));};exports[_0xb0a3('0x4a')]=function(_0xa14bcb,_0x1037f6){return db[_0xb0a3('0x2b')][_0xb0a3('0x4a')]()[_0xb0a3('0x24')](respondWithResult(_0x1037f6,null))['catch'](handleError(_0x1037f6,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e843b7d..fbf3360 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 _0x6ec1=['request-promise','path','../../config/environment','define','ChatTransferReport','uniqueid','../../config/logger','bluebird'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0x6ec1,0xfe));var _0x16ec=function(_0x2570c2,_0x1ba88f){_0x2570c2=_0x2570c2-0x0;var _0x2629df=_0x6ec1[_0x2570c2];return _0x2629df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x16ec('0x0'))('api');var moment=require('moment');var BPromise=require(_0x16ec('0x1'));var rp=require(_0x16ec('0x2'));var fs=require('fs');var path=require(_0x16ec('0x3'));var rimraf=require('rimraf');var config=require(_0x16ec('0x4'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x32deda,_0x23ed73){return _0x32deda[_0x16ec('0x5')](_0x16ec('0x6'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x16ec('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a6a=['report_chat_transfer','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0xf7b425,_0x4e8416){var _0x2a16ba=function(_0x3a600b){while(--_0x3a600b){_0xf7b425['push'](_0xf7b425['shift']());}};_0x2a16ba(++_0x4e8416);}(_0x0a6a,0x6f));var _0xa0a6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x0a6a[_0x4ba105];return _0x5eee7b;};'use strict';var _=require(_0xa0a6('0x0'));var util=require('util');var logger=require(_0xa0a6('0x1'))('api');var moment=require(_0xa0a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0a6('0x3'));var rimraf=require(_0xa0a6('0x4'));var config=require(_0xa0a6('0x5'));var attributes=require(_0xa0a6('0x6'));module[_0xa0a6('0x7')]=function(_0x5dfde9,_0x57e1d0){return _0x5dfde9[_0xa0a6('0x8')](_0xa0a6('0x9'),attributes,{'tableName':_0xa0a6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','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 e361fd0..2527155 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 _0x0e00=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x15e0eb,_0x114383){var _0x180016=function(_0x495281){while(--_0x495281){_0x15e0eb['push'](_0x15e0eb['shift']());}};_0x180016(++_0x114383);}(_0x0e00,0x104));var _0x00e0=function(_0x3b189d,_0x1c25e0){_0x3b189d=_0x3b189d-0x0;var _0x382792=_0x0e00[_0x3b189d];return _0x382792;};'use strict';var _=require(_0x00e0('0x0'));var util=require(_0x00e0('0x1'));var moment=require(_0x00e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x00e0('0x3'));var fs=require('fs');var Redis=require(_0x00e0('0x4'));var db=require(_0x00e0('0x5'))['db'];var utils=require(_0x00e0('0x6'));var logger=require(_0x00e0('0x7'))(_0x00e0('0x8'));var config=require(_0x00e0('0x9'));var jayson=require(_0x00e0('0xa'));var client=jayson[_0x00e0('0xb')][_0x00e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172c36,_0x1c5ff4,_0x245fe7){return new BPromise(function(_0x48edf6,_0x433c11){return client[_0x00e0('0xd')](_0x172c36,_0x245fe7)[_0x00e0('0xe')](function(_0x2de7cb){logger[_0x00e0('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1c5ff4,_0x00e0('0x10'));logger['debug'](_0x00e0('0x11'),_0x1c5ff4,_0x00e0('0x10'),JSON['stringify'](_0x2de7cb));if(_0x2de7cb[_0x00e0('0x12')]){if(_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x13')]===0x1f4){logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x15')]);return _0x433c11(_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x15')]);}logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x2de7cb['error']['message']);return _0x48edf6(_0x2de7cb[_0x00e0('0x12')]['message']);}else{logger[_0x00e0('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1c5ff4,'request\x20sent');_0x48edf6(_0x2de7cb[_0x00e0('0x16')]['message']);}})[_0x00e0('0x17')](function(_0x255d49){logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x255d49);_0x433c11(_0x255d49);});});}
\ No newline at end of file
+var _0x2afd=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2afd,0xbc));var _0xd2af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2afd[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd2af('0x0'));var moment=require(_0xd2af('0x1'));var BPromise=require(_0xd2af('0x2'));var rs=require(_0xd2af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2af('0x5'))(_0xd2af('0x6'));var config=require(_0xd2af('0x7'));var jayson=require(_0xd2af('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2dd3,_0x4102e6,_0x3cae3b){return new BPromise(function(_0x5295a2,_0x17fe9e){return client[_0xd2af('0x9')](_0x4a2dd3,_0x3cae3b)[_0xd2af('0xa')](function(_0x54dbad){logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,'request\x20sent');logger[_0xd2af('0xd')](_0xd2af('0xe'),_0x4102e6,_0xd2af('0xf'),JSON[_0xd2af('0x10')](_0x54dbad));if(_0x54dbad[_0xd2af('0x11')]){if(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x12')]===0x1f4){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x17fe9e(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);}logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x5295a2(_0x54dbad['error'][_0xd2af('0x13')]);}else{logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,_0xd2af('0xf'));_0x5295a2(_0x54dbad[_0xd2af('0x14')][_0xd2af('0x13')]);}})[_0xd2af('0x15')](function(_0x1024c9){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x1024c9);_0x17fe9e(_0x1024c9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 77260c4..12ab079 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 _0x7672=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x5509a8,_0x1a8b93){var _0x5383b1=function(_0x14cde3){while(--_0x14cde3){_0x5509a8['push'](_0x5509a8['shift']());}};_0x5383b1(++_0x1a8b93);}(_0x7672,0x1d9));var _0x2767=function(_0x47fe76,_0x1f9f51){_0x47fe76=_0x47fe76-0x0;var _0x1ee838=_0x7672[_0x47fe76];return _0x1ee838;};'use strict';var multer=require(_0x2767('0x0'));var util=require(_0x2767('0x1'));var path=require(_0x2767('0x2'));var timeout=require(_0x2767('0x3'));var express=require(_0x2767('0x4'));var router=express[_0x2767('0x5')]();var fs_extra=require(_0x2767('0x6'));var auth=require(_0x2767('0x7'));var interaction=require(_0x2767('0x8'));var config=require(_0x2767('0x9'));var controller=require(_0x2767('0xa'));router[_0x2767('0xb')]('/',auth[_0x2767('0xc')](),controller[_0x2767('0xd')]);router[_0x2767('0xb')](_0x2767('0xe'),auth[_0x2767('0xc')](),controller[_0x2767('0xf')]);router[_0x2767('0xb')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller[_0x2767('0x11')]);router[_0x2767('0x12')]('/',auth[_0x2767('0xc')](),controller['create']);router[_0x2767('0x13')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller[_0x2767('0x14')]);router[_0x2767('0x15')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3987=['index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3840a0,_0x1c2617){var _0x441d3f=function(_0x5ec5d3){while(--_0x5ec5d3){_0x3840a0['push'](_0x3840a0['shift']());}};_0x441d3f(++_0x1c2617);}(_0x3987,0xb3));var _0x7398=function(_0x486a06,_0x46d2dd){_0x486a06=_0x486a06-0x0;var _0x88198c=_0x3987[_0x486a06];return _0x88198c;};'use strict';var multer=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var path=require(_0x7398('0x2'));var timeout=require(_0x7398('0x3'));var express=require(_0x7398('0x4'));var router=express[_0x7398('0x5')]();var fs_extra=require(_0x7398('0x6'));var auth=require(_0x7398('0x7'));var interaction=require(_0x7398('0x8'));var config=require(_0x7398('0x9'));var controller=require(_0x7398('0xa'));router[_0x7398('0xb')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0xd')]);router[_0x7398('0xb')]('/describe',auth[_0x7398('0xc')](),controller[_0x7398('0xe')]);router[_0x7398('0xb')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x10')]);router[_0x7398('0x11')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0x12')]);router[_0x7398('0x13')](_0x7398('0xf'),auth['isAuthenticated'](),controller[_0x7398('0x14')]);router[_0x7398('0x15')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x16')]);module[_0x7398('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 6c65806..dea571f 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 _0x64d4=['Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','input','text','email','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x64d4,0x156));var _0x464d=function(_0x1130a1,_0x3a0aea){_0x1130a1=_0x1130a1-0x0;var _0x167055=_0x64d4[_0x1130a1];return _0x167055;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x464d('0x0'));module[_0x464d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x464d('0x2')},'description':{'type':Sequelize[_0x464d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x464d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x4')},'customerAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x464d('0x9')](_0x464d('0xa'),_0x464d('0xb')),'defaultValue':_0x464d('0xa')},'header_online':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xc')},'start_chat_button':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xd')},'offline_chat_button':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'header_offline':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xf')},'download_transcript':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x464d('0x11')]},'closingQuestion':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x13')},'noteTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x15')},'closingMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x16')},'closingMessageButton':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'skipMessageButton':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x17')},'conditionAgreement':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x18')},'ratingType':{'type':Sequelize[_0x464d('0x9')]('star','thumb'),'defaultValue':_0x464d('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x464d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x464d('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x464d('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x464d('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x464d('0x1c'),'type':_0x464d('0x1c')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x464d('0x1d')](_0x464d('0x1e'))?JSON[_0x464d('0x1f')](this['getDataValue'](_0x464d('0x1e'))):{};},'set':function(_0x548aac){return this[_0x464d('0x20')](_0x464d('0x1e'),JSON['stringify'](_0x548aac));}},'offlineForm':{'type':Sequelize[_0x464d('0x11')],'defaultValue':function(){return JSON[_0x464d('0x21')]({'items':[{'type':'input','props':{'title':_0x464d('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':_0x464d('0x1c'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x464d('0x22')},'props':{'title':_0x464d('0x22'),'helpText':_0x464d('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x464d('0x24'))?JSON[_0x464d('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x5642a2){return this[_0x464d('0x20')](_0x464d('0x24'),JSON['stringify'](_0x5642a2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x464d('0x25')]();}},'autoclose':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x464d('0x3')]},'forwardOffline':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x464d('0x3')]},'waitingTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x26')},'waitingMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x28')},'offlineMessageBody':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x17')},'sendUnmanaged':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x464d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x464d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x464d('0x2a');}},'notificationSound':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x2c')},'messagesAlignment':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x464d('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x2e')},'systemAvatar':{'type':Sequelize[_0x464d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x464d('0x7')],'comment':_0x464d('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1f8807){if(!_0x1f8807)this[_0x464d('0x20')](_0x464d('0x30'),null);this[_0x464d('0x20')]('mandatoryDisposition',_0x1f8807);}},'vidaooEscalation':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x464d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x31')},'vidaooNote':{'type':Sequelize[_0x464d('0x3')],'defaultValue':function(){return _0x464d('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x464d('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x464d('0x11')]}};
\ No newline at end of file
+var _0xa8d3=['squared','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa8d3,0x15b));var _0x3a8d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa8d3[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3a8d('0x0'));var rs=require(_0x3a8d('0x1'));module[_0x3a8d('0x2')]={'name':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'unique':_0x3a8d('0x4')},'description':{'type':Sequelize[_0x3a8d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x5')},'mapKeyOffline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x5')},'key':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3a8d('0x3')]},'animation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0xc'),_0x3a8d('0xd')),'defaultValue':_0x3a8d('0xc')},'header_online':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0xe')},'download_transcript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3a8d('0x10')]},'closingQuestion':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x13')},'closingMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0x14'),_0x3a8d('0x15')),'defaultValue':_0x3a8d('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'variable':null,'config':{'placeholder':_0x3a8d('0x18'),'type':_0x3a8d('0x19'),'required':!![]},'props':{'title':_0x3a8d('0x18'),'helpText':''}},{'type':_0x3a8d('0x17'),'props':{'title':_0x3a8d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3a8d('0x1a')]('onlineForm')?JSON[_0x3a8d('0x1b')](this['getDataValue'](_0x3a8d('0x1c'))):{};},'set':function(_0xaf5085){return this[_0x3a8d('0x1d')](_0x3a8d('0x1c'),JSON[_0x3a8d('0x16')](_0xaf5085));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3a8d('0x1e')},'props':{'title':_0x3a8d('0x1e'),'helpText':_0x3a8d('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x3a8d('0x1a')](_0x3a8d('0x20'))?JSON['parse'](this[_0x3a8d('0x1a')](_0x3a8d('0x20'))):{};},'set':function(_0x474cbe){return this['setDataValue']('offlineForm',JSON['stringify'](_0x474cbe));}},'token':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3a8d('0x3')]},'waitingTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x21')},'waitingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x22')},'offlineMessageBody':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x23')},'sendUnmanaged':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x24')},'enableCustomerAttachment':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3a8d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':function(){return _0x3a8d('0x25');}},'notificationSound':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x27')},'defaultTitle':{'type':Sequelize[_0x3a8d('0x3')]},'customerAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x29')},'systemAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a8d('0x9')],'comment':_0x3a8d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'comment':_0x3a8d('0x2b'),'set':function(_0xd6615d){if(!_0xd6615d)this[_0x3a8d('0x1d')](_0x3a8d('0x2c'),null);this[_0x3a8d('0x1d')]('mandatoryDisposition',_0xd6615d);}},'vidaooEscalation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3a8d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3a8d('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 9f27535..c450796 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 _0x4a86=['json','limit','undefined','count','offset','set','Content-Range','update','get','UserProfileResource','destroy','stack','name','send','Command','getSnippet','timezone','format','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Intervals','all','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','show','params','mandatoryDispositionPause','includeAll','find','create','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','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','List','Contacts','DESC','ChatApplication','Applications','Interval','spread','account','list','applications','orderBy','priority','asc','contact','headers','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','offline-chat','openNewInteraction','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','getInteractions','Contact','fullname','internal','color','tag','virtual','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','x-real-ip','referer','replace','render','alignment','verticalAlignment','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/environment','../../errors/api','handleError','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4a86,0x10f));var _0x64a8=function(_0x1f1db2,_0x230a06){_0x1f1db2=_0x1f1db2-0x0;var _0x1380ee=_0x4a86[_0x1f1db2];return _0x1380ee;};'use strict';var Mustache=require('mustache');var util=require(_0x64a8('0x0'));var path=require(_0x64a8('0x1'));var ejs=require(_0x64a8('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x64a8('0x3'));var htmlToText=require(_0x64a8('0x4'));var Redis=require(_0x64a8('0x5'));var jayson=require(_0x64a8('0x6'));var url=require(_0x64a8('0x7'));var qs=require(_0x64a8('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x64a8('0x9'));var APIOutOfIntervalError=require(_0x64a8('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x64a8('0xa'))[_0x64a8('0xb')];var db=require('../../mysqldb')['db'];config[_0x64a8('0xc')]=_[_0x64a8('0xd')](config[_0x64a8('0xc')],{'host':_0x64a8('0xe'),'port':0x18eb});var socket=require(_0x64a8('0xf'))(new Redis(config[_0x64a8('0xc')]));require(_0x64a8('0x10'))[_0x64a8('0x11')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x64a8('0x12')][_0x64a8('0x13')]({'port':0x232a});var client9003=jayson[_0x64a8('0x12')][_0x64a8('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x64a8('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x3ab915,_0x41b76a,_0x1c67af,_0x192b87){return new Promise(function(_0xa98fc4,_0xf9638a){var _0x850efb=_0x192b87||client;return _0x850efb['request'](_0x3ab915,_0x1c67af)[_0x64a8('0x14')](function(_0x5cd03f){logger[_0x64a8('0x15')](_0x64a8('0x16'),_0x41b76a,_0x64a8('0x17'));logger[_0x64a8('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41b76a,_0x64a8('0x17'),JSON[_0x64a8('0x19')](_0x5cd03f));if(_0x5cd03f[_0x64a8('0x1a')]){if(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1b')]===0x1f4){logger[_0x64a8('0x1a')](_0x64a8('0x16'),_0x41b76a,_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);return _0xf9638a(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);}logger['error'](_0x64a8('0x16'),_0x41b76a,_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);return _0xa98fc4(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);}else{logger[_0x64a8('0x15')](_0x64a8('0x16'),_0x41b76a,_0x64a8('0x17'));_0xa98fc4(_0x5cd03f[_0x64a8('0x1d')]['message']);}})[_0x64a8('0x1e')](function(_0x36d669){logger[_0x64a8('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x41b76a,_0x36d669);_0xf9638a(_0x36d669);});});}function respondWithStatusCode(_0x47648d,_0x548789){_0x548789=_0x548789||0xcc;return function(_0x55ced0){if(_0x55ced0){return _0x47648d[_0x64a8('0x1f')](_0x548789);}return _0x47648d[_0x64a8('0x20')](_0x548789)[_0x64a8('0x21')]();};}function respondWithResult(_0x29d2dc,_0x5935ba){_0x5935ba=_0x5935ba||0xc8;return function(_0x19cffa){if(_0x19cffa){return _0x29d2dc[_0x64a8('0x20')](_0x5935ba)[_0x64a8('0x22')](_0x19cffa);}};}function respondWithFilteredResult(_0x4516ec,_0xe1cb89){return function(_0x38cac9){if(_0x38cac9){var _0x4ebe6d=typeof _0xe1cb89['offset']==='undefined'&&typeof _0xe1cb89[_0x64a8('0x23')]===_0x64a8('0x24');var _0x3dcc98=_0x38cac9[_0x64a8('0x25')];var _0x33aac5=_0x4ebe6d?0x0:_0xe1cb89[_0x64a8('0x26')];var _0x3fdefc=_0x4ebe6d?_0x38cac9['count']:_0xe1cb89[_0x64a8('0x26')]+_0xe1cb89[_0x64a8('0x23')];var _0x27c992;if(_0x3fdefc>=_0x3dcc98){_0x3fdefc=_0x3dcc98;_0x27c992=0xc8;}else{_0x27c992=0xce;}_0x4516ec[_0x64a8('0x20')](_0x27c992);return _0x4516ec[_0x64a8('0x27')](_0x64a8('0x28'),_0x33aac5+'-'+_0x3fdefc+'/'+_0x3dcc98)[_0x64a8('0x22')](_0x38cac9);}return null;};}function saveUpdates(_0x175462){return function(_0x253d4c){if(_0x253d4c){return _0x253d4c[_0x64a8('0x29')](_0x175462)[_0x64a8('0x14')](function(_0x565e28){return _0x565e28;});}return null;};}function removeEntity(_0x2ea0ff){return function(_0x351be7){if(_0x351be7){return _0x351be7['destroy']()[_0x64a8('0x14')](function(){var _0x4ecd6a=_0x351be7[_0x64a8('0x2a')]({'plain':!![]});var _0x36edb1='ChatWebsites';return db[_0x64a8('0x2b')][_0x64a8('0x2c')]({'where':{'type':_0x36edb1,'resourceId':_0x4ecd6a['id']}})['then'](function(){return _0x351be7;});})[_0x64a8('0x14')](function(){_0x2ea0ff[_0x64a8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41fe64){return function(_0x49efd5){if(!_0x49efd5){_0x41fe64[_0x64a8('0x1f')](0x194);}return _0x49efd5;};}function handleError(_0x325078,_0x561817){_0x561817=_0x561817||0x1f4;return function(_0x174773){logger[_0x64a8('0x1a')](_0x174773[_0x64a8('0x2d')]);if(_0x174773[_0x64a8('0x2e')]){delete _0x174773['name'];}_0x325078[_0x64a8('0x20')](_0x561817)[_0x64a8('0x2f')](_0x174773);};}function iftimePromise(_0xf5d27f,_0x362e41){return respondWithRpcPromise(_0x64a8('0x30'),_0x64a8('0x31'),{'command':_0x362e41[_0x64a8('0x32')]?util[_0x64a8('0x33')]('iftime\x20%s,%s',_0xf5d27f[_0x64a8('0x34')],_0x362e41['timezone']):util[_0x64a8('0x33')](_0x64a8('0x35'),_0xf5d27f[_0x64a8('0x34')])},client9002)[_0x64a8('0x14')](function(_0x1e05cb){var _0x58bdd0=_0x1e05cb&&_0x1e05cb[_0x64a8('0x36')](_0x64a8('0x37'))>=0x0?!![]:![];logger[_0x64a8('0x15')](_0x64a8('0x38'),_0x362e41['id'],_0xf5d27f['id'],_0xf5d27f[_0x64a8('0x34')],_0x58bdd0?'ONLINE':_0x64a8('0x39'),_0x362e41[_0x64a8('0x32')]?_0x362e41['timezone']:_0x64a8('0x3a'));return _0x58bdd0;})[_0x64a8('0x1e')](function(_0x2d7547){logger[_0x64a8('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x362e41['id'],_0xf5d27f['id'],_0xf5d27f[_0x64a8('0x34')],util[_0x64a8('0x3b')](_0x2d7547,{'showHidden':![],'depth':null}),_0x362e41[_0x64a8('0x32')]?_0x362e41['timezone']:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x4a147c){var _0x3a83fa=_['map'](_0x4a147c['Interval'][_0x64a8('0x3c')],function(_0x20a0bd){var _0x3a5fc3=_0x20a0bd[_0x64a8('0x2a')]({'plain':!![]});return iftimePromise(_0x3a5fc3,_0x4a147c);});return Promise[_0x64a8('0x3d')](_0x3a83fa)[_0x64a8('0x14')](function(_0x17fb3d){return _[_0x64a8('0x3e')](_0x17fb3d);});}function createInteractionObject(_0x10e028,_0x3d06b3,_0x53877b,_0x267a01){var _0x140734=require(_0x64a8('0x3f'));var _0x2699ee=new _0x140734();var _0x1c84a4=_0x2699ee[_0x64a8('0x40')](_0x53877b[_0x64a8('0x41')])['getResult']();var _0x1c964f=_0x3d06b3[_0x64a8('0x42')];if(_0x53877b[_0x64a8('0x43')]){_0x1c964f=_0x53877b[_0x64a8('0x43')];}else if(_0x53877b[_0x64a8('0x44')]){_0x1c964f=_[_0x64a8('0x45')](_0x53877b[_0x64a8('0x44')][_0x64a8('0x46')](','));}return{'ContactId':_0x267a01['id'],'ChatWebsiteId':_0x10e028,'from':(_0x267a01[_0x64a8('0x47')]||'')+'\x20'+(_0x267a01['lastName']||''),'customerIp':_0x1c964f,'customerPort':_0x53877b[_0x64a8('0x48')]?_0x53877b[_0x64a8('0x48')]:null,'referer':_0x3d06b3['referer'],'browserName':_0x1c84a4['browser']['name']&&_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x4a')]?util['format'](_0x64a8('0x4b'),_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x2e')],_0x1c84a4['browser'][_0x64a8('0x4a')]):_0x64a8('0x4c'),'browserVersion':_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x4a')]||_0x64a8('0x4c'),'osName':util['format']('%s\x20%s',_0x1c84a4['os']['name'],_0x1c84a4['os'][_0x64a8('0x4a')]),'osVersion':_0x1c84a4['os'][_0x64a8('0x4a')],'deviceModel':_0x1c84a4['device'][_0x64a8('0x4d')]&&_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x4f')]?util[_0x64a8('0x33')](_0x64a8('0x50'),_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x4d')],_0x1c84a4['device']['vendor'],_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x51')]):null,'deviceVendor':_0x1c84a4['device'][_0x64a8('0x4f')],'deviceType':_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x51')],'formData':JSON[_0x64a8('0x19')](_0x3d06b3)};}exports[_0x64a8('0x52')]=function(_0x16d212,_0x2f8827){var _0x10e1ea={'include':[{'model':db[_0x64a8('0x53')],'as':'mandatoryDispositionPause'}]},_0x5e402c={},_0x4348cc={'count':0x0,'rows':[]};var _0x276ac5=_[_0x64a8('0x54')](db[_0x64a8('0x55')][_0x64a8('0x56')],function(_0x4e8c29){return{'name':_0x4e8c29[_0x64a8('0x57')],'type':_0x4e8c29['type'][_0x64a8('0x58')]};});_0x5e402c[_0x64a8('0x4d')]=_['map'](_0x276ac5,_0x64a8('0x2e'));_0x5e402c['query']=_[_0x64a8('0x59')](_0x16d212['query']);_0x5e402c[_0x64a8('0x5a')]=_['intersection'](_0x5e402c[_0x64a8('0x4d')],_0x5e402c[_0x64a8('0x5b')]);_0x10e1ea[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x5e402c[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x16d212[_0x64a8('0x5b')]['fields']));_0x10e1ea[_0x64a8('0x5c')]=_0x10e1ea[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x10e1ea['attributes']:_0x5e402c[_0x64a8('0x4d')];if(!_0x16d212[_0x64a8('0x5b')][_0x64a8('0x60')](_0x64a8('0x61'))){_0x10e1ea[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x16d212[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x10e1ea[_0x64a8('0x26')]=qs['offset'](_0x16d212[_0x64a8('0x5b')][_0x64a8('0x26')]);}_0x10e1ea[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x16d212['query']['sort']);_0x10e1ea[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x16d212['query'],_0x5e402c['filters']),_0x276ac5);if(_0x16d212['query'][_0x64a8('0x65')]){_0x10e1ea[_0x64a8('0x64')]=_['merge'](_0x10e1ea[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x276ac5,function(_0x2cfd31){if(_0x2cfd31['type']!==_0x64a8('0x66')){var _0x4b7b50={};_0x4b7b50[_0x2cfd31[_0x64a8('0x2e')]]={'$like':'%'+_0x16d212['query'][_0x64a8('0x65')]+'%'};return _0x4b7b50;}})});}_0x10e1ea=_[_0x64a8('0x67')]({},_0x10e1ea,_0x16d212[_0x64a8('0x68')]);var _0x54c794={'where':_0x10e1ea[_0x64a8('0x64')]};return db['ChatWebsite'][_0x64a8('0x25')](_0x54c794)[_0x64a8('0x14')](function(_0x1149fa){_0x4348cc[_0x64a8('0x25')]=_0x1149fa;if(_0x16d212[_0x64a8('0x5b')]['includeAll']){_0x10e1ea[_0x64a8('0x69')]=[{'all':!![]}];}return db[_0x64a8('0x55')]['findAll'](_0x10e1ea);})[_0x64a8('0x14')](function(_0xc015ad){_0x4348cc[_0x64a8('0x6a')]=_0xc015ad;return _0x4348cc;})[_0x64a8('0x14')](respondWithFilteredResult(_0x2f8827,_0x10e1ea))[_0x64a8('0x1e')](handleError(_0x2f8827,null));};exports[_0x64a8('0x6b')]=function(_0x319a0c,_0x439932){var _0x50f8d5={'raw':![],'where':{'id':_0x319a0c[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0x53')],'as':_0x64a8('0x6d')}]},_0x255381={};_0x255381['model']=_[_0x64a8('0x59')](db['ChatWebsite'][_0x64a8('0x56')]);_0x255381['query']=_[_0x64a8('0x59')](_0x319a0c[_0x64a8('0x5b')]);_0x255381[_0x64a8('0x5a')]=_['intersection'](_0x255381[_0x64a8('0x4d')],_0x255381[_0x64a8('0x5b')]);_0x50f8d5['attributes']=_[_0x64a8('0x5d')](_0x255381['model'],qs[_0x64a8('0x5e')](_0x319a0c['query']['fields']));_0x50f8d5[_0x64a8('0x5c')]=_0x50f8d5['attributes'][_0x64a8('0x5f')]?_0x50f8d5[_0x64a8('0x5c')]:_0x255381['model'];if(_0x319a0c[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x50f8d5[_0x64a8('0x69')]=[{'all':!![]}];}_0x50f8d5=_['merge']({},_0x50f8d5,_0x319a0c[_0x64a8('0x68')]);return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x50f8d5)['then'](handleEntityNotFound(_0x439932,null))[_0x64a8('0x14')](respondWithResult(_0x439932,null))[_0x64a8('0x1e')](handleError(_0x439932,null));};exports[_0x64a8('0x70')]=function(_0x5c8001,_0x256275){return db[_0x64a8('0x55')][_0x64a8('0x70')](_0x5c8001['body'],{})[_0x64a8('0x14')](function(_0x469161){var _0xe3c90a=_0x5c8001[_0x64a8('0x71')][_0x64a8('0x2a')]({'plain':!![]});if(!_0xe3c90a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3c90a['role']===_0x64a8('0x71')){var _0x3f4ce7=_0x469161['get']({'plain':!![]});var _0x47679f=_0x64a8('0x72');return db[_0x64a8('0x73')][_0x64a8('0x6f')]({'where':{'name':_0x47679f,'userProfileId':_0xe3c90a[_0x64a8('0x74')]},'raw':!![]})[_0x64a8('0x14')](function(_0x8f9530){if(_0x8f9530&&_0x8f9530[_0x64a8('0x75')]===0x0){return db['UserProfileResource'][_0x64a8('0x70')]({'name':_0x3f4ce7[_0x64a8('0x2e')],'resourceId':_0x3f4ce7['id'],'type':_0x8f9530[_0x64a8('0x2e')],'sectionId':_0x8f9530['id']},{})[_0x64a8('0x14')](function(){return _0x469161;});}else{return _0x469161;}})['catch'](function(_0x28d660){logger[_0x64a8('0x1a')](_0x64a8('0x76'),_0x28d660);throw _0x28d660;});}return _0x469161;})[_0x64a8('0x14')](respondWithResult(_0x256275,0xc9))[_0x64a8('0x1e')](handleError(_0x256275,null));};exports[_0x64a8('0x29')]=function(_0x216e93,_0x94f2db){if(_0x216e93[_0x64a8('0x77')]['id']){delete _0x216e93['body']['id'];}return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x216e93[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0x53')],'as':_0x64a8('0x6d')}]})[_0x64a8('0x14')](handleEntityNotFound(_0x94f2db,null))['then'](saveUpdates(_0x216e93[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x94f2db,null))[_0x64a8('0x1e')](handleError(_0x94f2db,null));};exports['destroy']=function(_0x25f851,_0x3dc7c4){return db['ChatWebsite'][_0x64a8('0x6f')]({'where':{'id':_0x25f851[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3dc7c4,null))[_0x64a8('0x14')](removeEntity(_0x3dc7c4,null))[_0x64a8('0x1e')](handleError(_0x3dc7c4,null));};exports[_0x64a8('0x78')]=function(_0x302ee4,_0x2d5ba5){return db[_0x64a8('0x55')][_0x64a8('0x78')]()['then'](respondWithResult(_0x2d5ba5,null))[_0x64a8('0x1e')](handleError(_0x2d5ba5,null));};exports['addDisposition']=function(_0x161772,_0x2edffb){if(_0x161772['body']['id']){delete _0x161772[_0x64a8('0x77')]['id'];}return db['ChatWebsite'][_0x64a8('0x6f')]({'where':{'id':_0x161772['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x2edffb,null))[_0x64a8('0x14')](function(_0x2e1bf5){if(_0x2e1bf5){_0x161772['body'][_0x64a8('0x79')]=_0x2e1bf5['id'];return db[_0x64a8('0x7a')][_0x64a8('0x70')](_0x161772[_0x64a8('0x77')]);}})[_0x64a8('0x14')](respondWithResult(_0x2edffb,null))['catch'](handleError(_0x2edffb,null));};exports['getDispositions']=function(_0x199085,_0x2f27c7){var _0x1f2038={'raw':![],'where':{}};var _0x1ff1f2={};var _0x11c16d={'count':0x0,'rows':[]};return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x199085[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2f27c7,null))[_0x64a8('0x14')](function(_0x2f623f){if(_0x2f623f){_0x1ff1f2[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x7a')][_0x64a8('0x56')]);_0x1ff1f2[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x199085[_0x64a8('0x5b')]);_0x1ff1f2[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x1ff1f2['model'],_0x1ff1f2['query']);_0x1f2038[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x1ff1f2[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x199085['query'][_0x64a8('0x5e')]));_0x1f2038[_0x64a8('0x5c')]=_0x1f2038['attributes'][_0x64a8('0x5f')]?_0x1f2038[_0x64a8('0x5c')]:_0x1ff1f2[_0x64a8('0x4d')];if(!_0x199085[_0x64a8('0x5b')][_0x64a8('0x60')](_0x64a8('0x61'))){_0x1f2038[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x199085['query']['limit']);_0x1f2038['offset']=qs['offset'](_0x199085['query'][_0x64a8('0x26')]);}_0x1f2038[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x199085[_0x64a8('0x5b')]['sort']);_0x1f2038[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x199085[_0x64a8('0x5b')],_0x1ff1f2[_0x64a8('0x5a')]));_0x1f2038[_0x64a8('0x64')][_0x64a8('0x79')]=_0x2f623f['id'];if(_0x199085[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x1f2038[_0x64a8('0x64')]=_['merge'](_0x1f2038[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x1f2038['attributes'],function(_0x1174a2){var _0x55a823={};_0x55a823[_0x1174a2]={'$like':'%'+_0x199085[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x55a823;})});}_0x1f2038=_['merge']({},_0x1f2038,_0x199085[_0x64a8('0x68')]);return db['Disposition']['count']({'where':_0x1f2038['where']})[_0x64a8('0x14')](function(_0x56635c){_0x11c16d[_0x64a8('0x25')]=_0x56635c;if(_0x199085[_0x64a8('0x5b')]['includeAll']){_0x1f2038[_0x64a8('0x69')]=[{'all':!![]}];}return db['Disposition'][_0x64a8('0x7c')](_0x1f2038);})[_0x64a8('0x14')](function(_0x327638){_0x11c16d[_0x64a8('0x6a')]=_0x327638;return _0x11c16d;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x2f27c7,_0x1f2038))['catch'](handleError(_0x2f27c7,null));};exports[_0x64a8('0x7d')]=function(_0x1ae802,_0x2f6afb){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x1ae802['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x2f6afb,null))[_0x64a8('0x14')](function(_0x8abc27){if(_0x8abc27){return _0x8abc27[_0x64a8('0x7d')](_0x1ae802[_0x64a8('0x5b')]['ids']);}})[_0x64a8('0x14')](respondWithStatusCode(_0x2f6afb,null))[_0x64a8('0x1e')](handleError(_0x2f6afb,null));};exports[_0x64a8('0x7e')]=function(_0xf69de,_0x5565e4){if(_0xf69de[_0x64a8('0x77')]['id']){delete _0xf69de[_0x64a8('0x77')]['id'];}return db[_0x64a8('0x55')]['find']({'where':{'id':_0xf69de[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5565e4,null))[_0x64a8('0x14')](function(_0x2dd8ef){if(_0x2dd8ef){_0xf69de[_0x64a8('0x77')][_0x64a8('0x79')]=_0x2dd8ef['id'];return db[_0x64a8('0x7f')][_0x64a8('0x70')](_0xf69de['body']);}})[_0x64a8('0x14')](respondWithResult(_0x5565e4,null))['catch'](handleError(_0x5565e4,null));};exports['getAnswers']=function(_0x3efff5,_0x264b00){var _0x22e28c={'raw':![],'where':{}};var _0x34f957={};var _0x35d2f3={'count':0x0,'rows':[]};return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x3efff5[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x264b00,null))['then'](function(_0x712ce6){if(_0x712ce6){_0x34f957[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x7f')][_0x64a8('0x56')]);_0x34f957['query']=_['keys'](_0x3efff5[_0x64a8('0x5b')]);_0x34f957[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x34f957[_0x64a8('0x4d')],_0x34f957[_0x64a8('0x5b')]);_0x22e28c['attributes']=_['intersection'](_0x34f957[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x22e28c[_0x64a8('0x5c')]=_0x22e28c[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x22e28c[_0x64a8('0x5c')]:_0x34f957[_0x64a8('0x4d')];if(!_0x3efff5[_0x64a8('0x5b')]['hasOwnProperty']('nolimit')){_0x22e28c[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x22e28c[_0x64a8('0x26')]=qs['offset'](_0x3efff5[_0x64a8('0x5b')]['offset']);}_0x22e28c['order']=qs[_0x64a8('0x63')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x22e28c[_0x64a8('0x64')]=qs['filters'](_[_0x64a8('0x80')](_0x3efff5[_0x64a8('0x5b')],_0x34f957['filters']));_0x22e28c[_0x64a8('0x64')][_0x64a8('0x79')]=_0x712ce6['id'];if(_0x3efff5['query'][_0x64a8('0x65')]){_0x22e28c[_0x64a8('0x64')]=_[_0x64a8('0x67')](_0x22e28c['where'],{'$or':_['map'](_0x22e28c['attributes'],function(_0x250c12){var _0x2cfa77={};_0x2cfa77[_0x250c12]={'$like':'%'+_0x3efff5[_0x64a8('0x5b')]['filter']+'%'};return _0x2cfa77;})});}_0x22e28c=_[_0x64a8('0x67')]({},_0x22e28c,_0x3efff5[_0x64a8('0x68')]);return db['CannedAnswer'][_0x64a8('0x25')]({'where':_0x22e28c['where']})['then'](function(_0x5e4b7a){_0x35d2f3[_0x64a8('0x25')]=_0x5e4b7a;if(_0x3efff5[_0x64a8('0x5b')]['includeAll']){_0x22e28c[_0x64a8('0x69')]=[{'all':!![]}];}return db['CannedAnswer'][_0x64a8('0x7c')](_0x22e28c);})[_0x64a8('0x14')](function(_0x750e4){_0x35d2f3['rows']=_0x750e4;return _0x35d2f3;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x264b00,_0x22e28c))['catch'](handleError(_0x264b00,null));};exports[_0x64a8('0x81')]=function(_0x3eaf89,_0x588226){return db['ChatWebsite']['find']({'where':{'id':_0x3eaf89[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x588226,null))['then'](function(_0x589ec8){if(_0x589ec8){return _0x589ec8[_0x64a8('0x81')](_0x3eaf89['query']['ids']);}})['then'](respondWithStatusCode(_0x588226,null))['catch'](handleError(_0x588226,null));};exports[_0x64a8('0x82')]=function(_0x7122c8,_0x339320){_0x7122c8[_0x64a8('0x77')][_0x64a8('0x83')]=_0x7122c8['file'][_0x64a8('0x84')];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x7122c8[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x339320,null))[_0x64a8('0x14')](saveUpdates(_0x7122c8[_0x64a8('0x77')],null))['then'](respondWithResult(_0x339320,null))[_0x64a8('0x1e')](handleError(_0x339320,null));};exports[_0x64a8('0x85')]=function(_0x58e4d8,_0x8b37b3){_0x58e4d8['body'][_0x64a8('0x86')]=_0x58e4d8['file']['filename'];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x58e4d8[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x8b37b3,null))[_0x64a8('0x14')](saveUpdates(_0x58e4d8[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x8b37b3,null))[_0x64a8('0x1e')](handleError(_0x8b37b3,null));};exports['addCustomerAvatar']=function(_0x48b463,_0x714e16){_0x48b463[_0x64a8('0x77')][_0x64a8('0x87')]=_0x48b463[_0x64a8('0x88')]['filename'];return db[_0x64a8('0x55')]['find']({'where':{'id':_0x48b463[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x714e16,null))[_0x64a8('0x14')](saveUpdates(_0x48b463['body'],null))['then'](respondWithResult(_0x714e16,null))[_0x64a8('0x1e')](handleError(_0x714e16,null));};exports[_0x64a8('0x89')]=function(_0x593000,_0x2a3ee8){_0x593000['body'][_0x64a8('0x8a')]=_0x593000[_0x64a8('0x88')]['filename'];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x593000['params']['id']}})['then'](handleEntityNotFound(_0x2a3ee8,null))[_0x64a8('0x14')](saveUpdates(_0x593000[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x2a3ee8,null))[_0x64a8('0x1e')](handleError(_0x2a3ee8,null));};exports[_0x64a8('0x8b')]=function(_0x30fffc,_0x2cb94b){var _0x398e3a=path['join'](config['root'],_0x64a8('0x8c'));var _0x3ce0b9={'where':{'id':_0x30fffc['params']['id']},'attributes':['id',_0x64a8('0x83')],'raw':!![]};var _0x40c93c=![];return require('../../config/license/util')[_0x64a8('0x8d')]()[_0x64a8('0x14')](function(_0x225249){if(_0x225249){_0x40c93c=_0x225249['custom'];}})['then'](function(){return db[_0x64a8('0x55')]['find'](_0x3ce0b9);})[_0x64a8('0x14')](handleEntityNotFound(_0x2cb94b,null))['then'](function(_0xb3a810){if(_0xb3a810){if(!_[_0x64a8('0x8e')](_0xb3a810[_0x64a8('0x83')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x92'),_0xb3a810['sitepic']))&&_0x40c93c){_0x398e3a=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x92'),_0xb3a810['sitepic']);}}return _0x2cb94b[_0x64a8('0x93')](_0x398e3a);}})[_0x64a8('0x1e')](handleError(_0x2cb94b,null));};exports[_0x64a8('0x94')]=function(_0x36ed54,_0xc0b83e){var _0x57b53a=path[_0x64a8('0x90')](config['root'],_0x64a8('0x95'));var _0x505063={'where':{'id':_0x36ed54[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x86')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x505063)['then'](handleEntityNotFound(_0xc0b83e,null))['then'](function(_0x936fd8){if(_0x936fd8){if(!_['isNil'](_0x936fd8['agentAvatar'])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config['root'],_0x64a8('0x96'),_0x936fd8[_0x64a8('0x86')]))){_0x57b53a=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x936fd8[_0x64a8('0x86')]);}}return _0xc0b83e[_0x64a8('0x93')](_0x57b53a);}})['catch'](handleError(_0xc0b83e,null));};exports[_0x64a8('0x97')]=function(_0x242391,_0x512abe){var _0x23c665=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/customer_avatar.png');var _0x111b9a={'where':{'id':_0x242391[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x87'),_0x64a8('0x98')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x111b9a)['then'](handleEntityNotFound(_0x512abe,null))[_0x64a8('0x14')](function(_0x20f018){if(_0x20f018){if(!_[_0x64a8('0x8e')](_0x20f018[_0x64a8('0x87')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/',_0x20f018[_0x64a8('0x87')]))&&_0x20f018[_0x64a8('0x98')]){_0x23c665=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/',_0x20f018[_0x64a8('0x87')]);}}return _0x512abe[_0x64a8('0x93')](_0x23c665);}})[_0x64a8('0x1e')](handleError(_0x512abe,null));};exports[_0x64a8('0x99')]=function(_0x4be150,_0x1226d7){var _0x27244d=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/system_avatar.png');var _0x2e9b65={'where':{'id':_0x4be150[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x8a')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x2e9b65)[_0x64a8('0x14')](handleEntityNotFound(_0x1226d7,null))['then'](function(_0x2a6180){if(_0x2a6180){if(!_[_0x64a8('0x8e')](_0x2a6180[_0x64a8('0x8a')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x2a6180[_0x64a8('0x8a')]))){_0x27244d=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x2a6180[_0x64a8('0x8a')]);}}return _0x1226d7['download'](_0x27244d);}})[_0x64a8('0x1e')](handleError(_0x1226d7,null));};exports[_0x64a8('0x9a')]=function(_0x1f0b97,_0x2a61d6){var _0x284a8f={'body':_0x1f0b97[_0x64a8('0x77')],'channel':_0x64a8('0x9b')};var _0x2e23d0=[];var _0x2d666f=[];var _0x13829={};var _0xcb177=![];return db[_0x64a8('0x9c')][_0x64a8('0x78')]()['then'](function(_0x37f0dc){if(!_0x37f0dc){throw new db[(_0x64a8('0x9d'))]['ValidationError'](_0x64a8('0x9e'));}_0x2e23d0=_[_0x64a8('0x9f')](_[_0x64a8('0x59')](_0x37f0dc),[_0x64a8('0xa0'),_0x64a8('0xa1')]);_0x2d666f=_[_0x64a8('0x9f')](_[_0x64a8('0x59')](_0x37f0dc),[_0x64a8('0xa0'),_0x64a8('0xa1'),_0x64a8('0xa2'),_0x64a8('0xa3')]);if(_0x1f0b97[_0x64a8('0x77')]['id']){delete _0x1f0b97[_0x64a8('0x77')]['id'];}if(_[_0x64a8('0x8e')](_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')])){throw new db[(_0x64a8('0x9d'))]['ValidationError'](_0x64a8('0xa5'));}if(_[_0x64a8('0x8e')](_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')])||_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')]===''){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xa7'));}if(_[_0x64a8('0x8e')](_0x1f0b97['body'][_0x64a8('0xa8')])){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xa9')+_0x2d666f);}if(!_[_0x64a8('0xaa')](_0x2d666f,_0x1f0b97[_0x64a8('0x77')]['mapKey'])){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xab')+_0x2d666f);}_0x13829[_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa8')]]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')];})[_0x64a8('0x14')](function(){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x1f0b97[_0x64a8('0x6c')]['id']},'include':[{'model':db['CmList'],'as':_0x64a8('0xac'),'include':[{'model':db[_0x64a8('0x9c')],'as':_0x64a8('0xad'),'where':_0x13829,'limit':0x1,'order':[[_0x64a8('0xa1'),_0x64a8('0xae')]]}]},{'model':db[_0x64a8('0xaf')],'as':_0x64a8('0xb0')},{'model':db['Interval'],'as':_0x64a8('0xb1'),'include':[{'model':db[_0x64a8('0xb1')],'as':_0x64a8('0x3c'),'attributes':['id',_0x64a8('0x34')],'raw':!![]}]}]});})[_0x64a8('0x14')](function(_0x56a317){if(!_0x56a317)throw new APINotFoundError(util[_0x64a8('0x33')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x1f0b97[_0x64a8('0x6c')]['id']));if(!_0x56a317[_0x64a8('0xb1')]||!_0x56a317[_0x64a8('0xb1')][_0x64a8('0x3c')])return[_0x56a317,!![]];return[_0x56a317,checkWebsiteIntervals(_0x56a317)];})[_0x64a8('0xb2')](function(_0xea996f,_0x18c3c0){if(!_0x18c3c0)throw new APIOutOfIntervalError();if(!_0xea996f[_0x64a8('0xac')])return;_0x284a8f[_0x64a8('0xb3')]=_0xea996f;_0x284a8f[_0x64a8('0xb4')]=_0xea996f[_0x64a8('0xac')];_0x284a8f[_0x64a8('0xb5')]=_[_0x64a8('0xb6')](_0xea996f[_0x64a8('0xb0')],[_0x64a8('0xb7')],[_0x64a8('0xb8')]);if(_0x284a8f['account'][_0x64a8('0xb0')]){delete _0x284a8f['account'][_0x64a8('0xb0')];}if(_0x284a8f['account'][_0x64a8('0xac')]&&_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xac')]['Contacts']['length']){return _0x284a8f[_0x64a8('0xb3')][_0x64a8('0xac')][_0x64a8('0xad')][0x0];}var _0x2e2f77=_[_0x64a8('0xd')](_0x1f0b97['body'],{'firstName':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')],'ListId':_0xea996f[_0x64a8('0xa3')]});_0x2e2f77[_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa8')]]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')];return db['CmContact']['create'](_0x2e2f77,{'fields':_0x2e23d0,'raw':!![]});})[_0x64a8('0x14')](function(_0x2a380e){_0x284a8f[_0x64a8('0xb9')]=_0x2a380e;var _0x1b3362=createInteractionObject(_0x1f0b97['params']['id'],_0x1f0b97['body'],_0x1f0b97[_0x64a8('0xba')],_0x2a380e);var _0x346a50={'ChatWebsiteId':_0x1f0b97['params']['id'],'closed':![]};if(_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbb')]){_0x346a50[_0x64a8('0xbb')]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbb')];return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':_0x346a50})[_0x64a8('0x14')](function(_0x10a507){if(_0x10a507){_0xcb177=!![];return _0x10a507;}_0x1b3362[_0x64a8('0xbb')]=_0x1f0b97['body'][_0x64a8('0xbb')];_0x1b3362[_0x64a8('0xbd')]=_0x1f0b97[_0x64a8('0x77')]['externalUrl'];return db[_0x64a8('0xbc')][_0x64a8('0x70')](_0x1b3362);});}_0x346a50['ContactId']=_0x2a380e['id'];if(_0x1f0b97['body'][_0x64a8('0xbe')]&&_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbe')]['id']){_0x346a50['id']=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbe')]['id'];return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':_0x346a50})[_0x64a8('0x14')](function(_0x47bf79){if(_0x47bf79){_0xcb177=!![];return _0x47bf79;}return db[_0x64a8('0xbc')]['create'](_0x1b3362);});}return db['ChatInteraction'][_0x64a8('0x70')](_0x1b3362);})[_0x64a8('0x14')](function(_0x2a644e){if(!_0xcb177)return _0x2a644e;var _0x2a8d8b={'from':(_0x284a8f[_0x64a8('0xb9')][_0x64a8('0x47')]||'')+'\x20'+(_0x284a8f[_0x64a8('0xb9')][_0x64a8('0xbf')]||'')};if(_0x1f0b97[_0x64a8('0x77')]['threadId']&&_0x1f0b97['body'][_0x64a8('0xc0')]&&_0x1f0b97['body'][_0x64a8('0xbb')]!=_0x1f0b97[_0x64a8('0x77')]['messageId']){_0x2a8d8b['threadId']=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xc0')];}return _0x2a644e[_0x64a8('0x29')](_0x2a8d8b);})[_0x64a8('0x14')](function(_0x5965c8){_0x284a8f[_0x64a8('0xbe')]=_0x5965c8['get']({'plain':!![]});_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc1')]=!_0xcb177;if(_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc1')]){if(_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xc2')]){_0x284a8f[_0x64a8('0xb5')]['push']({'id':0x0,'priority':_0x284a8f['applications'][_0x64a8('0x5f')]+0x1,'app':_0x64a8('0xc3'),'appdata':_0x64a8('0xc4'),'interval':_0x64a8('0xc5')});}}return db[_0x64a8('0xc6')][_0x64a8('0x70')]({'body':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')],'ChatWebsiteId':_0x1f0b97[_0x64a8('0x6c')]['id'],'ChatInteractionId':_0x5965c8['id'],'direction':'in','ContactId':_0x284a8f[_0x64a8('0xb9')]['id'],'AttachmentId':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xc7')]});})[_0x64a8('0x14')](function(_0x316a6e){_0x284a8f[_0x64a8('0x1c')]=_0x316a6e;if(!_0x284a8f['interaction'][_0x64a8('0xc8')]){return;}return db[_0x64a8('0xc9')][_0x64a8('0x6f')]({'attributes':['id',_0x64a8('0x2e')],'where':{'id':_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc8')]}});})[_0x64a8('0x14')](function(_0x4dc487){if(_0x4dc487){_0x284a8f[_0x64a8('0xb5')]['unshift']({'id':0x0,'priority':0x0,'app':_0x64a8('0xca'),'appdata':_0x4dc487[_0x64a8('0x2e')]+','+(_0x284a8f['account'][_0x64a8('0xcb')]||0xa),'interval':_0x64a8('0xc5')});_0x284a8f[_0x64a8('0xcc')]=!![];}if(!_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xcd')]){return;}return db[_0x64a8('0xce')][_0x64a8('0x6f')]({'attributes':['id','name'],'where':{'id':_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xcd')]}});})[_0x64a8('0x14')](function(_0x3e8b2e){if(_0x3e8b2e){_0x284a8f[_0x64a8('0xb5')][_0x64a8('0xcf')]({'id':0x0,'priority':0x1,'app':_0x64a8('0xd0'),'appdata':_0x3e8b2e[_0x64a8('0x2e')]+','+(_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xd1')]||0x12c),'interval':_0x64a8('0xc5')});}return respondWithRpcPromise(_0x64a8('0xd2'),_0x64a8('0xd3'),_0x284a8f);})['then'](function(_0x430f6a){respondWithRpcPromise(_0x64a8('0xd4'),'EventManager',{'event':_0x64a8('0x9a'),'message':_0x430f6a},client9002);return _0x430f6a;})[_0x64a8('0x14')](respondWithResult(_0x2a61d6,null))[_0x64a8('0x1e')](APIHandleError(_0x2a61d6));};exports[_0x64a8('0xd5')]=function(_0xb783da,_0x18c24c){var _0x525331,_0x41f566,_0x4560df;var _0x5f2093=[];var _0x1a026c={};var _0xb41b65=_0xb783da['files']||[];var _0x4cc7a6=[];var _0xd3fb7a;return db[_0x64a8('0x9c')][_0x64a8('0x78')]()[_0x64a8('0x14')](function(_0x1e154b){if(!_0x1e154b){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0x9e'));}_0x5f2093=_['difference'](_[_0x64a8('0x59')](_0x1e154b),[_0x64a8('0xa0'),'updatedAt',_0x64a8('0xa2'),_0x64a8('0xa3')]);if(_0xb783da[_0x64a8('0x77')]['id']){delete _0xb783da[_0x64a8('0x77')]['id'];}if(_['isNil'](_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')])){throw _0x18c24c['status'](0x1f4)[_0x64a8('0x2f')](new db['Sequelize'][(_0x64a8('0xa6'))](_0x64a8('0xa5')));}if(_[_0x64a8('0x8e')](_0xb783da[_0x64a8('0x77')][_0x64a8('0x77')])||_0xb783da['body'][_0x64a8('0x77')]===''){throw _0x18c24c['status'](0x1f4)[_0x64a8('0x2f')](new db['Sequelize']['ValidationError'](_0x64a8('0xa7')));}if(_[_0x64a8('0x8e')](_0xb783da[_0x64a8('0x77')][_0x64a8('0xd6')])){throw _0x18c24c[_0x64a8('0x20')](0x1f4)['send'](new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xd7')+_0x5f2093));}if(!_[_0x64a8('0xaa')](_0x5f2093,_0xb783da[_0x64a8('0x77')][_0x64a8('0xd6')])){throw _0x18c24c[_0x64a8('0x20')](0x1f4)['send'](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5f2093));}_0x1a026c[_0xb783da[_0x64a8('0x77')]['mapKeyOffline']]=_0xb783da['body'][_0x64a8('0xa4')];})['then'](function(){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0xb783da[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0xd8')],'as':_0x64a8('0xac')},{'model':db[_0x64a8('0xd9')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x18c24c,null))[_0x64a8('0x14')](function(_0x3524cb){if(_0x3524cb&&_0x3524cb[_0x64a8('0xac')]){_0x41f566=_0x3524cb;var _0x49b9d8=_['defaults'](_0xb783da['body'],{'firstName':_0xb783da['body'][_0x64a8('0xa4')],'phone':_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')],'ListId':_0x3524cb['ListId']});_0x49b9d8[_0xb783da[_0x64a8('0x77')]['mapKeyOffline']]=_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')];return db[_0x64a8('0x9c')]['findOrCreate']({'where':_0x1a026c,'defaults':_0x49b9d8});}})[_0x64a8('0xb2')](function(_0x31cf3b){if(_0x31cf3b){_0x4560df=_0x31cf3b;var _0x43dc08=fs[_0x64a8('0xda')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0xdb')),_0x64a8('0xdc'));var _0x31ad45=ejs['render'](_0x43dc08,{'body':_[_0x64a8('0xdd')](_0xb783da[_0x64a8('0x77')][_0x64a8('0x77')]),'bodyTitle':_0x41f566[_0x64a8('0xde')]});return db[_0x64a8('0xdf')][_0x64a8('0x70')]({'body':_0x31ad45,'plainBody':htmlToText[_0x64a8('0xe0')](_0x31ad45),'ContactId':_0x31cf3b['id'],'ChatWebsiteId':_0x41f566['id']});}})[_0x64a8('0x14')](function(_0x5504bd){_0xd3fb7a=_0x5504bd;if(_0xb41b65['length']){var _0x442e46=_0xb41b65[_0x64a8('0x54')](function(_0x14985b){return{'name':_0x14985b['originalname'],'basename':_0x14985b[_0x64a8('0x84')],'type':_0x14985b[_0x64a8('0xe1')],'ChatOfflineMessageId':_0x5504bd['id']};});_0x4cc7a6=_0x442e46[_0x64a8('0x54')](_0x1bd6e5=>{var _0x36bb2f={'filename':_0x1bd6e5[_0x64a8('0x2e')],'path':path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0xe2'),_0x64a8('0xe3'),'attachments',_0x64a8('0xe4'),_0x1bd6e5['basename'])};return _0x36bb2f;});if(!_0x41f566[_0x64a8('0xe5')]){return db['sequelize'][_0x64a8('0xe6')](function(_0x2ec538){return db['Attachment'][_0x64a8('0xe7')](_0x442e46,{'transaction':_0x2ec538});});}}})[_0x64a8('0x14')](function(){if(_0xd3fb7a){_0x525331=_0xd3fb7a;return db[_0x64a8('0xd9')][_0x64a8('0x7b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x64a8('0xe8'),'raw':!![],'include':[{'model':db[_0x64a8('0xe9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x64a8('0x14')](function(_0x359b3b){if(_0x359b3b&&_0x359b3b[_0x64a8('0xe8')]&&_0x41f566[_0x64a8('0xea')]&&_0x41f566[_0x64a8('0xeb')]){var _0x56227e=_0x359b3b['getSmtpOptions']();return respondWithRpcPromise(_0x64a8('0xec'),_0x64a8('0xed'),{'account':_0x56227e,'message':{'from':util[_0x64a8('0x33')](_0x64a8('0xee'),_0x359b3b[_0x64a8('0x2e')],_0x359b3b[_0x64a8('0xef')]||_0x359b3b[_0x64a8('0xe8')]['user']),'to':_0x41f566[_0x64a8('0xeb')],'subject':_0x41f566[_0x64a8('0xf0')],'html':_0x525331['body'],'attachments':_0x4cc7a6}},client9003)['then'](function(){return _0x525331;})[_0x64a8('0x1e')](function(_0x4570ff){logger[_0x64a8('0x1a')](_0x4570ff);});}})[_0x64a8('0x14')](function(){if(_0x41f566&&_0x41f566[_0x64a8('0xe5')]&&_0x41f566[_0x64a8('0xf1')]){var _0x4549c0=[];if(_0xb41b65[_0x64a8('0x5f')]){_0x4549c0=_0xb41b65[_0x64a8('0x54')](function(_0x31bdfa){return{'name':_0x31bdfa[_0x64a8('0xf2')],'basename':_0x31bdfa[_0x64a8('0x84')],'type':_0x31bdfa[_0x64a8('0xe1')],'ChatOfflineMessageId':_0xd3fb7a['id']};});}var _0x25fc7b;if(!_[_0x64a8('0x8e')](_0x41f566[_0x64a8('0xf3')])){var _0x1bb522=_[_0x64a8('0x54')](_0xb783da['body'],function(_0x4ae209){return _0x4ae209;});var _0x3b454f=_['toPairsIn'](_0x1bb522)[0x0];var _0x535c14=_[_0x64a8('0xf4')](_0x3b454f,function(_0x4a837c){return _0x4a837c;});_0x25fc7b=_0x535c14[0x1][_0x41f566['subjectOffline']];}var _0x3bec3c={'from':_0x4560df[_0x64a8('0xef')],'firstName':_0x4560df['firstName'],'lastName':_0x4560df['lastName'],'mapKey':'email','message':{'from':_0x4560df[_0x64a8('0xef')],'to':_0x41f566[_0x64a8('0xd9')][_0x64a8('0xef')],'cc':'','subject':_[_0x64a8('0x8e')](_0x25fc7b)?_0x41f566[_0x64a8('0xf0')]:_0x25fc7b,'messageId':'','sentAt':new Date(),'attach':_0x4549c0[_0x64a8('0x5f')],'attachments':_0x4549c0,'originChannel':_0x64a8('0xf5'),'ChatWebsiteId':_0x41f566['id'],'ChatOfflineMessageId':_0x525331['id'],'originTo':_0x41f566[_0x64a8('0xd9')][_0x64a8('0xef')]},'body':_0x525331[_0x64a8('0x77')]};var _0xd87551={'account':{'id':_0x41f566['MailAccountId']},'body':_0x3bec3c,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x64a8('0xf6'),_0x64a8('0xf7'),_0xd87551,client9001)['then'](function(){return _0x525331;})['catch'](function(_0x4c8413){logger[_0x64a8('0x1a')](_0x4c8413);});}return;})[_0x64a8('0x14')](function(){if(_0x525331){return _0x525331;}})[_0x64a8('0x14')](respondWithResult(_0x18c24c,null))[_0x64a8('0x1e')](function(){for(var _0x267b76 of _0xb41b65){var _0x3a71f2=path[_0x64a8('0x90')](config['root'],_0x64a8('0xe2'),'files',_0x64a8('0xf8'),_0x64a8('0xe4'),_0x267b76[_0x64a8('0x84')]);fs_extra[_0x64a8('0xf9')](_0x3a71f2)[_0x64a8('0x1e')](function(_0x117dd4){logger[_0x64a8('0x1a')](_0x64a8('0xfa'),_0x3a71f2,_0x117dd4);});}});};exports['addInteraction']=function(_0x261d85,_0x6ee599){return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':{'id':_0x261d85[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x6ee599,null))[_0x64a8('0x14')](function(_0x3301d0){if(_0x3301d0){return _0x3301d0[_0x64a8('0xfb')](_0x261d85[_0x64a8('0x77')][_0x64a8('0xfc')],_['omit'](_0x261d85[_0x64a8('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x6ee599,null))[_0x64a8('0x1e')](handleError(_0x6ee599,null));};exports[_0x64a8('0xfd')]=function(_0x287600,_0x40b582){var _0x246745={'raw':![],'where':{}};var _0x1c778a={};var _0x20a0c2={'count':0x0,'rows':[]};return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x287600['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x40b582,null))[_0x64a8('0x14')](function(_0x1237e8){if(_0x1237e8){_0x1c778a[_0x64a8('0x4d')]=_['keys'](db[_0x64a8('0xbc')][_0x64a8('0x56')]);_0x1c778a[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x287600[_0x64a8('0x5b')]);_0x1c778a['filters']=_[_0x64a8('0x5d')](_0x1c778a[_0x64a8('0x4d')],_0x1c778a['query']);_0x246745['attributes']=_[_0x64a8('0x5d')](_0x1c778a[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x287600['query']['fields']));_0x246745[_0x64a8('0x5c')]=_0x246745[_0x64a8('0x5c')]['length']?_0x246745[_0x64a8('0x5c')]:_0x1c778a[_0x64a8('0x4d')];if(!_0x287600[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x246745[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x287600['query'][_0x64a8('0x23')]);_0x246745['offset']=qs['offset'](_0x287600['query'][_0x64a8('0x26')]);}_0x246745[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x287600[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x246745[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x287600[_0x64a8('0x5b')],_0x1c778a[_0x64a8('0x5a')]));_0x246745[_0x64a8('0x64')][_0x64a8('0x79')]=_0x1237e8['id'];if(_0x287600[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x246745[_0x64a8('0x64')]=_[_0x64a8('0x67')](_0x246745['where'],{'$or':_[_0x64a8('0x54')](_0x246745[_0x64a8('0x5c')],function(_0x47ebaf){var _0x320e48={};_0x320e48[_0x47ebaf]={'$like':'%'+_0x287600[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x320e48;})});}_0x246745=_[_0x64a8('0x67')]({},_0x246745,_0x287600[_0x64a8('0x68')]);return db[_0x64a8('0xbc')][_0x64a8('0x25')]({'where':_0x246745['where']})['then'](function(_0x4a51dd){_0x20a0c2[_0x64a8('0x25')]=_0x4a51dd;if(_0x287600[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x246745[_0x64a8('0x69')]=[{'model':db[_0x64a8('0x9c')],'as':_0x64a8('0xfe'),'required':![]},{'model':db[_0x64a8('0xc9')],'as':'Owner','attributes':[_0x64a8('0x2e'),_0x64a8('0xff'),_0x64a8('0x100')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x64a8('0x2e'),_0x64a8('0x101')],'where':_0x287600['query'][_0x64a8('0x102')]?{'id':_0x287600[_0x64a8('0x5b')]['tag']}:undefined,'required':_0x287600[_0x64a8('0x5b')][_0x64a8('0x102')]?!![]:![]}];}return db[_0x64a8('0xbc')][_0x64a8('0x7c')](_0x246745);})[_0x64a8('0x14')](function(_0x1a4fa7){_0x20a0c2['rows']=_0x1a4fa7;return _0x20a0c2;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x40b582,_0x246745))[_0x64a8('0x1e')](handleError(_0x40b582,null));};exports[_0x64a8('0x31')]=function(_0x55fb35,_0x4e73f7){var _0x438e01=0x0;var _0x1b2866=0x0;var _0x2a7017=![];var _0x18bf0b;var _0x480af3;return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x55fb35['params']['id']},'include':[{'model':db['Interval'],'as':_0x64a8('0xb1'),'include':[{'model':db[_0x64a8('0xb1')],'as':'Intervals','attributes':['id',_0x64a8('0x34')]}]}]})[_0x64a8('0x14')](handleEntityNotFound(_0x4e73f7,null))[_0x64a8('0x14')](function(_0x55fac6){if(_0x55fac6){_0x18bf0b=_0x55fac6;return _0x55fac6['getProactiveActions']({'raw':!![]});}})[_0x64a8('0x14')](function(_0x3fa940){if(_0x18bf0b){if(_0x3fa940){_0x480af3=_0x3fa940;}}return require('../../config/license/util')[_0x64a8('0x8d')]();})[_0x64a8('0x14')](function(_0x621352){if(_0x621352){_0x1b2866=_0x621352[_0x64a8('0x103')];_0x2a7017=_0x621352[_0x64a8('0x104')];}})['then'](function(){return db[_0x64a8('0xbc')][_0x64a8('0x25')]({'where':{'closed':![]}});})[_0x64a8('0x14')](function(_0x217ad3){_0x438e01=_0x217ad3;if(_0x1b2866&&_0x217ad3>_0x1b2866){return db[_0x64a8('0x105')][_0x64a8('0x7b')]({'where':{'id':0x1}})[_0x64a8('0x14')](function(_0xe962db){if(_0xe962db){_0xe962db[_0x64a8('0x106')](_0x64a8('0x107'));}});}})[_0x64a8('0x14')](function(){if(!_0x18bf0b[_0x64a8('0xb1')]||!_0x18bf0b[_0x64a8('0xb1')][_0x64a8('0x3c')])return!![];return checkWebsiteIntervals(_0x18bf0b);})[_0x64a8('0x14')](function(_0x93dab){var _0x448829=fs[_0x64a8('0xda')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x108')),_0x64a8('0xdc'));var _0x37a6b2=new url[(_0x64a8('0x109'))](_0x18bf0b[_0x64a8('0x10a')])[_0x64a8('0x10b')];var _0x5754f9=_0x64a8('0x10c');var _0x556297=![];var _0xc20cb9={'chatVersion':_0x5754f9,'chatWebsiteAddressOrigin':_0x37a6b2,'remote':_0x18bf0b[_0x64a8('0x10d')],'query':querystring[_0x64a8('0x19')](_['merge'](_0x18bf0b[_0x64a8('0x2a')]({'plain':!![]}),{'customerIp':_0x55fb35[_0x64a8('0xba')][_0x64a8('0x44')]||_0x55fb35[_0x64a8('0xba')][_0x64a8('0x10e')]||_0x55fb35['connection']['remoteAddress']||_0x55fb35['ip'],'referer':_0x55fb35[_0x64a8('0xba')][_0x64a8('0x10f')],'openedInteractions':_0x438e01,'maxInteractions':_0x1b2866,'virtual':_0x2a7017[_0x64a8('0x103')],'online':_0x93dab,'custom':_0x2a7017}))[_0x64a8('0x110')](/'/g,'\x5c\x27')};_0x4e73f7[_0x64a8('0x2f')](ejs[_0x64a8('0x111')](Mustache[_0x64a8('0x111')](_0x448829,_0xc20cb9),{'proactiveActions':_0x480af3,'alignment':_0x18bf0b[_0x64a8('0x112')],'verticalAlignment':_0x18bf0b[_0x64a8('0x113')],'div_color':_0x18bf0b[_0x64a8('0x101')],'labelText':_0x18bf0b['labelText'],'text_color':_0x18bf0b[_0x64a8('0x114')],'text_button_color':_0x18bf0b[_0x64a8('0x115')],'button_color':_0x18bf0b['color_button'],'background_color':_0x18bf0b[_0x64a8('0x116')],'hideWhenOffline':_0x18bf0b[_0x64a8('0x117')],'intervalId':_0x18bf0b[_0x64a8('0x118')],'isDevelopment':_0x556297,'chatVersion':_0x5754f9}));})['catch'](handleError(_0x4e73f7,null));};exports[_0x64a8('0x119')]=function(_0x433170,_0x141c3a){var _0x2e90ca=_0x433170[_0x64a8('0x6c')]['id'];var _0x190cb5=_0x433170['body'];var _0x5239c9=0xc8;var _0x14c223=null;return db[_0x64a8('0x11a')][_0x64a8('0xe6')]({'isolationLevel':db[_0x64a8('0x11a')]['Transaction'][_0x64a8('0x11b')][_0x64a8('0x11c')]},function(_0x3c914d){return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x2e90ca},'transaction':_0x3c914d})['then'](function(_0x16d6b1){if(_0x16d6b1){return db[_0x64a8('0xaf')][_0x64a8('0x2c')]({'where':{'ChatWebsiteId':_0x2e90ca},'transaction':_0x3c914d})[_0x64a8('0x14')](function(){var _0x59520d=_[_0x64a8('0x54')](_0x190cb5,function(_0x8410c){_0x8410c[_0x64a8('0x79')]=_0x2e90ca;return _0x8410c;});return db[_0x64a8('0xaf')][_0x64a8('0xe7')](_0x59520d,{'transaction':_0x3c914d});});}else{_0x5239c9=0x194;_0x14c223=[];}});})[_0x64a8('0x14')](function(){if(_0x5239c9!==0x194){return db[_0x64a8('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2e90ca},'order':_0x64a8('0xb7')})[_0x64a8('0x14')](function(_0x313236){_0x14c223=_0x313236;});}})[_0x64a8('0x1e')](function(_0x3197d8){_0x5239c9=0x1f4;logger[_0x64a8('0x1a')](_0x3197d8[_0x64a8('0x2d')]);if(_0x3197d8[_0x64a8('0x2e')]){delete _0x3197d8[_0x64a8('0x2e')];}_0x14c223=_0x3197d8;})[_0x64a8('0x11d')](function(){if(_0x14c223===null){_0x141c3a[_0x64a8('0x1f')](_0x5239c9);}else{if(_0x5239c9===0x1f4){_0x141c3a['status'](_0x5239c9)[_0x64a8('0x2f')](_0x14c223);}else{_0x141c3a['status'](_0x5239c9)['json'](_0x14c223);}}});};exports[_0x64a8('0x11e')]=function(_0x533cd9,_0x3820fa){var _0x1d1541={};var _0x3c21a5={};var _0x41a368;var _0x68b6c6;return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x533cd9['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x3820fa,null))[_0x64a8('0x14')](function(_0x3984b7){if(_0x3984b7){_0x41a368=_0x3984b7;_0x3c21a5[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db['ChatApplication'][_0x64a8('0x56')]);_0x3c21a5[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x533cd9['query']);_0x3c21a5['filters']=_[_0x64a8('0x5d')](_0x3c21a5[_0x64a8('0x4d')],_0x3c21a5[_0x64a8('0x5b')]);_0x1d1541[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x3c21a5['model'],qs[_0x64a8('0x5e')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x1d1541[_0x64a8('0x5c')]=_0x1d1541[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x1d1541[_0x64a8('0x5c')]:_0x3c21a5['model'];_0x1d1541[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x1d1541[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x533cd9[_0x64a8('0x5b')],_0x3c21a5['filters']));if(_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x1d1541[_0x64a8('0x64')]=_['merge'](_0x1d1541[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x1d1541[_0x64a8('0x5c')],function(_0x575d26){var _0x4f9318={};_0x4f9318[_0x575d26]={'$like':'%'+_0x533cd9['query'][_0x64a8('0x65')]+'%'};return _0x4f9318;})});}_0x1d1541=_['merge']({},_0x1d1541,_0x533cd9['options']);return _0x41a368['getApplications'](_0x1d1541);}})['then'](function(_0x1e333e){if(_0x1e333e){_0x68b6c6=_0x1e333e[_0x64a8('0x5f')];if(!_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x1d1541[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x533cd9['query'][_0x64a8('0x23')]);_0x1d1541[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x26')]);}return _0x41a368[_0x64a8('0x11e')](_0x1d1541);}})[_0x64a8('0x14')](function(_0x396a59){if(_0x396a59){return _0x396a59?{'count':_0x68b6c6,'rows':_0x396a59}:null;}})[_0x64a8('0x14')](respondWithResult(_0x3820fa,null))['catch'](handleError(_0x3820fa,null));};exports[_0x64a8('0x11f')]=function(_0x1c11a5,_0x13b667){return db[_0x64a8('0x120')][_0x64a8('0x6f')]({'where':{'id':_0x1c11a5['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x13b667,null))['then'](function(_0xb4c885){if(_0xb4c885){return _0xb4c885[_0x64a8('0x11f')](_0x1c11a5['body'][_0x64a8('0xfc')],_['omit'](_0x1c11a5[_0x64a8('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x13b667,null))[_0x64a8('0x1e')](handleError(_0x13b667,null));};exports['getProactiveActions']=function(_0x494779,_0x2641db){var _0x57f251={};var _0x1e5e91={};var _0x1b788f;var _0x17a7db;return db['ChatWebsite'][_0x64a8('0x7b')]({'where':{'id':_0x494779[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2641db,null))[_0x64a8('0x14')](function(_0x3581d5){if(_0x3581d5){_0x1b788f=_0x3581d5;_0x1e5e91[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x121')]['rawAttributes']);_0x1e5e91[_0x64a8('0x5b')]=_['keys'](_0x494779[_0x64a8('0x5b')]);_0x1e5e91[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x1e5e91[_0x64a8('0x4d')],_0x1e5e91[_0x64a8('0x5b')]);_0x57f251[_0x64a8('0x5c')]=_['intersection'](_0x1e5e91[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x57f251[_0x64a8('0x5c')]=_0x57f251[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x57f251['attributes']:_0x1e5e91['model'];_0x57f251[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x57f251[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x494779[_0x64a8('0x5b')],_0x1e5e91[_0x64a8('0x5a')]));if(_0x494779[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x57f251['where']=_[_0x64a8('0x67')](_0x57f251['where'],{'$or':_[_0x64a8('0x54')](_0x57f251['attributes'],function(_0x5d2c9a){var _0x122e7d={};_0x122e7d[_0x5d2c9a]={'$like':'%'+_0x494779['query'][_0x64a8('0x65')]+'%'};return _0x122e7d;})});}_0x57f251=_[_0x64a8('0x67')]({},_0x57f251,_0x494779[_0x64a8('0x68')]);return _0x1b788f[_0x64a8('0x122')](_0x57f251);}})[_0x64a8('0x14')](function(_0x22ec09){if(_0x22ec09){_0x17a7db=_0x22ec09[_0x64a8('0x5f')];if(!_0x494779[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x57f251[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x57f251[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x494779['query'][_0x64a8('0x26')]);}return _0x1b788f[_0x64a8('0x122')](_0x57f251);}})['then'](function(_0x1e7630){if(_0x1e7630){return _0x1e7630?{'count':_0x17a7db,'rows':_0x1e7630}:null;}})['then'](respondWithResult(_0x2641db,null))['catch'](handleError(_0x2641db,null));};exports[_0x64a8('0x123')]=function(_0xcb46b0,_0x5f25b5){var _0x1019fd=_0xcb46b0[_0x64a8('0x5b')][_0x64a8('0x124')]===_0x64a8('0x125')?_0x64a8('0x126'):'onlineForm';return db[_0x64a8('0x55')]['find']({'attributes':['id',_0x1019fd],'where':{'id':_0xcb46b0[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x5f25b5,null))[_0x64a8('0x14')](function(_0x3fbed4){if(_0x3fbed4){var _0x2d92cb=_0x3fbed4[_0x1019fd];var _0x9b8a24=_0x2d92cb&&_0x2d92cb['items']?_0x2d92cb[_0x64a8('0x127')]:[];_0x5f25b5[_0x64a8('0x2f')]({'fromKey':_['isNil'](_0x2d92cb[_0x64a8('0x128')])?undefined:_0x2d92cb[_0x64a8('0x128')],'count':_0x9b8a24[_0x64a8('0x5f')],'rows':_0x9b8a24});}})['catch'](handleError(_0x5f25b5,null));};exports[_0x64a8('0x129')]=function(_0x445686,_0x35e000){var _0x3bcd8d={'raw':![],'where':{}};var _0x185296={};var _0x1ccb30={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x64a8('0x7b')]({'where':{'id':_0x445686[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x35e000,null))[_0x64a8('0x14')](function(_0x39639b){if(_0x39639b){_0x185296[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db['ChatOfflineMessage'][_0x64a8('0x56')]);_0x185296[_0x64a8('0x5b')]=_['keys'](_0x445686[_0x64a8('0x5b')]);_0x185296[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x185296[_0x64a8('0x4d')],_0x185296[_0x64a8('0x5b')]);_0x3bcd8d[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x185296[_0x64a8('0x4d')],qs['fields'](_0x445686[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x3bcd8d[_0x64a8('0x5c')]=_0x3bcd8d[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x3bcd8d[_0x64a8('0x5c')]:_0x185296[_0x64a8('0x4d')];if(!_0x445686[_0x64a8('0x5b')]['hasOwnProperty'](_0x64a8('0x61'))){_0x3bcd8d[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x445686[_0x64a8('0x5b')]['limit']);_0x3bcd8d[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x445686['query'][_0x64a8('0x26')]);}_0x3bcd8d[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x445686[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x3bcd8d[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x445686[_0x64a8('0x5b')],_0x185296[_0x64a8('0x5a')]));_0x3bcd8d[_0x64a8('0x64')]['ChatWebsiteId']=_0x39639b['id'];if(_0x445686[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x3bcd8d['where']=_[_0x64a8('0x67')](_0x3bcd8d['where'],{'$or':_['map'](_0x3bcd8d[_0x64a8('0x5c')],function(_0x324e39){var _0x52b2e5={};_0x52b2e5[_0x324e39]={'$like':'%'+_0x445686['query'][_0x64a8('0x65')]+'%'};return _0x52b2e5;})});}_0x3bcd8d=_[_0x64a8('0x67')]({},_0x3bcd8d,_0x445686['options']);return db['ChatOfflineMessage'][_0x64a8('0x25')]({'where':_0x3bcd8d[_0x64a8('0x64')]})[_0x64a8('0x14')](function(_0x6122c8){_0x1ccb30[_0x64a8('0x25')]=_0x6122c8;if(_0x445686[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x3bcd8d[_0x64a8('0x69')]=[{'all':!![]}];}else{_0x3bcd8d[_0x64a8('0x69')]=[{'model':db[_0x64a8('0x9c')],'as':'Contact','required':![]},{'model':db[_0x64a8('0x12a')],'as':'Attachments','required':![]}];}return db[_0x64a8('0xdf')]['findAll'](_0x3bcd8d);})[_0x64a8('0x14')](function(_0x2d4cba){_0x1ccb30[_0x64a8('0x6a')]=_0x2d4cba;return _0x1ccb30;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x35e000,_0x3bcd8d))['catch'](handleError(_0x35e000,null));};exports[_0x64a8('0x12b')]=function(_0x53722a,_0xe62f9c){return db[_0x64a8('0x55')]['find']({'where':{'id':_0x53722a[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0xe62f9c,null))['then'](function(_0x355948){if(_0x355948){return _0x355948[_0x64a8('0x12b')](_0x53722a['body']['ids'],_['omit'](_0x53722a[_0x64a8('0x77')],[_0x64a8('0xfc'),'id'])||{})[_0x64a8('0xb2')](function(_0x5706a4){for(var _0x4e4c0c=0x0;_0x4e4c0c<_0x53722a[_0x64a8('0x77')][_0x64a8('0xfc')]['length'];_0x4e4c0c+=0x1){socket[_0x64a8('0x12c')](_0x64a8('0x12d'),{'UserId':Number(_0x53722a[_0x64a8('0x77')]['ids'][_0x4e4c0c]),'ChatWebsiteId':Number(_0x53722a[_0x64a8('0x6c')]['id'])});}return _0x5706a4;});}})['then'](respondWithResult(_0xe62f9c,null))['catch'](handleError(_0xe62f9c,null));};exports[_0x64a8('0x12e')]=function(_0x4e5897,_0x356b00){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x4e5897['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x356b00,null))[_0x64a8('0x14')](function(_0x5a2af3){if(_0x5a2af3){return _0x5a2af3[_0x64a8('0x12e')](_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')])[_0x64a8('0x14')](function(){if(_['isArray'](_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')])){for(var _0x51641=0x0;_0x51641<_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')]['length'];_0x51641+=0x1){socket[_0x64a8('0x12c')](_0x64a8('0x12f'),{'UserId':Number(_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')][_0x51641]),'ChatWebsiteId':Number(_0x4e5897[_0x64a8('0x6c')]['id'])});}}else{socket['emit'](_0x64a8('0x12f'),{'UserId':Number(_0x4e5897[_0x64a8('0x5b')]['ids']),'ChatWebsiteId':Number(_0x4e5897[_0x64a8('0x6c')]['id'])});}});}})[_0x64a8('0x14')](respondWithStatusCode(_0x356b00,null))[_0x64a8('0x1e')](handleError(_0x356b00,null));};exports[_0x64a8('0x130')]=function(_0x23d4dc,_0x3a9b78){var _0x4c957a={};var _0x255240={};var _0x5ade7c;var _0x10df4e;return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x23d4dc[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3a9b78,null))[_0x64a8('0x14')](function(_0x5d54c0){if(_0x5d54c0){_0x5ade7c=_0x5d54c0;_0x255240[_0x64a8('0x4d')]=_['keys'](db[_0x64a8('0xc9')][_0x64a8('0x56')]);_0x255240[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x23d4dc[_0x64a8('0x5b')]);_0x255240[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x255240['model'],_0x255240[_0x64a8('0x5b')]);_0x4c957a[_0x64a8('0x5c')]=_['intersection'](_0x255240['model'],qs[_0x64a8('0x5e')](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x4c957a[_0x64a8('0x5c')]=_0x4c957a[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x4c957a[_0x64a8('0x5c')]:_0x255240[_0x64a8('0x4d')];_0x4c957a[_0x64a8('0x62')]=qs['sort'](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x4c957a['where']=qs['filters'](_['pick'](_0x23d4dc['query'],_0x255240[_0x64a8('0x5a')]));if(_0x23d4dc[_0x64a8('0x5b')]['filter']){_0x4c957a['where']=_['merge'](_0x4c957a[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x4c957a[_0x64a8('0x5c')],function(_0x3c5d4d){var _0x10cb41={};_0x10cb41[_0x3c5d4d]={'$like':'%'+_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x10cb41;})});}_0x4c957a=_[_0x64a8('0x67')]({},_0x4c957a,_0x23d4dc[_0x64a8('0x68')]);return _0x5ade7c[_0x64a8('0x130')](_0x4c957a);}})[_0x64a8('0x14')](function(_0x580830){if(_0x580830){_0x10df4e=_0x580830['length'];if(!_0x23d4dc[_0x64a8('0x5b')]['hasOwnProperty'](_0x64a8('0x61'))){_0x4c957a[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x23d4dc[_0x64a8('0x5b')]['limit']);_0x4c957a[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x26')]);}return _0x5ade7c[_0x64a8('0x130')](_0x4c957a);}})[_0x64a8('0x14')](function(_0x4e5862){if(_0x4e5862){return _0x4e5862?{'count':_0x10df4e,'rows':_0x4e5862}:null;}})[_0x64a8('0x14')](respondWithResult(_0x3a9b78,null))[_0x64a8('0x1e')](handleError(_0x3a9b78,null));};
\ No newline at end of file
+var _0x9944=['notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','x-real-ip','connection','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','Command','getSnippet','timezone','format','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','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','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','fieldName','key','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','ChatWebsite','includeAll','include','findAll','rows','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar','addSystemAvatar','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','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','headers','threadId','ChatInteraction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount'];(function(_0x32b9c5,_0x1c165d){var _0x589f31=function(_0x2e2ddf){while(--_0x2e2ddf){_0x32b9c5['push'](_0x32b9c5['shift']());}};_0x589f31(++_0x1c165d);}(_0x9944,0x16e));var _0x4994=function(_0xae32a4,_0x4d8d00){_0xae32a4=_0xae32a4-0x0;var _0x43d4f7=_0x9944[_0xae32a4];return _0x43d4f7;};'use strict';var Mustache=require(_0x4994('0x0'));var util=require('util');var path=require(_0x4994('0x1'));var ejs=require(_0x4994('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4994('0x3'));var querystring=require(_0x4994('0x4'));var htmlToText=require(_0x4994('0x5'));var Redis=require('ioredis');var jayson=require(_0x4994('0x6'));var url=require(_0x4994('0x7'));var qs=require(_0x4994('0x8'));var logger=require(_0x4994('0x9'))(_0x4994('0xa'));var config=require(_0x4994('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require(_0x4994('0xc'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x4994('0xd')];var db=require(_0x4994('0xe'))['db'];config[_0x4994('0xf')]=_[_0x4994('0x10')](config[_0x4994('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4994('0x11'))(new Redis(config[_0x4994('0xf')]));require(_0x4994('0x12'))[_0x4994('0x13')](socket);var client=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232c});var client9002=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232a});var client9003=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232b});var client9001=jayson[_0x4994('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x26b9fe,_0x5ea1ec,_0x4ad064,_0x1436e1){return new Promise(function(_0x4ae812,_0x36724e){var _0x16e75b=_0x1436e1||client;return _0x16e75b[_0x4994('0x16')](_0x26b9fe,_0x4ad064)[_0x4994('0x17')](function(_0x211cb0){logger[_0x4994('0x18')](_0x4994('0x19'),_0x5ea1ec,_0x4994('0x1a'));logger[_0x4994('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'),JSON[_0x4994('0x1c')](_0x211cb0));if(_0x211cb0[_0x4994('0x1d')]){if(_0x211cb0['error']['code']===0x1f4){logger['error'](_0x4994('0x19'),_0x5ea1ec,_0x211cb0['error'][_0x4994('0x1e')]);return _0x36724e(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);return _0x4ae812(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}else{logger[_0x4994('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'));_0x4ae812(_0x211cb0[_0x4994('0x1f')][_0x4994('0x1e')]);}})[_0x4994('0x20')](function(_0x6f2734){logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x6f2734);_0x36724e(_0x6f2734);});});}function respondWithStatusCode(_0x5d872c,_0x336b14){_0x336b14=_0x336b14||0xcc;return function(_0x31d249){if(_0x31d249){return _0x5d872c[_0x4994('0x21')](_0x336b14);}return _0x5d872c[_0x4994('0x22')](_0x336b14)[_0x4994('0x23')]();};}function respondWithResult(_0x521c10,_0xf0890){_0xf0890=_0xf0890||0xc8;return function(_0x250472){if(_0x250472){return _0x521c10[_0x4994('0x22')](_0xf0890)['json'](_0x250472);}};}function respondWithFilteredResult(_0x158fe8,_0x2ae073){return function(_0x1cd7c3){if(_0x1cd7c3){var _0x1b3826=typeof _0x2ae073[_0x4994('0x24')]===_0x4994('0x25')&&typeof _0x2ae073[_0x4994('0x26')]===_0x4994('0x25');var _0x279aab=_0x1cd7c3[_0x4994('0x27')];var _0x5d0492=_0x1b3826?0x0:_0x2ae073[_0x4994('0x24')];var _0x22b525=_0x1b3826?_0x1cd7c3[_0x4994('0x27')]:_0x2ae073[_0x4994('0x24')]+_0x2ae073[_0x4994('0x26')];var _0x5c8195;if(_0x22b525>=_0x279aab){_0x22b525=_0x279aab;_0x5c8195=0xc8;}else{_0x5c8195=0xce;}_0x158fe8['status'](_0x5c8195);return _0x158fe8[_0x4994('0x28')](_0x4994('0x29'),_0x5d0492+'-'+_0x22b525+'/'+_0x279aab)[_0x4994('0x2a')](_0x1cd7c3);}return null;};}function saveUpdates(_0x408a03){return function(_0x252ac8){if(_0x252ac8){return _0x252ac8[_0x4994('0x2b')](_0x408a03)['then'](function(_0x5d4f80){return _0x5d4f80;});}return null;};}function removeEntity(_0x1ec75a){return function(_0x30a7eb){if(_0x30a7eb){return _0x30a7eb[_0x4994('0x2c')]()[_0x4994('0x17')](function(){var _0x1ac13a=_0x30a7eb[_0x4994('0x2d')]({'plain':!![]});var _0x1e90ea=_0x4994('0x2e');return db[_0x4994('0x2f')]['destroy']({'where':{'type':_0x1e90ea,'resourceId':_0x1ac13a['id']}})[_0x4994('0x17')](function(){return _0x30a7eb;});})[_0x4994('0x17')](function(){_0x1ec75a[_0x4994('0x22')](0xcc)[_0x4994('0x23')]();});}};}function handleEntityNotFound(_0x513cd3){return function(_0x2b40a6){if(!_0x2b40a6){_0x513cd3['sendStatus'](0x194);}return _0x2b40a6;};}function handleError(_0x3431d2,_0x918041){_0x918041=_0x918041||0x1f4;return function(_0x357543){logger[_0x4994('0x1d')](_0x357543['stack']);if(_0x357543[_0x4994('0x30')]){delete _0x357543[_0x4994('0x30')];}_0x3431d2[_0x4994('0x22')](_0x918041)['send'](_0x357543);};}function iftimePromise(_0x59f43d,_0x478e6b){return respondWithRpcPromise(_0x4994('0x31'),_0x4994('0x32'),{'command':_0x478e6b[_0x4994('0x33')]?util[_0x4994('0x34')]('iftime\x20%s,%s',_0x59f43d['interval'],_0x478e6b[_0x4994('0x33')]):util[_0x4994('0x34')](_0x4994('0x35'),_0x59f43d['interval'])},client9002)[_0x4994('0x17')](function(_0x507f7b){var _0x198b64=_0x507f7b&&_0x507f7b[_0x4994('0x36')]('true')>=0x0?!![]:![];logger[_0x4994('0x18')](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],_0x198b64?_0x4994('0x39'):_0x4994('0x3a'),_0x478e6b[_0x4994('0x33')]?_0x478e6b[_0x4994('0x33')]:_0x4994('0x3b'));return _0x198b64;})[_0x4994('0x20')](function(_0x1ccad7){logger['error'](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],util[_0x4994('0x3c')](_0x1ccad7,{'showHidden':![],'depth':null}),_0x478e6b['timezone']?_0x478e6b['timezone']:_0x4994('0x3b'));return![];});}function checkWebsiteIntervals(_0x5182b0){var _0x52f334=_[_0x4994('0x3d')](_0x5182b0[_0x4994('0x3e')]['Intervals'],function(_0x1e8a2d){var _0x1bb36a=_0x1e8a2d[_0x4994('0x2d')]({'plain':!![]});return iftimePromise(_0x1bb36a,_0x5182b0);});return Promise[_0x4994('0x3f')](_0x52f334)[_0x4994('0x17')](function(_0x222d61){return _[_0x4994('0x40')](_0x222d61);});}function createInteractionObject(_0x11766c,_0x342876,_0x40ac64,_0x154a53){var _0x215dff=require(_0x4994('0x41'));var _0x1ae37d=new _0x215dff();var _0x298932=_0x1ae37d[_0x4994('0x42')](_0x40ac64['user-agent'])[_0x4994('0x43')]();var _0x24e263=_0x342876[_0x4994('0x44')];if(_0x40ac64[_0x4994('0x45')]){_0x24e263=_0x40ac64[_0x4994('0x45')];}else if(_0x40ac64[_0x4994('0x46')]){_0x24e263=_[_0x4994('0x47')](_0x40ac64[_0x4994('0x46')][_0x4994('0x48')](','));}return{'ContactId':_0x154a53['id'],'ChatWebsiteId':_0x11766c,'from':(_0x154a53[_0x4994('0x49')]||'')+'\x20'+(_0x154a53['lastName']||''),'customerIp':_0x24e263,'customerPort':_0x40ac64[_0x4994('0x4a')]?_0x40ac64['x-real-port']:null,'referer':_0x342876[_0x4994('0x4b')],'browserName':_0x298932['browser'][_0x4994('0x30')]&&_0x298932[_0x4994('0x4c')][_0x4994('0x4d')]?util['format'](_0x4994('0x4e'),_0x298932['browser']['name'],_0x298932['browser'][_0x4994('0x4d')]):_0x4994('0x4f'),'browserVersion':_0x298932['browser']['version']||_0x4994('0x4f'),'osName':util[_0x4994('0x34')](_0x4994('0x4e'),_0x298932['os'][_0x4994('0x30')],_0x298932['os']['version']),'osVersion':_0x298932['os'][_0x4994('0x4d')],'deviceModel':_0x298932[_0x4994('0x50')][_0x4994('0x51')]&&_0x298932['device'][_0x4994('0x52')]?util[_0x4994('0x34')](_0x4994('0x53'),_0x298932['device'][_0x4994('0x51')],_0x298932[_0x4994('0x50')][_0x4994('0x52')],_0x298932[_0x4994('0x50')][_0x4994('0x54')]):null,'deviceVendor':_0x298932[_0x4994('0x50')][_0x4994('0x52')],'deviceType':_0x298932['device'][_0x4994('0x54')],'formData':JSON[_0x4994('0x1c')](_0x342876)};}exports[_0x4994('0x55')]=function(_0x3da4f4,_0x7cd695){var _0x23d2f0={'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x39193d={},_0x2db1b2={'count':0x0,'rows':[]};var _0x115d7d=_[_0x4994('0x3d')](db['ChatWebsite']['rawAttributes'],function(_0x54cfe3){return{'name':_0x54cfe3[_0x4994('0x58')],'type':_0x54cfe3['type'][_0x4994('0x59')]};});_0x39193d[_0x4994('0x51')]=_['map'](_0x115d7d,'name');_0x39193d[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3da4f4['query']);_0x39193d[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x39193d[_0x4994('0x51')],_0x39193d['query']);_0x23d2f0['attributes']=_['intersection'](_0x39193d['model'],qs[_0x4994('0x5e')](_0x3da4f4['query'][_0x4994('0x5e')]));_0x23d2f0[_0x4994('0x5f')]=_0x23d2f0[_0x4994('0x5f')][_0x4994('0x60')]?_0x23d2f0[_0x4994('0x5f')]:_0x39193d['model'];if(!_0x3da4f4[_0x4994('0x5a')]['hasOwnProperty']('nolimit')){_0x23d2f0[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3da4f4['query'][_0x4994('0x26')]);_0x23d2f0[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3da4f4[_0x4994('0x5a')][_0x4994('0x24')]);}_0x23d2f0[_0x4994('0x61')]=qs['sort'](_0x3da4f4['query'][_0x4994('0x62')]);_0x23d2f0[_0x4994('0x63')]=qs['filters'](_['pick'](_0x3da4f4['query'],_0x39193d[_0x4994('0x5c')]),_0x115d7d);if(_0x3da4f4['query'][_0x4994('0x64')]){_0x23d2f0[_0x4994('0x63')]=_[_0x4994('0x65')](_0x23d2f0['where'],{'$or':_[_0x4994('0x3d')](_0x115d7d,function(_0x3d18e1){if(_0x3d18e1['type']!=='VIRTUAL'){var _0xb5845d={};_0xb5845d[_0x3d18e1[_0x4994('0x30')]]={'$like':'%'+_0x3da4f4[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0xb5845d;}})});}_0x23d2f0=_[_0x4994('0x65')]({},_0x23d2f0,_0x3da4f4['options']);var _0x4ebba7={'where':_0x23d2f0['where']};return db[_0x4994('0x66')][_0x4994('0x27')](_0x4ebba7)[_0x4994('0x17')](function(_0x20e102){_0x2db1b2[_0x4994('0x27')]=_0x20e102;if(_0x3da4f4['query'][_0x4994('0x67')]){_0x23d2f0[_0x4994('0x68')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4994('0x69')](_0x23d2f0);})['then'](function(_0x191699){_0x2db1b2[_0x4994('0x6a')]=_0x191699;return _0x2db1b2;})[_0x4994('0x17')](respondWithFilteredResult(_0x7cd695,_0x23d2f0))['catch'](handleError(_0x7cd695,null));};exports['show']=function(_0x52d8e4,_0x3105db){var _0x59c7a4={'raw':![],'where':{'id':_0x52d8e4[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x2361e5={};_0x2361e5[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x66')][_0x4994('0x6c')]);_0x2361e5[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x52d8e4[_0x4994('0x5a')]);_0x2361e5[_0x4994('0x5c')]=_['intersection'](_0x2361e5['model'],_0x2361e5[_0x4994('0x5a')]);_0x59c7a4[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2361e5[_0x4994('0x51')],qs['fields'](_0x52d8e4[_0x4994('0x5a')][_0x4994('0x5e')]));_0x59c7a4[_0x4994('0x5f')]=_0x59c7a4[_0x4994('0x5f')][_0x4994('0x60')]?_0x59c7a4[_0x4994('0x5f')]:_0x2361e5[_0x4994('0x51')];if(_0x52d8e4['query'][_0x4994('0x67')]){_0x59c7a4['include']=[{'all':!![]}];}_0x59c7a4=_[_0x4994('0x65')]({},_0x59c7a4,_0x52d8e4['options']);return db['ChatWebsite']['find'](_0x59c7a4)[_0x4994('0x17')](handleEntityNotFound(_0x3105db,null))[_0x4994('0x17')](respondWithResult(_0x3105db,null))[_0x4994('0x20')](handleError(_0x3105db,null));};exports[_0x4994('0x6d')]=function(_0x473d68,_0x2279f6){return db[_0x4994('0x66')][_0x4994('0x6d')](_0x473d68[_0x4994('0x6e')],{})[_0x4994('0x17')](function(_0x4b9095){var _0x24eaff=_0x473d68[_0x4994('0x6f')][_0x4994('0x2d')]({'plain':!![]});if(!_0x24eaff)throw new Error(_0x4994('0x70'));if(_0x24eaff[_0x4994('0x71')]===_0x4994('0x6f')){var _0x55b8c4=_0x4b9095[_0x4994('0x2d')]({'plain':!![]});var _0x21b622=_0x4994('0x2e');return db[_0x4994('0x72')]['find']({'where':{'name':_0x21b622,'userProfileId':_0x24eaff['userProfileId']},'raw':!![]})[_0x4994('0x17')](function(_0x3362c7){if(_0x3362c7&&_0x3362c7[_0x4994('0x73')]===0x0){return db[_0x4994('0x2f')][_0x4994('0x6d')]({'name':_0x55b8c4[_0x4994('0x30')],'resourceId':_0x55b8c4['id'],'type':_0x3362c7['name'],'sectionId':_0x3362c7['id']},{})[_0x4994('0x17')](function(){return _0x4b9095;});}else{return _0x4b9095;}})[_0x4994('0x20')](function(_0xd8762f){logger[_0x4994('0x1d')](_0x4994('0x74'),_0xd8762f);throw _0xd8762f;});}return _0x4b9095;})[_0x4994('0x17')](respondWithResult(_0x2279f6,0xc9))[_0x4994('0x20')](handleError(_0x2279f6,null));};exports['update']=function(_0x40b194,_0xad7d04){if(_0x40b194[_0x4994('0x6e')]['id']){delete _0x40b194[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x40b194['params']['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]})[_0x4994('0x17')](handleEntityNotFound(_0xad7d04,null))[_0x4994('0x17')](saveUpdates(_0x40b194[_0x4994('0x6e')],null))['then'](respondWithResult(_0xad7d04,null))[_0x4994('0x20')](handleError(_0xad7d04,null));};exports[_0x4994('0x2c')]=function(_0x471a01,_0x401046){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x471a01[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x401046,null))[_0x4994('0x17')](removeEntity(_0x401046,null))[_0x4994('0x20')](handleError(_0x401046,null));};exports[_0x4994('0x76')]=function(_0xd66338,_0x308030){return db['ChatWebsite'][_0x4994('0x76')]()[_0x4994('0x17')](respondWithResult(_0x308030,null))[_0x4994('0x20')](handleError(_0x308030,null));};exports['addDisposition']=function(_0x4399a9,_0x5d4e70){if(_0x4399a9[_0x4994('0x6e')]['id']){delete _0x4399a9[_0x4994('0x6e')]['id'];}return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x4399a9[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x5d4e70,null))[_0x4994('0x17')](function(_0x3a8261){if(_0x3a8261){_0x4399a9['body'][_0x4994('0x77')]=_0x3a8261['id'];return db[_0x4994('0x78')][_0x4994('0x6d')](_0x4399a9[_0x4994('0x6e')]);}})['then'](respondWithResult(_0x5d4e70,null))[_0x4994('0x20')](handleError(_0x5d4e70,null));};exports[_0x4994('0x79')]=function(_0x3761c0,_0x22aa0f){var _0x2c9884={'raw':![],'where':{}};var _0x5ef0c0={};var _0x1363b7={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3761c0['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x22aa0f,null))[_0x4994('0x17')](function(_0x414f94){if(_0x414f94){_0x5ef0c0[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x78')][_0x4994('0x6c')]);_0x5ef0c0[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3761c0['query']);_0x5ef0c0[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5ef0c0['model'],_0x5ef0c0[_0x4994('0x5a')]);_0x2c9884[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x5ef0c0[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x3761c0[_0x4994('0x5a')]['fields']));_0x2c9884[_0x4994('0x5f')]=_0x2c9884['attributes'][_0x4994('0x60')]?_0x2c9884[_0x4994('0x5f')]:_0x5ef0c0[_0x4994('0x51')];if(!_0x3761c0[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x2c9884[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3761c0[_0x4994('0x5a')][_0x4994('0x26')]);_0x2c9884[_0x4994('0x24')]=qs['offset'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x24')]);}_0x2c9884[_0x4994('0x61')]=qs['sort'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x62')]);_0x2c9884[_0x4994('0x63')]=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3761c0['query'],_0x5ef0c0[_0x4994('0x5c')]));_0x2c9884['where'][_0x4994('0x77')]=_0x414f94['id'];if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x64')]){_0x2c9884[_0x4994('0x63')]=_['merge'](_0x2c9884[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x2c9884[_0x4994('0x5f')],function(_0x588162){var _0x277f76={};_0x277f76[_0x588162]={'$like':'%'+_0x3761c0[_0x4994('0x5a')]['filter']+'%'};return _0x277f76;})});}_0x2c9884=_[_0x4994('0x65')]({},_0x2c9884,_0x3761c0[_0x4994('0x7e')]);return db[_0x4994('0x78')][_0x4994('0x27')]({'where':_0x2c9884[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x42095c){_0x1363b7['count']=_0x42095c;if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x67')]){_0x2c9884[_0x4994('0x68')]=[{'all':!![]}];}return db['Disposition'][_0x4994('0x69')](_0x2c9884);})[_0x4994('0x17')](function(_0x43551b){_0x1363b7['rows']=_0x43551b;return _0x1363b7;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x22aa0f,_0x2c9884))[_0x4994('0x20')](handleError(_0x22aa0f,null));};exports[_0x4994('0x7f')]=function(_0x36108f,_0x327513){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x36108f[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x327513,null))[_0x4994('0x17')](function(_0x1c22f4){if(_0x1c22f4){return _0x1c22f4[_0x4994('0x7f')](_0x36108f[_0x4994('0x5a')][_0x4994('0x80')]);}})[_0x4994('0x17')](respondWithStatusCode(_0x327513,null))[_0x4994('0x20')](handleError(_0x327513,null));};exports[_0x4994('0x81')]=function(_0x171a61,_0x3f69f0){if(_0x171a61[_0x4994('0x6e')]['id']){delete _0x171a61[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')]['find']({'where':{'id':_0x171a61[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3f69f0,null))[_0x4994('0x17')](function(_0x1eb162){if(_0x1eb162){_0x171a61[_0x4994('0x6e')][_0x4994('0x77')]=_0x1eb162['id'];return db[_0x4994('0x82')][_0x4994('0x6d')](_0x171a61[_0x4994('0x6e')]);}})[_0x4994('0x17')](respondWithResult(_0x3f69f0,null))['catch'](handleError(_0x3f69f0,null));};exports[_0x4994('0x83')]=function(_0x42cdd6,_0x4fb9ef){var _0x10cffe={'raw':![],'where':{}};var _0x2cd432={};var _0x5e3285={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x42cdd6[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4fb9ef,null))[_0x4994('0x17')](function(_0x1366e3){if(_0x1366e3){_0x2cd432[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x82')][_0x4994('0x6c')]);_0x2cd432['query']=_[_0x4994('0x5b')](_0x42cdd6[_0x4994('0x5a')]);_0x2cd432['filters']=_['intersection'](_0x2cd432[_0x4994('0x51')],_0x2cd432['query']);_0x10cffe[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2cd432['model'],qs[_0x4994('0x5e')](_0x42cdd6[_0x4994('0x5a')]['fields']));_0x10cffe['attributes']=_0x10cffe['attributes'][_0x4994('0x60')]?_0x10cffe['attributes']:_0x2cd432[_0x4994('0x51')];if(!_0x42cdd6[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x10cffe[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x26')]);_0x10cffe['offset']=qs[_0x4994('0x24')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x24')]);}_0x10cffe[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x62')]);_0x10cffe[_0x4994('0x63')]=qs[_0x4994('0x5c')](_['pick'](_0x42cdd6['query'],_0x2cd432['filters']));_0x10cffe[_0x4994('0x63')][_0x4994('0x77')]=_0x1366e3['id'];if(_0x42cdd6[_0x4994('0x5a')]['filter']){_0x10cffe['where']=_[_0x4994('0x65')](_0x10cffe[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x10cffe['attributes'],function(_0x3a9a79){var _0x3deb9d={};_0x3deb9d[_0x3a9a79]={'$like':'%'+_0x42cdd6[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x3deb9d;})});}_0x10cffe=_['merge']({},_0x10cffe,_0x42cdd6[_0x4994('0x7e')]);return db[_0x4994('0x82')][_0x4994('0x27')]({'where':_0x10cffe[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x9329b7){_0x5e3285[_0x4994('0x27')]=_0x9329b7;if(_0x42cdd6[_0x4994('0x5a')][_0x4994('0x67')]){_0x10cffe[_0x4994('0x68')]=[{'all':!![]}];}return db[_0x4994('0x82')][_0x4994('0x69')](_0x10cffe);})[_0x4994('0x17')](function(_0x5cea1b){_0x5e3285[_0x4994('0x6a')]=_0x5cea1b;return _0x5e3285;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x4fb9ef,_0x10cffe))[_0x4994('0x20')](handleError(_0x4fb9ef,null));};exports[_0x4994('0x84')]=function(_0xd9865,_0x7269f9){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xd9865[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x7269f9,null))[_0x4994('0x17')](function(_0x5ef3b7){if(_0x5ef3b7){return _0x5ef3b7['removeAnswers'](_0xd9865['query']['ids']);}})[_0x4994('0x17')](respondWithStatusCode(_0x7269f9,null))[_0x4994('0x20')](handleError(_0x7269f9,null));};exports[_0x4994('0x85')]=function(_0x73a51c,_0xef88f4){_0x73a51c[_0x4994('0x6e')][_0x4994('0x86')]=_0x73a51c[_0x4994('0x87')][_0x4994('0x88')];return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x73a51c[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0xef88f4,null))[_0x4994('0x17')](saveUpdates(_0x73a51c[_0x4994('0x6e')],null))[_0x4994('0x17')](respondWithResult(_0xef88f4,null))['catch'](handleError(_0xef88f4,null));};exports[_0x4994('0x89')]=function(_0x2c672d,_0x49a131){_0x2c672d[_0x4994('0x6e')]['agentAvatar']=_0x2c672d[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x2c672d['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x49a131,null))['then'](saveUpdates(_0x2c672d['body'],null))[_0x4994('0x17')](respondWithResult(_0x49a131,null))[_0x4994('0x20')](handleError(_0x49a131,null));};exports['addCustomerAvatar']=function(_0xb62458,_0x3ae9f5){_0xb62458['body'][_0x4994('0x8a')]=_0xb62458[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xb62458['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3ae9f5,null))[_0x4994('0x17')](saveUpdates(_0xb62458[_0x4994('0x6e')],null))['then'](respondWithResult(_0x3ae9f5,null))['catch'](handleError(_0x3ae9f5,null));};exports[_0x4994('0x8b')]=function(_0x4efb77,_0x561e7d){_0x4efb77[_0x4994('0x6e')][_0x4994('0x8c')]=_0x4efb77[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')]['find']({'where':{'id':_0x4efb77[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x561e7d,null))['then'](saveUpdates(_0x4efb77['body'],null))['then'](respondWithResult(_0x561e7d,null))[_0x4994('0x20')](handleError(_0x561e7d,null));};exports[_0x4994('0x8d')]=function(_0x454649,_0x102206){var _0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x90'));var _0xd61309={'where':{'id':_0x454649[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x86')],'raw':!![]};var _0xa0eb0=![];return require(_0x4994('0x91'))[_0x4994('0x92')]()[_0x4994('0x17')](function(_0x5460b9){if(_0x5460b9){_0xa0eb0=_0x5460b9[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0x66')]['find'](_0xd61309);})['then'](handleEntityNotFound(_0x102206,null))[_0x4994('0x17')](function(_0x52233b){if(_0x52233b){if(!_[_0x4994('0x94')](_0x52233b['sitepic'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b['sitepic']))&&_0xa0eb0){_0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b[_0x4994('0x86')]);}}return _0x102206[_0x4994('0x97')](_0x32792f);}})[_0x4994('0x20')](handleError(_0x102206,null));};exports['getAvatar']=function(_0x1669d0,_0x158bb8){var _0x3d7f3b=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x98'));var _0x33974e={'where':{'id':_0x1669d0[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x99')],'raw':!![]};return db[_0x4994('0x66')][_0x4994('0x75')](_0x33974e)[_0x4994('0x17')](handleEntityNotFound(_0x158bb8,null))['then'](function(_0x40c2b5){if(_0x40c2b5){if(!_[_0x4994('0x94')](_0x40c2b5[_0x4994('0x99')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]))){_0x3d7f3b=path['join'](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]);}}return _0x158bb8['download'](_0x3d7f3b);}})['catch'](handleError(_0x158bb8,null));};exports['getCustomerAvatar']=function(_0x2a7dfa,_0x13d3ba){var _0x819237=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9b'));var _0x45f61a={'where':{'id':_0x2a7dfa[_0x4994('0x6b')]['id']},'attributes':['id','customerAvatar',_0x4994('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x4994('0x75')](_0x45f61a)[_0x4994('0x17')](handleEntityNotFound(_0x13d3ba,null))['then'](function(_0x24b6b8){if(_0x24b6b8){if(!_[_0x4994('0x94')](_0x24b6b8['customerAvatar'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]))&&_0x24b6b8[_0x4994('0x9c')]){_0x819237=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]);}}return _0x13d3ba['download'](_0x819237);}})[_0x4994('0x20')](handleError(_0x13d3ba,null));};exports[_0x4994('0x9d')]=function(_0x4eeb52,_0x232253){var _0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9e'));var _0x1af2fc={'where':{'id':_0x4eeb52['params']['id']},'attributes':['id',_0x4994('0x8c')],'raw':!![]};return db[_0x4994('0x66')]['find'](_0x1af2fc)['then'](handleEntityNotFound(_0x232253,null))[_0x4994('0x17')](function(_0x22c959){if(_0x22c959){if(!_[_0x4994('0x94')](_0x22c959[_0x4994('0x8c')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]))){_0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]);}}return _0x232253[_0x4994('0x97')](_0x216999);}})['catch'](handleError(_0x232253,null));};exports[_0x4994('0x9f')]=function(_0x152624,_0x24c7fd){var _0x234026={'body':_0x152624[_0x4994('0x6e')],'channel':_0x4994('0xa0')};var _0x4a50f9=[];var _0x406d9e=[];var _0x11cb69={};var _0x57de26=![];return db['CmContact'][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x3a21cb){if(!_0x3a21cb){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x4a50f9=_['difference'](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5')]);_0x406d9e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5'),_0x4994('0xa7'),_0x4994('0xa8')]);if(_0x152624[_0x4994('0x6e')]['id']){delete _0x152624['body']['id'];}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['from'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory');}if(_[_0x4994('0x94')](_0x152624['body'][_0x4994('0x6e')])||_0x152624[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['mapKey'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa9')+_0x406d9e);}if(!_[_0x4994('0xaa')](_0x406d9e,_0x152624[_0x4994('0x6e')][_0x4994('0xab')])){throw new db[(_0x4994('0xa1'))]['ValidationError'](_0x4994('0xac')+_0x406d9e);}_0x11cb69[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x152624[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0xae')],'as':_0x4994('0xaf'),'include':[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xb1'),'where':_0x11cb69,'limit':0x1,'order':[[_0x4994('0xa5'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4994('0xb2')},{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id',_0x4994('0x38')],'raw':!![]}]}]});})[_0x4994('0x17')](function(_0x582557){if(!_0x582557)throw new APINotFoundError(util['format'](_0x4994('0xb4'),_0x152624[_0x4994('0x6b')]['id']));if(!_0x582557[_0x4994('0x3e')]||!_0x582557[_0x4994('0x3e')][_0x4994('0xb3')])return[_0x582557,!![]];return[_0x582557,checkWebsiteIntervals(_0x582557)];})[_0x4994('0xb5')](function(_0x30217c,_0x46a59e){if(!_0x46a59e)throw new APIOutOfIntervalError();if(!_0x30217c[_0x4994('0xaf')])return;_0x234026[_0x4994('0xb6')]=_0x30217c;_0x234026[_0x4994('0xb7')]=_0x30217c[_0x4994('0xaf')];_0x234026[_0x4994('0xb8')]=_[_0x4994('0xb9')](_0x30217c[_0x4994('0xb2')],[_0x4994('0xba')],[_0x4994('0xbb')]);if(_0x234026[_0x4994('0xb6')]['Applications']){delete _0x234026['account'][_0x4994('0xb2')];}if(_0x234026[_0x4994('0xb6')][_0x4994('0xaf')]&&_0x234026['account'][_0x4994('0xaf')][_0x4994('0xb1')][_0x4994('0x60')]){return _0x234026[_0x4994('0xb6')][_0x4994('0xaf')][_0x4994('0xb1')][0x0];}var _0x5ac49=_[_0x4994('0x10')](_0x152624[_0x4994('0x6e')],{'firstName':_0x152624[_0x4994('0x6e')][_0x4994('0xad')],'ListId':_0x30217c[_0x4994('0xa8')]});_0x5ac49[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624['body'][_0x4994('0xad')];return db[_0x4994('0xb0')]['create'](_0x5ac49,{'fields':_0x4a50f9,'raw':!![]});})['then'](function(_0x4b6843){_0x234026['contact']=_0x4b6843;var _0x33e30b=createInteractionObject(_0x152624[_0x4994('0x6b')]['id'],_0x152624[_0x4994('0x6e')],_0x152624[_0x4994('0xbc')],_0x4b6843);var _0x18ea85={'ChatWebsiteId':_0x152624[_0x4994('0x6b')]['id'],'closed':![]};if(_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]){_0x18ea85['threadId']=_0x152624[_0x4994('0x6e')][_0x4994('0xbd')];return db[_0x4994('0xbe')]['find']({'where':_0x18ea85})[_0x4994('0x17')](function(_0x3b8d03){if(_0x3b8d03){_0x57de26=!![];return _0x3b8d03;}_0x33e30b[_0x4994('0xbd')]=_0x152624['body']['threadId'];_0x33e30b[_0x4994('0xbf')]=_0x152624[_0x4994('0x6e')][_0x4994('0xbf')];return db[_0x4994('0xbe')]['create'](_0x33e30b);});}_0x18ea85['ContactId']=_0x4b6843['id'];if(_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]['id']){_0x18ea85['id']=_0x152624['body'][_0x4994('0xc0')]['id'];return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':_0x18ea85})['then'](function(_0x29c20e){if(_0x29c20e){_0x57de26=!![];return _0x29c20e;}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);});}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);})['then'](function(_0x9c5e94){if(!_0x57de26)return _0x9c5e94;var _0x9905a={'from':(_0x234026[_0x4994('0xc1')][_0x4994('0x49')]||'')+'\x20'+(_0x234026[_0x4994('0xc1')][_0x4994('0xc2')]||'')};if(_0x152624['body']['threadId']&&_0x152624[_0x4994('0x6e')][_0x4994('0xc3')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]!=_0x152624[_0x4994('0x6e')]['messageId']){_0x9905a[_0x4994('0xbd')]=_0x152624['body'][_0x4994('0xc3')];}return _0x9c5e94[_0x4994('0x2b')](_0x9905a);})['then'](function(_0x580168){_0x234026[_0x4994('0xc0')]=_0x580168['get']({'plain':!![]});_0x234026[_0x4994('0xc0')][_0x4994('0xc4')]=!_0x57de26;if(_0x234026[_0x4994('0xc0')]['created']){if(_0x234026[_0x4994('0xb6')][_0x4994('0xc5')]){_0x234026[_0x4994('0xb8')]['push']({'id':0x0,'priority':_0x234026[_0x4994('0xb8')][_0x4994('0x60')]+0x1,'app':_0x4994('0xc6'),'appdata':_0x4994('0xc7'),'interval':_0x4994('0xc8')});}}return db[_0x4994('0xc9')][_0x4994('0x6d')]({'body':_0x152624[_0x4994('0x6e')][_0x4994('0x6e')],'ChatWebsiteId':_0x152624['params']['id'],'ChatInteractionId':_0x580168['id'],'direction':'in','ContactId':_0x234026[_0x4994('0xc1')]['id'],'AttachmentId':_0x152624[_0x4994('0x6e')]['AttachmentId']});})[_0x4994('0x17')](function(_0x4314fd){_0x234026[_0x4994('0x1e')]=_0x4314fd;if(!_0x234026[_0x4994('0xc0')]['UserId']){return;}return db['User'][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026[_0x4994('0xc0')][_0x4994('0xca')]}});})[_0x4994('0x17')](function(_0x242040){if(_0x242040){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x0,'app':_0x4994('0xcc'),'appdata':_0x242040['name']+','+(_0x234026['account'][_0x4994('0xcd')]||0xa),'interval':_0x4994('0xc8')});_0x234026[_0x4994('0xce')]=!![];}if(!_0x234026[_0x4994('0xc0')][_0x4994('0xcf')]){return;}return db[_0x4994('0xd0')][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026['interaction']['queueId']}});})['then'](function(_0x464283){if(_0x464283){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x1,'app':_0x4994('0xd1'),'appdata':_0x464283[_0x4994('0x30')]+','+(_0x234026[_0x4994('0xb6')][_0x4994('0xd2')]||0x12c),'interval':_0x4994('0xc8')});}return respondWithRpcPromise(_0x4994('0xd3'),'startRouting',_0x234026);})['then'](function(_0x363cfc){respondWithRpcPromise(_0x4994('0xd4'),_0x4994('0xd4'),{'event':_0x4994('0x9f'),'message':_0x363cfc},client9002);return _0x363cfc;})['then'](respondWithResult(_0x24c7fd,null))[_0x4994('0x20')](APIHandleError(_0x24c7fd));};exports['offline']=function(_0x1bcdc6,_0x4010a8){var _0x46f75a,_0x1070a8,_0xf51fc6;var _0x7b727e=[];var _0x21bf56={};var _0x456615=_0x1bcdc6[_0x4994('0xd5')]||[];var _0x54de8c=[];var _0x4b9438;return db[_0x4994('0xb0')][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x4ac490){if(!_0x4ac490){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x7b727e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x4ac490),[_0x4994('0xa4'),_0x4994('0xa5'),'CompanyId',_0x4994('0xa8')]);if(_0x1bcdc6[_0x4994('0x6e')]['id']){delete _0x1bcdc6[_0x4994('0x6e')]['id'];}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')])||_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db['Sequelize'][(_0x4994('0xa2'))](_0x4994('0xd7')));}if(_[_0x4994('0x94')](_0x1bcdc6['body']['mapKeyOffline'])){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xd8')+_0x7b727e));}if(!_[_0x4994('0xaa')](_0x7b727e,_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7b727e));}_0x21bf56[_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x1bcdc6[_0x4994('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x4994('0xaf')},{'model':db[_0x4994('0xda')],'as':_0x4994('0xda')}]});})[_0x4994('0x17')](handleEntityNotFound(_0x4010a8,null))[_0x4994('0x17')](function(_0x51ec8f){if(_0x51ec8f&&_0x51ec8f[_0x4994('0xaf')]){_0x1070a8=_0x51ec8f;var _0x56d3b3=_[_0x4994('0x10')](_0x1bcdc6[_0x4994('0x6e')],{'firstName':_0x1bcdc6[_0x4994('0x6e')]['from'],'phone':_0x1bcdc6[_0x4994('0x6e')]['from'],'ListId':_0x51ec8f['ListId']});_0x56d3b3[_0x1bcdc6['body'][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];return db['CmContact']['findOrCreate']({'where':_0x21bf56,'defaults':_0x56d3b3});}})[_0x4994('0xb5')](function(_0x514f4e){if(_0x514f4e){_0xf51fc6=_0x514f4e;var _0x227f82=fs['readFileSync'](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0xdb')),_0x4994('0xdc'));var _0x313165=ejs['render'](_0x227f82,{'body':_[_0x4994('0xdd')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]),'bodyTitle':_0x1070a8[_0x4994('0xde')]});return db[_0x4994('0xdf')][_0x4994('0x6d')]({'body':_0x313165,'plainBody':htmlToText[_0x4994('0xe0')](_0x313165),'ContactId':_0x514f4e['id'],'ChatWebsiteId':_0x1070a8['id']});}})[_0x4994('0x17')](function(_0x59826d){_0x4b9438=_0x59826d;if(_0x456615[_0x4994('0x60')]){var _0x67fd48=_0x456615[_0x4994('0x3d')](function(_0x56e915){return{'name':_0x56e915[_0x4994('0xe1')],'basename':_0x56e915[_0x4994('0x88')],'type':_0x56e915[_0x4994('0xe2')],'ChatOfflineMessageId':_0x59826d['id']};});_0x54de8c=_0x67fd48[_0x4994('0x3d')](_0x346308=>{var _0x271606={'filename':_0x346308[_0x4994('0x30')],'path':path['join'](config[_0x4994('0x8f')],_0x4994('0xe3'),_0x4994('0xd5'),_0x4994('0xe4'),_0x4994('0xe5'),_0x346308[_0x4994('0xe6')])};return _0x271606;});if(!_0x1070a8[_0x4994('0xe7')]){return db['sequelize'][_0x4994('0xe8')](function(_0x1bcef1){return db[_0x4994('0xe9')][_0x4994('0xea')](_0x67fd48,{'transaction':_0x1bcef1});});}}})[_0x4994('0x17')](function(){if(_0x4b9438){_0x46f75a=_0x4b9438;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4994('0xeb'),'raw':!![],'include':[{'model':db[_0x4994('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x293707){if(_0x293707&&_0x293707['Smtp']&&_0x1070a8[_0x4994('0xed')]&&_0x1070a8[_0x4994('0xee')]){var _0xd6cd54=_0x293707['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4994('0xef'),{'account':_0xd6cd54,'message':{'from':util[_0x4994('0x34')](_0x4994('0xf0'),_0x293707[_0x4994('0x30')],_0x293707[_0x4994('0xf1')]||_0x293707[_0x4994('0xeb')]['user']),'to':_0x1070a8[_0x4994('0xee')],'subject':_0x1070a8['offlineMessageSubject'],'html':_0x46f75a['body'],'attachments':_0x54de8c}},client9003)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0xae376c){logger[_0x4994('0x1d')](_0xae376c);});}})[_0x4994('0x17')](function(){if(_0x1070a8&&_0x1070a8[_0x4994('0xe7')]&&_0x1070a8[_0x4994('0xf2')]){var _0x480db3=[];if(_0x456615[_0x4994('0x60')]){_0x480db3=_0x456615[_0x4994('0x3d')](function(_0x208970){return{'name':_0x208970[_0x4994('0xe1')],'basename':_0x208970[_0x4994('0x88')],'type':_0x208970[_0x4994('0xe2')],'ChatOfflineMessageId':_0x4b9438['id']};});}var _0x5b12a4;if(!_['isNil'](_0x1070a8[_0x4994('0xf3')])){var _0x39c3ce=_['map'](_0x1bcdc6['body'],function(_0x51d051){return _0x51d051;});var _0x20535e=_[_0x4994('0xf4')](_0x39c3ce)[0x0];var _0x49be37=_['mapValues'](_0x20535e,function(_0x1b2ba6){return _0x1b2ba6;});_0x5b12a4=_0x49be37[0x1][_0x1070a8['subjectOffline']];}var _0x5489a0={'from':_0xf51fc6[_0x4994('0xf1')],'firstName':_0xf51fc6[_0x4994('0x49')],'lastName':_0xf51fc6['lastName'],'mapKey':_0x4994('0xf1'),'message':{'from':_0xf51fc6[_0x4994('0xf1')],'to':_0x1070a8[_0x4994('0xda')][_0x4994('0xf1')],'cc':'','subject':_['isNil'](_0x5b12a4)?_0x1070a8[_0x4994('0xf5')]:_0x5b12a4,'messageId':'','sentAt':new Date(),'attach':_0x480db3[_0x4994('0x60')],'attachments':_0x480db3,'originChannel':_0x4994('0xf6'),'ChatWebsiteId':_0x1070a8['id'],'ChatOfflineMessageId':_0x46f75a['id'],'originTo':_0x1070a8['MailAccount'][_0x4994('0xf1')]},'body':_0x46f75a[_0x4994('0x6e')]};var _0x45b368={'account':{'id':_0x1070a8['MailAccountId']},'body':_0x5489a0,'log':_0x4994('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0x4994('0xf8'),_0x45b368,client9001)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0x49ebac){logger[_0x4994('0x1d')](_0x49ebac);});}return;})[_0x4994('0x17')](function(){if(_0x46f75a){return _0x46f75a;}})[_0x4994('0x17')](respondWithResult(_0x4010a8,null))['catch'](function(){for(var _0x1aa86e of _0x456615){var _0x1889af=path[_0x4994('0x8e')](config[_0x4994('0x8f')],'server','files',_0x4994('0xe4'),_0x4994('0xe5'),_0x1aa86e[_0x4994('0x88')]);fs_extra[_0x4994('0xf9')](_0x1889af)[_0x4994('0x20')](function(_0x265381){logger['error'](_0x4994('0xfa'),_0x1889af,_0x265381);});}});};exports['addInteraction']=function(_0x53d026,_0x247e6e){return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':{'id':_0x53d026[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x247e6e,null))[_0x4994('0x17')](function(_0x3cf36b){if(_0x3cf36b){return _0x3cf36b[_0x4994('0xfb')](_0x53d026[_0x4994('0x6e')][_0x4994('0x80')],_[_0x4994('0xfc')](_0x53d026[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x247e6e,null))['catch'](handleError(_0x247e6e,null));};exports[_0x4994('0xfd')]=function(_0x3cdc05,_0x331858){var _0x90f17a={'raw':![],'where':{}};var _0x15c927={};var _0x2b4216={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3cdc05[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x331858,null))[_0x4994('0x17')](function(_0x4a0d24){if(_0x4a0d24){_0x15c927[_0x4994('0x51')]=_['keys'](db[_0x4994('0xbe')]['rawAttributes']);_0x15c927[_0x4994('0x5a')]=_['keys'](_0x3cdc05[_0x4994('0x5a')]);_0x15c927[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x15c927[_0x4994('0x51')],_0x15c927[_0x4994('0x5a')]);_0x90f17a['attributes']=_['intersection'](_0x15c927['model'],qs[_0x4994('0x5e')](_0x3cdc05[_0x4994('0x5a')]['fields']));_0x90f17a['attributes']=_0x90f17a[_0x4994('0x5f')][_0x4994('0x60')]?_0x90f17a['attributes']:_0x15c927[_0x4994('0x51')];if(!_0x3cdc05[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x90f17a['limit']=qs[_0x4994('0x26')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x26')]);_0x90f17a[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x24')]);}_0x90f17a[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x3cdc05['query']['sort']);_0x90f17a['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3cdc05[_0x4994('0x5a')],_0x15c927[_0x4994('0x5c')]));_0x90f17a[_0x4994('0x63')][_0x4994('0x77')]=_0x4a0d24['id'];if(_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]){_0x90f17a[_0x4994('0x63')]=_[_0x4994('0x65')](_0x90f17a['where'],{'$or':_[_0x4994('0x3d')](_0x90f17a['attributes'],function(_0x322f25){var _0x299331={};_0x299331[_0x322f25]={'$like':'%'+_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x299331;})});}_0x90f17a=_[_0x4994('0x65')]({},_0x90f17a,_0x3cdc05['options']);return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':_0x90f17a[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x45b3f0){_0x2b4216['count']=_0x45b3f0;if(_0x3cdc05['query'][_0x4994('0x67')]){_0x90f17a[_0x4994('0x68')]=[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xff')],'as':_0x4994('0x100'),'attributes':[_0x4994('0x30'),_0x4994('0x101'),_0x4994('0x102')],'required':![]},{'model':db[_0x4994('0x103')],'as':_0x4994('0x104'),'attributes':['id','name',_0x4994('0x105')],'where':_0x3cdc05[_0x4994('0x5a')][_0x4994('0x106')]?{'id':_0x3cdc05['query'][_0x4994('0x106')]}:undefined,'required':_0x3cdc05[_0x4994('0x5a')]['tag']?!![]:![]}];}return db[_0x4994('0xbe')][_0x4994('0x69')](_0x90f17a);})['then'](function(_0x1ee117){_0x2b4216[_0x4994('0x6a')]=_0x1ee117;return _0x2b4216;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x331858,_0x90f17a))[_0x4994('0x20')](handleError(_0x331858,null));};exports[_0x4994('0x32')]=function(_0x17ef96,_0x245b89){var _0xba8540=0x0;var _0x311f1b=0x0;var _0x3eda07=![];var _0xeb5422;var _0x4b379a;return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x17ef96['params']['id']},'include':[{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x245b89,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0xeb5422=_0x1a3fe7;return _0x1a3fe7[_0x4994('0x107')]({'raw':!![]});}})[_0x4994('0x17')](function(_0x28de10){if(_0xeb5422){if(_0x28de10){_0x4b379a=_0x28de10;}}return require('../../config/license/util')['getLicense']();})[_0x4994('0x17')](function(_0x368a6e){if(_0x368a6e){_0x311f1b=_0x368a6e['virtual'];_0x3eda07=_0x368a6e[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':{'closed':![]}});})[_0x4994('0x17')](function(_0x43043e){_0xba8540=_0x43043e;if(_0x311f1b&&_0x43043e>_0x311f1b){return db[_0x4994('0x108')]['findOne']({'where':{'id':0x1}})[_0x4994('0x17')](function(_0x241a6e){if(_0x241a6e){_0x241a6e[_0x4994('0x109')](_0x4994('0x10a'));}});}})[_0x4994('0x17')](function(){if(!_0xeb5422['Interval']||!_0xeb5422['Interval'][_0x4994('0xb3')])return!![];return checkWebsiteIntervals(_0xeb5422);})[_0x4994('0x17')](function(_0x1fe81a){var _0x41bd91=fs[_0x4994('0x10b')](path[_0x4994('0x8e')](config['root'],_0x4994('0x10c')),'utf8');var _0x249ffb=new url[(_0x4994('0x10d'))](_0xeb5422[_0x4994('0x10e')])[_0x4994('0x10f')];var _0x40a50f=_0x4994('0x110');var _0x3bd881=![];var _0x374109={'chatVersion':_0x40a50f,'chatWebsiteAddressOrigin':_0x249ffb,'remote':_0xeb5422['remote'],'query':querystring[_0x4994('0x1c')](_[_0x4994('0x65')](_0xeb5422['get']({'plain':!![]}),{'customerIp':_0x17ef96['headers'][_0x4994('0x46')]||_0x17ef96[_0x4994('0xbc')][_0x4994('0x111')]||_0x17ef96[_0x4994('0x112')]['remoteAddress']||_0x17ef96['ip'],'referer':_0x17ef96['headers'][_0x4994('0x4b')],'openedInteractions':_0xba8540,'maxInteractions':_0x311f1b,'virtual':_0x3eda07[_0x4994('0x113')],'online':_0x1fe81a,'custom':_0x3eda07}))[_0x4994('0x114')](/'/g,'\x5c\x27')};_0x245b89[_0x4994('0xd6')](ejs[_0x4994('0x115')](Mustache[_0x4994('0x115')](_0x41bd91,_0x374109),{'proactiveActions':_0x4b379a,'alignment':_0xeb5422[_0x4994('0x116')],'verticalAlignment':_0xeb5422[_0x4994('0x117')],'div_color':_0xeb5422[_0x4994('0x105')],'labelText':_0xeb5422[_0x4994('0x118')],'text_color':_0xeb5422[_0x4994('0x119')],'text_button_color':_0xeb5422[_0x4994('0x11a')],'button_color':_0xeb5422['color_button'],'background_color':_0xeb5422[_0x4994('0x11b')],'hideWhenOffline':_0xeb5422[_0x4994('0x11c')],'intervalId':_0xeb5422[_0x4994('0x11d')],'isDevelopment':_0x3bd881,'chatVersion':_0x40a50f}));})[_0x4994('0x20')](handleError(_0x245b89,null));};exports[_0x4994('0x11e')]=function(_0x2c2b5d,_0x247cd7){var _0x1a6855=_0x2c2b5d[_0x4994('0x6b')]['id'];var _0x4c5e74=_0x2c2b5d['body'];var _0x2dfe8d=0xc8;var _0x51e398=null;return db['sequelize'][_0x4994('0xe8')]({'isolationLevel':db['sequelize'][_0x4994('0x11f')][_0x4994('0x120')][_0x4994('0x121')]},function(_0x183239){return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1a6855},'transaction':_0x183239})['then'](function(_0x49473b){if(_0x49473b){return db[_0x4994('0x122')][_0x4994('0x2c')]({'where':{'ChatWebsiteId':_0x1a6855},'transaction':_0x183239})[_0x4994('0x17')](function(){var _0x5e3bfe=_[_0x4994('0x3d')](_0x4c5e74,function(_0x298a08){_0x298a08['ChatWebsiteId']=_0x1a6855;return _0x298a08;});return db[_0x4994('0x122')]['bulkCreate'](_0x5e3bfe,{'transaction':_0x183239});});}else{_0x2dfe8d=0x194;_0x51e398=[];}});})[_0x4994('0x17')](function(){if(_0x2dfe8d!==0x194){return db[_0x4994('0x122')][_0x4994('0x123')]({'where':{'ChatWebsiteId':_0x1a6855},'order':_0x4994('0xba')})[_0x4994('0x17')](function(_0xade7c6){_0x51e398=_0xade7c6;});}})[_0x4994('0x20')](function(_0x346138){_0x2dfe8d=0x1f4;logger[_0x4994('0x1d')](_0x346138[_0x4994('0x124')]);if(_0x346138['name']){delete _0x346138[_0x4994('0x30')];}_0x51e398=_0x346138;})[_0x4994('0x125')](function(){if(_0x51e398===null){_0x247cd7[_0x4994('0x21')](_0x2dfe8d);}else{if(_0x2dfe8d===0x1f4){_0x247cd7['status'](_0x2dfe8d)[_0x4994('0xd6')](_0x51e398);}else{_0x247cd7[_0x4994('0x22')](_0x2dfe8d)['json'](_0x51e398);}}});};exports[_0x4994('0x126')]=function(_0xd6fdbe,_0x1b47d1){var _0x166666={};var _0x40beb2={};var _0x1fd62d;var _0x219cf3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0xd6fdbe['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x1b47d1,null))[_0x4994('0x17')](function(_0x48ea62){if(_0x48ea62){_0x1fd62d=_0x48ea62;_0x40beb2[_0x4994('0x51')]=_[_0x4994('0x5b')](db['ChatApplication']['rawAttributes']);_0x40beb2['query']=_[_0x4994('0x5b')](_0xd6fdbe[_0x4994('0x5a')]);_0x40beb2[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x40beb2['model'],_0x40beb2[_0x4994('0x5a')]);_0x166666[_0x4994('0x5f')]=_['intersection'](_0x40beb2[_0x4994('0x51')],qs[_0x4994('0x5e')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x5e')]));_0x166666['attributes']=_0x166666[_0x4994('0x5f')][_0x4994('0x60')]?_0x166666[_0x4994('0x5f')]:_0x40beb2[_0x4994('0x51')];_0x166666['order']=qs[_0x4994('0x62')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x62')]);_0x166666['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0xd6fdbe[_0x4994('0x5a')],_0x40beb2[_0x4994('0x5c')]));if(_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x64')]){_0x166666[_0x4994('0x63')]=_['merge'](_0x166666[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x166666['attributes'],function(_0x32d8b2){var _0x12b6ce={};_0x12b6ce[_0x32d8b2]={'$like':'%'+_0xd6fdbe['query'][_0x4994('0x64')]+'%'};return _0x12b6ce;})});}_0x166666=_['merge']({},_0x166666,_0xd6fdbe['options']);return _0x1fd62d['getApplications'](_0x166666);}})['then'](function(_0x4529e7){if(_0x4529e7){_0x219cf3=_0x4529e7[_0x4994('0x60')];if(!_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x166666['limit']=qs['limit'](_0xd6fdbe[_0x4994('0x5a')]['limit']);_0x166666[_0x4994('0x24')]=qs[_0x4994('0x24')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x1fd62d[_0x4994('0x126')](_0x166666);}})[_0x4994('0x17')](function(_0x157d34){if(_0x157d34){return _0x157d34?{'count':_0x219cf3,'rows':_0x157d34}:null;}})[_0x4994('0x17')](respondWithResult(_0x1b47d1,null))[_0x4994('0x20')](handleError(_0x1b47d1,null));};exports['addProactiveActions']=function(_0x491582,_0x2063ab){return db['chatProactiveAction'][_0x4994('0x75')]({'where':{'id':_0x491582[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2063ab,null))[_0x4994('0x17')](function(_0x359ac6){if(_0x359ac6){return _0x359ac6['addProactiveActions'](_0x491582[_0x4994('0x6e')]['ids'],_[_0x4994('0xfc')](_0x491582[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x2063ab,null))[_0x4994('0x20')](handleError(_0x2063ab,null));};exports['getProactiveActions']=function(_0x141d27,_0x2e76fd){var _0x30ba11={};var _0x5e6293={};var _0x9124fa;var _0x3dfee3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x141d27[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2e76fd,null))[_0x4994('0x17')](function(_0x5ba198){if(_0x5ba198){_0x9124fa=_0x5ba198;_0x5e6293[_0x4994('0x51')]=_['keys'](db[_0x4994('0x127')][_0x4994('0x6c')]);_0x5e6293[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x141d27[_0x4994('0x5a')]);_0x5e6293[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5e6293[_0x4994('0x51')],_0x5e6293[_0x4994('0x5a')]);_0x30ba11[_0x4994('0x5f')]=_['intersection'](_0x5e6293[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x141d27[_0x4994('0x5a')][_0x4994('0x5e')]));_0x30ba11[_0x4994('0x5f')]=_0x30ba11[_0x4994('0x5f')][_0x4994('0x60')]?_0x30ba11['attributes']:_0x5e6293[_0x4994('0x51')];_0x30ba11['order']=qs[_0x4994('0x62')](_0x141d27['query'][_0x4994('0x62')]);_0x30ba11['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x141d27[_0x4994('0x5a')],_0x5e6293['filters']));if(_0x141d27[_0x4994('0x5a')]['filter']){_0x30ba11[_0x4994('0x63')]=_[_0x4994('0x65')](_0x30ba11[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x30ba11[_0x4994('0x5f')],function(_0x3be37f){var _0x1c1a31={};_0x1c1a31[_0x3be37f]={'$like':'%'+_0x141d27[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x1c1a31;})});}_0x30ba11=_[_0x4994('0x65')]({},_0x30ba11,_0x141d27[_0x4994('0x7e')]);return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x5999a2){if(_0x5999a2){_0x3dfee3=_0x5999a2[_0x4994('0x60')];if(!_0x141d27[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x30ba11[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x141d27[_0x4994('0x5a')]['limit']);_0x30ba11['offset']=qs[_0x4994('0x24')](_0x141d27[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x4cb8fe){if(_0x4cb8fe){return _0x4cb8fe?{'count':_0x3dfee3,'rows':_0x4cb8fe}:null;}})[_0x4994('0x17')](respondWithResult(_0x2e76fd,null))[_0x4994('0x20')](handleError(_0x2e76fd,null));};exports[_0x4994('0x128')]=function(_0x51cc49,_0x30e418){var _0x50031b=_0x51cc49[_0x4994('0x5a')]['online']==='false'?_0x4994('0x129'):_0x4994('0x12a');return db['ChatWebsite'][_0x4994('0x75')]({'attributes':['id',_0x50031b],'where':{'id':_0x51cc49[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x30e418,null))[_0x4994('0x17')](function(_0x5214f5){if(_0x5214f5){var _0x57a913=_0x5214f5[_0x50031b];var _0x4fefe2=_0x57a913&&_0x57a913[_0x4994('0x12b')]?_0x57a913[_0x4994('0x12b')]:[];_0x30e418[_0x4994('0xd6')]({'fromKey':_[_0x4994('0x94')](_0x57a913[_0x4994('0x12c')])?undefined:_0x57a913['fromKey'],'count':_0x4fefe2[_0x4994('0x60')],'rows':_0x4fefe2});}})[_0x4994('0x20')](handleError(_0x30e418,null));};exports[_0x4994('0x12d')]=function(_0x50d7e8,_0x1cabb2){var _0x58de8d={'raw':![],'where':{}};var _0x20bb8c={};var _0x966f40={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x50d7e8[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1cabb2,null))[_0x4994('0x17')](function(_0x12c190){if(_0x12c190){_0x20bb8c[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0xdf')]['rawAttributes']);_0x20bb8c[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x50d7e8[_0x4994('0x5a')]);_0x20bb8c['filters']=_['intersection'](_0x20bb8c[_0x4994('0x51')],_0x20bb8c[_0x4994('0x5a')]);_0x58de8d[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x20bb8c[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x5e')]));_0x58de8d['attributes']=_0x58de8d[_0x4994('0x5f')]['length']?_0x58de8d[_0x4994('0x5f')]:_0x20bb8c['model'];if(!_0x50d7e8[_0x4994('0x5a')][_0x4994('0x7b')]('nolimit')){_0x58de8d['limit']=qs['limit'](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x26')]);_0x58de8d[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x50d7e8['query'][_0x4994('0x24')]);}_0x58de8d[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x62')]);_0x58de8d[_0x4994('0x63')]=qs['filters'](_['pick'](_0x50d7e8[_0x4994('0x5a')],_0x20bb8c[_0x4994('0x5c')]));_0x58de8d['where'][_0x4994('0x77')]=_0x12c190['id'];if(_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]){_0x58de8d['where']=_[_0x4994('0x65')](_0x58de8d[_0x4994('0x63')],{'$or':_['map'](_0x58de8d[_0x4994('0x5f')],function(_0x5e6af8){var _0x4779c9={};_0x4779c9[_0x5e6af8]={'$like':'%'+_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4779c9;})});}_0x58de8d=_[_0x4994('0x65')]({},_0x58de8d,_0x50d7e8[_0x4994('0x7e')]);return db['ChatOfflineMessage'][_0x4994('0x27')]({'where':_0x58de8d[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x2598d6){_0x966f40['count']=_0x2598d6;if(_0x50d7e8['query'][_0x4994('0x67')]){_0x58de8d['include']=[{'all':!![]}];}else{_0x58de8d[_0x4994('0x68')]=[{'model':db['CmContact'],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xe9')],'as':'Attachments','required':![]}];}return db[_0x4994('0xdf')]['findAll'](_0x58de8d);})['then'](function(_0x14236c){_0x966f40[_0x4994('0x6a')]=_0x14236c;return _0x966f40;});}})['then'](respondWithFilteredResult(_0x1cabb2,_0x58de8d))[_0x4994('0x20')](handleError(_0x1cabb2,null));};exports['addAgents']=function(_0x4a5bd5,_0x30b6ac){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x4a5bd5['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x30b6ac,null))[_0x4994('0x17')](function(_0x20fa8c){if(_0x20fa8c){return _0x20fa8c['addAgents'](_0x4a5bd5['body'][_0x4994('0x80')],_[_0x4994('0xfc')](_0x4a5bd5[_0x4994('0x6e')],[_0x4994('0x80'),'id'])||{})[_0x4994('0xb5')](function(_0x16b323){for(var _0x29fce8=0x0;_0x29fce8<_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x4994('0x60')];_0x29fce8+=0x1){socket['emit'](_0x4994('0x12e'),{'UserId':Number(_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x29fce8]),'ChatWebsiteId':Number(_0x4a5bd5[_0x4994('0x6b')]['id'])});}return _0x16b323;});}})[_0x4994('0x17')](respondWithResult(_0x30b6ac,null))[_0x4994('0x20')](handleError(_0x30b6ac,null));};exports[_0x4994('0x12f')]=function(_0x383552,_0xa392e3){return db['ChatWebsite']['find']({'where':{'id':_0x383552['params']['id']}})['then'](handleEntityNotFound(_0xa392e3,null))['then'](function(_0x4cf294){if(_0x4cf294){return _0x4cf294[_0x4994('0x12f')](_0x383552[_0x4994('0x5a')][_0x4994('0x80')])[_0x4994('0x17')](function(){if(_['isArray'](_0x383552['query'][_0x4994('0x80')])){for(var _0x5586e2=0x0;_0x5586e2<_0x383552['query']['ids'][_0x4994('0x60')];_0x5586e2+=0x1){socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')]['ids'][_0x5586e2]),'ChatWebsiteId':Number(_0x383552[_0x4994('0x6b')]['id'])});}}else{socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')][_0x4994('0x80')]),'ChatWebsiteId':Number(_0x383552['params']['id'])});}});}})[_0x4994('0x17')](respondWithStatusCode(_0xa392e3,null))[_0x4994('0x20')](handleError(_0xa392e3,null));};exports[_0x4994('0x132')]=function(_0x1f2c6d,_0x4f5787){var _0x406daa={};var _0x1b3be3={};var _0x3a7177;var _0x430009;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1f2c6d[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4f5787,null))[_0x4994('0x17')](function(_0x4a8bd6){if(_0x4a8bd6){_0x3a7177=_0x4a8bd6;_0x1b3be3['model']=_['keys'](db[_0x4994('0xff')][_0x4994('0x6c')]);_0x1b3be3[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x1f2c6d[_0x4994('0x5a')]);_0x1b3be3[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],_0x1b3be3[_0x4994('0x5a')]);_0x406daa[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],qs['fields'](_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x5e')]));_0x406daa['attributes']=_0x406daa[_0x4994('0x5f')][_0x4994('0x60')]?_0x406daa[_0x4994('0x5f')]:_0x1b3be3['model'];_0x406daa[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x1f2c6d[_0x4994('0x5a')]['sort']);_0x406daa[_0x4994('0x63')]=qs['filters'](_['pick'](_0x1f2c6d[_0x4994('0x5a')],_0x1b3be3[_0x4994('0x5c')]));if(_0x1f2c6d['query'][_0x4994('0x64')]){_0x406daa[_0x4994('0x63')]=_[_0x4994('0x65')](_0x406daa[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x406daa[_0x4994('0x5f')],function(_0xa448){var _0x4dc10b={};_0x4dc10b[_0xa448]={'$like':'%'+_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4dc10b;})});}_0x406daa=_[_0x4994('0x65')]({},_0x406daa,_0x1f2c6d[_0x4994('0x7e')]);return _0x3a7177['getAgents'](_0x406daa);}})['then'](function(_0x1d48fc){if(_0x1d48fc){_0x430009=_0x1d48fc[_0x4994('0x60')];if(!_0x1f2c6d['query'][_0x4994('0x7b')](_0x4994('0x7c'))){_0x406daa[_0x4994('0x26')]=qs['limit'](_0x1f2c6d[_0x4994('0x5a')]['limit']);_0x406daa['offset']=qs['offset'](_0x1f2c6d['query'][_0x4994('0x24')]);}return _0x3a7177[_0x4994('0x132')](_0x406daa);}})[_0x4994('0x17')](function(_0x582c7a){if(_0x582c7a){return _0x582c7a?{'count':_0x430009,'rows':_0x582c7a}:null;}})[_0x4994('0x17')](respondWithResult(_0x4f5787,null))[_0x4994('0x20')](handleError(_0x4f5787,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index fbbc3c9..b82d80f 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 _0xb90d=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xb90d,0x17a));var _0xdb90=function(_0x27e86e,_0x49d030){_0x27e86e=_0x27e86e-0x0;var _0x57d83e=_0xb90d[_0x27e86e];return _0x57d83e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdb90('0x0'))['db'][_0xdb90('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdb90('0x2')](0x0);var events={'afterCreate':_0xdb90('0x3'),'afterUpdate':_0xdb90('0x4'),'afterDestroy':_0xdb90('0x5')};function emitEvent(_0x4a9a1f){return function(_0x3db22e,_0x12db41,_0x1b7d75){ChatWebsiteEvents['emit'](_0x4a9a1f+':'+_0x3db22e['id'],_0x3db22e);ChatWebsiteEvents['emit'](_0x4a9a1f,_0x3db22e);_0x1b7d75(null);};}for(var e in events){if(events[_0xdb90('0x6')](e)){var event=events[e];ChatWebsite[_0xdb90('0x7')](e,emitEvent(event));}}module[_0xdb90('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0xd0d541,_0x4cf939){var _0x488821=function(_0x5e01e3){while(--_0x5e01e3){_0xd0d541['push'](_0xd0d541['shift']());}};_0x488821(++_0x4cf939);}(_0xd246,0xf5));var _0x6d24=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0xd246[_0x4eeca4];return _0x430031;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index bef4379..fbdd643 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 _0x95bc=['path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x1fdd3e,_0x22735b){var _0x2da065=function(_0x45f972){while(--_0x45f972){_0x1fdd3e['push'](_0x1fdd3e['shift']());}};_0x2da065(++_0x22735b);}(_0x95bc,0x11e));var _0xc95b=function(_0x4276cc,_0x33756c){_0x4276cc=_0x4276cc-0x0;var _0x215fa9=_0x95bc[_0x4276cc];return _0x215fa9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc95b('0x0'))(_0xc95b('0x1'));var moment=require('moment');var BPromise=require(_0xc95b('0x2'));var rp=require(_0xc95b('0x3'));var fs=require('fs');var path=require(_0xc95b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc95b('0x5'));module[_0xc95b('0x6')]=function(_0x16b34b,_0x47de34){return _0x16b34b[_0xc95b('0x7')](_0xc95b('0x8'),attributes,{'tableName':_0xc95b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2d1=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5747b7,_0x365173){var _0x5219a1=function(_0x26325a){while(--_0x26325a){_0x5747b7['push'](_0x5747b7['shift']());}};_0x5219a1(++_0x365173);}(_0xa2d1,0x6f));var _0x1a2d=function(_0x55eb57,_0x1011e2){_0x55eb57=_0x55eb57-0x0;var _0x55ca29=_0xa2d1[_0x55eb57];return _0x55ca29;};'use strict';var _=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var logger=require(_0x1a2d('0x2'))(_0x1a2d('0x3'));var moment=require(_0x1a2d('0x4'));var BPromise=require(_0x1a2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a2d('0x6'));var config=require(_0x1a2d('0x7'));var attributes=require(_0x1a2d('0x8'));module[_0x1a2d('0x9')]=function(_0x45f868,_0x449eb6){return _0x45f868[_0x1a2d('0xa')](_0x1a2d('0xb'),attributes,{'tableName':_0x1a2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4725f4a..7cc5690 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 _0x0e90=['../../config/environment','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','rpc'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x0e90,0x79));var _0x00e9=function(_0x3ea66c,_0x18b856){_0x3ea66c=_0x3ea66c-0x0;var _0x5b6f11=_0x0e90[_0x3ea66c];return _0x5b6f11;};'use strict';var _=require(_0x00e9('0x0'));var util=require(_0x00e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00e9('0x2'));var fs=require('fs');var Redis=require(_0x00e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x00e9('0x4'));var config=require(_0x00e9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x00e9('0x6')]['http']({'port':0x232a});config[_0x00e9('0x7')]=_['defaults'](config[_0x00e9('0x7')],{'host':_0x00e9('0x8'),'port':0x18eb});var socket=require(_0x00e9('0x9'))(new Redis(config[_0x00e9('0x7')]));require(_0x00e9('0xa'))[_0x00e9('0xb')](socket);function respondWithRpcPromise(_0x2ebfed,_0x16580f,_0xbd2a3b){return new BPromise(function(_0x521ff9,_0x38b403){return client[_0x00e9('0xc')](_0x2ebfed,_0xbd2a3b)['then'](function(_0x2f026c){logger[_0x00e9('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x16580f,_0x00e9('0xe'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x16580f,_0x00e9('0xe'),JSON[_0x00e9('0xf')](_0x2f026c));if(_0x2f026c['error']){if(_0x2f026c[_0x00e9('0x10')][_0x00e9('0x11')]===0x1f4){logger['error'](_0x00e9('0x12'),_0x16580f,_0x2f026c[_0x00e9('0x10')][_0x00e9('0x13')]);return _0x38b403(_0x2f026c[_0x00e9('0x10')][_0x00e9('0x13')]);}logger[_0x00e9('0x10')](_0x00e9('0x12'),_0x16580f,_0x2f026c[_0x00e9('0x10')]['message']);return _0x521ff9(_0x2f026c[_0x00e9('0x10')]['message']);}else{logger[_0x00e9('0xd')](_0x00e9('0x12'),_0x16580f,_0x00e9('0xe'));_0x521ff9(_0x2f026c[_0x00e9('0x14')]['message']);}})['catch'](function(_0x4911ab){logger[_0x00e9('0x10')](_0x00e9('0x12'),_0x16580f,_0x4911ab);_0x38b403(_0x4911ab);});});}
\ No newline at end of file
+var _0xf381=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result'];(function(_0x608efe,_0x4516e6){var _0x18f678=function(_0x4b3c7c){while(--_0x4b3c7c){_0x608efe['push'](_0x608efe['shift']());}};_0x18f678(++_0x4516e6);}(_0xf381,0x160));var _0x1f38=function(_0x5078d7,_0x1ff80a){_0x5078d7=_0x5078d7-0x0;var _0x143fee=_0xf381[_0x5078d7];return _0x143fee;};'use strict';var _=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var moment=require(_0x1f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f38('0x3'));var fs=require('fs');var Redis=require(_0x1f38('0x4'));var db=require(_0x1f38('0x5'))['db'];var utils=require(_0x1f38('0x6'));var logger=require('../../config/logger')(_0x1f38('0x7'));var config=require(_0x1f38('0x8'));var jayson=require(_0x1f38('0x9'));var client=jayson[_0x1f38('0xa')][_0x1f38('0xb')]({'port':0x232a});config[_0x1f38('0xc')]=_[_0x1f38('0xd')](config[_0x1f38('0xc')],{'host':_0x1f38('0xe'),'port':0x18eb});var socket=require(_0x1f38('0xf'))(new Redis(config[_0x1f38('0xc')]));require(_0x1f38('0x10'))['register'](socket);function respondWithRpcPromise(_0x27995c,_0x374302,_0x5e94da){return new BPromise(function(_0x44364c,_0x18b8f0){return client[_0x1f38('0x11')](_0x27995c,_0x5e94da)[_0x1f38('0x12')](function(_0x3e1cf8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'),JSON['stringify'](_0x3e1cf8));if(_0x3e1cf8[_0x1f38('0x14')]){if(_0x3e1cf8['error'][_0x1f38('0x15')]===0x1f4){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x3e1cf8[_0x1f38('0x14')]['message']);return _0x18b8f0(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}logger[_0x1f38('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);return _0x44364c(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}else{logger[_0x1f38('0x18')](_0x1f38('0x16'),_0x374302,'request\x20sent');_0x44364c(_0x3e1cf8[_0x1f38('0x19')]['message']);}})[_0x1f38('0x1a')](function(_0x13babe){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x13babe);_0x18b8f0(_0x13babe);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 2da6c8b..d49fded 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 _0x4a40=['update','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x4a40,0xc4));var _0x04a4=function(_0x51f09a,_0x21607f){_0x51f09a=_0x51f09a-0x0;var _0x23aabf=_0x4a40[_0x51f09a];return _0x23aabf;};'use strict';var ChatWebsiteEvents=require(_0x04a4('0x0'));var events=['save',_0x04a4('0x1'),_0x04a4('0x2')];function createListener(_0x2c51fc,_0x68934e){return function(_0x9e22a2){_0x68934e['emit'](_0x2c51fc,_0x9e22a2);};}function removeListener(_0x3966cf,_0x77c490){return function(){ChatWebsiteEvents['removeListener'](_0x3966cf,_0x77c490);};}exports[_0x04a4('0x3')]=function(_0x480027){for(var _0x4f93f2=0x0,_0x143112=events[_0x04a4('0x4')];_0x4f93f2<_0x143112;_0x4f93f2++){var _0x388062=events[_0x4f93f2];var _0x444866=createListener(_0x04a4('0x5')+_0x388062,_0x480027);ChatWebsiteEvents['on'](_0x388062,_0x444866);}};
\ No newline at end of file
+var _0x5839=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x2b9d5c,_0x173518){var _0x37bb93=function(_0x5515cd){while(--_0x5515cd){_0x2b9d5c['push'](_0x2b9d5c['shift']());}};_0x37bb93(++_0x173518);}(_0x5839,0x158));var _0x9583=function(_0x480957,_0x2632b7){_0x480957=_0x480957-0x0;var _0x5101d3=_0x5839[_0x480957];return _0x5101d3;};'use strict';var ChatWebsiteEvents=require(_0x9583('0x0'));var events=[_0x9583('0x1'),_0x9583('0x2'),_0x9583('0x3')];function createListener(_0x1973a3,_0x2dcfb9){return function(_0x3652ee){_0x2dcfb9[_0x9583('0x4')](_0x1973a3,_0x3652ee);};}function removeListener(_0x2a8679,_0xf89270){return function(){ChatWebsiteEvents[_0x9583('0x5')](_0x2a8679,_0xf89270);};}exports[_0x9583('0x6')]=function(_0x32bed7){for(var _0xf16798=0x0,_0x2d2d76=events[_0x9583('0x7')];_0xf16798<_0x2d2d76;_0xf16798++){var _0x1e2720=events[_0xf16798];var _0x57e550=createListener(_0x9583('0x8')+_0x1e2720,_0x32bed7);ChatWebsiteEvents['on'](_0x1e2720,_0x57e550);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index f12314a..538c2a7 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 _0xacc1=['diskStorage','join','root','%s-%s','originalname','file','addLogo','server/files/images/avatars/','format','single','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/interactions','addInteraction','addAgents','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xacc1,0x1f4));var _0x1acc=function(_0x1e2e3b,_0x5d37c0){_0x1e2e3b=_0x1e2e3b-0x0;var _0x21bae3=_0xacc1[_0x1e2e3b];return _0x21bae3;};'use strict';var multer=require('multer');var util=require(_0x1acc('0x0'));var path=require(_0x1acc('0x1'));var timeout=require(_0x1acc('0x2'));var express=require(_0x1acc('0x3'));var router=express[_0x1acc('0x4')]();var fs_extra=require(_0x1acc('0x5'));var auth=require(_0x1acc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x1acc('0x7')](),controller[_0x1acc('0x8')]);router[_0x1acc('0x9')](_0x1acc('0xa'),auth[_0x1acc('0x7')](),controller[_0x1acc('0xb')]);router[_0x1acc('0x9')]('/:id',auth[_0x1acc('0x7')](),controller[_0x1acc('0xc')]);router[_0x1acc('0x9')](_0x1acc('0xd'),auth[_0x1acc('0x7')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1acc('0xe')]);router[_0x1acc('0x9')]('/:id/logo',controller[_0x1acc('0xf')]);router['get'](_0x1acc('0x10'),controller[_0x1acc('0x11')]);router[_0x1acc('0x9')](_0x1acc('0x12'),controller[_0x1acc('0x13')]);router['get'](_0x1acc('0x14'),controller[_0x1acc('0x15')]);router[_0x1acc('0x9')]('/:id/interactions',auth[_0x1acc('0x7')](),controller[_0x1acc('0x16')]);router[_0x1acc('0x9')]('/:id/snippet',controller[_0x1acc('0x17')]);router[_0x1acc('0x9')](_0x1acc('0x18'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x19')]);router[_0x1acc('0x9')](_0x1acc('0x1a'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x1b')]);router['get'](_0x1acc('0x1c'),controller['getFields']);router['get'](_0x1acc('0x1d'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x1e')]);router['get'](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x20')]);router['post']('/',auth[_0x1acc('0x7')](),controller['create']);router[_0x1acc('0x21')](_0x1acc('0xd'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x22')]);router[_0x1acc('0x21')](_0x1acc('0x23'),auth[_0x1acc('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x43a860,_0x5b8378,_0x626f1d){_0x626f1d(null,path[_0x1acc('0x25')](config[_0x1acc('0x26')],'server/files/images/logos/'));},'filename':function(_0x385efc,_0x40fcab,_0x6c4826){_0x6c4826(null,util['format'](_0x1acc('0x27'),Date['now'](),_0x40fcab[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')]('/:id/logo',upload['single'](_0x1acc('0x29')),controller[_0x1acc('0x2a')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x5c4f03,_0x412efa,_0x16fb3f){_0x16fb3f(null,path[_0x1acc('0x25')](config['root'],_0x1acc('0x2b')));},'filename':function(_0x147e4a,_0x355609,_0x2aa899){_0x2aa899(null,util[_0x1acc('0x2c')](_0x1acc('0x27'),Date['now'](),_0x355609[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')](_0x1acc('0x10'),upload[_0x1acc('0x2d')](_0x1acc('0x29')),controller[_0x1acc('0x2e')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x29b211,_0x18a6d8,_0x308b38){_0x308b38(null,path[_0x1acc('0x25')](config['root'],_0x1acc('0x2b')));},'filename':function(_0x500259,_0x588bc4,_0x3a1596){_0x3a1596(null,util[_0x1acc('0x2c')]('%s-%s',Date[_0x1acc('0x2f')](),_0x588bc4[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')](_0x1acc('0x12'),upload['single'](_0x1acc('0x29')),controller[_0x1acc('0x30')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x252d97,_0xf82be6,_0x3ba9a8){_0x3ba9a8(null,path['join'](config['root'],_0x1acc('0x2b')));},'filename':function(_0x3c5902,_0x41e8b0,_0xa1c640){_0xa1c640(null,util[_0x1acc('0x2c')]('%s-%s',Date[_0x1acc('0x2f')](),_0x41e8b0['originalname']));}})});router[_0x1acc('0x21')]('/:id/system_avatar',upload['single']('file'),controller[_0x1acc('0x31')]);router[_0x1acc('0x21')](_0x1acc('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x36e9fb,_0x2e0898,_0x3d4cdf){const _0x3aef3f=path[_0x1acc('0x25')](config[_0x1acc('0x26')],_0x1acc('0x33'),_0x1acc('0x34'),_0x1acc('0x35'));fs_extra['ensureDir'](_0x3aef3f,function(){_0x3d4cdf(null,_0x3aef3f);});},'filename':function(_0x525c5f,_0x2789a8,_0x16f204){const _0x1853f3=_0x2789a8[_0x1acc('0x28')][_0x1acc('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31829b=path[_0x1acc('0x37')](_0x1853f3);const _0x566c28=Date['now']()+'-'+_0x1853f3[_0x1acc('0x36')](_0x31829b,'')+_0x31829b;_0x16f204(null,_0x566c28);}})});router[_0x1acc('0x21')]('/:id/offline',offlineUploadMulter['any'](),controller['offline']);router[_0x1acc('0x21')](_0x1acc('0x38'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x39')]);router['post'](_0x1acc('0x18'),auth[_0x1acc('0x7')](),controller['addApplications']);router[_0x1acc('0x21')](_0x1acc('0x1a'),auth[_0x1acc('0x7')](),controller['addProactiveActions']);router[_0x1acc('0x21')](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x3a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1acc('0x3b')]);router[_0x1acc('0x3c')](_0x1acc('0x3d'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x3e')]);router[_0x1acc('0x3c')](_0x1acc('0xd'),auth['isAuthenticated'](),controller[_0x1acc('0x3f')]);router[_0x1acc('0x3c')](_0x1acc('0x23'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x40')]);router['delete'](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x41')]);module[_0x1acc('0x42')]=router;
\ No newline at end of file
+var _0xb1f8=['originalname','/:id/logo','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now'];(function(_0x5c0dd9,_0x543e97){var _0x51b27e=function(_0x188c6d){while(--_0x188c6d){_0x5c0dd9['push'](_0x5c0dd9['shift']());}};_0x51b27e(++_0x543e97);}(_0xb1f8,0xb2));var _0x8b1f=function(_0x33fa50,_0x281caa){_0x33fa50=_0x33fa50-0x0;var _0x52d1c3=_0xb1f8[_0x33fa50];return _0x52d1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b1f('0x0'));var timeout=require(_0x8b1f('0x1'));var express=require(_0x8b1f('0x2'));var router=express[_0x8b1f('0x3')]();var fs_extra=require(_0x8b1f('0x4'));var auth=require(_0x8b1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b1f('0x6'));var controller=require('./chatWebsite.controller');router[_0x8b1f('0x7')]('/',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x9')]);router[_0x8b1f('0x7')](_0x8b1f('0xa'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xb')]);router['get']('/:id',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xc')]);router['get'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xe')]);router[_0x8b1f('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8b1f('0xf')]);router[_0x8b1f('0x7')]('/:id/logo',controller[_0x8b1f('0x10')]);router[_0x8b1f('0x7')](_0x8b1f('0x11'),controller[_0x8b1f('0x12')]);router[_0x8b1f('0x7')](_0x8b1f('0x13'),controller[_0x8b1f('0x14')]);router[_0x8b1f('0x7')]('/:id/system_avatar',controller[_0x8b1f('0x15')]);router[_0x8b1f('0x7')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x17')]);router[_0x8b1f('0x7')](_0x8b1f('0x18'),controller['getSnippet']);router[_0x8b1f('0x7')](_0x8b1f('0x19'),auth[_0x8b1f('0x8')](),controller['getApplications']);router[_0x8b1f('0x7')](_0x8b1f('0x1a'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1b')]);router[_0x8b1f('0x7')](_0x8b1f('0x1c'),controller[_0x8b1f('0x1d')]);router[_0x8b1f('0x7')](_0x8b1f('0x1e'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1f')]);router[_0x8b1f('0x7')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x21')]);router[_0x8b1f('0x22')]('/',auth[_0x8b1f('0x8')](),controller['create']);router['post'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x23')]);router[_0x8b1f('0x22')](_0x8b1f('0x24'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x25')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5955cc,_0x44625f,_0x18336d){_0x18336d(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x28')));},'filename':function(_0x5f233a,_0x252929,_0x2d1c9e){_0x2d1c9e(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x252929[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x2d'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x30')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x27fca4,_0x485bba,_0x5cd42c){_0x5cd42c(null,path[_0x8b1f('0x27')](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x18f0d2,_0x1e6262,_0x2850f1){_0x2850f1(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x1e6262[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x11'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x33')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0xf73504,_0x6713d,_0x308cbc){_0x308cbc(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x32')));},'filename':function(_0x6afd48,_0x26525b,_0x1f2ff5){_0x1f2ff5(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date['now'](),_0x26525b[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x13'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x34')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5062ca,_0x35a282,_0x5e99e2){_0x5e99e2(null,path['join'](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x22eb34,_0x52b4bb,_0x4be9e9){_0x4be9e9(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x52b4bb[_0x8b1f('0x2c')]));}})});router[_0x8b1f('0x22')](_0x8b1f('0x35'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x36')]);router['post'](_0x8b1f('0x37'),controller[_0x8b1f('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x183942,_0x13cc19,_0x10f4e1){const _0x5ab45c=path[_0x8b1f('0x27')](config['root'],'server/files','attachments',_0x8b1f('0x39'));fs_extra[_0x8b1f('0x3a')](_0x5ab45c,function(){_0x10f4e1(null,_0x5ab45c);});},'filename':function(_0x2eda1c,_0x52f758,_0x84b58b){const _0x4a2fe4=_0x52f758[_0x8b1f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5bfdb2=path['extname'](_0x4a2fe4);const _0xcfd715=Date[_0x8b1f('0x2b')]()+'-'+_0x4a2fe4[_0x8b1f('0x3b')](_0x5bfdb2,'')+_0x5bfdb2;_0x84b58b(null,_0xcfd715);}})});router[_0x8b1f('0x22')](_0x8b1f('0x3c'),offlineUploadMulter[_0x8b1f('0x3d')](),controller[_0x8b1f('0x3e')]);router[_0x8b1f('0x22')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x3f')]);router[_0x8b1f('0x22')]('/:id/applications',auth[_0x8b1f('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x40')]);router[_0x8b1f('0x22')](_0x8b1f('0x20'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x41')]);router[_0x8b1f('0x42')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x44')]);router[_0x8b1f('0x45')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x46')]);router[_0x8b1f('0x45')](_0x8b1f('0xd'),auth['isAuthenticated'](),controller[_0x8b1f('0x47')]);router[_0x8b1f('0x45')](_0x8b1f('0x24'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8b1f('0x45')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x48')]);module[_0x8b1f('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index fa53fab..edd1cb5 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 _0xbf44=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','exports','beaver-logger/server','express','../components/auth/service','Router','env'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbf44,0xd7));var _0x4bf4=function(_0x5ab39b,_0x346b1b){_0x5ab39b=_0x5ab39b-0x0;var _0x3150e2=_0xbf44[_0x5ab39b];return _0x3150e2;};var beaverLogger=require(_0x4bf4('0x0'));var express=require(_0x4bf4('0x1'));var auth=require(_0x4bf4('0x2'));var config=require('../config/environment');var router=express[_0x4bf4('0x3')]();var isProduction=config[_0x4bf4('0x4')]==='production'||![];function clientSideLogs(_0x135d2a,_0x19b229,_0x3c0d3f){var _0x4bd87d=_0x135d2a[_0x4bf4('0x5')]['get'](_0x4bf4('0x6'));if(!_0x4bd87d){throw new Error(_0x4bf4('0x7'));}return beaverLogger[_0x4bf4('0x8')]({'uri':'/client-logs','logger':_0x4bd87d,'enableCors':!isProduction})(_0x135d2a,_0x19b229,_0x3c0d3f);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x4bf4('0x9')]=router;
\ No newline at end of file
+var _0x57b3=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','Router'];(function(_0x125da9,_0x559df9){var _0x1426b4=function(_0x5492b8){while(--_0x5492b8){_0x125da9['push'](_0x125da9['shift']());}};_0x1426b4(++_0x559df9);}(_0x57b3,0x72));var _0x357b=function(_0x5e9b88,_0x320778){_0x5e9b88=_0x5e9b88-0x0;var _0x471af0=_0x57b3[_0x5e9b88];return _0x471af0;};var beaverLogger=require(_0x357b('0x0'));var express=require('express');var auth=require(_0x357b('0x1'));var config=require('../config/environment');var router=express[_0x357b('0x2')]();var isProduction=config[_0x357b('0x3')]===_0x357b('0x4')||![];function clientSideLogs(_0x39a277,_0x10dccf,_0x5aed32){var _0x5d69bd=_0x39a277[_0x357b('0x5')][_0x357b('0x6')](_0x357b('0x7'));if(!_0x5d69bd){throw new Error(_0x357b('0x8'));}return beaverLogger[_0x357b('0x9')]({'uri':_0x357b('0xa'),'logger':_0x5d69bd,'enableCors':!isProduction})(_0x39a277,_0x10dccf,_0x5aed32);}router[_0x357b('0xb')](auth[_0x357b('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 8387e7e..09c2b25 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 _0x0dd8=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x469c7c,_0x4a54c6){var _0x4b8ffa=function(_0x2bff74){while(--_0x2bff74){_0x469c7c['push'](_0x469c7c['shift']());}};_0x4b8ffa(++_0x4a54c6);}(_0x0dd8,0xef));var _0x80dd=function(_0x3c53fe,_0xad83fb){_0x3c53fe=_0x3c53fe-0x0;var _0x1bef0d=_0x0dd8[_0x3c53fe];return _0x1bef0d;};'use strict';var Sequelize=require('sequelize');module[_0x80dd('0x0')]={'name':{'type':Sequelize[_0x80dd('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x80dd('0x2')](_0x80dd('0x3'),_0x80dd('0x4'),_0x80dd('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x80dd('0x6'),_0x80dd('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x80dd('0x8')},'data2':{'type':Sequelize[_0x80dd('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x80dd('0x1')],'comment':_0x80dd('0x9')},'data4':{'type':Sequelize[_0x80dd('0x1')],'comment':_0x80dd('0xa')},'data5':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xc')},'data6':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xd')},'data7':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xe')}};
\ No newline at end of file
+var _0xe6ca=['Google','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x5a04ac,_0x2b8b74){var _0x2406d9=function(_0x3e4237){while(--_0x3e4237){_0x5a04ac['push'](_0x5a04ac['shift']());}};_0x2406d9(++_0x2b8b74);}(_0xe6ca,0xd8));var _0xae6c=function(_0xe69ec7,_0x44d820){_0xe69ec7=_0xe69ec7-0x0;var _0x164d47=_0xe6ca[_0xe69ec7];return _0x164d47;};'use strict';var Sequelize=require(_0xae6c('0x0'));module[_0xae6c('0x1')]={'name':{'type':Sequelize[_0xae6c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xae6c('0x3')](_0xae6c('0x4'),_0xae6c('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xae6c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x7')},'data3':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x8')},'data4':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xa')},'data6':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xae6c('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f1a7689..e472413 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 _0x34f0=['Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','findAll','rows','MicrosoftAzure','decryptString','data3','catch','params','length','include','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','parse','from','state','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message'];(function(_0x17df57,_0x3be05b){var _0x4b58d8=function(_0x2338cd){while(--_0x2338cd){_0x17df57['push'](_0x17df57['shift']());}};_0x4b58d8(++_0x3be05b);}(_0x34f0,0x11c));var _0x034f=function(_0x281a8a,_0x50c6e8){_0x281a8a=_0x281a8a-0x0;var _0xfc2be8=_0x34f0[_0x281a8a];return _0xfc2be8;};'use strict';var _=require('lodash');var Redis=require(_0x034f('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x034f('0x1'));var logger=require(_0x034f('0x2'))(_0x034f('0x3'));var db=require(_0x034f('0x4'))['db'];var oauth=require(_0x034f('0x5'));config[_0x034f('0x6')]=_['defaults'](config[_0x034f('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x034f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x52c438,_0x3c32b9){_0x3c32b9=_0x3c32b9||0xcc;return function(_0x542476){if(_0x542476){return _0x52c438[_0x034f('0x7')](_0x3c32b9);}return _0x52c438[_0x034f('0x8')](_0x3c32b9)['end']();};}function respondWithResult(_0x2934ea,_0x868d41){_0x868d41=_0x868d41||0xc8;return function(_0x4eb486){if(_0x4eb486){return _0x2934ea[_0x034f('0x8')](_0x868d41)[_0x034f('0x9')](_0x4eb486);}};}function respondWithFilteredResult(_0x3a713a,_0x29d1b7){return function(_0x141531){if(_0x141531){var _0x1e2f9b=typeof _0x29d1b7[_0x034f('0xa')]===_0x034f('0xb')&&typeof _0x29d1b7[_0x034f('0xc')]===_0x034f('0xb');var _0x23fb5c=_0x141531[_0x034f('0xd')];var _0x9a577e=_0x1e2f9b?0x0:_0x29d1b7[_0x034f('0xa')];var _0x41e1b0=_0x1e2f9b?_0x141531[_0x034f('0xd')]:_0x29d1b7[_0x034f('0xa')]+_0x29d1b7[_0x034f('0xc')];var _0x33866f;if(_0x41e1b0>=_0x23fb5c){_0x41e1b0=_0x23fb5c;_0x33866f=0xc8;}else{_0x33866f=0xce;}_0x3a713a[_0x034f('0x8')](_0x33866f);return _0x3a713a[_0x034f('0xe')](_0x034f('0xf'),_0x9a577e+'-'+_0x41e1b0+'/'+_0x23fb5c)[_0x034f('0x9')](_0x141531);}return null;};}function saveUpdates(_0x50f5d6){return function(_0x4f40d1){if(_0x4f40d1){return _0x4f40d1[_0x034f('0x10')](_0x50f5d6)[_0x034f('0x11')](function(_0xfce2b7){return _0xfce2b7;});}return null;};}function removeEntity(_0x5c2087){return function(_0x112221){if(_0x112221){return _0x112221['destroy']()['then'](function(){_0x5c2087[_0x034f('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ebc4){return function(_0x137ccc){if(!_0x137ccc){_0x45ebc4['sendStatus'](0x194);}return _0x137ccc;};}function handleError(_0x1c995a,_0x5df401){_0x5df401=_0x5df401||0x1f4;return function(_0x20b951){logger['error'](_0x20b951[_0x034f('0x12')]);if(_0x20b951[_0x034f('0x13')]){delete _0x20b951[_0x034f('0x13')];}_0x1c995a[_0x034f('0x8')](_0x5df401)[_0x034f('0x14')](_0x20b951);};}function maskClientSecret(_0x528600){return _[_0x034f('0x15')](_0x528600[_0x034f('0x16')](0x0,0x3),0x14,'*');}exports[_0x034f('0x17')]=function(_0x55f24c,_0xc24eeb){var _0x5712db={},_0x52887a={},_0x86868={'count':0x0,'rows':[]};var _0x5e5c5b=_[_0x034f('0x18')](db[_0x034f('0x19')][_0x034f('0x1a')],function(_0x464aab){return{'name':_0x464aab[_0x034f('0x1b')],'type':_0x464aab[_0x034f('0x1c')][_0x034f('0x1d')]};});_0x52887a[_0x034f('0x1e')]=_['map'](_0x5e5c5b,_0x034f('0x13'));_0x52887a[_0x034f('0x1f')]=_['keys'](_0x55f24c[_0x034f('0x1f')]);_0x52887a[_0x034f('0x20')]=_['intersection'](_0x52887a[_0x034f('0x1e')],_0x52887a[_0x034f('0x1f')]);_0x5712db[_0x034f('0x21')]=_[_0x034f('0x22')](_0x52887a[_0x034f('0x1e')],qs[_0x034f('0x23')](_0x55f24c['query'][_0x034f('0x23')]));_0x5712db[_0x034f('0x21')]=_0x5712db[_0x034f('0x21')]['length']?_0x5712db[_0x034f('0x21')]:_0x52887a[_0x034f('0x1e')];if(!_0x55f24c[_0x034f('0x1f')][_0x034f('0x24')]('nolimit')){_0x5712db[_0x034f('0xc')]=qs['limit'](_0x55f24c['query'][_0x034f('0xc')]);_0x5712db[_0x034f('0xa')]=qs[_0x034f('0xa')](_0x55f24c[_0x034f('0x1f')][_0x034f('0xa')]);}_0x5712db[_0x034f('0x25')]=qs[_0x034f('0x26')](_0x55f24c['query'][_0x034f('0x26')]);_0x5712db['where']=qs['filters'](_[_0x034f('0x27')](_0x55f24c[_0x034f('0x1f')],_0x52887a['filters']),_0x5e5c5b);if(_0x55f24c[_0x034f('0x1f')]['filter']){_0x5712db['where']=_[_0x034f('0x28')](_0x5712db[_0x034f('0x29')],{'$or':_[_0x034f('0x18')](_0x5e5c5b,function(_0x207388){if(_0x207388[_0x034f('0x1c')]!==_0x034f('0x2a')){var _0x2a049d={};_0x2a049d[_0x207388[_0x034f('0x13')]]={'$like':'%'+_0x55f24c[_0x034f('0x1f')][_0x034f('0x2b')]+'%'};return _0x2a049d;}})});}_0x5712db=_[_0x034f('0x28')]({},_0x5712db,_0x55f24c['options']);var _0x43a66a={'where':_0x5712db[_0x034f('0x29')]};return db['CloudProvider'][_0x034f('0xd')](_0x43a66a)[_0x034f('0x11')](function(_0x53227c){_0x86868[_0x034f('0xd')]=_0x53227c;if(_0x55f24c[_0x034f('0x1f')][_0x034f('0x2c')]){_0x5712db['include']=[{'all':!![]}];}return db['CloudProvider'][_0x034f('0x2d')](_0x5712db);})['then'](function(_0x37a960){_0x86868[_0x034f('0x2e')]=_[_0x034f('0x18')](_0x37a960,function(_0x5d339c){if(_0x5d339c['service']===_0x034f('0x2f')){var _0xe2474e=encryptor[_0x034f('0x30')](_0x5d339c[_0x034f('0x31')]);_0x5d339c[_0x034f('0x31')]=maskClientSecret(_0xe2474e);}return _0x5d339c;});return _0x86868;})[_0x034f('0x11')](respondWithFilteredResult(_0xc24eeb,_0x5712db))[_0x034f('0x32')](handleError(_0xc24eeb,null));};exports['show']=function(_0x4a1278,_0x408fde){var _0x553ba6={'raw':!![],'where':{'id':_0x4a1278[_0x034f('0x33')]['id']}},_0x59c598={};_0x59c598[_0x034f('0x1e')]=_['keys'](db[_0x034f('0x19')][_0x034f('0x1a')]);_0x59c598[_0x034f('0x1f')]=_['keys'](_0x4a1278[_0x034f('0x1f')]);_0x59c598[_0x034f('0x20')]=_['intersection'](_0x59c598[_0x034f('0x1e')],_0x59c598[_0x034f('0x1f')]);_0x553ba6[_0x034f('0x21')]=_[_0x034f('0x22')](_0x59c598[_0x034f('0x1e')],qs['fields'](_0x4a1278[_0x034f('0x1f')][_0x034f('0x23')]));_0x553ba6['attributes']=_0x553ba6[_0x034f('0x21')][_0x034f('0x34')]?_0x553ba6[_0x034f('0x21')]:_0x59c598[_0x034f('0x1e')];if(_0x4a1278['query'][_0x034f('0x2c')]){_0x553ba6[_0x034f('0x35')]=[{'all':!![]}];}_0x553ba6=_['merge']({},_0x553ba6,_0x4a1278[_0x034f('0x36')]);return db[_0x034f('0x19')][_0x034f('0x37')](_0x553ba6)[_0x034f('0x11')](handleEntityNotFound(_0x408fde,null))[_0x034f('0x11')](function(_0xc5dac1){if(_0xc5dac1[_0x034f('0x38')]==='MicrosoftAzure'){var _0x298540=encryptor[_0x034f('0x30')](_0xc5dac1[_0x034f('0x31')]);_0xc5dac1['data3']=maskClientSecret(_0x298540);}return _0xc5dac1;})['then'](respondWithResult(_0x408fde,null))[_0x034f('0x32')](handleError(_0x408fde,null));};exports[_0x034f('0x39')]=function(_0x2203c5,_0x10f78a){if(!_0x2203c5[_0x034f('0x3a')][_0x034f('0x13')])throw new Error(_0x034f('0x3b'));if(!_0x2203c5['body'][_0x034f('0x38')])throw new Error(_0x034f('0x3c'));var _0x4a05f7=db[_0x034f('0x19')]['rawAttributes'][_0x034f('0x38')]['values'];if(!_0x4a05f7[_0x034f('0x3d')](_0x2203c5['body'][_0x034f('0x38')]))throw new Error(_0x034f('0x3e')+_0x4a05f7[_0x034f('0x3f')](',\x20'));if(_0x2203c5['body']['service']===_0x034f('0x2f')&&_0x2203c5[_0x034f('0x3a')][_0x034f('0x31')]){_0x2203c5[_0x034f('0x3a')][_0x034f('0x31')]=encryptor[_0x034f('0x40')](_0x2203c5[_0x034f('0x3a')]['data3']);}return db[_0x034f('0x19')][_0x034f('0x39')](_0x2203c5[_0x034f('0x3a')],{})[_0x034f('0x11')](respondWithResult(_0x10f78a,0xc9))['catch'](handleError(_0x10f78a,null));};exports[_0x034f('0x10')]=function(_0x1a3375,_0x3d31b6){if(_0x1a3375[_0x034f('0x3a')]['id']){delete _0x1a3375[_0x034f('0x3a')]['id'];}return db[_0x034f('0x19')][_0x034f('0x37')]({'where':{'id':_0x1a3375[_0x034f('0x33')]['id']}})[_0x034f('0x11')](handleEntityNotFound(_0x3d31b6,null))['then'](function(_0x4a4c76){if(_0x4a4c76[_0x034f('0x38')]===_0x034f('0x2f')&&_0x1a3375[_0x034f('0x3a')][_0x034f('0x31')]){_0x1a3375[_0x034f('0x3a')][_0x034f('0x31')]=encryptor['encryptString'](_0x1a3375[_0x034f('0x3a')]['data3']);}return _0x4a4c76;})['then'](saveUpdates(_0x1a3375[_0x034f('0x3a')],null))['then'](respondWithResult(_0x3d31b6,null))[_0x034f('0x32')](handleError(_0x3d31b6,null));};exports[_0x034f('0x41')]=function(_0x3b374b,_0x32ecd3){return db[_0x034f('0x19')]['find']({'where':{'id':_0x3b374b[_0x034f('0x33')]['id']}})[_0x034f('0x11')](handleEntityNotFound(_0x32ecd3,null))[_0x034f('0x11')](removeEntity(_0x32ecd3,null))[_0x034f('0x32')](handleError(_0x32ecd3,null));};exports[_0x034f('0x42')]=function(_0x119d6a,_0x2ad1c3){return db['CloudProvider'][_0x034f('0x43')]({'where':{'id':_0x119d6a[_0x034f('0x33')]['id']},'raw':!![]})['then'](function(_0x3c5beb){if(!_0x3c5beb)return _0x2ad1c3[_0x034f('0x7')](0x194);return{'url':oauth[_0x034f('0x44')](_0x3c5beb,_0x119d6a[_0x034f('0x45')]['id'])};})['then'](respondWithResult(_0x2ad1c3,null))[_0x034f('0x32')](handleError(_0x2ad1c3,null));};exports['oauth2MicrosoftCallback']=function(_0x392124,_0x42dcd7){var _0x118763=_0x392124[_0x034f('0x3a')];var _0x40edb8;var _0x3bd282;if(_0x118763[_0x034f('0x46')])throw _0x118763;redis[_0x034f('0x47')](_0x118763['state'])['then'](function(_0x209131){if(!_0x209131)throw new Error('Invalid\x20state\x20parameter');_0x40edb8=JSON[_0x034f('0x48')](_0x209131);var _0x5b5ef0=Buffer[_0x034f('0x49')](_0x118763[_0x034f('0x4a')],'base64')[_0x034f('0x4b')](_0x034f('0x4c'));_0x3bd282=JSON[_0x034f('0x48')](_0x5b5ef0);if(!oauth[_0x034f('0x4d')](_0x118763[_0x034f('0x4e')],_0x40edb8[_0x034f('0x4f')]))throw new Error(_0x034f('0x50'));redis[_0x034f('0x51')](_0x118763[_0x034f('0x4a')]);return oauth[_0x034f('0x52')](_0x118763[_0x034f('0x53')],_0x40edb8);})['then'](function(_0x292ddc){_0x40edb8[_0x034f('0x54')]=_0x292ddc[_0x034f('0x55')];_0x40edb8[_0x034f('0x56')]=_0x292ddc[_0x034f('0x57')];return db[_0x034f('0x19')]['update']({'data5':_0x40edb8[_0x034f('0x54')],'data6':_0x40edb8[_0x034f('0x56')]},{'where':{'id':_0x40edb8['id']}});})[_0x034f('0x11')](function(){oauth['startRefreshInterval'](_0x40edb8);socket[_0x034f('0x58')]('microsoftAuthorization:success',{'id':_0x3bd282['id']});return;})[_0x034f('0x11')](respondWithStatusCode(_0x42dcd7,null))[_0x034f('0x32')](function(_0x59549f){if(_0x3bd282){socket[_0x034f('0x58')](_0x034f('0x59'),{'id':_0x3bd282['id']});}if(!_0x40edb8){logger[_0x034f('0x46')](_0x034f('0x5a'),_0x59549f);return _0x42dcd7['status'](0x1f4)['send'](_0x59549f[_0x034f('0x5b')]);}logger[_0x034f('0x46')](_0x034f('0x5c'),_0x40edb8['id'],JSON[_0x034f('0x5d')](_0x59549f));});};
\ No newline at end of file
+var _0xdc27=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','where','filter','merge','VIRTUAL','options','includeAll','rows','MicrosoftAzure','data3','show','include','service','catch','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','findOne','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','from','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdc27,0x1b4));var _0x7dc2=function(_0x363d9c,_0x40fd02){_0x363d9c=_0x363d9c-0x0;var _0x1d1c0c=_0xdc27[_0x363d9c];return _0x1d1c0c;};'use strict';var _=require(_0x7dc2('0x0'));var Redis=require(_0x7dc2('0x1'));var qs=require(_0x7dc2('0x2'));var encryptor=require(_0x7dc2('0x3'));var config=require(_0x7dc2('0x4'));var logger=require(_0x7dc2('0x5'))(_0x7dc2('0x6'));var db=require(_0x7dc2('0x7'))['db'];var oauth=require(_0x7dc2('0x8'));config[_0x7dc2('0x9')]=_[_0x7dc2('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7dc2('0xb'))(new Redis(config[_0x7dc2('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5b059b,_0xcb6be8){_0xcb6be8=_0xcb6be8||0xcc;return function(_0x1de6ae){if(_0x1de6ae){return _0x5b059b['sendStatus'](_0xcb6be8);}return _0x5b059b[_0x7dc2('0xc')](_0xcb6be8)[_0x7dc2('0xd')]();};}function respondWithResult(_0x1d83fb,_0x52c651){_0x52c651=_0x52c651||0xc8;return function(_0x2d7ed7){if(_0x2d7ed7){return _0x1d83fb[_0x7dc2('0xc')](_0x52c651)[_0x7dc2('0xe')](_0x2d7ed7);}};}function respondWithFilteredResult(_0x3c3017,_0xc7df69){return function(_0x4072c9){if(_0x4072c9){var _0x48da8f=typeof _0xc7df69[_0x7dc2('0xf')]===_0x7dc2('0x10')&&typeof _0xc7df69[_0x7dc2('0x11')]===_0x7dc2('0x10');var _0xc9d90f=_0x4072c9[_0x7dc2('0x12')];var _0x46d2b6=_0x48da8f?0x0:_0xc7df69[_0x7dc2('0xf')];var _0x55e544=_0x48da8f?_0x4072c9[_0x7dc2('0x12')]:_0xc7df69[_0x7dc2('0xf')]+_0xc7df69[_0x7dc2('0x11')];var _0x1f8580;if(_0x55e544>=_0xc9d90f){_0x55e544=_0xc9d90f;_0x1f8580=0xc8;}else{_0x1f8580=0xce;}_0x3c3017['status'](_0x1f8580);return _0x3c3017[_0x7dc2('0x13')](_0x7dc2('0x14'),_0x46d2b6+'-'+_0x55e544+'/'+_0xc9d90f)[_0x7dc2('0xe')](_0x4072c9);}return null;};}function saveUpdates(_0x2ccbc3){return function(_0x2f1731){if(_0x2f1731){return _0x2f1731[_0x7dc2('0x15')](_0x2ccbc3)[_0x7dc2('0x16')](function(_0x189f03){return _0x189f03;});}return null;};}function removeEntity(_0x591839){return function(_0x5075fe){if(_0x5075fe){return _0x5075fe[_0x7dc2('0x17')]()[_0x7dc2('0x16')](function(){_0x591839[_0x7dc2('0xc')](0xcc)[_0x7dc2('0xd')]();});}};}function handleEntityNotFound(_0x5a0478){return function(_0x51c448){if(!_0x51c448){_0x5a0478[_0x7dc2('0x18')](0x194);}return _0x51c448;};}function handleError(_0x2ceed4,_0x43a113){_0x43a113=_0x43a113||0x1f4;return function(_0x4ef7c9){logger[_0x7dc2('0x19')](_0x4ef7c9['stack']);if(_0x4ef7c9[_0x7dc2('0x1a')]){delete _0x4ef7c9[_0x7dc2('0x1a')];}_0x2ceed4[_0x7dc2('0xc')](_0x43a113)[_0x7dc2('0x1b')](_0x4ef7c9);};}function maskClientSecret(_0x357de6){return _['padEnd'](_0x357de6[_0x7dc2('0x1c')](0x0,0x3),0x14,'*');}exports[_0x7dc2('0x1d')]=function(_0x4bdf77,_0x4809e8){var _0x2c3294={},_0x27703d={},_0x2d7b90={'count':0x0,'rows':[]};var _0x35c6a9=_[_0x7dc2('0x1e')](db[_0x7dc2('0x1f')][_0x7dc2('0x20')],function(_0x37d774){return{'name':_0x37d774['fieldName'],'type':_0x37d774[_0x7dc2('0x21')][_0x7dc2('0x22')]};});_0x27703d['model']=_[_0x7dc2('0x1e')](_0x35c6a9,_0x7dc2('0x1a'));_0x27703d[_0x7dc2('0x23')]=_[_0x7dc2('0x24')](_0x4bdf77['query']);_0x27703d[_0x7dc2('0x25')]=_['intersection'](_0x27703d[_0x7dc2('0x26')],_0x27703d[_0x7dc2('0x23')]);_0x2c3294[_0x7dc2('0x27')]=_[_0x7dc2('0x28')](_0x27703d[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x4bdf77[_0x7dc2('0x23')]['fields']));_0x2c3294[_0x7dc2('0x27')]=_0x2c3294[_0x7dc2('0x27')]['length']?_0x2c3294['attributes']:_0x27703d['model'];if(!_0x4bdf77[_0x7dc2('0x23')]['hasOwnProperty'](_0x7dc2('0x2a'))){_0x2c3294['limit']=qs[_0x7dc2('0x11')](_0x4bdf77[_0x7dc2('0x23')]['limit']);_0x2c3294[_0x7dc2('0xf')]=qs[_0x7dc2('0xf')](_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0xf')]);}_0x2c3294['order']=qs['sort'](_0x4bdf77['query']['sort']);_0x2c3294[_0x7dc2('0x2b')]=qs[_0x7dc2('0x25')](_['pick'](_0x4bdf77[_0x7dc2('0x23')],_0x27703d['filters']),_0x35c6a9);if(_0x4bdf77['query'][_0x7dc2('0x2c')]){_0x2c3294['where']=_[_0x7dc2('0x2d')](_0x2c3294[_0x7dc2('0x2b')],{'$or':_[_0x7dc2('0x1e')](_0x35c6a9,function(_0x5cf428){if(_0x5cf428[_0x7dc2('0x21')]!==_0x7dc2('0x2e')){var _0x533177={};_0x533177[_0x5cf428[_0x7dc2('0x1a')]]={'$like':'%'+_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x2c')]+'%'};return _0x533177;}})});}_0x2c3294=_['merge']({},_0x2c3294,_0x4bdf77[_0x7dc2('0x2f')]);var _0x411125={'where':_0x2c3294[_0x7dc2('0x2b')]};return db[_0x7dc2('0x1f')][_0x7dc2('0x12')](_0x411125)[_0x7dc2('0x16')](function(_0x49d9b9){_0x2d7b90[_0x7dc2('0x12')]=_0x49d9b9;if(_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x30')]){_0x2c3294['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2c3294);})[_0x7dc2('0x16')](function(_0x1498f6){_0x2d7b90[_0x7dc2('0x31')]=_[_0x7dc2('0x1e')](_0x1498f6,function(_0xda1e8e){if(_0xda1e8e['service']===_0x7dc2('0x32')){var _0xcb1ee1=encryptor['decryptString'](_0xda1e8e['data3']);_0xda1e8e[_0x7dc2('0x33')]=maskClientSecret(_0xcb1ee1);}return _0xda1e8e;});return _0x2d7b90;})[_0x7dc2('0x16')](respondWithFilteredResult(_0x4809e8,_0x2c3294))['catch'](handleError(_0x4809e8,null));};exports[_0x7dc2('0x34')]=function(_0x5ebdb4,_0x3628c7){var _0x4d0ed3={'raw':!![],'where':{'id':_0x5ebdb4['params']['id']}},_0x1f8b88={};_0x1f8b88['model']=_[_0x7dc2('0x24')](db['CloudProvider']['rawAttributes']);_0x1f8b88[_0x7dc2('0x23')]=_['keys'](_0x5ebdb4[_0x7dc2('0x23')]);_0x1f8b88['filters']=_[_0x7dc2('0x28')](_0x1f8b88[_0x7dc2('0x26')],_0x1f8b88[_0x7dc2('0x23')]);_0x4d0ed3[_0x7dc2('0x27')]=_['intersection'](_0x1f8b88[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x5ebdb4[_0x7dc2('0x23')][_0x7dc2('0x29')]));_0x4d0ed3['attributes']=_0x4d0ed3[_0x7dc2('0x27')]['length']?_0x4d0ed3[_0x7dc2('0x27')]:_0x1f8b88['model'];if(_0x5ebdb4['query'][_0x7dc2('0x30')]){_0x4d0ed3[_0x7dc2('0x35')]=[{'all':!![]}];}_0x4d0ed3=_[_0x7dc2('0x2d')]({},_0x4d0ed3,_0x5ebdb4[_0x7dc2('0x2f')]);return db[_0x7dc2('0x1f')]['find'](_0x4d0ed3)[_0x7dc2('0x16')](handleEntityNotFound(_0x3628c7,null))['then'](function(_0x4e1a00){if(_0x4e1a00[_0x7dc2('0x36')]===_0x7dc2('0x32')){var _0x59b8ab=encryptor['decryptString'](_0x4e1a00[_0x7dc2('0x33')]);_0x4e1a00[_0x7dc2('0x33')]=maskClientSecret(_0x59b8ab);}return _0x4e1a00;})[_0x7dc2('0x16')](respondWithResult(_0x3628c7,null))[_0x7dc2('0x37')](handleError(_0x3628c7,null));};exports[_0x7dc2('0x38')]=function(_0x1a49e5,_0x49bcfc){if(!_0x1a49e5['body'][_0x7dc2('0x1a')])throw new Error(_0x7dc2('0x39'));if(!_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5903e4=db[_0x7dc2('0x1f')][_0x7dc2('0x20')][_0x7dc2('0x36')][_0x7dc2('0x3b')];if(!_0x5903e4[_0x7dc2('0x3c')](_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]))throw new Error(_0x7dc2('0x3d')+_0x5903e4[_0x7dc2('0x3e')](',\x20'));if(_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]===_0x7dc2('0x32')&&_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1a49e5[_0x7dc2('0x3a')]['data3']);}return db[_0x7dc2('0x1f')][_0x7dc2('0x38')](_0x1a49e5[_0x7dc2('0x3a')],{})['then'](respondWithResult(_0x49bcfc,0xc9))['catch'](handleError(_0x49bcfc,null));};exports['update']=function(_0x1f2159,_0x505282){if(_0x1f2159['body']['id']){delete _0x1f2159[_0x7dc2('0x3a')]['id'];}return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x1f2159[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x505282,null))[_0x7dc2('0x16')](function(_0x22e619){if(_0x22e619[_0x7dc2('0x36')]==='MicrosoftAzure'&&_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1f2159[_0x7dc2('0x3a')]['data3']);}return _0x22e619;})[_0x7dc2('0x16')](saveUpdates(_0x1f2159[_0x7dc2('0x3a')],null))['then'](respondWithResult(_0x505282,null))['catch'](handleError(_0x505282,null));};exports[_0x7dc2('0x17')]=function(_0x181e7d,_0x415913){return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x181e7d[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x415913,null))['then'](removeEntity(_0x415913,null))[_0x7dc2('0x37')](handleError(_0x415913,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e360e,_0x3ff018){return db[_0x7dc2('0x1f')][_0x7dc2('0x42')]({'where':{'id':_0x2e360e[_0x7dc2('0x41')]['id']},'raw':!![]})[_0x7dc2('0x16')](function(_0x32a48a){if(!_0x32a48a)return _0x3ff018['sendStatus'](0x194);return{'url':oauth[_0x7dc2('0x43')](_0x32a48a,_0x2e360e['user']['id'])};})['then'](respondWithResult(_0x3ff018,null))[_0x7dc2('0x37')](handleError(_0x3ff018,null));};exports['oauth2MicrosoftCallback']=function(_0x3c8fa8,_0x4998b4){var _0x389826=_0x3c8fa8[_0x7dc2('0x3a')];var _0x2311db;var _0x5ba59b;if(_0x389826[_0x7dc2('0x19')])throw _0x389826;redis[_0x7dc2('0x44')](_0x389826['state'])[_0x7dc2('0x16')](function(_0x1a060e){if(!_0x1a060e)throw new Error(_0x7dc2('0x45'));_0x2311db=JSON['parse'](_0x1a060e);var _0x932c35=Buffer[_0x7dc2('0x46')](_0x389826[_0x7dc2('0x47')],_0x7dc2('0x48'))[_0x7dc2('0x49')]('ascii');_0x5ba59b=JSON[_0x7dc2('0x4a')](_0x932c35);if(!oauth[_0x7dc2('0x4b')](_0x389826[_0x7dc2('0x4c')],_0x2311db[_0x7dc2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x389826['state']);return oauth[_0x7dc2('0x4e')](_0x389826[_0x7dc2('0x4f')],_0x2311db);})['then'](function(_0x329803){_0x2311db[_0x7dc2('0x50')]=_0x329803[_0x7dc2('0x51')];_0x2311db[_0x7dc2('0x52')]=_0x329803[_0x7dc2('0x53')];return db[_0x7dc2('0x1f')][_0x7dc2('0x15')]({'data5':_0x2311db[_0x7dc2('0x50')],'data6':_0x2311db[_0x7dc2('0x52')]},{'where':{'id':_0x2311db['id']}});})[_0x7dc2('0x16')](function(){oauth[_0x7dc2('0x54')](_0x2311db);socket[_0x7dc2('0x55')](_0x7dc2('0x56'),{'id':_0x5ba59b['id']});return;})[_0x7dc2('0x16')](respondWithStatusCode(_0x4998b4,null))[_0x7dc2('0x37')](function(_0x57d050){if(_0x5ba59b){socket[_0x7dc2('0x55')](_0x7dc2('0x57'),{'id':_0x5ba59b['id']});}if(!_0x2311db){logger[_0x7dc2('0x19')](_0x7dc2('0x58'),_0x57d050);return _0x4998b4['status'](0x1f4)[_0x7dc2('0x1b')](_0x57d050['message']);}logger[_0x7dc2('0x19')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x2311db['id'],JSON[_0x7dc2('0x59')](_0x57d050));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4b5628d..a6d5e7e 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 _0x2cd9=['moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x5430e3,_0x2a5302){var _0x9b1f0c=function(_0x100a5a){while(--_0x100a5a){_0x5430e3['push'](_0x5430e3['shift']());}};_0x9b1f0c(++_0x2a5302);}(_0x2cd9,0xd8));var _0x92cd=function(_0x446f12,_0x259fb6){_0x446f12=_0x446f12-0x0;var _0xeb88bd=_0x2cd9[_0x446f12];return _0xeb88bd;};'use strict';var _=require(_0x92cd('0x0'));var util=require(_0x92cd('0x1'));var logger=require(_0x92cd('0x2'))(_0x92cd('0x3'));var moment=require(_0x92cd('0x4'));var BPromise=require('bluebird');var rp=require(_0x92cd('0x5'));var fs=require('fs');var path=require(_0x92cd('0x6'));var rimraf=require(_0x92cd('0x7'));var config=require(_0x92cd('0x8'));var attributes=require(_0x92cd('0x9'));module[_0x92cd('0xa')]=function(_0x45470a,_0x15b3c6){return _0x45470a['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa061=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa061,0x194));var _0x1a06=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xa061[_0x1e8f35];return _0x446c13;};'use strict';var _=require('lodash');var util=require(_0x1a06('0x0'));var logger=require(_0x1a06('0x1'))(_0x1a06('0x2'));var moment=require(_0x1a06('0x3'));var BPromise=require(_0x1a06('0x4'));var rp=require(_0x1a06('0x5'));var fs=require('fs');var path=require(_0x1a06('0x6'));var rimraf=require(_0x1a06('0x7'));var config=require(_0x1a06('0x8'));var attributes=require(_0x1a06('0x9'));module['exports']=function(_0x6cd83c,_0xe07b0){return _0x6cd83c[_0x1a06('0xa')](_0x1a06('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 213aa28..75de99b 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 _0x320f=['nonce','login','oauth2Claims','oauth2/','set','stringify','decode','payload','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','POST','{TENANT_ID}','access_token','refresh_token','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','push','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','from','base64','randomBytes','toString','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state'];(function(_0x5d7b60,_0x22ba91){var _0x477343=function(_0x23382f){while(--_0x23382f){_0x5d7b60['push'](_0x5d7b60['shift']());}};_0x477343(++_0x22ba91);}(_0x320f,0xbb));var _0xf320=function(_0x23a0f4,_0x3b89d6){_0x23a0f4=_0x23a0f4-0x0;var _0x3c8691=_0x320f[_0x23a0f4];return _0x3c8691;};'use strict';var _=require('lodash');var crypto=require(_0xf320('0x0'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xf320('0x1'));var util=require(_0xf320('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xf320('0x3'))(_0xf320('0x4'));var schedule=require(_0xf320('0x5'));var db=require(_0xf320('0x6'))['db'];config[_0xf320('0x7')]=_[_0xf320('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf320('0x7')]);var MICROSOFT_AUTH_URL=_0xf320('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf320('0xa'),_0xf320('0xb'),_0xf320('0xc'),_0xf320('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xf320('0xe')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5797c3){var _0x513eb4=_[_0xf320('0xf')](AZURE_AUTH_SCOPES[_0x5797c3[_0xf320('0x10')]]);if(_0x5797c3[_0xf320('0x10')]===_0xf320('0x11'))_0x513eb4[_0xf320('0x12')](_0x5797c3[_0xf320('0x13')]+_0xf320('0x14'));return _0x513eb4['join']('\x20');}function getAccessTokenScope(_0x3a9e19){if(_0x3a9e19[_0xf320('0x10')]===_0xf320('0x15'))return _0xf320('0x16');if(_0x3a9e19[_0xf320('0x10')]===_0xf320('0x11'))return _0x3a9e19['data7']+_0xf320('0x14');}function generateMicrosoftAuthorizationUrl(_0xb5753,_0x382c50){var _0x2a8db9=MICROSOFT_AUTH_URL[_0xf320('0x17')]('{TENANT_ID}',_0xb5753[_0xf320('0x18')]);var _0x1f4089=['code','id_token'];var _0x130063=Buffer[_0xf320('0x19')](JSON['stringify']({'id':_0x382c50}))['toString'](_0xf320('0x1a'));var _0x3118b1=crypto[_0xf320('0x1b')](0x10)[_0xf320('0x1c')]('hex');var _0x5b2813=getAuthorizationScopes(_0xb5753);var _0x526340=[{'key':_0xf320('0x1d'),'value':_0xb5753[_0xf320('0x1e')]},{'key':_0xf320('0x1f'),'value':encodeURIComponent(_0x1f4089['join']('\x20'))},{'key':_0xf320('0x20'),'value':_0xb5753[_0xf320('0x21')]},{'key':_0xf320('0x22'),'value':_0xf320('0x23')},{'key':_0xf320('0x24'),'value':encodeURIComponent(_0x5b2813)},{'key':_0xf320('0x25'),'value':_0x130063},{'key':_0xf320('0x26'),'value':_0x3118b1},{'key':'prompt','value':_0xf320('0x27')}];var _0x1e5dee=_0x2a8db9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf320('0xf')](_0x526340,function(_0x17cf00){return _0x17cf00['key']+'='+_0x17cf00['value'];})['join']('&');_0xb5753[_0xf320('0x28')]={'issuer':_0x2a8db9[_0xf320('0x17')](_0xf320('0x29'),''),'audience':_0xb5753[_0xf320('0x1e')],'state':_0x130063,'nonce':_0x3118b1};redis[_0xf320('0x2a')](_0x130063,JSON[_0xf320('0x2b')](_0xb5753));return _0x1e5dee;}function isValidIdToken(_0x5e56c5,_0xa9b966){try{var _0xd83955=jwt[_0xf320('0x2c')](_0x5e56c5,{'complete':!![]});var _0x513d41=_0xd83955[_0xf320('0x2d')];if(_0x513d41[_0xf320('0x2e')]!==_0xa9b966[_0xf320('0x2f')])return![];if(_0x513d41['aud']!==_0xa9b966[_0xf320('0x30')])return![];if(_0x513d41['nonce']!==_0xa9b966['nonce'])return![];if(moment()[_0xf320('0x31')](moment[_0xf320('0x32')](_0x513d41[_0xf320('0x33')])))return![];return!![];}catch(_0x51b8d5){throw _0x51b8d5;}}function refreshOauth2MicrosoftAccessToken(_0xf3360d){return Promise[_0xf320('0x34')]()[_0xf320('0x35')](function(){if(_0xf3360d[_0xf320('0x36')])return _0xf3360d;return db[_0xf320('0x37')][_0xf320('0x38')]({'where':{'id':_0xf3360d['id']},'raw':!![]});})[_0xf320('0x35')](function(_0xbf5a67){var _0x52a85b={'grant_type':'refresh_token','refresh_token':_0xbf5a67[_0xf320('0x39')],'scope':getAccessTokenScope(_0xbf5a67),'redirect_uri':_0xbf5a67['data4'],'client_id':_0xbf5a67['data1'],'client_secret':encryptor['decryptString'](_0xbf5a67[_0xf320('0x36')])};var _0x5efb35={'method':_0xf320('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf320('0x17')](_0xf320('0x3b'),_0xbf5a67[_0xf320('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x52a85b,'json':!![]};return rp(_0x5efb35);})[_0xf320('0x35')](function(_0xffb4fb){_0xf3360d['data5']=_0xffb4fb[_0xf320('0x3c')];_0xf3360d[_0xf320('0x39')]=_0xffb4fb[_0xf320('0x3d')];return db[_0xf320('0x37')][_0xf320('0x3e')]({'data5':_0xf3360d[_0xf320('0x3f')],'data6':_0xf3360d['data6']},{'where':{'id':_0xf3360d['id']}});})[_0xf320('0x35')](function(){return _0xf3360d;})[_0xf320('0x40')](function(_0x6bb002){logger['error'](_0xf320('0x41'),_0xf3360d['id'],_0x6bb002);});}function getOauth2MicrosoftAccessToken(_0x344cfc,_0x3d169f){var _0x3c58cd={'grant_type':_0xf320('0x42'),'code':_0x344cfc,'scope':getAccessTokenScope(_0x3d169f),'redirect_uri':_0x3d169f[_0xf320('0x21')],'client_id':_0x3d169f[_0xf320('0x1e')],'client_secret':encryptor[_0xf320('0x43')](_0x3d169f['data3'])};var _0x573519={'method':_0xf320('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf320('0x17')](_0xf320('0x3b'),_0x3d169f[_0xf320('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3c58cd,'json':!![]};return rp(_0x573519);}function startRefreshInterval(_0x16b25c){var _0x5191bd=schedule[_0xf320('0x44')];if(_0x5191bd[_0x16b25c['id']])clearInterval(_0x5191bd[_0x16b25c['id']]);_0x5191bd[_0x16b25c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf320('0x45')](this,{'id':_0x16b25c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf320('0x44')]=_0x5191bd;}function startAllRefreshIntervals(){return db[_0xf320('0x37')][_0xf320('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf320('0x35')](function(_0x244636){var _0x5c2b40=_0x244636[_0xf320('0xf')](function(_0x4052cc){return refreshOauth2MicrosoftAccessToken(_0x4052cc)[_0xf320('0x35')](function(_0x1720f6){startRefreshInterval(_0x1720f6);});});return Promise['all'](_0x5c2b40);})['catch'](function(_0x5a744c){var _0x28df0f=_0x5a744c?util[_0xf320('0x47')](_0x5a744c,{'showHidden':![],'depth':null}):'';logger[_0xf320('0x48')](_0xf320('0x49'),_0x28df0f);});}module[_0xf320('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xf65b=['https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','toString','base64','randomBytes','hex','response_type','data4','form_post','scope','state','nonce','login','oauth2Claims','oauth2/','data1','set','stringify','payload','issuer','aud','audience','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','update','error','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join'];(function(_0x3d3c35,_0x4957eb){var _0x1ae732=function(_0x487c49){while(--_0x487c49){_0x3d3c35['push'](_0x3d3c35['shift']());}};_0x1ae732(++_0x4957eb);}(_0xf65b,0x78));var _0xbf65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf65b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf65('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xbf65('0x1'));var Redis=require(_0xbf65('0x2'));var rp=require(_0xbf65('0x3'));var util=require('util');var encryptor=require(_0xbf65('0x4'));var config=require(_0xbf65('0x5'));var logger=require(_0xbf65('0x6'))('api');var schedule=require(_0xbf65('0x7'));var db=require(_0xbf65('0x8'))['db'];config[_0xbf65('0x9')]=_['defaults'](config[_0xbf65('0x9')],{'host':_0xbf65('0xa'),'port':0x18eb});var redis=new Redis(config[_0xbf65('0x9')]);var MICROSOFT_AUTH_URL=_0xbf65('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbf65('0xc'),_0xbf65('0xd'),_0xbf65('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xbf65('0xf'),_0xbf65('0x10')],'Dynamics365':[_0xbf65('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbf65('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xbf65('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3938bc){var _0x2ddf0d=_[_0xbf65('0x13')](AZURE_AUTH_SCOPES[_0x3938bc[_0xbf65('0x14')]]);if(_0x3938bc[_0xbf65('0x14')]===_0xbf65('0x15'))_0x2ddf0d[_0xbf65('0x16')](_0x3938bc[_0xbf65('0x17')]+_0xbf65('0x18'));return _0x2ddf0d[_0xbf65('0x19')]('\x20');}function getAccessTokenScope(_0x62780d){if(_0x62780d['type']==='Outlook365')return _0xbf65('0x1a');if(_0x62780d[_0xbf65('0x14')]==='Dynamics365')return _0x62780d[_0xbf65('0x17')]+_0xbf65('0x18');}function generateMicrosoftAuthorizationUrl(_0x4eeb47,_0xa03291){var _0x5c3441=MICROSOFT_AUTH_URL[_0xbf65('0x1b')]('{TENANT_ID}',_0x4eeb47[_0xbf65('0x1c')]);var _0x4b3a87=[_0xbf65('0x1d'),_0xbf65('0x1e')];var _0x3146e7=Buffer[_0xbf65('0x1f')](JSON['stringify']({'id':_0xa03291}))[_0xbf65('0x20')](_0xbf65('0x21'));var _0x40f866=crypto[_0xbf65('0x22')](0x10)[_0xbf65('0x20')](_0xbf65('0x23'));var _0x3f8cc7=getAuthorizationScopes(_0x4eeb47);var _0x32382f=[{'key':'client_id','value':_0x4eeb47['data1']},{'key':_0xbf65('0x24'),'value':encodeURIComponent(_0x4b3a87[_0xbf65('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x4eeb47[_0xbf65('0x25')]},{'key':'response_mode','value':_0xbf65('0x26')},{'key':_0xbf65('0x27'),'value':encodeURIComponent(_0x3f8cc7)},{'key':_0xbf65('0x28'),'value':_0x3146e7},{'key':_0xbf65('0x29'),'value':_0x40f866},{'key':'prompt','value':_0xbf65('0x2a')}];var _0x247cca=_0x5c3441+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbf65('0x13')](_0x32382f,function(_0x15e705){return _0x15e705['key']+'='+_0x15e705['value'];})['join']('&');_0x4eeb47[_0xbf65('0x2b')]={'issuer':_0x5c3441[_0xbf65('0x1b')](_0xbf65('0x2c'),''),'audience':_0x4eeb47[_0xbf65('0x2d')],'state':_0x3146e7,'nonce':_0x40f866};redis[_0xbf65('0x2e')](_0x3146e7,JSON[_0xbf65('0x2f')](_0x4eeb47));return _0x247cca;}function isValidIdToken(_0x48177c,_0x5da0d5){try{var _0x5e05b9=jwt['decode'](_0x48177c,{'complete':!![]});var _0x3847bf=_0x5e05b9[_0xbf65('0x30')];if(_0x3847bf['iss']!==_0x5da0d5[_0xbf65('0x31')])return![];if(_0x3847bf[_0xbf65('0x32')]!==_0x5da0d5[_0xbf65('0x33')])return![];if(_0x3847bf[_0xbf65('0x29')]!==_0x5da0d5['nonce'])return![];if(moment()['isAfter'](moment[_0xbf65('0x34')](_0x3847bf[_0xbf65('0x35')])))return![];return!![];}catch(_0x1d2aed){throw _0x1d2aed;}}function refreshOauth2MicrosoftAccessToken(_0x52a09c){return Promise['resolve']()[_0xbf65('0x36')](function(){if(_0x52a09c[_0xbf65('0x37')])return _0x52a09c;return db[_0xbf65('0x38')][_0xbf65('0x39')]({'where':{'id':_0x52a09c['id']},'raw':!![]});})['then'](function(_0x35ab4d){var _0x1f958a={'grant_type':_0xbf65('0x3a'),'refresh_token':_0x35ab4d[_0xbf65('0x3b')],'scope':getAccessTokenScope(_0x35ab4d),'redirect_uri':_0x35ab4d[_0xbf65('0x25')],'client_id':_0x35ab4d[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x35ab4d[_0xbf65('0x37')])};var _0x46d0d6={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x35ab4d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f958a,'json':!![]};return rp(_0x46d0d6);})['then'](function(_0xef712a){_0x52a09c[_0xbf65('0x3e')]=_0xef712a[_0xbf65('0x3f')];_0x52a09c[_0xbf65('0x3b')]=_0xef712a[_0xbf65('0x3a')];return db[_0xbf65('0x38')][_0xbf65('0x40')]({'data5':_0x52a09c[_0xbf65('0x3e')],'data6':_0x52a09c['data6']},{'where':{'id':_0x52a09c['id']}});})['then'](function(){return _0x52a09c;})['catch'](function(_0x2ecd4e){logger[_0xbf65('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x52a09c['id'],_0x2ecd4e);});}function getOauth2MicrosoftAccessToken(_0x99bc59,_0x4abf68){var _0x4d712d={'grant_type':'authorization_code','code':_0x99bc59,'scope':getAccessTokenScope(_0x4abf68),'redirect_uri':_0x4abf68[_0xbf65('0x25')],'client_id':_0x4abf68[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x4abf68['data3'])};var _0x577871={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x4abf68[_0xbf65('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d712d,'json':!![]};return rp(_0x577871);}function startRefreshInterval(_0x2941be){var _0x3f01eb=schedule[_0xbf65('0x42')];if(_0x3f01eb[_0x2941be['id']])clearInterval(_0x3f01eb[_0x2941be['id']]);_0x3f01eb[_0x2941be['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbf65('0x43')](this,{'id':_0x2941be['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3f01eb;}function startAllRefreshIntervals(){return db[_0xbf65('0x38')][_0xbf65('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xae8d45){var _0x4ffaf0=_0xae8d45['map'](function(_0x4351a8){return refreshOauth2MicrosoftAccessToken(_0x4351a8)[_0xbf65('0x36')](function(_0x1f3126){startRefreshInterval(_0x1f3126);});});return Promise[_0xbf65('0x45')](_0x4ffaf0);})['catch'](function(_0x22625b){var _0x47a76f=_0x22625b?util[_0xbf65('0x46')](_0x22625b,{'showHidden':![],'depth':null}):'';logger[_0xbf65('0x41')](_0xbf65('0x47'),_0x47a76f);});}module[_0xbf65('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 7ba21c2..1c5966d 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 _0x9e63=['../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x9e63,0x65));var _0x39e6=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9e63[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require(_0x39e6('0x4'));var db=require(_0x39e6('0x5'))['db'];var utils=require(_0x39e6('0x6'));var logger=require(_0x39e6('0x7'))(_0x39e6('0x8'));var config=require(_0x39e6('0x9'));var jayson=require(_0x39e6('0xa'));var client=jayson['client'][_0x39e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2224,_0x3f2fa2,_0x554392){return new BPromise(function(_0x21938f,_0xddc291){return client['request'](_0x3c2224,_0x554392)[_0x39e6('0xc')](function(_0x4ee158){logger['info'](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));logger[_0x39e6('0xf')](_0x39e6('0x10'),_0x3f2fa2,_0x39e6('0xe'),JSON['stringify'](_0x4ee158));if(_0x4ee158['error']){if(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x12')]===0x1f4){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158[_0x39e6('0x11')]['message']);return _0xddc291(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158['error']['message']);return _0x21938f(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}else{logger[_0x39e6('0x14')](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));_0x21938f(_0x4ee158['result'][_0x39e6('0x13')]);}})[_0x39e6('0x15')](function(_0x32ad13){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x32ad13);_0xddc291(_0x32ad13);});});}
\ No newline at end of file
+var _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd05a,0x143));var _0xad05=function(_0x4433f9,_0xa9dd70){_0x4433f9=_0x4433f9-0x0;var _0x1bc092=_0xd05a[_0x4433f9];return _0x1bc092;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 11bac21..3885a40 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x427cb6,_0x55b1af){var _0x30472e=function(_0x411958){while(--_0x411958){_0x427cb6['push'](_0x427cb6['shift']());}};_0x30472e(++_0x55b1af);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x3c03e6,_0x2a7f15){_0x3c03e6=_0x3c03e6-0x0;var _0xf6c0e7=_0x7a54[_0x3c03e6];return _0xf6c0e7;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 54afeb5..9ae73f9 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 _0xc2b0=['STRING','sequelize','name'];(function(_0x5822c6,_0x11d122){var _0x330d31=function(_0x223289){while(--_0x223289){_0x5822c6['push'](_0x5822c6['shift']());}};_0x330d31(++_0x11d122);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0xc2b0[_0x134192];return _0x3cd080;};'use strict';var Sequelize=require(_0x0c2b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0c2b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0c2b('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0c2b('0x2')]},'phone':{'type':Sequelize[_0x0c2b('0x2')]},'fax':{'type':Sequelize[_0x0c2b('0x2')]},'type':{'type':Sequelize[_0x0c2b('0x2')]},'street':{'type':Sequelize[_0x0c2b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0c2b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0c2b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x0c2b('0x2')]},'sPostalCode':{'type':Sequelize[_0x0c2b('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x0c2b('0x2')]},'description':{'type':Sequelize[_0x0c2b('0x2')]}};
\ No newline at end of file
+var _0x47b4=['STRING','name','sequelize'];(function(_0x47c88e,_0x404a49){var _0x301c8c=function(_0x4abf34){while(--_0x4abf34){_0x47c88e['push'](_0x47c88e['shift']());}};_0x301c8c(++_0x404a49);}(_0x47b4,0x1e2));var _0x447b=function(_0x22f215,_0x1e877c){_0x22f215=_0x22f215-0x0;var _0x3971a5=_0x47b4[_0x22f215];return _0x3971a5;};'use strict';var Sequelize=require(_0x447b('0x0'));module['exports']={'name':{'type':Sequelize[_0x447b('0x1')],'unique':_0x447b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x447b('0x1')]},'website':{'type':Sequelize[_0x447b('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x447b('0x1')]},'type':{'type':Sequelize[_0x447b('0x1')]},'street':{'type':Sequelize[_0x447b('0x1')]},'postalCode':{'type':Sequelize[_0x447b('0x1')]},'city':{'type':Sequelize[_0x447b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x447b('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x447b('0x1')]},'sCity':{'type':Sequelize[_0x447b('0x1')]},'sCountry':{'type':Sequelize[_0x447b('0x1')]},'description':{'type':Sequelize[_0x447b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 04bb2fe..2ba454f 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 _0x7ca0=['then','destroy','Companies','error','name','send','index','CmCompany','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','describe','addContacts','CmContact','ids','omit','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x7ca0,0x18d));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07ca('0x0'));var zipdir=require(_0x07ca('0x1'));var jsonpatch=require(_0x07ca('0x2'));var rp=require(_0x07ca('0x3'));var moment=require(_0x07ca('0x4'));var BPromise=require(_0x07ca('0x5'));var Mustache=require('mustache');var util=require(_0x07ca('0x6'));var path=require(_0x07ca('0x7'));var sox=require(_0x07ca('0x8'));var csv=require(_0x07ca('0x9'));var ejs=require(_0x07ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x07ca('0xb'));var squel=require(_0x07ca('0xc'));var crypto=require(_0x07ca('0xd'));var jsforce=require(_0x07ca('0xe'));var deskjs=require(_0x07ca('0xf'));var toCsv=require('to-csv');var querystring=require(_0x07ca('0x10'));var Papa=require(_0x07ca('0x11'));var Redis=require(_0x07ca('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07ca('0x13'));var as=require(_0x07ca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x07ca('0x15'));var utils=require(_0x07ca('0x16'));var config=require(_0x07ca('0x17'));var licenseUtil=require(_0x07ca('0x18'));var db=require(_0x07ca('0x19'))['db'];function respondWithStatusCode(_0x1c8928,_0x328652){_0x328652=_0x328652||0xcc;return function(_0x571746){if(_0x571746){return _0x1c8928['sendStatus'](_0x328652);}return _0x1c8928['status'](_0x328652)[_0x07ca('0x1a')]();};}function respondWithResult(_0x5b4768,_0x5b607f){_0x5b607f=_0x5b607f||0xc8;return function(_0x1c2311){if(_0x1c2311){return _0x5b4768[_0x07ca('0x1b')](_0x5b607f)[_0x07ca('0x1c')](_0x1c2311);}};}function respondWithFilteredResult(_0x362486,_0x1a6149){return function(_0x5acb7b){if(_0x5acb7b){var _0x35d737=typeof _0x1a6149[_0x07ca('0x1d')]===_0x07ca('0x1e')&&typeof _0x1a6149[_0x07ca('0x1f')]===_0x07ca('0x1e');var _0x50e0fa=_0x5acb7b[_0x07ca('0x20')];var _0x57c9c3=_0x35d737?0x0:_0x1a6149['offset'];var _0x5bab6e=_0x35d737?_0x5acb7b[_0x07ca('0x20')]:_0x1a6149[_0x07ca('0x1d')]+_0x1a6149[_0x07ca('0x1f')];var _0x3afd5a;if(_0x5bab6e>=_0x50e0fa){_0x5bab6e=_0x50e0fa;_0x3afd5a=0xc8;}else{_0x3afd5a=0xce;}_0x362486['status'](_0x3afd5a);return _0x362486[_0x07ca('0x21')](_0x07ca('0x22'),_0x57c9c3+'-'+_0x5bab6e+'/'+_0x50e0fa)[_0x07ca('0x1c')](_0x5acb7b);}return null;};}function patchUpdates(_0x22a512){return function(_0x126203){try{jsonpatch[_0x07ca('0x23')](_0x126203,_0x22a512,!![]);}catch(_0x3acf56){return BPromise[_0x07ca('0x24')](_0x3acf56);}return _0x126203['save']();};}function saveUpdates(_0x5a84df,_0x54a48b){return function(_0x2a0013){if(_0x2a0013){return _0x2a0013[_0x07ca('0x25')](_0x5a84df)[_0x07ca('0x26')](function(_0x1e8330){return _0x1e8330;});}return null;};}function removeEntity(_0x3227bb,_0x498eba){return function(_0x3b1bf4){if(_0x3b1bf4){return _0x3b1bf4[_0x07ca('0x27')]()[_0x07ca('0x26')](function(){var _0x31a7cf=_0x3b1bf4['get']({'plain':!![]});var _0x288914=_0x07ca('0x28');return db['UserProfileResource'][_0x07ca('0x27')]({'where':{'type':_0x288914,'resourceId':_0x31a7cf['id']}})[_0x07ca('0x26')](function(){return _0x3b1bf4;});})[_0x07ca('0x26')](function(){_0x3227bb[_0x07ca('0x1b')](0xcc)[_0x07ca('0x1a')]();});}};}function handleEntityNotFound(_0x314ca4,_0xd31b6){return function(_0x44726a){if(!_0x44726a){_0x314ca4['sendStatus'](0x194);}return _0x44726a;};}function handleError(_0x3721f4,_0x5ef15b){_0x5ef15b=_0x5ef15b||0x1f4;return function(_0x395da3){logger[_0x07ca('0x29')](_0x395da3['stack']);if(_0x395da3['name']){delete _0x395da3[_0x07ca('0x2a')];}_0x3721f4[_0x07ca('0x1b')](_0x5ef15b)[_0x07ca('0x2b')](_0x395da3);};}exports[_0x07ca('0x2c')]=function(_0x4ca33c,_0xe47ced){var _0xe859b9={},_0x48f3f0={},_0x3caacd={'count':0x0,'rows':[]};return db[_0x07ca('0x2d')]['describe']()[_0x07ca('0x26')](function(_0xc94936){_0x48f3f0['model']=_['keys'](_0xc94936);_0x48f3f0[_0x07ca('0x2e')]=_['keys'](_0x4ca33c[_0x07ca('0x2e')]);_0x48f3f0[_0x07ca('0x2f')]=_['intersection'](_0x48f3f0[_0x07ca('0x30')],_0x48f3f0[_0x07ca('0x2e')]);_0xe859b9[_0x07ca('0x31')]=_[_0x07ca('0x32')](_0x48f3f0[_0x07ca('0x30')],qs['fields'](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x33')]));_0xe859b9['attributes']=_0xe859b9['attributes'][_0x07ca('0x34')]?_0xe859b9[_0x07ca('0x31')]:_0x48f3f0[_0x07ca('0x30')];if(!_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x35')](_0x07ca('0x36'))){_0xe859b9[_0x07ca('0x1f')]=qs[_0x07ca('0x1f')](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x1f')]);_0xe859b9[_0x07ca('0x1d')]=qs[_0x07ca('0x1d')](_0x4ca33c['query'][_0x07ca('0x1d')]);}_0xe859b9[_0x07ca('0x37')]=qs[_0x07ca('0x38')](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x38')]);_0xe859b9[_0x07ca('0x39')]=qs[_0x07ca('0x2f')](_[_0x07ca('0x3a')](_0x4ca33c[_0x07ca('0x2e')],_0x48f3f0[_0x07ca('0x2f')]),_0xc94936);if(_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x3b')]){_0xe859b9[_0x07ca('0x39')]=_[_0x07ca('0x3c')](_0xe859b9[_0x07ca('0x39')],{'$or':_[_0x07ca('0x3d')](_0xe859b9[_0x07ca('0x31')],function(_0x43c922){var _0x2a0b5a={};_0x2a0b5a[_0x43c922]={'$like':'%'+_0x4ca33c[_0x07ca('0x2e')]['filter']+'%'};return _0x2a0b5a;})});}_0xe859b9=_[_0x07ca('0x3c')]({},_0xe859b9,_0x4ca33c[_0x07ca('0x3e')]);var _0x134331={'where':_0xe859b9['where']};return db[_0x07ca('0x2d')][_0x07ca('0x20')](_0x134331)[_0x07ca('0x26')](function(_0x254f63){_0x3caacd['count']=_0x254f63;if(_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x3f')]){_0xe859b9[_0x07ca('0x40')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0xe859b9);})[_0x07ca('0x26')](function(_0x5a5217){_0x3caacd[_0x07ca('0x41')]=_0x5a5217;return _0x3caacd;})[_0x07ca('0x26')](respondWithFilteredResult(_0xe47ced,_0xe859b9))[_0x07ca('0x42')](handleError(_0xe47ced,null));})[_0x07ca('0x42')](handleError(_0xe47ced,null));};exports[_0x07ca('0x43')]=function(_0x3e10f4,_0x191c29){var _0x2e90d6={'raw':![],'where':{'id':_0x3e10f4[_0x07ca('0x44')]['id']}},_0x3d7c34={};_0x3d7c34[_0x07ca('0x30')]=_[_0x07ca('0x45')](db['CmCompany'][_0x07ca('0x46')]);_0x3d7c34[_0x07ca('0x2e')]=_[_0x07ca('0x45')](_0x3e10f4[_0x07ca('0x2e')]);_0x3d7c34[_0x07ca('0x2f')]=_[_0x07ca('0x32')](_0x3d7c34[_0x07ca('0x30')],_0x3d7c34[_0x07ca('0x2e')]);_0x2e90d6['attributes']=_['intersection'](_0x3d7c34[_0x07ca('0x30')],qs[_0x07ca('0x33')](_0x3e10f4[_0x07ca('0x2e')][_0x07ca('0x33')]));_0x2e90d6[_0x07ca('0x31')]=_0x2e90d6['attributes'][_0x07ca('0x34')]?_0x2e90d6[_0x07ca('0x31')]:_0x3d7c34[_0x07ca('0x30')];if(_0x3e10f4['query']['includeAll']){_0x2e90d6[_0x07ca('0x40')]=[{'all':!![]}];}_0x2e90d6=_[_0x07ca('0x3c')]({},_0x2e90d6,_0x3e10f4[_0x07ca('0x3e')]);return db[_0x07ca('0x2d')][_0x07ca('0x47')](_0x2e90d6)[_0x07ca('0x26')](handleEntityNotFound(_0x191c29,null))[_0x07ca('0x26')](respondWithResult(_0x191c29,null))['catch'](handleError(_0x191c29,null));};exports[_0x07ca('0x48')]=function(_0x3f60d1,_0x1fccfa){return db[_0x07ca('0x2d')][_0x07ca('0x48')](_0x3f60d1[_0x07ca('0x49')],{})[_0x07ca('0x26')](function(_0x5de764){var _0x33b88c=_0x3f60d1[_0x07ca('0x4a')][_0x07ca('0x4b')]({'plain':!![]});if(!_0x33b88c)throw new Error(_0x07ca('0x4c'));if(_0x33b88c[_0x07ca('0x4d')]===_0x07ca('0x4a')){var _0xdb7cd0=_0x5de764[_0x07ca('0x4b')]({'plain':!![]});var _0xfc3128=_0x07ca('0x28');return db['UserProfileSection'][_0x07ca('0x47')]({'where':{'name':_0xfc3128,'userProfileId':_0x33b88c[_0x07ca('0x4e')]},'raw':!![]})[_0x07ca('0x26')](function(_0x5baecd){if(_0x5baecd&&_0x5baecd[_0x07ca('0x4f')]===0x0){return db[_0x07ca('0x50')][_0x07ca('0x48')]({'name':_0xdb7cd0['name'],'resourceId':_0xdb7cd0['id'],'type':_0x5baecd[_0x07ca('0x2a')],'sectionId':_0x5baecd['id']},{})['then'](function(){return _0x5de764;});}else{return _0x5de764;}})[_0x07ca('0x42')](function(_0x1a27f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a27f6);throw _0x1a27f6;});}return _0x5de764;})['then'](respondWithResult(_0x1fccfa,0xc9))[_0x07ca('0x42')](handleError(_0x1fccfa,null));};exports['update']=function(_0x106942,_0x4b2900){if(_0x106942['body']['id']){delete _0x106942[_0x07ca('0x49')]['id'];}return db[_0x07ca('0x2d')][_0x07ca('0x47')]({'where':{'id':_0x106942[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x4b2900,null))[_0x07ca('0x26')](saveUpdates(_0x106942[_0x07ca('0x49')],null))[_0x07ca('0x26')](respondWithResult(_0x4b2900,null))[_0x07ca('0x42')](handleError(_0x4b2900,null));};exports[_0x07ca('0x27')]=function(_0x52111f,_0x4bc1a9){return db[_0x07ca('0x2d')][_0x07ca('0x47')]({'where':{'id':_0x52111f['params']['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x4bc1a9,null))['then'](removeEntity(_0x4bc1a9,null))[_0x07ca('0x42')](handleError(_0x4bc1a9,null));};exports[_0x07ca('0x51')]=function(_0x1729f0,_0x161de3){return db[_0x07ca('0x2d')]['describe']()[_0x07ca('0x26')](respondWithResult(_0x161de3,null))[_0x07ca('0x42')](handleError(_0x161de3,null));};exports[_0x07ca('0x52')]=function(_0x341840,_0x42e33d,_0x128772){return db[_0x07ca('0x53')][_0x07ca('0x47')]({'where':{'id':_0x341840[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x42e33d,null))['then'](function(_0x1d5dc6){if(_0x1d5dc6){return _0x1d5dc6[_0x07ca('0x52')](_0x341840['body'][_0x07ca('0x54')],_[_0x07ca('0x55')](_0x341840['body'],[_0x07ca('0x54'),'id'])||{});}})[_0x07ca('0x26')](respondWithResult(_0x42e33d,null))['catch'](handleError(_0x42e33d,null));};exports['getContacts']=function(_0x497520,_0x3a8808,_0x40a5fc){var _0x457d77={};var _0x484909={};var _0x13f980;var _0x4e6678;return db['CmCompany']['findOne']({'where':{'id':_0x497520[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x3a8808,null))[_0x07ca('0x26')](function(_0x6496e5){if(_0x6496e5){_0x13f980=_0x6496e5;_0x484909['model']=_[_0x07ca('0x45')](db[_0x07ca('0x53')][_0x07ca('0x46')]);_0x484909['query']=_[_0x07ca('0x45')](_0x497520[_0x07ca('0x2e')]);_0x484909['filters']=_[_0x07ca('0x32')](_0x484909['model'],_0x484909[_0x07ca('0x2e')]);_0x457d77[_0x07ca('0x31')]=_[_0x07ca('0x32')](_0x484909[_0x07ca('0x30')],qs[_0x07ca('0x33')](_0x497520[_0x07ca('0x2e')][_0x07ca('0x33')]));_0x457d77[_0x07ca('0x31')]=_0x457d77['attributes'][_0x07ca('0x34')]?_0x457d77[_0x07ca('0x31')]:_0x484909[_0x07ca('0x30')];_0x457d77['order']=qs[_0x07ca('0x38')](_0x497520['query'][_0x07ca('0x38')]);_0x457d77[_0x07ca('0x39')]=qs[_0x07ca('0x2f')](_[_0x07ca('0x3a')](_0x497520[_0x07ca('0x2e')],_0x484909[_0x07ca('0x2f')]));if(_0x497520[_0x07ca('0x2e')][_0x07ca('0x3b')]){_0x457d77[_0x07ca('0x39')]=_[_0x07ca('0x3c')](_0x457d77[_0x07ca('0x39')],{'$or':_[_0x07ca('0x3d')](_0x457d77[_0x07ca('0x31')],function(_0x2ad9f9){var _0x1e53c1={};_0x1e53c1[_0x2ad9f9]={'$like':'%'+_0x497520[_0x07ca('0x2e')]['filter']+'%'};return _0x1e53c1;})});}_0x457d77=_[_0x07ca('0x3c')]({},_0x457d77,_0x497520[_0x07ca('0x3e')]);return _0x13f980[_0x07ca('0x56')](_0x457d77);}})['then'](function(_0x4948ff){if(_0x4948ff){_0x4e6678=_0x4948ff[_0x07ca('0x34')];if(!_0x497520['query'][_0x07ca('0x35')](_0x07ca('0x36'))){_0x457d77[_0x07ca('0x1f')]=qs['limit'](_0x497520[_0x07ca('0x2e')][_0x07ca('0x1f')]);_0x457d77[_0x07ca('0x1d')]=qs['offset'](_0x497520[_0x07ca('0x2e')]['offset']);}return _0x13f980[_0x07ca('0x56')](_0x457d77);}})[_0x07ca('0x26')](function(_0x59cbed){if(_0x59cbed){return _0x59cbed?{'count':_0x4e6678,'rows':_0x59cbed}:null;}})[_0x07ca('0x26')](respondWithResult(_0x3a8808,null))[_0x07ca('0x42')](handleError(_0x3a8808,null));};
\ No newline at end of file
+var _0xb835=['query','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmCompany','model','keys'];(function(_0xabfe60,_0x2c61fe){var _0x3aa022=function(_0xcb4e81){while(--_0xcb4e81){_0xabfe60['push'](_0xabfe60['shift']());}};_0x3aa022(++_0x2c61fe);}(_0xb835,0xd3));var _0x5b83=function(_0x5bb1f2,_0x18a496){_0x5bb1f2=_0x5bb1f2-0x0;var _0xc894b5=_0xb835[_0x5bb1f2];return _0xc894b5;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require(_0x5b83('0x1'));var zipdir=require(_0x5b83('0x2'));var jsonpatch=require(_0x5b83('0x3'));var rp=require('request-promise');var moment=require(_0x5b83('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b83('0x5'));var util=require(_0x5b83('0x6'));var path=require(_0x5b83('0x7'));var sox=require('sox');var csv=require(_0x5b83('0x8'));var ejs=require(_0x5b83('0x9'));var fs=require('fs');var fs_extra=require(_0x5b83('0xa'));var _=require(_0x5b83('0xb'));var squel=require(_0x5b83('0xc'));var crypto=require(_0x5b83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b83('0xf'));var Papa=require(_0x5b83('0x10'));var Redis=require(_0x5b83('0x11'));var authService=require(_0x5b83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b83('0x13'));var hardwareService=require(_0x5b83('0x14'));var logger=require('../../config/logger')(_0x5b83('0x15'));var utils=require(_0x5b83('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5b83('0x17'));var db=require(_0x5b83('0x18'))['db'];function respondWithStatusCode(_0x3fdbcc,_0x1405d0){_0x1405d0=_0x1405d0||0xcc;return function(_0x2832d9){if(_0x2832d9){return _0x3fdbcc['sendStatus'](_0x1405d0);}return _0x3fdbcc[_0x5b83('0x19')](_0x1405d0)['end']();};}function respondWithResult(_0x3a457e,_0x3ef26e){_0x3ef26e=_0x3ef26e||0xc8;return function(_0x15009c){if(_0x15009c){return _0x3a457e[_0x5b83('0x19')](_0x3ef26e)[_0x5b83('0x1a')](_0x15009c);}};}function respondWithFilteredResult(_0x425721,_0x16690f){return function(_0x5d3905){if(_0x5d3905){var _0x3bc03b=typeof _0x16690f[_0x5b83('0x1b')]==='undefined'&&typeof _0x16690f[_0x5b83('0x1c')]===_0x5b83('0x1d');var _0x4f71c5=_0x5d3905[_0x5b83('0x1e')];var _0x1fc455=_0x3bc03b?0x0:_0x16690f[_0x5b83('0x1b')];var _0x38d642=_0x3bc03b?_0x5d3905[_0x5b83('0x1e')]:_0x16690f[_0x5b83('0x1b')]+_0x16690f['limit'];var _0x2ffbe2;if(_0x38d642>=_0x4f71c5){_0x38d642=_0x4f71c5;_0x2ffbe2=0xc8;}else{_0x2ffbe2=0xce;}_0x425721['status'](_0x2ffbe2);return _0x425721[_0x5b83('0x1f')](_0x5b83('0x20'),_0x1fc455+'-'+_0x38d642+'/'+_0x4f71c5)['json'](_0x5d3905);}return null;};}function patchUpdates(_0x419ea9){return function(_0x404190){try{jsonpatch[_0x5b83('0x21')](_0x404190,_0x419ea9,!![]);}catch(_0x544920){return BPromise[_0x5b83('0x22')](_0x544920);}return _0x404190[_0x5b83('0x23')]();};}function saveUpdates(_0x208da5,_0x5b3214){return function(_0x20c599){if(_0x20c599){return _0x20c599[_0x5b83('0x24')](_0x208da5)[_0x5b83('0x25')](function(_0x2517e0){return _0x2517e0;});}return null;};}function removeEntity(_0x106c8d,_0x18fa83){return function(_0x5425f2){if(_0x5425f2){return _0x5425f2[_0x5b83('0x26')]()['then'](function(){var _0x247b01=_0x5425f2['get']({'plain':!![]});var _0x5c1f70='Companies';return db[_0x5b83('0x27')]['destroy']({'where':{'type':_0x5c1f70,'resourceId':_0x247b01['id']}})[_0x5b83('0x25')](function(){return _0x5425f2;});})[_0x5b83('0x25')](function(){_0x106c8d[_0x5b83('0x19')](0xcc)[_0x5b83('0x28')]();});}};}function handleEntityNotFound(_0x2123d2,_0x1049e2){return function(_0x366b91){if(!_0x366b91){_0x2123d2[_0x5b83('0x29')](0x194);}return _0x366b91;};}function handleError(_0x5c4ed0,_0x50d8bf){_0x50d8bf=_0x50d8bf||0x1f4;return function(_0xfb5327){logger[_0x5b83('0x2a')](_0xfb5327[_0x5b83('0x2b')]);if(_0xfb5327[_0x5b83('0x2c')]){delete _0xfb5327[_0x5b83('0x2c')];}_0x5c4ed0['status'](_0x50d8bf)[_0x5b83('0x2d')](_0xfb5327);};}exports[_0x5b83('0x2e')]=function(_0xadf965,_0x30beba){var _0x31ce6f={},_0x4d6c34={},_0x12623b={'count':0x0,'rows':[]};return db[_0x5b83('0x2f')]['describe']()[_0x5b83('0x25')](function(_0x22c5be){_0x4d6c34[_0x5b83('0x30')]=_[_0x5b83('0x31')](_0x22c5be);_0x4d6c34[_0x5b83('0x32')]=_[_0x5b83('0x31')](_0xadf965[_0x5b83('0x32')]);_0x4d6c34['filters']=_[_0x5b83('0x33')](_0x4d6c34[_0x5b83('0x30')],_0x4d6c34[_0x5b83('0x32')]);_0x31ce6f[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0x4d6c34['model'],qs['fields'](_0xadf965[_0x5b83('0x32')]['fields']));_0x31ce6f[_0x5b83('0x34')]=_0x31ce6f[_0x5b83('0x34')]['length']?_0x31ce6f['attributes']:_0x4d6c34['model'];if(!_0xadf965[_0x5b83('0x32')][_0x5b83('0x35')](_0x5b83('0x36'))){_0x31ce6f[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1c')]);_0x31ce6f['offset']=qs[_0x5b83('0x1b')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1b')]);}_0x31ce6f['order']=qs[_0x5b83('0x37')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x37')]);_0x31ce6f['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0xadf965[_0x5b83('0x32')],_0x4d6c34[_0x5b83('0x38')]),_0x22c5be);if(_0xadf965[_0x5b83('0x32')][_0x5b83('0x3a')]){_0x31ce6f[_0x5b83('0x3b')]=_[_0x5b83('0x3c')](_0x31ce6f['where'],{'$or':_[_0x5b83('0x3d')](_0x31ce6f[_0x5b83('0x34')],function(_0x308ce6){var _0x1dd83d={};_0x1dd83d[_0x308ce6]={'$like':'%'+_0xadf965['query']['filter']+'%'};return _0x1dd83d;})});}_0x31ce6f=_[_0x5b83('0x3c')]({},_0x31ce6f,_0xadf965[_0x5b83('0x3e')]);var _0x592931={'where':_0x31ce6f['where']};return db[_0x5b83('0x2f')][_0x5b83('0x1e')](_0x592931)[_0x5b83('0x25')](function(_0x96b606){_0x12623b['count']=_0x96b606;if(_0xadf965['query'][_0x5b83('0x3f')]){_0x31ce6f[_0x5b83('0x40')]=[{'all':!![]}];}return db[_0x5b83('0x2f')]['findAll'](_0x31ce6f);})[_0x5b83('0x25')](function(_0x3d3591){_0x12623b[_0x5b83('0x41')]=_0x3d3591;return _0x12623b;})[_0x5b83('0x25')](respondWithFilteredResult(_0x30beba,_0x31ce6f))[_0x5b83('0x42')](handleError(_0x30beba,null));})[_0x5b83('0x42')](handleError(_0x30beba,null));};exports[_0x5b83('0x43')]=function(_0xec61fe,_0x5260bc){var _0x300311={'raw':![],'where':{'id':_0xec61fe[_0x5b83('0x44')]['id']}},_0x196ad1={};_0x196ad1[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x2f')][_0x5b83('0x45')]);_0x196ad1['query']=_[_0x5b83('0x31')](_0xec61fe[_0x5b83('0x32')]);_0x196ad1[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],_0x196ad1[_0x5b83('0x32')]);_0x300311['attributes']=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],qs['fields'](_0xec61fe['query'][_0x5b83('0x46')]));_0x300311[_0x5b83('0x34')]=_0x300311[_0x5b83('0x34')][_0x5b83('0x47')]?_0x300311[_0x5b83('0x34')]:_0x196ad1[_0x5b83('0x30')];if(_0xec61fe[_0x5b83('0x32')][_0x5b83('0x3f')]){_0x300311['include']=[{'all':!![]}];}_0x300311=_[_0x5b83('0x3c')]({},_0x300311,_0xec61fe[_0x5b83('0x3e')]);return db[_0x5b83('0x2f')][_0x5b83('0x48')](_0x300311)['then'](handleEntityNotFound(_0x5260bc,null))[_0x5b83('0x25')](respondWithResult(_0x5260bc,null))[_0x5b83('0x42')](handleError(_0x5260bc,null));};exports['create']=function(_0x277042,_0x465cf1){return db[_0x5b83('0x2f')][_0x5b83('0x49')](_0x277042[_0x5b83('0x4a')],{})[_0x5b83('0x25')](function(_0x72fdfc){var _0x41b23e=_0x277042[_0x5b83('0x4b')]['get']({'plain':!![]});if(!_0x41b23e)throw new Error(_0x5b83('0x4c'));if(_0x41b23e['role']===_0x5b83('0x4b')){var _0x1819e6=_0x72fdfc[_0x5b83('0x4d')]({'plain':!![]});var _0x2239c5=_0x5b83('0x4e');return db[_0x5b83('0x4f')]['find']({'where':{'name':_0x2239c5,'userProfileId':_0x41b23e['userProfileId']},'raw':!![]})[_0x5b83('0x25')](function(_0x53b65f){if(_0x53b65f&&_0x53b65f['autoAssociation']===0x0){return db[_0x5b83('0x27')][_0x5b83('0x49')]({'name':_0x1819e6[_0x5b83('0x2c')],'resourceId':_0x1819e6['id'],'type':_0x53b65f[_0x5b83('0x2c')],'sectionId':_0x53b65f['id']},{})[_0x5b83('0x25')](function(){return _0x72fdfc;});}else{return _0x72fdfc;}})[_0x5b83('0x42')](function(_0x20c6cb){logger['error'](_0x5b83('0x50'),_0x20c6cb);throw _0x20c6cb;});}return _0x72fdfc;})[_0x5b83('0x25')](respondWithResult(_0x465cf1,0xc9))['catch'](handleError(_0x465cf1,null));};exports['update']=function(_0x551269,_0x50a3ad){if(_0x551269[_0x5b83('0x4a')]['id']){delete _0x551269[_0x5b83('0x4a')]['id'];}return db[_0x5b83('0x2f')]['find']({'where':{'id':_0x551269[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x50a3ad,null))['then'](saveUpdates(_0x551269['body'],null))[_0x5b83('0x25')](respondWithResult(_0x50a3ad,null))[_0x5b83('0x42')](handleError(_0x50a3ad,null));};exports['destroy']=function(_0x4c49b5,_0x5d26d6){return db['CmCompany'][_0x5b83('0x48')]({'where':{'id':_0x4c49b5[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d26d6,null))[_0x5b83('0x25')](removeEntity(_0x5d26d6,null))[_0x5b83('0x42')](handleError(_0x5d26d6,null));};exports['describe']=function(_0x138b3c,_0x3d9be8){return db[_0x5b83('0x2f')][_0x5b83('0x51')]()[_0x5b83('0x25')](respondWithResult(_0x3d9be8,null))[_0x5b83('0x42')](handleError(_0x3d9be8,null));};exports[_0x5b83('0x52')]=function(_0x49851f,_0x3aaa97,_0x5e307f){return db[_0x5b83('0x53')][_0x5b83('0x48')]({'where':{'id':_0x49851f[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aaa97,null))[_0x5b83('0x25')](function(_0x42a687){if(_0x42a687){return _0x42a687[_0x5b83('0x52')](_0x49851f['body'][_0x5b83('0x54')],_['omit'](_0x49851f[_0x5b83('0x4a')],[_0x5b83('0x54'),'id'])||{});}})[_0x5b83('0x25')](respondWithResult(_0x3aaa97,null))['catch'](handleError(_0x3aaa97,null));};exports[_0x5b83('0x55')]=function(_0x509753,_0x4d6736,_0x5afaab){var _0x10ee37={};var _0x5437f2={};var _0x5a2873;var _0x47d28c;return db['CmCompany'][_0x5b83('0x56')]({'where':{'id':_0x509753[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x4d6736,null))[_0x5b83('0x25')](function(_0x55e5b7){if(_0x55e5b7){_0x5a2873=_0x55e5b7;_0x5437f2[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x53')]['rawAttributes']);_0x5437f2[_0x5b83('0x32')]=_['keys'](_0x509753[_0x5b83('0x32')]);_0x5437f2[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],_0x5437f2['query']);_0x10ee37['attributes']=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],qs['fields'](_0x509753[_0x5b83('0x32')]['fields']));_0x10ee37['attributes']=_0x10ee37[_0x5b83('0x34')][_0x5b83('0x47')]?_0x10ee37['attributes']:_0x5437f2[_0x5b83('0x30')];_0x10ee37['order']=qs[_0x5b83('0x37')](_0x509753[_0x5b83('0x32')][_0x5b83('0x37')]);_0x10ee37['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0x509753[_0x5b83('0x32')],_0x5437f2[_0x5b83('0x38')]));if(_0x509753['query'][_0x5b83('0x3a')]){_0x10ee37['where']=_[_0x5b83('0x3c')](_0x10ee37[_0x5b83('0x3b')],{'$or':_[_0x5b83('0x3d')](_0x10ee37['attributes'],function(_0x75c334){var _0x54381f={};_0x54381f[_0x75c334]={'$like':'%'+_0x509753[_0x5b83('0x32')][_0x5b83('0x3a')]+'%'};return _0x54381f;})});}_0x10ee37=_[_0x5b83('0x3c')]({},_0x10ee37,_0x509753['options']);return _0x5a2873[_0x5b83('0x55')](_0x10ee37);}})[_0x5b83('0x25')](function(_0x33d296){if(_0x33d296){_0x47d28c=_0x33d296[_0x5b83('0x47')];if(!_0x509753[_0x5b83('0x32')][_0x5b83('0x35')]('nolimit')){_0x10ee37[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0x509753['query'][_0x5b83('0x1c')]);_0x10ee37[_0x5b83('0x1b')]=qs[_0x5b83('0x1b')](_0x509753['query'][_0x5b83('0x1b')]);}return _0x5a2873['getContacts'](_0x10ee37);}})[_0x5b83('0x25')](function(_0x258dda){if(_0x258dda){return _0x258dda?{'count':_0x47d28c,'rows':_0x258dda}:null;}})[_0x5b83('0x25')](respondWithResult(_0x4d6736,null))[_0x5b83('0x42')](handleError(_0x4d6736,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 05e05fa..64f3016 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 _0x883c=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x883c,0x133));var _0xc883=function(_0x21c48a,_0x262750){_0x21c48a=_0x21c48a-0x0;var _0x7b019=_0x883c[_0x21c48a];return _0x7b019;};'use strict';var _=require(_0xc883('0x0'));var util=require(_0xc883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc883('0x2'));var BPromise=require(_0xc883('0x3'));var rp=require(_0xc883('0x4'));var fs=require('fs');var path=require(_0xc883('0x5'));var rimraf=require(_0xc883('0x6'));var config=require(_0xc883('0x7'));var attributes=require(_0xc883('0x8'));module[_0xc883('0x9')]=function(_0xa959e3,_0x8e327e){return _0xa959e3['define']('CmCompany',attributes,{'tableName':_0xc883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6c6=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0xd94707,_0x3cacec){var _0x273bf8=function(_0x2b36d8){while(--_0x2b36d8){_0xd94707['push'](_0xd94707['shift']());}};_0x273bf8(++_0x3cacec);}(_0xb6c6,0x81));var _0x6b6c=function(_0x1d6688,_0x20fce6){_0x1d6688=_0x1d6688-0x0;var _0x253f94=_0xb6c6[_0x1d6688];return _0x253f94;};'use strict';var _=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var logger=require(_0x6b6c('0x2'))(_0x6b6c('0x3'));var moment=require('moment');var BPromise=require(_0x6b6c('0x4'));var rp=require(_0x6b6c('0x5'));var fs=require('fs');var path=require(_0x6b6c('0x6'));var rimraf=require(_0x6b6c('0x7'));var config=require(_0x6b6c('0x8'));var attributes=require(_0x6b6c('0x9'));module['exports']=function(_0x78d39f,_0x40daea){return _0x78d39f[_0x6b6c('0xa')](_0x6b6c('0xb'),attributes,{'tableName':_0x6b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 43fe03e..901c343 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 _0x9755=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x586998,_0xc9fd34){var _0x1c882d=function(_0x48b3e8){while(--_0x48b3e8){_0x586998['push'](_0x586998['shift']());}};_0x1c882d(++_0xc9fd34);}(_0x9755,0x9b));var _0x5975=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x9755[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0x5975('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5975('0x1'));var rs=require(_0x5975('0x2'));var fs=require('fs');var Redis=require(_0x5975('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5975('0x4'));var logger=require(_0x5975('0x5'))(_0x5975('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5975('0x7')][_0x5975('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e88ee,_0x56c167,_0x29695b){return new BPromise(function(_0x1d811a,_0x3e54b0){return client[_0x5975('0x9')](_0x5e88ee,_0x29695b)[_0x5975('0xa')](function(_0x1a580f){logger[_0x5975('0xb')]('CmCompany,\x20%s,\x20%s',_0x56c167,_0x5975('0xc'));logger[_0x5975('0xd')](_0x5975('0xe'),_0x56c167,_0x5975('0xc'),JSON[_0x5975('0xf')](_0x1a580f));if(_0x1a580f['error']){if(_0x1a580f[_0x5975('0x10')][_0x5975('0x11')]===0x1f4){logger[_0x5975('0x10')]('CmCompany,\x20%s,\x20%s',_0x56c167,_0x1a580f[_0x5975('0x10')][_0x5975('0x12')]);return _0x3e54b0(_0x1a580f[_0x5975('0x10')]['message']);}logger[_0x5975('0x10')](_0x5975('0x13'),_0x56c167,_0x1a580f[_0x5975('0x10')][_0x5975('0x12')]);return _0x1d811a(_0x1a580f['error'][_0x5975('0x12')]);}else{logger[_0x5975('0xb')](_0x5975('0x13'),_0x56c167,_0x5975('0xc'));_0x1d811a(_0x1a580f['result'][_0x5975('0x12')]);}})[_0x5975('0x14')](function(_0x31249f){logger[_0x5975('0x10')](_0x5975('0x13'),_0x56c167,_0x31249f);_0x3e54b0(_0x31249f);});});}
\ No newline at end of file
+var _0xe18f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe18f,0x149));var _0xfe18=function(_0x379d87,_0x50962c){_0x379d87=_0x379d87-0x0;var _0x4c7593=_0xe18f[_0x379d87];return _0x4c7593;};'use strict';var _=require(_0xfe18('0x0'));var util=require(_0xfe18('0x1'));var moment=require(_0xfe18('0x2'));var BPromise=require(_0xfe18('0x3'));var rs=require(_0xfe18('0x4'));var fs=require('fs');var Redis=require(_0xfe18('0x5'));var db=require(_0xfe18('0x6'))['db'];var utils=require(_0xfe18('0x7'));var logger=require(_0xfe18('0x8'))(_0xfe18('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe18('0xa'));var client=jayson[_0xfe18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74fd,_0x5f3dc8,_0x2e4103){return new BPromise(function(_0x271b17,_0x4e806c){return client[_0xfe18('0xc')](_0x3a74fd,_0x2e4103)[_0xfe18('0xd')](function(_0x1f258f){logger[_0xfe18('0xe')](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));logger[_0xfe18('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5f3dc8,_0xfe18('0x10'),JSON[_0xfe18('0x12')](_0x1f258f));if(_0x1f258f['error']){if(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x14')]===0x1f4){logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x4e806c(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);}logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x271b17(_0x1f258f[_0xfe18('0x13')]['message']);}else{logger['info'](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));_0x271b17(_0x1f258f['result'][_0xfe18('0x15')]);}})['catch'](function(_0x32f5eb){logger[_0xfe18('0x13')]('CmCompany,\x20%s,\x20%s',_0x5f3dc8,_0x32f5eb);_0x4e806c(_0x32f5eb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 9fd249e..1d68e2e 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 _0x5ab5=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x54feb1,_0x21d9ac){var _0x222316=function(_0x13cd81){while(--_0x13cd81){_0x54feb1['push'](_0x54feb1['shift']());}};_0x222316(++_0x21d9ac);}(_0x5ab5,0x186));var _0x55ab=function(_0x299cf8,_0x5c01ae){_0x299cf8=_0x299cf8-0x0;var _0x3042ef=_0x5ab5[_0x299cf8];return _0x3042ef;};'use strict';var multer=require(_0x55ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55ab('0x1'));var express=require(_0x55ab('0x2'));var router=express[_0x55ab('0x3')]();var fs_extra=require(_0x55ab('0x4'));var auth=require(_0x55ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x55ab('0x6'));var controller=require(_0x55ab('0x7'));router[_0x55ab('0x8')]('/',auth[_0x55ab('0x9')](),controller[_0x55ab('0xa')]);router['get'](_0x55ab('0xb'),auth[_0x55ab('0x9')](),controller[_0x55ab('0xc')]);router[_0x55ab('0x8')](_0x55ab('0xd'),auth[_0x55ab('0x9')](),controller[_0x55ab('0xe')]);router[_0x55ab('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x55ab('0xf')]);router[_0x55ab('0x10')]('/',auth[_0x55ab('0x9')](),controller[_0x55ab('0x11')]);router[_0x55ab('0x10')](_0x55ab('0x12'),auth[_0x55ab('0x9')](),controller['addContacts']);router[_0x55ab('0x13')](_0x55ab('0xd'),auth['isAuthenticated'](),controller[_0x55ab('0x14')]);router['delete'](_0x55ab('0xd'),auth[_0x55ab('0x9')](),controller[_0x55ab('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x3cb7=['index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x1d7165,_0x89c7a5){var _0x52cdee=function(_0x17df8a){while(--_0x17df8a){_0x1d7165['push'](_0x1d7165['shift']());}};_0x52cdee(++_0x89c7a5);}(_0x3cb7,0xcf));var _0x73cb=function(_0x4b15a4,_0x4241fe){_0x4b15a4=_0x4b15a4-0x0;var _0x40a783=_0x3cb7[_0x4b15a4];return _0x40a783;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73cb('0x0'));var timeout=require('connect-timeout');var express=require(_0x73cb('0x1'));var router=express[_0x73cb('0x2')]();var fs_extra=require(_0x73cb('0x3'));var auth=require(_0x73cb('0x4'));var interaction=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var controller=require(_0x73cb('0x7'));router[_0x73cb('0x8')]('/',auth['isAuthenticated'](),controller[_0x73cb('0x9')]);router[_0x73cb('0x8')](_0x73cb('0xa'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xc')]);router['get'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xe')]);router[_0x73cb('0x8')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x10')]);router['post']('/',auth[_0x73cb('0xb')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x12')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x13')]);router['put'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x14')]);router[_0x73cb('0x15')](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x16')]);module[_0x73cb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a66e907..71bcf53 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 _0x67ba=['DATE','NOW','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x83e4d9,_0x3b9bb6){var _0x36a145=function(_0x2904e9){while(--_0x2904e9){_0x83e4d9['push'](_0x83e4d9['shift']());}};_0x36a145(++_0x3b9bb6);}(_0x67ba,0xfe));var _0xa67b=function(_0x307632,_0xb3ebd6){_0x307632=_0x307632-0x0;var _0x1cfa61=_0x67ba[_0x307632];return _0x1cfa61;};'use strict';var _=require('lodash');var Sequelize=require(_0xa67b('0x0'));module[_0xa67b('0x1')]={'firstName':{'type':Sequelize[_0xa67b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa67b('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa67b('0x2')]},'country':{'type':Sequelize[_0xa67b('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa67b('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa67b('0x2')]},'mobile':{'type':Sequelize[_0xa67b('0x2')]},'fax':{'type':Sequelize[_0xa67b('0x2')]},'email':{'type':Sequelize[_0xa67b('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa67b('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa67b('0x2')]},'wechat':{'type':Sequelize[_0xa67b('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xa67b('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xa67b('0x2')]},'priority':{'type':Sequelize[_0xa67b('0x3')](0x2)[_0xa67b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa67b('0x5')],'defaultValue':Sequelize[_0xa67b('0x6')]},'dialTimezone':{'type':Sequelize[_0xa67b('0x2')]},'utcOffset':{'type':Sequelize[_0xa67b('0x3')]}};
\ No newline at end of file
+var _0xf879=['TEXT','INTEGER','NOW','lodash','sequelize','exports','STRING'];(function(_0x3eb950,_0x291f67){var _0x5bc4f4=function(_0x172dc5){while(--_0x172dc5){_0x3eb950['push'](_0x3eb950['shift']());}};_0x5bc4f4(++_0x291f67);}(_0xf879,0x145));var _0x9f87=function(_0x5b74c2,_0xd523bd){_0x5b74c2=_0x5b74c2-0x0;var _0x446678=_0xf879[_0x5b74c2];return _0x446678;};'use strict';var _=require(_0x9f87('0x0'));var Sequelize=require(_0x9f87('0x1'));module[_0x9f87('0x2')]={'firstName':{'type':Sequelize[_0x9f87('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9f87('0x3')]},'street':{'type':Sequelize[_0x9f87('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9f87('0x3')]},'country':{'type':Sequelize[_0x9f87('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f87('0x4')]},'phone':{'type':Sequelize[_0x9f87('0x3')]},'mobile':{'type':Sequelize[_0x9f87('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9f87('0x3')]},'url':{'type':Sequelize[_0x9f87('0x3')]},'facebook':{'type':Sequelize[_0x9f87('0x3')]},'fb_data':{'type':Sequelize[_0x9f87('0x3')]},'twitter':{'type':Sequelize[_0x9f87('0x3')]},'skype':{'type':Sequelize[_0x9f87('0x3')]},'teams':{'type':Sequelize[_0x9f87('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9f87('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x9f87('0x3')]},'UserId':{'type':Sequelize[_0x9f87('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9f87('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9f87('0x6')]},'dialTimezone':{'type':Sequelize[_0x9f87('0x3')]},'utcOffset':{'type':Sequelize[_0x9f87('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index c858d33..a2f0b5e 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 _0xdb1b=['isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','spread','hasOwnProperty','contact','params','Tag','Tags','name','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','map','format','cf_%d','omit','startsWith','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','model','filters','intersection','fields','attributes','order','sort','options','nolimit','setTags','ids','setAdditionalPhones','all','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopperId','item','ItemType.OrderBy','`ItemType`.OrderBy','duplicateAdditionalPhones','CmContactId','hopperId','rawAttributes','pick','filter','includeAll','rows','getHopperHistories','ContactId','include','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','file','meta','User','agent','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','message','error\x20child\x20process','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','source','callerid','starttime','endtime','note','createdAt','userSecondDisposition','fullname','startCase','Website','closed','closedAt','secondDisposition','thirdDisposition','UserId','Account','key','Owner','chat','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','mail','subject','externalUrl','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','slice','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','json','offset','limit','undefined','count','status','set','Content-Range','update','then','error','stack','send','index','query','user','catch','destroy','find','describe','CmContact','tags','length','keys','cf_','columnName','displayName','CmCustomField','findAll','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','merge','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport'];(function(_0x48ae80,_0x4b9d9d){var _0xaa6e26=function(_0x3dd05f){while(--_0x3dd05f){_0x48ae80['push'](_0x48ae80['shift']());}};_0xaa6e26(++_0x4b9d9d);}(_0xdb1b,0xa4));var _0xbdb1=function(_0x2f3581,_0x23fe61){_0x2f3581=_0x2f3581-0x0;var _0x304df9=_0xdb1b[_0x2f3581];return _0x304df9;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xbdb1('0x0'));var path=require(_0xbdb1('0x1'));var fs=require('fs');var _=require(_0xbdb1('0x2'));var squel=require(_0xbdb1('0x3'));var Papa=require(_0xbdb1('0x4'));var Redis=require(_0xbdb1('0x5'));var contacts=require(_0xbdb1('0x6'));var qs=require(_0xbdb1('0x7'));var logger=require(_0xbdb1('0x8'))(_0xbdb1('0x9'));var config=require(_0xbdb1('0xa'));var shared=require(_0xbdb1('0xb'));var db=require('../../mysqldb')['db'];config[_0xbdb1('0xc')]=_[_0xbdb1('0xd')](config[_0xbdb1('0xc')],{'host':_0xbdb1('0xe'),'port':0x18eb});var socket=require(_0xbdb1('0xf'))(new Redis(config[_0xbdb1('0xc')]));require('./cmContact.socket')[_0xbdb1('0x10')](socket);function respondWithResult(_0x3f03f5,_0x334830){_0x334830=_0x334830||0xc8;return function(_0x3598c3){if(_0x3598c3){return _0x3f03f5['status'](_0x334830)[_0xbdb1('0x11')](_0x3598c3);}};}function respondWithFilteredResult(_0x35f210,_0x49fa39){return function(_0x251bf8){if(_0x251bf8){var _0xfb8e98=typeof _0x49fa39[_0xbdb1('0x12')]==='undefined'&&typeof _0x49fa39[_0xbdb1('0x13')]===_0xbdb1('0x14');var _0x4a4bfa=_0x251bf8[_0xbdb1('0x15')];var _0x5e3e06=_0xfb8e98?0x0:_0x49fa39['offset'];var _0x247d8a=_0xfb8e98?_0x251bf8['count']:_0x49fa39['offset']+_0x49fa39[_0xbdb1('0x13')];var _0xca1aca;if(_0x247d8a>=_0x4a4bfa){_0x247d8a=_0x4a4bfa;_0xca1aca=0xc8;}else{_0xca1aca=0xce;}_0x35f210[_0xbdb1('0x16')](_0xca1aca);return _0x35f210[_0xbdb1('0x17')](_0xbdb1('0x18'),_0x5e3e06+'-'+_0x247d8a+'/'+_0x4a4bfa)['json'](_0x251bf8);}return null;};}function saveUpdates(_0x2f4872){return function(_0x5f1d14){if(_0x5f1d14){return _0x5f1d14[_0xbdb1('0x19')](_0x2f4872)[_0xbdb1('0x1a')](function(_0x28d437){return _0x28d437;});}return null;};}function removeEntity(_0x230291){return function(_0x9fffc8){if(_0x9fffc8){return _0x9fffc8['destroy']()[_0xbdb1('0x1a')](function(){_0x230291[_0xbdb1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445a21){return function(_0x553f94){if(!_0x553f94){_0x445a21['sendStatus'](0x194);}return _0x553f94;};}function handleError(_0x1b837f,_0x3d7796){_0x3d7796=_0x3d7796||0x1f4;return function(_0x3bbebd){logger[_0xbdb1('0x1b')](_0x3bbebd[_0xbdb1('0x1c')]);if(_0x3bbebd['name']){delete _0x3bbebd['name'];}_0x1b837f[_0xbdb1('0x16')](_0x3d7796)[_0xbdb1('0x1d')](_0x3bbebd);};}exports[_0xbdb1('0x1e')]=function(_0x2ad4b7,_0x432bef){var _0x223480={};return contacts['describe']()[_0xbdb1('0x1a')](function(_0x550870){_0x223480=qs['getOptions'](_0x550870,_0x2ad4b7);return contacts['findAll'](_0x2ad4b7[_0xbdb1('0x1f')],_0x2ad4b7[_0xbdb1('0x20')],_0x223480,_0x550870);})[_0xbdb1('0x1a')](respondWithFilteredResult(_0x432bef,_0x223480))[_0xbdb1('0x21')](handleError(_0x432bef,null));};exports[_0xbdb1('0x22')]=function(_0x36fbd1,_0x373ba3){return db['CmContact'][_0xbdb1('0x23')]({'where':{'id':_0x36fbd1['params']['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x373ba3,null))[_0xbdb1('0x1a')](removeEntity(_0x373ba3,null))[_0xbdb1('0x21')](handleError(_0x373ba3,null));};exports[_0xbdb1('0x24')]=function(_0x50f8b5,_0x67b429){return db[_0xbdb1('0x25')][_0xbdb1('0x24')]()['then'](function(_0x4b15df){delete _0x4b15df[_0xbdb1('0x26')];for(var _0xdbddc2=0x0;_0xdbddc2
','Attachments','Title'];(function(_0x33a5ec,_0x10c014){var _0x38f89c=function(_0x15f7ee){while(--_0x15f7ee){_0x33a5ec['push'](_0x33a5ec['shift']());}};_0x38f89c(++_0x10c014);}(_0xfce6,0xd7));var _0x6fce=function(_0x38806d,_0x176c25){_0x38806d=_0x38806d-0x0;var _0x235ec0=_0xfce6[_0x38806d];return _0x235ec0;};'use strict';var _=require(_0x6fce('0x0'));var moment=require('moment');var random=require(_0x6fce('0x1'));var fs=require('fs');var path=require(_0x6fce('0x2'));var util=require(_0x6fce('0x3'));var tnef=require(_0x6fce('0x4'));var logger=require(_0x6fce('0x5'))(_0x6fce('0x6'));var config=require(_0x6fce('0x7'));function getAddress(_0x18efed){var _0x10506e=_[_0x6fce('0x8')](_0x18efed[_0x6fce('0x9')]);return _0x10506e&&_0x10506e[_0x6fce('0xa')]?_0x10506e[_0x6fce('0xa')]:_0x6fce('0xb')+random[_0x6fce('0xc')](0x6)+_0x6fce('0xd');}function getFirstName(_0x479834){var _0x12d043=_[_0x6fce('0x8')](_0x479834['value']);if(_0x12d043&&_0x12d043[_0x6fce('0xe')]){if(_0x12d043[_0x6fce('0xe')]==_0x12d043[_0x6fce('0xa')]){return _0x12d043[_0x6fce('0xe')][_0x6fce('0xf')](0x0,_0x12d043[_0x6fce('0xe')][_0x6fce('0x10')]('@'));}var _0x21a264=_0x12d043['name'][_0x6fce('0x11')](/\s+/);return _0x21a264[_0x6fce('0x12')]>0x1?_0x21a264[_0x6fce('0x13')](0x0,-0x1)['join']('\x20'):_0x12d043[_0x6fce('0xe')];}return'Anonymous';}function getLastName(_0x426f7e){var _0x5f42bf=_[_0x6fce('0x8')](_0x426f7e['value']);if(_0x5f42bf&&_0x5f42bf[_0x6fce('0xe')]){var _0x23baef=_0x5f42bf['name'][_0x6fce('0x11')](/\s+/);return _0x23baef[_0x6fce('0x12')]>0x1?_0x23baef['pop']():'';}return'';}function getMails(_0x2c7b4e,_0x481928){var _0x4a5d95='';for(var _0x4182a3=0x0;_0x4182a3<_0x481928[_0x6fce('0x9')][_0x6fce('0x12')];_0x4182a3+=0x1){if(_0x481928['value'][_0x4182a3][_0x6fce('0xa')]!==_0x2c7b4e){if(!_[_0x6fce('0x14')](_0x4a5d95)){_0x4a5d95+=',';}_0x4a5d95+=_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xe')]||_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]||'';_0x4a5d95+='\x20<';_0x4a5d95+=_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]?_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]:'anonymous'+random[_0x6fce('0xc')](0x6)+_0x6fce('0xd');_0x4a5d95+='>';}}return _0x4a5d95;}function parseEmail(_0x11d76a,_0x4dd695,_0x5556d3){if(_0x4dd695[_0x6fce('0x15')]){var _0x554b57=/