From: support
Date: Tue, 13 Sep 2022 06:20:55 +0000 (+0000)
Subject: Built motion from commit 6ae5c09c.|2.6.15
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22avatar.png//%27?a=commitdiff_plain;h=1f8d975136afbfa0e7d8e34c7d560abe7b02be0e;p=motion2.git
Built motion from commit 6ae5c09c.|2.6.15
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 4427f1e..cec64f6 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-12T09:26:32.890Z",
+ "time": "2022-09-13T06:12:56.114Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index ae80f8d..aa47b38 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-12T09:26:32.890Z",
+ "time": "2022-09-13T06:12:56.114Z",
"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 675b899..680d183 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 _0xb58d=['action','contactManager','motionbar','jscripty','urlForward','browser','script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x39aec5,_0x2c0b3b){var _0x27d1c3=function(_0x205748){while(--_0x205748){_0x39aec5['push'](_0x39aec5['shift']());}};_0x27d1c3(++_0x2c0b3b);}(_0xb58d,0x141));var _0xdb58=function(_0x4cf1ad,_0x2929f0){_0x4cf1ad=_0x4cf1ad-0x0;var _0x3b210f=_0xb58d[_0x4cf1ad];return _0x3b210f;};'use strict';var Sequelize=require(_0xdb58('0x0'));module[_0xdb58('0x1')]={'name':{'type':Sequelize[_0xdb58('0x2')],'get':function(_0x4e9eea){return this['getDataValue'](_0xdb58('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xdb58('0x4'),'integration',_0xdb58('0x5'),_0xdb58('0x6'),_0xdb58('0x7'),_0xdb58('0x8'),'bot',_0xdb58('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comment':_0xdb58('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdb58('0xc')},'data4':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comments':_0xdb58('0xd')},'data5':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comments':_0xdb58('0xe')},'data6':{'type':Sequelize[_0xdb58('0xa')],'comments':_0xdb58('0xf')},'data7':{'type':Sequelize[_0xdb58('0x10')],'comments':_0xdb58('0x11')}};
\ No newline at end of file
+var _0x414c=['jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager','integration','motionbar'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x414c,0x175));var _0xc414=function(_0x1954d7,_0x4f8aba){_0x1954d7=_0x1954d7-0x0;var _0x161a3c=_0x414c[_0x1954d7];return _0x161a3c;};'use strict';var Sequelize=require(_0xc414('0x0'));module[_0xc414('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a9982){return this[_0xc414('0x2')]('action');}},'action':{'type':Sequelize[_0xc414('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc414('0x4'),_0xc414('0x5'),_0xc414('0x6'),_0xc414('0x7'),_0xc414('0x8'),'browser',_0xc414('0x9'),_0xc414('0xa')]],'msg':_0xc414('0xb')}},'comment':_0xc414('0xb')},'data1':{'type':Sequelize[_0xc414('0x3')](0x1000),'comment':_0xc414('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xc414('0xd')},'data3':{'type':Sequelize[_0xc414('0x3')](0x1000),'comment':_0xc414('0xe')},'data4':{'type':Sequelize[_0xc414('0x3')](0x1000),'comments':_0xc414('0xf')},'data5':{'type':Sequelize[_0xc414('0x3')](0x1000),'comments':_0xc414('0x10')},'data6':{'type':Sequelize[_0xc414('0x3')],'comments':_0xc414('0x11')},'data7':{'type':Sequelize[_0xc414('0x12')],'comments':_0xc414('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 6d53f63..15718d9 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 _0xe9ff=['request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x331c5a,_0x5d85f4){var _0x34fda5=function(_0x2e9d35){while(--_0x2e9d35){_0x331c5a['push'](_0x331c5a['shift']());}};_0x34fda5(++_0x5d85f4);}(_0xe9ff,0x1be));var _0xfe9f=function(_0x75a383,_0x265b4b){_0x75a383=_0x75a383-0x0;var _0x2f70a0=_0xe9ff[_0x75a383];return _0x2f70a0;};'use strict';var emlformat=require(_0xfe9f('0x0'));var rimraf=require(_0xfe9f('0x1'));var zipdir=require(_0xfe9f('0x2'));var jsonpatch=require(_0xfe9f('0x3'));var rp=require(_0xfe9f('0x4'));var moment=require(_0xfe9f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe9f('0x6'));var path=require('path');var sox=require(_0xfe9f('0x7'));var csv=require(_0xfe9f('0x8'));var ejs=require(_0xfe9f('0x9'));var fs=require('fs');var fs_extra=require(_0xfe9f('0xa'));var _=require(_0xfe9f('0xb'));var squel=require(_0xfe9f('0xc'));var crypto=require(_0xfe9f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfe9f('0xe'));var toCsv=require(_0xfe9f('0x8'));var querystring=require(_0xfe9f('0xf'));var Papa=require('papaparse');var Redis=require(_0xfe9f('0x10'));var authService=require(_0xfe9f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfe9f('0x12'));var hardwareService=require(_0xfe9f('0x13'));var logger=require(_0xfe9f('0x14'))(_0xfe9f('0x15'));var utils=require(_0xfe9f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfe9f('0x17'))['db'];function respondWithStatusCode(_0x3e7898,_0x2adba8){_0x2adba8=_0x2adba8||0xcc;return function(_0x315bcb){if(_0x315bcb){return _0x3e7898[_0xfe9f('0x18')](_0x2adba8);}return _0x3e7898[_0xfe9f('0x19')](_0x2adba8)[_0xfe9f('0x1a')]();};}function respondWithResult(_0x16086b,_0x44fa17){_0x44fa17=_0x44fa17||0xc8;return function(_0x48be7f){if(_0x48be7f){return _0x16086b[_0xfe9f('0x19')](_0x44fa17)[_0xfe9f('0x1b')](_0x48be7f);}};}function respondWithFilteredResult(_0x538bf6,_0xd21849){return function(_0x4de0c8){if(_0x4de0c8){var _0x294a52=typeof _0xd21849['offset']===_0xfe9f('0x1c')&&typeof _0xd21849[_0xfe9f('0x1d')]==='undefined';var _0x2531fb=_0x4de0c8[_0xfe9f('0x1e')];var _0x39463a=_0x294a52?0x0:_0xd21849[_0xfe9f('0x1f')];var _0xe70804=_0x294a52?_0x4de0c8[_0xfe9f('0x1e')]:_0xd21849['offset']+_0xd21849['limit'];var _0x9d686e;if(_0xe70804>=_0x2531fb){_0xe70804=_0x2531fb;_0x9d686e=0xc8;}else{_0x9d686e=0xce;}_0x538bf6['status'](_0x9d686e);return _0x538bf6[_0xfe9f('0x20')](_0xfe9f('0x21'),_0x39463a+'-'+_0xe70804+'/'+_0x2531fb)[_0xfe9f('0x1b')](_0x4de0c8);}return null;};}function patchUpdates(_0x242c72){return function(_0x28212c){try{jsonpatch[_0xfe9f('0x22')](_0x28212c,_0x242c72,!![]);}catch(_0x4e6179){return BPromise['reject'](_0x4e6179);}return _0x28212c[_0xfe9f('0x23')]();};}function saveUpdates(_0x2932e5,_0x245b4b){return function(_0x5d37e1){if(_0x5d37e1){return _0x5d37e1[_0xfe9f('0x24')](_0x2932e5)[_0xfe9f('0x25')](function(_0x4d7eb2){return _0x4d7eb2;});}return null;};}function removeEntity(_0x1ff2e8,_0x37163d){return function(_0xb2ae03){if(_0xb2ae03){return _0xb2ae03['destroy']()[_0xfe9f('0x25')](function(){_0x1ff2e8['status'](0xcc)[_0xfe9f('0x1a')]();});}};}function handleEntityNotFound(_0x5d804b,_0x239049){return function(_0x2e2970){if(!_0x2e2970){_0x5d804b[_0xfe9f('0x18')](0x194);}return _0x2e2970;};}function handleError(_0x288dbb,_0x450478){_0x450478=_0x450478||0x1f4;return function(_0x4d5fdd){logger['error'](_0x4d5fdd['stack']);if(_0x4d5fdd[_0xfe9f('0x26')]){delete _0x4d5fdd[_0xfe9f('0x26')];}_0x288dbb[_0xfe9f('0x19')](_0x450478)[_0xfe9f('0x27')](_0x4d5fdd);};}exports[_0xfe9f('0x24')]=function(_0x5b0030,_0xbacc12){if(_0x5b0030[_0xfe9f('0x28')]['id']){delete _0x5b0030[_0xfe9f('0x28')]['id'];}return db[_0xfe9f('0x29')][_0xfe9f('0x2a')]({'where':{'id':_0x5b0030[_0xfe9f('0x2b')]['id']}})[_0xfe9f('0x25')](handleEntityNotFound(_0xbacc12,null))[_0xfe9f('0x25')](saveUpdates(_0x5b0030[_0xfe9f('0x28')],null))[_0xfe9f('0x25')](respondWithResult(_0xbacc12,null))[_0xfe9f('0x2c')](handleError(_0xbacc12,null));};exports['destroy']=function(_0x2b5ed3,_0x5111e5){return db[_0xfe9f('0x29')][_0xfe9f('0x2a')]({'where':{'id':_0x2b5ed3['params']['id']}})['then'](handleEntityNotFound(_0x5111e5,null))['then'](removeEntity(_0x5111e5,null))['catch'](handleError(_0x5111e5,null));};
\ No newline at end of file
+var _0xb473=['find','params','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','then','destroy','stack','name','send','update','body','Action'];(function(_0x2c70fa,_0x35f7bd){var _0x413a81=function(_0x413727){while(--_0x413727){_0x2c70fa['push'](_0x2c70fa['shift']());}};_0x413a81(++_0x35f7bd);}(_0xb473,0x14c));var _0x3b47=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xb473[_0x15ea09];return _0x3e9c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b47('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b47('0x1'));var rp=require('request-promise');var moment=require(_0x3b47('0x2'));var BPromise=require(_0x3b47('0x3'));var Mustache=require(_0x3b47('0x4'));var util=require(_0x3b47('0x5'));var path=require(_0x3b47('0x6'));var sox=require(_0x3b47('0x7'));var csv=require(_0x3b47('0x8'));var ejs=require(_0x3b47('0x9'));var fs=require('fs');var fs_extra=require(_0x3b47('0xa'));var _=require(_0x3b47('0xb'));var squel=require(_0x3b47('0xc'));var crypto=require(_0x3b47('0xd'));var jsforce=require(_0x3b47('0xe'));var deskjs=require(_0x3b47('0xf'));var toCsv=require(_0x3b47('0x8'));var querystring=require('querystring');var Papa=require(_0x3b47('0x10'));var Redis=require('ioredis');var authService=require(_0x3b47('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b47('0x12'));var hardwareService=require(_0x3b47('0x13'));var logger=require(_0x3b47('0x14'))(_0x3b47('0x15'));var utils=require(_0x3b47('0x16'));var config=require(_0x3b47('0x17'));var licenseUtil=require(_0x3b47('0x18'));var db=require(_0x3b47('0x19'))['db'];function respondWithStatusCode(_0x40f32f,_0x1960d8){_0x1960d8=_0x1960d8||0xcc;return function(_0x421a53){if(_0x421a53){return _0x40f32f[_0x3b47('0x1a')](_0x1960d8);}return _0x40f32f['status'](_0x1960d8)['end']();};}function respondWithResult(_0x2549e4,_0x2364ec){_0x2364ec=_0x2364ec||0xc8;return function(_0x463344){if(_0x463344){return _0x2549e4[_0x3b47('0x1b')](_0x2364ec)['json'](_0x463344);}};}function respondWithFilteredResult(_0x32b9a6,_0x59cc37){return function(_0x3d6f03){if(_0x3d6f03){var _0x21f832=typeof _0x59cc37[_0x3b47('0x1c')]===_0x3b47('0x1d')&&typeof _0x59cc37['limit']===_0x3b47('0x1d');var _0x5b3731=_0x3d6f03['count'];var _0x319a94=_0x21f832?0x0:_0x59cc37[_0x3b47('0x1c')];var _0x1dfc3e=_0x21f832?_0x3d6f03['count']:_0x59cc37[_0x3b47('0x1c')]+_0x59cc37[_0x3b47('0x1e')];var _0x3e2d88;if(_0x1dfc3e>=_0x5b3731){_0x1dfc3e=_0x5b3731;_0x3e2d88=0xc8;}else{_0x3e2d88=0xce;}_0x32b9a6['status'](_0x3e2d88);return _0x32b9a6[_0x3b47('0x1f')](_0x3b47('0x20'),_0x319a94+'-'+_0x1dfc3e+'/'+_0x5b3731)[_0x3b47('0x21')](_0x3d6f03);}return null;};}function patchUpdates(_0x73c4bd){return function(_0x21d9dd){try{jsonpatch['apply'](_0x21d9dd,_0x73c4bd,!![]);}catch(_0x2343ad){return BPromise[_0x3b47('0x22')](_0x2343ad);}return _0x21d9dd[_0x3b47('0x23')]();};}function saveUpdates(_0x39b469,_0x5e1344){return function(_0x1a2ba9){if(_0x1a2ba9){return _0x1a2ba9['update'](_0x39b469)[_0x3b47('0x24')](function(_0x1bb637){return _0x1bb637;});}return null;};}function removeEntity(_0x4b1fcd,_0x2524ac){return function(_0x1ce51d){if(_0x1ce51d){return _0x1ce51d[_0x3b47('0x25')]()[_0x3b47('0x24')](function(){_0x4b1fcd[_0x3b47('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212228,_0x43a7c6){return function(_0xdf9722){if(!_0xdf9722){_0x212228[_0x3b47('0x1a')](0x194);}return _0xdf9722;};}function handleError(_0x44934c,_0x44ba1f){_0x44ba1f=_0x44ba1f||0x1f4;return function(_0x4db628){logger['error'](_0x4db628[_0x3b47('0x26')]);if(_0x4db628[_0x3b47('0x27')]){delete _0x4db628[_0x3b47('0x27')];}_0x44934c['status'](_0x44ba1f)[_0x3b47('0x28')](_0x4db628);};}exports[_0x3b47('0x29')]=function(_0x5cd574,_0x129dd2){if(_0x5cd574[_0x3b47('0x2a')]['id']){delete _0x5cd574[_0x3b47('0x2a')]['id'];}return db[_0x3b47('0x2b')][_0x3b47('0x2c')]({'where':{'id':_0x5cd574[_0x3b47('0x2d')]['id']}})[_0x3b47('0x24')](handleEntityNotFound(_0x129dd2,null))[_0x3b47('0x24')](saveUpdates(_0x5cd574[_0x3b47('0x2a')],null))[_0x3b47('0x24')](respondWithResult(_0x129dd2,null))[_0x3b47('0x2e')](handleError(_0x129dd2,null));};exports[_0x3b47('0x25')]=function(_0x3df5da,_0x555c87){return db[_0x3b47('0x2b')]['find']({'where':{'id':_0x3df5da[_0x3b47('0x2d')]['id']}})[_0x3b47('0x24')](handleEntityNotFound(_0x555c87,null))[_0x3b47('0x24')](removeEntity(_0x555c87,null))['catch'](handleError(_0x555c87,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 01d5ecd..a84986f 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 _0x7677=['exports','Action','tools_actions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3ac552,_0x257348){var _0xcb4fb9=function(_0x120f0a){while(--_0x120f0a){_0x3ac552['push'](_0x3ac552['shift']());}};_0xcb4fb9(++_0x257348);}(_0x7677,0x18f));var _0x7767=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7677[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7767('0x0'));var util=require('util');var logger=require(_0x7767('0x1'))(_0x7767('0x2'));var moment=require(_0x7767('0x3'));var BPromise=require('bluebird');var rp=require(_0x7767('0x4'));var fs=require('fs');var path=require(_0x7767('0x5'));var rimraf=require(_0x7767('0x6'));var config=require(_0x7767('0x7'));var attributes=require(_0x7767('0x8'));module[_0x7767('0x9')]=function(_0x40ebd6,_0x12cc0c){return _0x40ebd6['define'](_0x7767('0xa'),attributes,{'tableName':_0x7767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9175=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9175,0x1ad));var _0x5917=function(_0x5bac46,_0x34d07f){_0x5bac46=_0x5bac46-0x0;var _0x407ef3=_0x9175[_0x5bac46];return _0x407ef3;};'use strict';var _=require(_0x5917('0x0'));var util=require(_0x5917('0x1'));var logger=require(_0x5917('0x2'))(_0x5917('0x3'));var moment=require(_0x5917('0x4'));var BPromise=require(_0x5917('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5917('0x6'));var config=require(_0x5917('0x7'));var attributes=require(_0x5917('0x8'));module[_0x5917('0x9')]=function(_0x4d2f4e,_0x4f6da3){return _0x4d2f4e[_0x5917('0xa')](_0x5917('0xb'),attributes,{'tableName':_0x5917('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index de1b76c..de47ed1 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x15a0c4,_0x3ceeca){var _0x1abadf=function(_0x2a047b){while(--_0x2a047b){_0x15a0c4['push'](_0x15a0c4['shift']());}};_0x1abadf(++_0x3ceeca);}(_0x8ef6,0xf2));var _0x68ef=function(_0x327da6,_0x2c1c80){_0x327da6=_0x327da6-0x0;var _0x4f1297=_0x8ef6[_0x327da6];return _0x4f1297;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x33401b,_0x587247){var _0x49fc6b=function(_0x3f18ca){while(--_0x3f18ca){_0x33401b['push'](_0x33401b['shift']());}};_0x49fc6b(++_0x587247);}(_0x1261,0x144));var _0x1126=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x1261[_0x16938f];return _0x5c66e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9940f83..fdacf95 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 _0x79cb=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x13f731,_0x1c061a){var _0x3ac7d7=function(_0x347227){while(--_0x347227){_0x13f731['push'](_0x13f731['shift']());}};_0x3ac7d7(++_0x1c061a);}(_0x79cb,0xf4));var _0xb79c=function(_0x291578,_0x23098a){_0x291578=_0x291578-0x0;var _0x58bf79=_0x79cb[_0x291578];return _0x58bf79;};'use strict';var multer=require('multer');var util=require(_0xb79c('0x0'));var path=require(_0xb79c('0x1'));var timeout=require(_0xb79c('0x2'));var express=require(_0xb79c('0x3'));var router=express['Router']();var fs_extra=require(_0xb79c('0x4'));var auth=require(_0xb79c('0x5'));var interaction=require(_0xb79c('0x6'));var config=require(_0xb79c('0x7'));var controller=require(_0xb79c('0x8'));router[_0xb79c('0x9')](_0xb79c('0xa'),auth['isAuthenticated'](),controller[_0xb79c('0xb')]);router[_0xb79c('0xc')](_0xb79c('0xa'),auth['isAuthenticated'](),controller[_0xb79c('0xd')]);module[_0xb79c('0xe')]=router;
\ No newline at end of file
+var _0x22a2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','delete','destroy'];(function(_0xe67418,_0x445c58){var _0x58f718=function(_0x35d357){while(--_0x35d357){_0xe67418['push'](_0xe67418['shift']());}};_0x58f718(++_0x445c58);}(_0x22a2,0xf7));var _0x222a=function(_0x262c73,_0x5150be){_0x262c73=_0x262c73-0x0;var _0x4e9d07=_0x22a2[_0x262c73];return _0x4e9d07;};'use strict';var multer=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var path=require(_0x222a('0x2'));var timeout=require(_0x222a('0x3'));var express=require(_0x222a('0x4'));var router=express[_0x222a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x222a('0x6'));var interaction=require(_0x222a('0x7'));var config=require(_0x222a('0x8'));var controller=require('./action.controller');router[_0x222a('0x9')]('/:id',auth[_0x222a('0xa')](),controller['update']);router[_0x222a('0xb')]('/:id',auth[_0x222a('0xa')](),controller[_0x222a('0xc')]);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 81b6e53..df414e7 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x4ccb98,_0x50bbf6){var _0x2385aa=function(_0x40c1e5){while(--_0x40c1e5){_0x4ccb98['push'](_0x4ccb98['shift']());}};_0x2385aa(++_0x50bbf6);}(_0x98a8,0x12c));var _0x898a=function(_0x5ed353,_0x1dff87){_0x5ed353=_0x5ed353-0x0;var _0x59f15f=_0x98a8[_0x5ed353];return _0x59f15f;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5df5e8,_0x1eff29){_0x5df5e8=_0x5df5e8-0x0;var _0x4954b5=_0xdc97[_0x5df5e8];return _0x4954b5;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index dd9c5fa..1066d8d 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 _0x3aee=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','end','status','offset','undefined','count','limit','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','MetricId','metric','field','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','value','Please\x20insert\x20at\x20least\x20one\x20field','select','from','groupBy','clone','web','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','AVG(%s)','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware'];(function(_0x492375,_0xcdc033){var _0x507fd7=function(_0x184211){while(--_0x184211){_0x492375['push'](_0x492375['shift']());}};_0x507fd7(++_0xcdc033);}(_0x3aee,0x131));var _0xe3ae=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x3aee[_0x255ac0];return _0x437bf1;};'use strict';var emlformat=require(_0xe3ae('0x0'));var rimraf=require(_0xe3ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ae('0x2'));var rp=require(_0xe3ae('0x3'));var moment=require(_0xe3ae('0x4'));var BPromise=require(_0xe3ae('0x5'));var Mustache=require(_0xe3ae('0x6'));var util=require(_0xe3ae('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe3ae('0x8'));var ejs=require(_0xe3ae('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ae('0xa'));var _=require(_0xe3ae('0xb'));var squel=require(_0xe3ae('0xc'));var crypto=require(_0xe3ae('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe3ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe3ae('0xf'));var Papa=require(_0xe3ae('0x10'));var Redis=require(_0xe3ae('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3ae('0x12'));var logger=require(_0xe3ae('0x13'))(_0xe3ae('0x14'));var utils=require(_0xe3ae('0x15'));var config=require(_0xe3ae('0x16'));var licenseUtil=require(_0xe3ae('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe3ae('0x18')];function respondWithStatusCode(_0x3b4915,_0x51fb1d){_0x51fb1d=_0x51fb1d||0xcc;return function(_0x4c07b6){if(_0x4c07b6){return _0x3b4915[_0xe3ae('0x19')](_0x51fb1d);}return _0x3b4915['status'](_0x51fb1d)[_0xe3ae('0x1a')]();};}function respondWithResult(_0x16eb0d,_0x6ecd9b){_0x6ecd9b=_0x6ecd9b||0xc8;return function(_0x22c790){if(_0x22c790){return _0x16eb0d[_0xe3ae('0x1b')](_0x6ecd9b)['json'](_0x22c790);}};}function respondWithFilteredResult(_0xc17690,_0x4b5826){return function(_0x4e505a){if(_0x4e505a){var _0x34ba70=typeof _0x4b5826[_0xe3ae('0x1c')]===_0xe3ae('0x1d')&&typeof _0x4b5826['limit']===_0xe3ae('0x1d');var _0x1cd220=_0x4e505a['count'];var _0x34f11f=_0x34ba70?0x0:_0x4b5826['offset'];var _0x3522c0=_0x34ba70?_0x4e505a[_0xe3ae('0x1e')]:_0x4b5826[_0xe3ae('0x1c')]+_0x4b5826[_0xe3ae('0x1f')];var _0x2272c0;if(_0x3522c0>=_0x1cd220){_0x3522c0=_0x1cd220;_0x2272c0=0xc8;}else{_0x2272c0=0xce;}_0xc17690[_0xe3ae('0x1b')](_0x2272c0);return _0xc17690['set']('Content-Range',_0x34f11f+'-'+_0x3522c0+'/'+_0x1cd220)[_0xe3ae('0x20')](_0x4e505a);}return null;};}function patchUpdates(_0x45b2c4){return function(_0x42ce83){try{jsonpatch['apply'](_0x42ce83,_0x45b2c4,!![]);}catch(_0x28b092){return BPromise[_0xe3ae('0x21')](_0x28b092);}return _0x42ce83[_0xe3ae('0x22')]();};}function saveUpdates(_0x14aa59,_0x2b07e8){return function(_0x451ec1){if(_0x451ec1){return _0x451ec1[_0xe3ae('0x23')](_0x14aa59)[_0xe3ae('0x24')](function(_0x42b68f){return _0x42b68f;});}return null;};}function removeEntity(_0x36225b,_0x56b4f2){return function(_0x9e7ce0){if(_0x9e7ce0){return _0x9e7ce0[_0xe3ae('0x25')]()[_0xe3ae('0x24')](function(){var _0x5c1efa=_0x9e7ce0[_0xe3ae('0x26')]({'plain':!![]});var _0x2eaeed=_0xe3ae('0x27');return db[_0xe3ae('0x28')]['destroy']({'where':{'type':_0x2eaeed,'resourceId':_0x5c1efa['id']}})[_0xe3ae('0x24')](function(){return _0x9e7ce0;});})[_0xe3ae('0x24')](function(){_0x36225b[_0xe3ae('0x1b')](0xcc)[_0xe3ae('0x1a')]();});}};}function handleEntityNotFound(_0x52b822,_0x4c0a5c){return function(_0x156b78){if(!_0x156b78){_0x52b822[_0xe3ae('0x19')](0x194);}return _0x156b78;};}function handleError(_0x2ed03a,_0x540bd5){_0x540bd5=_0x540bd5||0x1f4;return function(_0x3d67e1){logger['error'](_0x3d67e1[_0xe3ae('0x29')]);if(_0x3d67e1['name']){delete _0x3d67e1[_0xe3ae('0x2a')];}_0x2ed03a[_0xe3ae('0x1b')](_0x540bd5)[_0xe3ae('0x2b')](_0x3d67e1);};}exports[_0xe3ae('0x2c')]=function(_0x2d5b70,_0x99520e){var _0x312454={},_0x26f52e={},_0x234c08={'count':0x0,'rows':[]};var _0x14d09d=_[_0xe3ae('0x2d')](db[_0xe3ae('0x2e')][_0xe3ae('0x2f')],function(_0x265f8e){return{'name':_0x265f8e['fieldName'],'type':_0x265f8e[_0xe3ae('0x30')][_0xe3ae('0x31')]};});_0x26f52e[_0xe3ae('0x32')]=_['map'](_0x14d09d,'name');_0x26f52e[_0xe3ae('0x33')]=_['keys'](_0x2d5b70[_0xe3ae('0x33')]);_0x26f52e[_0xe3ae('0x34')]=_[_0xe3ae('0x35')](_0x26f52e['model'],_0x26f52e[_0xe3ae('0x33')]);_0x312454[_0xe3ae('0x36')]=_[_0xe3ae('0x35')](_0x26f52e[_0xe3ae('0x32')],qs[_0xe3ae('0x37')](_0x2d5b70[_0xe3ae('0x33')]['fields']));_0x312454[_0xe3ae('0x36')]=_0x312454[_0xe3ae('0x36')][_0xe3ae('0x38')]?_0x312454[_0xe3ae('0x36')]:_0x26f52e[_0xe3ae('0x32')];if(!_0x2d5b70['query']['hasOwnProperty'](_0xe3ae('0x39'))){_0x312454[_0xe3ae('0x1f')]=qs[_0xe3ae('0x1f')](_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x1f')]);_0x312454[_0xe3ae('0x1c')]=qs[_0xe3ae('0x1c')](_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x1c')]);}_0x312454['order']=qs[_0xe3ae('0x3a')](_0x2d5b70['query'][_0xe3ae('0x3a')]);_0x312454[_0xe3ae('0x3b')]=qs[_0xe3ae('0x34')](_[_0xe3ae('0x3c')](_0x2d5b70[_0xe3ae('0x33')],_0x26f52e[_0xe3ae('0x34')]),_0x14d09d);if(_0x2d5b70[_0xe3ae('0x33')]['filter']){_0x312454[_0xe3ae('0x3b')]=_[_0xe3ae('0x3d')](_0x312454[_0xe3ae('0x3b')],{'$or':_[_0xe3ae('0x2d')](_0x14d09d,function(_0x2271a1){if(_0x2271a1[_0xe3ae('0x30')]!==_0xe3ae('0x3e')){var _0x83b798={};_0x83b798[_0x2271a1[_0xe3ae('0x2a')]]={'$like':'%'+_0x2d5b70[_0xe3ae('0x33')]['filter']+'%'};return _0x83b798;}})});}_0x312454=_[_0xe3ae('0x3d')]({},_0x312454,_0x2d5b70['options']);var _0x151fa6={'where':_0x312454[_0xe3ae('0x3b')]};return db[_0xe3ae('0x2e')][_0xe3ae('0x1e')](_0x151fa6)['then'](function(_0x27080f){_0x234c08[_0xe3ae('0x1e')]=_0x27080f;if(_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x3f')]){_0x312454[_0xe3ae('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe3ae('0x41')](_0x312454);})[_0xe3ae('0x24')](function(_0x38d643){_0x234c08['rows']=_0x38d643;return _0x234c08;})[_0xe3ae('0x24')](respondWithFilteredResult(_0x99520e,_0x312454))[_0xe3ae('0x42')](handleError(_0x99520e,null));};exports['show']=function(_0x3e2de9,_0x28f8eb){var _0x5b00a9={'raw':![],'where':{'id':_0x3e2de9[_0xe3ae('0x43')]['id']}},_0xcbd164={};_0xcbd164[_0xe3ae('0x32')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0xcbd164['query']=_[_0xe3ae('0x44')](_0x3e2de9[_0xe3ae('0x33')]);_0xcbd164[_0xe3ae('0x34')]=_['intersection'](_0xcbd164['model'],_0xcbd164['query']);_0x5b00a9[_0xe3ae('0x36')]=_[_0xe3ae('0x35')](_0xcbd164['model'],qs[_0xe3ae('0x37')](_0x3e2de9[_0xe3ae('0x33')][_0xe3ae('0x37')]));_0x5b00a9[_0xe3ae('0x36')]=_0x5b00a9['attributes'][_0xe3ae('0x38')]?_0x5b00a9['attributes']:_0xcbd164['model'];if(_0x3e2de9[_0xe3ae('0x33')][_0xe3ae('0x3f')]){_0x5b00a9['include']=[{'all':!![]}];}_0x5b00a9=_[_0xe3ae('0x3d')]({},_0x5b00a9,_0x3e2de9[_0xe3ae('0x45')]);return db[_0xe3ae('0x2e')]['find'](_0x5b00a9)['then'](handleEntityNotFound(_0x28f8eb,null))[_0xe3ae('0x24')](respondWithResult(_0x28f8eb,null))[_0xe3ae('0x42')](handleError(_0x28f8eb,null));};exports['create']=function(_0x206234,_0x11681f){return db['AnalyticCustomReport'][_0xe3ae('0x46')](_0x206234[_0xe3ae('0x47')],{})['then'](function(_0x46bc95){var _0x41f07d=_0x206234['user'][_0xe3ae('0x26')]({'plain':!![]});if(!_0x41f07d)throw new Error(_0xe3ae('0x48'));if(_0x41f07d[_0xe3ae('0x49')]==='user'){var _0x42e987=_0x46bc95[_0xe3ae('0x26')]({'plain':!![]});var _0x2b1c17=_0xe3ae('0x4a');return db[_0xe3ae('0x4b')][_0xe3ae('0x4c')]({'where':{'name':_0x2b1c17,'userProfileId':_0x41f07d[_0xe3ae('0x4d')]},'raw':!![]})['then'](function(_0x59fd0e){if(_0x59fd0e&&_0x59fd0e['autoAssociation']===0x0){return db[_0xe3ae('0x28')][_0xe3ae('0x46')]({'name':_0x42e987['name'],'resourceId':_0x42e987['id'],'type':_0xe3ae('0x27'),'sectionId':_0x59fd0e['id']},{})['then'](function(){return _0x46bc95;});}else{return _0x46bc95;}})[_0xe3ae('0x42')](function(_0x1dd124){logger['error'](_0xe3ae('0x4e'),_0x1dd124);throw _0x1dd124;});}return _0x46bc95;})[_0xe3ae('0x24')](respondWithResult(_0x11681f,0xc9))[_0xe3ae('0x42')](handleError(_0x11681f,null));};exports[_0xe3ae('0x23')]=function(_0xe599a7,_0x3cf9e6){if(_0xe599a7[_0xe3ae('0x47')]['id']){delete _0xe599a7[_0xe3ae('0x47')]['id'];}return db[_0xe3ae('0x2e')]['find']({'where':{'id':_0xe599a7['params']['id']}})[_0xe3ae('0x24')](handleEntityNotFound(_0x3cf9e6,null))[_0xe3ae('0x24')](saveUpdates(_0xe599a7[_0xe3ae('0x47')],null))[_0xe3ae('0x24')](respondWithResult(_0x3cf9e6,null))[_0xe3ae('0x42')](handleError(_0x3cf9e6,null));};exports[_0xe3ae('0x25')]=function(_0x37737e,_0x3c0fca){return db[_0xe3ae('0x2e')][_0xe3ae('0x4c')]({'where':{'id':_0x37737e[_0xe3ae('0x43')]['id']}})[_0xe3ae('0x24')](handleEntityNotFound(_0x3c0fca,null))[_0xe3ae('0x24')](removeEntity(_0x3c0fca,null))[_0xe3ae('0x42')](handleError(_0x3c0fca,null));};exports['preview']=function(_0x40be3c,_0x1f03e9){var _0x21772e=0xa;var _0x52f49f=[_0xe3ae('0x4f'),_0xe3ae('0x50'),'right_join',_0xe3ae('0x51')];var _0x47a824={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':_0xe3ae('0x54'),'MAX':'MAX(%s)','MIN':_0xe3ae('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe3ae('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0x1a889e={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':_0xe3ae('0x5a')};var _0x58f361=function(_0x4d8daf){return!_[_0xe3ae('0x5b')](['IS\x20NULL',_0xe3ae('0x5c'),_0xe3ae('0x5d'),'IS\x20NOT\x20EMPTY'],_0x4d8daf);};var _0x454160=function(_0x34e85f){if(!_0x34e85f||!_0x34e85f[_0xe3ae('0x5e')][_0xe3ae('0x38')]){return'';}for(var _0x4b153d='(',_0x21b6bf=0x0;_0x21b6bf<_0x34e85f['rules'][_0xe3ae('0x38')];_0x21b6bf+=0x1){_0x21b6bf>0x0&&(_0x4b153d+='\x20'+_0x34e85f[_0xe3ae('0x5f')]+'\x20');_0x4b153d+=_0x34e85f['rules'][_0x21b6bf][_0xe3ae('0x60')]?_0x454160(_0x34e85f['rules'][_0x21b6bf]['group']):_0x34e85f['rules'][_0x21b6bf]['field']+'\x20'+_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf][_0xe3ae('0x61')]+(_0x58f361(_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf][_0xe3ae('0x61')])?'\x20'+_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf]['value']:'');}return _0x4b153d+')';};var _0x226533={'where':{'id':_0x40be3c[_0xe3ae('0x43')]['id']}},_0x170745,_0x1c63ed,_0x4f2671,_0x6b7d1e,_0x5d8fb0;_0x226533=_[_0xe3ae('0x3d')]({},_0x226533,_0x40be3c[_0xe3ae('0x45')]);return db['AnalyticCustomReport'][_0xe3ae('0x4c')](_0x226533)['then'](function(_0x46ecf3){if(_0x46ecf3){_0x170745=_0x46ecf3;return _0x46ecf3['getFields']();}return null;})[_0xe3ae('0x24')](function(_0xc54a58){if(_0xc54a58){if(!_0xc54a58[_0xe3ae('0x38')]){throw new db[(_0xe3ae('0x62'))][(_0xe3ae('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1c63ed=_0xc54a58;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x6c558b){if(_0x6c558b){_0x4f2671=_[_0xe3ae('0x65')](_0x6c558b,'id');var _0x3041b3;var _0x1e0703=squel['select']();_0x1e0703['from'](_0x170745['table']);for(var _0x293345=0x0;_0x293345<_0x1c63ed['length'];_0x293345+=0x1){_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x66')]?_0x4f2671[_0x1c63ed[_0x293345][_0xe3ae('0x66')]][_0xe3ae('0x67')]:_0x1c63ed[_0x293345][_0xe3ae('0x68')];_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x69')]?_[_0xe3ae('0x6a')](_0x47a824[_0x1c63ed[_0x293345][_0xe3ae('0x69')]],'%s',_0x3041b3):_0x3041b3;_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x6b')]?_[_0xe3ae('0x6a')](_0x1a889e[_0x1c63ed[_0x293345]['format']],'%s',_0x3041b3):_0x3041b3;if(_0x1c63ed[_0x293345]['groupBy']){_0x1e0703['group'](_0x3041b3);}_0x1c63ed[_0x293345][_0xe3ae('0x6c')]&&_0x1e0703[_0xe3ae('0x6d')](_0x3041b3,_0x1c63ed[_0x293345][_0xe3ae('0x6c')]===_0xe3ae('0x6e')?![]:!![]);_0x1e0703[_0xe3ae('0x68')](_0x3041b3,_0x1c63ed[_0x293345][_0xe3ae('0x6f')]||_0x3041b3);}if(_0x170745[_0xe3ae('0x70')]){_0x170745[_0xe3ae('0x70')]=JSON[_0xe3ae('0x71')](_0x170745[_0xe3ae('0x70')]);for(var _0x40bf63=0x0;_0x40bf63<_0x170745[_0xe3ae('0x70')][_0xe3ae('0x38')];_0x40bf63+=0x1){if(_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x30')]&&_[_0xe3ae('0x5b')](_0x52f49f,_0x170745[_0xe3ae('0x70')][_0x40bf63]['type'])&&_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x72')]&&_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x73')]&&_0x170745[_0xe3ae('0x70')][_0x40bf63]['foreignKey']){_0x1e0703[_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x30')]](_0x170745['joins'][_0x40bf63]['foreignTable'],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x170745[_0xe3ae('0x75')],_0x170745['joins'][_0x40bf63][_0xe3ae('0x72')],_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x73')],_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x76')]));}}}if(_0x170745[_0xe3ae('0x77')]){_0x170745[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x170745[_0xe3ae('0x77')]);_0x1e0703['where'](_0x454160(_0x170745[_0xe3ae('0x77')][_0xe3ae('0x60')]));}_0x5d8fb0=_0x1e0703['clone']();_0x1e0703[_0xe3ae('0x1f')](_0x21772e);_0x1e0703['offset'](0x0);logger[_0xe3ae('0x78')](_0xe3ae('0x79'),_0x1e0703[_0xe3ae('0x7a')]());return dbH['sequelize']['query'](_0x1e0703[_0xe3ae('0x7a')](),{'type':dbH[_0xe3ae('0x7b')][_0xe3ae('0x7c')][_0xe3ae('0x7d')]});}})[_0xe3ae('0x24')](respondWithResult(_0x1f03e9,null))[_0xe3ae('0x42')](handleError(_0x1f03e9,null));};function runReport(_0x5dc21d,_0x390a2a,_0x35aeac){var _0x30824a=_0x390a2a['name'];var _0x5cbabe=0xa;var _0x5aba03=[_0xe3ae('0x4f'),_0xe3ae('0x50'),_0xe3ae('0x7e'),_0xe3ae('0x51')];var _0x58e092={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe3ae('0x7f'),'MIN':_0xe3ae('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe3ae('0x80'),'GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0xe139a6={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':_0xe3ae('0x81'),'HOUR':_0xe3ae('0x82'),'ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e8e29=function(_0x167eb3){return!_[_0xe3ae('0x5b')]([_0xe3ae('0x83'),_0xe3ae('0x5c'),_0xe3ae('0x5d'),_0xe3ae('0x84')],_0x167eb3);};var _0x379986=function(_0x4f0532){if(!_0x4f0532||!_0x4f0532['rules'][_0xe3ae('0x38')]){return'';}for(var _0x2c54e7='(',_0x3ad5ca=0x0;_0x3ad5ca<_0x4f0532['rules'][_0xe3ae('0x38')];_0x3ad5ca+=0x1){_0x3ad5ca>0x0&&(_0x2c54e7+='\x20'+_0x4f0532[_0xe3ae('0x5f')]+'\x20');_0x2c54e7+=_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x60')]?_0x379986(_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['group']):_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['field']+'\x20'+_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x61')]+(_0x1e8e29(_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['condition'])?'\x20'+_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x85')]:'');}return _0x2c54e7+')';};var _0x4164bd={'where':{'id':_0x5dc21d['id']}},_0x5eb360,_0x55e634,_0x5070b0,_0x3ffab1,_0x1e9b60;_0x4164bd=_[_0xe3ae('0x3d')]({},_0x4164bd,_0x35aeac);return db[_0xe3ae('0x2e')][_0xe3ae('0x4c')](_0x4164bd)[_0xe3ae('0x24')](function(_0x4cb140){if(_0x4cb140){_0x5eb360=_0x4cb140;return _0x4cb140['getFields']();}return null;})[_0xe3ae('0x24')](function(_0x9b68fb){if(_0x9b68fb){if(!_0x9b68fb['length']){throw new db[(_0xe3ae('0x62'))]['ValidationErrorItem'](_0xe3ae('0x86'),0x193);}_0x55e634=_0x9b68fb;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x405609){if(_0x405609){_0x5070b0=_[_0xe3ae('0x65')](_0x405609,'id');var _0x5381ee;var _0xaf2da4=squel[_0xe3ae('0x87')]();_0xaf2da4[_0xe3ae('0x88')](_0x5eb360[_0xe3ae('0x75')]);for(var _0x40e21d=0x0;_0x40e21d<_0x55e634[_0xe3ae('0x38')];_0x40e21d+=0x1){_0x5381ee=_0x55e634[_0x40e21d][_0xe3ae('0x66')]?_0x5070b0[_0x55e634[_0x40e21d]['MetricId']][_0xe3ae('0x67')]:_0x55e634[_0x40e21d][_0xe3ae('0x68')];_0x5381ee=_0x55e634[_0x40e21d]['function']?_[_0xe3ae('0x6a')](_0x58e092[_0x55e634[_0x40e21d][_0xe3ae('0x69')]],'%s',_0x5381ee):_0x5381ee;_0x5381ee=_0x55e634[_0x40e21d]['format']?_[_0xe3ae('0x6a')](_0xe139a6[_0x55e634[_0x40e21d][_0xe3ae('0x6b')]],'%s',_0x5381ee):_0x5381ee;if(_0x55e634[_0x40e21d][_0xe3ae('0x89')]){_0xaf2da4[_0xe3ae('0x60')](_0x5381ee);}_0x55e634[_0x40e21d]['orderBy']&&_0xaf2da4['order'](_0x5381ee,_0x55e634[_0x40e21d]['orderBy']==='DESC'?![]:!![]);_0xaf2da4[_0xe3ae('0x68')](_0x5381ee,_0x55e634[_0x40e21d][_0xe3ae('0x6f')]||_0x5381ee);}if(_0x5eb360[_0xe3ae('0x70')]){_0x5eb360['joins']=JSON['parse'](_0x5eb360[_0xe3ae('0x70')]);for(var _0x40c6c0=0x0;_0x40c6c0<_0x5eb360[_0xe3ae('0x70')][_0xe3ae('0x38')];_0x40c6c0+=0x1){if(_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')]&&_[_0xe3ae('0x5b')](_0x5aba03,_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')])&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x72')]&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0]['foreignTable']&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0]['foreignKey']){_0xaf2da4[_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')]](_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x73')],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x5eb360['table'],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x72')],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x73')],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x76')]));}}}if(_0x5eb360[_0xe3ae('0x77')]){_0x5eb360[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x5eb360[_0xe3ae('0x77')]);_0xaf2da4['where'](_0x379986(_0x5eb360[_0xe3ae('0x77')]['group']));}_0x1e9b60=_0xaf2da4[_0xe3ae('0x8a')]();_0xaf2da4[_0xe3ae('0x1f')](_0x5cbabe);_0xaf2da4[_0xe3ae('0x1c')](0x0);return;}})['then'](function(){if(_0x390a2a['output']===_0xe3ae('0x8b')){return null;}var _0x136196=_[_0xe3ae('0x3d')](_0x390a2a,{'name':_0x390a2a['fullPath']||_0x390a2a[_0xe3ae('0x2a')]||_0x5eb360[_0xe3ae('0x2a')],'basename':_0x30824a,'savename':util[_0xe3ae('0x6b')](_0xe3ae('0x8c'),_0x390a2a[_0xe3ae('0x2a')]||_0x5eb360[_0xe3ae('0x2a')],require(_0xe3ae('0x8d'))[_0xe3ae('0x8e')](0x4),_0x390a2a[_0xe3ae('0x8f')]||_0xe3ae('0x90')),'reportId':_0x5eb360['id'],'reportType':'custom'});return db[_0xe3ae('0x91')]['create'](_0x136196,{'raw':!![]});})[_0xe3ae('0x24')](function(_0x1ce822){if(_0x5eb360[_0xe3ae('0x75')]===_0xe3ae('0x92')){_0x1e9b60[_0xe3ae('0x3b')](_0x5eb360[_0xe3ae('0x75')]+_0xe3ae('0x93'),_0x390a2a[_0xe3ae('0x94')],_0x390a2a[_0xe3ae('0x95')]);}else{_0x1e9b60[_0xe3ae('0x3b')](_0x5eb360[_0xe3ae('0x75')]+_0xe3ae('0x96'),_0x390a2a[_0xe3ae('0x94')],_0x390a2a[_0xe3ae('0x95')]);}if(_0x1ce822){logger[_0xe3ae('0x97')](_0xe3ae('0x98'),_0x1e9b60[_0xe3ae('0x7a')]());require(_0xe3ae('0x99'))[_0xe3ae('0x9a')](path['join'](__dirname,_0xe3ae('0x9b'),_0x1ce822[_0xe3ae('0x8f')]),[_0x1ce822['id'],_0x1e9b60[_0xe3ae('0x7a')](),path[_0xe3ae('0x4f')](__dirname,_0xe3ae('0x9c'),_0x1ce822[_0xe3ae('0x9d')]),_0x30824a]);return _0x1ce822;}else{var _0x341ffd=squel[_0xe3ae('0x87')]();_0x341ffd[_0xe3ae('0x88')]('('+_0x1e9b60['toString']()+')',_0xe3ae('0x9e'));_0x341ffd[_0xe3ae('0x68')]('COUNT(*)',_0xe3ae('0x1e'));_0x1e9b60[_0xe3ae('0x1f')](_0x390a2a[_0xe3ae('0x1f')]||_0x5cbabe);_0x1e9b60[_0xe3ae('0x1c')](_0x390a2a['offset']||0x0);return dbH[_0xe3ae('0x7b')][_0xe3ae('0x33')](_0x341ffd[_0xe3ae('0x7a')](),{'type':dbH[_0xe3ae('0x7b')][_0xe3ae('0x7c')][_0xe3ae('0x7d')]})[_0xe3ae('0x24')](function(_0xfe9e73){if(!_0xfe9e73['length']){_0x3ffab1=0x0;}else{_0x3ffab1=_0xfe9e73[0x0][_0xe3ae('0x1e')]||0x0;}return dbH[_0xe3ae('0x7b')][_0xe3ae('0x33')](_0x1e9b60['toString'](),{'type':dbH[_0xe3ae('0x7b')]['QueryTypes'][_0xe3ae('0x7d')]});})[_0xe3ae('0x24')](function(_0x2d23a9){return{'rows':_0x2d23a9||[],'count':_0x3ffab1};});}});}exports['run']=function(_0x323040,_0x1563f8){return runReport(_0x323040['params'],_0x323040[_0xe3ae('0x33')],_0x323040[_0xe3ae('0x45')])['then'](respondWithResult(_0x1563f8,null))[_0xe3ae('0x42')](handleError(_0x1563f8,null));};exports[_0xe3ae('0x9f')]=runReport;exports[_0xe3ae('0x33')]=function(_0x9d3d22,_0x3c3d81){var _0x5b5042=0xa;var _0x4785ea=[_0xe3ae('0x4f'),_0xe3ae('0x50'),_0xe3ae('0x7e'),_0xe3ae('0x51')];var _0x4f394c={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe3ae('0x7f'),'MIN':_0xe3ae('0x55'),'AVG':_0xe3ae('0xa0'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe3ae('0x80'),'GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0x84d115={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':_0xe3ae('0x81'),'HOUR':_0xe3ae('0x82'),'ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':_0xe3ae('0x5a')};var _0x5a7f29=function(_0x5431e5){return!_[_0xe3ae('0x5b')]([_0xe3ae('0x83'),_0xe3ae('0x5c'),'IS\x20EMPTY',_0xe3ae('0x84')],_0x5431e5);};var _0x2c2e8e=function(_0x22c379){if(!_0x22c379||!_0x22c379[_0xe3ae('0x5e')][_0xe3ae('0x38')]){return'';}for(var _0xb8869d='(',_0x3be6cb=0x0;_0x3be6cb<_0x22c379[_0xe3ae('0x5e')][_0xe3ae('0x38')];_0x3be6cb+=0x1){_0x3be6cb>0x0&&(_0xb8869d+='\x20'+_0x22c379[_0xe3ae('0x5f')]+'\x20');_0xb8869d+=_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x60')]?_0x2c2e8e(_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x60')]):_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x68')]+'\x20'+_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x61')]+(_0x5a7f29(_0x22c379['rules'][_0x3be6cb][_0xe3ae('0x61')])?'\x20'+_0x22c379['rules'][_0x3be6cb]['value']:'');}return _0xb8869d+')';};var _0x158a85={'where':{'id':_0x9d3d22['params']['id']}},_0x32bb6d,_0x2094c7,_0x2588ef,_0x6c6485,_0x2f3702;_0x158a85=_['merge']({},_0x158a85,_0x9d3d22['options']);return db['AnalyticCustomReport'][_0xe3ae('0x4c')](_0x158a85)[_0xe3ae('0x24')](function(_0x441e52){if(_0x441e52){_0x32bb6d=_0x441e52;return _0x441e52[_0xe3ae('0xa1')]();}return null;})[_0xe3ae('0x24')](function(_0x3898a0){if(_0x3898a0){if(!_0x3898a0[_0xe3ae('0x38')]){throw new db[(_0xe3ae('0x62'))][(_0xe3ae('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2094c7=_0x3898a0;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x201400){if(_0x201400){_0x2588ef=_[_0xe3ae('0x65')](_0x201400,'id');var _0x3fb853;var _0x401da5=squel[_0xe3ae('0x87')]();_0x401da5['from'](_0x32bb6d[_0xe3ae('0x75')]);for(var _0x8c8dd0=0x0;_0x8c8dd0<_0x2094c7[_0xe3ae('0x38')];_0x8c8dd0+=0x1){_0x3fb853=_0x2094c7[_0x8c8dd0][_0xe3ae('0x66')]?_0x2588ef[_0x2094c7[_0x8c8dd0][_0xe3ae('0x66')]][_0xe3ae('0x67')]:_0x2094c7[_0x8c8dd0][_0xe3ae('0x68')];_0x3fb853=_0x2094c7[_0x8c8dd0]['function']?_[_0xe3ae('0x6a')](_0x4f394c[_0x2094c7[_0x8c8dd0][_0xe3ae('0x69')]],'%s',_0x3fb853):_0x3fb853;_0x3fb853=_0x2094c7[_0x8c8dd0]['format']?_[_0xe3ae('0x6a')](_0x84d115[_0x2094c7[_0x8c8dd0]['format']],'%s',_0x3fb853):_0x3fb853;if(_0x2094c7[_0x8c8dd0]['groupBy']){_0x401da5[_0xe3ae('0x60')](_0x3fb853);}_0x2094c7[_0x8c8dd0][_0xe3ae('0x6c')]&&_0x401da5[_0xe3ae('0x6d')](_0x3fb853,_0x2094c7[_0x8c8dd0][_0xe3ae('0x6c')]===_0xe3ae('0x6e')?![]:!![]);_0x401da5['field'](_0x3fb853,_0x2094c7[_0x8c8dd0][_0xe3ae('0x6f')]||_0x3fb853);}if(_0x32bb6d['joins']){_0x32bb6d[_0xe3ae('0x70')]=JSON[_0xe3ae('0x71')](_0x32bb6d[_0xe3ae('0x70')]);for(var _0x4ebbd4=0x0;_0x4ebbd4<_0x32bb6d['joins'][_0xe3ae('0x38')];_0x4ebbd4+=0x1){if(_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x30')]&&_['includes'](_0x4785ea,_0x32bb6d['joins'][_0x4ebbd4]['type'])&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x72')]&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4]['foreignTable']&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x76')]){_0x401da5[_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x30')]](_0x32bb6d['joins'][_0x4ebbd4][_0xe3ae('0x73')],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x32bb6d[_0xe3ae('0x75')],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x72')],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4]['foreignTable'],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x76')]));}}}if(_0x32bb6d[_0xe3ae('0x77')]){_0x32bb6d[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x32bb6d[_0xe3ae('0x77')]);_0x401da5['where'](_0x2c2e8e(_0x32bb6d['conditions'][_0xe3ae('0x60')]));}_0x2f3702=_0x401da5[_0xe3ae('0x8a')]();_0x401da5['limit'](_0x5b5042);_0x401da5[_0xe3ae('0x1c')](0x0);logger[_0xe3ae('0x78')](_0xe3ae('0x79'),_0x401da5[_0xe3ae('0x7a')]());return dbH[_0xe3ae('0x7b')]['query'](_0x401da5[_0xe3ae('0x7a')](),{'type':dbH['sequelize'][_0xe3ae('0x7c')][_0xe3ae('0x7d')]});}})[_0xe3ae('0x24')](function(){return{'sql':_0x2f3702[_0xe3ae('0x7a')]()};})[_0xe3ae('0x24')](respondWithResult(_0x3c3d81,null))[_0xe3ae('0x42')](handleError(_0x3c3d81,null));};
\ No newline at end of file
+var _0xdee7=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','operator','ValidationErrorItem','%s.%s\x20=\x20%s.%s','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','ROUND(%s)','Sequelize','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/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','fields','length','find','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','left_join'];(function(_0x2e3153,_0x558652){var _0x12b2ab=function(_0x5e36fc){while(--_0x5e36fc){_0x2e3153['push'](_0x2e3153['shift']());}};_0x12b2ab(++_0x558652);}(_0xdee7,0xf1));var _0x7dee=function(_0x66a658,_0x592749){_0x66a658=_0x66a658-0x0;var _0x21331f=_0xdee7[_0x66a658];return _0x21331f;};'use strict';var emlformat=require(_0x7dee('0x0'));var rimraf=require(_0x7dee('0x1'));var zipdir=require(_0x7dee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dee('0x3'));var moment=require(_0x7dee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7dee('0x5'));var util=require(_0x7dee('0x6'));var path=require(_0x7dee('0x7'));var sox=require(_0x7dee('0x8'));var csv=require(_0x7dee('0x9'));var ejs=require(_0x7dee('0xa'));var fs=require('fs');var fs_extra=require(_0x7dee('0xb'));var _=require(_0x7dee('0xc'));var squel=require(_0x7dee('0xd'));var crypto=require(_0x7dee('0xe'));var jsforce=require(_0x7dee('0xf'));var deskjs=require(_0x7dee('0x10'));var toCsv=require(_0x7dee('0x9'));var querystring=require('querystring');var Papa=require(_0x7dee('0x11'));var Redis=require(_0x7dee('0x12'));var authService=require(_0x7dee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7dee('0x14'))('api');var utils=require(_0x7dee('0x15'));var config=require(_0x7dee('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7dee('0x17'))['db'];var dbH=require(_0x7dee('0x17'))[_0x7dee('0x18')];function respondWithStatusCode(_0x15cab1,_0x3596e4){_0x3596e4=_0x3596e4||0xcc;return function(_0x52ed3){if(_0x52ed3){return _0x15cab1[_0x7dee('0x19')](_0x3596e4);}return _0x15cab1[_0x7dee('0x1a')](_0x3596e4)[_0x7dee('0x1b')]();};}function respondWithResult(_0xb158c0,_0x3cfc94){_0x3cfc94=_0x3cfc94||0xc8;return function(_0x461470){if(_0x461470){return _0xb158c0[_0x7dee('0x1a')](_0x3cfc94)['json'](_0x461470);}};}function respondWithFilteredResult(_0x1b39f1,_0xcfda31){return function(_0x15c3ab){if(_0x15c3ab){var _0xaff14f=typeof _0xcfda31[_0x7dee('0x1c')]===_0x7dee('0x1d')&&typeof _0xcfda31[_0x7dee('0x1e')]===_0x7dee('0x1d');var _0x1a8b0b=_0x15c3ab[_0x7dee('0x1f')];var _0x2352be=_0xaff14f?0x0:_0xcfda31[_0x7dee('0x1c')];var _0x55e8e7=_0xaff14f?_0x15c3ab[_0x7dee('0x1f')]:_0xcfda31[_0x7dee('0x1c')]+_0xcfda31['limit'];var _0x281558;if(_0x55e8e7>=_0x1a8b0b){_0x55e8e7=_0x1a8b0b;_0x281558=0xc8;}else{_0x281558=0xce;}_0x1b39f1[_0x7dee('0x1a')](_0x281558);return _0x1b39f1[_0x7dee('0x20')](_0x7dee('0x21'),_0x2352be+'-'+_0x55e8e7+'/'+_0x1a8b0b)[_0x7dee('0x22')](_0x15c3ab);}return null;};}function patchUpdates(_0x11e1af){return function(_0x136251){try{jsonpatch[_0x7dee('0x23')](_0x136251,_0x11e1af,!![]);}catch(_0x1be151){return BPromise[_0x7dee('0x24')](_0x1be151);}return _0x136251[_0x7dee('0x25')]();};}function saveUpdates(_0x4a57fd,_0x360214){return function(_0x3a5b0a){if(_0x3a5b0a){return _0x3a5b0a[_0x7dee('0x26')](_0x4a57fd)[_0x7dee('0x27')](function(_0x370b4e){return _0x370b4e;});}return null;};}function removeEntity(_0x4763d6,_0x526277){return function(_0x247528){if(_0x247528){return _0x247528['destroy']()['then'](function(){var _0x5af77b=_0x247528[_0x7dee('0x28')]({'plain':!![]});var _0xcd2c61=_0x7dee('0x29');return db[_0x7dee('0x2a')][_0x7dee('0x2b')]({'where':{'type':_0xcd2c61,'resourceId':_0x5af77b['id']}})[_0x7dee('0x27')](function(){return _0x247528;});})['then'](function(){_0x4763d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ab7a,_0x237157){return function(_0x562477){if(!_0x562477){_0x35ab7a[_0x7dee('0x19')](0x194);}return _0x562477;};}function handleError(_0x52b9a7,_0x50a03f){_0x50a03f=_0x50a03f||0x1f4;return function(_0x4aa96f){logger['error'](_0x4aa96f[_0x7dee('0x2c')]);if(_0x4aa96f[_0x7dee('0x2d')]){delete _0x4aa96f[_0x7dee('0x2d')];}_0x52b9a7['status'](_0x50a03f)['send'](_0x4aa96f);};}exports[_0x7dee('0x2e')]=function(_0x432afb,_0x42a12e){var _0x5f4dc2={},_0x402933={},_0x483ad8={'count':0x0,'rows':[]};var _0x4688a7=_[_0x7dee('0x2f')](db[_0x7dee('0x30')][_0x7dee('0x31')],function(_0x23bd91){return{'name':_0x23bd91[_0x7dee('0x32')],'type':_0x23bd91['type']['key']};});_0x402933[_0x7dee('0x33')]=_[_0x7dee('0x2f')](_0x4688a7,'name');_0x402933[_0x7dee('0x34')]=_[_0x7dee('0x35')](_0x432afb[_0x7dee('0x34')]);_0x402933[_0x7dee('0x36')]=_[_0x7dee('0x37')](_0x402933['model'],_0x402933['query']);_0x5f4dc2[_0x7dee('0x38')]=_[_0x7dee('0x37')](_0x402933['model'],qs['fields'](_0x432afb[_0x7dee('0x34')]['fields']));_0x5f4dc2[_0x7dee('0x38')]=_0x5f4dc2['attributes']['length']?_0x5f4dc2[_0x7dee('0x38')]:_0x402933['model'];if(!_0x432afb[_0x7dee('0x34')]['hasOwnProperty']('nolimit')){_0x5f4dc2[_0x7dee('0x1e')]=qs[_0x7dee('0x1e')](_0x432afb['query'][_0x7dee('0x1e')]);_0x5f4dc2['offset']=qs[_0x7dee('0x1c')](_0x432afb['query'][_0x7dee('0x1c')]);}_0x5f4dc2[_0x7dee('0x39')]=qs['sort'](_0x432afb['query'][_0x7dee('0x3a')]);_0x5f4dc2[_0x7dee('0x3b')]=qs[_0x7dee('0x36')](_[_0x7dee('0x3c')](_0x432afb[_0x7dee('0x34')],_0x402933[_0x7dee('0x36')]),_0x4688a7);if(_0x432afb['query']['filter']){_0x5f4dc2[_0x7dee('0x3b')]=_['merge'](_0x5f4dc2['where'],{'$or':_[_0x7dee('0x2f')](_0x4688a7,function(_0x3f7722){if(_0x3f7722['type']!=='VIRTUAL'){var _0x25b912={};_0x25b912[_0x3f7722['name']]={'$like':'%'+_0x432afb[_0x7dee('0x34')][_0x7dee('0x3d')]+'%'};return _0x25b912;}})});}_0x5f4dc2=_[_0x7dee('0x3e')]({},_0x5f4dc2,_0x432afb[_0x7dee('0x3f')]);var _0x4e8857={'where':_0x5f4dc2['where']};return db['AnalyticCustomReport'][_0x7dee('0x1f')](_0x4e8857)['then'](function(_0x5ac8c1){_0x483ad8[_0x7dee('0x1f')]=_0x5ac8c1;if(_0x432afb['query'][_0x7dee('0x40')]){_0x5f4dc2[_0x7dee('0x41')]=[{'all':!![]}];}return db[_0x7dee('0x30')][_0x7dee('0x42')](_0x5f4dc2);})[_0x7dee('0x27')](function(_0x4b2904){_0x483ad8[_0x7dee('0x43')]=_0x4b2904;return _0x483ad8;})['then'](respondWithFilteredResult(_0x42a12e,_0x5f4dc2))[_0x7dee('0x44')](handleError(_0x42a12e,null));};exports['show']=function(_0x1aa69b,_0x9df904){var _0x23e4df={'raw':![],'where':{'id':_0x1aa69b['params']['id']}},_0x20e8d9={};_0x20e8d9[_0x7dee('0x33')]=_[_0x7dee('0x35')](db[_0x7dee('0x30')][_0x7dee('0x31')]);_0x20e8d9[_0x7dee('0x34')]=_[_0x7dee('0x35')](_0x1aa69b['query']);_0x20e8d9[_0x7dee('0x36')]=_[_0x7dee('0x37')](_0x20e8d9[_0x7dee('0x33')],_0x20e8d9[_0x7dee('0x34')]);_0x23e4df[_0x7dee('0x38')]=_[_0x7dee('0x37')](_0x20e8d9[_0x7dee('0x33')],qs[_0x7dee('0x45')](_0x1aa69b[_0x7dee('0x34')][_0x7dee('0x45')]));_0x23e4df[_0x7dee('0x38')]=_0x23e4df[_0x7dee('0x38')][_0x7dee('0x46')]?_0x23e4df[_0x7dee('0x38')]:_0x20e8d9[_0x7dee('0x33')];if(_0x1aa69b[_0x7dee('0x34')][_0x7dee('0x40')]){_0x23e4df[_0x7dee('0x41')]=[{'all':!![]}];}_0x23e4df=_[_0x7dee('0x3e')]({},_0x23e4df,_0x1aa69b['options']);return db[_0x7dee('0x30')][_0x7dee('0x47')](_0x23e4df)['then'](handleEntityNotFound(_0x9df904,null))['then'](respondWithResult(_0x9df904,null))[_0x7dee('0x44')](handleError(_0x9df904,null));};exports[_0x7dee('0x48')]=function(_0x1f895a,_0x1f796c){return db['AnalyticCustomReport'][_0x7dee('0x48')](_0x1f895a['body'],{})[_0x7dee('0x27')](function(_0x5746ae){var _0x79334a=_0x1f895a[_0x7dee('0x49')][_0x7dee('0x28')]({'plain':!![]});if(!_0x79334a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x79334a[_0x7dee('0x4a')]===_0x7dee('0x49')){var _0x50f182=_0x5746ae[_0x7dee('0x28')]({'plain':!![]});var _0x374f55=_0x7dee('0x4b');return db[_0x7dee('0x4c')][_0x7dee('0x47')]({'where':{'name':_0x374f55,'userProfileId':_0x79334a[_0x7dee('0x4d')]},'raw':!![]})[_0x7dee('0x27')](function(_0x35c36c){if(_0x35c36c&&_0x35c36c[_0x7dee('0x4e')]===0x0){return db['UserProfileResource'][_0x7dee('0x48')]({'name':_0x50f182[_0x7dee('0x2d')],'resourceId':_0x50f182['id'],'type':_0x7dee('0x29'),'sectionId':_0x35c36c['id']},{})[_0x7dee('0x27')](function(){return _0x5746ae;});}else{return _0x5746ae;}})['catch'](function(_0x27446f){logger['error'](_0x7dee('0x4f'),_0x27446f);throw _0x27446f;});}return _0x5746ae;})[_0x7dee('0x27')](respondWithResult(_0x1f796c,0xc9))[_0x7dee('0x44')](handleError(_0x1f796c,null));};exports['update']=function(_0x57a289,_0x21e871){if(_0x57a289['body']['id']){delete _0x57a289[_0x7dee('0x50')]['id'];}return db[_0x7dee('0x30')]['find']({'where':{'id':_0x57a289[_0x7dee('0x51')]['id']}})['then'](handleEntityNotFound(_0x21e871,null))[_0x7dee('0x27')](saveUpdates(_0x57a289['body'],null))[_0x7dee('0x27')](respondWithResult(_0x21e871,null))['catch'](handleError(_0x21e871,null));};exports[_0x7dee('0x2b')]=function(_0x1d673b,_0x3ab822){return db[_0x7dee('0x30')]['find']({'where':{'id':_0x1d673b[_0x7dee('0x51')]['id']}})[_0x7dee('0x27')](handleEntityNotFound(_0x3ab822,null))[_0x7dee('0x27')](removeEntity(_0x3ab822,null))['catch'](handleError(_0x3ab822,null));};exports['preview']=function(_0x375a84,_0x37c1ef){var _0xa14e19=0xa;var _0x39df83=['join',_0x7dee('0x52'),_0x7dee('0x53'),_0x7dee('0x54')];var _0x68c824={'SUM':_0x7dee('0x55'),'COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':_0x7dee('0x5a'),'GROUP_CONCAT':_0x7dee('0x5b'),'GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x50d6ab={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':_0x7dee('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dee('0x61')};var _0x4ee908=function(_0x294a94){return!_['includes']([_0x7dee('0x62'),_0x7dee('0x63'),_0x7dee('0x64'),_0x7dee('0x65')],_0x294a94);};var _0x40946a=function(_0x3b50cc){if(!_0x3b50cc||!_0x3b50cc[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x4a98be='(',_0x57fa6b=0x0;_0x57fa6b<_0x3b50cc['rules'][_0x7dee('0x46')];_0x57fa6b+=0x1){_0x57fa6b>0x0&&(_0x4a98be+='\x20'+_0x3b50cc['operator']+'\x20');_0x4a98be+=_0x3b50cc[_0x7dee('0x66')][_0x57fa6b]['group']?_0x40946a(_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x67')]):_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x68')]+'\x20'+_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x69')]+(_0x4ee908(_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x69')])?'\x20'+_0x3b50cc[_0x7dee('0x66')][_0x57fa6b][_0x7dee('0x6a')]:'');}return _0x4a98be+')';};var _0x328b53={'where':{'id':_0x375a84[_0x7dee('0x51')]['id']}},_0x4d687b,_0x342011,_0x14ef0d,_0x1a99c2,_0x2043be;_0x328b53=_[_0x7dee('0x3e')]({},_0x328b53,_0x375a84[_0x7dee('0x3f')]);return db['AnalyticCustomReport'][_0x7dee('0x47')](_0x328b53)[_0x7dee('0x27')](function(_0x43997d){if(_0x43997d){_0x4d687b=_0x43997d;return _0x43997d[_0x7dee('0x6b')]();}return null;})[_0x7dee('0x27')](function(_0x19353c){if(_0x19353c){if(!_0x19353c[_0x7dee('0x46')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dee('0x6c'),0x193);}_0x342011=_0x19353c;return db[_0x7dee('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3e03a5){if(_0x3e03a5){_0x14ef0d=_[_0x7dee('0x6e')](_0x3e03a5,'id');var _0x125717;var _0x28f691=squel[_0x7dee('0x6f')]();_0x28f691[_0x7dee('0x70')](_0x4d687b[_0x7dee('0x71')]);for(var _0x5d21ed=0x0;_0x5d21ed<_0x342011[_0x7dee('0x46')];_0x5d21ed+=0x1){_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x72')]?_0x14ef0d[_0x342011[_0x5d21ed]['MetricId']][_0x7dee('0x73')]:_0x342011[_0x5d21ed][_0x7dee('0x68')];_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x74')]?_['replace'](_0x68c824[_0x342011[_0x5d21ed][_0x7dee('0x74')]],'%s',_0x125717):_0x125717;_0x125717=_0x342011[_0x5d21ed][_0x7dee('0x75')]?_[_0x7dee('0x76')](_0x50d6ab[_0x342011[_0x5d21ed][_0x7dee('0x75')]],'%s',_0x125717):_0x125717;if(_0x342011[_0x5d21ed][_0x7dee('0x77')]){_0x28f691['group'](_0x125717);}_0x342011[_0x5d21ed][_0x7dee('0x78')]&&_0x28f691[_0x7dee('0x39')](_0x125717,_0x342011[_0x5d21ed]['orderBy']===_0x7dee('0x79')?![]:!![]);_0x28f691['field'](_0x125717,_0x342011[_0x5d21ed][_0x7dee('0x7a')]||_0x125717);}if(_0x4d687b['joins']){_0x4d687b[_0x7dee('0x7b')]=JSON[_0x7dee('0x7c')](_0x4d687b['joins']);for(var _0x277881=0x0;_0x277881<_0x4d687b[_0x7dee('0x7b')]['length'];_0x277881+=0x1){if(_0x4d687b['joins'][_0x277881][_0x7dee('0x7d')]&&_[_0x7dee('0x7e')](_0x39df83,_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7d')])&&_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7f')]&&_0x4d687b['joins'][_0x277881][_0x7dee('0x80')]&&_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x81')]){_0x28f691[_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7d')]](_0x4d687b[_0x7dee('0x7b')][_0x277881]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4d687b[_0x7dee('0x71')],_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x7f')],_0x4d687b[_0x7dee('0x7b')][_0x277881]['foreignTable'],_0x4d687b[_0x7dee('0x7b')][_0x277881][_0x7dee('0x81')]));}}}if(_0x4d687b[_0x7dee('0x82')]){_0x4d687b[_0x7dee('0x82')]=JSON[_0x7dee('0x7c')](_0x4d687b[_0x7dee('0x82')]);_0x28f691[_0x7dee('0x3b')](_0x40946a(_0x4d687b[_0x7dee('0x82')][_0x7dee('0x67')]));}_0x2043be=_0x28f691[_0x7dee('0x83')]();_0x28f691[_0x7dee('0x1e')](_0xa14e19);_0x28f691[_0x7dee('0x1c')](0x0);logger['debug'](_0x7dee('0x84'),_0x28f691[_0x7dee('0x85')]());return dbH['sequelize'][_0x7dee('0x34')](_0x28f691[_0x7dee('0x85')](),{'type':dbH[_0x7dee('0x86')][_0x7dee('0x87')][_0x7dee('0x88')]});}})[_0x7dee('0x27')](respondWithResult(_0x37c1ef,null))[_0x7dee('0x44')](handleError(_0x37c1ef,null));};function runReport(_0x885049,_0x514377,_0x24a6c2){var _0x68743c=_0x514377[_0x7dee('0x2d')];var _0x3a70d2=0xa;var _0x35ff3a=[_0x7dee('0x89'),_0x7dee('0x52'),'right_join',_0x7dee('0x54')];var _0x313eb2={'SUM':_0x7dee('0x55'),'COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x44f8d8={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':_0x7dee('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dee('0x61')};var _0x46b3b0=function(_0x3b9127){return!_[_0x7dee('0x7e')]([_0x7dee('0x62'),'IS\x20NOT\x20NULL',_0x7dee('0x64'),_0x7dee('0x65')],_0x3b9127);};var _0x3f6b2d=function(_0x20dfb8){if(!_0x20dfb8||!_0x20dfb8[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x584e73='(',_0x5c7c82=0x0;_0x5c7c82<_0x20dfb8[_0x7dee('0x66')]['length'];_0x5c7c82+=0x1){_0x5c7c82>0x0&&(_0x584e73+='\x20'+_0x20dfb8[_0x7dee('0x8a')]+'\x20');_0x584e73+=_0x20dfb8[_0x7dee('0x66')][_0x5c7c82]['group']?_0x3f6b2d(_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x67')]):_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x68')]+'\x20'+_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x69')]+(_0x46b3b0(_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x69')])?'\x20'+_0x20dfb8[_0x7dee('0x66')][_0x5c7c82][_0x7dee('0x6a')]:'');}return _0x584e73+')';};var _0x377915={'where':{'id':_0x885049['id']}},_0x1ec875,_0xafa3ef,_0x1913de,_0x4ff4b3,_0x1d7e04;_0x377915=_[_0x7dee('0x3e')]({},_0x377915,_0x24a6c2);return db[_0x7dee('0x30')]['find'](_0x377915)['then'](function(_0x2b9cfd){if(_0x2b9cfd){_0x1ec875=_0x2b9cfd;return _0x2b9cfd['getFields']();}return null;})[_0x7dee('0x27')](function(_0x47349d){if(_0x47349d){if(!_0x47349d[_0x7dee('0x46')]){throw new db['Sequelize'][(_0x7dee('0x8b'))](_0x7dee('0x6c'),0x193);}_0xafa3ef=_0x47349d;return db[_0x7dee('0x6d')][_0x7dee('0x42')]({'raw':!![]});}return null;})[_0x7dee('0x27')](function(_0x19613b){if(_0x19613b){_0x1913de=_['keyBy'](_0x19613b,'id');var _0x4b12a1;var _0x2882c6=squel[_0x7dee('0x6f')]();_0x2882c6['from'](_0x1ec875['table']);for(var _0x29f8d9=0x0;_0x29f8d9<_0xafa3ef['length'];_0x29f8d9+=0x1){_0x4b12a1=_0xafa3ef[_0x29f8d9]['MetricId']?_0x1913de[_0xafa3ef[_0x29f8d9][_0x7dee('0x72')]][_0x7dee('0x73')]:_0xafa3ef[_0x29f8d9]['field'];_0x4b12a1=_0xafa3ef[_0x29f8d9][_0x7dee('0x74')]?_[_0x7dee('0x76')](_0x313eb2[_0xafa3ef[_0x29f8d9][_0x7dee('0x74')]],'%s',_0x4b12a1):_0x4b12a1;_0x4b12a1=_0xafa3ef[_0x29f8d9]['format']?_[_0x7dee('0x76')](_0x44f8d8[_0xafa3ef[_0x29f8d9][_0x7dee('0x75')]],'%s',_0x4b12a1):_0x4b12a1;if(_0xafa3ef[_0x29f8d9][_0x7dee('0x77')]){_0x2882c6[_0x7dee('0x67')](_0x4b12a1);}_0xafa3ef[_0x29f8d9][_0x7dee('0x78')]&&_0x2882c6[_0x7dee('0x39')](_0x4b12a1,_0xafa3ef[_0x29f8d9]['orderBy']===_0x7dee('0x79')?![]:!![]);_0x2882c6[_0x7dee('0x68')](_0x4b12a1,_0xafa3ef[_0x29f8d9][_0x7dee('0x7a')]||_0x4b12a1);}if(_0x1ec875['joins']){_0x1ec875[_0x7dee('0x7b')]=JSON[_0x7dee('0x7c')](_0x1ec875[_0x7dee('0x7b')]);for(var _0x51d78f=0x0;_0x51d78f<_0x1ec875['joins'][_0x7dee('0x46')];_0x51d78f+=0x1){if(_0x1ec875['joins'][_0x51d78f]['type']&&_[_0x7dee('0x7e')](_0x35ff3a,_0x1ec875['joins'][_0x51d78f][_0x7dee('0x7d')])&&_0x1ec875['joins'][_0x51d78f][_0x7dee('0x7f')]&&_0x1ec875[_0x7dee('0x7b')][_0x51d78f]['foreignTable']&&_0x1ec875['joins'][_0x51d78f][_0x7dee('0x81')]){_0x2882c6[_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x7d')]](_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x80')],null,util[_0x7dee('0x75')](_0x7dee('0x8c'),_0x1ec875[_0x7dee('0x71')],_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x7f')],_0x1ec875[_0x7dee('0x7b')][_0x51d78f]['foreignTable'],_0x1ec875[_0x7dee('0x7b')][_0x51d78f][_0x7dee('0x81')]));}}}if(_0x1ec875[_0x7dee('0x82')]){_0x1ec875[_0x7dee('0x82')]=JSON[_0x7dee('0x7c')](_0x1ec875[_0x7dee('0x82')]);_0x2882c6[_0x7dee('0x3b')](_0x3f6b2d(_0x1ec875[_0x7dee('0x82')][_0x7dee('0x67')]));}_0x1d7e04=_0x2882c6['clone']();_0x2882c6[_0x7dee('0x1e')](_0x3a70d2);_0x2882c6['offset'](0x0);return;}})[_0x7dee('0x27')](function(){if(_0x514377['output']==='web'){return null;}var _0x1a8ad7=_[_0x7dee('0x3e')](_0x514377,{'name':_0x514377['fullPath']||_0x514377['name']||_0x1ec875['name'],'basename':_0x68743c,'savename':util[_0x7dee('0x75')](_0x7dee('0x8d'),_0x514377[_0x7dee('0x2d')]||_0x1ec875[_0x7dee('0x2d')],require(_0x7dee('0x8e'))[_0x7dee('0x8f')](0x4),_0x514377[_0x7dee('0x90')]||_0x7dee('0x91')),'reportId':_0x1ec875['id'],'reportType':_0x7dee('0x92')});return db[_0x7dee('0x93')][_0x7dee('0x48')](_0x1a8ad7,{'raw':!![]});})[_0x7dee('0x27')](function(_0x5b5cab){if(_0x1ec875[_0x7dee('0x71')]==='cdr'){_0x1d7e04[_0x7dee('0x3b')](_0x1ec875[_0x7dee('0x71')]+_0x7dee('0x94'),_0x514377[_0x7dee('0x95')],_0x514377['endDate']);}else{_0x1d7e04[_0x7dee('0x3b')](_0x1ec875[_0x7dee('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514377[_0x7dee('0x95')],_0x514377[_0x7dee('0x96')]);}if(_0x5b5cab){logger[_0x7dee('0x97')](_0x7dee('0x98'),_0x1d7e04[_0x7dee('0x85')]());require(_0x7dee('0x99'))[_0x7dee('0x9a')](path[_0x7dee('0x89')](__dirname,'../../components/export/',_0x5b5cab[_0x7dee('0x90')]),[_0x5b5cab['id'],_0x1d7e04[_0x7dee('0x85')](),path[_0x7dee('0x89')](__dirname,_0x7dee('0x9b'),_0x5b5cab['savename']),_0x68743c]);return _0x5b5cab;}else{var _0x1c782d=squel[_0x7dee('0x6f')]();_0x1c782d[_0x7dee('0x70')]('('+_0x1d7e04['toString']()+')',_0x7dee('0x9c'));_0x1c782d[_0x7dee('0x68')](_0x7dee('0x9d'),'count');_0x1d7e04[_0x7dee('0x1e')](_0x514377[_0x7dee('0x1e')]||_0x3a70d2);_0x1d7e04[_0x7dee('0x1c')](_0x514377[_0x7dee('0x1c')]||0x0);return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x1c782d[_0x7dee('0x85')](),{'type':dbH[_0x7dee('0x86')]['QueryTypes']['SELECT']})[_0x7dee('0x27')](function(_0x12c870){if(!_0x12c870['length']){_0x4ff4b3=0x0;}else{_0x4ff4b3=_0x12c870[0x0][_0x7dee('0x1f')]||0x0;}return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x1d7e04[_0x7dee('0x85')](),{'type':dbH['sequelize'][_0x7dee('0x87')]['SELECT']});})[_0x7dee('0x27')](function(_0x11b958){return{'rows':_0x11b958||[],'count':_0x4ff4b3};});}});}exports[_0x7dee('0x9e')]=function(_0x5dbf2d,_0x459fd2){return runReport(_0x5dbf2d[_0x7dee('0x51')],_0x5dbf2d[_0x7dee('0x34')],_0x5dbf2d[_0x7dee('0x3f')])[_0x7dee('0x27')](respondWithResult(_0x459fd2,null))['catch'](handleError(_0x459fd2,null));};exports[_0x7dee('0x9f')]=runReport;exports['query']=function(_0x22976e,_0x36c01b){var _0x5e6eaf=0xa;var _0x17adfb=[_0x7dee('0x89'),_0x7dee('0x52'),'right_join',_0x7dee('0x54')];var _0x5ee6f7={'SUM':'SUM(%s)','COUNT':_0x7dee('0x56'),'COUNT DISTINCT':_0x7dee('0x57'),'MAX':_0x7dee('0x58'),'MIN':_0x7dee('0x59'),'AVG':_0x7dee('0x5a'),'GROUP_CONCAT':_0x7dee('0x5b'),'GROUP_CONCAT ASC':_0x7dee('0x5c'),'GROUP_CONCAT DESC':_0x7dee('0x5d')};var _0x1692c2={'SEC_TO_TIME':_0x7dee('0x5e'),'DATE':_0x7dee('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x7dee('0xa0'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x54524b=function(_0x30fb98){return!_[_0x7dee('0x7e')]([_0x7dee('0x62'),_0x7dee('0x63'),_0x7dee('0x64'),'IS\x20NOT\x20EMPTY'],_0x30fb98);};var _0x57ead9=function(_0x17af9f){if(!_0x17af9f||!_0x17af9f[_0x7dee('0x66')][_0x7dee('0x46')]){return'';}for(var _0x1fdc70='(',_0x331a12=0x0;_0x331a12<_0x17af9f[_0x7dee('0x66')]['length'];_0x331a12+=0x1){_0x331a12>0x0&&(_0x1fdc70+='\x20'+_0x17af9f[_0x7dee('0x8a')]+'\x20');_0x1fdc70+=_0x17af9f[_0x7dee('0x66')][_0x331a12]['group']?_0x57ead9(_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x67')]):_0x17af9f['rules'][_0x331a12][_0x7dee('0x68')]+'\x20'+_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x69')]+(_0x54524b(_0x17af9f['rules'][_0x331a12][_0x7dee('0x69')])?'\x20'+_0x17af9f[_0x7dee('0x66')][_0x331a12][_0x7dee('0x6a')]:'');}return _0x1fdc70+')';};var _0x2f819d={'where':{'id':_0x22976e[_0x7dee('0x51')]['id']}},_0x61bfba,_0x1665f7,_0x785395,_0x33ecf7,_0x1bebb9;_0x2f819d=_['merge']({},_0x2f819d,_0x22976e['options']);return db[_0x7dee('0x30')]['find'](_0x2f819d)[_0x7dee('0x27')](function(_0x4801c9){if(_0x4801c9){_0x61bfba=_0x4801c9;return _0x4801c9[_0x7dee('0x6b')]();}return null;})['then'](function(_0x468a20){if(_0x468a20){if(!_0x468a20[_0x7dee('0x46')]){throw new db[(_0x7dee('0xa1'))][(_0x7dee('0x8b'))](_0x7dee('0x6c'),0x193);}_0x1665f7=_0x468a20;return db[_0x7dee('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x7dee('0x27')](function(_0x5647b2){if(_0x5647b2){_0x785395=_['keyBy'](_0x5647b2,'id');var _0x5835b1;var _0x279ba0=squel[_0x7dee('0x6f')]();_0x279ba0[_0x7dee('0x70')](_0x61bfba[_0x7dee('0x71')]);for(var _0x1e3ca9=0x0;_0x1e3ca9<_0x1665f7[_0x7dee('0x46')];_0x1e3ca9+=0x1){_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x72')]?_0x785395[_0x1665f7[_0x1e3ca9]['MetricId']][_0x7dee('0x73')]:_0x1665f7[_0x1e3ca9]['field'];_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x74')]?_[_0x7dee('0x76')](_0x5ee6f7[_0x1665f7[_0x1e3ca9]['function']],'%s',_0x5835b1):_0x5835b1;_0x5835b1=_0x1665f7[_0x1e3ca9][_0x7dee('0x75')]?_[_0x7dee('0x76')](_0x1692c2[_0x1665f7[_0x1e3ca9][_0x7dee('0x75')]],'%s',_0x5835b1):_0x5835b1;if(_0x1665f7[_0x1e3ca9][_0x7dee('0x77')]){_0x279ba0['group'](_0x5835b1);}_0x1665f7[_0x1e3ca9]['orderBy']&&_0x279ba0[_0x7dee('0x39')](_0x5835b1,_0x1665f7[_0x1e3ca9][_0x7dee('0x78')]===_0x7dee('0x79')?![]:!![]);_0x279ba0[_0x7dee('0x68')](_0x5835b1,_0x1665f7[_0x1e3ca9][_0x7dee('0x7a')]||_0x5835b1);}if(_0x61bfba['joins']){_0x61bfba[_0x7dee('0x7b')]=JSON['parse'](_0x61bfba[_0x7dee('0x7b')]);for(var _0x867a23=0x0;_0x867a23<_0x61bfba[_0x7dee('0x7b')][_0x7dee('0x46')];_0x867a23+=0x1){if(_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x7d')]&&_[_0x7dee('0x7e')](_0x17adfb,_0x61bfba['joins'][_0x867a23][_0x7dee('0x7d')])&&_0x61bfba[_0x7dee('0x7b')][_0x867a23]['parentKey']&&_0x61bfba['joins'][_0x867a23][_0x7dee('0x80')]&&_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x81')]){_0x279ba0[_0x61bfba['joins'][_0x867a23][_0x7dee('0x7d')]](_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x80')],null,util['format'](_0x7dee('0x8c'),_0x61bfba['table'],_0x61bfba[_0x7dee('0x7b')][_0x867a23]['parentKey'],_0x61bfba[_0x7dee('0x7b')][_0x867a23][_0x7dee('0x80')],_0x61bfba['joins'][_0x867a23][_0x7dee('0x81')]));}}}if(_0x61bfba[_0x7dee('0x82')]){_0x61bfba['conditions']=JSON['parse'](_0x61bfba[_0x7dee('0x82')]);_0x279ba0[_0x7dee('0x3b')](_0x57ead9(_0x61bfba['conditions'][_0x7dee('0x67')]));}_0x1bebb9=_0x279ba0['clone']();_0x279ba0[_0x7dee('0x1e')](_0x5e6eaf);_0x279ba0[_0x7dee('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x279ba0[_0x7dee('0x85')]());return dbH[_0x7dee('0x86')][_0x7dee('0x34')](_0x279ba0[_0x7dee('0x85')](),{'type':dbH['sequelize'][_0x7dee('0x87')][_0x7dee('0x88')]});}})[_0x7dee('0x27')](function(){return{'sql':_0x1bebb9[_0x7dee('0x85')]()};})['then'](respondWithResult(_0x36c01b,null))['catch'](handleError(_0x36c01b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 392bd8d..87e9214 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 _0x7372=['define','analytics_custom_reports','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0x7372,0xe9));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2737('0x0'));var logger=require(_0x2737('0x1'))(_0x2737('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2737('0x3'));var fs=require('fs');var path=require(_0x2737('0x4'));var rimraf=require(_0x2737('0x5'));var config=require(_0x2737('0x6'));var attributes=require(_0x2737('0x7'));module[_0x2737('0x8')]=function(_0x21d3ac,_0x56634c){return _0x21d3ac[_0x2737('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x2737('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x001d=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0x001d,0xf8));var _0xd001=function(_0x44c01a,_0x102504){_0x44c01a=_0x44c01a-0x0;var _0x2d701c=_0x001d[_0x44c01a];return _0x2d701c;};'use strict';var _=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var logger=require(_0xd001('0x2'))(_0xd001('0x3'));var moment=require(_0xd001('0x4'));var BPromise=require(_0xd001('0x5'));var rp=require(_0xd001('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd001('0x7'));var attributes=require(_0xd001('0x8'));module[_0xd001('0x9')]=function(_0x8d4bb,_0x13dd5a){return _0x8d4bb[_0xd001('0xa')](_0xd001('0xb'),attributes,{'tableName':_0xd001('0xc'),'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 289ad0f..b215be7 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 _0xc400=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x3b49f8,_0x567194){var _0x1bc638=function(_0xbb3a87){while(--_0xbb3a87){_0x3b49f8['push'](_0x3b49f8['shift']());}};_0x1bc638(++_0x567194);}(_0xc400,0xf9));var _0x0c40=function(_0x493a9a,_0x44a487){_0x493a9a=_0x493a9a-0x0;var _0x2ff0a6=_0xc400[_0x493a9a];return _0x2ff0a6;};'use strict';var _=require(_0x0c40('0x0'));var util=require('util');var moment=require(_0x0c40('0x1'));var BPromise=require(_0x0c40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c40('0x3'));var db=require(_0x0c40('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c40('0x5'))(_0x0c40('0x6'));var config=require('../../config/environment');var jayson=require(_0x0c40('0x7'));var client=jayson[_0x0c40('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a8f6,_0x57b6ec,_0x3657fa){return new BPromise(function(_0x21af46,_0x30815a){return client[_0x0c40('0x9')](_0x31a8f6,_0x3657fa)[_0x0c40('0xa')](function(_0x21d20a){logger[_0x0c40('0xb')](_0x0c40('0xc'),_0x57b6ec,_0x0c40('0xd'));logger[_0x0c40('0xe')](_0x0c40('0xf'),_0x57b6ec,_0x0c40('0xd'),JSON['stringify'](_0x21d20a));if(_0x21d20a[_0x0c40('0x10')]){if(_0x21d20a[_0x0c40('0x10')][_0x0c40('0x11')]===0x1f4){logger[_0x0c40('0x10')](_0x0c40('0xc'),_0x57b6ec,_0x21d20a[_0x0c40('0x10')][_0x0c40('0x12')]);return _0x30815a(_0x21d20a[_0x0c40('0x10')][_0x0c40('0x12')]);}logger[_0x0c40('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57b6ec,_0x21d20a['error']['message']);return _0x21af46(_0x21d20a['error']['message']);}else{logger[_0x0c40('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57b6ec,_0x0c40('0xd'));_0x21af46(_0x21d20a[_0x0c40('0x13')]['message']);}})[_0x0c40('0x14')](function(_0x23ce6a){logger['error'](_0x0c40('0xc'),_0x57b6ec,_0x23ce6a);_0x30815a(_0x23ce6a);});});}
\ No newline at end of file
+var _0x58db=['rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ed00e,_0x15cad0){var _0x4d6819=function(_0x2b7afa){while(--_0x2b7afa){_0x2ed00e['push'](_0x2ed00e['shift']());}};_0x4d6819(++_0x15cad0);}(_0x58db,0x176));var _0xb58d=function(_0x5f322f,_0x1f2cde){_0x5f322f=_0x5f322f-0x0;var _0x43499c=_0x58db[_0x5f322f];return _0x43499c;};'use strict';var _=require('lodash');var util=require(_0xb58d('0x0'));var moment=require(_0xb58d('0x1'));var BPromise=require(_0xb58d('0x2'));var rs=require(_0xb58d('0x3'));var fs=require('fs');var Redis=require(_0xb58d('0x4'));var db=require(_0xb58d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb58d('0x6'));var config=require(_0xb58d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb58d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17bfb3,_0x1aa8bd,_0x43ebae){return new BPromise(function(_0x481860,_0x35442e){return client[_0xb58d('0x9')](_0x17bfb3,_0x43ebae)[_0xb58d('0xa')](function(_0xe2bf6b){logger[_0xb58d('0xb')](_0xb58d('0xc'),_0x1aa8bd,'request\x20sent');logger[_0xb58d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1aa8bd,_0xb58d('0xe'),JSON[_0xb58d('0xf')](_0xe2bf6b));if(_0xe2bf6b['error']){if(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x11')]===0x1f4){logger[_0xb58d('0x10')](_0xb58d('0xc'),_0x1aa8bd,_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);return _0x35442e(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);}logger['error'](_0xb58d('0xc'),_0x1aa8bd,_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);return _0x481860(_0xe2bf6b[_0xb58d('0x10')][_0xb58d('0x12')]);}else{logger[_0xb58d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1aa8bd,_0xb58d('0xe'));_0x481860(_0xe2bf6b[_0xb58d('0x13')][_0xb58d('0x12')]);}})['catch'](function(_0x4378c0){logger['error'](_0xb58d('0xc'),_0x1aa8bd,_0x4378c0);_0x35442e(_0x4378c0);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index e9be345..5266a80 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 _0xf55e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy'];(function(_0x47729a,_0x197fdd){var _0x4dedd1=function(_0x467912){while(--_0x467912){_0x47729a['push'](_0x47729a['shift']());}};_0x4dedd1(++_0x197fdd);}(_0xf55e,0x191));var _0xef55=function(_0x4452d6,_0x2c1d0f){_0x4452d6=_0x4452d6-0x0;var _0x2c7fa1=_0xf55e[_0x4452d6];return _0x2c7fa1;};'use strict';var multer=require(_0xef55('0x0'));var util=require(_0xef55('0x1'));var path=require(_0xef55('0x2'));var timeout=require(_0xef55('0x3'));var express=require(_0xef55('0x4'));var router=express['Router']();var fs_extra=require(_0xef55('0x5'));var auth=require(_0xef55('0x6'));var interaction=require(_0xef55('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xef55('0x8')]('/',auth[_0xef55('0x9')](),controller[_0xef55('0xa')]);router[_0xef55('0x8')](_0xef55('0xb'),auth[_0xef55('0x9')](),controller[_0xef55('0xc')]);router[_0xef55('0x8')](_0xef55('0xd'),auth['isAuthenticated'](),controller[_0xef55('0xe')]);router['get'](_0xef55('0xf'),auth[_0xef55('0x9')](),controller[_0xef55('0x10')]);router[_0xef55('0x8')](_0xef55('0x11'),auth[_0xef55('0x9')](),controller[_0xef55('0x12')]);router[_0xef55('0x13')]('/',auth[_0xef55('0x9')](),controller[_0xef55('0x14')]);router[_0xef55('0x15')](_0xef55('0xb'),auth['isAuthenticated'](),controller[_0xef55('0x16')]);router['delete'](_0xef55('0xb'),auth[_0xef55('0x9')](),controller[_0xef55('0x17')]);module[_0xef55('0x18')]=router;
\ No newline at end of file
+var _0xebd8=['../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4341ab,_0x2c9c79){var _0x4fa920=function(_0x2409dc){while(--_0x2409dc){_0x4341ab['push'](_0x4341ab['shift']());}};_0x4fa920(++_0x2c9c79);}(_0xebd8,0x127));var _0x8ebd=function(_0xe98f87,_0x2ca314){_0xe98f87=_0xe98f87-0x0;var _0x54c53f=_0xebd8[_0xe98f87];return _0x54c53f;};'use strict';var multer=require(_0x8ebd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ebd('0x1'));var express=require('express');var router=express[_0x8ebd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8ebd('0x3'));var interaction=require(_0x8ebd('0x4'));var config=require(_0x8ebd('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x8ebd('0x6')]('/',auth[_0x8ebd('0x7')](),controller[_0x8ebd('0x8')]);router[_0x8ebd('0x6')](_0x8ebd('0x9'),auth['isAuthenticated'](),controller[_0x8ebd('0xa')]);router[_0x8ebd('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0x8ebd('0xb')]);router[_0x8ebd('0x6')](_0x8ebd('0xc'),auth[_0x8ebd('0x7')](),controller[_0x8ebd('0xd')]);router['get'](_0x8ebd('0xe'),auth[_0x8ebd('0x7')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x8ebd('0xf')]);router[_0x8ebd('0x10')](_0x8ebd('0x9'),auth[_0x8ebd('0x7')](),controller[_0x8ebd('0x11')]);router[_0x8ebd('0x12')](_0x8ebd('0x9'),auth[_0x8ebd('0x7')](),controller['destroy']);module[_0x8ebd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 38ad115..99c68c0 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x46ed,0x168));var _0xd46e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x46ed[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0xc3050a,_0x3f50b5){var _0x433e7a=function(_0x1fd962){while(--_0x1fd962){_0xc3050a['push'](_0xc3050a['shift']());}};_0x433e7a(++_0x3f50b5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1fd8b5,_0x7d9ee6){_0x1fd8b5=_0x1fd8b5-0x0;var _0x1001eb=_0xbd51[_0x1fd8b5];return _0x1001eb;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'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 4d67d76..65b8831 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x5dbb0a,_0x2daefa){var _0x2100e9=function(_0x261959){while(--_0x261959){_0x5dbb0a['push'](_0x5dbb0a['shift']());}};_0x2100e9(++_0x2daefa);}(_0x5fab,0x177));var _0xb5fa=function(_0x27c69b,_0x4cbe55){_0x27c69b=_0x27c69b-0x0;var _0x198ac4=_0x5fab[_0x27c69b];return _0x198ac4;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x7a54,0x106));var _0x47a5=function(_0xef8159,_0x5da201){_0xef8159=_0xef8159-0x0;var _0x2e1798=_0x7a54[_0xef8159];return _0x2e1798;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ce5237b..8d2bf15 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 _0xf716=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x5e586d,_0x2c47de){var _0x4aa612=function(_0x471241){while(--_0x471241){_0x5e586d['push'](_0x5e586d['shift']());}};_0x4aa612(++_0x2c47de);}(_0xf716,0x91));var _0x6f71=function(_0x355bc3,_0x7a93f7){_0x355bc3=_0x355bc3-0x0;var _0x34a9b3=_0xf716[_0x355bc3];return _0x34a9b3;};'use strict';var _=require(_0x6f71('0x0'));var util=require(_0x6f71('0x1'));var logger=require(_0x6f71('0x2'))(_0x6f71('0x3'));var moment=require(_0x6f71('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f71('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f71('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x6f71('0x7')]=function(_0x5dbf3b,_0x7accc9){return _0x5dbf3b[_0x6f71('0x8')](_0x6f71('0x9'),attributes,{'tableName':_0x6f71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48c4=['moment','request-promise','path','rimraf','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','../../config/logger','api'];(function(_0x97eeef,_0xab42c5){var _0x5d8a3b=function(_0xeb3910){while(--_0xeb3910){_0x97eeef['push'](_0x97eeef['shift']());}};_0x5d8a3b(++_0xab42c5);}(_0x48c4,0x197));var _0x448c=function(_0x2e5a5b,_0x46bbee){_0x2e5a5b=_0x2e5a5b-0x0;var _0xbbf868=_0x48c4[_0x2e5a5b];return _0xbbf868;};'use strict';var _=require(_0x448c('0x0'));var util=require('util');var logger=require(_0x448c('0x1'))(_0x448c('0x2'));var moment=require(_0x448c('0x3'));var BPromise=require('bluebird');var rp=require(_0x448c('0x4'));var fs=require('fs');var path=require(_0x448c('0x5'));var rimraf=require(_0x448c('0x6'));var config=require('../../config/environment');var attributes=require(_0x448c('0x7'));module['exports']=function(_0x28f5cf,_0x5ccbc4){return _0x28f5cf[_0x448c('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x448c('0x9'),'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 3279cb2..ad16564 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 _0x1310=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then'];(function(_0x1444b0,_0x187724){var _0x29617b=function(_0x58a705){while(--_0x58a705){_0x1444b0['push'](_0x1444b0['shift']());}};_0x29617b(++_0x187724);}(_0x1310,0x7c));var _0x0131=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1310[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0131('0x0'));var util=require(_0x0131('0x1'));var moment=require(_0x0131('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0131('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0131('0x4'));var logger=require(_0x0131('0x5'))('rpc');var config=require(_0x0131('0x6'));var jayson=require(_0x0131('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d56ee,_0x48aea9,_0x13f525){return new BPromise(function(_0x2cee2f,_0x267601){return client['request'](_0x4d56ee,_0x13f525)[_0x0131('0x8')](function(_0xe1e68c){logger[_0x0131('0x9')](_0x0131('0xa'),_0x48aea9,_0x0131('0xb'));logger[_0x0131('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x48aea9,_0x0131('0xb'),JSON[_0x0131('0xd')](_0xe1e68c));if(_0xe1e68c['error']){if(_0xe1e68c[_0x0131('0xe')][_0x0131('0xf')]===0x1f4){logger[_0x0131('0xe')](_0x0131('0xa'),_0x48aea9,_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);return _0x267601(_0xe1e68c['error'][_0x0131('0x10')]);}logger[_0x0131('0xe')](_0x0131('0xa'),_0x48aea9,_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);return _0x2cee2f(_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);}else{logger['info'](_0x0131('0xa'),_0x48aea9,'request\x20sent');_0x2cee2f(_0xe1e68c[_0x0131('0x11')][_0x0131('0x10')]);}})[_0x0131('0x12')](function(_0x12dcc6){logger[_0x0131('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48aea9,_0x12dcc6);_0x267601(_0x12dcc6);});});}
\ No newline at end of file
+var _0x051e=['jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x334372,_0x2fefaf){var _0x44bf72=function(_0x880df6){while(--_0x880df6){_0x334372['push'](_0x334372['shift']());}};_0x44bf72(++_0x2fefaf);}(_0x051e,0x133));var _0xe051=function(_0x5b3eec,_0x4d2208){_0x5b3eec=_0x5b3eec-0x0;var _0x4e7fb1=_0x051e[_0x5b3eec];return _0x4e7fb1;};'use strict';var _=require('lodash');var util=require(_0xe051('0x0'));var moment=require(_0xe051('0x1'));var BPromise=require(_0xe051('0x2'));var rs=require(_0xe051('0x3'));var fs=require('fs');var Redis=require(_0xe051('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe051('0x5'));var logger=require(_0xe051('0x6'))(_0xe051('0x7'));var config=require('../../config/environment');var jayson=require(_0xe051('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a5936,_0x2b0dc3,_0x5d78fd){return new BPromise(function(_0x441ebd,_0x59f96c){return client[_0xe051('0x9')](_0x6a5936,_0x5d78fd)[_0xe051('0xa')](function(_0x19bf52){logger[_0xe051('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2b0dc3,_0xe051('0xc'));logger[_0xe051('0xd')](_0xe051('0xe'),_0x2b0dc3,_0xe051('0xc'),JSON[_0xe051('0xf')](_0x19bf52));if(_0x19bf52[_0xe051('0x10')]){if(_0x19bf52['error'][_0xe051('0x11')]===0x1f4){logger[_0xe051('0x10')](_0xe051('0x12'),_0x2b0dc3,_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);return _0x59f96c(_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);}logger[_0xe051('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2b0dc3,_0x19bf52['error'][_0xe051('0x13')]);return _0x441ebd(_0x19bf52[_0xe051('0x10')][_0xe051('0x13')]);}else{logger['info'](_0xe051('0x12'),_0x2b0dc3,_0xe051('0xc'));_0x441ebd(_0x19bf52['result'][_0xe051('0x13')]);}})[_0xe051('0x14')](function(_0x3dd969){logger[_0xe051('0x10')](_0xe051('0x12'),_0x2b0dc3,_0x3dd969);_0x59f96c(_0x3dd969);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a9297f8..c3faf6a 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 _0x0ab3=['get','isAuthenticated','/:id','show','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0ab3,0x111));var _0x30ab=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0ab3[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x30ab('0x0'));var path=require(_0x30ab('0x1'));var timeout=require(_0x30ab('0x2'));var express=require(_0x30ab('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30ab('0x4'));var interaction=require(_0x30ab('0x5'));var config=require('../../config/environment');var controller=require(_0x30ab('0x6'));router[_0x30ab('0x7')]('/',auth[_0x30ab('0x8')](),controller['index']);router[_0x30ab('0x7')](_0x30ab('0x9'),auth[_0x30ab('0x8')](),controller[_0x30ab('0xa')]);router[_0x30ab('0x7')]('/:id/preview',auth[_0x30ab('0x8')](),controller['preview']);router[_0x30ab('0x7')](_0x30ab('0xb'),auth[_0x30ab('0x8')](),controller['run']);router[_0x30ab('0x7')](_0x30ab('0xc'),auth[_0x30ab('0x8')](),controller[_0x30ab('0xd')]);router[_0x30ab('0xe')]('/',auth[_0x30ab('0x8')](),controller[_0x30ab('0xf')]);router[_0x30ab('0x10')](_0x30ab('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x30ab('0x11')](_0x30ab('0x9'),auth[_0x30ab('0x8')](),controller[_0x30ab('0x12')]);module[_0x30ab('0x13')]=router;
\ No newline at end of file
+var _0xdcd0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','destroy','multer','util','connect-timeout','express','fs-extra'];(function(_0x7784a8,_0x24c8ed){var _0xa82040=function(_0x223f58){while(--_0x223f58){_0x7784a8['push'](_0x7784a8['shift']());}};_0xa82040(++_0x24c8ed);}(_0xdcd0,0x1cf));var _0x0dcd=function(_0x2e50b0,_0x54b097){_0x2e50b0=_0x2e50b0-0x0;var _0x5462e5=_0xdcd0[_0x2e50b0];return _0x5462e5;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require(_0x0dcd('0x1'));var path=require('path');var timeout=require(_0x0dcd('0x2'));var express=require(_0x0dcd('0x3'));var router=express['Router']();var fs_extra=require(_0x0dcd('0x4'));var auth=require(_0x0dcd('0x5'));var interaction=require(_0x0dcd('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x0dcd('0x7')]('/',auth[_0x0dcd('0x8')](),controller['index']);router['get'](_0x0dcd('0x9'),auth['isAuthenticated'](),controller[_0x0dcd('0xa')]);router[_0x0dcd('0x7')](_0x0dcd('0xb'),auth['isAuthenticated'](),controller[_0x0dcd('0xc')]);router['get'](_0x0dcd('0xd'),auth[_0x0dcd('0x8')](),controller['run']);router[_0x0dcd('0x7')](_0x0dcd('0xe'),auth[_0x0dcd('0x8')](),controller[_0x0dcd('0xf')]);router['post']('/',auth[_0x0dcd('0x8')](),controller['create']);router[_0x0dcd('0x10')](_0x0dcd('0x9'),auth[_0x0dcd('0x8')](),controller['update']);router['delete'](_0x0dcd('0x9'),auth[_0x0dcd('0x8')](),controller[_0x0dcd('0x11')]);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 f04514a..1c9af1e 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 _0xd183=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED'];(function(_0x129046,_0x519448){var _0x4d06d9=function(_0x425c26){while(--_0x425c26){_0x129046['push'](_0x129046['shift']());}};_0x4d06d9(++_0x519448);}(_0xd183,0xb0));var _0x3d18=function(_0x5e2b95,_0x45e3a2){_0x5e2b95=_0x5e2b95-0x0;var _0x23aebd=_0xd183[_0x5e2b95];return _0x23aebd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3d18('0x0'));module[_0x3d18('0x1')]={'name':{'type':Sequelize[_0x3d18('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3d18('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3d18('0x3')](_0x3d18('0x4'),_0x3d18('0x5'),_0x3d18('0x6')),'allowNull':![],'defaultValue':_0x3d18('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3d18('0x7')]},'endDate':{'type':Sequelize[_0x3d18('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3d18('0x3')](_0x3d18('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3d18('0x9')](0xb)[_0x3d18('0xa')]},'reportType':{'type':Sequelize[_0x3d18('0x2')]}};
\ No newline at end of file
+var _0xdb89=['UNSIGNED','sequelize','moment','exports','STRING','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x449fb0,_0xf691a2){var _0x10bb91=function(_0x86e613){while(--_0x86e613){_0x449fb0['push'](_0x449fb0['shift']());}};_0x10bb91(++_0xf691a2);}(_0xdb89,0x1a5));var _0x9db8=function(_0x10cccd,_0x293ecd){_0x10cccd=_0x10cccd-0x0;var _0x4a378c=_0xdb89[_0x10cccd];return _0x4a378c;};'use strict';var Sequelize=require(_0x9db8('0x0'));var moment=require(_0x9db8('0x1'));module[_0x9db8('0x2')]={'name':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9db8('0x4'),'pdf',_0x9db8('0x5')),'allowNull':![],'defaultValue':_0x9db8('0x4')},'savename':{'type':Sequelize[_0x9db8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9db8('0x6')]},'endDate':{'type':Sequelize[_0x9db8('0x6')]},'status':{'type':Sequelize[_0x9db8('0x3')],'defaultValue':_0x9db8('0x7')},'type':{'type':Sequelize['ENUM'](_0x9db8('0x8'),_0x9db8('0x9')),'allowNull':![],'defaultValue':_0x9db8('0x8')},'reportId':{'type':Sequelize[_0x9db8('0xa')](0xb)[_0x9db8('0xb')]},'reportType':{'type':Sequelize[_0x9db8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2fdcdd1..ecc8c98 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 _0x0399=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','name','send','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x39cbb3,_0x5e1877){var _0xb6aea2=function(_0x4e6f49){while(--_0x4e6f49){_0x39cbb3['push'](_0x39cbb3['shift']());}};_0xb6aea2(++_0x5e1877);}(_0x0399,0x1de));var _0x9039=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0399[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x9039('0x0'));var rimraf=require(_0x9039('0x1'));var zipdir=require(_0x9039('0x2'));var jsonpatch=require(_0x9039('0x3'));var rp=require(_0x9039('0x4'));var moment=require(_0x9039('0x5'));var BPromise=require(_0x9039('0x6'));var Mustache=require(_0x9039('0x7'));var util=require(_0x9039('0x8'));var path=require(_0x9039('0x9'));var sox=require(_0x9039('0xa'));var csv=require(_0x9039('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9039('0xc'));var _=require(_0x9039('0xd'));var squel=require(_0x9039('0xe'));var crypto=require('crypto');var jsforce=require(_0x9039('0xf'));var deskjs=require(_0x9039('0x10'));var toCsv=require(_0x9039('0xb'));var querystring=require(_0x9039('0x11'));var Papa=require(_0x9039('0x12'));var Redis=require(_0x9039('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9039('0x14'));var as=require(_0x9039('0x15'));var hardwareService=require(_0x9039('0x16'));var logger=require(_0x9039('0x17'))(_0x9039('0x18'));var utils=require(_0x9039('0x19'));var config=require(_0x9039('0x1a'));var licenseUtil=require(_0x9039('0x1b'));var db=require(_0x9039('0x1c'))['db'];function respondWithStatusCode(_0x4a674b,_0x56e270){_0x56e270=_0x56e270||0xcc;return function(_0x1b2195){if(_0x1b2195){return _0x4a674b['sendStatus'](_0x56e270);}return _0x4a674b[_0x9039('0x1d')](_0x56e270)['end']();};}function respondWithResult(_0x2486c9,_0x4fdcab){_0x4fdcab=_0x4fdcab||0xc8;return function(_0x15f9b4){if(_0x15f9b4){return _0x2486c9['status'](_0x4fdcab)[_0x9039('0x1e')](_0x15f9b4);}};}function respondWithFilteredResult(_0x1be16c,_0x375575){return function(_0xef61a9){if(_0xef61a9){var _0x46ae7e=typeof _0x375575[_0x9039('0x1f')]===_0x9039('0x20')&&typeof _0x375575[_0x9039('0x21')]===_0x9039('0x20');var _0x5df6bd=_0xef61a9[_0x9039('0x22')];var _0x1ea359=_0x46ae7e?0x0:_0x375575[_0x9039('0x1f')];var _0x1b6fb5=_0x46ae7e?_0xef61a9['count']:_0x375575[_0x9039('0x1f')]+_0x375575['limit'];var _0x38e6df;if(_0x1b6fb5>=_0x5df6bd){_0x1b6fb5=_0x5df6bd;_0x38e6df=0xc8;}else{_0x38e6df=0xce;}_0x1be16c['status'](_0x38e6df);return _0x1be16c[_0x9039('0x23')](_0x9039('0x24'),_0x1ea359+'-'+_0x1b6fb5+'/'+_0x5df6bd)[_0x9039('0x1e')](_0xef61a9);}return null;};}function patchUpdates(_0x9dc205){return function(_0x18aaf5){try{jsonpatch[_0x9039('0x25')](_0x18aaf5,_0x9dc205,!![]);}catch(_0x1aea83){return BPromise[_0x9039('0x26')](_0x1aea83);}return _0x18aaf5[_0x9039('0x27')]();};}function saveUpdates(_0x55919a,_0xe85dae){return function(_0x37e2bf){if(_0x37e2bf){return _0x37e2bf[_0x9039('0x28')](_0x55919a)[_0x9039('0x29')](function(_0x3ae0b4){return _0x3ae0b4;});}return null;};}function removeEntity(_0x50e093,_0x37614f){return function(_0x465b64){if(_0x465b64){return _0x465b64['destroy']()[_0x9039('0x29')](function(){var _0x337399=_0x465b64[_0x9039('0x2a')]({'plain':!![]});var _0x38c8ec=_0x9039('0x2b');return db[_0x9039('0x2c')][_0x9039('0x2d')]({'where':{'type':_0x38c8ec,'resourceId':_0x337399['id']}})[_0x9039('0x29')](function(){return _0x465b64;});})['then'](function(){_0x50e093[_0x9039('0x1d')](0xcc)[_0x9039('0x2e')]();});}};}function handleEntityNotFound(_0x3ec235,_0x35ae1c){return function(_0x4cdd30){if(!_0x4cdd30){_0x3ec235['sendStatus'](0x194);}return _0x4cdd30;};}function handleError(_0x310682,_0x4d1a46){_0x4d1a46=_0x4d1a46||0x1f4;return function(_0x6f6139){logger[_0x9039('0x2f')](_0x6f6139['stack']);if(_0x6f6139[_0x9039('0x30')]){delete _0x6f6139['name'];}_0x310682['status'](_0x4d1a46)[_0x9039('0x31')](_0x6f6139);};}exports['index']=function(_0x120618,_0x57ceed){var _0x2c58a4={},_0xa9e7ee={},_0x987607={'count':0x0,'rows':[]};var _0x938dbd=_[_0x9039('0x32')](db[_0x9039('0x33')][_0x9039('0x34')],function(_0x56f572){return{'name':_0x56f572['fieldName'],'type':_0x56f572[_0x9039('0x35')]['key']};});_0xa9e7ee[_0x9039('0x36')]=_[_0x9039('0x32')](_0x938dbd,'name');_0xa9e7ee[_0x9039('0x37')]=_[_0x9039('0x38')](_0x120618[_0x9039('0x37')]);_0xa9e7ee[_0x9039('0x39')]=_[_0x9039('0x3a')](_0xa9e7ee['model'],_0xa9e7ee[_0x9039('0x37')]);_0x2c58a4['attributes']=_[_0x9039('0x3a')](_0xa9e7ee[_0x9039('0x36')],qs[_0x9039('0x3b')](_0x120618[_0x9039('0x37')]['fields']));_0x2c58a4[_0x9039('0x3c')]=_0x2c58a4[_0x9039('0x3c')][_0x9039('0x3d')]?_0x2c58a4[_0x9039('0x3c')]:_0xa9e7ee[_0x9039('0x36')];if(!_0x120618['query'][_0x9039('0x3e')]('nolimit')){_0x2c58a4[_0x9039('0x21')]=qs['limit'](_0x120618[_0x9039('0x37')]['limit']);_0x2c58a4['offset']=qs[_0x9039('0x1f')](_0x120618[_0x9039('0x37')][_0x9039('0x1f')]);}_0x2c58a4['order']=qs[_0x9039('0x3f')](_0x120618[_0x9039('0x37')][_0x9039('0x3f')]);_0x2c58a4[_0x9039('0x40')]=qs[_0x9039('0x39')](_[_0x9039('0x41')](_0x120618[_0x9039('0x37')],_0xa9e7ee[_0x9039('0x39')]),_0x938dbd);if(_0x120618['query'][_0x9039('0x42')]){_0x2c58a4[_0x9039('0x40')]=_['merge'](_0x2c58a4[_0x9039('0x40')],{'$or':_['map'](_0x938dbd,function(_0x4fada9){if(_0x4fada9[_0x9039('0x35')]!==_0x9039('0x43')){var _0x44b187={};_0x44b187[_0x4fada9[_0x9039('0x30')]]={'$like':'%'+_0x120618[_0x9039('0x37')][_0x9039('0x42')]+'%'};return _0x44b187;}})});}_0x2c58a4=_[_0x9039('0x44')]({},_0x2c58a4,_0x120618[_0x9039('0x45')]);var _0x4cea03={'where':_0x2c58a4[_0x9039('0x40')]};return db[_0x9039('0x33')][_0x9039('0x22')](_0x4cea03)[_0x9039('0x29')](function(_0x41776c){_0x987607[_0x9039('0x22')]=_0x41776c;if(_0x120618[_0x9039('0x37')]['includeAll']){_0x2c58a4['include']=[{'all':!![]}];}return db[_0x9039('0x33')][_0x9039('0x46')](_0x2c58a4);})[_0x9039('0x29')](function(_0x5880a8){_0x987607[_0x9039('0x47')]=_0x5880a8;return _0x987607;})['then'](respondWithFilteredResult(_0x57ceed,_0x2c58a4))[_0x9039('0x48')](handleError(_0x57ceed,null));};exports['show']=function(_0x24ea2e,_0x21ad96){var _0x2eabdc={'raw':!![],'where':{'id':_0x24ea2e[_0x9039('0x49')]['id']}},_0x3da029={};_0x3da029[_0x9039('0x36')]=_[_0x9039('0x38')](db[_0x9039('0x33')][_0x9039('0x34')]);_0x3da029[_0x9039('0x37')]=_[_0x9039('0x38')](_0x24ea2e[_0x9039('0x37')]);_0x3da029[_0x9039('0x39')]=_['intersection'](_0x3da029[_0x9039('0x36')],_0x3da029[_0x9039('0x37')]);_0x2eabdc[_0x9039('0x3c')]=_[_0x9039('0x3a')](_0x3da029[_0x9039('0x36')],qs['fields'](_0x24ea2e['query'][_0x9039('0x3b')]));_0x2eabdc[_0x9039('0x3c')]=_0x2eabdc[_0x9039('0x3c')][_0x9039('0x3d')]?_0x2eabdc[_0x9039('0x3c')]:_0x3da029[_0x9039('0x36')];if(_0x24ea2e['query'][_0x9039('0x4a')]){_0x2eabdc[_0x9039('0x4b')]=[{'all':!![]}];}_0x2eabdc=_[_0x9039('0x44')]({},_0x2eabdc,_0x24ea2e[_0x9039('0x45')]);return db[_0x9039('0x33')][_0x9039('0x4c')](_0x2eabdc)[_0x9039('0x29')](handleEntityNotFound(_0x21ad96,null))[_0x9039('0x29')](respondWithResult(_0x21ad96,null))[_0x9039('0x48')](handleError(_0x21ad96,null));};exports[_0x9039('0x4d')]=function(_0x370555,_0x904df8){return db[_0x9039('0x33')]['create'](_0x370555[_0x9039('0x4e')],{})['then'](function(_0x4591e5){var _0x3c10a4=_0x370555['user'][_0x9039('0x2a')]({'plain':!![]});if(!_0x3c10a4)throw new Error(_0x9039('0x4f'));if(_0x3c10a4[_0x9039('0x50')]===_0x9039('0x51')){var _0x1484d1=_0x4591e5[_0x9039('0x2a')]({'plain':!![]});var _0x7712aa=_0x9039('0x2b');return db[_0x9039('0x52')][_0x9039('0x4c')]({'where':{'name':_0x7712aa,'userProfileId':_0x3c10a4['userProfileId']},'raw':!![]})['then'](function(_0xbf7a75){if(_0xbf7a75&&_0xbf7a75['autoAssociation']===0x0){return db[_0x9039('0x2c')][_0x9039('0x4d')]({'name':_0x1484d1[_0x9039('0x30')],'resourceId':_0x1484d1['id'],'type':_0xbf7a75['name'],'sectionId':_0xbf7a75['id']},{})['then'](function(){return _0x4591e5;});}else{return _0x4591e5;}})[_0x9039('0x48')](function(_0x3dedb4){logger[_0x9039('0x2f')](_0x9039('0x53'),_0x3dedb4);throw _0x3dedb4;});}return _0x4591e5;})['then'](respondWithResult(_0x904df8,0xc9))[_0x9039('0x48')](handleError(_0x904df8,null));};exports['update']=function(_0x2d2aa2,_0x3f9e46){if(_0x2d2aa2[_0x9039('0x4e')]['id']){delete _0x2d2aa2['body']['id'];}return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x2d2aa2[_0x9039('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f9e46,null))[_0x9039('0x29')](saveUpdates(_0x2d2aa2['body'],null))[_0x9039('0x29')](respondWithResult(_0x3f9e46,null))[_0x9039('0x48')](handleError(_0x3f9e46,null));};exports['destroy']=function(_0x3df798,_0x183ea9){return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x3df798[_0x9039('0x49')]['id']}})[_0x9039('0x29')](handleEntityNotFound(_0x183ea9,null))[_0x9039('0x29')](removeEntity(_0x183ea9,null))[_0x9039('0x48')](handleError(_0x183ea9,null));};exports[_0x9039('0x54')]=function(_0x488511,_0x1014c4,_0x22b98c){return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x488511['params']['id']},'attributes':['name',_0x9039('0x55'),_0x9039('0x56'),_0x9039('0x57')],'raw':!![]})[_0x9039('0x29')](handleEntityNotFound(_0x1014c4,null))['then'](function(_0x256106){if(_0x256106){if(!fs[_0x9039('0x58')](path[_0x9039('0x59')](config['root'],_0x9039('0x5a'),_0x256106[_0x9039('0x56')]))){throw new db[(_0x9039('0x5b'))][(_0x9039('0x5c'))](_0x9039('0x5d'));}if(_0x488511[_0x9039('0x37')][_0x9039('0x5e')]){return _0x1014c4[_0x9039('0x5f')](0xc8);}return _0x1014c4['download'](path[_0x9039('0x59')](config['root'],_0x9039('0x5a'),_0x256106[_0x9039('0x56')]),util[_0x9039('0x60')](_0x9039('0x61'),_0x256106[_0x9039('0x55')]||_0x256106[_0x9039('0x30')],_0x256106['output']['toLowerCase']()));}})[_0x9039('0x48')](handleError(_0x1014c4,null));};
\ No newline at end of file
+var _0x0640=['join','server/files/reports','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','name','index','map','AnalyticExtractedReport','fieldName','type','model','keys','filters','intersection','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','savename','output','existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists'];(function(_0x1fa387,_0x40e45f){var _0x2f0101=function(_0x55e833){while(--_0x55e833){_0x1fa387['push'](_0x1fa387['shift']());}};_0x2f0101(++_0x40e45f);}(_0x0640,0xbc));var _0x0064=function(_0xc191c8,_0x2098f9){_0xc191c8=_0xc191c8-0x0;var _0x2d8373=_0x0640[_0xc191c8];return _0x2d8373;};'use strict';var emlformat=require(_0x0064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0064('0x1'));var jsonpatch=require(_0x0064('0x2'));var rp=require(_0x0064('0x3'));var moment=require(_0x0064('0x4'));var BPromise=require(_0x0064('0x5'));var Mustache=require(_0x0064('0x6'));var util=require(_0x0064('0x7'));var path=require(_0x0064('0x8'));var sox=require('sox');var csv=require(_0x0064('0x9'));var ejs=require(_0x0064('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0064('0xb'));var squel=require(_0x0064('0xc'));var crypto=require(_0x0064('0xd'));var jsforce=require(_0x0064('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0064('0xf'));var Papa=require('papaparse');var Redis=require(_0x0064('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0064('0x11'));var logger=require(_0x0064('0x12'))(_0x0064('0x13'));var utils=require(_0x0064('0x14'));var config=require(_0x0064('0x15'));var licenseUtil=require(_0x0064('0x16'));var db=require(_0x0064('0x17'))['db'];function respondWithStatusCode(_0x472765,_0x4564b0){_0x4564b0=_0x4564b0||0xcc;return function(_0x36ec05){if(_0x36ec05){return _0x472765[_0x0064('0x18')](_0x4564b0);}return _0x472765[_0x0064('0x19')](_0x4564b0)['end']();};}function respondWithResult(_0x2a83b0,_0x1a15c8){_0x1a15c8=_0x1a15c8||0xc8;return function(_0x236974){if(_0x236974){return _0x2a83b0[_0x0064('0x19')](_0x1a15c8)[_0x0064('0x1a')](_0x236974);}};}function respondWithFilteredResult(_0x165833,_0x176fc8){return function(_0x2f8a79){if(_0x2f8a79){var _0x4fccba=typeof _0x176fc8[_0x0064('0x1b')]===_0x0064('0x1c')&&typeof _0x176fc8[_0x0064('0x1d')]==='undefined';var _0x5cce14=_0x2f8a79[_0x0064('0x1e')];var _0x1bb51d=_0x4fccba?0x0:_0x176fc8[_0x0064('0x1b')];var _0x356aeb=_0x4fccba?_0x2f8a79['count']:_0x176fc8[_0x0064('0x1b')]+_0x176fc8['limit'];var _0x264f50;if(_0x356aeb>=_0x5cce14){_0x356aeb=_0x5cce14;_0x264f50=0xc8;}else{_0x264f50=0xce;}_0x165833[_0x0064('0x19')](_0x264f50);return _0x165833[_0x0064('0x1f')](_0x0064('0x20'),_0x1bb51d+'-'+_0x356aeb+'/'+_0x5cce14)[_0x0064('0x1a')](_0x2f8a79);}return null;};}function patchUpdates(_0x56bcf2){return function(_0x2c7fe4){try{jsonpatch[_0x0064('0x21')](_0x2c7fe4,_0x56bcf2,!![]);}catch(_0x3595dc){return BPromise[_0x0064('0x22')](_0x3595dc);}return _0x2c7fe4[_0x0064('0x23')]();};}function saveUpdates(_0xf216fb,_0x2ead4d){return function(_0x2673bd){if(_0x2673bd){return _0x2673bd[_0x0064('0x24')](_0xf216fb)[_0x0064('0x25')](function(_0xd93470){return _0xd93470;});}return null;};}function removeEntity(_0x19caca,_0x435d3b){return function(_0x6580c7){if(_0x6580c7){return _0x6580c7[_0x0064('0x26')]()[_0x0064('0x25')](function(){var _0x3455ec=_0x6580c7['get']({'plain':!![]});var _0x4875ab=_0x0064('0x27');return db[_0x0064('0x28')][_0x0064('0x26')]({'where':{'type':_0x4875ab,'resourceId':_0x3455ec['id']}})[_0x0064('0x25')](function(){return _0x6580c7;});})[_0x0064('0x25')](function(){_0x19caca[_0x0064('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb512,_0x1b3a51){return function(_0x4cb28c){if(!_0x4cb28c){_0x5bb512[_0x0064('0x18')](0x194);}return _0x4cb28c;};}function handleError(_0x527e10,_0xf2ae5f){_0xf2ae5f=_0xf2ae5f||0x1f4;return function(_0x48114d){logger['error'](_0x48114d['stack']);if(_0x48114d[_0x0064('0x29')]){delete _0x48114d['name'];}_0x527e10[_0x0064('0x19')](_0xf2ae5f)['send'](_0x48114d);};}exports[_0x0064('0x2a')]=function(_0x510f95,_0x44da95){var _0x38f523={},_0x192caf={},_0x28dbab={'count':0x0,'rows':[]};var _0xdca530=_[_0x0064('0x2b')](db[_0x0064('0x2c')]['rawAttributes'],function(_0x2eb78a){return{'name':_0x2eb78a[_0x0064('0x2d')],'type':_0x2eb78a[_0x0064('0x2e')]['key']};});_0x192caf[_0x0064('0x2f')]=_[_0x0064('0x2b')](_0xdca530,_0x0064('0x29'));_0x192caf['query']=_[_0x0064('0x30')](_0x510f95['query']);_0x192caf[_0x0064('0x31')]=_[_0x0064('0x32')](_0x192caf[_0x0064('0x2f')],_0x192caf[_0x0064('0x33')]);_0x38f523[_0x0064('0x34')]=_['intersection'](_0x192caf[_0x0064('0x2f')],qs['fields'](_0x510f95[_0x0064('0x33')]['fields']));_0x38f523[_0x0064('0x34')]=_0x38f523['attributes'][_0x0064('0x35')]?_0x38f523[_0x0064('0x34')]:_0x192caf['model'];if(!_0x510f95['query']['hasOwnProperty'](_0x0064('0x36'))){_0x38f523[_0x0064('0x1d')]=qs[_0x0064('0x1d')](_0x510f95[_0x0064('0x33')][_0x0064('0x1d')]);_0x38f523['offset']=qs[_0x0064('0x1b')](_0x510f95['query'][_0x0064('0x1b')]);}_0x38f523[_0x0064('0x37')]=qs[_0x0064('0x38')](_0x510f95[_0x0064('0x33')][_0x0064('0x38')]);_0x38f523[_0x0064('0x39')]=qs[_0x0064('0x31')](_[_0x0064('0x3a')](_0x510f95[_0x0064('0x33')],_0x192caf[_0x0064('0x31')]),_0xdca530);if(_0x510f95[_0x0064('0x33')][_0x0064('0x3b')]){_0x38f523['where']=_[_0x0064('0x3c')](_0x38f523[_0x0064('0x39')],{'$or':_[_0x0064('0x2b')](_0xdca530,function(_0x428776){if(_0x428776[_0x0064('0x2e')]!==_0x0064('0x3d')){var _0x121ff9={};_0x121ff9[_0x428776[_0x0064('0x29')]]={'$like':'%'+_0x510f95[_0x0064('0x33')]['filter']+'%'};return _0x121ff9;}})});}_0x38f523=_[_0x0064('0x3c')]({},_0x38f523,_0x510f95['options']);var _0x79a574={'where':_0x38f523[_0x0064('0x39')]};return db[_0x0064('0x2c')]['count'](_0x79a574)[_0x0064('0x25')](function(_0x4a8f07){_0x28dbab[_0x0064('0x1e')]=_0x4a8f07;if(_0x510f95['query'][_0x0064('0x3e')]){_0x38f523[_0x0064('0x3f')]=[{'all':!![]}];}return db[_0x0064('0x2c')][_0x0064('0x40')](_0x38f523);})[_0x0064('0x25')](function(_0xa4a71d){_0x28dbab['rows']=_0xa4a71d;return _0x28dbab;})[_0x0064('0x25')](respondWithFilteredResult(_0x44da95,_0x38f523))[_0x0064('0x41')](handleError(_0x44da95,null));};exports[_0x0064('0x42')]=function(_0x456930,_0x2cde53){var _0x4cef8a={'raw':!![],'where':{'id':_0x456930[_0x0064('0x43')]['id']}},_0xfb6b77={};_0xfb6b77[_0x0064('0x2f')]=_[_0x0064('0x30')](db[_0x0064('0x2c')]['rawAttributes']);_0xfb6b77['query']=_[_0x0064('0x30')](_0x456930[_0x0064('0x33')]);_0xfb6b77[_0x0064('0x31')]=_['intersection'](_0xfb6b77['model'],_0xfb6b77[_0x0064('0x33')]);_0x4cef8a[_0x0064('0x34')]=_['intersection'](_0xfb6b77[_0x0064('0x2f')],qs[_0x0064('0x44')](_0x456930[_0x0064('0x33')][_0x0064('0x44')]));_0x4cef8a[_0x0064('0x34')]=_0x4cef8a['attributes'][_0x0064('0x35')]?_0x4cef8a[_0x0064('0x34')]:_0xfb6b77[_0x0064('0x2f')];if(_0x456930['query'][_0x0064('0x3e')]){_0x4cef8a[_0x0064('0x3f')]=[{'all':!![]}];}_0x4cef8a=_['merge']({},_0x4cef8a,_0x456930[_0x0064('0x45')]);return db[_0x0064('0x2c')][_0x0064('0x46')](_0x4cef8a)['then'](handleEntityNotFound(_0x2cde53,null))[_0x0064('0x25')](respondWithResult(_0x2cde53,null))['catch'](handleError(_0x2cde53,null));};exports[_0x0064('0x47')]=function(_0x416b64,_0x591876){return db[_0x0064('0x2c')][_0x0064('0x47')](_0x416b64[_0x0064('0x48')],{})[_0x0064('0x25')](function(_0x3dce4d){var _0x2db0b5=_0x416b64[_0x0064('0x49')]['get']({'plain':!![]});if(!_0x2db0b5)throw new Error(_0x0064('0x4a'));if(_0x2db0b5[_0x0064('0x4b')]===_0x0064('0x49')){var _0x215a67=_0x3dce4d[_0x0064('0x4c')]({'plain':!![]});var _0x13f9c1='ExtractedReports';return db[_0x0064('0x4d')][_0x0064('0x46')]({'where':{'name':_0x13f9c1,'userProfileId':_0x2db0b5[_0x0064('0x4e')]},'raw':!![]})[_0x0064('0x25')](function(_0x4c9fce){if(_0x4c9fce&&_0x4c9fce[_0x0064('0x4f')]===0x0){return db[_0x0064('0x28')][_0x0064('0x47')]({'name':_0x215a67[_0x0064('0x29')],'resourceId':_0x215a67['id'],'type':_0x4c9fce[_0x0064('0x29')],'sectionId':_0x4c9fce['id']},{})[_0x0064('0x25')](function(){return _0x3dce4d;});}else{return _0x3dce4d;}})[_0x0064('0x41')](function(_0x44769e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44769e);throw _0x44769e;});}return _0x3dce4d;})['then'](respondWithResult(_0x591876,0xc9))[_0x0064('0x41')](handleError(_0x591876,null));};exports[_0x0064('0x24')]=function(_0x143e51,_0xc9d1c7){if(_0x143e51[_0x0064('0x48')]['id']){delete _0x143e51[_0x0064('0x48')]['id'];}return db[_0x0064('0x2c')][_0x0064('0x46')]({'where':{'id':_0x143e51[_0x0064('0x43')]['id']}})[_0x0064('0x25')](handleEntityNotFound(_0xc9d1c7,null))[_0x0064('0x25')](saveUpdates(_0x143e51[_0x0064('0x48')],null))[_0x0064('0x25')](respondWithResult(_0xc9d1c7,null))[_0x0064('0x41')](handleError(_0xc9d1c7,null));};exports[_0x0064('0x26')]=function(_0x398c7b,_0x71607f){return db['AnalyticExtractedReport'][_0x0064('0x46')]({'where':{'id':_0x398c7b[_0x0064('0x43')]['id']}})[_0x0064('0x25')](handleEntityNotFound(_0x71607f,null))['then'](removeEntity(_0x71607f,null))[_0x0064('0x41')](handleError(_0x71607f,null));};exports['download']=function(_0xcd3b70,_0x467b69,_0x4ef031){return db[_0x0064('0x2c')][_0x0064('0x46')]({'where':{'id':_0xcd3b70[_0x0064('0x43')]['id']},'attributes':[_0x0064('0x29'),'basename',_0x0064('0x50'),_0x0064('0x51')],'raw':!![]})[_0x0064('0x25')](handleEntityNotFound(_0x467b69,null))[_0x0064('0x25')](function(_0x72c238){if(_0x72c238){if(!fs[_0x0064('0x52')](path['join'](config[_0x0064('0x53')],'server/files/reports',_0x72c238[_0x0064('0x50')]))){throw new db[(_0x0064('0x54'))][(_0x0064('0x55'))](_0x0064('0x56'));}if(_0xcd3b70[_0x0064('0x33')][_0x0064('0x57')]){return _0x467b69[_0x0064('0x18')](0xc8);}return _0x467b69['download'](path[_0x0064('0x58')](config[_0x0064('0x53')],_0x0064('0x59'),_0x72c238[_0x0064('0x50')]),util[_0x0064('0x5a')]('%s.%s',_0x72c238['basename']||_0x72c238[_0x0064('0x29')],_0x72c238['output'][_0x0064('0x5b')]()));}})[_0x0064('0x41')](handleError(_0x467b69,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0d8b5cb..284ea56 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 _0x86ca=['analytics_extracted_reports','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x86ca,0x119));var _0xa86c=function(_0x349b26,_0x5b560b){_0x349b26=_0x349b26-0x0;var _0x2c1235=_0x86ca[_0x349b26];return _0x2c1235;};'use strict';var _=require(_0xa86c('0x0'));var util=require('util');var logger=require(_0xa86c('0x1'))(_0xa86c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa86c('0x3'));var fs=require('fs');var path=require(_0xa86c('0x4'));var rimraf=require(_0xa86c('0x5'));var config=require(_0xa86c('0x6'));var attributes=require(_0xa86c('0x7'));module[_0xa86c('0x8')]=function(_0x448dfb,_0x30a5d6){return _0x448dfb['define']('AnalyticExtractedReport',attributes,{'tableName':_0xa86c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd052=['../../config/logger','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x31e4d8,_0x1222e3){var _0xc2ec79=function(_0x900f07){while(--_0x900f07){_0x31e4d8['push'](_0x31e4d8['shift']());}};_0xc2ec79(++_0x1222e3);}(_0xd052,0x1d2));var _0x2d05=function(_0x329ab8,_0x3295c7){_0x329ab8=_0x329ab8-0x0;var _0x5f3aa8=_0xd052[_0x329ab8];return _0x5f3aa8;};'use strict';var _=require(_0x2d05('0x0'));var util=require(_0x2d05('0x1'));var logger=require(_0x2d05('0x2'))(_0x2d05('0x3'));var moment=require(_0x2d05('0x4'));var BPromise=require(_0x2d05('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d05('0x6'));var rimraf=require(_0x2d05('0x7'));var config=require('../../config/environment');var attributes=require(_0x2d05('0x8'));module[_0x2d05('0x9')]=function(_0x55a964,_0x1b47ef){return _0x55a964[_0x2d05('0xa')](_0x2d05('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 27db164..1405960 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 _0x7948=['jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e2135,_0x55d94e){var _0x39ac3d=function(_0xb3c8f6){while(--_0xb3c8f6){_0x5e2135['push'](_0x5e2135['shift']());}};_0x39ac3d(++_0x55d94e);}(_0x7948,0x185));var _0x8794=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x7948[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require(_0x8794('0x3'));var rs=require(_0x8794('0x4'));var fs=require('fs');var Redis=require(_0x8794('0x5'));var db=require(_0x8794('0x6'))['db'];var utils=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var config=require(_0x8794('0xa'));var jayson=require(_0x8794('0xb'));var client=jayson[_0x8794('0xc')][_0x8794('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28d12e,_0x2276f2,_0x22b452){return new BPromise(function(_0x27f31e,_0x6d7e86){return client[_0x8794('0xe')](_0x28d12e,_0x22b452)[_0x8794('0xf')](function(_0x2305d8){logger[_0x8794('0x10')](_0x8794('0x11'),_0x2276f2,_0x8794('0x12'));logger[_0x8794('0x13')](_0x8794('0x14'),_0x2276f2,_0x8794('0x12'),JSON[_0x8794('0x15')](_0x2305d8));if(_0x2305d8[_0x8794('0x16')]){if(_0x2305d8[_0x8794('0x16')]['code']===0x1f4){logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x6d7e86(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x27f31e(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}else{logger[_0x8794('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2276f2,_0x8794('0x12'));_0x27f31e(_0x2305d8['result']['message']);}})[_0x8794('0x18')](function(_0x8b862a){logger[_0x8794('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2276f2,_0x8b862a);_0x6d7e86(_0x8b862a);});});}
\ No newline at end of file
+var _0x5dc7=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x5dc7,0x148));var _0x75dc=function(_0x589639,_0x5ae3db){_0x589639=_0x589639-0x0;var _0x2ade0e=_0x5dc7[_0x589639];return _0x2ade0e;};'use strict';var _=require(_0x75dc('0x0'));var util=require(_0x75dc('0x1'));var moment=require('moment');var BPromise=require(_0x75dc('0x2'));var rs=require(_0x75dc('0x3'));var fs=require('fs');var Redis=require(_0x75dc('0x4'));var db=require(_0x75dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75dc('0x6'));var config=require(_0x75dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x75dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8196a0,_0x335263,_0x24f85d){return new BPromise(function(_0x2d951e,_0x1d17ee){return client[_0x75dc('0x9')](_0x8196a0,_0x24f85d)['then'](function(_0x5ef7c8){logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,'request\x20sent');logger[_0x75dc('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x335263,_0x75dc('0xd'),JSON[_0x75dc('0xe')](_0x5ef7c8));if(_0x5ef7c8[_0x75dc('0xf')]){if(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x10')]===0x1f4){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x1d17ee(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}logger[_0x75dc('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x2d951e(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}else{logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,_0x75dc('0xd'));_0x2d951e(_0x5ef7c8[_0x75dc('0x12')][_0x75dc('0x11')]);}})[_0x75dc('0x13')](function(_0xd68462){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0xd68462);_0x1d17ee(_0xd68462);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2a28f6d..410c48d 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 _0x97ef=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','download','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2ea262,_0x58ada0){var _0x4f51ad=function(_0xd0ba71){while(--_0xd0ba71){_0x2ea262['push'](_0x2ea262['shift']());}};_0x4f51ad(++_0x58ada0);}(_0x97ef,0x71));var _0xf97e=function(_0xc7ef13,_0x5366b9){_0xc7ef13=_0xc7ef13-0x0;var _0x368264=_0x97ef[_0xc7ef13];return _0x368264;};'use strict';var multer=require(_0xf97e('0x0'));var util=require(_0xf97e('0x1'));var path=require(_0xf97e('0x2'));var timeout=require(_0xf97e('0x3'));var express=require(_0xf97e('0x4'));var router=express[_0xf97e('0x5')]();var fs_extra=require(_0xf97e('0x6'));var auth=require(_0xf97e('0x7'));var interaction=require(_0xf97e('0x8'));var config=require(_0xf97e('0x9'));var controller=require(_0xf97e('0xa'));router[_0xf97e('0xb')]('/',auth['isAuthenticated'](),controller[_0xf97e('0xc')]);router[_0xf97e('0xb')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0xf')]);router[_0xf97e('0xb')]('/:id/download',auth[_0xf97e('0xe')](),controller[_0xf97e('0x10')]);router['post']('/',auth[_0xf97e('0xe')](),controller[_0xf97e('0x11')]);router[_0xf97e('0x12')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0x13')]);router[_0xf97e('0x14')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0x15')]);module[_0xf97e('0x16')]=router;
\ No newline at end of file
+var _0x3485=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','put','update','delete','destroy','exports','multer'];(function(_0x3f0800,_0x5b61b3){var _0x287ea5=function(_0xf078e6){while(--_0xf078e6){_0x3f0800['push'](_0x3f0800['shift']());}};_0x287ea5(++_0x5b61b3);}(_0x3485,0x155));var _0x5348=function(_0xca19c4,_0x407602){_0xca19c4=_0xca19c4-0x0;var _0xd5c216=_0x3485[_0xca19c4];return _0xd5c216;};'use strict';var multer=require(_0x5348('0x0'));var util=require('util');var path=require(_0x5348('0x1'));var timeout=require(_0x5348('0x2'));var express=require('express');var router=express[_0x5348('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5348('0x4'));var interaction=require(_0x5348('0x5'));var config=require(_0x5348('0x6'));var controller=require(_0x5348('0x7'));router[_0x5348('0x8')]('/',auth[_0x5348('0x9')](),controller[_0x5348('0xa')]);router[_0x5348('0x8')](_0x5348('0xb'),auth[_0x5348('0x9')](),controller['show']);router[_0x5348('0x8')](_0x5348('0xc'),auth[_0x5348('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5348('0xd')](_0x5348('0xb'),auth[_0x5348('0x9')](),controller[_0x5348('0xe')]);router[_0x5348('0xf')](_0x5348('0xb'),auth['isAuthenticated'](),controller[_0x5348('0x10')]);module[_0x5348('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 28effe5..9ab1904 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 _0xd94e=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x50d46c,_0x17ea61){var _0x18d2eb=function(_0x2599b3){while(--_0x2599b3){_0x50d46c['push'](_0x50d46c['shift']());}};_0x18d2eb(++_0x17ea61);}(_0xd94e,0xc3));var _0xed94=function(_0x4c6058,_0x4b5868){_0x4c6058=_0x4c6058-0x0;var _0x8d1b4c=_0xd94e[_0x4c6058];return _0x8d1b4c;};'use strict';var Sequelize=require(_0xed94('0x0'));module[_0xed94('0x1')]={'field':{'type':Sequelize[_0xed94('0x2')]},'alias':{'type':Sequelize[_0xed94('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xed94('0x3')]},'groupBy':{'type':Sequelize[_0xed94('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xed94('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6fdd=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1c0630,_0x11f37a){var _0x1125a3=function(_0x26db31){while(--_0x26db31){_0x1c0630['push'](_0x1c0630['shift']());}};_0x1125a3(++_0x11f37a);}(_0x6fdd,0x189));var _0xd6fd=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x6fdd[_0x3a2e49];return _0x257140;};'use strict';var Sequelize=require(_0xd6fd('0x0'));module[_0xd6fd('0x1')]={'field':{'type':Sequelize[_0xd6fd('0x2')]},'alias':{'type':Sequelize[_0xd6fd('0x3')]},'function':{'type':Sequelize[_0xd6fd('0x3')]},'format':{'type':Sequelize[_0xd6fd('0x3')]},'groupBy':{'type':Sequelize[_0xd6fd('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd6fd('0x3')]},'custom':{'type':Sequelize[_0xd6fd('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index f97b2a1..b55cecf 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 _0xb9e4=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','create','bulkCreate','body','find','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x39758e,_0x1c4f9e){var _0x467281=function(_0x14ba8e){while(--_0x14ba8e){_0x39758e['push'](_0x39758e['shift']());}};_0x467281(++_0x1c4f9e);}(_0xb9e4,0x1a9));var _0x4b9e=function(_0x456392,_0x1b2b72){_0x456392=_0x456392-0x0;var _0x4a8c6b=_0xb9e4[_0x456392];return _0x4a8c6b;};'use strict';var emlformat=require(_0x4b9e('0x0'));var rimraf=require(_0x4b9e('0x1'));var zipdir=require(_0x4b9e('0x2'));var jsonpatch=require(_0x4b9e('0x3'));var rp=require(_0x4b9e('0x4'));var moment=require(_0x4b9e('0x5'));var BPromise=require(_0x4b9e('0x6'));var Mustache=require(_0x4b9e('0x7'));var util=require(_0x4b9e('0x8'));var path=require(_0x4b9e('0x9'));var sox=require(_0x4b9e('0xa'));var csv=require(_0x4b9e('0xb'));var ejs=require(_0x4b9e('0xc'));var fs=require('fs');var fs_extra=require(_0x4b9e('0xd'));var _=require(_0x4b9e('0xe'));var squel=require(_0x4b9e('0xf'));var crypto=require(_0x4b9e('0x10'));var jsforce=require(_0x4b9e('0x11'));var deskjs=require(_0x4b9e('0x12'));var toCsv=require('to-csv');var querystring=require(_0x4b9e('0x13'));var Papa=require(_0x4b9e('0x14'));var Redis=require(_0x4b9e('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x4b9e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b9e('0x17'));var logger=require(_0x4b9e('0x18'))(_0x4b9e('0x19'));var utils=require('../../config/utils');var config=require(_0x4b9e('0x1a'));var licenseUtil=require(_0x4b9e('0x1b'));var db=require(_0x4b9e('0x1c'))['db'];function respondWithStatusCode(_0x577e6f,_0x375559){_0x375559=_0x375559||0xcc;return function(_0x49f6c0){if(_0x49f6c0){return _0x577e6f[_0x4b9e('0x1d')](_0x375559);}return _0x577e6f[_0x4b9e('0x1e')](_0x375559)[_0x4b9e('0x1f')]();};}function respondWithResult(_0xd4346d,_0x1e5715){_0x1e5715=_0x1e5715||0xc8;return function(_0x36eacb){if(_0x36eacb){return _0xd4346d[_0x4b9e('0x1e')](_0x1e5715)[_0x4b9e('0x20')](_0x36eacb);}};}function respondWithFilteredResult(_0x5e1022,_0x508bc2){return function(_0x1a2300){if(_0x1a2300){var _0x321902=typeof _0x508bc2['offset']===_0x4b9e('0x21')&&typeof _0x508bc2[_0x4b9e('0x22')]===_0x4b9e('0x21');var _0x2be27f=_0x1a2300[_0x4b9e('0x23')];var _0x17172a=_0x321902?0x0:_0x508bc2['offset'];var _0x46fc88=_0x321902?_0x1a2300[_0x4b9e('0x23')]:_0x508bc2[_0x4b9e('0x24')]+_0x508bc2['limit'];var _0xa5a995;if(_0x46fc88>=_0x2be27f){_0x46fc88=_0x2be27f;_0xa5a995=0xc8;}else{_0xa5a995=0xce;}_0x5e1022['status'](_0xa5a995);return _0x5e1022[_0x4b9e('0x25')](_0x4b9e('0x26'),_0x17172a+'-'+_0x46fc88+'/'+_0x2be27f)[_0x4b9e('0x20')](_0x1a2300);}return null;};}function patchUpdates(_0x33abd1){return function(_0xeafdfa){try{jsonpatch['apply'](_0xeafdfa,_0x33abd1,!![]);}catch(_0x2d453a){return BPromise['reject'](_0x2d453a);}return _0xeafdfa['save']();};}function saveUpdates(_0x3d7a4f,_0x5926f2){return function(_0x199be3){if(_0x199be3){return _0x199be3[_0x4b9e('0x27')](_0x3d7a4f)[_0x4b9e('0x28')](function(_0x539ce0){return _0x539ce0;});}return null;};}function removeEntity(_0x6423ae,_0x3ea343){return function(_0x4aa7ff){if(_0x4aa7ff){return _0x4aa7ff[_0x4b9e('0x29')]()[_0x4b9e('0x28')](function(){_0x6423ae[_0x4b9e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f631d,_0x3eaa40){return function(_0x217a98){if(!_0x217a98){_0x2f631d[_0x4b9e('0x1d')](0x194);}return _0x217a98;};}function handleError(_0x57f7d3,_0x10e5b2){_0x10e5b2=_0x10e5b2||0x1f4;return function(_0x5029cd){logger[_0x4b9e('0x2a')](_0x5029cd[_0x4b9e('0x2b')]);if(_0x5029cd[_0x4b9e('0x2c')]){delete _0x5029cd['name'];}_0x57f7d3[_0x4b9e('0x1e')](_0x10e5b2)[_0x4b9e('0x2d')](_0x5029cd);};}exports[_0x4b9e('0x2e')]=function(_0xa2c0c8,_0x593b34){var _0x233c08={},_0x54ba7d={},_0x3a4126={'count':0x0,'rows':[]};var _0x261726=_[_0x4b9e('0x2f')](db[_0x4b9e('0x30')][_0x4b9e('0x31')],function(_0x428097){return{'name':_0x428097[_0x4b9e('0x32')],'type':_0x428097[_0x4b9e('0x33')][_0x4b9e('0x34')]};});_0x54ba7d['model']=_['map'](_0x261726,'name');_0x54ba7d[_0x4b9e('0x35')]=_[_0x4b9e('0x36')](_0xa2c0c8[_0x4b9e('0x35')]);_0x54ba7d['filters']=_['intersection'](_0x54ba7d[_0x4b9e('0x37')],_0x54ba7d[_0x4b9e('0x35')]);_0x233c08[_0x4b9e('0x38')]=_[_0x4b9e('0x39')](_0x54ba7d[_0x4b9e('0x37')],qs[_0x4b9e('0x3a')](_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x3a')]));_0x233c08[_0x4b9e('0x38')]=_0x233c08[_0x4b9e('0x38')][_0x4b9e('0x3b')]?_0x233c08['attributes']:_0x54ba7d[_0x4b9e('0x37')];if(!_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x3c')](_0x4b9e('0x3d'))){_0x233c08['limit']=qs['limit'](_0xa2c0c8['query'][_0x4b9e('0x22')]);_0x233c08[_0x4b9e('0x24')]=qs[_0x4b9e('0x24')](_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x24')]);}_0x233c08[_0x4b9e('0x3e')]=qs[_0x4b9e('0x3f')](_0xa2c0c8['query']['sort']);_0x233c08['where']=qs['filters'](_[_0x4b9e('0x40')](_0xa2c0c8[_0x4b9e('0x35')],_0x54ba7d[_0x4b9e('0x41')]),_0x261726);if(_0xa2c0c8['query'][_0x4b9e('0x42')]){_0x233c08[_0x4b9e('0x43')]=_[_0x4b9e('0x44')](_0x233c08['where'],{'$or':_['map'](_0x261726,function(_0x388080){if(_0x388080[_0x4b9e('0x33')]!==_0x4b9e('0x45')){var _0x2f3b20={};_0x2f3b20[_0x388080[_0x4b9e('0x2c')]]={'$like':'%'+_0xa2c0c8['query'][_0x4b9e('0x42')]+'%'};return _0x2f3b20;}})});}_0x233c08=_[_0x4b9e('0x44')]({},_0x233c08,_0xa2c0c8[_0x4b9e('0x46')]);var _0x3c176e={'where':_0x233c08[_0x4b9e('0x43')]};return db[_0x4b9e('0x30')][_0x4b9e('0x23')](_0x3c176e)['then'](function(_0x35f3e2){_0x3a4126[_0x4b9e('0x23')]=_0x35f3e2;if(_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x47')]){_0x233c08[_0x4b9e('0x48')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x233c08);})[_0x4b9e('0x28')](function(_0x286798){_0x3a4126['rows']=_0x286798;return _0x3a4126;})['then'](respondWithFilteredResult(_0x593b34,_0x233c08))[_0x4b9e('0x49')](handleError(_0x593b34,null));};exports['show']=function(_0x335ebf,_0x349940){var _0x52cddf={'raw':![],'where':{'id':_0x335ebf[_0x4b9e('0x4a')]['id']}},_0x4ed67e={};_0x4ed67e['model']=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x4ed67e[_0x4b9e('0x35')]=_[_0x4b9e('0x36')](_0x335ebf[_0x4b9e('0x35')]);_0x4ed67e['filters']=_[_0x4b9e('0x39')](_0x4ed67e['model'],_0x4ed67e[_0x4b9e('0x35')]);_0x52cddf[_0x4b9e('0x38')]=_[_0x4b9e('0x39')](_0x4ed67e['model'],qs['fields'](_0x335ebf[_0x4b9e('0x35')][_0x4b9e('0x3a')]));_0x52cddf[_0x4b9e('0x38')]=_0x52cddf[_0x4b9e('0x38')][_0x4b9e('0x3b')]?_0x52cddf[_0x4b9e('0x38')]:_0x4ed67e[_0x4b9e('0x37')];if(_0x335ebf[_0x4b9e('0x35')][_0x4b9e('0x47')]){_0x52cddf[_0x4b9e('0x48')]=[{'all':!![]}];}_0x52cddf=_[_0x4b9e('0x44')]({},_0x52cddf,_0x335ebf[_0x4b9e('0x46')]);return db[_0x4b9e('0x30')]['find'](_0x52cddf)[_0x4b9e('0x28')](handleEntityNotFound(_0x349940,null))['then'](respondWithResult(_0x349940,null))[_0x4b9e('0x49')](handleError(_0x349940,null));};exports[_0x4b9e('0x4b')]=function(_0x342614,_0x1104bd){return db[_0x4b9e('0x30')]['create'](_0x342614['body'],{})['then'](respondWithResult(_0x1104bd,0xc9))['catch'](handleError(_0x1104bd,null));};exports[_0x4b9e('0x4c')]=function(_0x47e87e,_0x295848){return db['AnalyticFieldReport'][_0x4b9e('0x4c')](_0x47e87e[_0x4b9e('0x4d')],{'raw':![],'individualHooks':!![]})[_0x4b9e('0x28')](respondWithResult(_0x295848,0xc9))[_0x4b9e('0x49')](handleError(_0x295848,null));};exports[_0x4b9e('0x27')]=function(_0x3528dd,_0x45b285){if(_0x3528dd[_0x4b9e('0x4d')]['id']){delete _0x3528dd['body']['id'];}return db[_0x4b9e('0x30')]['find']({'where':{'id':_0x3528dd[_0x4b9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45b285,null))[_0x4b9e('0x28')](saveUpdates(_0x3528dd[_0x4b9e('0x4d')],null))['then'](respondWithResult(_0x45b285,null))[_0x4b9e('0x49')](handleError(_0x45b285,null));};exports['destroy']=function(_0x25ec27,_0x112add){return db[_0x4b9e('0x30')][_0x4b9e('0x4e')]({'where':{'id':_0x25ec27['params']['id']}})[_0x4b9e('0x28')](handleEntityNotFound(_0x112add,null))[_0x4b9e('0x28')](removeEntity(_0x112add,null))[_0x4b9e('0x49')](handleError(_0x112add,null));};exports[_0x4b9e('0x4f')]=function(_0x4e3c68,_0x3eb8c5){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4e3c68[_0x4b9e('0x35')][_0x4b9e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x4b9e('0x28')](respondWithResult(_0x3eb8c5,0xcc))[_0x4b9e('0x49')](handleError(_0x3eb8c5,null));};exports[_0x4b9e('0x51')]=function(_0x24698b,_0x47b292,_0x396bd6){return db['AnalyticCustomReport'][_0x4b9e('0x52')]({'where':{'id':_0x24698b['params']['id']}})[_0x4b9e('0x28')](handleEntityNotFound(_0x47b292,null))[_0x4b9e('0x28')](function(_0x166932){if(_0x166932){return db[_0x4b9e('0x53')][_0x4b9e('0x54')](function(_0x17c3d7){return db['AnalyticFieldReport'][_0x4b9e('0x29')]({'where':{'CustomReportId':_0x24698b['params']['id']},'transaction':_0x17c3d7})[_0x4b9e('0x28')](function(_0x4147f1){var _0x55aa10=_[_0x4b9e('0x2f')](_0x24698b['body'],function(_0x358ecd){delete _0x358ecd['id'];_0x358ecd[_0x4b9e('0x55')]=_0x24698b[_0x4b9e('0x4a')]['id'];return _0x358ecd;});return db[_0x4b9e('0x30')][_0x4b9e('0x4c')](_0x55aa10,{'transaction':_0x17c3d7});});})[_0x4b9e('0x28')](function(){return db[_0x4b9e('0x30')][_0x4b9e('0x56')]({'where':{'CustomReportId':_0x24698b['params']['id']}});});}})[_0x4b9e('0x28')](respondWithResult(_0x47b292,null))['catch'](handleError(_0x47b292,null));};
\ No newline at end of file
+var _0xf596=['rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','AnalyticFieldReport'];(function(_0x1fad12,_0x1764ea){var _0x6ef56b=function(_0xd684e8){while(--_0xd684e8){_0x1fad12['push'](_0x1fad12['shift']());}};_0x6ef56b(++_0x1764ea);}(_0xf596,0xd3));var _0x6f59=function(_0x3c866e,_0x39ad83){_0x3c866e=_0x3c866e-0x0;var _0x4e0c60=_0xf596[_0x3c866e];return _0x4e0c60;};'use strict';var emlformat=require(_0x6f59('0x0'));var rimraf=require(_0x6f59('0x1'));var zipdir=require(_0x6f59('0x2'));var jsonpatch=require(_0x6f59('0x3'));var rp=require(_0x6f59('0x4'));var moment=require(_0x6f59('0x5'));var BPromise=require(_0x6f59('0x6'));var Mustache=require(_0x6f59('0x7'));var util=require(_0x6f59('0x8'));var path=require(_0x6f59('0x9'));var sox=require(_0x6f59('0xa'));var csv=require(_0x6f59('0xb'));var ejs=require(_0x6f59('0xc'));var fs=require('fs');var fs_extra=require(_0x6f59('0xd'));var _=require(_0x6f59('0xe'));var squel=require('squel');var crypto=require(_0x6f59('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6f59('0x10'));var toCsv=require(_0x6f59('0xb'));var querystring=require(_0x6f59('0x11'));var Papa=require(_0x6f59('0x12'));var Redis=require('ioredis');var authService=require(_0x6f59('0x13'));var qs=require(_0x6f59('0x14'));var as=require(_0x6f59('0x15'));var hardwareService=require(_0x6f59('0x16'));var logger=require(_0x6f59('0x17'))(_0x6f59('0x18'));var utils=require(_0x6f59('0x19'));var config=require(_0x6f59('0x1a'));var licenseUtil=require(_0x6f59('0x1b'));var db=require(_0x6f59('0x1c'))['db'];function respondWithStatusCode(_0x103acd,_0x54da27){_0x54da27=_0x54da27||0xcc;return function(_0x5861a1){if(_0x5861a1){return _0x103acd[_0x6f59('0x1d')](_0x54da27);}return _0x103acd['status'](_0x54da27)[_0x6f59('0x1e')]();};}function respondWithResult(_0x678993,_0x32c385){_0x32c385=_0x32c385||0xc8;return function(_0x18e7b6){if(_0x18e7b6){return _0x678993[_0x6f59('0x1f')](_0x32c385)[_0x6f59('0x20')](_0x18e7b6);}};}function respondWithFilteredResult(_0x25f611,_0x541ae3){return function(_0x4337dc){if(_0x4337dc){var _0x3161a0=typeof _0x541ae3[_0x6f59('0x21')]==='undefined'&&typeof _0x541ae3[_0x6f59('0x22')]===_0x6f59('0x23');var _0x3801e0=_0x4337dc[_0x6f59('0x24')];var _0x5c5da4=_0x3161a0?0x0:_0x541ae3[_0x6f59('0x21')];var _0x32c3ec=_0x3161a0?_0x4337dc['count']:_0x541ae3[_0x6f59('0x21')]+_0x541ae3[_0x6f59('0x22')];var _0x1ce4c6;if(_0x32c3ec>=_0x3801e0){_0x32c3ec=_0x3801e0;_0x1ce4c6=0xc8;}else{_0x1ce4c6=0xce;}_0x25f611[_0x6f59('0x1f')](_0x1ce4c6);return _0x25f611[_0x6f59('0x25')](_0x6f59('0x26'),_0x5c5da4+'-'+_0x32c3ec+'/'+_0x3801e0)[_0x6f59('0x20')](_0x4337dc);}return null;};}function patchUpdates(_0xe58eba){return function(_0x4aec45){try{jsonpatch[_0x6f59('0x27')](_0x4aec45,_0xe58eba,!![]);}catch(_0x255fbd){return BPromise[_0x6f59('0x28')](_0x255fbd);}return _0x4aec45[_0x6f59('0x29')]();};}function saveUpdates(_0x872ca3,_0x5dfc0d){return function(_0x579932){if(_0x579932){return _0x579932[_0x6f59('0x2a')](_0x872ca3)[_0x6f59('0x2b')](function(_0x25461a){return _0x25461a;});}return null;};}function removeEntity(_0x1b7213,_0x50d81e){return function(_0x55fd9f){if(_0x55fd9f){return _0x55fd9f[_0x6f59('0x2c')]()[_0x6f59('0x2b')](function(){_0x1b7213[_0x6f59('0x1f')](0xcc)[_0x6f59('0x1e')]();});}};}function handleEntityNotFound(_0x46acd1,_0x29f076){return function(_0x56bc60){if(!_0x56bc60){_0x46acd1[_0x6f59('0x1d')](0x194);}return _0x56bc60;};}function handleError(_0x1f6502,_0x902f2b){_0x902f2b=_0x902f2b||0x1f4;return function(_0x1a97ab){logger[_0x6f59('0x2d')](_0x1a97ab[_0x6f59('0x2e')]);if(_0x1a97ab[_0x6f59('0x2f')]){delete _0x1a97ab['name'];}_0x1f6502[_0x6f59('0x1f')](_0x902f2b)[_0x6f59('0x30')](_0x1a97ab);};}exports['index']=function(_0x2268b5,_0x8593eb){var _0x4bdb03={},_0x4733a7={},_0x517409={'count':0x0,'rows':[]};var _0x188a2f=_['map'](db[_0x6f59('0x31')][_0x6f59('0x32')],function(_0xb04b2d){return{'name':_0xb04b2d[_0x6f59('0x33')],'type':_0xb04b2d[_0x6f59('0x34')][_0x6f59('0x35')]};});_0x4733a7['model']=_[_0x6f59('0x36')](_0x188a2f,_0x6f59('0x2f'));_0x4733a7[_0x6f59('0x37')]=_[_0x6f59('0x38')](_0x2268b5[_0x6f59('0x37')]);_0x4733a7[_0x6f59('0x39')]=_['intersection'](_0x4733a7['model'],_0x4733a7[_0x6f59('0x37')]);_0x4bdb03[_0x6f59('0x3a')]=_[_0x6f59('0x3b')](_0x4733a7['model'],qs[_0x6f59('0x3c')](_0x2268b5['query']['fields']));_0x4bdb03[_0x6f59('0x3a')]=_0x4bdb03['attributes']['length']?_0x4bdb03[_0x6f59('0x3a')]:_0x4733a7[_0x6f59('0x3d')];if(!_0x2268b5[_0x6f59('0x37')][_0x6f59('0x3e')](_0x6f59('0x3f'))){_0x4bdb03['limit']=qs[_0x6f59('0x22')](_0x2268b5[_0x6f59('0x37')]['limit']);_0x4bdb03[_0x6f59('0x21')]=qs[_0x6f59('0x21')](_0x2268b5['query'][_0x6f59('0x21')]);}_0x4bdb03[_0x6f59('0x40')]=qs[_0x6f59('0x41')](_0x2268b5[_0x6f59('0x37')][_0x6f59('0x41')]);_0x4bdb03[_0x6f59('0x42')]=qs[_0x6f59('0x39')](_[_0x6f59('0x43')](_0x2268b5[_0x6f59('0x37')],_0x4733a7[_0x6f59('0x39')]),_0x188a2f);if(_0x2268b5['query'][_0x6f59('0x44')]){_0x4bdb03[_0x6f59('0x42')]=_[_0x6f59('0x45')](_0x4bdb03['where'],{'$or':_['map'](_0x188a2f,function(_0x2a90f7){if(_0x2a90f7[_0x6f59('0x34')]!=='VIRTUAL'){var _0x3c5cdc={};_0x3c5cdc[_0x2a90f7['name']]={'$like':'%'+_0x2268b5[_0x6f59('0x37')]['filter']+'%'};return _0x3c5cdc;}})});}_0x4bdb03=_[_0x6f59('0x45')]({},_0x4bdb03,_0x2268b5[_0x6f59('0x46')]);var _0x311592={'where':_0x4bdb03[_0x6f59('0x42')]};return db[_0x6f59('0x31')][_0x6f59('0x24')](_0x311592)['then'](function(_0x4666a9){_0x517409[_0x6f59('0x24')]=_0x4666a9;if(_0x2268b5['query'][_0x6f59('0x47')]){_0x4bdb03[_0x6f59('0x48')]=[{'all':!![]}];}return db[_0x6f59('0x31')][_0x6f59('0x49')](_0x4bdb03);})[_0x6f59('0x2b')](function(_0x4c8d65){_0x517409['rows']=_0x4c8d65;return _0x517409;})[_0x6f59('0x2b')](respondWithFilteredResult(_0x8593eb,_0x4bdb03))[_0x6f59('0x4a')](handleError(_0x8593eb,null));};exports[_0x6f59('0x4b')]=function(_0x3c7bc4,_0x127c73){var _0x24d67f={'raw':![],'where':{'id':_0x3c7bc4[_0x6f59('0x4c')]['id']}},_0x20ec19={};_0x20ec19[_0x6f59('0x3d')]=_[_0x6f59('0x38')](db[_0x6f59('0x31')][_0x6f59('0x32')]);_0x20ec19[_0x6f59('0x37')]=_[_0x6f59('0x38')](_0x3c7bc4['query']);_0x20ec19[_0x6f59('0x39')]=_[_0x6f59('0x3b')](_0x20ec19['model'],_0x20ec19[_0x6f59('0x37')]);_0x24d67f[_0x6f59('0x3a')]=_['intersection'](_0x20ec19[_0x6f59('0x3d')],qs[_0x6f59('0x3c')](_0x3c7bc4[_0x6f59('0x37')][_0x6f59('0x3c')]));_0x24d67f[_0x6f59('0x3a')]=_0x24d67f['attributes']['length']?_0x24d67f['attributes']:_0x20ec19[_0x6f59('0x3d')];if(_0x3c7bc4[_0x6f59('0x37')]['includeAll']){_0x24d67f[_0x6f59('0x48')]=[{'all':!![]}];}_0x24d67f=_[_0x6f59('0x45')]({},_0x24d67f,_0x3c7bc4[_0x6f59('0x46')]);return db[_0x6f59('0x31')][_0x6f59('0x4d')](_0x24d67f)[_0x6f59('0x2b')](handleEntityNotFound(_0x127c73,null))[_0x6f59('0x2b')](respondWithResult(_0x127c73,null))[_0x6f59('0x4a')](handleError(_0x127c73,null));};exports[_0x6f59('0x4e')]=function(_0xedcc15,_0x4732e6){return db[_0x6f59('0x31')][_0x6f59('0x4e')](_0xedcc15[_0x6f59('0x4f')],{})[_0x6f59('0x2b')](respondWithResult(_0x4732e6,0xc9))['catch'](handleError(_0x4732e6,null));};exports[_0x6f59('0x50')]=function(_0x3210e1,_0x2ee324){return db[_0x6f59('0x31')][_0x6f59('0x50')](_0x3210e1[_0x6f59('0x4f')],{'raw':![],'individualHooks':!![]})[_0x6f59('0x2b')](respondWithResult(_0x2ee324,0xc9))[_0x6f59('0x4a')](handleError(_0x2ee324,null));};exports[_0x6f59('0x2a')]=function(_0x22e53d,_0x2e22fc){if(_0x22e53d['body']['id']){delete _0x22e53d[_0x6f59('0x4f')]['id'];}return db[_0x6f59('0x31')]['find']({'where':{'id':_0x22e53d[_0x6f59('0x4c')]['id']}})[_0x6f59('0x2b')](handleEntityNotFound(_0x2e22fc,null))[_0x6f59('0x2b')](saveUpdates(_0x22e53d[_0x6f59('0x4f')],null))['then'](respondWithResult(_0x2e22fc,null))[_0x6f59('0x4a')](handleError(_0x2e22fc,null));};exports[_0x6f59('0x2c')]=function(_0x2a4021,_0x3b01ae){return db[_0x6f59('0x31')][_0x6f59('0x4d')]({'where':{'id':_0x2a4021['params']['id']}})['then'](handleEntityNotFound(_0x3b01ae,null))[_0x6f59('0x2b')](removeEntity(_0x3b01ae,null))[_0x6f59('0x4a')](handleError(_0x3b01ae,null));};exports[_0x6f59('0x51')]=function(_0x18ff5f,_0xfb061d){return db[_0x6f59('0x31')][_0x6f59('0x2c')]({'where':{'id':_0x18ff5f['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xfb061d,0xcc))[_0x6f59('0x4a')](handleError(_0xfb061d,null));};exports[_0x6f59('0x52')]=function(_0x520244,_0x368596,_0x34b32f){return db[_0x6f59('0x53')]['findOne']({'where':{'id':_0x520244[_0x6f59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x368596,null))[_0x6f59('0x2b')](function(_0xdba50){if(_0xdba50){return db[_0x6f59('0x54')][_0x6f59('0x55')](function(_0x524ac7){return db[_0x6f59('0x31')][_0x6f59('0x2c')]({'where':{'CustomReportId':_0x520244[_0x6f59('0x4c')]['id']},'transaction':_0x524ac7})[_0x6f59('0x2b')](function(_0x1bb3dd){var _0xcec0c1=_[_0x6f59('0x36')](_0x520244['body'],function(_0x29f7f1){delete _0x29f7f1['id'];_0x29f7f1[_0x6f59('0x56')]=_0x520244[_0x6f59('0x4c')]['id'];return _0x29f7f1;});return db['AnalyticFieldReport'][_0x6f59('0x50')](_0xcec0c1,{'transaction':_0x524ac7});});})[_0x6f59('0x2b')](function(){return db[_0x6f59('0x31')][_0x6f59('0x49')]({'where':{'CustomReportId':_0x520244[_0x6f59('0x4c')]['id']}});});}})['then'](respondWithResult(_0x368596,null))['catch'](handleError(_0x368596,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e1da2ad..8781cef 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 _0x0a07=['api','bluebird','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x0a07,0x7b));var _0x70a0=function(_0x4c3184,_0x52ea70){_0x4c3184=_0x4c3184-0x0;var _0x2ff62b=_0x0a07[_0x4c3184];return _0x2ff62b;};'use strict';var _=require(_0x70a0('0x0'));var util=require(_0x70a0('0x1'));var logger=require(_0x70a0('0x2'))(_0x70a0('0x3'));var moment=require('moment');var BPromise=require(_0x70a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x70a0('0x5'));var attributes=require(_0x70a0('0x6'));module['exports']=function(_0x3d06d3,_0x50fa55){return _0x3d06d3[_0x70a0('0x7')](_0x70a0('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x143d=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util'];(function(_0x2517ef,_0x2769da){var _0x452311=function(_0xafc35d){while(--_0xafc35d){_0x2517ef['push'](_0x2517ef['shift']());}};_0x452311(++_0x2769da);}(_0x143d,0xfc));var _0xd143=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x143d[_0x810025];return _0x4dbc81;};'use strict';var _=require('lodash');var util=require(_0xd143('0x0'));var logger=require(_0xd143('0x1'))(_0xd143('0x2'));var moment=require(_0xd143('0x3'));var BPromise=require('bluebird');var rp=require(_0xd143('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd143('0x5'));var config=require(_0xd143('0x6'));var attributes=require(_0xd143('0x7'));module[_0xd143('0x8')]=function(_0x5f2549,_0xb4a74c){return _0x5f2549['define'](_0xd143('0x9'),attributes,{'tableName':_0xd143('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 8782aa7..6e1bf77 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 _0xe319=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x1e5a0c,_0x3a16fc){var _0x5cc15b=function(_0x39e08f){while(--_0x39e08f){_0x1e5a0c['push'](_0x1e5a0c['shift']());}};_0x5cc15b(++_0x3a16fc);}(_0xe319,0xac));var _0x9e31=function(_0x3f5002,_0x51cd58){_0x3f5002=_0x3f5002-0x0;var _0x357b9e=_0xe319[_0x3f5002];return _0x357b9e;};'use strict';var _=require(_0x9e31('0x0'));var util=require('util');var moment=require(_0x9e31('0x1'));var BPromise=require(_0x9e31('0x2'));var rs=require(_0x9e31('0x3'));var fs=require('fs');var Redis=require(_0x9e31('0x4'));var db=require(_0x9e31('0x5'))['db'];var utils=require(_0x9e31('0x6'));var logger=require(_0x9e31('0x7'))('rpc');var config=require(_0x9e31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e31('0x9')][_0x9e31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2965ee,_0x3ba86a,_0x5ebbe1){return new BPromise(function(_0x500d47,_0x54a522){return client['request'](_0x2965ee,_0x5ebbe1)[_0x9e31('0xb')](function(_0x1177df){logger[_0x9e31('0xc')](_0x9e31('0xd'),_0x3ba86a,_0x9e31('0xe'));logger[_0x9e31('0xf')](_0x9e31('0x10'),_0x3ba86a,_0x9e31('0xe'),JSON[_0x9e31('0x11')](_0x1177df));if(_0x1177df[_0x9e31('0x12')]){if(_0x1177df[_0x9e31('0x12')][_0x9e31('0x13')]===0x1f4){logger[_0x9e31('0x12')](_0x9e31('0xd'),_0x3ba86a,_0x1177df[_0x9e31('0x12')]['message']);return _0x54a522(_0x1177df['error'][_0x9e31('0x14')]);}logger[_0x9e31('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ba86a,_0x1177df[_0x9e31('0x12')][_0x9e31('0x14')]);return _0x500d47(_0x1177df[_0x9e31('0x12')][_0x9e31('0x14')]);}else{logger[_0x9e31('0xc')](_0x9e31('0xd'),_0x3ba86a,_0x9e31('0xe'));_0x500d47(_0x1177df[_0x9e31('0x15')]['message']);}})[_0x9e31('0x16')](function(_0x4bcf6e){logger['error'](_0x9e31('0xd'),_0x3ba86a,_0x4bcf6e);_0x54a522(_0x4bcf6e);});});}
\ No newline at end of file
+var _0x18c7=['client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x18c7,0x64));var _0x718c=function(_0x14d993,_0x26e5dc){_0x14d993=_0x14d993-0x0;var _0x66af08=_0x18c7[_0x14d993];return _0x66af08;};'use strict';var _=require(_0x718c('0x0'));var util=require(_0x718c('0x1'));var moment=require('moment');var BPromise=require(_0x718c('0x2'));var rs=require(_0x718c('0x3'));var fs=require('fs');var Redis=require(_0x718c('0x4'));var db=require(_0x718c('0x5'))['db'];var utils=require(_0x718c('0x6'));var logger=require(_0x718c('0x7'))(_0x718c('0x8'));var config=require(_0x718c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x718c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d71d,_0x5a5049,_0xa7553b){return new BPromise(function(_0x1ce2e1,_0x1089ef){return client['request'](_0x48d71d,_0xa7553b)[_0x718c('0xb')](function(_0x13d48a){logger[_0x718c('0xc')](_0x718c('0xd'),_0x5a5049,_0x718c('0xe'));logger['debug'](_0x718c('0xf'),_0x5a5049,_0x718c('0xe'),JSON[_0x718c('0x10')](_0x13d48a));if(_0x13d48a['error']){if(_0x13d48a['error'][_0x718c('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5a5049,_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);return _0x1089ef(_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);}logger[_0x718c('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a5049,_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);return _0x1ce2e1(_0x13d48a[_0x718c('0x12')][_0x718c('0x13')]);}else{logger[_0x718c('0xc')](_0x718c('0xd'),_0x5a5049,_0x718c('0xe'));_0x1ce2e1(_0x13d48a[_0x718c('0x14')][_0x718c('0x13')]);}})[_0x718c('0x15')](function(_0xfd5408){logger[_0x718c('0x12')](_0x718c('0xd'),_0x5a5049,_0xfd5408);_0x1089ef(_0xfd5408);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0da01b0..c4654aa 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(_0x1450b6,_0xa089aa){var _0x29d3a8=function(_0x18a928){while(--_0x18a928){_0x1450b6['push'](_0x1450b6['shift']());}};_0x29d3a8(++_0xa089aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x2d08d2,_0x1d5c45){var _0x4f2b0c=function(_0x339c9d){while(--_0x339c9d){_0x2d08d2['push'](_0x2d08d2['shift']());}};_0x4f2b0c(++_0x1d5c45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 ae0f096..cc6601e 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 _0x6c63=['exports','STRING','name','TEXT','sequelize'];(function(_0x4c78c6,_0x3d6889){var _0x5431b8=function(_0x192846){while(--_0x192846){_0x4c78c6['push'](_0x4c78c6['shift']());}};_0x5431b8(++_0x3d6889);}(_0x6c63,0x1ee));var _0x36c6=function(_0x5bf329,_0x5379ae){_0x5bf329=_0x5bf329-0x0;var _0x1b7005=_0x6c63[_0x5bf329];return _0x1b7005;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'name':{'type':Sequelize[_0x36c6('0x2')],'allowNull':![],'unique':_0x36c6('0x3')},'table':{'type':Sequelize[_0x36c6('0x2')]},'metric':{'type':Sequelize[_0x36c6('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2f8b=['sequelize','exports','name','STRING','TEXT'];(function(_0x486224,_0x519bad){var _0x303931=function(_0x5f3246){while(--_0x5f3246){_0x486224['push'](_0x486224['shift']());}};_0x303931(++_0x519bad);}(_0x2f8b,0x96));var _0xb2f8=function(_0x1eecf6,_0x28ebba){_0x1eecf6=_0x1eecf6-0x0;var _0x84c3d8=_0x2f8b[_0x1eecf6];return _0x84c3d8;};'use strict';var Sequelize=require(_0xb2f8('0x0'));module[_0xb2f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb2f8('0x2')},'table':{'type':Sequelize[_0xb2f8('0x3')]},'metric':{'type':Sequelize[_0xb2f8('0x4')]},'description':{'type':Sequelize[_0xb2f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 3f3ca3b..f921a9b 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x4deac3,_0x49a143){var _0x190902=function(_0x55a521){while(--_0x55a521){_0x4deac3['push'](_0x4deac3['shift']());}};_0x190902(++_0x49a143);}(_0x9a19,0x114));var _0x99a1=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9a19[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x1235a8,_0x2db48e){var _0x41a2cf=function(_0x2c30df){while(--_0x2c30df){_0x1235a8['push'](_0x1235a8['shift']());}};_0x41a2cf(++_0x2db48e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4a29d7,_0x19eaee){_0x4a29d7=_0x4a29d7-0x0;var _0x1bec46=_0x9c5a[_0x4a29d7];return _0x1bec46;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5275479..189ff84 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 _0x13c5=['exports','analytics_metrics','lodash','path','./analyticMetric.attributes'];(function(_0x8b06f7,_0x2afcff){var _0x30d20a=function(_0x2388ed){while(--_0x2388ed){_0x8b06f7['push'](_0x8b06f7['shift']());}};_0x30d20a(++_0x2afcff);}(_0x13c5,0x7a));var _0x513c=function(_0x3e5eda,_0x156d80){_0x3e5eda=_0x3e5eda-0x0;var _0x482d3f=_0x13c5[_0x3e5eda];return _0x482d3f;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x513c('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x513c('0x2'));module[_0x513c('0x3')]=function(_0x982017,_0x2ad2db){return _0x982017['define']('AnalyticMetric',attributes,{'tableName':_0x513c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x539d=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x233e6f,_0x4019ac){var _0x1deeb0=function(_0x43f942){while(--_0x43f942){_0x233e6f['push'](_0x233e6f['shift']());}};_0x1deeb0(++_0x4019ac);}(_0x539d,0x17b));var _0xd539=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x539d[_0x212579];return _0x55d50e;};'use strict';var _=require(_0xd539('0x0'));var util=require('util');var logger=require(_0xd539('0x1'))(_0xd539('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd539('0x3'));var fs=require('fs');var path=require(_0xd539('0x4'));var rimraf=require(_0xd539('0x5'));var config=require(_0xd539('0x6'));var attributes=require(_0xd539('0x7'));module['exports']=function(_0x341dd4,_0x158719){return _0x341dd4[_0xd539('0x8')](_0xd539('0x9'),attributes,{'tableName':_0xd539('0xa'),'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 17c7482..8655e02 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 _0x7295=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s'];(function(_0x410464,_0x31b526){var _0x2dbece=function(_0x5966c6){while(--_0x5966c6){_0x410464['push'](_0x410464['shift']());}};_0x2dbece(++_0x31b526);}(_0x7295,0x10b));var _0x5729=function(_0x47cc41,_0x11e552){_0x47cc41=_0x47cc41-0x0;var _0x580c72=_0x7295[_0x47cc41];return _0x580c72;};'use strict';var _=require(_0x5729('0x0'));var util=require(_0x5729('0x1'));var moment=require(_0x5729('0x2'));var BPromise=require(_0x5729('0x3'));var rs=require(_0x5729('0x4'));var fs=require('fs');var Redis=require(_0x5729('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5729('0x6'));var logger=require(_0x5729('0x7'))('rpc');var config=require(_0x5729('0x8'));var jayson=require(_0x5729('0x9'));var client=jayson['client'][_0x5729('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x321f77,_0x55f6cd,_0xa8dd21){return new BPromise(function(_0x58d51e,_0x27fa78){return client['request'](_0x321f77,_0xa8dd21)['then'](function(_0x423f17){logger[_0x5729('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x5729('0xc'));logger[_0x5729('0xd')](_0x5729('0xe'),_0x55f6cd,_0x5729('0xc'),JSON[_0x5729('0xf')](_0x423f17));if(_0x423f17[_0x5729('0x10')]){if(_0x423f17['error']['code']===0x1f4){logger['error'](_0x5729('0x11'),_0x55f6cd,_0x423f17[_0x5729('0x10')]['message']);return _0x27fa78(_0x423f17['error'][_0x5729('0x12')]);}logger[_0x5729('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x423f17[_0x5729('0x10')][_0x5729('0x12')]);return _0x58d51e(_0x423f17[_0x5729('0x10')][_0x5729('0x12')]);}else{logger[_0x5729('0xb')](_0x5729('0x11'),_0x55f6cd,_0x5729('0xc'));_0x58d51e(_0x423f17['result'][_0x5729('0x12')]);}})['catch'](function(_0x5cc425){logger[_0x5729('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x5cc425);_0x27fa78(_0x5cc425);});});}
\ No newline at end of file
+var _0xbdc2=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d7f9d,_0x529ab8){var _0x396d51=function(_0x1b9fed){while(--_0x1b9fed){_0x1d7f9d['push'](_0x1d7f9d['shift']());}};_0x396d51(++_0x529ab8);}(_0xbdc2,0xac));var _0x2bdc=function(_0x1b6057,_0x43ac7e){_0x1b6057=_0x1b6057-0x0;var _0x19ed50=_0xbdc2[_0x1b6057];return _0x19ed50;};'use strict';var _=require('lodash');var util=require(_0x2bdc('0x0'));var moment=require(_0x2bdc('0x1'));var BPromise=require(_0x2bdc('0x2'));var rs=require(_0x2bdc('0x3'));var fs=require('fs');var Redis=require(_0x2bdc('0x4'));var db=require(_0x2bdc('0x5'))['db'];var utils=require(_0x2bdc('0x6'));var logger=require(_0x2bdc('0x7'))(_0x2bdc('0x8'));var config=require(_0x2bdc('0x9'));var jayson=require(_0x2bdc('0xa'));var client=jayson[_0x2bdc('0xb')][_0x2bdc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21b5d2,_0x56f25d,_0x2f4a88){return new BPromise(function(_0x5053f7,_0x3e09f6){return client['request'](_0x21b5d2,_0x2f4a88)[_0x2bdc('0xd')](function(_0x484ecf){logger[_0x2bdc('0xe')](_0x2bdc('0xf'),_0x56f25d,_0x2bdc('0x10'));logger[_0x2bdc('0x11')](_0x2bdc('0x12'),_0x56f25d,_0x2bdc('0x10'),JSON[_0x2bdc('0x13')](_0x484ecf));if(_0x484ecf[_0x2bdc('0x14')]){if(_0x484ecf[_0x2bdc('0x14')]['code']===0x1f4){logger[_0x2bdc('0x14')](_0x2bdc('0xf'),_0x56f25d,_0x484ecf[_0x2bdc('0x14')][_0x2bdc('0x15')]);return _0x3e09f6(_0x484ecf['error'][_0x2bdc('0x15')]);}logger['error'](_0x2bdc('0xf'),_0x56f25d,_0x484ecf[_0x2bdc('0x14')][_0x2bdc('0x15')]);return _0x5053f7(_0x484ecf[_0x2bdc('0x14')]['message']);}else{logger[_0x2bdc('0xe')](_0x2bdc('0xf'),_0x56f25d,'request\x20sent');_0x5053f7(_0x484ecf[_0x2bdc('0x16')]['message']);}})['catch'](function(_0x432db0){logger[_0x2bdc('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x56f25d,_0x432db0);_0x3e09f6(_0x432db0);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8350541..e0e3b4e 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 _0x56da=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb16083,_0xa1e4c5){var _0x5b1a52=function(_0x36b703){while(--_0x36b703){_0xb16083['push'](_0xb16083['shift']());}};_0x5b1a52(++_0xa1e4c5);}(_0x56da,0x119));var _0xa56d=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x56da[_0x18daeb];return _0x425a30;};'use strict';var multer=require(_0xa56d('0x0'));var util=require('util');var path=require(_0xa56d('0x1'));var timeout=require(_0xa56d('0x2'));var express=require('express');var router=express[_0xa56d('0x3')]();var fs_extra=require(_0xa56d('0x4'));var auth=require(_0xa56d('0x5'));var interaction=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var controller=require(_0xa56d('0x8'));router[_0xa56d('0x9')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xb')]);router[_0xa56d('0x9')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa56d('0xd')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa56d('0x10')](_0xa56d('0xc'),auth[_0xa56d('0xa')](),controller['destroy']);module[_0xa56d('0x11')]=router;
\ No newline at end of file
+var _0xd8fb=['get','index','/:id','show','post','put','isAuthenticated','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x173aca,_0x4cfe9f){var _0x5dbf81=function(_0x10c012){while(--_0x10c012){_0x173aca['push'](_0x173aca['shift']());}};_0x5dbf81(++_0x4cfe9f);}(_0xd8fb,0x99));var _0xbd8f=function(_0x55452f,_0x534f02){_0x55452f=_0x55452f-0x0;var _0xc7354d=_0xd8fb[_0x55452f];return _0xc7354d;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd8f('0xc')](_0xbd8f('0x9'),auth[_0xbd8f('0xd')](),controller['update']);router[_0xbd8f('0xe')](_0xbd8f('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xbd8f('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f8b47ae..2027767 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 _0xe62b=['sequelize','TEXT'];(function(_0xbb17d0,_0x597619){var _0x5238b0=function(_0x55f29c){while(--_0x55f29c){_0xbb17d0['push'](_0xbb17d0['shift']());}};_0x5238b0(++_0x597619);}(_0xe62b,0x180));var _0xbe62=function(_0x528b92,_0x2a3971){_0x528b92=_0x528b92-0x0;var _0x171eba=_0xe62b[_0x528b92];return _0x171eba;};'use strict';var Sequelize=require(_0xbe62('0x0'));module['exports']={'tree':{'type':Sequelize[_0xbe62('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x2499=['sequelize','exports','TEXT'];(function(_0x3677fc,_0x187168){var _0x183fc3=function(_0x3d51c0){while(--_0x3d51c0){_0x3677fc['push'](_0x3677fc['shift']());}};_0x183fc3(++_0x187168);}(_0x2499,0x108));var _0x9249=function(_0x5dad14,_0x49ee81){_0x5dad14=_0x5dad14-0x0;var _0x5379da=_0x2499[_0x5dad14];return _0x5379da;};'use strict';var Sequelize=require(_0x9249('0x0'));module[_0x9249('0x1')]={'tree':{'type':Sequelize[_0x9249('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 0e1ff5d..9cc7916 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 _0xf298=['status','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','includeAll','include','AnalyticTreeReport','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xfa0d6,_0x2feed0){var _0x543b26=function(_0x410d31){while(--_0x410d31){_0xfa0d6['push'](_0xfa0d6['shift']());}};_0x543b26(++_0x2feed0);}(_0xf298,0xf6));var _0x8f29=function(_0x42bdaf,_0x510fb2){_0x42bdaf=_0x42bdaf-0x0;var _0x96cc6b=_0xf298[_0x42bdaf];return _0x96cc6b;};'use strict';var emlformat=require(_0x8f29('0x0'));var rimraf=require(_0x8f29('0x1'));var zipdir=require(_0x8f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f29('0x3'));var moment=require(_0x8f29('0x4'));var BPromise=require(_0x8f29('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8f29('0x6'));var csv=require(_0x8f29('0x7'));var ejs=require(_0x8f29('0x8'));var fs=require('fs');var fs_extra=require(_0x8f29('0x9'));var _=require(_0x8f29('0xa'));var squel=require('squel');var crypto=require(_0x8f29('0xb'));var jsforce=require(_0x8f29('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f29('0xd'));var Papa=require(_0x8f29('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f29('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f29('0x10'));var utils=require(_0x8f29('0x11'));var config=require(_0x8f29('0x12'));var licenseUtil=require(_0x8f29('0x13'));var db=require(_0x8f29('0x14'))['db'];function respondWithStatusCode(_0x4ab8bb,_0xd636c6){_0xd636c6=_0xd636c6||0xcc;return function(_0x48a4d8){if(_0x48a4d8){return _0x4ab8bb[_0x8f29('0x15')](_0xd636c6);}return _0x4ab8bb[_0x8f29('0x16')](_0xd636c6)['end']();};}function respondWithResult(_0x36f34c,_0x49b891){_0x49b891=_0x49b891||0xc8;return function(_0x3771ba){if(_0x3771ba){return _0x36f34c[_0x8f29('0x16')](_0x49b891)['json'](_0x3771ba);}};}function respondWithFilteredResult(_0x386590,_0x10daa7){return function(_0xa882ba){if(_0xa882ba){var _0x1269ad=typeof _0x10daa7['offset']==='undefined'&&typeof _0x10daa7[_0x8f29('0x17')]===_0x8f29('0x18');var _0x4eb4f1=_0xa882ba[_0x8f29('0x19')];var _0x17906c=_0x1269ad?0x0:_0x10daa7['offset'];var _0x7fd74=_0x1269ad?_0xa882ba[_0x8f29('0x19')]:_0x10daa7['offset']+_0x10daa7[_0x8f29('0x17')];var _0x560960;if(_0x7fd74>=_0x4eb4f1){_0x7fd74=_0x4eb4f1;_0x560960=0xc8;}else{_0x560960=0xce;}_0x386590[_0x8f29('0x16')](_0x560960);return _0x386590[_0x8f29('0x1a')](_0x8f29('0x1b'),_0x17906c+'-'+_0x7fd74+'/'+_0x4eb4f1)[_0x8f29('0x1c')](_0xa882ba);}return null;};}function patchUpdates(_0x337f00){return function(_0x2aace8){try{jsonpatch[_0x8f29('0x1d')](_0x2aace8,_0x337f00,!![]);}catch(_0xd9672a){return BPromise[_0x8f29('0x1e')](_0xd9672a);}return _0x2aace8['save']();};}function saveUpdates(_0x5e418e,_0x1deecd){return function(_0x63abb7){if(_0x63abb7){return _0x63abb7[_0x8f29('0x1f')](_0x5e418e)['then'](function(_0x47df32){return _0x47df32;});}return null;};}function removeEntity(_0x4c9d6f,_0x3ff104){return function(_0x19135a){if(_0x19135a){return _0x19135a['destroy']()[_0x8f29('0x20')](function(){_0x4c9d6f[_0x8f29('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d77a2,_0xa52716){return function(_0x2bbe8b){if(!_0x2bbe8b){_0x4d77a2[_0x8f29('0x15')](0x194);}return _0x2bbe8b;};}function handleError(_0x1765e7,_0x430852){_0x430852=_0x430852||0x1f4;return function(_0x5809ef){logger[_0x8f29('0x21')](_0x5809ef[_0x8f29('0x22')]);if(_0x5809ef['name']){delete _0x5809ef[_0x8f29('0x23')];}_0x1765e7[_0x8f29('0x16')](_0x430852)[_0x8f29('0x24')](_0x5809ef);};}exports['index']=function(_0x28cb42,_0xd8d6ba){var _0x2f6c58={},_0x5f0a7d={},_0xe35d6e={'count':0x0,'rows':[]};var _0x3ea003=_[_0x8f29('0x25')](db['AnalyticTreeReport'][_0x8f29('0x26')],function(_0x7785c3){return{'name':_0x7785c3['fieldName'],'type':_0x7785c3[_0x8f29('0x27')]['key']};});_0x5f0a7d[_0x8f29('0x28')]=_['map'](_0x3ea003,_0x8f29('0x23'));_0x5f0a7d[_0x8f29('0x29')]=_[_0x8f29('0x2a')](_0x28cb42[_0x8f29('0x29')]);_0x5f0a7d['filters']=_[_0x8f29('0x2b')](_0x5f0a7d[_0x8f29('0x28')],_0x5f0a7d[_0x8f29('0x29')]);_0x2f6c58[_0x8f29('0x2c')]=_[_0x8f29('0x2b')](_0x5f0a7d[_0x8f29('0x28')],qs[_0x8f29('0x2d')](_0x28cb42[_0x8f29('0x29')]['fields']));_0x2f6c58[_0x8f29('0x2c')]=_0x2f6c58[_0x8f29('0x2c')][_0x8f29('0x2e')]?_0x2f6c58[_0x8f29('0x2c')]:_0x5f0a7d[_0x8f29('0x28')];if(!_0x28cb42['query']['hasOwnProperty'](_0x8f29('0x2f'))){_0x2f6c58[_0x8f29('0x17')]=qs[_0x8f29('0x17')](_0x28cb42['query']['limit']);_0x2f6c58[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x28cb42[_0x8f29('0x29')][_0x8f29('0x30')]);}_0x2f6c58[_0x8f29('0x31')]=qs[_0x8f29('0x32')](_0x28cb42[_0x8f29('0x29')][_0x8f29('0x32')]);_0x2f6c58[_0x8f29('0x33')]=qs[_0x8f29('0x34')](_[_0x8f29('0x35')](_0x28cb42[_0x8f29('0x29')],_0x5f0a7d[_0x8f29('0x34')]),_0x3ea003);if(_0x28cb42[_0x8f29('0x29')][_0x8f29('0x36')]){_0x2f6c58[_0x8f29('0x33')]=_[_0x8f29('0x37')](_0x2f6c58[_0x8f29('0x33')],{'$or':_['map'](_0x3ea003,function(_0xf86c0c){if(_0xf86c0c['type']!=='VIRTUAL'){var _0x3cb183={};_0x3cb183[_0xf86c0c[_0x8f29('0x23')]]={'$like':'%'+_0x28cb42[_0x8f29('0x29')][_0x8f29('0x36')]+'%'};return _0x3cb183;}})});}_0x2f6c58=_[_0x8f29('0x37')]({},_0x2f6c58,_0x28cb42['options']);var _0x60980b={'where':_0x2f6c58[_0x8f29('0x33')]};return db['AnalyticTreeReport'][_0x8f29('0x19')](_0x60980b)[_0x8f29('0x20')](function(_0x4eefaf){_0xe35d6e['count']=_0x4eefaf;if(_0x28cb42[_0x8f29('0x29')][_0x8f29('0x38')]){_0x2f6c58[_0x8f29('0x39')]=[{'all':!![]}];}return db[_0x8f29('0x3a')][_0x8f29('0x3b')](_0x2f6c58);})[_0x8f29('0x20')](function(_0x3f20d2){_0xe35d6e['rows']=_0x3f20d2;return _0xe35d6e;})['then'](respondWithFilteredResult(_0xd8d6ba,_0x2f6c58))[_0x8f29('0x3c')](handleError(_0xd8d6ba,null));};exports[_0x8f29('0x3d')]=function(_0xfcbcff,_0x4bfa06){var _0x56f25b={'raw':!![],'where':{'id':_0xfcbcff[_0x8f29('0x3e')]['id']}},_0x3c8d6d={};_0x3c8d6d['model']=_[_0x8f29('0x2a')](db[_0x8f29('0x3a')][_0x8f29('0x26')]);_0x3c8d6d[_0x8f29('0x29')]=_[_0x8f29('0x2a')](_0xfcbcff[_0x8f29('0x29')]);_0x3c8d6d[_0x8f29('0x34')]=_[_0x8f29('0x2b')](_0x3c8d6d['model'],_0x3c8d6d[_0x8f29('0x29')]);_0x56f25b[_0x8f29('0x2c')]=_[_0x8f29('0x2b')](_0x3c8d6d[_0x8f29('0x28')],qs[_0x8f29('0x2d')](_0xfcbcff[_0x8f29('0x29')][_0x8f29('0x2d')]));_0x56f25b[_0x8f29('0x2c')]=_0x56f25b[_0x8f29('0x2c')][_0x8f29('0x2e')]?_0x56f25b['attributes']:_0x3c8d6d['model'];if(_0xfcbcff[_0x8f29('0x29')][_0x8f29('0x38')]){_0x56f25b['include']=[{'all':!![]}];}_0x56f25b=_[_0x8f29('0x37')]({},_0x56f25b,_0xfcbcff[_0x8f29('0x3f')]);return db[_0x8f29('0x3a')][_0x8f29('0x40')](_0x56f25b)['then'](handleEntityNotFound(_0x4bfa06,null))[_0x8f29('0x20')](respondWithResult(_0x4bfa06,null))[_0x8f29('0x3c')](handleError(_0x4bfa06,null));};exports['create']=function(_0x1d2a4b,_0x388601){return db[_0x8f29('0x3a')][_0x8f29('0x41')](_0x1d2a4b[_0x8f29('0x42')],{})[_0x8f29('0x20')](respondWithResult(_0x388601,0xc9))['catch'](handleError(_0x388601,null));};exports[_0x8f29('0x1f')]=function(_0x3fb6c7,_0x178e90){if(_0x3fb6c7['body']['id']){delete _0x3fb6c7['body']['id'];}return db[_0x8f29('0x3a')][_0x8f29('0x40')]({'where':{'id':_0x3fb6c7[_0x8f29('0x3e')]['id']}})['then'](handleEntityNotFound(_0x178e90,null))['then'](saveUpdates(_0x3fb6c7[_0x8f29('0x42')],null))[_0x8f29('0x20')](respondWithResult(_0x178e90,null))[_0x8f29('0x3c')](handleError(_0x178e90,null));};exports['destroy']=function(_0xace800,_0xdf0cd6){return db[_0x8f29('0x3a')][_0x8f29('0x40')]({'where':{'id':_0xace800[_0x8f29('0x3e')]['id']}})['then'](handleEntityNotFound(_0xdf0cd6,null))[_0x8f29('0x20')](removeEntity(_0xdf0cd6,null))[_0x8f29('0x3c')](handleError(_0xdf0cd6,null));};
\ No newline at end of file
+var _0xc190=['create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','save','update','destroy','then','sendStatus','stack','name','index','map','AnalyticTreeReport','fieldName','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','catch','keys','rawAttributes','fields','find'];(function(_0x1c01f7,_0x580546){var _0x241f6f=function(_0xcdbad){while(--_0xcdbad){_0x1c01f7['push'](_0x1c01f7['shift']());}};_0x241f6f(++_0x580546);}(_0xc190,0x1f4));var _0x0c19=function(_0xefc3a0,_0x3e792e){_0xefc3a0=_0xefc3a0-0x0;var _0x5c681f=_0xc190[_0xefc3a0];return _0x5c681f;};'use strict';var emlformat=require(_0x0c19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c19('0x1'));var jsonpatch=require(_0x0c19('0x2'));var rp=require(_0x0c19('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c19('0x4'));var util=require('util');var path=require(_0x0c19('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c19('0x6'));var _=require(_0x0c19('0x7'));var squel=require(_0x0c19('0x8'));var crypto=require(_0x0c19('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0c19('0xa'));var toCsv=require(_0x0c19('0xb'));var querystring=require(_0x0c19('0xc'));var Papa=require(_0x0c19('0xd'));var Redis=require(_0x0c19('0xe'));var authService=require(_0x0c19('0xf'));var qs=require(_0x0c19('0x10'));var as=require(_0x0c19('0x11'));var hardwareService=require(_0x0c19('0x12'));var logger=require(_0x0c19('0x13'))(_0x0c19('0x14'));var utils=require('../../config/utils');var config=require(_0x0c19('0x15'));var licenseUtil=require(_0x0c19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534e74,_0x4c2740){_0x4c2740=_0x4c2740||0xcc;return function(_0x27cfae){if(_0x27cfae){return _0x534e74['sendStatus'](_0x4c2740);}return _0x534e74[_0x0c19('0x17')](_0x4c2740)[_0x0c19('0x18')]();};}function respondWithResult(_0x1b6a84,_0x263ef7){_0x263ef7=_0x263ef7||0xc8;return function(_0x408684){if(_0x408684){return _0x1b6a84[_0x0c19('0x17')](_0x263ef7)[_0x0c19('0x19')](_0x408684);}};}function respondWithFilteredResult(_0x4cdd75,_0x52c705){return function(_0xd05879){if(_0xd05879){var _0x573f34=typeof _0x52c705[_0x0c19('0x1a')]===_0x0c19('0x1b')&&typeof _0x52c705['limit']==='undefined';var _0x47f51f=_0xd05879['count'];var _0x3bf708=_0x573f34?0x0:_0x52c705['offset'];var _0x3724a6=_0x573f34?_0xd05879['count']:_0x52c705[_0x0c19('0x1a')]+_0x52c705[_0x0c19('0x1c')];var _0x287b90;if(_0x3724a6>=_0x47f51f){_0x3724a6=_0x47f51f;_0x287b90=0xc8;}else{_0x287b90=0xce;}_0x4cdd75['status'](_0x287b90);return _0x4cdd75['set'](_0x0c19('0x1d'),_0x3bf708+'-'+_0x3724a6+'/'+_0x47f51f)[_0x0c19('0x19')](_0xd05879);}return null;};}function patchUpdates(_0x30ac8f){return function(_0x4ba6a6){try{jsonpatch['apply'](_0x4ba6a6,_0x30ac8f,!![]);}catch(_0x31d81b){return BPromise['reject'](_0x31d81b);}return _0x4ba6a6[_0x0c19('0x1e')]();};}function saveUpdates(_0xb612a3,_0x43ab9b){return function(_0x5bec7c){if(_0x5bec7c){return _0x5bec7c[_0x0c19('0x1f')](_0xb612a3)['then'](function(_0x5f2e8c){return _0x5f2e8c;});}return null;};}function removeEntity(_0x499c78,_0x1288b3){return function(_0x442922){if(_0x442922){return _0x442922[_0x0c19('0x20')]()[_0x0c19('0x21')](function(){_0x499c78[_0x0c19('0x17')](0xcc)[_0x0c19('0x18')]();});}};}function handleEntityNotFound(_0x1e2f8c,_0x52d893){return function(_0x243b3e){if(!_0x243b3e){_0x1e2f8c[_0x0c19('0x22')](0x194);}return _0x243b3e;};}function handleError(_0x3d4390,_0x52849a){_0x52849a=_0x52849a||0x1f4;return function(_0x25dc22){logger['error'](_0x25dc22[_0x0c19('0x23')]);if(_0x25dc22[_0x0c19('0x24')]){delete _0x25dc22['name'];}_0x3d4390['status'](_0x52849a)['send'](_0x25dc22);};}exports[_0x0c19('0x25')]=function(_0x4ac493,_0x35803a){var _0xbe3f48={},_0x145f57={},_0x3e9261={'count':0x0,'rows':[]};var _0x5c5217=_[_0x0c19('0x26')](db[_0x0c19('0x27')]['rawAttributes'],function(_0x487896){return{'name':_0x487896[_0x0c19('0x28')],'type':_0x487896['type'][_0x0c19('0x29')]};});_0x145f57['model']=_[_0x0c19('0x26')](_0x5c5217,_0x0c19('0x24'));_0x145f57[_0x0c19('0x2a')]=_['keys'](_0x4ac493[_0x0c19('0x2a')]);_0x145f57[_0x0c19('0x2b')]=_[_0x0c19('0x2c')](_0x145f57[_0x0c19('0x2d')],_0x145f57[_0x0c19('0x2a')]);_0xbe3f48['attributes']=_['intersection'](_0x145f57[_0x0c19('0x2d')],qs['fields'](_0x4ac493['query']['fields']));_0xbe3f48['attributes']=_0xbe3f48[_0x0c19('0x2e')][_0x0c19('0x2f')]?_0xbe3f48['attributes']:_0x145f57[_0x0c19('0x2d')];if(!_0x4ac493['query'][_0x0c19('0x30')](_0x0c19('0x31'))){_0xbe3f48[_0x0c19('0x1c')]=qs[_0x0c19('0x1c')](_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x1c')]);_0xbe3f48['offset']=qs[_0x0c19('0x1a')](_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x1a')]);}_0xbe3f48[_0x0c19('0x32')]=qs[_0x0c19('0x33')](_0x4ac493['query'][_0x0c19('0x33')]);_0xbe3f48[_0x0c19('0x34')]=qs[_0x0c19('0x2b')](_[_0x0c19('0x35')](_0x4ac493['query'],_0x145f57['filters']),_0x5c5217);if(_0x4ac493[_0x0c19('0x2a')]['filter']){_0xbe3f48['where']=_['merge'](_0xbe3f48[_0x0c19('0x34')],{'$or':_['map'](_0x5c5217,function(_0x505a16){if(_0x505a16[_0x0c19('0x36')]!==_0x0c19('0x37')){var _0x4c9857={};_0x4c9857[_0x505a16[_0x0c19('0x24')]]={'$like':'%'+_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x38')]+'%'};return _0x4c9857;}})});}_0xbe3f48=_[_0x0c19('0x39')]({},_0xbe3f48,_0x4ac493[_0x0c19('0x3a')]);var _0x4bf832={'where':_0xbe3f48[_0x0c19('0x34')]};return db[_0x0c19('0x27')][_0x0c19('0x3b')](_0x4bf832)['then'](function(_0x48ea55){_0x3e9261['count']=_0x48ea55;if(_0x4ac493[_0x0c19('0x2a')][_0x0c19('0x3c')]){_0xbe3f48[_0x0c19('0x3d')]=[{'all':!![]}];}return db[_0x0c19('0x27')][_0x0c19('0x3e')](_0xbe3f48);})['then'](function(_0x46ae93){_0x3e9261['rows']=_0x46ae93;return _0x3e9261;})[_0x0c19('0x21')](respondWithFilteredResult(_0x35803a,_0xbe3f48))[_0x0c19('0x3f')](handleError(_0x35803a,null));};exports['show']=function(_0x15ca96,_0x59d4e8){var _0x597fb5={'raw':!![],'where':{'id':_0x15ca96['params']['id']}},_0x499689={};_0x499689[_0x0c19('0x2d')]=_[_0x0c19('0x40')](db[_0x0c19('0x27')][_0x0c19('0x41')]);_0x499689['query']=_[_0x0c19('0x40')](_0x15ca96['query']);_0x499689['filters']=_[_0x0c19('0x2c')](_0x499689[_0x0c19('0x2d')],_0x499689[_0x0c19('0x2a')]);_0x597fb5[_0x0c19('0x2e')]=_[_0x0c19('0x2c')](_0x499689['model'],qs[_0x0c19('0x42')](_0x15ca96[_0x0c19('0x2a')]['fields']));_0x597fb5[_0x0c19('0x2e')]=_0x597fb5[_0x0c19('0x2e')]['length']?_0x597fb5[_0x0c19('0x2e')]:_0x499689[_0x0c19('0x2d')];if(_0x15ca96[_0x0c19('0x2a')][_0x0c19('0x3c')]){_0x597fb5[_0x0c19('0x3d')]=[{'all':!![]}];}_0x597fb5=_[_0x0c19('0x39')]({},_0x597fb5,_0x15ca96[_0x0c19('0x3a')]);return db[_0x0c19('0x27')][_0x0c19('0x43')](_0x597fb5)[_0x0c19('0x21')](handleEntityNotFound(_0x59d4e8,null))['then'](respondWithResult(_0x59d4e8,null))['catch'](handleError(_0x59d4e8,null));};exports[_0x0c19('0x44')]=function(_0x1fb92c,_0x574743){return db['AnalyticTreeReport'][_0x0c19('0x44')](_0x1fb92c[_0x0c19('0x45')],{})['then'](respondWithResult(_0x574743,0xc9))[_0x0c19('0x3f')](handleError(_0x574743,null));};exports[_0x0c19('0x1f')]=function(_0xd672d3,_0x71ccf8){if(_0xd672d3[_0x0c19('0x45')]['id']){delete _0xd672d3[_0x0c19('0x45')]['id'];}return db[_0x0c19('0x27')][_0x0c19('0x43')]({'where':{'id':_0xd672d3[_0x0c19('0x46')]['id']}})[_0x0c19('0x21')](handleEntityNotFound(_0x71ccf8,null))[_0x0c19('0x21')](saveUpdates(_0xd672d3[_0x0c19('0x45')],null))['then'](respondWithResult(_0x71ccf8,null))[_0x0c19('0x3f')](handleError(_0x71ccf8,null));};exports[_0x0c19('0x20')]=function(_0x249d8e,_0x544f24){return db['AnalyticTreeReport'][_0x0c19('0x43')]({'where':{'id':_0x249d8e[_0x0c19('0x46')]['id']}})[_0x0c19('0x21')](handleEntityNotFound(_0x544f24,null))[_0x0c19('0x21')](removeEntity(_0x544f24,null))[_0x0c19('0x3f')](handleError(_0x544f24,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index c8ad5ed..8e3458d 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 _0xb8f3=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0xb8f3,0xbe));var _0x3b8f=function(_0x3f4568,_0x9eb0ee){_0x3f4568=_0x3f4568-0x0;var _0xee2340=_0xb8f3[_0x3f4568];return _0xee2340;};'use strict';var _=require(_0x3b8f('0x0'));var util=require(_0x3b8f('0x1'));var logger=require(_0x3b8f('0x2'))(_0x3b8f('0x3'));var moment=require(_0x3b8f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3b8f('0x5'));var fs=require('fs');var path=require(_0x3b8f('0x6'));var rimraf=require(_0x3b8f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b8f('0x8'));module[_0x3b8f('0x9')]=function(_0x321272,_0x1dc460){return _0x321272[_0x3b8f('0xa')](_0x3b8f('0xb'),attributes,{'tableName':_0x3b8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf81=['path','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3173a5,_0x150e7c){var _0x26c94c=function(_0x11e335){while(--_0x11e335){_0x3173a5['push'](_0x3173a5['shift']());}};_0x26c94c(++_0x150e7c);}(_0xbf81,0x13a));var _0x1bf8=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xbf81[_0x216d45];return _0xbaac0b;};'use strict';var _=require('lodash');var util=require(_0x1bf8('0x0'));var logger=require(_0x1bf8('0x1'))(_0x1bf8('0x2'));var moment=require('moment');var BPromise=require(_0x1bf8('0x3'));var rp=require(_0x1bf8('0x4'));var fs=require('fs');var path=require(_0x1bf8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bf8('0x6'));module[_0x1bf8('0x7')]=function(_0x3cda6e,_0x136e47){return _0x3cda6e[_0x1bf8('0x8')](_0x1bf8('0x9'),attributes,{'tableName':_0x1bf8('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 7a43fdb..e9c851d 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x367b96,_0x2bc5d5){var _0x19fd6e=function(_0x12681c){while(--_0x12681c){_0x367b96['push'](_0x367b96['shift']());}};_0x19fd6e(++_0x2bc5d5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x5f2f[_0x284609];return _0x55116b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2d101d,_0x814e7){var _0xa02f7b=function(_0x1075d5){while(--_0x1075d5){_0x2d101d['push'](_0x2d101d['shift']());}};_0xa02f7b(++_0x814e7);}(_0xdb28,0x106));var _0x8db2=function(_0x52921f,_0x43d3da){_0x52921f=_0x52921f-0x0;var _0x4a2f05=_0xdb28[_0x52921f];return _0x4a2f05;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 72b3cc2..cbb28bb 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 _0xc0a1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports'];(function(_0x4fd6d0,_0x55451a){var _0x2452de=function(_0x517b1a){while(--_0x517b1a){_0x4fd6d0['push'](_0x4fd6d0['shift']());}};_0x2452de(++_0x55451a);}(_0xc0a1,0x90));var _0x1c0a=function(_0xc31458,_0x45ee76){_0xc31458=_0xc31458-0x0;var _0x1b4a90=_0xc0a1[_0xc31458];return _0x1b4a90;};'use strict';var multer=require('multer');var util=require(_0x1c0a('0x0'));var path=require(_0x1c0a('0x1'));var timeout=require(_0x1c0a('0x2'));var express=require(_0x1c0a('0x3'));var router=express[_0x1c0a('0x4')]();var fs_extra=require(_0x1c0a('0x5'));var auth=require(_0x1c0a('0x6'));var interaction=require(_0x1c0a('0x7'));var config=require(_0x1c0a('0x8'));var controller=require(_0x1c0a('0x9'));router[_0x1c0a('0xa')]('/',auth[_0x1c0a('0xb')](),controller['index']);router[_0x1c0a('0xa')](_0x1c0a('0xc'),auth[_0x1c0a('0xb')](),controller['show']);router['post']('/',auth[_0x1c0a('0xb')](),controller['create']);router[_0x1c0a('0xd')](_0x1c0a('0xc'),auth['isAuthenticated'](),controller[_0x1c0a('0xe')]);router[_0x1c0a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1c0a('0x10')]);module[_0x1c0a('0x11')]=router;
\ No newline at end of file
+var _0x2368=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','show','create','put','/:id','destroy','exports','multer','util','path'];(function(_0x34067a,_0x510624){var _0xc2e868=function(_0x3df173){while(--_0x3df173){_0x34067a['push'](_0x34067a['shift']());}};_0xc2e868(++_0x510624);}(_0x2368,0x1d1));var _0x8236=function(_0x43016e,_0x3ee132){_0x43016e=_0x43016e-0x0;var _0x161949=_0x2368[_0x43016e];return _0x161949;};'use strict';var multer=require(_0x8236('0x0'));var util=require(_0x8236('0x1'));var path=require(_0x8236('0x2'));var timeout=require('connect-timeout');var express=require(_0x8236('0x3'));var router=express['Router']();var fs_extra=require(_0x8236('0x4'));var auth=require(_0x8236('0x5'));var interaction=require(_0x8236('0x6'));var config=require(_0x8236('0x7'));var controller=require(_0x8236('0x8'));router['get']('/',auth[_0x8236('0x9')](),controller[_0x8236('0xa')]);router[_0x8236('0xb')]('/:id',auth[_0x8236('0x9')](),controller[_0x8236('0xc')]);router['post']('/',auth[_0x8236('0x9')](),controller[_0x8236('0xd')]);router[_0x8236('0xe')]('/:id',auth[_0x8236('0x9')](),controller['update']);router['delete'](_0x8236('0xf'),auth[_0x8236('0x9')](),controller[_0x8236('0x10')]);module[_0x8236('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5dfab70..b21f25f 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 _0x83f1=['STRING','sequelize','exports'];(function(_0xea86b9,_0x55f73f){var _0x340174=function(_0x5c6350){while(--_0x5c6350){_0xea86b9['push'](_0xea86b9['shift']());}};_0x340174(++_0x55f73f);}(_0x83f1,0x1cc));var _0x183f=function(_0x1c55ed,_0x485ab0){_0x1c55ed=_0x1c55ed-0x0;var _0x3174bd=_0x83f1[_0x1c55ed];return _0x3174bd;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')]},'basename':{'type':Sequelize[_0x183f('0x2')]},'type':{'type':Sequelize[_0x183f('0x2')]}};
\ No newline at end of file
+var _0xaa7c=['sequelize'];(function(_0x25bcf7,_0x283759){var _0x2ee920=function(_0xecbdd9){while(--_0xecbdd9){_0x25bcf7['push'](_0x25bcf7['shift']());}};_0x2ee920(++_0x283759);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x5e84ec,_0x5ba3bb){_0x5e84ec=_0x5e84ec-0x0;var _0x41f73c=_0xaa7c[_0x5e84ec];return _0x41f73c;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ad863b7..c574007 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 _0xc697=['filter','options','includeAll','include','catch','show','params','rawAttributes','clone','find','get','updatedAt','body','omit','createdAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','Attachment','fieldName','key','keys','filters','intersection','model','attributes','query','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL'];(function(_0x4489b6,_0x47c466){var _0x13a4bb=function(_0x25092f){while(--_0x25092f){_0x4489b6['push'](_0x4489b6['shift']());}};_0x13a4bb(++_0x47c466);}(_0xc697,0xcd));var _0x7c69=function(_0x1ca099,_0x1a03c9){_0x1ca099=_0x1ca099-0x0;var _0x16e20d=_0xc697[_0x1ca099];return _0x16e20d;};'use strict';var emlformat=require(_0x7c69('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c69('0x1'));var rp=require(_0x7c69('0x2'));var moment=require(_0x7c69('0x3'));var BPromise=require(_0x7c69('0x4'));var Mustache=require(_0x7c69('0x5'));var util=require('util');var path=require(_0x7c69('0x6'));var sox=require(_0x7c69('0x7'));var csv=require(_0x7c69('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c69('0x9'));var squel=require(_0x7c69('0xa'));var crypto=require(_0x7c69('0xb'));var jsforce=require(_0x7c69('0xc'));var deskjs=require(_0x7c69('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7c69('0xe'));var Papa=require(_0x7c69('0xf'));var Redis=require(_0x7c69('0x10'));var authService=require(_0x7c69('0x11'));var qs=require(_0x7c69('0x12'));var as=require(_0x7c69('0x13'));var hardwareService=require(_0x7c69('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7c69('0x15'));var config=require(_0x7c69('0x16'));var licenseUtil=require(_0x7c69('0x17'));var db=require(_0x7c69('0x18'))['db'];function respondWithStatusCode(_0x113219,_0x4eea62){_0x4eea62=_0x4eea62||0xcc;return function(_0x3476c9){if(_0x3476c9){return _0x113219[_0x7c69('0x19')](_0x4eea62);}return _0x113219[_0x7c69('0x1a')](_0x4eea62)[_0x7c69('0x1b')]();};}function respondWithResult(_0x29a551,_0xdd1861){_0xdd1861=_0xdd1861||0xc8;return function(_0x5ac9c4){if(_0x5ac9c4){return _0x29a551[_0x7c69('0x1a')](_0xdd1861)[_0x7c69('0x1c')](_0x5ac9c4);}};}function respondWithFilteredResult(_0x7f1d73,_0x4e3a5f){return function(_0x5dfe2d){if(_0x5dfe2d){var _0x405d5d=typeof _0x4e3a5f[_0x7c69('0x1d')]===_0x7c69('0x1e')&&typeof _0x4e3a5f[_0x7c69('0x1f')]===_0x7c69('0x1e');var _0x471867=_0x5dfe2d[_0x7c69('0x20')];var _0x37a30e=_0x405d5d?0x0:_0x4e3a5f[_0x7c69('0x1d')];var _0x34323c=_0x405d5d?_0x5dfe2d['count']:_0x4e3a5f[_0x7c69('0x1d')]+_0x4e3a5f[_0x7c69('0x1f')];var _0x18a9f5;if(_0x34323c>=_0x471867){_0x34323c=_0x471867;_0x18a9f5=0xc8;}else{_0x18a9f5=0xce;}_0x7f1d73[_0x7c69('0x1a')](_0x18a9f5);return _0x7f1d73['set'](_0x7c69('0x21'),_0x37a30e+'-'+_0x34323c+'/'+_0x471867)[_0x7c69('0x1c')](_0x5dfe2d);}return null;};}function patchUpdates(_0x564e67){return function(_0x1658ea){try{jsonpatch[_0x7c69('0x22')](_0x1658ea,_0x564e67,!![]);}catch(_0xc0b66d){return BPromise[_0x7c69('0x23')](_0xc0b66d);}return _0x1658ea['save']();};}function saveUpdates(_0x29ce73,_0x310e67){return function(_0x542b24){if(_0x542b24){return _0x542b24['update'](_0x29ce73)[_0x7c69('0x24')](function(_0x5ad83c){return _0x5ad83c;});}return null;};}function removeEntity(_0x4f0cd3,_0x53fe2b){return function(_0x393a0c){if(_0x393a0c){return _0x393a0c[_0x7c69('0x25')]()[_0x7c69('0x24')](function(){_0x4f0cd3[_0x7c69('0x1a')](0xcc)[_0x7c69('0x1b')]();});}};}function handleEntityNotFound(_0x52b018,_0x208e12){return function(_0x21f0b0){if(!_0x21f0b0){_0x52b018[_0x7c69('0x19')](0x194);}return _0x21f0b0;};}function handleError(_0x22f2dd,_0x19bea4){_0x19bea4=_0x19bea4||0x1f4;return function(_0x158b4c){logger[_0x7c69('0x26')](_0x158b4c[_0x7c69('0x27')]);if(_0x158b4c[_0x7c69('0x28')]){delete _0x158b4c[_0x7c69('0x28')];}_0x22f2dd[_0x7c69('0x1a')](_0x19bea4)[_0x7c69('0x29')](_0x158b4c);};}exports['index']=function(_0x52b84b,_0x1a0b64){var _0x2944a7={},_0x3f1de6={},_0x40beb5={'count':0x0,'rows':[]};var _0x491e03=_['map'](db[_0x7c69('0x2a')]['rawAttributes'],function(_0x2ffe1a){return{'name':_0x2ffe1a[_0x7c69('0x2b')],'type':_0x2ffe1a['type'][_0x7c69('0x2c')]};});_0x3f1de6['model']=_['map'](_0x491e03,'name');_0x3f1de6['query']=_[_0x7c69('0x2d')](_0x52b84b['query']);_0x3f1de6[_0x7c69('0x2e')]=_[_0x7c69('0x2f')](_0x3f1de6[_0x7c69('0x30')],_0x3f1de6['query']);_0x2944a7[_0x7c69('0x31')]=_['intersection'](_0x3f1de6['model'],qs['fields'](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x33')]));_0x2944a7['attributes']=_0x2944a7[_0x7c69('0x31')][_0x7c69('0x34')]?_0x2944a7[_0x7c69('0x31')]:_0x3f1de6[_0x7c69('0x30')];if(!_0x52b84b[_0x7c69('0x32')]['hasOwnProperty'](_0x7c69('0x35'))){_0x2944a7[_0x7c69('0x1f')]=qs['limit'](_0x52b84b['query'][_0x7c69('0x1f')]);_0x2944a7[_0x7c69('0x1d')]=qs[_0x7c69('0x1d')](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x1d')]);}_0x2944a7[_0x7c69('0x36')]=qs['sort'](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x37')]);_0x2944a7[_0x7c69('0x38')]=qs[_0x7c69('0x2e')](_[_0x7c69('0x39')](_0x52b84b['query'],_0x3f1de6[_0x7c69('0x2e')]),_0x491e03);if(_0x52b84b['query']['filter']){_0x2944a7[_0x7c69('0x38')]=_[_0x7c69('0x3a')](_0x2944a7['where'],{'$or':_[_0x7c69('0x3b')](_0x491e03,function(_0x44c7b8){if(_0x44c7b8[_0x7c69('0x3c')]!==_0x7c69('0x3d')){var _0x144a45={};_0x144a45[_0x44c7b8[_0x7c69('0x28')]]={'$like':'%'+_0x52b84b[_0x7c69('0x32')][_0x7c69('0x3e')]+'%'};return _0x144a45;}})});}_0x2944a7=_[_0x7c69('0x3a')]({},_0x2944a7,_0x52b84b[_0x7c69('0x3f')]);var _0x5de3={'where':_0x2944a7['where']};return db['Attachment']['count'](_0x5de3)[_0x7c69('0x24')](function(_0xff121a){_0x40beb5[_0x7c69('0x20')]=_0xff121a;if(_0x52b84b[_0x7c69('0x32')][_0x7c69('0x40')]){_0x2944a7[_0x7c69('0x41')]=[{'all':!![]}];}return db[_0x7c69('0x2a')]['findAll'](_0x2944a7);})[_0x7c69('0x24')](function(_0x2e4a04){_0x40beb5['rows']=_0x2e4a04;return _0x40beb5;})['then'](respondWithFilteredResult(_0x1a0b64,_0x2944a7))[_0x7c69('0x42')](handleError(_0x1a0b64,null));};exports[_0x7c69('0x43')]=function(_0x499a4a,_0x5c4cf1){var _0x369ea9={'raw':!![],'where':{'id':_0x499a4a[_0x7c69('0x44')]['id']}},_0x20e7d7={};_0x20e7d7['model']=_[_0x7c69('0x2d')](db['Attachment'][_0x7c69('0x45')]);_0x20e7d7['query']=_['keys'](_0x499a4a[_0x7c69('0x32')]);_0x20e7d7['filters']=_[_0x7c69('0x2f')](_0x20e7d7[_0x7c69('0x30')],_0x20e7d7[_0x7c69('0x32')]);_0x369ea9['attributes']=_[_0x7c69('0x2f')](_0x20e7d7[_0x7c69('0x30')],qs[_0x7c69('0x33')](_0x499a4a[_0x7c69('0x32')][_0x7c69('0x33')]));_0x369ea9[_0x7c69('0x31')]=_0x369ea9[_0x7c69('0x31')][_0x7c69('0x34')]?_0x369ea9[_0x7c69('0x31')]:_0x20e7d7[_0x7c69('0x30')];if(_0x499a4a['query'][_0x7c69('0x40')]){_0x369ea9['include']=[{'all':!![]}];}_0x369ea9=_[_0x7c69('0x3a')]({},_0x369ea9,_0x499a4a['options']);return db[_0x7c69('0x2a')]['find'](_0x369ea9)[_0x7c69('0x24')](handleEntityNotFound(_0x5c4cf1,null))[_0x7c69('0x24')](respondWithResult(_0x5c4cf1,null))[_0x7c69('0x42')](handleError(_0x5c4cf1,null));};exports[_0x7c69('0x46')]=function(_0x563b13,_0x50b906){var _0x4ef6ff={'where':{'id':_0x563b13[_0x7c69('0x44')]['id']}},_0x3f72f0={};_0x3f72f0[_0x7c69('0x30')]=_[_0x7c69('0x2d')](db['Attachment'][_0x7c69('0x45')]);_0x4ef6ff[_0x7c69('0x31')]=_[_0x7c69('0x2f')](_0x3f72f0[_0x7c69('0x30')],qs['fields'](_0x563b13['query'][_0x7c69('0x33')]));_0x4ef6ff['attributes']=_0x4ef6ff[_0x7c69('0x31')]['length']?_0x4ef6ff[_0x7c69('0x31')]:_0x3f72f0['model'];if(_0x563b13['query'][_0x7c69('0x40')]){_0x4ef6ff[_0x7c69('0x41')]=[{'all':!![]}];}_0x4ef6ff=_[_0x7c69('0x3a')]({},_0x4ef6ff,_0x563b13[_0x7c69('0x3f')]);return db[_0x7c69('0x2a')][_0x7c69('0x47')](_0x4ef6ff)[_0x7c69('0x24')](handleEntityNotFound(_0x50b906,null))[_0x7c69('0x24')](function(_0x442730){if(_0x442730){var _0x327fd7=_0x442730[_0x7c69('0x48')]({'plain':!![]});_0x327fd7=qs['omit'](_0x327fd7,['id','createdAt',_0x7c69('0x49')]);_0x563b13[_0x7c69('0x4a')]=_[_0x7c69('0x4b')](_0x563b13['body'],['id',_0x7c69('0x4c'),'updatedAt']);return db['Attachment']['create'](_[_0x7c69('0x3a')](_0x327fd7,_0x563b13[_0x7c69('0x4a')]),{'include':_0x563b13[_0x7c69('0x32')][_0x7c69('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x50b906,0xc9))[_0x7c69('0x42')](handleError(_0x50b906,null));};exports['update']=function(_0x375abd,_0x274384){if(_0x375abd[_0x7c69('0x4a')]['id']){delete _0x375abd['body']['id'];}return db[_0x7c69('0x2a')]['find']({'where':{'id':_0x375abd[_0x7c69('0x44')]['id']}})[_0x7c69('0x24')](handleEntityNotFound(_0x274384,null))['then'](saveUpdates(_0x375abd[_0x7c69('0x4a')],null))[_0x7c69('0x24')](respondWithResult(_0x274384,null))['catch'](handleError(_0x274384,null));};exports[_0x7c69('0x25')]=function(_0x3b587c,_0x23bcdc){return db['Attachment'][_0x7c69('0x47')]({'where':{'id':_0x3b587c[_0x7c69('0x44')]['id']}})['then'](handleEntityNotFound(_0x23bcdc,null))['then'](removeEntity(_0x23bcdc,null))[_0x7c69('0x42')](handleError(_0x23bcdc,null));};exports[_0x7c69('0x4d')]=function(_0x35bfde,_0xeb3a02,_0x4c7954){_0x35bfde['body']['name']=_0x35bfde[_0x7c69('0x4e')][_0x7c69('0x4f')];_0x35bfde[_0x7c69('0x4a')][_0x7c69('0x50')]=_0x35bfde[_0x7c69('0x4e')][_0x7c69('0x51')];_0x35bfde[_0x7c69('0x4a')][_0x7c69('0x3c')]=_0x35bfde['file'][_0x7c69('0x52')];return db[_0x7c69('0x2a')][_0x7c69('0x4d')](_0x35bfde[_0x7c69('0x4a')])[_0x7c69('0x24')](respondWithResult(_0xeb3a02,0xc9))[_0x7c69('0x42')](handleError(_0xeb3a02,null));};exports[_0x7c69('0x53')]=function(_0x33ccb8,_0x58e5f7,_0x4499a7){return db[_0x7c69('0x2a')][_0x7c69('0x54')]({'where':{'id':_0x33ccb8[_0x7c69('0x44')]['id']},'raw':!![]})[_0x7c69('0x24')](handleEntityNotFound(_0x58e5f7,null))['then'](function(_0x22669d){if(_0x22669d){var _0x5384c6=_0x22669d[_0x7c69('0x55')]!==null;var _0x5053ed=path[_0x7c69('0x56')](config['root'],_0x7c69('0x57'));if(_0x5384c6){_0x5053ed=path[_0x7c69('0x56')](_0x5053ed,_0x7c69('0x58'));}var _0x364fed=path[_0x7c69('0x56')](_0x5053ed,_0x22669d[_0x7c69('0x50')]);return _0x58e5f7[_0x7c69('0x53')](_0x364fed);}})[_0x7c69('0x42')](handleError(_0x58e5f7,null));};
\ No newline at end of file
+var _0xa98b=['createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','query','filters','attributes','intersection','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','keys','length','find','clone','params','includeAll','get','omit'];(function(_0x5e7ede,_0xb4f04f){var _0x14efe4=function(_0x34ddc7){while(--_0x34ddc7){_0x5e7ede['push'](_0x5e7ede['shift']());}};_0x14efe4(++_0xb4f04f);}(_0xa98b,0x69));var _0xba98=function(_0x4048d6,_0x46a36d){_0x4048d6=_0x4048d6-0x0;var _0x35a7f5=_0xa98b[_0x4048d6];return _0x35a7f5;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba98('0x1'));var jsonpatch=require(_0xba98('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba98('0x3'));var Mustache=require(_0xba98('0x4'));var util=require('util');var path=require(_0xba98('0x5'));var sox=require(_0xba98('0x6'));var csv=require(_0xba98('0x7'));var ejs=require(_0xba98('0x8'));var fs=require('fs');var fs_extra=require(_0xba98('0x9'));var _=require('lodash');var squel=require(_0xba98('0xa'));var crypto=require('crypto');var jsforce=require(_0xba98('0xb'));var deskjs=require(_0xba98('0xc'));var toCsv=require(_0xba98('0x7'));var querystring=require(_0xba98('0xd'));var Papa=require(_0xba98('0xe'));var Redis=require(_0xba98('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xba98('0x10'));var as=require(_0xba98('0x11'));var hardwareService=require(_0xba98('0x12'));var logger=require('../../config/logger')(_0xba98('0x13'));var utils=require('../../config/utils');var config=require(_0xba98('0x14'));var licenseUtil=require(_0xba98('0x15'));var db=require(_0xba98('0x16'))['db'];function respondWithStatusCode(_0x74ca78,_0x6c0d1b){_0x6c0d1b=_0x6c0d1b||0xcc;return function(_0x196fc1){if(_0x196fc1){return _0x74ca78[_0xba98('0x17')](_0x6c0d1b);}return _0x74ca78[_0xba98('0x18')](_0x6c0d1b)[_0xba98('0x19')]();};}function respondWithResult(_0x34484e,_0x3fafa8){_0x3fafa8=_0x3fafa8||0xc8;return function(_0x38cbbc){if(_0x38cbbc){return _0x34484e[_0xba98('0x18')](_0x3fafa8)[_0xba98('0x1a')](_0x38cbbc);}};}function respondWithFilteredResult(_0x359a3a,_0x3a15d2){return function(_0x5d6ffd){if(_0x5d6ffd){var _0x40edfd=typeof _0x3a15d2[_0xba98('0x1b')]===_0xba98('0x1c')&&typeof _0x3a15d2[_0xba98('0x1d')]===_0xba98('0x1c');var _0x30d24d=_0x5d6ffd[_0xba98('0x1e')];var _0x26ce3e=_0x40edfd?0x0:_0x3a15d2['offset'];var _0x4c7670=_0x40edfd?_0x5d6ffd['count']:_0x3a15d2[_0xba98('0x1b')]+_0x3a15d2[_0xba98('0x1d')];var _0x15eed5;if(_0x4c7670>=_0x30d24d){_0x4c7670=_0x30d24d;_0x15eed5=0xc8;}else{_0x15eed5=0xce;}_0x359a3a[_0xba98('0x18')](_0x15eed5);return _0x359a3a[_0xba98('0x1f')](_0xba98('0x20'),_0x26ce3e+'-'+_0x4c7670+'/'+_0x30d24d)['json'](_0x5d6ffd);}return null;};}function patchUpdates(_0x549797){return function(_0x1a9104){try{jsonpatch[_0xba98('0x21')](_0x1a9104,_0x549797,!![]);}catch(_0x3a4822){return BPromise[_0xba98('0x22')](_0x3a4822);}return _0x1a9104['save']();};}function saveUpdates(_0x457be7,_0x4f73da){return function(_0x2d10c8){if(_0x2d10c8){return _0x2d10c8[_0xba98('0x23')](_0x457be7)[_0xba98('0x24')](function(_0x5729a2){return _0x5729a2;});}return null;};}function removeEntity(_0x317d7f,_0x412901){return function(_0x4be6e5){if(_0x4be6e5){return _0x4be6e5[_0xba98('0x25')]()['then'](function(){_0x317d7f['status'](0xcc)[_0xba98('0x19')]();});}};}function handleEntityNotFound(_0x2078b5,_0x14b19f){return function(_0x1a786f){if(!_0x1a786f){_0x2078b5[_0xba98('0x17')](0x194);}return _0x1a786f;};}function handleError(_0x5e6b2b,_0x1b9f93){_0x1b9f93=_0x1b9f93||0x1f4;return function(_0x11b4ba){logger[_0xba98('0x26')](_0x11b4ba[_0xba98('0x27')]);if(_0x11b4ba[_0xba98('0x28')]){delete _0x11b4ba['name'];}_0x5e6b2b[_0xba98('0x18')](_0x1b9f93)[_0xba98('0x29')](_0x11b4ba);};}exports[_0xba98('0x2a')]=function(_0x275b52,_0x420c15){var _0xb2109={},_0x363e0b={},_0x1b79d9={'count':0x0,'rows':[]};var _0x5a75f7=_[_0xba98('0x2b')](db[_0xba98('0x2c')][_0xba98('0x2d')],function(_0x59012c){return{'name':_0x59012c['fieldName'],'type':_0x59012c[_0xba98('0x2e')][_0xba98('0x2f')]};});_0x363e0b['model']=_[_0xba98('0x2b')](_0x5a75f7,_0xba98('0x28'));_0x363e0b[_0xba98('0x30')]=_['keys'](_0x275b52['query']);_0x363e0b[_0xba98('0x31')]=_['intersection'](_0x363e0b['model'],_0x363e0b[_0xba98('0x30')]);_0xb2109[_0xba98('0x32')]=_[_0xba98('0x33')](_0x363e0b[_0xba98('0x34')],qs[_0xba98('0x35')](_0x275b52['query'][_0xba98('0x35')]));_0xb2109['attributes']=_0xb2109[_0xba98('0x32')]['length']?_0xb2109[_0xba98('0x32')]:_0x363e0b[_0xba98('0x34')];if(!_0x275b52[_0xba98('0x30')]['hasOwnProperty'](_0xba98('0x36'))){_0xb2109[_0xba98('0x1d')]=qs['limit'](_0x275b52[_0xba98('0x30')][_0xba98('0x1d')]);_0xb2109[_0xba98('0x1b')]=qs[_0xba98('0x1b')](_0x275b52[_0xba98('0x30')][_0xba98('0x1b')]);}_0xb2109[_0xba98('0x37')]=qs['sort'](_0x275b52[_0xba98('0x30')][_0xba98('0x38')]);_0xb2109[_0xba98('0x39')]=qs[_0xba98('0x31')](_[_0xba98('0x3a')](_0x275b52[_0xba98('0x30')],_0x363e0b[_0xba98('0x31')]),_0x5a75f7);if(_0x275b52[_0xba98('0x30')]['filter']){_0xb2109[_0xba98('0x39')]=_[_0xba98('0x3b')](_0xb2109['where'],{'$or':_[_0xba98('0x2b')](_0x5a75f7,function(_0x2a60b0){if(_0x2a60b0[_0xba98('0x2e')]!==_0xba98('0x3c')){var _0x4bda0e={};_0x4bda0e[_0x2a60b0[_0xba98('0x28')]]={'$like':'%'+_0x275b52[_0xba98('0x30')][_0xba98('0x3d')]+'%'};return _0x4bda0e;}})});}_0xb2109=_[_0xba98('0x3b')]({},_0xb2109,_0x275b52[_0xba98('0x3e')]);var _0x18be67={'where':_0xb2109[_0xba98('0x39')]};return db[_0xba98('0x2c')]['count'](_0x18be67)['then'](function(_0x5c88de){_0x1b79d9[_0xba98('0x1e')]=_0x5c88de;if(_0x275b52[_0xba98('0x30')]['includeAll']){_0xb2109[_0xba98('0x3f')]=[{'all':!![]}];}return db[_0xba98('0x2c')][_0xba98('0x40')](_0xb2109);})['then'](function(_0x2d0efe){_0x1b79d9[_0xba98('0x41')]=_0x2d0efe;return _0x1b79d9;})[_0xba98('0x24')](respondWithFilteredResult(_0x420c15,_0xb2109))[_0xba98('0x42')](handleError(_0x420c15,null));};exports['show']=function(_0x5969df,_0x4067ca){var _0x365836={'raw':!![],'where':{'id':_0x5969df['params']['id']}},_0x181120={};_0x181120[_0xba98('0x34')]=_[_0xba98('0x43')](db[_0xba98('0x2c')][_0xba98('0x2d')]);_0x181120[_0xba98('0x30')]=_[_0xba98('0x43')](_0x5969df[_0xba98('0x30')]);_0x181120['filters']=_[_0xba98('0x33')](_0x181120[_0xba98('0x34')],_0x181120[_0xba98('0x30')]);_0x365836[_0xba98('0x32')]=_[_0xba98('0x33')](_0x181120['model'],qs[_0xba98('0x35')](_0x5969df[_0xba98('0x30')][_0xba98('0x35')]));_0x365836[_0xba98('0x32')]=_0x365836['attributes'][_0xba98('0x44')]?_0x365836[_0xba98('0x32')]:_0x181120[_0xba98('0x34')];if(_0x5969df[_0xba98('0x30')]['includeAll']){_0x365836[_0xba98('0x3f')]=[{'all':!![]}];}_0x365836=_[_0xba98('0x3b')]({},_0x365836,_0x5969df[_0xba98('0x3e')]);return db[_0xba98('0x2c')][_0xba98('0x45')](_0x365836)[_0xba98('0x24')](handleEntityNotFound(_0x4067ca,null))[_0xba98('0x24')](respondWithResult(_0x4067ca,null))[_0xba98('0x42')](handleError(_0x4067ca,null));};exports[_0xba98('0x46')]=function(_0x411554,_0x4560a2){var _0x5a8fba={'where':{'id':_0x411554[_0xba98('0x47')]['id']}},_0x53fc8c={};_0x53fc8c['model']=_['keys'](db['Attachment']['rawAttributes']);_0x5a8fba[_0xba98('0x32')]=_[_0xba98('0x33')](_0x53fc8c[_0xba98('0x34')],qs[_0xba98('0x35')](_0x411554[_0xba98('0x30')][_0xba98('0x35')]));_0x5a8fba[_0xba98('0x32')]=_0x5a8fba[_0xba98('0x32')][_0xba98('0x44')]?_0x5a8fba[_0xba98('0x32')]:_0x53fc8c[_0xba98('0x34')];if(_0x411554['query'][_0xba98('0x48')]){_0x5a8fba['include']=[{'all':!![]}];}_0x5a8fba=_[_0xba98('0x3b')]({},_0x5a8fba,_0x411554[_0xba98('0x3e')]);return db[_0xba98('0x2c')][_0xba98('0x45')](_0x5a8fba)[_0xba98('0x24')](handleEntityNotFound(_0x4560a2,null))['then'](function(_0x1e24ca){if(_0x1e24ca){var _0x1dea40=_0x1e24ca[_0xba98('0x49')]({'plain':!![]});_0x1dea40=qs[_0xba98('0x4a')](_0x1dea40,['id',_0xba98('0x4b'),_0xba98('0x4c')]);_0x411554[_0xba98('0x4d')]=_[_0xba98('0x4a')](_0x411554['body'],['id','createdAt','updatedAt']);return db[_0xba98('0x2c')][_0xba98('0x4e')](_[_0xba98('0x3b')](_0x1dea40,_0x411554['body']),{'include':_0x411554[_0xba98('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xba98('0x24')](respondWithResult(_0x4560a2,0xc9))['catch'](handleError(_0x4560a2,null));};exports['update']=function(_0x511f2d,_0x498de4){if(_0x511f2d[_0xba98('0x4d')]['id']){delete _0x511f2d[_0xba98('0x4d')]['id'];}return db['Attachment']['find']({'where':{'id':_0x511f2d['params']['id']}})['then'](handleEntityNotFound(_0x498de4,null))[_0xba98('0x24')](saveUpdates(_0x511f2d['body'],null))[_0xba98('0x24')](respondWithResult(_0x498de4,null))[_0xba98('0x42')](handleError(_0x498de4,null));};exports[_0xba98('0x25')]=function(_0x4b0014,_0x1b3504){return db[_0xba98('0x2c')][_0xba98('0x45')]({'where':{'id':_0x4b0014['params']['id']}})[_0xba98('0x24')](handleEntityNotFound(_0x1b3504,null))[_0xba98('0x24')](removeEntity(_0x1b3504,null))['catch'](handleError(_0x1b3504,null));};exports[_0xba98('0x4e')]=function(_0x13270a,_0x11ec71,_0x5ccfff){_0x13270a['body'][_0xba98('0x28')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x50')];_0x13270a[_0xba98('0x4d')][_0xba98('0x51')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x52')];_0x13270a[_0xba98('0x4d')][_0xba98('0x2e')]=_0x13270a[_0xba98('0x4f')][_0xba98('0x53')];return db[_0xba98('0x2c')][_0xba98('0x4e')](_0x13270a[_0xba98('0x4d')])['then'](respondWithResult(_0x11ec71,0xc9))['catch'](handleError(_0x11ec71,null));};exports[_0xba98('0x54')]=function(_0x15416a,_0xcbba73,_0x5adb83){return db[_0xba98('0x2c')][_0xba98('0x55')]({'where':{'id':_0x15416a[_0xba98('0x47')]['id']},'raw':!![]})[_0xba98('0x24')](handleEntityNotFound(_0xcbba73,null))[_0xba98('0x24')](function(_0x35a3ed){if(_0x35a3ed){var _0x4aa856=_0x35a3ed[_0xba98('0x56')]!==null;var _0x4ee806=path[_0xba98('0x57')](config[_0xba98('0x58')],'server/files/attachments/');if(_0x4aa856){_0x4ee806=path[_0xba98('0x57')](_0x4ee806,_0xba98('0x59'));}var _0x597823=path[_0xba98('0x57')](_0x4ee806,_0x35a3ed[_0xba98('0x51')]);return _0xcbba73['download'](_0x597823);}})['catch'](handleError(_0xcbba73,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index bb8c4c9..f40ea31 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 _0x089a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','attachments'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x089a,0x174));var _0xa089=function(_0x492707,_0x3e65dd){_0x492707=_0x492707-0x0;var _0x299c4d=_0x089a[_0x492707];return _0x299c4d;};'use strict';var _=require(_0xa089('0x0'));var util=require(_0xa089('0x1'));var logger=require(_0xa089('0x2'))('api');var moment=require(_0xa089('0x3'));var BPromise=require(_0xa089('0x4'));var rp=require(_0xa089('0x5'));var fs=require('fs');var path=require(_0xa089('0x6'));var rimraf=require('rimraf');var config=require(_0xa089('0x7'));var attributes=require(_0xa089('0x8'));module[_0xa089('0x9')]=function(_0x110ffa,_0x56cb50){return _0x110ffa[_0xa089('0xa')]('Attachment',attributes,{'tableName':_0xa089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab1b=['api','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments'];(function(_0x459d66,_0x57c91c){var _0x204a52=function(_0x5101a6){while(--_0x5101a6){_0x459d66['push'](_0x459d66['shift']());}};_0x204a52(++_0x57c91c);}(_0xab1b,0x70));var _0xbab1=function(_0x5a0311,_0xefddfc){_0x5a0311=_0x5a0311-0x0;var _0x16d47a=_0xab1b[_0x5a0311];return _0x16d47a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbab1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbab1('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbab1('0x2'));var config=require(_0xbab1('0x3'));var attributes=require(_0xbab1('0x4'));module[_0xbab1('0x5')]=function(_0xb2cad6,_0x1d7c6b){return _0xb2cad6[_0xbab1('0x6')]('Attachment',attributes,{'tableName':_0xbab1('0x7'),'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 6e28688..4f28650 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 _0xc964=['request\x20sent','stringify','error','Attachment,\x20%s,\x20%s','message','result','Attachment','create','body','options','raw','then','catch','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x268d8b,_0xde6a32){var _0x4ee10b=function(_0x10fd20){while(--_0x10fd20){_0x268d8b['push'](_0x268d8b['shift']());}};_0x4ee10b(++_0xde6a32);}(_0xc964,0x7e));var _0x4c96=function(_0x37c648,_0x3f1fe7){_0x37c648=_0x37c648-0x0;var _0x57fb7a=_0xc964[_0x37c648];return _0x57fb7a;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var moment=require('moment');var BPromise=require(_0x4c96('0x2'));var rs=require(_0x4c96('0x3'));var fs=require('fs');var Redis=require(_0x4c96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c96('0x5'));var logger=require('../../config/logger')(_0x4c96('0x6'));var config=require(_0x4c96('0x7'));var jayson=require(_0x4c96('0x8'));var client=jayson[_0x4c96('0x9')][_0x4c96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa8a0,_0x4070a5,_0x493618){return new BPromise(function(_0x19ed76,_0xaa3f20){return client[_0x4c96('0xb')](_0x1fa8a0,_0x493618)['then'](function(_0x208911){logger[_0x4c96('0xc')]('Attachment,\x20%s,\x20%s',_0x4070a5,'request\x20sent');logger['debug'](_0x4c96('0xd'),_0x4070a5,_0x4c96('0xe'),JSON[_0x4c96('0xf')](_0x208911));if(_0x208911['error']){if(_0x208911[_0x4c96('0x10')]['code']===0x1f4){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);return _0xaa3f20(_0x208911['error']['message']);}logger[_0x4c96('0x10')](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')]['message']);return _0x19ed76(_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);}else{logger[_0x4c96('0xc')](_0x4c96('0x11'),_0x4070a5,_0x4c96('0xe'));_0x19ed76(_0x208911[_0x4c96('0x13')][_0x4c96('0x12')]);}})['catch'](function(_0x388237){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x388237);_0xaa3f20(_0x388237);});});}exports['CreateAttachment']=function(_0x2453e0){var _0x494a26=this;return new Promise(function(_0x17891b,_0x1807b6){return db[_0x4c96('0x14')][_0x4c96('0x15')](_0x2453e0[_0x4c96('0x16')],{'raw':_0x2453e0[_0x4c96('0x17')]?_0x2453e0[_0x4c96('0x17')][_0x4c96('0x18')]===undefined?!![]:![]:!![]})[_0x4c96('0x19')](function(_0x9546c5){logger[_0x4c96('0xc')]('CreateAttachment',_0x2453e0);logger['debug']('CreateAttachment',_0x2453e0,JSON[_0x4c96('0xf')](_0x9546c5));_0x17891b(_0x9546c5);})[_0x4c96('0x1a')](function(_0x29f3a3){logger[_0x4c96('0x10')](_0x4c96('0x1b'),_0x29f3a3[_0x4c96('0x12')],_0x2453e0);_0x1807b6(_0x494a26['error'](0x1f4,_0x29f3a3[_0x4c96('0x12')]));});});};
\ No newline at end of file
+var _0x702d=['message','result','Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x2ff38f,_0xefceba){var _0x19a75f=function(_0x22c3b1){while(--_0x22c3b1){_0x2ff38f['push'](_0x2ff38f['shift']());}};_0x19a75f(++_0xefceba);}(_0x702d,0x147));var _0xd702=function(_0x53fb8a,_0x1cf6f8){_0x53fb8a=_0x53fb8a-0x0;var _0x2f0a6a=_0x702d[_0x53fb8a];return _0x2f0a6a;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});}exports['CreateAttachment']=function(_0x5b3b1d){var _0x2205de=this;return new Promise(function(_0x5a296e,_0x3fbcec){return db[_0xd702('0x17')][_0xd702('0x18')](_0x5b3b1d[_0xd702('0x19')],{'raw':_0x5b3b1d[_0xd702('0x1a')]?_0x5b3b1d[_0xd702('0x1a')][_0xd702('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4be140){logger['info'](_0xd702('0x1c'),_0x5b3b1d);logger[_0xd702('0x10')]('CreateAttachment',_0x5b3b1d,JSON[_0xd702('0x12')](_0x4be140));_0x5a296e(_0x4be140);})['catch'](function(_0xc4c246){logger['error']('CreateAttachment',_0xc4c246['message'],_0x5b3b1d);_0x3fbcec(_0x2205de[_0xd702('0x14')](0x1f4,_0xc4c246[_0xd702('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b2fa122..04c255a 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1622a0,_0x2b55a9){_0x1622a0=_0x1622a0-0x0;var _0x2a2308=_0x0b0e[_0x1622a0];return _0x2a2308;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5f2c50,_0x2fd64f){var _0x481961=function(_0x1ba1ee){while(--_0x1ba1ee){_0x5f2c50['push'](_0x5f2c50['shift']());}};_0x481961(++_0x2fd64f);}(_0xadb5,0xad));var _0x5adb=function(_0x1699d8,_0x24b741){_0x1699d8=_0x1699d8-0x0;var _0xf49e31=_0xadb5[_0x1699d8];return _0xf49e31;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index f24ac56..e4b7dd7 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 _0xd966=['blockedAt','online','admin','user','agent','then','getLicense','catch','status','send','login','ad-login','use','passport-local','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','url','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked'];(function(_0x4f0b31,_0x2ffd23){var _0x202c4f=function(_0x287fbb){while(--_0x287fbb){_0x4f0b31['push'](_0x4f0b31['shift']());}};_0x202c4f(++_0x2ffd23);}(_0xd966,0xad));var _0x6d96=function(_0x34365b,_0x418c5a){_0x34365b=_0x34365b-0x0;var _0x12d73a=_0xd966[_0x34365b];return _0x12d73a;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x6d96('0x0'))['Strategy'];var moment=require(_0x6d96('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x6d96('0x2'));var util=require('util');var db=require(_0x6d96('0x3'))['db'];var authService=require(_0x6d96('0x4'));var utils=require(_0x6d96('0x5'));var config=require(_0x6d96('0x6'));var logger=require(_0x6d96('0x7'))('api');function isActiveDirectoryConfigured(_0x198db2){var _0x49f13a=![];if(typeof _0x198db2['activedirectory']!==_0x6d96('0x8')){_0x49f13a=_0x198db2[_0x6d96('0x9')][_0x6d96('0xa')]&&_0x198db2['activedirectory'][_0x6d96('0xb')]&&_0x198db2[_0x6d96('0x9')][_0x6d96('0xc')];}return _0x49f13a;}function adAuthenticate(_0x5dcefc,_0x5da8e1,_0x144ba9){return new BPromise(function(_0x5dde43,_0x5e05ca){try{var _0x2d3ec4=new ActiveDirectory(_0x5dcefc);_0x2d3ec4[_0x6d96('0xd')](_0x5da8e1,_0x144ba9,function(_0xd90bf2,_0x4c7535){if(_0xd90bf2){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x5da8e1,util['inspect'](_0xd90bf2,{'showHidden':![],'depth':null}));_0x5e05ca('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4c7535){logger[_0x6d96('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5da8e1);_0x5e05ca(_0x6d96('0xf'));}else{_0x5dde43(_0x4c7535);}});}catch(_0x581ae8){_0x5e05ca(_0x581ae8);}});}function ActiveDirectoryAuthenticate(_0x3c4008,_0x487be5,_0x1f500f,_0x3f7509){var _0x18b257,_0x189cb2;if(!isActiveDirectoryConfigured(config)){logger[_0x6d96('0xe')](_0x6d96('0x10'),_0x487be5);return _0x3f7509(null,![],{'message':_0x6d96('0xf')});}return db[_0x6d96('0x11')][_0x6d96('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x6d96('0x13')],'raw':!![]})['then'](function(_0x2fe330){_0x18b257=_0x2fe330;if(!_0x18b257[_0x6d96('0x14')]){logger['error'](_0x6d96('0x15'),_0x487be5);throw new Error(_0x6d96('0xf'));}return _0x3c4008['findOne']({'attributes':['id',_0x6d96('0x16'),_0x6d96('0x17'),'salt',_0x6d96('0x18'),_0x6d96('0x19'),_0x6d96('0x1a'),_0x6d96('0x1b'),_0x6d96('0x1c')],'where':{'name':_0x487be5,'role':{'$or':[_0x6d96('0x1d'),_0x6d96('0x1e'),_0x6d96('0x1f')]},'adSsoEnabled':!![]}});})[_0x6d96('0x20')](function(_0x1662f1){if(!_0x1662f1||_0x1662f1&&_0x1662f1[_0x6d96('0x16')]!==_0x487be5){throw new Error(_0x6d96('0xf'));}_0x189cb2=_0x1662f1;var _0x243b1d=_0x189cb2['name']+'@'+config[_0x6d96('0x9')][_0x6d96('0xc')];return adAuthenticate(config[_0x6d96('0x9')],_0x243b1d,_0x1f500f);})[_0x6d96('0x20')](function(_0x59f267){if(_0x189cb2['disabled']){throw new Error(_0x6d96('0xf'));}if(_0x18b257['blockDuration']>0x0){if(_0x189cb2[_0x6d96('0x1a')]){if(moment(_0x189cb2[_0x6d96('0x1b')])['add'](_0x18b257[_0x6d96('0x13')],'minutes')>moment()){throw new Error(_0x6d96('0xf'));}return utils['clearBlockUser'](_0x189cb2,0x0,![],null)['then'](function(){return utils['getLicense'](_0x189cb2);})['then'](function(){return _0x3f7509(null,_0x189cb2);});}else{return utils[_0x6d96('0x21')](_0x189cb2)[_0x6d96('0x20')](function(){return _0x3f7509(null,_0x189cb2);});}}else{return utils[_0x6d96('0x21')](_0x189cb2)[_0x6d96('0x20')](function(){return _0x3f7509(null,_0x189cb2);});}})[_0x6d96('0x22')](function(_0x9ceac7){return _0x3f7509(null,![],_0x9ceac7);});}function handleError(_0x1c299f,_0x2849e7,_0x3d36ca){return _0x1c299f[_0x6d96('0x23')](_0x2849e7||0x1f4)[_0x6d96('0x24')]({'message':_0x3d36ca?_0x3d36ca['message']||_0x3d36ca:''});}exports[_0x6d96('0x25')]=function(_0x2d8ae1,_0x4ebbed,_0x5500bf){passport['authenticate'](_0x6d96('0x26'),function(_0x48c9ce,_0x163a65,_0x5aacda){var _0x1e226d=_0x48c9ce||_0x5aacda;if(_0x1e226d){return handleError(_0x4ebbed,0x191,_0x1e226d);}if(!_0x163a65){return handleError(_0x4ebbed,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x414ec9={'payload':{'id':_0x163a65['id'],'role':_0x163a65['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x414ec9)['then'](function(_0x1a85c3){_0x4ebbed['json']({'id':_0x163a65['id'],'token':_0x1a85c3,'statusCall':'','isAlreadyLogged':_0x163a65[_0x6d96('0x1c')]});});}})(_0x2d8ae1,_0x4ebbed,_0x5500bf);};passport[_0x6d96('0x27')](_0x6d96('0x26'),new LocalStrategy({'usernameField':'name','passwordField':_0x6d96('0x17')},function(_0x193a56,_0x19a511,_0x423f82){return ActiveDirectoryAuthenticate(db['User'],_0x193a56,_0x19a511,_0x423f82);}));
\ No newline at end of file
+var _0xc24f=['online','admin','user','domain','blocked','blockedAt','clearBlockUser','getLicense','catch','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport-local','Strategy','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','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','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled'];(function(_0x4da69c,_0x12eb04){var _0x5ac5d5=function(_0x1b4947){while(--_0x1b4947){_0x4da69c['push'](_0x4da69c['shift']());}};_0x5ac5d5(++_0x12eb04);}(_0xc24f,0x70));var _0xfc24=function(_0x582fde,_0xd38326){_0x582fde=_0x582fde-0x0;var _0x15d99d=_0xc24f[_0x582fde];return _0x15d99d;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xfc24('0x0'))[_0xfc24('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xfc24('0x2'));var util=require(_0xfc24('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xfc24('0x4'));var utils=require('../../config/utils');var config=require(_0xfc24('0x5'));var logger=require(_0xfc24('0x6'))(_0xfc24('0x7'));function isActiveDirectoryConfigured(_0x4116af){var _0xe3036d=![];if(typeof _0x4116af[_0xfc24('0x8')]!==_0xfc24('0x9')){_0xe3036d=_0x4116af[_0xfc24('0x8')][_0xfc24('0xa')]&&_0x4116af['activedirectory'][_0xfc24('0xb')]&&_0x4116af[_0xfc24('0x8')]['domain'];}return _0xe3036d;}function adAuthenticate(_0x2bb60a,_0x3b52d0,_0xf078b4){return new BPromise(function(_0x448efd,_0x477a58){try{var _0x2b3400=new ActiveDirectory(_0x2bb60a);_0x2b3400['authenticate'](_0x3b52d0,_0xf078b4,function(_0x181a92,_0x45bd13){if(_0x181a92){logger[_0xfc24('0xc')](_0xfc24('0xd'),_0x3b52d0,util[_0xfc24('0xe')](_0x181a92,{'showHidden':![],'depth':null}));_0x477a58(_0xfc24('0xf'));}else if(!_0x45bd13){logger[_0xfc24('0xc')](_0xfc24('0x10'),_0x3b52d0);_0x477a58(_0xfc24('0xf'));}else{_0x448efd(_0x45bd13);}});}catch(_0x5c1f0c){_0x477a58(_0x5c1f0c);}});}function ActiveDirectoryAuthenticate(_0x50ae6c,_0x244740,_0xa3b09c,_0x4cf401){var _0x173744,_0x13571c;if(!isActiveDirectoryConfigured(config)){logger[_0xfc24('0xc')](_0xfc24('0x11'),_0x244740);return _0x4cf401(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xfc24('0x12')][_0xfc24('0x13')]({'where':{'id':0x1},'attributes':[_0xfc24('0x14'),_0xfc24('0x15')],'raw':!![]})[_0xfc24('0x16')](function(_0x1a02c1){_0x173744=_0x1a02c1;if(!_0x173744[_0xfc24('0x14')]){logger[_0xfc24('0xc')](_0xfc24('0x17'),_0x244740);throw new Error(_0xfc24('0xf'));}return _0x50ae6c[_0xfc24('0x13')]({'attributes':['id',_0xfc24('0x18'),_0xfc24('0x19'),_0xfc24('0x1a'),_0xfc24('0x1b'),_0xfc24('0x1c'),'blocked','blockedAt',_0xfc24('0x1d')],'where':{'name':_0x244740,'role':{'$or':[_0xfc24('0x1e'),_0xfc24('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xfc24('0x16')](function(_0x14ab90){if(!_0x14ab90||_0x14ab90&&_0x14ab90[_0xfc24('0x18')]!==_0x244740){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x13571c=_0x14ab90;var _0x24883=_0x13571c['name']+'@'+config[_0xfc24('0x8')][_0xfc24('0x20')];return adAuthenticate(config['activedirectory'],_0x24883,_0xa3b09c);})[_0xfc24('0x16')](function(_0xde8a15){if(_0x13571c[_0xfc24('0x1c')]){throw new Error(_0xfc24('0xf'));}if(_0x173744[_0xfc24('0x15')]>0x0){if(_0x13571c[_0xfc24('0x21')]){if(moment(_0x13571c[_0xfc24('0x22')])['add'](_0x173744[_0xfc24('0x15')],'minutes')>moment()){throw new Error(_0xfc24('0xf'));}return utils[_0xfc24('0x23')](_0x13571c,0x0,![],null)['then'](function(){return utils[_0xfc24('0x24')](_0x13571c);})['then'](function(){return _0x4cf401(null,_0x13571c);});}else{return utils[_0xfc24('0x24')](_0x13571c)[_0xfc24('0x16')](function(){return _0x4cf401(null,_0x13571c);});}}else{return utils[_0xfc24('0x24')](_0x13571c)['then'](function(){return _0x4cf401(null,_0x13571c);});}})[_0xfc24('0x25')](function(_0x25ebdf){return _0x4cf401(null,![],_0x25ebdf);});}function handleError(_0x50ea6f,_0x293a9f,_0xbd6e8d){return _0x50ea6f['status'](_0x293a9f||0x1f4)['send']({'message':_0xbd6e8d?_0xbd6e8d[_0xfc24('0x26')]||_0xbd6e8d:''});}exports[_0xfc24('0x27')]=function(_0x258385,_0x23e9a0,_0x50286e){passport[_0xfc24('0x28')]('ad-login',function(_0x530a2b,_0x2161b0,_0x4cd2a6){var _0x7c184e=_0x530a2b||_0x4cd2a6;if(_0x7c184e){return handleError(_0x23e9a0,0x191,_0x7c184e);}if(!_0x2161b0){return handleError(_0x23e9a0,0x194,{'message':_0xfc24('0x29')});}else{var _0x2b7ae8={'payload':{'id':_0x2161b0['id'],'role':_0x2161b0['role']},'options':{'expiresIn':0x15180}};return authService[_0xfc24('0x2a')](_0x2b7ae8)[_0xfc24('0x16')](function(_0x44c402){_0x23e9a0[_0xfc24('0x2b')]({'id':_0x2161b0['id'],'token':_0x44c402,'statusCall':'','isAlreadyLogged':_0x2161b0[_0xfc24('0x1d')]});});}})(_0x258385,_0x23e9a0,_0x50286e);};passport[_0xfc24('0x2c')](_0xfc24('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0xfc24('0x19')},function(_0x4d3ddf,_0x2d8efe,_0x17ed63){return ActiveDirectoryAuthenticate(db[_0xfc24('0x2e')],_0x4d3ddf,_0x2d8efe,_0x17ed63);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 4e16ed0..869b579 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 _0x109c=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x1b6e9c,_0xb7dc58){var _0x101b7c=function(_0xaa159c){while(--_0xaa159c){_0x1b6e9c['push'](_0x1b6e9c['shift']());}};_0x101b7c(++_0xb7dc58);}(_0x109c,0xda));var _0xc109=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x109c[_0x397e5f];return _0x5302b8;};'use strict';var express=require('express');var router=express[_0xc109('0x0')]();var controller=require(_0xc109('0x1'));router[_0xc109('0x2')]('/',controller[_0xc109('0x3')]);module[_0xc109('0x4')]=router;
\ No newline at end of file
+var _0xd8bf=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x120279,_0xb71cb0){var _0x22b763=function(_0x1442c8){while(--_0x1442c8){_0x120279['push'](_0x120279['shift']());}};_0x22b763(++_0xb71cb0);}(_0xd8bf,0x157));var _0xfd8b=function(_0x143550,_0x441332){_0x143550=_0x143550-0x0;var _0x4d54ee=_0xd8bf[_0x143550];return _0x4d54ee;};'use strict';var express=require(_0xfd8b('0x0'));var router=express[_0xfd8b('0x1')]();var controller=require(_0xfd8b('0x2'));router[_0xfd8b('0x3')]('/',controller[_0xfd8b('0x4')]);module[_0xfd8b('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 49d7662..7901cd3 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x411e96,_0x3f7c9a){var _0x87b13c=function(_0x3f1421){while(--_0x3f1421){_0x411e96['push'](_0x411e96['shift']());}};_0x87b13c(++_0x3f7c9a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4099d4,_0x38671e){var _0x4171b1=function(_0x34209d){while(--_0x34209d){_0x4099d4['push'](_0x4099d4['shift']());}};_0x4171b1(++_0x38671e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 126b3a2..4c837fb 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 _0xae1c=['isMiddleware','setTokenCookie','exports','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x374a2c,_0x4563cc){var _0x2811a2=function(_0x182761){while(--_0x182761){_0x374a2c['push'](_0x374a2c['shift']());}};_0x2811a2(++_0x4563cc);}(_0xae1c,0xff));var _0xcae1=function(_0x18fbcc,_0x3a3020){_0x18fbcc=_0x18fbcc-0x0;var _0x609604=_0xae1c[_0x18fbcc];return _0x609604;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xcae1('0x0'));var authService=require(_0xcae1('0x1'));router[_0xcae1('0x2')]('/',controller[_0xcae1('0x3')]);router[_0xcae1('0x2')](_0xcae1('0x4'),controller[_0xcae1('0x5')],authService[_0xcae1('0x6')],userController[_0xcae1('0x3')],authService[_0xcae1('0x7')]);module[_0xcae1('0x8')]=router;
\ No newline at end of file
+var _0x217a=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','express','passport'];(function(_0x369995,_0x4a0694){var _0x12d55b=function(_0x3062ef){while(--_0x3062ef){_0x369995['push'](_0x369995['shift']());}};_0x12d55b(++_0x4a0694);}(_0x217a,0x1ac));var _0xa217=function(_0x26e2aa,_0x1bc233){_0x26e2aa=_0x26e2aa-0x0;var _0x1a8813=_0x217a[_0x26e2aa];return _0x1a8813;};'use strict';var express=require(_0xa217('0x0'));var passport=require(_0xa217('0x1'));var router=express[_0xa217('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xa217('0x3'));var authService=require(_0xa217('0x4'));router[_0xa217('0x5')]('/',controller[_0xa217('0x6')]);router[_0xa217('0x5')](_0xa217('0x7'),controller[_0xa217('0x8')],authService['isMiddleware'],userController[_0xa217('0x6')],authService[_0xa217('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 97f048a..d41bf8f 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 _0xc11c=['previousPasswords','Password\x20reset!','use','local-login','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','user','agent','then','authenticate','loginAttempts','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password'];(function(_0x5e499f,_0x46daa9){var _0x5995b1=function(_0x54f226){while(--_0x54f226){_0x5e499f['push'](_0x5e499f['shift']());}};_0x5995b1(++_0x46daa9);}(_0xc11c,0x144));var _0xcc11=function(_0x42777b,_0x29d3fb){_0x42777b=_0x42777b-0x0;var _0x2fb268=_0xc11c[_0x42777b];return _0x2fb268;};'use strict';var util=require('util');var passport=require(_0xcc11('0x0'));var LocalStrategy=require(_0xcc11('0x1'))[_0xcc11('0x2')];var jayson=require(_0xcc11('0x3'));var _=require('lodash');var rs=require(_0xcc11('0x4'));var moment=require(_0xcc11('0x5'));var db=require(_0xcc11('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcc11('0x7'));var client=jayson[_0xcc11('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1b4110,_0xe54839,_0x5108b7,_0x54104e){var _0x5a1be7,_0x161fa9;return db[_0xcc11('0x9')][_0xcc11('0xa')]({'where':{'id':0x1},'attributes':[_0xcc11('0xb'),_0xcc11('0xc')],'raw':!![]})['then'](function(_0x343145){_0x5a1be7=_0x343145;return _0x1b4110[_0xcc11('0xa')]({'attributes':['id',_0xcc11('0xd'),'password','salt',_0xcc11('0xe'),_0xcc11('0xf'),_0xcc11('0x10'),_0xcc11('0x11'),'loginAttempts'],'where':{'name':_0xe54839,'role':{'$or':['admin',_0xcc11('0x12'),_0xcc11('0x13')]}}});})[_0xcc11('0x14')](function(_0x391930){if(!_0x391930||_0x391930&&_0x391930['name']!==_0xe54839){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x161fa9=_0x391930;return _0x161fa9;}})['then'](function(){_0x161fa9[_0xcc11('0x15')](_0x5108b7,function(_0x5a3d23,_0x5522ca){var _0x325b4b=_0x161fa9[_0xcc11('0x16')]+0x1;if(_0x5a3d23){return _0x54104e(_0x5a3d23);}else if(!_0x5522ca){if(_0x161fa9[_0xcc11('0xf')]){return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5a1be7[_0xcc11('0xb')]>0x0){if(_0x161fa9['blocked']){if(_0x5a1be7[_0xcc11('0xc')]>0x0){if(moment(_0x161fa9[_0xcc11('0x11')])[_0xcc11('0x17')](_0x5a1be7['blockDuration'],'minutes')>moment()){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x19')](_0x161fa9,_0x325b4b,![],null)['then'](function(){return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x54104e(null,![],{'message':_0xcc11('0x18')});}}else{if(_0x325b4b>=_0x5a1be7[_0xcc11('0xb')]){return utils[_0xcc11('0x19')](_0x161fa9,0x0,!![],moment())[_0xcc11('0x14')](function(){return _0x54104e(null,![],{'message':_0xcc11('0x18')});});}else{return utils[_0xcc11('0x19')](_0x161fa9,_0x325b4b,![],null)[_0xcc11('0x14')](function(){return _0x54104e(null,![],{'message':_0xcc11('0x18')});});}}}else{return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x161fa9[_0xcc11('0xf')]){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else if(_0x5a1be7[_0xcc11('0xb')]>0x0){if(_0x161fa9[_0xcc11('0x10')]){if(_0x5a1be7[_0xcc11('0xc')]>0x0){if(moment(_0x161fa9[_0xcc11('0x11')])[_0xcc11('0x17')](_0x5a1be7[_0xcc11('0xc')],_0xcc11('0x1a'))>moment()){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x19')](_0x161fa9,0x0,![],null)['then'](function(){return utils[_0xcc11('0x1b')](_0x161fa9);})[_0xcc11('0x14')](function(){return _0x54104e(null,_0x161fa9);});}}else{return _0x54104e(null,![],{'message':_0xcc11('0x18')});}}else{return utils[_0xcc11('0x19')](_0x161fa9,0x0,![],null)[_0xcc11('0x14')](function(){return utils[_0xcc11('0x1b')](_0x161fa9);})[_0xcc11('0x14')](function(){return _0x54104e(null,_0x161fa9);})[_0xcc11('0x1c')](function(_0x9230ab){return _0x54104e(null,![],_0x9230ab);});}}else{if(_0x161fa9[_0xcc11('0x10')]){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x1b')](_0x161fa9)['then'](function(){return _0x54104e(null,_0x161fa9);});}}}});})[_0xcc11('0x1c')](function(_0x4231f3){return _0x54104e(null,![],_0x4231f3);});}function sendServiceMail(_0x20f14b){return db['MailAccount'][_0xcc11('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xcc11('0xd'),_0xcc11('0x1e')],'include':[{'model':db[_0xcc11('0x1f')],'as':_0xcc11('0x20'),'include':[{'model':db[_0xcc11('0x21')],'as':_0xcc11('0x21')}]}]})[_0xcc11('0x14')](function(_0x3887f4){if(!_0x3887f4){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5e8109=_0x3887f4['getSmtpOptions']();var _0x177622={'account':_0x5e8109,'message':_['merge']({'from':util[_0xcc11('0x22')](_0xcc11('0x23'),_0x3887f4[_0xcc11('0xd')],_0x3887f4[_0xcc11('0x1e')]||_0x3887f4['Smtp'][_0xcc11('0x12')])},_0x20f14b)};return client[_0xcc11('0x24')](_0xcc11('0x25'),_0x177622);})['then'](function(_0x43fa93){if(_0x43fa93[_0xcc11('0x26')]){throw new Error(util[_0xcc11('0x22')](_0xcc11('0x27'),_0x43fa93[_0xcc11('0x26')][_0xcc11('0x28')]||JSON[_0xcc11('0x29')](_0x43fa93[_0xcc11('0x26')])));}return!![];});}function handleError(_0x162a5b,_0x3eb20c,_0x2fe433){return _0x162a5b['status'](_0x3eb20c||0x1f4)['send']({'message':_0x2fe433?_0x2fe433['message']||_0x2fe433:''});}exports['login']=function(_0x2fd5ce,_0x24fa0d,_0x5a3f0e){passport[_0xcc11('0x15')]('local-login',function(_0x4d67c6,_0x965ace,_0x49750c){var _0x212f99=_0x4d67c6||_0x49750c;if(_0x212f99){return handleError(_0x24fa0d,0x191,_0x212f99);}if(!_0x965ace){return handleError(_0x24fa0d,0x194,{'message':_0xcc11('0x2a')});}else{var _0x599301={'payload':{'id':_0x965ace['id'],'role':_0x965ace[_0xcc11('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xcc11('0x2b')](_0x599301)[_0xcc11('0x14')](function(_0x206412){_0x24fa0d[_0xcc11('0x2c')]({'id':_0x965ace['id'],'token':_0x206412,'statusCall':'','isAlreadyLogged':_0x965ace[_0xcc11('0x2d')]});});}})(_0x2fd5ce,_0x24fa0d,_0x5a3f0e);};exports[_0xcc11('0x2e')]=function(_0x37fc3d,_0x3bb5d6){if(!_0x37fc3d['body'][_0xcc11('0x1e')]){return handleError(_0x3bb5d6,0x1f4,{'message':_0xcc11('0x2f')});}var _0x32d345=rs['generate']();_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')]=_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')][_0xcc11('0x31')]()['toLowerCase']();var _0x991037;return db['Setting'][_0xcc11('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xcc11('0x14')](function(_0x8e50dc){_0x991037=_0x8e50dc;return db[_0xcc11('0x32')][_0xcc11('0x1d')]({'where':{'email':_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')]}});})[_0xcc11('0x14')](function(_0x7ddce3){if(!_0x7ddce3){throw new Error(_0xcc11('0x33'));}if(_0x7ddce3[_0xcc11('0xf')]){throw new Error(_0xcc11('0x34'));}if(_0x7ddce3['blocked']){if(moment(_0x7ddce3['blockedAt'])['add'](_0x991037[_0xcc11('0xc')],_0xcc11('0x1a'))>moment()){throw new Error(_0xcc11('0x35'));}else{_0x7ddce3[_0xcc11('0x10')]=![];_0x7ddce3[_0xcc11('0x11')]=null;}}_0x7ddce3[_0xcc11('0x36')]=_0x32d345;_0x7ddce3[_0xcc11('0x37')]=Date[_0xcc11('0x38')]()+0x36ee80;return _0x7ddce3[_0xcc11('0x39')]();})[_0xcc11('0x14')](function(){return sendServiceMail({'to':_0x37fc3d[_0xcc11('0x30')]['email'],'subject':_0xcc11('0x3a'),'text':_0xcc11('0x3b')+_0xcc11('0x3c')+_0xcc11('0x3d')+_0x37fc3d[_0xcc11('0x3e')][_0xcc11('0x3f')]+_0xcc11('0x40')+_0x32d345+'\x0a\x0a'+_0xcc11('0x41')});})[_0xcc11('0x14')](function(){_0x3bb5d6[_0xcc11('0x42')](0xc8)[_0xcc11('0x43')]({'message':_0xcc11('0x44')});})[_0xcc11('0x1c')](function(_0x5efd70){return handleError(_0x3bb5d6,0x1f4,_0x5efd70);});};exports['reset']=function(_0x14bed9,_0x49b6e3){return db[_0xcc11('0x32')]['find']({'where':{'resetPasswordToken':_0x14bed9['params'][_0xcc11('0x45')],'resetPasswordExpires':{'$gt':Date[_0xcc11('0x38')]()}}})[_0xcc11('0x14')](function(_0x7669be){if(!_0x7669be){throw new Error(_0xcc11('0x46'));}return db[_0xcc11('0x9')][_0xcc11('0xa')]({'attributes':['id',_0xcc11('0x47'),_0xcc11('0x48'),_0xcc11('0x49')]})[_0xcc11('0x14')](function(_0x41f0f3){if(_0x41f0f3[_0xcc11('0x47')])authService[_0xcc11('0x4a')](_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')]);if(!_0x41f0f3[_0xcc11('0x48')]||!_0x7669be[_0xcc11('0x4c')])return _0x7669be;authService['validatePasswordHistory'](_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')],_0x7669be['previousPasswords'],_0x41f0f3['passwordHistoryLimit']);return _0x7669be;})[_0xcc11('0x14')](function(){_0x7669be[_0xcc11('0x4b')]=_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')];_0x7669be[_0xcc11('0x36')]=null;_0x7669be[_0xcc11('0x37')]=null;return _0x7669be['save']();});})[_0xcc11('0x14')](function(){_0x49b6e3[_0xcc11('0x42')](0xc8)[_0xcc11('0x43')]({'message':_0xcc11('0x4d')});})[_0xcc11('0x1c')](function(_0x205473){return handleError(_0x49b6e3,0x1f4,_0x205473);});};passport[_0xcc11('0x4e')](_0xcc11('0x4f'),new LocalStrategy({'usernameField':_0xcc11('0xd'),'passwordField':_0xcc11('0x4b')},function(_0x139688,_0x2cbd3a,_0x289916){return localAuthenticate(db[_0xcc11('0x32')],_0x139688,_0x2cbd3a,_0x289916);}));
\ No newline at end of file
+var _0x1fb5=['catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','local-login','passport','passport-local','Strategy','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense'];(function(_0x29c8e5,_0x16823c){var _0x59d791=function(_0x4fc51e){while(--_0x4fc51e){_0x29c8e5['push'](_0x29c8e5['shift']());}};_0x59d791(++_0x16823c);}(_0x1fb5,0x126));var _0x51fb=function(_0x5a5536,_0x57a88c){_0x5a5536=_0x5a5536-0x0;var _0x3c82aa=_0x1fb5[_0x5a5536];return _0x3c82aa;};'use strict';var util=require('util');var passport=require(_0x51fb('0x0'));var LocalStrategy=require(_0x51fb('0x1'))[_0x51fb('0x2')];var jayson=require(_0x51fb('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x51fb('0x4'))['db'];var authService=require(_0x51fb('0x5'));var utils=require(_0x51fb('0x6'));var client=jayson[_0x51fb('0x7')][_0x51fb('0x8')]({'port':0x232b});function localAuthenticate(_0x46bb3c,_0x1f2b3a,_0x2a7486,_0x5305c4){var _0x2e5054,_0x2dcd4c;return db[_0x51fb('0x9')][_0x51fb('0xa')]({'where':{'id':0x1},'attributes':[_0x51fb('0xb'),_0x51fb('0xc')],'raw':!![]})[_0x51fb('0xd')](function(_0x128467){_0x2e5054=_0x128467;return _0x46bb3c[_0x51fb('0xa')]({'attributes':['id',_0x51fb('0xe'),_0x51fb('0xf'),_0x51fb('0x10'),_0x51fb('0x11'),_0x51fb('0x12'),_0x51fb('0x13'),_0x51fb('0x14'),_0x51fb('0x15')],'where':{'name':_0x1f2b3a,'role':{'$or':['admin',_0x51fb('0x16'),_0x51fb('0x17')]}}});})['then'](function(_0x3aeaa8){if(!_0x3aeaa8||_0x3aeaa8&&_0x3aeaa8[_0x51fb('0xe')]!==_0x1f2b3a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2dcd4c=_0x3aeaa8;return _0x2dcd4c;}})['then'](function(){_0x2dcd4c[_0x51fb('0x18')](_0x2a7486,function(_0x8a7b4b,_0x56d04e){var _0x13dacd=_0x2dcd4c[_0x51fb('0x15')]+0x1;if(_0x8a7b4b){return _0x5305c4(_0x8a7b4b);}else if(!_0x56d04e){if(_0x2dcd4c[_0x51fb('0x12')]){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else if(_0x2e5054[_0x51fb('0xb')]>0x0){if(_0x2dcd4c['blocked']){if(_0x2e5054['blockDuration']>0x0){if(moment(_0x2dcd4c[_0x51fb('0x14')])[_0x51fb('0x1a')](_0x2e5054[_0x51fb('0xc')],_0x51fb('0x1b'))>moment()){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,_0x13dacd,![],null)[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}}else{return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}}else{if(_0x13dacd>=_0x2e5054[_0x51fb('0xb')]){return utils['clearBlockUser'](_0x2dcd4c,0x0,!![],moment())[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,_0x13dacd,![],null)[_0x51fb('0xd')](function(){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});});}}}else{return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2dcd4c[_0x51fb('0x12')]){return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}else if(_0x2e5054[_0x51fb('0xb')]>0x0){if(_0x2dcd4c[_0x51fb('0x13')]){if(_0x2e5054['blockDuration']>0x0){if(moment(_0x2dcd4c['blockedAt'])[_0x51fb('0x1a')](_0x2e5054[_0x51fb('0xc')],'minutes')>moment()){return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,0x0,![],null)['then'](function(){return utils[_0x51fb('0x1d')](_0x2dcd4c);})['then'](function(){return _0x5305c4(null,_0x2dcd4c);});}}else{return _0x5305c4(null,![],{'message':_0x51fb('0x19')});}}else{return utils[_0x51fb('0x1c')](_0x2dcd4c,0x0,![],null)[_0x51fb('0xd')](function(){return utils[_0x51fb('0x1d')](_0x2dcd4c);})[_0x51fb('0xd')](function(){return _0x5305c4(null,_0x2dcd4c);})[_0x51fb('0x1e')](function(_0xb7732d){return _0x5305c4(null,![],_0xb7732d);});}}else{if(_0x2dcd4c[_0x51fb('0x13')]){return _0x5305c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2dcd4c)[_0x51fb('0xd')](function(){return _0x5305c4(null,_0x2dcd4c);});}}}});})[_0x51fb('0x1e')](function(_0x452616){return _0x5305c4(null,![],_0x452616);});}function sendServiceMail(_0x74ff5c){return db['MailAccount'][_0x51fb('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x51fb('0xe'),_0x51fb('0x20')],'include':[{'model':db[_0x51fb('0x21')],'as':'Smtp','include':[{'model':db[_0x51fb('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x309e1a){if(!_0x309e1a){throw new Error(_0x51fb('0x23'));}var _0x4726e7=_0x309e1a[_0x51fb('0x24')]();var _0x2303cc={'account':_0x4726e7,'message':_[_0x51fb('0x25')]({'from':util[_0x51fb('0x26')](_0x51fb('0x27'),_0x309e1a['name'],_0x309e1a['email']||_0x309e1a[_0x51fb('0x28')][_0x51fb('0x16')])},_0x74ff5c)};return client['request'](_0x51fb('0x29'),_0x2303cc);})[_0x51fb('0xd')](function(_0x4f431b){if(_0x4f431b['error']){throw new Error(util[_0x51fb('0x26')](_0x51fb('0x2a'),_0x4f431b[_0x51fb('0x2b')][_0x51fb('0x2c')]||JSON[_0x51fb('0x2d')](_0x4f431b['error'])));}return!![];});}function handleError(_0x53fd6b,_0x23fe02,_0x49a446){return _0x53fd6b[_0x51fb('0x2e')](_0x23fe02||0x1f4)['send']({'message':_0x49a446?_0x49a446['message']||_0x49a446:''});}exports[_0x51fb('0x2f')]=function(_0x4284ae,_0x459042,_0x6e2118){passport[_0x51fb('0x18')]('local-login',function(_0x5e2e52,_0x2ebb94,_0x523ab6){var _0x5d9c16=_0x5e2e52||_0x523ab6;if(_0x5d9c16){return handleError(_0x459042,0x191,_0x5d9c16);}if(!_0x2ebb94){return handleError(_0x459042,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x250f31={'payload':{'id':_0x2ebb94['id'],'role':_0x2ebb94['role']},'options':{'expiresIn':0x15180}};return authService[_0x51fb('0x30')](_0x250f31)['then'](function(_0x18ae39){_0x459042[_0x51fb('0x31')]({'id':_0x2ebb94['id'],'token':_0x18ae39,'statusCall':'','isAlreadyLogged':_0x2ebb94[_0x51fb('0x32')]});});}})(_0x4284ae,_0x459042,_0x6e2118);};exports['forgot']=function(_0x31ec91,_0x59f39e){if(!_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')]){return handleError(_0x59f39e,0x1f4,{'message':_0x51fb('0x34')});}var _0x519aae=rs['generate']();_0x31ec91['body']['email']=_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')][_0x51fb('0x35')]()[_0x51fb('0x36')]();var _0x16f069;return db['Setting'][_0x51fb('0xa')]({'where':{'id':0x1},'attributes':[_0x51fb('0xb'),_0x51fb('0xc')],'raw':!![]})['then'](function(_0x86377d){_0x16f069=_0x86377d;return db['User'][_0x51fb('0x1f')]({'where':{'email':_0x31ec91[_0x51fb('0x33')][_0x51fb('0x20')]}});})[_0x51fb('0xd')](function(_0x5ddaf8){if(!_0x5ddaf8){throw new Error(_0x51fb('0x37'));}if(_0x5ddaf8[_0x51fb('0x12')]){throw new Error(_0x51fb('0x38'));}if(_0x5ddaf8['blocked']){if(moment(_0x5ddaf8[_0x51fb('0x14')])[_0x51fb('0x1a')](_0x16f069[_0x51fb('0xc')],_0x51fb('0x1b'))>moment()){throw new Error(_0x51fb('0x39'));}else{_0x5ddaf8[_0x51fb('0x13')]=![];_0x5ddaf8[_0x51fb('0x14')]=null;}}_0x5ddaf8['resetPasswordToken']=_0x519aae;_0x5ddaf8['resetPasswordExpires']=Date[_0x51fb('0x3a')]()+0x36ee80;return _0x5ddaf8['save']();})[_0x51fb('0xd')](function(){return sendServiceMail({'to':_0x31ec91['body'][_0x51fb('0x20')],'subject':_0x51fb('0x3b'),'text':_0x51fb('0x3c')+_0x51fb('0x3d')+_0x51fb('0x3e')+_0x31ec91[_0x51fb('0x3f')][_0x51fb('0x40')]+_0x51fb('0x41')+_0x519aae+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x51fb('0xd')](function(){_0x59f39e[_0x51fb('0x2e')](0xc8)['send']({'message':_0x51fb('0x42')});})[_0x51fb('0x1e')](function(_0xb2bea3){return handleError(_0x59f39e,0x1f4,_0xb2bea3);});};exports[_0x51fb('0x43')]=function(_0x429bc8,_0x2635ed){return db[_0x51fb('0x44')][_0x51fb('0x1f')]({'where':{'resetPasswordToken':_0x429bc8['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x51fb('0x3a')]()}}})[_0x51fb('0xd')](function(_0x23ef2b){if(!_0x23ef2b){throw new Error(_0x51fb('0x45'));}return db[_0x51fb('0x9')][_0x51fb('0xa')]({'attributes':['id',_0x51fb('0x46'),_0x51fb('0x47'),_0x51fb('0x48')]})[_0x51fb('0xd')](function(_0x319a26){if(_0x319a26['securePassword'])authService[_0x51fb('0x49')](_0x429bc8['body'][_0x51fb('0xf')]);if(!_0x319a26['enforcePasswordHistory']||!_0x23ef2b[_0x51fb('0x4a')])return _0x23ef2b;authService[_0x51fb('0x4b')](_0x429bc8[_0x51fb('0x33')][_0x51fb('0xf')],_0x23ef2b[_0x51fb('0x4a')],_0x319a26[_0x51fb('0x48')]);return _0x23ef2b;})['then'](function(){_0x23ef2b['password']=_0x429bc8[_0x51fb('0x33')]['password'];_0x23ef2b[_0x51fb('0x4c')]=null;_0x23ef2b[_0x51fb('0x4d')]=null;return _0x23ef2b[_0x51fb('0x4e')]();});})[_0x51fb('0xd')](function(){_0x2635ed[_0x51fb('0x2e')](0xc8)['send']({'message':_0x51fb('0x4f')});})[_0x51fb('0x1e')](function(_0x4c1fc6){return handleError(_0x2635ed,0x1f4,_0x4c1fc6);});};passport['use'](_0x51fb('0x50'),new LocalStrategy({'usernameField':_0x51fb('0xe'),'passwordField':_0x51fb('0xf')},function(_0x4fc699,_0x25fd75,_0x489d00){return localAuthenticate(db['User'],_0x4fc699,_0x25fd75,_0x489d00);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 5fd6ceb..23f2db1 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 _0x6c40=['post','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0xc88a95,_0x132392){var _0x5ae1b2=function(_0x5458aa){while(--_0x5458aa){_0xc88a95['push'](_0xc88a95['shift']());}};_0x5ae1b2(++_0x132392);}(_0x6c40,0x19d));var _0x06c4=function(_0x31459c,_0x898143){_0x31459c=_0x31459c-0x0;var _0x7aba2b=_0x6c40[_0x31459c];return _0x7aba2b;};'use strict';var express=require(_0x06c4('0x0'));var router=express[_0x06c4('0x1')]();var controller=require(_0x06c4('0x2'));router[_0x06c4('0x3')]('/',controller['login']);router['post']('/forgot',controller[_0x06c4('0x4')]);router[_0x06c4('0x3')](_0x06c4('0x5'),controller[_0x06c4('0x6')]);module[_0x06c4('0x7')]=router;
\ No newline at end of file
+var _0xf75e=['post','login','forgot','/reset/:token','reset','express','Router'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xf75e,0x11d));var _0xef75=function(_0x51b53f,_0x1d7216){_0x51b53f=_0x51b53f-0x0;var _0x46312e=_0xf75e[_0x51b53f];return _0x46312e;};'use strict';var express=require(_0xef75('0x0'));var router=express[_0xef75('0x1')]();var controller=require('./authLocal.controller');router[_0xef75('0x2')]('/',controller[_0xef75('0x3')]);router[_0xef75('0x2')]('/forgot',controller[_0xef75('0x4')]);router[_0xef75('0x2')](_0xef75('0x5'),controller[_0xef75('0x6')]);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 5ce23ea..9c96bf7 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 _0x7c7d=['INTEGER','exports','STRING'];(function(_0x2f0622,_0x3aad7f){var _0x3ec353=function(_0xc8784a){while(--_0xc8784a){_0x2f0622['push'](_0x2f0622['shift']());}};_0x3ec353(++_0x3aad7f);}(_0x7c7d,0xfa));var _0xd7c7=function(_0x2bfc42,_0x5a9e74){_0x2bfc42=_0x2bfc42-0x0;var _0x1630ef=_0x7c7d[_0x2bfc42];return _0x1630ef;};'use strict';var Sequelize=require('sequelize');module[_0xd7c7('0x0')]={'name':{'type':Sequelize[_0xd7c7('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xd7c7('0x1')]},'description':{'type':Sequelize[_0xd7c7('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd7c7('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x2ddb=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd339,_0x1b5e74){var _0x37c682=function(_0x4d74e5){while(--_0x4d74e5){_0x3dd339['push'](_0x3dd339['shift']());}};_0x37c682(++_0x1b5e74);}(_0x2ddb,0x17e));var _0xb2dd=function(_0x27702c,_0xad309d){_0x27702c=_0x27702c-0x0;var _0xc775ad=_0x2ddb[_0x27702c];return _0xc775ad;};'use strict';var Sequelize=require(_0xb2dd('0x0'));module[_0xb2dd('0x1')]={'name':{'type':Sequelize[_0xb2dd('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb2dd('0x2')]},'description':{'type':Sequelize[_0xb2dd('0x2')]},'status':{'type':Sequelize[_0xb2dd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index ac7cddd..fec8429 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 _0xe4f3=['addConditions','Condition','omit','ids','getConditions','findOne','merge','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','catch','rawAttributes','include','find','create','body','params'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xe4f3,0x1a9));var _0x3e4f=function(_0x45c96a,_0x4cfc11){_0x45c96a=_0x45c96a-0x0;var _0x314fed=_0xe4f3[_0x45c96a];return _0x314fed;};'use strict';var emlformat=require(_0x3e4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e4f('0x1'));var jsonpatch=require(_0x3e4f('0x2'));var rp=require(_0x3e4f('0x3'));var moment=require(_0x3e4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3e4f('0x5'));var util=require(_0x3e4f('0x6'));var path=require(_0x3e4f('0x7'));var sox=require(_0x3e4f('0x8'));var csv=require(_0x3e4f('0x9'));var ejs=require(_0x3e4f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e4f('0xb'));var crypto=require(_0x3e4f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e4f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e4f('0xe'));var Papa=require(_0x3e4f('0xf'));var Redis=require(_0x3e4f('0x10'));var authService=require(_0x3e4f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e4f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3e4f('0x13'));var config=require(_0x3e4f('0x14'));var licenseUtil=require(_0x3e4f('0x15'));var db=require(_0x3e4f('0x16'))['db'];function respondWithStatusCode(_0x3b1209,_0xfae52d){_0xfae52d=_0xfae52d||0xcc;return function(_0x46fba1){if(_0x46fba1){return _0x3b1209[_0x3e4f('0x17')](_0xfae52d);}return _0x3b1209[_0x3e4f('0x18')](_0xfae52d)[_0x3e4f('0x19')]();};}function respondWithResult(_0x386231,_0x9f797c){_0x9f797c=_0x9f797c||0xc8;return function(_0x4b15cf){if(_0x4b15cf){return _0x386231[_0x3e4f('0x18')](_0x9f797c)['json'](_0x4b15cf);}};}function respondWithFilteredResult(_0x536456,_0x3dfe89){return function(_0xff912){if(_0xff912){var _0x70d5c1=typeof _0x3dfe89[_0x3e4f('0x1a')]===_0x3e4f('0x1b')&&typeof _0x3dfe89[_0x3e4f('0x1c')]===_0x3e4f('0x1b');var _0x20b221=_0xff912[_0x3e4f('0x1d')];var _0x2a050f=_0x70d5c1?0x0:_0x3dfe89[_0x3e4f('0x1a')];var _0x292cb9=_0x70d5c1?_0xff912[_0x3e4f('0x1d')]:_0x3dfe89[_0x3e4f('0x1a')]+_0x3dfe89[_0x3e4f('0x1c')];var _0x141132;if(_0x292cb9>=_0x20b221){_0x292cb9=_0x20b221;_0x141132=0xc8;}else{_0x141132=0xce;}_0x536456[_0x3e4f('0x18')](_0x141132);return _0x536456[_0x3e4f('0x1e')](_0x3e4f('0x1f'),_0x2a050f+'-'+_0x292cb9+'/'+_0x20b221)[_0x3e4f('0x20')](_0xff912);}return null;};}function patchUpdates(_0x46a7b1){return function(_0x467f05){try{jsonpatch[_0x3e4f('0x21')](_0x467f05,_0x46a7b1,!![]);}catch(_0x2a404e){return BPromise[_0x3e4f('0x22')](_0x2a404e);}return _0x467f05[_0x3e4f('0x23')]();};}function saveUpdates(_0x20d559,_0x25b68c){return function(_0x48f0ff){if(_0x48f0ff){return _0x48f0ff[_0x3e4f('0x24')](_0x20d559)[_0x3e4f('0x25')](function(_0x4904a9){return _0x4904a9;});}return null;};}function removeEntity(_0x1ef0fd,_0x4eb89a){return function(_0x46bd12){if(_0x46bd12){return _0x46bd12[_0x3e4f('0x26')]()['then'](function(){_0x1ef0fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xec7dde,_0x544f5){return function(_0x40e487){if(!_0x40e487){_0xec7dde[_0x3e4f('0x17')](0x194);}return _0x40e487;};}function handleError(_0x45c11c,_0xade20b){_0xade20b=_0xade20b||0x1f4;return function(_0x126d68){logger[_0x3e4f('0x27')](_0x126d68['stack']);if(_0x126d68[_0x3e4f('0x28')]){delete _0x126d68[_0x3e4f('0x28')];}_0x45c11c[_0x3e4f('0x18')](_0xade20b)['send'](_0x126d68);};}exports[_0x3e4f('0x29')]=function(_0x275495,_0x4739bf){var _0x5c5cb6={},_0xa969de={},_0x4d3f9d={'count':0x0,'rows':[]};var _0x34e929=_[_0x3e4f('0x2a')](db[_0x3e4f('0x2b')]['rawAttributes'],function(_0xc59956){return{'name':_0xc59956[_0x3e4f('0x2c')],'type':_0xc59956[_0x3e4f('0x2d')][_0x3e4f('0x2e')]};});_0xa969de[_0x3e4f('0x2f')]=_['map'](_0x34e929,_0x3e4f('0x28'));_0xa969de[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x275495[_0x3e4f('0x30')]);_0xa969de[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0xa969de[_0x3e4f('0x2f')],_0xa969de['query']);_0x5c5cb6[_0x3e4f('0x34')]=_['intersection'](_0xa969de[_0x3e4f('0x2f')],qs[_0x3e4f('0x35')](_0x275495['query'][_0x3e4f('0x35')]));_0x5c5cb6['attributes']=_0x5c5cb6[_0x3e4f('0x34')][_0x3e4f('0x36')]?_0x5c5cb6[_0x3e4f('0x34')]:_0xa969de[_0x3e4f('0x2f')];if(!_0x275495[_0x3e4f('0x30')][_0x3e4f('0x37')](_0x3e4f('0x38'))){_0x5c5cb6[_0x3e4f('0x1c')]=qs[_0x3e4f('0x1c')](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x1c')]);_0x5c5cb6[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}_0x5c5cb6[_0x3e4f('0x39')]=qs['sort'](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0x5c5cb6[_0x3e4f('0x3b')]=qs['filters'](_[_0x3e4f('0x3c')](_0x275495['query'],_0xa969de[_0x3e4f('0x32')]),_0x34e929);if(_0x275495[_0x3e4f('0x30')]['filter']){_0x5c5cb6[_0x3e4f('0x3b')]=_['merge'](_0x5c5cb6['where'],{'$or':_[_0x3e4f('0x2a')](_0x34e929,function(_0x4960fc){if(_0x4960fc[_0x3e4f('0x2d')]!==_0x3e4f('0x3d')){var _0x60fa89={};_0x60fa89[_0x4960fc[_0x3e4f('0x28')]]={'$like':'%'+_0x275495['query'][_0x3e4f('0x3e')]+'%'};return _0x60fa89;}})});}_0x5c5cb6=_['merge']({},_0x5c5cb6,_0x275495[_0x3e4f('0x3f')]);var _0x393ce2={'where':_0x5c5cb6[_0x3e4f('0x3b')]};return db[_0x3e4f('0x2b')]['count'](_0x393ce2)[_0x3e4f('0x25')](function(_0x12eb83){_0x4d3f9d[_0x3e4f('0x1d')]=_0x12eb83;if(_0x275495['query'][_0x3e4f('0x40')]){_0x5c5cb6['include']=[{'all':!![]}];}return db[_0x3e4f('0x2b')][_0x3e4f('0x41')](_0x5c5cb6);})[_0x3e4f('0x25')](function(_0x416cf9){_0x4d3f9d['rows']=_0x416cf9;return _0x4d3f9d;})[_0x3e4f('0x25')](respondWithFilteredResult(_0x4739bf,_0x5c5cb6))[_0x3e4f('0x42')](handleError(_0x4739bf,null));};exports['show']=function(_0x2a363d,_0x2ac78e){var _0x6456e6={'raw':![],'where':{'id':_0x2a363d['params']['id']}},_0x373ce2={};_0x373ce2['model']=_[_0x3e4f('0x31')](db[_0x3e4f('0x2b')][_0x3e4f('0x43')]);_0x373ce2[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x2a363d['query']);_0x373ce2[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x373ce2['model'],_0x373ce2[_0x3e4f('0x30')]);_0x6456e6[_0x3e4f('0x34')]=_[_0x3e4f('0x33')](_0x373ce2[_0x3e4f('0x2f')],qs[_0x3e4f('0x35')](_0x2a363d['query'][_0x3e4f('0x35')]));_0x6456e6[_0x3e4f('0x34')]=_0x6456e6[_0x3e4f('0x34')]['length']?_0x6456e6[_0x3e4f('0x34')]:_0x373ce2[_0x3e4f('0x2f')];if(_0x2a363d[_0x3e4f('0x30')][_0x3e4f('0x40')]){_0x6456e6[_0x3e4f('0x44')]=[{'all':!![]}];}_0x6456e6=_['merge']({},_0x6456e6,_0x2a363d[_0x3e4f('0x3f')]);return db[_0x3e4f('0x2b')][_0x3e4f('0x45')](_0x6456e6)['then'](handleEntityNotFound(_0x2ac78e,null))[_0x3e4f('0x25')](respondWithResult(_0x2ac78e,null))[_0x3e4f('0x42')](handleError(_0x2ac78e,null));};exports[_0x3e4f('0x46')]=function(_0x5136a2,_0x290c0b){return db[_0x3e4f('0x2b')][_0x3e4f('0x46')](_0x5136a2[_0x3e4f('0x47')],{})[_0x3e4f('0x25')](respondWithResult(_0x290c0b,0xc9))[_0x3e4f('0x42')](handleError(_0x290c0b,null));};exports['update']=function(_0x5f5270,_0x263805){if(_0x5f5270[_0x3e4f('0x47')]['id']){delete _0x5f5270[_0x3e4f('0x47')]['id'];}return db['Automation'][_0x3e4f('0x45')]({'where':{'id':_0x5f5270[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x263805,null))[_0x3e4f('0x25')](saveUpdates(_0x5f5270[_0x3e4f('0x47')],null))[_0x3e4f('0x25')](respondWithResult(_0x263805,null))[_0x3e4f('0x42')](handleError(_0x263805,null));};exports[_0x3e4f('0x26')]=function(_0x33e381,_0x51b1a6){return db['Automation'][_0x3e4f('0x45')]({'where':{'id':_0x33e381['params']['id']}})['then'](handleEntityNotFound(_0x51b1a6,null))['then'](removeEntity(_0x51b1a6,null))[_0x3e4f('0x42')](handleError(_0x51b1a6,null));};exports[_0x3e4f('0x49')]=function(_0x445f90,_0x52e5cc,_0x41ee82){return db[_0x3e4f('0x4a')][_0x3e4f('0x45')]({'where':{'id':_0x445f90[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x52e5cc,null))[_0x3e4f('0x25')](function(_0x548e6c){if(_0x548e6c){return _0x548e6c[_0x3e4f('0x49')](_0x445f90[_0x3e4f('0x47')]['ids'],_[_0x3e4f('0x4b')](_0x445f90[_0x3e4f('0x47')],[_0x3e4f('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x52e5cc,null))[_0x3e4f('0x42')](handleError(_0x52e5cc,null));};exports[_0x3e4f('0x4d')]=function(_0x287d10,_0x858ac,_0x3482b4){var _0xbc27f7={};var _0x48a670={};var _0x16af7e;var _0x6e625a;return db['Automation'][_0x3e4f('0x4e')]({'where':{'id':_0x287d10[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x858ac,null))['then'](function(_0x3044e3){if(_0x3044e3){_0x16af7e=_0x3044e3;_0x48a670[_0x3e4f('0x2f')]=_[_0x3e4f('0x31')](db[_0x3e4f('0x4a')][_0x3e4f('0x43')]);_0x48a670['query']=_[_0x3e4f('0x31')](_0x287d10[_0x3e4f('0x30')]);_0x48a670[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x48a670[_0x3e4f('0x2f')],_0x48a670['query']);_0xbc27f7[_0x3e4f('0x34')]=_[_0x3e4f('0x33')](_0x48a670[_0x3e4f('0x2f')],qs['fields'](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x35')]));_0xbc27f7['attributes']=_0xbc27f7['attributes'][_0x3e4f('0x36')]?_0xbc27f7[_0x3e4f('0x34')]:_0x48a670[_0x3e4f('0x2f')];_0xbc27f7[_0x3e4f('0x39')]=qs[_0x3e4f('0x3a')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0xbc27f7['where']=qs[_0x3e4f('0x32')](_[_0x3e4f('0x3c')](_0x287d10['query'],_0x48a670[_0x3e4f('0x32')]));if(_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x3e')]){_0xbc27f7[_0x3e4f('0x3b')]=_['merge'](_0xbc27f7['where'],{'$or':_[_0x3e4f('0x2a')](_0xbc27f7['attributes'],function(_0x4b1d30){var _0x763508={};_0x763508[_0x4b1d30]={'$like':'%'+_0x287d10['query'][_0x3e4f('0x3e')]+'%'};return _0x763508;})});}_0xbc27f7=_[_0x3e4f('0x4f')]({},_0xbc27f7,_0x287d10[_0x3e4f('0x3f')]);return _0x16af7e[_0x3e4f('0x4d')](_0xbc27f7);}})[_0x3e4f('0x25')](function(_0x225c8f){if(_0x225c8f){_0x6e625a=_0x225c8f[_0x3e4f('0x36')];if(!_0x287d10[_0x3e4f('0x30')]['hasOwnProperty'](_0x3e4f('0x38'))){_0xbc27f7['limit']=qs[_0x3e4f('0x1c')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x1c')]);_0xbc27f7[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}return _0x16af7e['getConditions'](_0xbc27f7);}})[_0x3e4f('0x25')](function(_0x1b4a10){if(_0x1b4a10){return _0x1b4a10?{'count':_0x6e625a,'rows':_0x1b4a10}:null;}})[_0x3e4f('0x25')](respondWithResult(_0x858ac,null))[_0x3e4f('0x42')](handleError(_0x858ac,null));};exports[_0x3e4f('0x50')]=function(_0x2f04e9,_0x895589,_0x1db8e0){return db[_0x3e4f('0x51')]['find']({'where':{'id':_0x2f04e9[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x895589,null))[_0x3e4f('0x25')](function(_0x5834c5){if(_0x5834c5){return _0x5834c5['addActions'](_0x2f04e9[_0x3e4f('0x47')][_0x3e4f('0x4c')],_[_0x3e4f('0x4b')](_0x2f04e9['body'],[_0x3e4f('0x4c'),'id'])||{});}})[_0x3e4f('0x25')](respondWithResult(_0x895589,null))[_0x3e4f('0x42')](handleError(_0x895589,null));};exports[_0x3e4f('0x52')]=function(_0x39b55f,_0x5bab1e,_0x2545d8){var _0x45b34a={};var _0x1460ef={};var _0x4e89c3;var _0x28b995;return db[_0x3e4f('0x2b')][_0x3e4f('0x4e')]({'where':{'id':_0x39b55f[_0x3e4f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bab1e,null))['then'](function(_0x148bda){if(_0x148bda){_0x4e89c3=_0x148bda;_0x1460ef['model']=_[_0x3e4f('0x31')](db[_0x3e4f('0x51')][_0x3e4f('0x43')]);_0x1460ef[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x39b55f[_0x3e4f('0x30')]);_0x1460ef[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x1460ef[_0x3e4f('0x2f')],_0x1460ef[_0x3e4f('0x30')]);_0x45b34a[_0x3e4f('0x34')]=_['intersection'](_0x1460ef['model'],qs[_0x3e4f('0x35')](_0x39b55f[_0x3e4f('0x30')]['fields']));_0x45b34a[_0x3e4f('0x34')]=_0x45b34a[_0x3e4f('0x34')]['length']?_0x45b34a[_0x3e4f('0x34')]:_0x1460ef['model'];_0x45b34a[_0x3e4f('0x39')]=qs[_0x3e4f('0x3a')](_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0x45b34a['where']=qs[_0x3e4f('0x32')](_[_0x3e4f('0x3c')](_0x39b55f[_0x3e4f('0x30')],_0x1460ef[_0x3e4f('0x32')]));if(_0x39b55f['query']['filter']){_0x45b34a[_0x3e4f('0x3b')]=_['merge'](_0x45b34a[_0x3e4f('0x3b')],{'$or':_[_0x3e4f('0x2a')](_0x45b34a[_0x3e4f('0x34')],function(_0xc483ba){var _0x4a72e4={};_0x4a72e4[_0xc483ba]={'$like':'%'+_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x3e')]+'%'};return _0x4a72e4;})});}_0x45b34a=_[_0x3e4f('0x4f')]({},_0x45b34a,_0x39b55f[_0x3e4f('0x3f')]);return _0x4e89c3[_0x3e4f('0x52')](_0x45b34a);}})[_0x3e4f('0x25')](function(_0x33bd89){if(_0x33bd89){_0x28b995=_0x33bd89['length'];if(!_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x37')](_0x3e4f('0x38'))){_0x45b34a['limit']=qs[_0x3e4f('0x1c')](_0x39b55f['query']['limit']);_0x45b34a[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}return _0x4e89c3['getActions'](_0x45b34a);}})['then'](function(_0x3e25b0){if(_0x3e25b0){return _0x3e25b0?{'count':_0x28b995,'rows':_0x3e25b0}:null;}})['then'](respondWithResult(_0x5bab1e,null))[_0x3e4f('0x42')](handleError(_0x5bab1e,null));};
\ No newline at end of file
+var _0x017c=['set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','model','map','query','keys','filters','attributes','intersection','fields','sort','where','pick','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','params','length','find','create','body','addConditions','omit','ids','getConditions','Condition','filter','hasOwnProperty','addActions','Action','getActions','findOne','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x017c,0x17c));var _0xc017=function(_0x8c6eee,_0x21f601){_0x8c6eee=_0x8c6eee-0x0;var _0x5a03b5=_0x017c[_0x8c6eee];return _0x5a03b5;};'use strict';var emlformat=require(_0xc017('0x0'));var rimraf=require(_0xc017('0x1'));var zipdir=require(_0xc017('0x2'));var jsonpatch=require(_0xc017('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc017('0x4'));var Mustache=require('mustache');var util=require(_0xc017('0x5'));var path=require(_0xc017('0x6'));var sox=require(_0xc017('0x7'));var csv=require(_0xc017('0x8'));var ejs=require(_0xc017('0x9'));var fs=require('fs');var fs_extra=require(_0xc017('0xa'));var _=require('lodash');var squel=require(_0xc017('0xb'));var crypto=require('crypto');var jsforce=require(_0xc017('0xc'));var deskjs=require(_0xc017('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc017('0xe'));var Papa=require(_0xc017('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc017('0x10'));var as=require(_0xc017('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc017('0x12'));var utils=require(_0xc017('0x13'));var config=require(_0xc017('0x14'));var licenseUtil=require(_0xc017('0x15'));var db=require(_0xc017('0x16'))['db'];function respondWithStatusCode(_0x839c2f,_0x3cbe46){_0x3cbe46=_0x3cbe46||0xcc;return function(_0x34cf87){if(_0x34cf87){return _0x839c2f['sendStatus'](_0x3cbe46);}return _0x839c2f[_0xc017('0x17')](_0x3cbe46)[_0xc017('0x18')]();};}function respondWithResult(_0xdfcae7,_0x12f8a3){_0x12f8a3=_0x12f8a3||0xc8;return function(_0x1aa92e){if(_0x1aa92e){return _0xdfcae7[_0xc017('0x17')](_0x12f8a3)[_0xc017('0x19')](_0x1aa92e);}};}function respondWithFilteredResult(_0x492fc7,_0x41f1ee){return function(_0x5ed83d){if(_0x5ed83d){var _0x369920=typeof _0x41f1ee[_0xc017('0x1a')]==='undefined'&&typeof _0x41f1ee[_0xc017('0x1b')]===_0xc017('0x1c');var _0x57f429=_0x5ed83d[_0xc017('0x1d')];var _0x2e4dc7=_0x369920?0x0:_0x41f1ee[_0xc017('0x1a')];var _0x28d68d=_0x369920?_0x5ed83d[_0xc017('0x1d')]:_0x41f1ee['offset']+_0x41f1ee[_0xc017('0x1b')];var _0x51d156;if(_0x28d68d>=_0x57f429){_0x28d68d=_0x57f429;_0x51d156=0xc8;}else{_0x51d156=0xce;}_0x492fc7[_0xc017('0x17')](_0x51d156);return _0x492fc7[_0xc017('0x1e')](_0xc017('0x1f'),_0x2e4dc7+'-'+_0x28d68d+'/'+_0x57f429)['json'](_0x5ed83d);}return null;};}function patchUpdates(_0x4f6b0a){return function(_0x29892b){try{jsonpatch[_0xc017('0x20')](_0x29892b,_0x4f6b0a,!![]);}catch(_0x4fad7a){return BPromise[_0xc017('0x21')](_0x4fad7a);}return _0x29892b[_0xc017('0x22')]();};}function saveUpdates(_0x383cd4,_0x4db67e){return function(_0x5ee307){if(_0x5ee307){return _0x5ee307[_0xc017('0x23')](_0x383cd4)['then'](function(_0x1334f3){return _0x1334f3;});}return null;};}function removeEntity(_0x51ab13,_0x1b2f24){return function(_0x1cbbc9){if(_0x1cbbc9){return _0x1cbbc9[_0xc017('0x24')]()['then'](function(){_0x51ab13['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eca27,_0x5f1127){return function(_0x8e55db){if(!_0x8e55db){_0x1eca27[_0xc017('0x25')](0x194);}return _0x8e55db;};}function handleError(_0x151efe,_0x4afd1d){_0x4afd1d=_0x4afd1d||0x1f4;return function(_0x718ee8){logger[_0xc017('0x26')](_0x718ee8[_0xc017('0x27')]);if(_0x718ee8[_0xc017('0x28')]){delete _0x718ee8['name'];}_0x151efe[_0xc017('0x17')](_0x4afd1d)[_0xc017('0x29')](_0x718ee8);};}exports[_0xc017('0x2a')]=function(_0x196ec7,_0x48b9ca){var _0x5c8a8c={},_0x16684c={},_0x2dd0d8={'count':0x0,'rows':[]};var _0x1cbba5=_['map'](db[_0xc017('0x2b')][_0xc017('0x2c')],function(_0x40a95c){return{'name':_0x40a95c['fieldName'],'type':_0x40a95c['type']['key']};});_0x16684c[_0xc017('0x2d')]=_[_0xc017('0x2e')](_0x1cbba5,_0xc017('0x28'));_0x16684c[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x196ec7['query']);_0x16684c[_0xc017('0x31')]=_['intersection'](_0x16684c['model'],_0x16684c[_0xc017('0x2f')]);_0x5c8a8c[_0xc017('0x32')]=_[_0xc017('0x33')](_0x16684c[_0xc017('0x2d')],qs['fields'](_0x196ec7[_0xc017('0x2f')][_0xc017('0x34')]));_0x5c8a8c[_0xc017('0x32')]=_0x5c8a8c['attributes']['length']?_0x5c8a8c['attributes']:_0x16684c[_0xc017('0x2d')];if(!_0x196ec7[_0xc017('0x2f')]['hasOwnProperty']('nolimit')){_0x5c8a8c[_0xc017('0x1b')]=qs[_0xc017('0x1b')](_0x196ec7['query'][_0xc017('0x1b')]);_0x5c8a8c[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x196ec7['query'][_0xc017('0x1a')]);}_0x5c8a8c['order']=qs['sort'](_0x196ec7[_0xc017('0x2f')][_0xc017('0x35')]);_0x5c8a8c[_0xc017('0x36')]=qs[_0xc017('0x31')](_[_0xc017('0x37')](_0x196ec7[_0xc017('0x2f')],_0x16684c[_0xc017('0x31')]),_0x1cbba5);if(_0x196ec7[_0xc017('0x2f')]['filter']){_0x5c8a8c['where']=_[_0xc017('0x38')](_0x5c8a8c[_0xc017('0x36')],{'$or':_[_0xc017('0x2e')](_0x1cbba5,function(_0x56ad8e){if(_0x56ad8e['type']!==_0xc017('0x39')){var _0x1b76b5={};_0x1b76b5[_0x56ad8e['name']]={'$like':'%'+_0x196ec7[_0xc017('0x2f')]['filter']+'%'};return _0x1b76b5;}})});}_0x5c8a8c=_[_0xc017('0x38')]({},_0x5c8a8c,_0x196ec7[_0xc017('0x3a')]);var _0x13aa67={'where':_0x5c8a8c[_0xc017('0x36')]};return db[_0xc017('0x2b')]['count'](_0x13aa67)[_0xc017('0x3b')](function(_0x30cd1c){_0x2dd0d8[_0xc017('0x1d')]=_0x30cd1c;if(_0x196ec7[_0xc017('0x2f')][_0xc017('0x3c')]){_0x5c8a8c[_0xc017('0x3d')]=[{'all':!![]}];}return db[_0xc017('0x2b')][_0xc017('0x3e')](_0x5c8a8c);})[_0xc017('0x3b')](function(_0x1a152c){_0x2dd0d8['rows']=_0x1a152c;return _0x2dd0d8;})[_0xc017('0x3b')](respondWithFilteredResult(_0x48b9ca,_0x5c8a8c))[_0xc017('0x3f')](handleError(_0x48b9ca,null));};exports['show']=function(_0x688092,_0x115b27){var _0x3a1ec6={'raw':![],'where':{'id':_0x688092[_0xc017('0x40')]['id']}},_0x327249={};_0x327249['model']=_[_0xc017('0x30')](db[_0xc017('0x2b')][_0xc017('0x2c')]);_0x327249[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x688092[_0xc017('0x2f')]);_0x327249[_0xc017('0x31')]=_[_0xc017('0x33')](_0x327249[_0xc017('0x2d')],_0x327249['query']);_0x3a1ec6[_0xc017('0x32')]=_[_0xc017('0x33')](_0x327249[_0xc017('0x2d')],qs[_0xc017('0x34')](_0x688092[_0xc017('0x2f')][_0xc017('0x34')]));_0x3a1ec6[_0xc017('0x32')]=_0x3a1ec6[_0xc017('0x32')][_0xc017('0x41')]?_0x3a1ec6['attributes']:_0x327249[_0xc017('0x2d')];if(_0x688092[_0xc017('0x2f')][_0xc017('0x3c')]){_0x3a1ec6['include']=[{'all':!![]}];}_0x3a1ec6=_[_0xc017('0x38')]({},_0x3a1ec6,_0x688092['options']);return db[_0xc017('0x2b')][_0xc017('0x42')](_0x3a1ec6)[_0xc017('0x3b')](handleEntityNotFound(_0x115b27,null))[_0xc017('0x3b')](respondWithResult(_0x115b27,null))['catch'](handleError(_0x115b27,null));};exports[_0xc017('0x43')]=function(_0xdac4a5,_0x125259){return db[_0xc017('0x2b')][_0xc017('0x43')](_0xdac4a5[_0xc017('0x44')],{})[_0xc017('0x3b')](respondWithResult(_0x125259,0xc9))[_0xc017('0x3f')](handleError(_0x125259,null));};exports[_0xc017('0x23')]=function(_0x2e189b,_0x3c8d90){if(_0x2e189b['body']['id']){delete _0x2e189b[_0xc017('0x44')]['id'];}return db['Automation'][_0xc017('0x42')]({'where':{'id':_0x2e189b[_0xc017('0x40')]['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x3c8d90,null))[_0xc017('0x3b')](saveUpdates(_0x2e189b['body'],null))['then'](respondWithResult(_0x3c8d90,null))[_0xc017('0x3f')](handleError(_0x3c8d90,null));};exports[_0xc017('0x24')]=function(_0x4e7f31,_0x1fbc7a){return db[_0xc017('0x2b')][_0xc017('0x42')]({'where':{'id':_0x4e7f31['params']['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x1fbc7a,null))[_0xc017('0x3b')](removeEntity(_0x1fbc7a,null))[_0xc017('0x3f')](handleError(_0x1fbc7a,null));};exports[_0xc017('0x45')]=function(_0xb0f608,_0x38239f,_0x36b6ef){return db['Condition']['find']({'where':{'id':_0xb0f608['params']['id']}})['then'](handleEntityNotFound(_0x38239f,null))[_0xc017('0x3b')](function(_0x2685ff){if(_0x2685ff){return _0x2685ff[_0xc017('0x45')](_0xb0f608[_0xc017('0x44')]['ids'],_[_0xc017('0x46')](_0xb0f608[_0xc017('0x44')],[_0xc017('0x47'),'id'])||{});}})['then'](respondWithResult(_0x38239f,null))[_0xc017('0x3f')](handleError(_0x38239f,null));};exports[_0xc017('0x48')]=function(_0x55a187,_0x3c3341,_0x330606){var _0x213bd={};var _0x3b0c55={};var _0x44d86c;var _0x122e18;return db[_0xc017('0x2b')]['findOne']({'where':{'id':_0x55a187['params']['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x3c3341,null))[_0xc017('0x3b')](function(_0x43fd4c){if(_0x43fd4c){_0x44d86c=_0x43fd4c;_0x3b0c55['model']=_[_0xc017('0x30')](db[_0xc017('0x49')][_0xc017('0x2c')]);_0x3b0c55[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x55a187[_0xc017('0x2f')]);_0x3b0c55[_0xc017('0x31')]=_[_0xc017('0x33')](_0x3b0c55[_0xc017('0x2d')],_0x3b0c55[_0xc017('0x2f')]);_0x213bd[_0xc017('0x32')]=_[_0xc017('0x33')](_0x3b0c55[_0xc017('0x2d')],qs[_0xc017('0x34')](_0x55a187[_0xc017('0x2f')][_0xc017('0x34')]));_0x213bd['attributes']=_0x213bd[_0xc017('0x32')][_0xc017('0x41')]?_0x213bd['attributes']:_0x3b0c55[_0xc017('0x2d')];_0x213bd['order']=qs[_0xc017('0x35')](_0x55a187['query'][_0xc017('0x35')]);_0x213bd['where']=qs[_0xc017('0x31')](_['pick'](_0x55a187[_0xc017('0x2f')],_0x3b0c55['filters']));if(_0x55a187[_0xc017('0x2f')][_0xc017('0x4a')]){_0x213bd[_0xc017('0x36')]=_[_0xc017('0x38')](_0x213bd['where'],{'$or':_[_0xc017('0x2e')](_0x213bd['attributes'],function(_0x460c19){var _0x4347f7={};_0x4347f7[_0x460c19]={'$like':'%'+_0x55a187['query']['filter']+'%'};return _0x4347f7;})});}_0x213bd=_[_0xc017('0x38')]({},_0x213bd,_0x55a187[_0xc017('0x3a')]);return _0x44d86c['getConditions'](_0x213bd);}})['then'](function(_0x13ee09){if(_0x13ee09){_0x122e18=_0x13ee09[_0xc017('0x41')];if(!_0x55a187['query'][_0xc017('0x4b')]('nolimit')){_0x213bd['limit']=qs[_0xc017('0x1b')](_0x55a187[_0xc017('0x2f')][_0xc017('0x1b')]);_0x213bd[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x55a187[_0xc017('0x2f')][_0xc017('0x1a')]);}return _0x44d86c[_0xc017('0x48')](_0x213bd);}})[_0xc017('0x3b')](function(_0x70899a){if(_0x70899a){return _0x70899a?{'count':_0x122e18,'rows':_0x70899a}:null;}})[_0xc017('0x3b')](respondWithResult(_0x3c3341,null))[_0xc017('0x3f')](handleError(_0x3c3341,null));};exports[_0xc017('0x4c')]=function(_0x170126,_0x57d432,_0x22cca4){return db[_0xc017('0x4d')]['find']({'where':{'id':_0x170126[_0xc017('0x40')]['id']}})[_0xc017('0x3b')](handleEntityNotFound(_0x57d432,null))['then'](function(_0x3fb2b9){if(_0x3fb2b9){return _0x3fb2b9['addActions'](_0x170126['body']['ids'],_['omit'](_0x170126['body'],[_0xc017('0x47'),'id'])||{});}})[_0xc017('0x3b')](respondWithResult(_0x57d432,null))[_0xc017('0x3f')](handleError(_0x57d432,null));};exports[_0xc017('0x4e')]=function(_0x5d2a71,_0x3e74ab,_0x3fd8e9){var _0xbccd3a={};var _0x3c8e98={};var _0x1dea91;var _0x244d4f;return db[_0xc017('0x2b')][_0xc017('0x4f')]({'where':{'id':_0x5d2a71[_0xc017('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e74ab,null))[_0xc017('0x3b')](function(_0x26dc32){if(_0x26dc32){_0x1dea91=_0x26dc32;_0x3c8e98[_0xc017('0x2d')]=_['keys'](db[_0xc017('0x4d')][_0xc017('0x2c')]);_0x3c8e98[_0xc017('0x2f')]=_[_0xc017('0x30')](_0x5d2a71['query']);_0x3c8e98[_0xc017('0x31')]=_[_0xc017('0x33')](_0x3c8e98[_0xc017('0x2d')],_0x3c8e98[_0xc017('0x2f')]);_0xbccd3a['attributes']=_[_0xc017('0x33')](_0x3c8e98[_0xc017('0x2d')],qs['fields'](_0x5d2a71[_0xc017('0x2f')]['fields']));_0xbccd3a[_0xc017('0x32')]=_0xbccd3a[_0xc017('0x32')][_0xc017('0x41')]?_0xbccd3a['attributes']:_0x3c8e98[_0xc017('0x2d')];_0xbccd3a[_0xc017('0x50')]=qs[_0xc017('0x35')](_0x5d2a71[_0xc017('0x2f')][_0xc017('0x35')]);_0xbccd3a[_0xc017('0x36')]=qs[_0xc017('0x31')](_[_0xc017('0x37')](_0x5d2a71[_0xc017('0x2f')],_0x3c8e98['filters']));if(_0x5d2a71[_0xc017('0x2f')]['filter']){_0xbccd3a[_0xc017('0x36')]=_[_0xc017('0x38')](_0xbccd3a[_0xc017('0x36')],{'$or':_['map'](_0xbccd3a['attributes'],function(_0x5927ef){var _0x251470={};_0x251470[_0x5927ef]={'$like':'%'+_0x5d2a71['query'][_0xc017('0x4a')]+'%'};return _0x251470;})});}_0xbccd3a=_[_0xc017('0x38')]({},_0xbccd3a,_0x5d2a71[_0xc017('0x3a')]);return _0x1dea91[_0xc017('0x4e')](_0xbccd3a);}})['then'](function(_0x55fc89){if(_0x55fc89){_0x244d4f=_0x55fc89[_0xc017('0x41')];if(!_0x5d2a71['query']['hasOwnProperty'](_0xc017('0x51'))){_0xbccd3a[_0xc017('0x1b')]=qs[_0xc017('0x1b')](_0x5d2a71[_0xc017('0x2f')]['limit']);_0xbccd3a[_0xc017('0x1a')]=qs[_0xc017('0x1a')](_0x5d2a71[_0xc017('0x2f')]['offset']);}return _0x1dea91['getActions'](_0xbccd3a);}})['then'](function(_0x724831){if(_0x724831){return _0x724831?{'count':_0x244d4f,'rows':_0x724831}:null;}})[_0xc017('0x3b')](respondWithResult(_0x3e74ab,null))[_0xc017('0x3f')](handleError(_0x3e74ab,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 89d3bbe..b73fe54 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 _0xac06=['Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define'];(function(_0x4ab311,_0x51ac35){var _0x2c56c0=function(_0x17186d){while(--_0x17186d){_0x4ab311['push'](_0x4ab311['shift']());}};_0x2c56c0(++_0x51ac35);}(_0xac06,0x147));var _0x6ac0=function(_0x32dee9,_0x1d1b20){_0x32dee9=_0x32dee9-0x0;var _0x12b69d=_0xac06[_0x32dee9];return _0x12b69d;};'use strict';var _=require(_0x6ac0('0x0'));var util=require(_0x6ac0('0x1'));var logger=require(_0x6ac0('0x2'))(_0x6ac0('0x3'));var moment=require(_0x6ac0('0x4'));var BPromise=require(_0x6ac0('0x5'));var rp=require(_0x6ac0('0x6'));var fs=require('fs');var path=require(_0x6ac0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ac0('0x8'));module[_0x6ac0('0x9')]=function(_0x428ce6,_0x5770a0){return _0x428ce6[_0x6ac0('0xa')](_0x6ac0('0xb'),attributes,{'tableName':_0x6ac0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce4b=['lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x7e2e19,_0x272911){var _0x9d32cb=function(_0x15ff1a){while(--_0x15ff1a){_0x7e2e19['push'](_0x7e2e19['shift']());}};_0x9d32cb(++_0x272911);}(_0xce4b,0x1d6));var _0xbce4=function(_0x4b3e12,_0x4a1bdc){_0x4b3e12=_0x4b3e12-0x0;var _0xec0991=_0xce4b[_0x4b3e12];return _0xec0991;};'use strict';var _=require(_0xbce4('0x0'));var util=require('util');var logger=require(_0xbce4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbce4('0x2'));var fs=require('fs');var path=require(_0xbce4('0x3'));var rimraf=require(_0xbce4('0x4'));var config=require(_0xbce4('0x5'));var attributes=require(_0xbce4('0x6'));module[_0xbce4('0x7')]=function(_0x3734b4,_0x47ff1f){return _0x3734b4[_0xbce4('0x8')]('Automation',attributes,{'tableName':_0xbce4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index e437c88..ed9c77e 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 _0x9ab8=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0x9ab8,0x81));var _0x89ab=function(_0x5995e1,_0x5282b8){_0x5995e1=_0x5995e1-0x0;var _0x4a4f39=_0x9ab8[_0x5995e1];return _0x4a4f39;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ab('0x4'));var logger=require(_0x89ab('0x5'))('rpc');var config=require(_0x89ab('0x6'));var jayson=require(_0x89ab('0x7'));var client=jayson[_0x89ab('0x8')][_0x89ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a984,_0x3ecaa0,_0x366c32){return new BPromise(function(_0x5fd99f,_0x42da87){return client[_0x89ab('0xa')](_0x29a984,_0x366c32)[_0x89ab('0xb')](function(_0x36dc63){logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ecaa0,_0x89ab('0xc'),JSON[_0x89ab('0xd')](_0x36dc63));if(_0x36dc63[_0x89ab('0xe')]){if(_0x36dc63[_0x89ab('0xe')][_0x89ab('0xf')]===0x1f4){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x42da87(_0x36dc63[_0x89ab('0xe')][_0x89ab('0x11')]);}logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x5fd99f(_0x36dc63[_0x89ab('0xe')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');_0x5fd99f(_0x36dc63['result']['message']);}})[_0x89ab('0x12')](function(_0x1ce918){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x1ce918);_0x42da87(_0x1ce918);});});}
\ No newline at end of file
+var _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x349e,0xcb));var _0xe349=function(_0x40ad1d,_0x22e1e4){_0x40ad1d=_0x40ad1d-0x0;var _0x88ae7d=_0x349e[_0x40ad1d];return _0x88ae7d;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('Automation,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 101c8b6..f8a4925 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 _0xd33b=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd33b,0x1af));var _0xbd33=function(_0x5e20f3,_0x53bc46){_0x5e20f3=_0x5e20f3-0x0;var _0x3442ae=_0xd33b[_0x5e20f3];return _0x3442ae;};'use strict';var multer=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var path=require('path');var timeout=require(_0xbd33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd33('0x3'));var interaction=require(_0xbd33('0x4'));var config=require('../../config/environment');var controller=require(_0xbd33('0x5'));router[_0xbd33('0x6')]('/',auth[_0xbd33('0x7')](),controller[_0xbd33('0x8')]);router['get'](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0xa')]);router[_0xbd33('0x6')](_0xbd33('0xb'),auth[_0xbd33('0x7')](),controller[_0xbd33('0xc')]);router[_0xbd33('0x6')](_0xbd33('0xd'),auth['isAuthenticated'](),controller[_0xbd33('0xe')]);router[_0xbd33('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd33('0x10')]);router[_0xbd33('0xf')](_0xbd33('0xb'),auth['isAuthenticated'](),controller[_0xbd33('0x11')]);router[_0xbd33('0xf')](_0xbd33('0xd'),auth[_0xbd33('0x7')](),controller[_0xbd33('0x12')]);router[_0xbd33('0x13')](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0x14')]);router[_0xbd33('0x15')](_0xbd33('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeac6=['getActions','create','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xeac6,0xc0));var _0x6eac=function(_0x34785b,_0x503b3d){_0x34785b=_0x34785b-0x0;var _0x4f4d83=_0xeac6[_0x34785b];return _0x4f4d83;};'use strict';var multer=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var path=require(_0x6eac('0x2'));var timeout=require('connect-timeout');var express=require(_0x6eac('0x3'));var router=express[_0x6eac('0x4')]();var fs_extra=require(_0x6eac('0x5'));var auth=require(_0x6eac('0x6'));var interaction=require(_0x6eac('0x7'));var config=require(_0x6eac('0x8'));var controller=require(_0x6eac('0x9'));router[_0x6eac('0xa')]('/',auth[_0x6eac('0xb')](),controller[_0x6eac('0xc')]);router[_0x6eac('0xa')](_0x6eac('0xd'),auth['isAuthenticated'](),controller[_0x6eac('0xe')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0x6eac('0xf')]);router[_0x6eac('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x6eac('0x10')]);router['post']('/',auth[_0x6eac('0xb')](),controller[_0x6eac('0x11')]);router[_0x6eac('0x12')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x6eac('0x13')]);router[_0x6eac('0x12')]('/:id/actions',auth[_0x6eac('0xb')](),controller[_0x6eac('0x14')]);router[_0x6eac('0x15')]('/:id',auth[_0x6eac('0xb')](),controller[_0x6eac('0x16')]);router[_0x6eac('0x17')](_0x6eac('0xd'),auth[_0x6eac('0xb')](),controller[_0x6eac('0x18')]);module[_0x6eac('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 8d59d3d..9bd8909 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 _0x834c=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x57a75f,_0x4c764d){var _0x1b7bda=function(_0x3d200e){while(--_0x3d200e){_0x57a75f['push'](_0x57a75f['shift']());}};_0x1b7bda(++_0x4c764d);}(_0x834c,0x73));var _0xc834=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x834c[_0x514c15];return _0x16283e;};'use strict';var Sequelize=require(_0xc834('0x0'));module[_0xc834('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc834('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc834('0x3')](_0xc834('0x4')),'allowNull':![],'defaultValue':_0xc834('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc834('0x5')],'defaultValue':0x0,'comment':_0xc834('0x6')},'limitCalls':{'type':Sequelize[_0xc834('0x7')](0x4)[_0xc834('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc834('0x9')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc834('0x9')]},'dialOriginateTimeout':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc834('0x9')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc834('0x9')],'defaultValue':_0xc834('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc834('0x3')](_0xc834('0x10'),_0xc834('0x11'),'onlyIfOpen'),'defaultValue':_0xc834('0x10')},'dialAMDActive':{'type':Sequelize[_0xc834('0x5')],'defaultValue':0x0,'comment':_0xc834('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc834('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc834('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc834('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc834('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc834('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc834('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc834('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc834('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xc834('0x9')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc834('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x1021=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1021,0xaf));var _0x1102=function(_0x44198b,_0x4cedcc){_0x44198b=_0x44198b-0x0;var _0x28367c=_0x1021[_0x44198b];return _0x28367c;};'use strict';var Sequelize=require(_0x1102('0x0'));module[_0x1102('0x1')]={'name':{'type':Sequelize[_0x1102('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x4')),'allowNull':![],'defaultValue':_0x1102('0x4')},'description':{'type':Sequelize[_0x1102('0x2')]},'active':{'type':Sequelize[_0x1102('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1102('0x6')](0x4)[_0x1102('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1102('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'comment':_0x1102('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1102('0xf')},'dialTimezone':{'type':Sequelize[_0x1102('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1102('0x2')],'defaultValue':_0x1102('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x11'),_0x1102('0x12'),_0x1102('0x13')),'defaultValue':_0x1102('0x11')},'dialAMDActive':{'type':Sequelize[_0x1102('0x5')],'defaultValue':0x0,'comment':_0x1102('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1102('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1102('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1102('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1102('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1102('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1102('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1102('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1102('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1102('0x6')](0x9)[_0x1102('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1102('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1102('0x3')](_0x1102('0x1c'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1102('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1102('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)[_0x1102('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1102('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1102('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1102('0x6')](0x5)[_0x1102('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1102('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index f067576..778566f 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 _0x565c=['save','update','destroy','then','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','map','Campaign','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','intersection','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','updatedAt','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject'];(function(_0x484f58,_0x521a54){var _0x87ee76=function(_0x5290f7){while(--_0x5290f7){_0x484f58['push'](_0x484f58['shift']());}};_0x87ee76(++_0x521a54);}(_0x565c,0x73));var _0xc565=function(_0x47ec78,_0x9eadfa){_0x47ec78=_0x47ec78-0x0;var _0x1e032d=_0x565c[_0x47ec78];return _0x1e032d;};'use strict';var emlformat=require(_0xc565('0x0'));var rimraf=require(_0xc565('0x1'));var zipdir=require(_0xc565('0x2'));var jsonpatch=require(_0xc565('0x3'));var rp=require(_0xc565('0x4'));var moment=require(_0xc565('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc565('0x6'));var sox=require(_0xc565('0x7'));var csv=require(_0xc565('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc565('0x9'));var squel=require('squel');var crypto=require(_0xc565('0xa'));var jsforce=require(_0xc565('0xb'));var deskjs=require(_0xc565('0xc'));var toCsv=require(_0xc565('0x8'));var querystring=require(_0xc565('0xd'));var Papa=require(_0xc565('0xe'));var Redis=require('ioredis');var authService=require(_0xc565('0xf'));var qs=require(_0xc565('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc565('0x11'));var logger=require(_0xc565('0x12'))(_0xc565('0x13'));var utils=require(_0xc565('0x14'));var config=require(_0xc565('0x15'));var licenseUtil=require(_0xc565('0x16'));var db=require(_0xc565('0x17'))['db'];function respondWithStatusCode(_0x214f27,_0x3ca9a6){_0x3ca9a6=_0x3ca9a6||0xcc;return function(_0x54d900){if(_0x54d900){return _0x214f27['sendStatus'](_0x3ca9a6);}return _0x214f27['status'](_0x3ca9a6)['end']();};}function respondWithResult(_0x11853a,_0x26c026){_0x26c026=_0x26c026||0xc8;return function(_0x543d68){if(_0x543d68){return _0x11853a[_0xc565('0x18')](_0x26c026)[_0xc565('0x19')](_0x543d68);}};}function respondWithFilteredResult(_0x297d35,_0x200ebb){return function(_0x66c6cb){if(_0x66c6cb){var _0x11d3f1=typeof _0x200ebb[_0xc565('0x1a')]===_0xc565('0x1b')&&typeof _0x200ebb[_0xc565('0x1c')]===_0xc565('0x1b');var _0x1de92c=_0x66c6cb[_0xc565('0x1d')];var _0x16cabe=_0x11d3f1?0x0:_0x200ebb[_0xc565('0x1a')];var _0x275e7b=_0x11d3f1?_0x66c6cb['count']:_0x200ebb['offset']+_0x200ebb[_0xc565('0x1c')];var _0x3b88b4;if(_0x275e7b>=_0x1de92c){_0x275e7b=_0x1de92c;_0x3b88b4=0xc8;}else{_0x3b88b4=0xce;}_0x297d35[_0xc565('0x18')](_0x3b88b4);return _0x297d35[_0xc565('0x1e')]('Content-Range',_0x16cabe+'-'+_0x275e7b+'/'+_0x1de92c)[_0xc565('0x19')](_0x66c6cb);}return null;};}function patchUpdates(_0x166fa7){return function(_0x1ab8ec){try{jsonpatch[_0xc565('0x1f')](_0x1ab8ec,_0x166fa7,!![]);}catch(_0x4d6939){return BPromise[_0xc565('0x20')](_0x4d6939);}return _0x1ab8ec[_0xc565('0x21')]();};}function saveUpdates(_0x404b39,_0x43769e){return function(_0x36a386){if(_0x36a386){return _0x36a386[_0xc565('0x22')](_0x404b39)['then'](function(_0x4a2807){return _0x4a2807;});}return null;};}function removeEntity(_0xefedf6,_0x422a6c){return function(_0x2d91b0){if(_0x2d91b0){return _0x2d91b0[_0xc565('0x23')]()[_0xc565('0x24')](function(){var _0x4eee02=_0x2d91b0['get']({'plain':!![]});var _0x2d3961=_0xc565('0x25');return db[_0xc565('0x26')]['destroy']({'where':{'type':_0x2d3961,'resourceId':_0x4eee02['id']}})[_0xc565('0x24')](function(){return _0x2d91b0;});})[_0xc565('0x24')](function(){_0xefedf6[_0xc565('0x18')](0xcc)[_0xc565('0x27')]();});}};}function handleEntityNotFound(_0x175d05,_0x5722da){return function(_0x42a0c9){if(!_0x42a0c9){_0x175d05[_0xc565('0x28')](0x194);}return _0x42a0c9;};}function handleError(_0xf4272c,_0x512d68){_0x512d68=_0x512d68||0x1f4;return function(_0x2149ee){logger[_0xc565('0x29')](_0x2149ee[_0xc565('0x2a')]);if(_0x2149ee[_0xc565('0x2b')]){delete _0x2149ee[_0xc565('0x2b')];}_0xf4272c[_0xc565('0x18')](_0x512d68)[_0xc565('0x2c')](_0x2149ee);};}exports['index']=function(_0x3c2ed3,_0x1fd840){var _0x31f1c6={},_0x2553a5={},_0x2f8671={'count':0x0,'rows':[]};var _0x270b63=_[_0xc565('0x2d')](db[_0xc565('0x2e')]['rawAttributes'],function(_0x54d14e){return{'name':_0x54d14e[_0xc565('0x2f')],'type':_0x54d14e[_0xc565('0x30')]['key']};});_0x2553a5[_0xc565('0x31')]=_[_0xc565('0x2d')](_0x270b63,_0xc565('0x2b'));_0x2553a5[_0xc565('0x32')]=_[_0xc565('0x33')](_0x3c2ed3[_0xc565('0x32')]);_0x2553a5[_0xc565('0x34')]=_['intersection'](_0x2553a5[_0xc565('0x31')],_0x2553a5[_0xc565('0x32')]);_0x31f1c6[_0xc565('0x35')]=_['intersection'](_0x2553a5[_0xc565('0x31')],qs['fields'](_0x3c2ed3[_0xc565('0x32')]['fields']));_0x31f1c6[_0xc565('0x35')]=_0x31f1c6[_0xc565('0x35')][_0xc565('0x36')]?_0x31f1c6[_0xc565('0x35')]:_0x2553a5[_0xc565('0x31')];if(!_0x3c2ed3[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x31f1c6[_0xc565('0x1c')]=qs['limit'](_0x3c2ed3[_0xc565('0x32')][_0xc565('0x1c')]);_0x31f1c6[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x3c2ed3[_0xc565('0x32')][_0xc565('0x1a')]);}_0x31f1c6[_0xc565('0x39')]=qs['sort'](_0x3c2ed3['query'][_0xc565('0x3a')]);_0x31f1c6[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x3c2ed3[_0xc565('0x32')],_0x2553a5[_0xc565('0x34')]),_0x270b63);if(_0x3c2ed3[_0xc565('0x32')]['filter']){_0x31f1c6[_0xc565('0x3b')]=_['merge'](_0x31f1c6[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x270b63,function(_0xe43c87){if(_0xe43c87['type']!=='VIRTUAL'){var _0x197419={};_0x197419[_0xe43c87[_0xc565('0x2b')]]={'$like':'%'+_0x3c2ed3[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x197419;}})});}_0x31f1c6=_[_0xc565('0x3e')]({},_0x31f1c6,_0x3c2ed3[_0xc565('0x3f')]);var _0x2fa276={'where':_0x31f1c6[_0xc565('0x3b')]};return db['Campaign'][_0xc565('0x1d')](_0x2fa276)[_0xc565('0x24')](function(_0x3fd0ad){_0x2f8671[_0xc565('0x1d')]=_0x3fd0ad;if(_0x3c2ed3[_0xc565('0x32')][_0xc565('0x40')]){_0x31f1c6[_0xc565('0x41')]=[{'all':!![]}];}return db['Campaign'][_0xc565('0x42')](_0x31f1c6);})[_0xc565('0x24')](function(_0x533793){_0x2f8671['rows']=_0x533793;return _0x2f8671;})[_0xc565('0x24')](respondWithFilteredResult(_0x1fd840,_0x31f1c6))['catch'](handleError(_0x1fd840,null));};exports[_0xc565('0x43')]=function(_0x43af71,_0x1f898e){var _0x18e4cb={'raw':![],'where':{'id':_0x43af71[_0xc565('0x44')]['id']}},_0x1e4810={};_0x1e4810[_0xc565('0x31')]=_['keys'](db['Campaign'][_0xc565('0x45')]);_0x1e4810[_0xc565('0x32')]=_[_0xc565('0x33')](_0x43af71[_0xc565('0x32')]);_0x1e4810['filters']=_[_0xc565('0x46')](_0x1e4810[_0xc565('0x31')],_0x1e4810[_0xc565('0x32')]);_0x18e4cb[_0xc565('0x35')]=_[_0xc565('0x46')](_0x1e4810[_0xc565('0x31')],qs[_0xc565('0x47')](_0x43af71['query'][_0xc565('0x47')]));_0x18e4cb[_0xc565('0x35')]=_0x18e4cb[_0xc565('0x35')][_0xc565('0x36')]?_0x18e4cb[_0xc565('0x35')]:_0x1e4810['model'];if(_0x43af71['query'][_0xc565('0x40')]){_0x18e4cb[_0xc565('0x41')]=[{'all':!![]}];}_0x18e4cb=_['merge']({},_0x18e4cb,_0x43af71[_0xc565('0x3f')]);return db[_0xc565('0x2e')][_0xc565('0x48')](_0x18e4cb)[_0xc565('0x24')](handleEntityNotFound(_0x1f898e,null))[_0xc565('0x24')](respondWithResult(_0x1f898e,null))['catch'](handleError(_0x1f898e,null));};exports['create']=function(_0x42b435,_0x296816){return db['Campaign'][_0xc565('0x49')](_0x42b435[_0xc565('0x4a')],{})[_0xc565('0x24')](function(_0x329615){var _0x3bdb55=_0x42b435[_0xc565('0x4b')][_0xc565('0x4c')]({'plain':!![]});if(!_0x3bdb55)throw new Error(_0xc565('0x4d'));if(_0x3bdb55['role']===_0xc565('0x4b')){var _0x4f4f7d=_0x329615['get']({'plain':!![]});var _0x21128d=_0xc565('0x25');return db[_0xc565('0x4e')]['find']({'where':{'name':_0x21128d,'userProfileId':_0x3bdb55[_0xc565('0x4f')]},'raw':!![]})[_0xc565('0x24')](function(_0x5d93f7){if(_0x5d93f7&&_0x5d93f7[_0xc565('0x50')]===0x0){return db[_0xc565('0x26')][_0xc565('0x49')]({'name':_0x4f4f7d['name'],'resourceId':_0x4f4f7d['id'],'type':_0x5d93f7[_0xc565('0x2b')],'sectionId':_0x5d93f7['id']},{})[_0xc565('0x24')](function(){return _0x329615;});}else{return _0x329615;}})['catch'](function(_0x39267f){logger[_0xc565('0x29')](_0xc565('0x51'),_0x39267f);throw _0x39267f;});}return _0x329615;})['then'](respondWithResult(_0x296816,0xc9))[_0xc565('0x52')](handleError(_0x296816,null));};exports[_0xc565('0x53')]=function(_0x3c4b60,_0x315ee4){var _0x3505b5={'where':{'id':_0x3c4b60['params']['id']}},_0x13d28c={};_0x13d28c[_0xc565('0x31')]=_[_0xc565('0x33')](db[_0xc565('0x2e')][_0xc565('0x45')]);_0x3505b5[_0xc565('0x35')]=_[_0xc565('0x46')](_0x13d28c[_0xc565('0x31')],qs[_0xc565('0x47')](_0x3c4b60[_0xc565('0x32')][_0xc565('0x47')]));_0x3505b5[_0xc565('0x35')]=_0x3505b5['attributes'][_0xc565('0x36')]?_0x3505b5[_0xc565('0x35')]:_0x13d28c[_0xc565('0x31')];if(_0x3c4b60[_0xc565('0x32')][_0xc565('0x40')]){_0x3505b5['include']=[{'all':!![]}];}_0x3505b5=_[_0xc565('0x3e')]({},_0x3505b5,_0x3c4b60[_0xc565('0x3f')]);return db['Campaign'][_0xc565('0x48')](_0x3505b5)[_0xc565('0x24')](handleEntityNotFound(_0x315ee4,null))[_0xc565('0x24')](function(_0x571b62){if(_0x571b62){var _0x54c02a=_0x571b62[_0xc565('0x4c')]({'plain':!![]});_0x54c02a=qs[_0xc565('0x54')](_0x54c02a,['id',_0xc565('0x55'),'updatedAt']);_0x3c4b60[_0xc565('0x4a')]=_[_0xc565('0x54')](_0x3c4b60[_0xc565('0x4a')],['id',_0xc565('0x55'),_0xc565('0x56')]);return db[_0xc565('0x2e')][_0xc565('0x49')](_['merge'](_0x54c02a,_0x3c4b60['body']),{'include':_0x3c4b60[_0xc565('0x32')][_0xc565('0x40')]?[{'all':!![]}]:undefined})[_0xc565('0x24')](function(_0x2b9bd7){var _0x11210f=_0x3c4b60[_0xc565('0x4b')][_0xc565('0x4c')]({'plain':!![]});if(!_0x11210f)throw new Error(_0xc565('0x4d'));if(_0x11210f['role']===_0xc565('0x4b')){var _0x51e40c=_0x2b9bd7[_0xc565('0x4c')]({'plain':!![]});var _0x240fbd=_0xc565('0x25');return db['UserProfileSection'][_0xc565('0x48')]({'where':{'name':_0x240fbd,'userProfileId':_0x11210f[_0xc565('0x4f')]},'raw':!![]})[_0xc565('0x24')](function(_0x32b4f1){if(_0x32b4f1&&_0x32b4f1[_0xc565('0x50')]===0x0){return db[_0xc565('0x26')][_0xc565('0x49')]({'name':_0x51e40c[_0xc565('0x2b')],'resourceId':_0x51e40c['id'],'type':_0x32b4f1[_0xc565('0x2b')],'sectionId':_0x32b4f1['id']},{})[_0xc565('0x24')](function(){return _0x2b9bd7;});}else{return _0x2b9bd7;}})[_0xc565('0x52')](function(_0x7537be){logger['error'](_0xc565('0x51'),_0x7537be);throw _0x7537be;});}return _0x2b9bd7;});}})['then'](respondWithResult(_0x315ee4,0xc9))[_0xc565('0x52')](handleError(_0x315ee4,null));};exports[_0xc565('0x22')]=function(_0x4d1a01,_0x49cb51){if(_0x4d1a01['body']['id']){delete _0x4d1a01[_0xc565('0x4a')]['id'];}return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x4d1a01[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x49cb51,null))['then'](saveUpdates(_0x4d1a01[_0xc565('0x4a')],null))[_0xc565('0x24')](respondWithResult(_0x49cb51,null))[_0xc565('0x52')](handleError(_0x49cb51,null));};exports['destroy']=function(_0x425e1c,_0x425a9c){return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x425e1c['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x425a9c,null))['then'](removeEntity(_0x425a9c,null))['catch'](handleError(_0x425a9c,null));};exports['getHoppers']=function(_0x47004b,_0x5d8233,_0x233a16){var _0x37a93c={'raw':!![],'where':{}};var _0x3f7dd0={};var _0x1e1e75={'count':0x0,'rows':[]};return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x47004b[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x5d8233,null))[_0xc565('0x24')](function(_0x28b54e){if(_0x28b54e){_0x3f7dd0['model']=_[_0xc565('0x33')](db[_0xc565('0x58')][_0xc565('0x45')]);_0x3f7dd0[_0xc565('0x32')]=_['keys'](_0x47004b[_0xc565('0x32')]);_0x3f7dd0[_0xc565('0x34')]=_['intersection'](_0x3f7dd0[_0xc565('0x31')],_0x3f7dd0[_0xc565('0x32')]);_0x37a93c[_0xc565('0x35')]=_[_0xc565('0x46')](_0x3f7dd0[_0xc565('0x31')],qs[_0xc565('0x47')](_0x47004b['query'][_0xc565('0x47')]));_0x37a93c[_0xc565('0x35')]=_0x37a93c[_0xc565('0x35')][_0xc565('0x36')]?_0x37a93c[_0xc565('0x35')]:_0x3f7dd0['model'];if(!_0x47004b[_0xc565('0x32')]['hasOwnProperty']('nolimit')){_0x37a93c['limit']=qs['limit'](_0x47004b['query']['limit']);_0x37a93c['offset']=qs['offset'](_0x47004b[_0xc565('0x32')][_0xc565('0x1a')]);}_0x37a93c[_0xc565('0x39')]=qs[_0xc565('0x3a')](_0x47004b[_0xc565('0x32')][_0xc565('0x3a')]);_0x37a93c[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x47004b[_0xc565('0x32')],_0x3f7dd0[_0xc565('0x34')]));_0x37a93c[_0xc565('0x3b')][_0xc565('0x59')]=_0x28b54e['id'];if(_0x47004b['query'][_0xc565('0x3d')]){_0x37a93c[_0xc565('0x3b')]=_['merge'](_0x37a93c[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x37a93c[_0xc565('0x35')],function(_0x5e8b12){var _0x8dff3e={};_0x8dff3e[_0x5e8b12]={'$like':'%'+_0x47004b[_0xc565('0x32')]['filter']+'%'};return _0x8dff3e;})});}_0x37a93c=_['merge']({},_0x37a93c,_0x47004b[_0xc565('0x3f')]);return db[_0xc565('0x58')]['count']({'where':_0x37a93c[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x27f5d9){_0x1e1e75['count']=_0x27f5d9;if(_0x47004b[_0xc565('0x32')][_0xc565('0x40')]){_0x37a93c[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x58')][_0xc565('0x42')](_0x37a93c);})[_0xc565('0x24')](function(_0x4a816b){_0x1e1e75['rows']=_0x4a816b;return _0x1e1e75;});}})[_0xc565('0x24')](respondWithFilteredResult(_0x5d8233,_0x37a93c))[_0xc565('0x52')](handleError(_0x5d8233,null));};exports[_0xc565('0x5a')]=function(_0x25a42c,_0x1c42e7,_0x115de6){var _0x5ec2e0={'raw':!![],'where':{}};var _0x519e44={};var _0x194202={'count':0x0,'rows':[]};return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x25a42c[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x1c42e7,null))['then'](function(_0xc99864){if(_0xc99864){_0x519e44[_0xc565('0x31')]=_[_0xc565('0x33')](db[_0xc565('0x5b')]['rawAttributes']);_0x519e44[_0xc565('0x32')]=_['keys'](_0x25a42c[_0xc565('0x32')]);_0x519e44[_0xc565('0x34')]=_['intersection'](_0x519e44[_0xc565('0x31')],_0x519e44[_0xc565('0x32')]);_0x5ec2e0[_0xc565('0x35')]=_[_0xc565('0x46')](_0x519e44[_0xc565('0x31')],qs['fields'](_0x25a42c[_0xc565('0x32')]['fields']));_0x5ec2e0[_0xc565('0x35')]=_0x5ec2e0['attributes']['length']?_0x5ec2e0[_0xc565('0x35')]:_0x519e44[_0xc565('0x31')];if(!_0x25a42c[_0xc565('0x32')][_0xc565('0x37')]('nolimit')){_0x5ec2e0[_0xc565('0x1c')]=qs['limit'](_0x25a42c[_0xc565('0x32')]['limit']);_0x5ec2e0[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x25a42c[_0xc565('0x32')][_0xc565('0x1a')]);}_0x5ec2e0[_0xc565('0x39')]=qs['sort'](_0x25a42c['query'][_0xc565('0x3a')]);_0x5ec2e0['where']=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x25a42c['query'],_0x519e44[_0xc565('0x34')]));_0x5ec2e0[_0xc565('0x3b')][_0xc565('0x59')]=_0xc99864['id'];if(_0x25a42c[_0xc565('0x32')][_0xc565('0x3d')]){_0x5ec2e0[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x5ec2e0[_0xc565('0x3b')],{'$or':_['map'](_0x5ec2e0[_0xc565('0x35')],function(_0x234a51){var _0x4c74e5={};_0x4c74e5[_0x234a51]={'$like':'%'+_0x25a42c[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x4c74e5;})});}_0x5ec2e0=_[_0xc565('0x3e')]({},_0x5ec2e0,_0x25a42c[_0xc565('0x3f')]);return db[_0xc565('0x5b')][_0xc565('0x1d')]({'where':_0x5ec2e0[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x735821){_0x194202[_0xc565('0x1d')]=_0x735821;if(_0x25a42c[_0xc565('0x32')][_0xc565('0x40')]){_0x5ec2e0[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x5b')][_0xc565('0x42')](_0x5ec2e0);})[_0xc565('0x24')](function(_0x32c630){_0x194202[_0xc565('0x5c')]=_0x32c630;return _0x194202;});}})['then'](respondWithFilteredResult(_0x1c42e7,_0x5ec2e0))['catch'](handleError(_0x1c42e7,null));};exports[_0xc565('0x5d')]=function(_0x3a2217,_0xaf4f7f,_0x2b4fb2){var _0x454664={'raw':!![],'where':{}};var _0x3f083d={};var _0x10e7b4={'count':0x0,'rows':[]};return db[_0xc565('0x2e')]['findOne']({'where':{'id':_0x3a2217['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0xaf4f7f,null))['then'](function(_0x312027){if(_0x312027){_0x3f083d[_0xc565('0x31')]=_[_0xc565('0x33')](db['CmHopperFinal'][_0xc565('0x45')]);_0x3f083d[_0xc565('0x32')]=_[_0xc565('0x33')](_0x3a2217[_0xc565('0x32')]);_0x3f083d[_0xc565('0x34')]=_[_0xc565('0x46')](_0x3f083d[_0xc565('0x31')],_0x3f083d[_0xc565('0x32')]);_0x454664[_0xc565('0x35')]=_[_0xc565('0x46')](_0x3f083d[_0xc565('0x31')],qs[_0xc565('0x47')](_0x3a2217['query']['fields']));_0x454664[_0xc565('0x35')]=_0x454664[_0xc565('0x35')][_0xc565('0x36')]?_0x454664[_0xc565('0x35')]:_0x3f083d[_0xc565('0x31')];if(!_0x3a2217[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x454664[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x3a2217[_0xc565('0x32')][_0xc565('0x1c')]);_0x454664[_0xc565('0x1a')]=qs['offset'](_0x3a2217['query'][_0xc565('0x1a')]);}_0x454664['order']=qs[_0xc565('0x3a')](_0x3a2217[_0xc565('0x32')]['sort']);_0x454664[_0xc565('0x3b')]=qs[_0xc565('0x34')](_['pick'](_0x3a2217[_0xc565('0x32')],_0x3f083d[_0xc565('0x34')]));_0x454664['where'][_0xc565('0x59')]=_0x312027['id'];if(_0x3a2217[_0xc565('0x32')][_0xc565('0x3d')]){_0x454664[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x454664[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x454664[_0xc565('0x35')],function(_0x2326fa){var _0x75b9f3={};_0x75b9f3[_0x2326fa]={'$like':'%'+_0x3a2217['query']['filter']+'%'};return _0x75b9f3;})});}_0x454664=_[_0xc565('0x3e')]({},_0x454664,_0x3a2217[_0xc565('0x3f')]);return db[_0xc565('0x5e')]['count']({'where':_0x454664[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x4131f6){_0x10e7b4[_0xc565('0x1d')]=_0x4131f6;if(_0x3a2217[_0xc565('0x32')][_0xc565('0x40')]){_0x454664['include']=[{'all':!![]}];}return db[_0xc565('0x5e')][_0xc565('0x42')](_0x454664);})['then'](function(_0x1d7106){_0x10e7b4[_0xc565('0x5c')]=_0x1d7106;return _0x10e7b4;});}})[_0xc565('0x24')](respondWithFilteredResult(_0xaf4f7f,_0x454664))[_0xc565('0x52')](handleError(_0xaf4f7f,null));};exports[_0xc565('0x5f')]=function(_0x31c579,_0x43f0b3,_0x115a26){var _0x5bc838={'raw':!![],'where':{}};var _0x353d6e={};var _0x146a9c={'count':0x0,'rows':[]};return db[_0xc565('0x2e')]['findOne']({'where':{'id':_0x31c579[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x43f0b3,null))[_0xc565('0x24')](function(_0x24509f){if(_0x24509f){_0x353d6e[_0xc565('0x31')]=_['keys'](db[_0xc565('0x60')][_0xc565('0x45')]);_0x353d6e[_0xc565('0x32')]=_[_0xc565('0x33')](_0x31c579[_0xc565('0x32')]);_0x353d6e['filters']=_['intersection'](_0x353d6e[_0xc565('0x31')],_0x353d6e[_0xc565('0x32')]);_0x5bc838[_0xc565('0x35')]=_[_0xc565('0x46')](_0x353d6e[_0xc565('0x31')],qs[_0xc565('0x47')](_0x31c579[_0xc565('0x32')][_0xc565('0x47')]));_0x5bc838[_0xc565('0x35')]=_0x5bc838['attributes'][_0xc565('0x36')]?_0x5bc838['attributes']:_0x353d6e['model'];if(!_0x31c579['query'][_0xc565('0x37')]('nolimit')){_0x5bc838[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x31c579['query'][_0xc565('0x1c')]);_0x5bc838[_0xc565('0x1a')]=qs['offset'](_0x31c579[_0xc565('0x32')][_0xc565('0x1a')]);}_0x5bc838[_0xc565('0x39')]=qs['sort'](_0x31c579['query'][_0xc565('0x3a')]);_0x5bc838[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x31c579[_0xc565('0x32')],_0x353d6e[_0xc565('0x34')]));_0x5bc838[_0xc565('0x3b')]['CampaignId']=_0x24509f['id'];if(_0x31c579[_0xc565('0x32')][_0xc565('0x3d')]){_0x5bc838['where']=_[_0xc565('0x3e')](_0x5bc838[_0xc565('0x3b')],{'$or':_['map'](_0x5bc838[_0xc565('0x35')],function(_0x1711e2){var _0x5e1a86={};_0x5e1a86[_0x1711e2]={'$like':'%'+_0x31c579[_0xc565('0x32')]['filter']+'%'};return _0x5e1a86;})});}_0x5bc838=_[_0xc565('0x3e')]({},_0x5bc838,_0x31c579['options']);return db[_0xc565('0x60')][_0xc565('0x1d')]({'where':_0x5bc838[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x38d32c){_0x146a9c['count']=_0x38d32c;if(_0x31c579[_0xc565('0x32')][_0xc565('0x40')]){_0x5bc838[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x60')]['findAll'](_0x5bc838);})[_0xc565('0x24')](function(_0xcb16e){_0x146a9c[_0xc565('0x5c')]=_0xcb16e;return _0x146a9c;});}})['then'](respondWithFilteredResult(_0x43f0b3,_0x5bc838))[_0xc565('0x52')](handleError(_0x43f0b3,null));};exports['getLists']=function(_0x337bb9,_0x54dfb4,_0x426ea8){var _0x201b2e={};var _0x358407={};var _0x2446cb;var _0x8f9f02;return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x337bb9[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x54dfb4,null))[_0xc565('0x24')](function(_0x36cd5c){if(_0x36cd5c){_0x2446cb=_0x36cd5c;_0x358407['model']=_[_0xc565('0x33')](db[_0xc565('0x61')]['rawAttributes']);_0x358407[_0xc565('0x32')]=_['keys'](_0x337bb9[_0xc565('0x32')]);_0x358407[_0xc565('0x34')]=_[_0xc565('0x46')](_0x358407['model'],_0x358407['query']);_0x201b2e[_0xc565('0x35')]=_[_0xc565('0x46')](_0x358407['model'],qs[_0xc565('0x47')](_0x337bb9['query']['fields']));_0x201b2e[_0xc565('0x35')]=_0x201b2e[_0xc565('0x35')]['length']?_0x201b2e['attributes']:_0x358407[_0xc565('0x31')];_0x201b2e['order']=qs[_0xc565('0x3a')](_0x337bb9[_0xc565('0x32')][_0xc565('0x3a')]);_0x201b2e[_0xc565('0x3b')]=qs[_0xc565('0x34')](_['pick'](_0x337bb9[_0xc565('0x32')],_0x358407[_0xc565('0x34')]));if(_0x337bb9['query'][_0xc565('0x3d')]){_0x201b2e['where']=_[_0xc565('0x3e')](_0x201b2e[_0xc565('0x3b')],{'$or':_['map'](_0x201b2e[_0xc565('0x35')],function(_0x4180dc){var _0x50938f={};_0x50938f[_0x4180dc]={'$like':'%'+_0x337bb9['query'][_0xc565('0x3d')]+'%'};return _0x50938f;})});}_0x201b2e=_[_0xc565('0x3e')]({},_0x201b2e,_0x337bb9[_0xc565('0x3f')]);return _0x2446cb[_0xc565('0x62')](_0x201b2e);}})['then'](function(_0x70a69d){if(_0x70a69d){_0x8f9f02=_0x70a69d[_0xc565('0x36')];if(!_0x337bb9[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x201b2e[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x337bb9[_0xc565('0x32')]['limit']);_0x201b2e[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x337bb9[_0xc565('0x32')]['offset']);}return _0x2446cb[_0xc565('0x62')](_0x201b2e);}})['then'](function(_0x29c54b){if(_0x29c54b){return _0x29c54b?{'count':_0x8f9f02,'rows':_0x29c54b}:null;}})[_0xc565('0x24')](respondWithResult(_0x54dfb4,null))[_0xc565('0x52')](handleError(_0x54dfb4,null));};exports[_0xc565('0x63')]=function(_0x1ee4d6,_0x21f094,_0x15a7f8){var _0x3f5685,_0x1721e4;var _0xd3059e=[];var _0x58f233=moment()[_0xc565('0x64')](_0xc565('0x65'));return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x1ee4d6[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x21f094,null))[_0xc565('0x24')](function(_0x5d1787){if(_0x5d1787){_0x1721e4=_0x5d1787;return _0x5d1787[_0xc565('0x63')](_0x1ee4d6[_0xc565('0x4a')][_0xc565('0x66')],_[_0xc565('0x54')](_0x1ee4d6[_0xc565('0x4a')],[_0xc565('0x66'),'id'])||{});}return null;})[_0xc565('0x67')](function(_0x3f6764){var _0x17dda1;var _0x44ed4e;_0x3f5685=_0x3f6764||[];var _0x504a6c=[];if(_0x3f6764){for(var _0x1e1598=0x0;_0x1e1598<_0x3f6764[_0xc565('0x36')];_0x1e1598+=0x1){var _0x1fc403=_0x3f6764[_0x1e1598][_0xc565('0x4c')]({'plain':!![]});_0x1721e4[_0xc565('0x68')]=_0x1ee4d6[_0xc565('0x4a')][_0xc565('0x68')]?_0x1ee4d6['body'][_0xc565('0x68')]:_0x1721e4['dialCheckDuplicateType'];switch(_0x1721e4[_0xc565('0x68')]){case _0xc565('0x69'):_0x17dda1=squel[_0xc565('0x6a')]()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x6f'),_0xc565('0x70'),_0xc565('0x71'),'CampaignId',_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')]('phone','phone')['field'](_0xc565('0x74'),_0xc565('0x6f'))['field']('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403[_0xc565('0x75')][_0xc565('0x76')](),_0xc565('0x71'))[_0xc565('0x73')](_0x1ee4d6['params']['id']['toString'](),_0xc565('0x59'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27','createdAt')['field']('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x78'))[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403['CmListId'][_0xc565('0x76')]())['where'](_0xc565('0x7b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xc565('0x72')]()[_0xc565('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0xc565('0x77')](_0xc565('0x7c'))['where'](_0xc565('0x7d'),_0x1ee4d6[_0xc565('0x44')]['id'][_0xc565('0x76')]()))[_0xc565('0x3b')](_0xc565('0x7e'),squel['select']()[_0xc565('0x73')]('COALESCE(phone,\x27\x27)')[_0xc565('0x77')](_0xc565('0x6c'))[_0xc565('0x3b')](_0xc565('0x7d'),_0x1ee4d6['params']['id'][_0xc565('0x76')]())))[_0xc565('0x76')]();break;case _0xc565('0x7f'):_0x17dda1=squel['insert']()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x6f'),_0xc565('0x70'),_0xc565('0x71'),_0xc565('0x59'),_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x6e'),_0xc565('0x6e'))[_0xc565('0x73')]('NOW()',_0xc565('0x6f'))[_0xc565('0x73')]('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403['CmListId']['toString'](),'ListId')[_0xc565('0x73')](_0x1ee4d6['params']['id']['toString'](),'CampaignId')[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')]('cm_contacts')['where'](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b'))[_0xc565('0x3b')](_0xc565('0x7e'),squel['select']()['field'](_0xc565('0x80'))[_0xc565('0x77')](_0xc565('0x6c'))['where'](_0xc565('0x7d'),_0x1ee4d6['params']['id'][_0xc565('0x76')]())))[_0xc565('0x76')]();break;default:_0x17dda1=squel['insert']()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')](['phone',_0xc565('0x6f'),_0xc565('0x70'),'ListId',_0xc565('0x59'),_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x6e'),'phone')[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x6f'))[_0xc565('0x73')]('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403['CmListId'][_0xc565('0x76')](),_0xc565('0x71'))[_0xc565('0x73')](_0x1ee4d6[_0xc565('0x44')]['id'][_0xc565('0x76')](),_0xc565('0x59'))['field']('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x78'))[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b')))[_0xc565('0x76')]();}_0x44ed4e=squel[_0xc565('0x6a')]()[_0xc565('0x6b')](_0xc565('0x81'))['fromQuery']([_0xc565('0x82'),'scheduledAt','phone','OrderBy','createdAt',_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x83'),'id')[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x6f'))['field']('ci.item','phone')[_0xc565('0x73')](_0xc565('0x84'),_0xc565('0x85'))['field']('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x86'),'ci')[_0xc565('0x87')](_0xc565('0x6c'),'h',_0xc565('0x88'))[_0xc565('0x3b')](_0xc565('0x89'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x8a'),_0x1ee4d6[_0xc565('0x44')]['id']['toString']())[_0xc565('0x3b')](_0xc565('0x8b'),_0x58f233))[_0xc565('0x76')]();_0x504a6c[_0xc565('0x8c')](db[_0xc565('0x8d')][_0xc565('0x32')](_0x17dda1));_0xd3059e[_0xc565('0x8c')](db[_0xc565('0x8d')][_0xc565('0x32')](_0x44ed4e));}return BPromise[_0xc565('0x8e')](_0x504a6c);}})[_0xc565('0x24')](function(){return BPromise['all'](_0xd3059e);})['then'](function(){return _0x3f5685;})['then'](respondWithResult(_0x21f094,null))[_0xc565('0x52')](handleError(_0x21f094,null));};exports[_0xc565('0x8f')]=function(_0x5c3c8e,_0x1dfebf,_0x2077f3){return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x5c3c8e[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x1dfebf,null))[_0xc565('0x24')](function(_0x5c08bd){if(_0x5c08bd){return _0x5c08bd[_0xc565('0x8f')](_0x5c3c8e[_0xc565('0x32')][_0xc565('0x66')]);}})[_0xc565('0x24')](function(_0x4cfe25){if(_0x4cfe25){return db['CmHopper']['destroy']({'where':{'ListId':_0x5c3c8e[_0xc565('0x32')][_0xc565('0x66')],'CampaignId':_0x5c3c8e[_0xc565('0x44')]['id']}})[_0xc565('0x24')](function(){return _0x4cfe25;});}})[_0xc565('0x24')](respondWithStatusCode(_0x1dfebf,null))[_0xc565('0x52')](handleError(_0x1dfebf,null));};exports[_0xc565('0x90')]=function(_0x4ea3a9,_0x2b7e29,_0x1a86ff){var _0x582096={};var _0x5f089e={};var _0x39bebb;var _0x3609f0;return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x4ea3a9[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x2b7e29,null))[_0xc565('0x24')](function(_0x46b6b3){if(_0x46b6b3){_0x39bebb=_0x46b6b3;_0x5f089e[_0xc565('0x31')]=_['keys'](db['CmList'][_0xc565('0x45')]);_0x5f089e[_0xc565('0x32')]=_[_0xc565('0x33')](_0x4ea3a9['query']);_0x5f089e[_0xc565('0x34')]=_[_0xc565('0x46')](_0x5f089e[_0xc565('0x31')],_0x5f089e[_0xc565('0x32')]);_0x582096[_0xc565('0x35')]=_[_0xc565('0x46')](_0x5f089e[_0xc565('0x31')],qs[_0xc565('0x47')](_0x4ea3a9['query']['fields']));_0x582096[_0xc565('0x35')]=_0x582096['attributes'][_0xc565('0x36')]?_0x582096[_0xc565('0x35')]:_0x5f089e[_0xc565('0x31')];_0x582096['order']=qs[_0xc565('0x3a')](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3a')]);_0x582096[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x4ea3a9[_0xc565('0x32')],_0x5f089e[_0xc565('0x34')]));if(_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3d')]){_0x582096[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x582096[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x582096[_0xc565('0x35')],function(_0x2f0b73){var _0x26f43e={};_0x26f43e[_0x2f0b73]={'$like':'%'+_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x26f43e;})});}_0x582096=_[_0xc565('0x3e')]({},_0x582096,_0x4ea3a9['options']);return _0x39bebb[_0xc565('0x90')](_0x582096);}})['then'](function(_0x3d1a0a){if(_0x3d1a0a){_0x3609f0=_0x3d1a0a[_0xc565('0x36')];if(!_0x4ea3a9[_0xc565('0x32')]['hasOwnProperty'](_0xc565('0x38'))){_0x582096[_0xc565('0x1c')]=qs['limit'](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x1c')]);_0x582096[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x1a')]);}return _0x39bebb[_0xc565('0x90')](_0x582096);}})[_0xc565('0x24')](function(_0x178a31){if(_0x178a31){return _0x178a31?{'count':_0x3609f0,'rows':_0x178a31}:null;}})[_0xc565('0x24')](respondWithResult(_0x2b7e29,null))['catch'](handleError(_0x2b7e29,null));};exports[_0xc565('0x91')]=function(_0x277480,_0x2915b0,_0x231bb4){var _0x369380,_0x4d4d60;var _0x582431=[];var _0x3a3231=moment()[_0xc565('0x64')](_0xc565('0x65'));return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x277480['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x2915b0,null))['then'](function(_0x3bb885){if(_0x3bb885){_0x4d4d60=_0x3bb885;return _0x3bb885[_0xc565('0x91')](_0x277480[_0xc565('0x4a')][_0xc565('0x66')],_[_0xc565('0x54')](_0x277480[_0xc565('0x4a')],[_0xc565('0x66'),'id'])||{});}return null;})[_0xc565('0x67')](function(_0x4e9adb){var _0x3118f4;var _0xe2d1cb;_0x369380=_0x4e9adb||[];var _0x4ef476=[];if(_0x4e9adb){for(var _0x211cc8=0x0;_0x211cc8<_0x4e9adb[_0xc565('0x36')];_0x211cc8+=0x1){var _0x1cb366=_0x4e9adb[_0x211cc8][_0xc565('0x4c')]({'plain':!![]});_0x3118f4=squel[_0xc565('0x6a')]()['into'](_0xc565('0x92'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x70'),_0xc565('0x71'),_0xc565('0x59'),'createdAt','updatedAt'],squel[_0xc565('0x72')]()[_0xc565('0x73')]('phone',_0xc565('0x6e'))['field']('id',_0xc565('0x70'))['field'](_0x1cb366[_0xc565('0x75')][_0xc565('0x76')](),'ListId')['field'](_0x277480[_0xc565('0x44')]['id'][_0xc565('0x76')](),_0xc565('0x59'))[_0xc565('0x73')]('NOW()',_0xc565('0x55'))[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x56'))['from']('cm_contacts')[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1cb366[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b')))[_0xc565('0x76')]();_0x4ef476['push'](db[_0xc565('0x8d')][_0xc565('0x32')](_0x3118f4));}return BPromise[_0xc565('0x8e')](_0x4ef476);}})[_0xc565('0x24')](function(){return _0x369380;})[_0xc565('0x24')](respondWithResult(_0x2915b0,null))[_0xc565('0x52')](handleError(_0x2915b0,null));};exports[_0xc565('0x93')]=function(_0x40f562,_0x1ee15d,_0x48d094){return db[_0xc565('0x2e')]['find']({'where':{'id':_0x40f562[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ee15d,null))[_0xc565('0x24')](function(_0x397435){if(_0x397435){return _0x397435[_0xc565('0x93')](_0x40f562[_0xc565('0x32')][_0xc565('0x66')]);}})[_0xc565('0x24')](function(_0x2f4bce){if(_0x2f4bce){return db['CmHopperBlack'][_0xc565('0x23')]({'where':{'ListId':_0x40f562[_0xc565('0x32')][_0xc565('0x66')],'CampaignId':_0x40f562[_0xc565('0x44')]['id']}})[_0xc565('0x24')](function(){return _0x2f4bce;});}})[_0xc565('0x24')](respondWithStatusCode(_0x1ee15d,null))[_0xc565('0x52')](handleError(_0x1ee15d,null));};
\ No newline at end of file
+var _0x4ffe=['show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','push','sequelize','all','removeLists','ids','getBlackLists','format','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch'];(function(_0x335e24,_0x3fbd76){var _0x3e3b08=function(_0x19ee98){while(--_0x19ee98){_0x335e24['push'](_0x335e24['shift']());}};_0x3e3b08(++_0x3fbd76);}(_0x4ffe,0x172));var _0xe4ff=function(_0x513835,_0x93de04){_0x513835=_0x513835-0x0;var _0x567b24=_0x4ffe[_0x513835];return _0x567b24;};'use strict';var emlformat=require(_0xe4ff('0x0'));var rimraf=require(_0xe4ff('0x1'));var zipdir=require(_0xe4ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4ff('0x3'));var moment=require(_0xe4ff('0x4'));var BPromise=require(_0xe4ff('0x5'));var Mustache=require('mustache');var util=require(_0xe4ff('0x6'));var path=require(_0xe4ff('0x7'));var sox=require(_0xe4ff('0x8'));var csv=require(_0xe4ff('0x9'));var ejs=require(_0xe4ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4ff('0xb'));var squel=require(_0xe4ff('0xc'));var crypto=require(_0xe4ff('0xd'));var jsforce=require(_0xe4ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe4ff('0x9'));var querystring=require('querystring');var Papa=require(_0xe4ff('0xf'));var Redis=require(_0xe4ff('0x10'));var authService=require(_0xe4ff('0x11'));var qs=require(_0xe4ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4ff('0x13'))(_0xe4ff('0x14'));var utils=require(_0xe4ff('0x15'));var config=require(_0xe4ff('0x16'));var licenseUtil=require(_0xe4ff('0x17'));var db=require(_0xe4ff('0x18'))['db'];function respondWithStatusCode(_0x4d6721,_0x40b932){_0x40b932=_0x40b932||0xcc;return function(_0x20c8c1){if(_0x20c8c1){return _0x4d6721['sendStatus'](_0x40b932);}return _0x4d6721[_0xe4ff('0x19')](_0x40b932)['end']();};}function respondWithResult(_0xb6c406,_0x2d5182){_0x2d5182=_0x2d5182||0xc8;return function(_0x5702dc){if(_0x5702dc){return _0xb6c406[_0xe4ff('0x19')](_0x2d5182)[_0xe4ff('0x1a')](_0x5702dc);}};}function respondWithFilteredResult(_0x1d0664,_0x30db8f){return function(_0x2b7212){if(_0x2b7212){var _0x416889=typeof _0x30db8f['offset']===_0xe4ff('0x1b')&&typeof _0x30db8f[_0xe4ff('0x1c')]===_0xe4ff('0x1b');var _0x5da39b=_0x2b7212['count'];var _0x342bad=_0x416889?0x0:_0x30db8f[_0xe4ff('0x1d')];var _0x2f89d0=_0x416889?_0x2b7212[_0xe4ff('0x1e')]:_0x30db8f['offset']+_0x30db8f[_0xe4ff('0x1c')];var _0x39c753;if(_0x2f89d0>=_0x5da39b){_0x2f89d0=_0x5da39b;_0x39c753=0xc8;}else{_0x39c753=0xce;}_0x1d0664[_0xe4ff('0x19')](_0x39c753);return _0x1d0664[_0xe4ff('0x1f')](_0xe4ff('0x20'),_0x342bad+'-'+_0x2f89d0+'/'+_0x5da39b)['json'](_0x2b7212);}return null;};}function patchUpdates(_0x323864){return function(_0xfa6146){try{jsonpatch[_0xe4ff('0x21')](_0xfa6146,_0x323864,!![]);}catch(_0x3a7511){return BPromise[_0xe4ff('0x22')](_0x3a7511);}return _0xfa6146[_0xe4ff('0x23')]();};}function saveUpdates(_0x5df979,_0xb7c50){return function(_0x57f868){if(_0x57f868){return _0x57f868[_0xe4ff('0x24')](_0x5df979)[_0xe4ff('0x25')](function(_0x47d9c3){return _0x47d9c3;});}return null;};}function removeEntity(_0x2044ca,_0x5c9345){return function(_0xf8e190){if(_0xf8e190){return _0xf8e190[_0xe4ff('0x26')]()[_0xe4ff('0x25')](function(){var _0x1a0f3c=_0xf8e190[_0xe4ff('0x27')]({'plain':!![]});var _0xfa00a5=_0xe4ff('0x28');return db[_0xe4ff('0x29')][_0xe4ff('0x26')]({'where':{'type':_0xfa00a5,'resourceId':_0x1a0f3c['id']}})[_0xe4ff('0x25')](function(){return _0xf8e190;});})[_0xe4ff('0x25')](function(){_0x2044ca[_0xe4ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e28a,_0x768c03){return function(_0x1fd9e3){if(!_0x1fd9e3){_0x28e28a[_0xe4ff('0x2a')](0x194);}return _0x1fd9e3;};}function handleError(_0x320a5c,_0x240892){_0x240892=_0x240892||0x1f4;return function(_0x49c9a3){logger[_0xe4ff('0x2b')](_0x49c9a3[_0xe4ff('0x2c')]);if(_0x49c9a3[_0xe4ff('0x2d')]){delete _0x49c9a3['name'];}_0x320a5c[_0xe4ff('0x19')](_0x240892)['send'](_0x49c9a3);};}exports[_0xe4ff('0x2e')]=function(_0x1334b2,_0x59c3dc){var _0x56a5cc={},_0x4439be={},_0x1fd76b={'count':0x0,'rows':[]};var _0x295531=_[_0xe4ff('0x2f')](db[_0xe4ff('0x30')][_0xe4ff('0x31')],function(_0x37ac7d){return{'name':_0x37ac7d[_0xe4ff('0x32')],'type':_0x37ac7d['type'][_0xe4ff('0x33')]};});_0x4439be[_0xe4ff('0x34')]=_[_0xe4ff('0x2f')](_0x295531,_0xe4ff('0x2d'));_0x4439be[_0xe4ff('0x35')]=_['keys'](_0x1334b2['query']);_0x4439be[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x4439be[_0xe4ff('0x34')],_0x4439be[_0xe4ff('0x35')]);_0x56a5cc[_0xe4ff('0x38')]=_['intersection'](_0x4439be[_0xe4ff('0x34')],qs['fields'](_0x1334b2[_0xe4ff('0x35')]['fields']));_0x56a5cc[_0xe4ff('0x38')]=_0x56a5cc['attributes'][_0xe4ff('0x39')]?_0x56a5cc['attributes']:_0x4439be[_0xe4ff('0x34')];if(!_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x56a5cc['limit']=qs[_0xe4ff('0x1c')](_0x1334b2['query'][_0xe4ff('0x1c')]);_0x56a5cc[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x1334b2[_0xe4ff('0x35')]['offset']);}_0x56a5cc[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x56a5cc[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x1334b2[_0xe4ff('0x35')],_0x4439be[_0xe4ff('0x36')]),_0x295531);if(_0x1334b2[_0xe4ff('0x35')]['filter']){_0x56a5cc[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x56a5cc[_0xe4ff('0x3e')],{'$or':_[_0xe4ff('0x2f')](_0x295531,function(_0x459246){if(_0x459246[_0xe4ff('0x41')]!==_0xe4ff('0x42')){var _0x4374d3={};_0x4374d3[_0x459246[_0xe4ff('0x2d')]]={'$like':'%'+_0x1334b2[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x4374d3;}})});}_0x56a5cc=_[_0xe4ff('0x40')]({},_0x56a5cc,_0x1334b2[_0xe4ff('0x44')]);var _0x4bebe7={'where':_0x56a5cc['where']};return db[_0xe4ff('0x30')]['count'](_0x4bebe7)[_0xe4ff('0x25')](function(_0x2ac135){_0x1fd76b['count']=_0x2ac135;if(_0x1334b2['query'][_0xe4ff('0x45')]){_0x56a5cc[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x30')][_0xe4ff('0x47')](_0x56a5cc);})[_0xe4ff('0x25')](function(_0x222434){_0x1fd76b[_0xe4ff('0x48')]=_0x222434;return _0x1fd76b;})['then'](respondWithFilteredResult(_0x59c3dc,_0x56a5cc))[_0xe4ff('0x49')](handleError(_0x59c3dc,null));};exports[_0xe4ff('0x4a')]=function(_0x5b7d8f,_0x38ab43){var _0x31adb6={'raw':![],'where':{'id':_0x5b7d8f[_0xe4ff('0x4b')]['id']}},_0x55cfdf={};_0x55cfdf[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x30')][_0xe4ff('0x31')]);_0x55cfdf['query']=_[_0xe4ff('0x4c')](_0x5b7d8f['query']);_0x55cfdf[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x55cfdf[_0xe4ff('0x34')],_0x55cfdf['query']);_0x31adb6[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x55cfdf[_0xe4ff('0x34')],qs['fields'](_0x5b7d8f['query'][_0xe4ff('0x4d')]));_0x31adb6['attributes']=_0x31adb6[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x31adb6[_0xe4ff('0x38')]:_0x55cfdf['model'];if(_0x5b7d8f[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x31adb6[_0xe4ff('0x46')]=[{'all':!![]}];}_0x31adb6=_[_0xe4ff('0x40')]({},_0x31adb6,_0x5b7d8f[_0xe4ff('0x44')]);return db[_0xe4ff('0x30')][_0xe4ff('0x4e')](_0x31adb6)[_0xe4ff('0x25')](handleEntityNotFound(_0x38ab43,null))[_0xe4ff('0x25')](respondWithResult(_0x38ab43,null))['catch'](handleError(_0x38ab43,null));};exports[_0xe4ff('0x4f')]=function(_0x1676c9,_0x1ee66f){return db[_0xe4ff('0x30')][_0xe4ff('0x4f')](_0x1676c9[_0xe4ff('0x50')],{})[_0xe4ff('0x25')](function(_0x4c1ca1){var _0x3d5a48=_0x1676c9[_0xe4ff('0x51')][_0xe4ff('0x27')]({'plain':!![]});if(!_0x3d5a48)throw new Error(_0xe4ff('0x52'));if(_0x3d5a48[_0xe4ff('0x53')]===_0xe4ff('0x51')){var _0x2d73f4=_0x4c1ca1[_0xe4ff('0x27')]({'plain':!![]});var _0x2590c6='IvrCampaigns';return db[_0xe4ff('0x54')]['find']({'where':{'name':_0x2590c6,'userProfileId':_0x3d5a48[_0xe4ff('0x55')]},'raw':!![]})[_0xe4ff('0x25')](function(_0x578c6c){if(_0x578c6c&&_0x578c6c[_0xe4ff('0x56')]===0x0){return db[_0xe4ff('0x29')][_0xe4ff('0x4f')]({'name':_0x2d73f4[_0xe4ff('0x2d')],'resourceId':_0x2d73f4['id'],'type':_0x578c6c[_0xe4ff('0x2d')],'sectionId':_0x578c6c['id']},{})['then'](function(){return _0x4c1ca1;});}else{return _0x4c1ca1;}})[_0xe4ff('0x49')](function(_0x557249){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x557249);throw _0x557249;});}return _0x4c1ca1;})[_0xe4ff('0x25')](respondWithResult(_0x1ee66f,0xc9))[_0xe4ff('0x49')](handleError(_0x1ee66f,null));};exports[_0xe4ff('0x57')]=function(_0x28cc81,_0xb710f0){var _0x494281={'where':{'id':_0x28cc81[_0xe4ff('0x4b')]['id']}},_0x1e2008={};_0x1e2008[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x30')][_0xe4ff('0x31')]);_0x494281[_0xe4ff('0x38')]=_['intersection'](_0x1e2008['model'],qs['fields'](_0x28cc81[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x494281['attributes']=_0x494281[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x494281[_0xe4ff('0x38')]:_0x1e2008[_0xe4ff('0x34')];if(_0x28cc81[_0xe4ff('0x35')]['includeAll']){_0x494281[_0xe4ff('0x46')]=[{'all':!![]}];}_0x494281=_['merge']({},_0x494281,_0x28cc81[_0xe4ff('0x44')]);return db[_0xe4ff('0x30')]['find'](_0x494281)[_0xe4ff('0x25')](handleEntityNotFound(_0xb710f0,null))[_0xe4ff('0x25')](function(_0x70f68a){if(_0x70f68a){var _0x27dd00=_0x70f68a[_0xe4ff('0x27')]({'plain':!![]});_0x27dd00=qs[_0xe4ff('0x58')](_0x27dd00,['id',_0xe4ff('0x59'),_0xe4ff('0x5a')]);_0x28cc81[_0xe4ff('0x50')]=_[_0xe4ff('0x58')](_0x28cc81[_0xe4ff('0x50')],['id',_0xe4ff('0x59'),_0xe4ff('0x5a')]);return db[_0xe4ff('0x30')][_0xe4ff('0x4f')](_[_0xe4ff('0x40')](_0x27dd00,_0x28cc81[_0xe4ff('0x50')]),{'include':_0x28cc81[_0xe4ff('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xe4ff('0x25')](function(_0x11cb09){var _0x30cfcb=_0x28cc81['user'][_0xe4ff('0x27')]({'plain':!![]});if(!_0x30cfcb)throw new Error(_0xe4ff('0x52'));if(_0x30cfcb['role']==='user'){var _0x443d4f=_0x11cb09[_0xe4ff('0x27')]({'plain':!![]});var _0xc744a2=_0xe4ff('0x28');return db[_0xe4ff('0x54')][_0xe4ff('0x4e')]({'where':{'name':_0xc744a2,'userProfileId':_0x30cfcb['userProfileId']},'raw':!![]})[_0xe4ff('0x25')](function(_0x2c701c){if(_0x2c701c&&_0x2c701c[_0xe4ff('0x56')]===0x0){return db[_0xe4ff('0x29')][_0xe4ff('0x4f')]({'name':_0x443d4f[_0xe4ff('0x2d')],'resourceId':_0x443d4f['id'],'type':_0x2c701c[_0xe4ff('0x2d')],'sectionId':_0x2c701c['id']},{})[_0xe4ff('0x25')](function(){return _0x11cb09;});}else{return _0x11cb09;}})[_0xe4ff('0x49')](function(_0x444f31){logger['error'](_0xe4ff('0x5b'),_0x444f31);throw _0x444f31;});}return _0x11cb09;});}})[_0xe4ff('0x25')](respondWithResult(_0xb710f0,0xc9))[_0xe4ff('0x49')](handleError(_0xb710f0,null));};exports[_0xe4ff('0x24')]=function(_0x2711d9,_0x283d37){if(_0x2711d9[_0xe4ff('0x50')]['id']){delete _0x2711d9[_0xe4ff('0x50')]['id'];}return db['Campaign'][_0xe4ff('0x4e')]({'where':{'id':_0x2711d9[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x283d37,null))[_0xe4ff('0x25')](saveUpdates(_0x2711d9[_0xe4ff('0x50')],null))[_0xe4ff('0x25')](respondWithResult(_0x283d37,null))['catch'](handleError(_0x283d37,null));};exports[_0xe4ff('0x26')]=function(_0x17077b,_0x404547){return db['Campaign']['find']({'where':{'id':_0x17077b[_0xe4ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x404547,null))[_0xe4ff('0x25')](removeEntity(_0x404547,null))[_0xe4ff('0x49')](handleError(_0x404547,null));};exports[_0xe4ff('0x5c')]=function(_0x46f633,_0x324723,_0x133ab0){var _0x186bd0={'raw':!![],'where':{}};var _0x147444={};var _0x134506={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x46f633[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x324723,null))[_0xe4ff('0x25')](function(_0x2c1855){if(_0x2c1855){_0x147444[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x5d')][_0xe4ff('0x31')]);_0x147444['query']=_[_0xe4ff('0x4c')](_0x46f633['query']);_0x147444[_0xe4ff('0x36')]=_['intersection'](_0x147444[_0xe4ff('0x34')],_0x147444[_0xe4ff('0x35')]);_0x186bd0['attributes']=_[_0xe4ff('0x37')](_0x147444[_0xe4ff('0x34')],qs['fields'](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x186bd0[_0xe4ff('0x38')]=_0x186bd0[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x186bd0[_0xe4ff('0x38')]:_0x147444[_0xe4ff('0x34')];if(!_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x3a')]('nolimit')){_0x186bd0['limit']=qs[_0xe4ff('0x1c')](_0x46f633[_0xe4ff('0x35')]['limit']);_0x186bd0['offset']=qs[_0xe4ff('0x1d')](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}_0x186bd0['order']=qs[_0xe4ff('0x3d')](_0x46f633[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x186bd0[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x46f633[_0xe4ff('0x35')],_0x147444[_0xe4ff('0x36')]));_0x186bd0[_0xe4ff('0x3e')][_0xe4ff('0x5e')]=_0x2c1855['id'];if(_0x46f633['query'][_0xe4ff('0x43')]){_0x186bd0['where']=_[_0xe4ff('0x40')](_0x186bd0[_0xe4ff('0x3e')],{'$or':_['map'](_0x186bd0[_0xe4ff('0x38')],function(_0x4d90d7){var _0x3f2b36={};_0x3f2b36[_0x4d90d7]={'$like':'%'+_0x46f633[_0xe4ff('0x35')]['filter']+'%'};return _0x3f2b36;})});}_0x186bd0=_[_0xe4ff('0x40')]({},_0x186bd0,_0x46f633['options']);return db[_0xe4ff('0x5d')][_0xe4ff('0x1e')]({'where':_0x186bd0[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x1cafdc){_0x134506['count']=_0x1cafdc;if(_0x46f633[_0xe4ff('0x35')]['includeAll']){_0x186bd0[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x5d')][_0xe4ff('0x47')](_0x186bd0);})[_0xe4ff('0x25')](function(_0x49f1fa){_0x134506['rows']=_0x49f1fa;return _0x134506;});}})['then'](respondWithFilteredResult(_0x324723,_0x186bd0))['catch'](handleError(_0x324723,null));};exports[_0xe4ff('0x5f')]=function(_0x18639e,_0x458b0c,_0x178e21){var _0x1feabc={'raw':!![],'where':{}};var _0x40d24f={};var _0x1c9813={'count':0x0,'rows':[]};return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x18639e['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x458b0c,null))[_0xe4ff('0x25')](function(_0x49659d){if(_0x49659d){_0x40d24f[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x61')][_0xe4ff('0x31')]);_0x40d24f[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x18639e['query']);_0x40d24f[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x40d24f[_0xe4ff('0x34')],_0x40d24f['query']);_0x1feabc['attributes']=_['intersection'](_0x40d24f[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x18639e[_0xe4ff('0x35')]['fields']));_0x1feabc[_0xe4ff('0x38')]=_0x1feabc[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x1feabc[_0xe4ff('0x38')]:_0x40d24f[_0xe4ff('0x34')];if(!_0x18639e['query'][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x1feabc[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x18639e['query'][_0xe4ff('0x1c')]);_0x1feabc[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x18639e['query'][_0xe4ff('0x1d')]);}_0x1feabc[_0xe4ff('0x3c')]=qs['sort'](_0x18639e[_0xe4ff('0x35')]['sort']);_0x1feabc[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x18639e[_0xe4ff('0x35')],_0x40d24f['filters']));_0x1feabc[_0xe4ff('0x3e')][_0xe4ff('0x5e')]=_0x49659d['id'];if(_0x18639e[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x1feabc[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x1feabc[_0xe4ff('0x3e')],{'$or':_[_0xe4ff('0x2f')](_0x1feabc[_0xe4ff('0x38')],function(_0x4017ac){var _0x354efa={};_0x354efa[_0x4017ac]={'$like':'%'+_0x18639e['query'][_0xe4ff('0x43')]+'%'};return _0x354efa;})});}_0x1feabc=_[_0xe4ff('0x40')]({},_0x1feabc,_0x18639e['options']);return db[_0xe4ff('0x61')][_0xe4ff('0x1e')]({'where':_0x1feabc[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0xb23fc5){_0x1c9813[_0xe4ff('0x1e')]=_0xb23fc5;if(_0x18639e[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x1feabc[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x61')][_0xe4ff('0x47')](_0x1feabc);})[_0xe4ff('0x25')](function(_0x61dec9){_0x1c9813[_0xe4ff('0x48')]=_0x61dec9;return _0x1c9813;});}})['then'](respondWithFilteredResult(_0x458b0c,_0x1feabc))[_0xe4ff('0x49')](handleError(_0x458b0c,null));};exports[_0xe4ff('0x62')]=function(_0x1316c2,_0x39e82e,_0x2fcfb7){var _0x55b5b4={'raw':!![],'where':{}};var _0x338521={};var _0xc5390c={'count':0x0,'rows':[]};return db['Campaign'][_0xe4ff('0x60')]({'where':{'id':_0x1316c2[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x39e82e,null))[_0xe4ff('0x25')](function(_0x47034e){if(_0x47034e){_0x338521[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x63')]['rawAttributes']);_0x338521[_0xe4ff('0x35')]=_['keys'](_0x1316c2['query']);_0x338521[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x338521[_0xe4ff('0x34')],_0x338521[_0xe4ff('0x35')]);_0x55b5b4[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x338521[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x55b5b4[_0xe4ff('0x38')]=_0x55b5b4[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x55b5b4['attributes']:_0x338521[_0xe4ff('0x34')];if(!_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x3a')]('nolimit')){_0x55b5b4[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x55b5b4[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x1316c2['query'][_0xe4ff('0x1d')]);}_0x55b5b4[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x55b5b4[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x1316c2['query'],_0x338521[_0xe4ff('0x36')]));_0x55b5b4['where']['CampaignId']=_0x47034e['id'];if(_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x55b5b4['where']=_[_0xe4ff('0x40')](_0x55b5b4['where'],{'$or':_[_0xe4ff('0x2f')](_0x55b5b4['attributes'],function(_0x34bd60){var _0x2c8aef={};_0x2c8aef[_0x34bd60]={'$like':'%'+_0x1316c2[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x2c8aef;})});}_0x55b5b4=_[_0xe4ff('0x40')]({},_0x55b5b4,_0x1316c2['options']);return db[_0xe4ff('0x63')]['count']({'where':_0x55b5b4[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x156ecf){_0xc5390c['count']=_0x156ecf;if(_0x1316c2['query'][_0xe4ff('0x45')]){_0x55b5b4[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x63')]['findAll'](_0x55b5b4);})['then'](function(_0x24d042){_0xc5390c[_0xe4ff('0x48')]=_0x24d042;return _0xc5390c;});}})[_0xe4ff('0x25')](respondWithFilteredResult(_0x39e82e,_0x55b5b4))[_0xe4ff('0x49')](handleError(_0x39e82e,null));};exports[_0xe4ff('0x64')]=function(_0x4176d4,_0x241f55,_0x4de2a3){var _0x268dbd={'raw':!![],'where':{}};var _0x950fea={};var _0x4e46f8={'count':0x0,'rows':[]};return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x4176d4['params']['id']}})['then'](handleEntityNotFound(_0x241f55,null))['then'](function(_0x99792a){if(_0x99792a){_0x950fea[_0xe4ff('0x34')]=_['keys'](db[_0xe4ff('0x65')][_0xe4ff('0x31')]);_0x950fea[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x4176d4[_0xe4ff('0x35')]);_0x950fea['filters']=_[_0xe4ff('0x37')](_0x950fea[_0xe4ff('0x34')],_0x950fea[_0xe4ff('0x35')]);_0x268dbd[_0xe4ff('0x38')]=_[_0xe4ff('0x37')](_0x950fea[_0xe4ff('0x34')],qs[_0xe4ff('0x4d')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x268dbd[_0xe4ff('0x38')]=_0x268dbd[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x268dbd[_0xe4ff('0x38')]:_0x950fea[_0xe4ff('0x34')];if(!_0x4176d4['query']['hasOwnProperty']('nolimit')){_0x268dbd[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x268dbd[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}_0x268dbd['order']=qs[_0xe4ff('0x3d')](_0x4176d4['query'][_0xe4ff('0x3d')]);_0x268dbd[_0xe4ff('0x3e')]=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x4176d4[_0xe4ff('0x35')],_0x950fea[_0xe4ff('0x36')]));_0x268dbd['where'][_0xe4ff('0x5e')]=_0x99792a['id'];if(_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x268dbd[_0xe4ff('0x3e')]=_['merge'](_0x268dbd['where'],{'$or':_[_0xe4ff('0x2f')](_0x268dbd[_0xe4ff('0x38')],function(_0x50c2f0){var _0x3cd5b0={};_0x3cd5b0[_0x50c2f0]={'$like':'%'+_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x3cd5b0;})});}_0x268dbd=_[_0xe4ff('0x40')]({},_0x268dbd,_0x4176d4[_0xe4ff('0x44')]);return db[_0xe4ff('0x65')][_0xe4ff('0x1e')]({'where':_0x268dbd[_0xe4ff('0x3e')]})[_0xe4ff('0x25')](function(_0x15ded9){_0x4e46f8[_0xe4ff('0x1e')]=_0x15ded9;if(_0x4176d4[_0xe4ff('0x35')][_0xe4ff('0x45')]){_0x268dbd[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x65')][_0xe4ff('0x47')](_0x268dbd);})[_0xe4ff('0x25')](function(_0x2c2477){_0x4e46f8[_0xe4ff('0x48')]=_0x2c2477;return _0x4e46f8;});}})[_0xe4ff('0x25')](respondWithFilteredResult(_0x241f55,_0x268dbd))[_0xe4ff('0x49')](handleError(_0x241f55,null));};exports[_0xe4ff('0x66')]=function(_0x5d9de8,_0x54781c,_0x708d1e){var _0x12fee4={};var _0xd01167={};var _0x20c743;var _0x30e61e;return db[_0xe4ff('0x30')][_0xe4ff('0x60')]({'where':{'id':_0x5d9de8[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x54781c,null))[_0xe4ff('0x25')](function(_0x3edbff){if(_0x3edbff){_0x20c743=_0x3edbff;_0xd01167[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x67')][_0xe4ff('0x31')]);_0xd01167['query']=_[_0xe4ff('0x4c')](_0x5d9de8[_0xe4ff('0x35')]);_0xd01167[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0xd01167[_0xe4ff('0x34')],_0xd01167[_0xe4ff('0x35')]);_0x12fee4[_0xe4ff('0x38')]=_['intersection'](_0xd01167['model'],qs['fields'](_0x5d9de8['query'][_0xe4ff('0x4d')]));_0x12fee4[_0xe4ff('0x38')]=_0x12fee4['attributes'][_0xe4ff('0x39')]?_0x12fee4[_0xe4ff('0x38')]:_0xd01167[_0xe4ff('0x34')];_0x12fee4['order']=qs[_0xe4ff('0x3d')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x3d')]);_0x12fee4[_0xe4ff('0x3e')]=qs['filters'](_[_0xe4ff('0x3f')](_0x5d9de8['query'],_0xd01167[_0xe4ff('0x36')]));if(_0x5d9de8['query']['filter']){_0x12fee4['where']=_[_0xe4ff('0x40')](_0x12fee4[_0xe4ff('0x3e')],{'$or':_['map'](_0x12fee4['attributes'],function(_0x240c4d){var _0x3f2fa8={};_0x3f2fa8[_0x240c4d]={'$like':'%'+_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x43')]+'%'};return _0x3f2fa8;})});}_0x12fee4=_['merge']({},_0x12fee4,_0x5d9de8[_0xe4ff('0x44')]);return _0x20c743[_0xe4ff('0x66')](_0x12fee4);}})[_0xe4ff('0x25')](function(_0x2cba06){if(_0x2cba06){_0x30e61e=_0x2cba06[_0xe4ff('0x39')];if(!_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x3a')](_0xe4ff('0x3b'))){_0x12fee4[_0xe4ff('0x1c')]=qs[_0xe4ff('0x1c')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x1c')]);_0x12fee4[_0xe4ff('0x1d')]=qs[_0xe4ff('0x1d')](_0x5d9de8[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}return _0x20c743['getLists'](_0x12fee4);}})['then'](function(_0x55c1fd){if(_0x55c1fd){return _0x55c1fd?{'count':_0x30e61e,'rows':_0x55c1fd}:null;}})['then'](respondWithResult(_0x54781c,null))[_0xe4ff('0x49')](handleError(_0x54781c,null));};exports[_0xe4ff('0x68')]=function(_0xd02b37,_0x13e1ea,_0x395302){var _0x58c19b,_0x1a57a4;var _0x144c0f=[];var _0x1f3598=moment()['format'](_0xe4ff('0x69'));return db['Campaign']['find']({'where':{'id':_0xd02b37[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x13e1ea,null))[_0xe4ff('0x25')](function(_0x12457b){if(_0x12457b){_0x1a57a4=_0x12457b;return _0x12457b[_0xe4ff('0x68')](_0xd02b37[_0xe4ff('0x50')]['ids'],_[_0xe4ff('0x58')](_0xd02b37[_0xe4ff('0x50')],['ids','id'])||{});}return null;})[_0xe4ff('0x6a')](function(_0x27c06c){var _0x41ee5e;var _0x246d53;_0x58c19b=_0x27c06c||[];var _0x218d6b=[];if(_0x27c06c){for(var _0x4e31b4=0x0;_0x4e31b4<_0x27c06c['length'];_0x4e31b4+=0x1){var _0x5039a3=_0x27c06c[_0x4e31b4]['get']({'plain':!![]});_0x1a57a4[_0xe4ff('0x6b')]=_0xd02b37['body'][_0xe4ff('0x6b')]?_0xd02b37[_0xe4ff('0x50')][_0xe4ff('0x6b')]:_0x1a57a4[_0xe4ff('0x6b')];switch(_0x1a57a4[_0xe4ff('0x6b')]){case _0xe4ff('0x6c'):_0x41ee5e=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')]('cm_hopper')[_0xe4ff('0x6f')]([_0xe4ff('0x70'),'scheduledAt',_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),'createdAt',_0xe4ff('0x5a')],squel['select']()['field'](_0xe4ff('0x70'),_0xe4ff('0x70'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))['field'](_0x5039a3['CmListId']['toString'](),_0xe4ff('0x72'))[_0xe4ff('0x73')](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),_0xe4ff('0x5e'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x7c'))[_0xe4ff('0x3e')](_0xe4ff('0x7d'),squel['select']()[_0xe4ff('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xe4ff('0x7e'))[_0xe4ff('0x3e')](_0xe4ff('0x7f'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]()))[_0xe4ff('0x3e')](_0xe4ff('0x7d'),squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x81'))[_0xe4ff('0x77')](_0xe4ff('0x82'))['where']('CampaignId\x20=\x20?',_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())))[_0xe4ff('0x76')]();break;case _0xe4ff('0x83'):_0x41ee5e=squel['insert']()['into'](_0xe4ff('0x82'))[_0xe4ff('0x6f')]([_0xe4ff('0x70'),_0xe4ff('0x75'),_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),_0xe4ff('0x59'),_0xe4ff('0x5a')],squel['select']()[_0xe4ff('0x73')]('phone','phone')['field'](_0xe4ff('0x74'),_0xe4ff('0x75'))['field']('id',_0xe4ff('0x71'))['field'](_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')](),_0xe4ff('0x72'))['field'](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),_0xe4ff('0x5e'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27','createdAt')['field']('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x7c'))['where'](_0xe4ff('0x7d'),squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x81'))[_0xe4ff('0x77')](_0xe4ff('0x82'))['where'](_0xe4ff('0x7f'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())))[_0xe4ff('0x76')]();break;default:_0x41ee5e=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')](_0xe4ff('0x82'))[_0xe4ff('0x6f')]([_0xe4ff('0x70'),_0xe4ff('0x75'),_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),_0xe4ff('0x59'),'updatedAt'],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x70'),_0xe4ff('0x70'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))[_0xe4ff('0x73')](_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')](),'ListId')[_0xe4ff('0x73')](_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')](),'CampaignId')[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27','updatedAt')[_0xe4ff('0x77')](_0xe4ff('0x78'))[_0xe4ff('0x3e')]('deletedAt\x20IS\x20NULL')[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())['where'](_0xe4ff('0x7c')))['toString']();}_0x246d53=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')]('cm_hopper_additional_phones')[_0xe4ff('0x6f')]([_0xe4ff('0x84'),_0xe4ff('0x75'),_0xe4ff('0x70'),_0xe4ff('0x85'),_0xe4ff('0x59'),_0xe4ff('0x5a')],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')](_0xe4ff('0x86'),'id')[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x75'))[_0xe4ff('0x73')](_0xe4ff('0x87'),_0xe4ff('0x70'))[_0xe4ff('0x73')]('ci.OrderBY','OrderBy')[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x59'))[_0xe4ff('0x73')]('\x27'+_0x1f3598+'\x27',_0xe4ff('0x5a'))['from'](_0xe4ff('0x88'),'ci')['join']('cm_hopper','h',_0xe4ff('0x89'))[_0xe4ff('0x3e')]('h.ListId\x20=\x20?',_0x5039a3[_0xe4ff('0x7b')][_0xe4ff('0x76')]())[_0xe4ff('0x3e')](_0xe4ff('0x8a'),_0xd02b37[_0xe4ff('0x4b')]['id'][_0xe4ff('0x76')]())[_0xe4ff('0x3e')]('h.createdAt\x20=\x20?',_0x1f3598))['toString']();_0x218d6b[_0xe4ff('0x8b')](db[_0xe4ff('0x8c')][_0xe4ff('0x35')](_0x41ee5e));_0x144c0f[_0xe4ff('0x8b')](db[_0xe4ff('0x8c')][_0xe4ff('0x35')](_0x246d53));}return BPromise[_0xe4ff('0x8d')](_0x218d6b);}})[_0xe4ff('0x25')](function(){return BPromise[_0xe4ff('0x8d')](_0x144c0f);})[_0xe4ff('0x25')](function(){return _0x58c19b;})[_0xe4ff('0x25')](respondWithResult(_0x13e1ea,null))[_0xe4ff('0x49')](handleError(_0x13e1ea,null));};exports[_0xe4ff('0x8e')]=function(_0x3782d6,_0x1fe698,_0x11470f){return db[_0xe4ff('0x30')][_0xe4ff('0x4e')]({'where':{'id':_0x3782d6['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x1fe698,null))['then'](function(_0xc913a){if(_0xc913a){return _0xc913a[_0xe4ff('0x8e')](_0x3782d6[_0xe4ff('0x35')][_0xe4ff('0x8f')]);}})[_0xe4ff('0x25')](function(_0x5a2ac4){if(_0x5a2ac4){return db[_0xe4ff('0x5d')][_0xe4ff('0x26')]({'where':{'ListId':_0x3782d6['query'][_0xe4ff('0x8f')],'CampaignId':_0x3782d6[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](function(){return _0x5a2ac4;});}})[_0xe4ff('0x25')](respondWithStatusCode(_0x1fe698,null))['catch'](handleError(_0x1fe698,null));};exports['getBlackLists']=function(_0x4a0f14,_0x579758,_0x510c83){var _0x1a299d={};var _0x19f5dc={};var _0x115820;var _0x3f3f01;return db['Campaign'][_0xe4ff('0x60')]({'where':{'id':_0x4a0f14['params']['id']}})['then'](handleEntityNotFound(_0x579758,null))['then'](function(_0x2b8cd3){if(_0x2b8cd3){_0x115820=_0x2b8cd3;_0x19f5dc[_0xe4ff('0x34')]=_[_0xe4ff('0x4c')](db[_0xe4ff('0x67')][_0xe4ff('0x31')]);_0x19f5dc[_0xe4ff('0x35')]=_[_0xe4ff('0x4c')](_0x4a0f14['query']);_0x19f5dc[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x19f5dc['model'],_0x19f5dc[_0xe4ff('0x35')]);_0x1a299d[_0xe4ff('0x38')]=_['intersection'](_0x19f5dc[_0xe4ff('0x34')],qs['fields'](_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x4d')]));_0x1a299d[_0xe4ff('0x38')]=_0x1a299d[_0xe4ff('0x38')][_0xe4ff('0x39')]?_0x1a299d[_0xe4ff('0x38')]:_0x19f5dc[_0xe4ff('0x34')];_0x1a299d[_0xe4ff('0x3c')]=qs[_0xe4ff('0x3d')](_0x4a0f14[_0xe4ff('0x35')]['sort']);_0x1a299d['where']=qs[_0xe4ff('0x36')](_[_0xe4ff('0x3f')](_0x4a0f14[_0xe4ff('0x35')],_0x19f5dc[_0xe4ff('0x36')]));if(_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x43')]){_0x1a299d[_0xe4ff('0x3e')]=_[_0xe4ff('0x40')](_0x1a299d[_0xe4ff('0x3e')],{'$or':_['map'](_0x1a299d['attributes'],function(_0x21d857){var _0x4a3ea4={};_0x4a3ea4[_0x21d857]={'$like':'%'+_0x4a0f14[_0xe4ff('0x35')]['filter']+'%'};return _0x4a3ea4;})});}_0x1a299d=_[_0xe4ff('0x40')]({},_0x1a299d,_0x4a0f14[_0xe4ff('0x44')]);return _0x115820[_0xe4ff('0x90')](_0x1a299d);}})[_0xe4ff('0x25')](function(_0x214154){if(_0x214154){_0x3f3f01=_0x214154[_0xe4ff('0x39')];if(!_0x4a0f14[_0xe4ff('0x35')]['hasOwnProperty'](_0xe4ff('0x3b'))){_0x1a299d[_0xe4ff('0x1c')]=qs['limit'](_0x4a0f14[_0xe4ff('0x35')]['limit']);_0x1a299d[_0xe4ff('0x1d')]=qs['offset'](_0x4a0f14[_0xe4ff('0x35')][_0xe4ff('0x1d')]);}return _0x115820[_0xe4ff('0x90')](_0x1a299d);}})[_0xe4ff('0x25')](function(_0x1186ef){if(_0x1186ef){return _0x1186ef?{'count':_0x3f3f01,'rows':_0x1186ef}:null;}})[_0xe4ff('0x25')](respondWithResult(_0x579758,null))['catch'](handleError(_0x579758,null));};exports['addBlackLists']=function(_0x181664,_0x51c41a,_0x144ae1){var _0x5414b2,_0x1a0410;var _0x132f75=[];var _0x5a8d48=moment()[_0xe4ff('0x91')](_0xe4ff('0x69'));return db[_0xe4ff('0x30')]['find']({'where':{'id':_0x181664[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x51c41a,null))['then'](function(_0x129cf7){if(_0x129cf7){_0x1a0410=_0x129cf7;return _0x129cf7[_0xe4ff('0x92')](_0x181664[_0xe4ff('0x50')][_0xe4ff('0x8f')],_[_0xe4ff('0x58')](_0x181664[_0xe4ff('0x50')],[_0xe4ff('0x8f'),'id'])||{});}return null;})[_0xe4ff('0x6a')](function(_0x371801){var _0x3a0a2c;var _0x49f8e0;_0x5414b2=_0x371801||[];var _0x5b8598=[];if(_0x371801){for(var _0x218739=0x0;_0x218739<_0x371801[_0xe4ff('0x39')];_0x218739+=0x1){var _0xf623a2=_0x371801[_0x218739][_0xe4ff('0x27')]({'plain':!![]});_0x3a0a2c=squel[_0xe4ff('0x6d')]()[_0xe4ff('0x6e')](_0xe4ff('0x93'))[_0xe4ff('0x6f')](['phone',_0xe4ff('0x71'),_0xe4ff('0x72'),_0xe4ff('0x5e'),'createdAt',_0xe4ff('0x5a')],squel[_0xe4ff('0x80')]()[_0xe4ff('0x73')]('phone',_0xe4ff('0x70'))[_0xe4ff('0x73')]('id',_0xe4ff('0x71'))[_0xe4ff('0x73')](_0xf623a2[_0xe4ff('0x7b')][_0xe4ff('0x76')](),_0xe4ff('0x72'))['field'](_0x181664[_0xe4ff('0x4b')]['id']['toString'](),'CampaignId')[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x59'))[_0xe4ff('0x73')](_0xe4ff('0x74'),_0xe4ff('0x5a'))[_0xe4ff('0x77')]('cm_contacts')[_0xe4ff('0x3e')](_0xe4ff('0x79'))[_0xe4ff('0x3e')](_0xe4ff('0x7a'),_0xf623a2['CmListId']['toString']())[_0xe4ff('0x3e')](_0xe4ff('0x7c')))['toString']();_0x5b8598[_0xe4ff('0x8b')](db['sequelize'][_0xe4ff('0x35')](_0x3a0a2c));}return BPromise[_0xe4ff('0x8d')](_0x5b8598);}})[_0xe4ff('0x25')](function(){return _0x5414b2;})[_0xe4ff('0x25')](respondWithResult(_0x51c41a,null))[_0xe4ff('0x49')](handleError(_0x51c41a,null));};exports['removeBlackLists']=function(_0x21d5ac,_0x266a54,_0x214a3b){return db[_0xe4ff('0x30')]['find']({'where':{'id':_0x21d5ac['params']['id']}})[_0xe4ff('0x25')](handleEntityNotFound(_0x266a54,null))[_0xe4ff('0x25')](function(_0x1a3265){if(_0x1a3265){return _0x1a3265['removeBlackLists'](_0x21d5ac[_0xe4ff('0x35')][_0xe4ff('0x8f')]);}})['then'](function(_0x5b5882){if(_0x5b5882){return db[_0xe4ff('0x65')][_0xe4ff('0x26')]({'where':{'ListId':_0x21d5ac['query']['ids'],'CampaignId':_0x21d5ac[_0xe4ff('0x4b')]['id']}})['then'](function(){return _0x5b5882;});}})['then'](respondWithStatusCode(_0x266a54,null))[_0xe4ff('0x49')](handleError(_0x266a54,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index abad4c3..4d1d26e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x26b30a,_0xfb3217){var _0x269187=function(_0x468148){while(--_0x468148){_0x26b30a['push'](_0x26b30a['shift']());}};_0x269187(++_0xfb3217);}(_0x7a54,0x106));var _0x47a5=function(_0x47b928,_0x3c8344){_0x47b928=_0x47b928-0x0;var _0xa64cea=_0x7a54[_0x47b928];return _0xa64cea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index fb9942d..dfaecd2 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 _0xaf80=['then','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCampaign','options','raw','attributes','limit','include','map','model'];(function(_0xa1b5fb,_0x41a2bd){var _0x123597=function(_0x1b3157){while(--_0x1b3157){_0xa1b5fb['push'](_0xa1b5fb['shift']());}};_0x123597(++_0x41a2bd);}(_0xaf80,0x1ef));var _0x0af8=function(_0x31c8fb,_0x3cf630){_0x31c8fb=_0x31c8fb-0x0;var _0x3c0773=_0xaf80[_0x31c8fb];return _0x3c0773;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Campaign,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});}exports[_0x0af8('0x13')]=function(_0x54e946){var _0x2ace30=this;return new Promise(function(_0x230a68,_0x38068d){return db['Campaign']['findAll']({'raw':_0x54e946['options']?_0x54e946[_0x0af8('0x14')][_0x0af8('0x15')]===undefined?!![]:![]:!![],'where':_0x54e946['options']?_0x54e946[_0x0af8('0x14')]['where']||null:null,'attributes':_0x54e946['options']?_0x54e946[_0x0af8('0x14')][_0x0af8('0x16')]||null:null,'limit':_0x54e946[_0x0af8('0x14')]?_0x54e946[_0x0af8('0x14')][_0x0af8('0x17')]||null:null,'include':_0x54e946['options']?_0x54e946['options'][_0x0af8('0x18')]?_[_0x0af8('0x19')](_0x54e946[_0x0af8('0x14')][_0x0af8('0x18')],function(_0x320d0c){return{'model':db[_0x320d0c[_0x0af8('0x1a')]],'as':_0x320d0c['as'],'attributes':_0x320d0c[_0x0af8('0x16')],'include':_0x320d0c[_0x0af8('0x18')]?_['map'](_0x320d0c['include'],function(_0x1c6306){return{'model':db[_0x1c6306[_0x0af8('0x1a')]],'as':_0x1c6306['as'],'attributes':_0x1c6306[_0x0af8('0x16')],'include':_0x1c6306[_0x0af8('0x18')]?_['map'](_0x1c6306['include'],function(_0x315ad){return{'model':db[_0x315ad[_0x0af8('0x1a')]],'as':_0x315ad['as'],'attributes':_0x315ad[_0x0af8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0af8('0x1b')](function(_0x2e8853){logger[_0x0af8('0xb')](_0x0af8('0x13'),_0x54e946);logger['debug'](_0x0af8('0x13'),_0x54e946,JSON[_0x0af8('0xf')](_0x2e8853));_0x230a68(_0x2e8853);})[_0x0af8('0x1c')](function(_0x20eab4){logger[_0x0af8('0x10')](_0x0af8('0x13'),_0x20eab4[_0x0af8('0x11')],_0x54e946);_0x38068d(_0x2ace30[_0x0af8('0x10')](0x1f4,_0x20eab4[_0x0af8('0x11')]));});});};
\ No newline at end of file
+var _0x130d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','stringify','lodash','moment','randomstring','ioredis'];(function(_0x1e2447,_0x5fea89){var _0x306f03=function(_0x11ac2c){while(--_0x11ac2c){_0x1e2447['push'](_0x1e2447['shift']());}};_0x306f03(++_0x5fea89);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require('util');var moment=require(_0xd130('0x1'));var BPromise=require('bluebird');var rs=require(_0xd130('0x2'));var fs=require('fs');var Redis=require(_0xd130('0x3'));var db=require(_0xd130('0x4'))['db'];var utils=require(_0xd130('0x5'));var logger=require(_0xd130('0x6'))(_0xd130('0x7'));var config=require(_0xd130('0x8'));var jayson=require(_0xd130('0x9'));var client=jayson[_0xd130('0xa')][_0xd130('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c215,_0x168ee7,_0x3f77e1){return new BPromise(function(_0x1b9875,_0x4a3818){return client[_0xd130('0xc')](_0x44c215,_0x3f77e1)['then'](function(_0x1cec3b){logger[_0xd130('0xd')](_0xd130('0xe'),_0x168ee7,'request\x20sent');logger[_0xd130('0xf')](_0xd130('0x10'),_0x168ee7,'request\x20sent',JSON['stringify'](_0x1cec3b));if(_0x1cec3b[_0xd130('0x11')]){if(_0x1cec3b['error'][_0xd130('0x12')]===0x1f4){logger[_0xd130('0x11')]('Campaign,\x20%s,\x20%s',_0x168ee7,_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);return _0x4a3818(_0x1cec3b[_0xd130('0x11')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x168ee7,_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);return _0x1b9875(_0x1cec3b[_0xd130('0x11')][_0xd130('0x13')]);}else{logger[_0xd130('0xd')]('Campaign,\x20%s,\x20%s',_0x168ee7,_0xd130('0x14'));_0x1b9875(_0x1cec3b[_0xd130('0x15')][_0xd130('0x13')]);}})[_0xd130('0x16')](function(_0x57930b){logger[_0xd130('0x11')](_0xd130('0xe'),_0x168ee7,_0x57930b);_0x4a3818(_0x57930b);});});}exports[_0xd130('0x17')]=function(_0xce6d93){var _0x342eb2=this;return new Promise(function(_0xc1c504,_0x43ed26){return db[_0xd130('0x18')]['findAll']({'raw':_0xce6d93['options']?_0xce6d93[_0xd130('0x19')][_0xd130('0x1a')]===undefined?!![]:![]:!![],'where':_0xce6d93[_0xd130('0x19')]?_0xce6d93['options'][_0xd130('0x1b')]||null:null,'attributes':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')][_0xd130('0x1c')]||null:null,'limit':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')]['limit']||null:null,'include':_0xce6d93[_0xd130('0x19')]?_0xce6d93[_0xd130('0x19')][_0xd130('0x1d')]?_[_0xd130('0x1e')](_0xce6d93[_0xd130('0x19')][_0xd130('0x1d')],function(_0x15208f){return{'model':db[_0x15208f[_0xd130('0x1f')]],'as':_0x15208f['as'],'attributes':_0x15208f[_0xd130('0x1c')],'include':_0x15208f[_0xd130('0x1d')]?_['map'](_0x15208f[_0xd130('0x1d')],function(_0x44c560){return{'model':db[_0x44c560[_0xd130('0x1f')]],'as':_0x44c560['as'],'attributes':_0x44c560[_0xd130('0x1c')],'include':_0x44c560[_0xd130('0x1d')]?_[_0xd130('0x1e')](_0x44c560['include'],function(_0x31efe6){return{'model':db[_0x31efe6['model']],'as':_0x31efe6['as'],'attributes':_0x31efe6[_0xd130('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d31af){logger['info'](_0xd130('0x17'),_0xce6d93);logger[_0xd130('0xf')](_0xd130('0x17'),_0xce6d93,JSON[_0xd130('0x20')](_0x5d31af));_0xc1c504(_0x5d31af);})['catch'](function(_0x1d8d1c){logger[_0xd130('0x11')](_0xd130('0x17'),_0x1d8d1c['message'],_0xce6d93);_0x43ed26(_0x342eb2[_0xd130('0x11')](0x1f4,_0x1d8d1c['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index ceb618c..4b32c08 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 _0xe827=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','create','clone','addLists','addBlackLists','destroy','delete','removeBlackLists','multer','util','path'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xe827,0x1dd));var _0x7e82=function(_0x3a2d49,_0x53d190){_0x3a2d49=_0x3a2d49-0x0;var _0x277b78=_0xe827[_0x3a2d49];return _0x277b78;};'use strict';var multer=require(_0x7e82('0x0'));var util=require(_0x7e82('0x1'));var path=require(_0x7e82('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e82('0x3'));var router=express[_0x7e82('0x4')]();var fs_extra=require(_0x7e82('0x5'));var auth=require(_0x7e82('0x6'));var interaction=require(_0x7e82('0x7'));var config=require(_0x7e82('0x8'));var controller=require('./campaign.controller');router['get']('/',auth[_0x7e82('0x9')](),controller[_0x7e82('0xa')]);router[_0x7e82('0xb')](_0x7e82('0xc'),auth['isAuthenticated'](),controller[_0x7e82('0xd')]);router['get'](_0x7e82('0xe'),auth[_0x7e82('0x9')](),controller[_0x7e82('0xf')]);router['get'](_0x7e82('0x10'),auth['isAuthenticated'](),controller[_0x7e82('0x11')]);router[_0x7e82('0xb')](_0x7e82('0x12'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x13')]);router['get'](_0x7e82('0x14'),auth[_0x7e82('0x9')](),controller['getHopperBlacks']);router['get'](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x16')]);router[_0x7e82('0xb')](_0x7e82('0x17'),auth[_0x7e82('0x9')](),controller['getBlackLists']);router[_0x7e82('0x18')]('/',auth[_0x7e82('0x9')](),controller[_0x7e82('0x19')]);router[_0x7e82('0x18')]('/:id/clone',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1a')]);router['post'](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x1b')]);router[_0x7e82('0x18')](_0x7e82('0x17'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x1c')]);router['put'](_0x7e82('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1d')]);router[_0x7e82('0x1e')](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller['removeLists']);router[_0x7e82('0x1e')]('/:id/blacklists',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x6e12=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id','destroy','/:id/lists','removeLists','removeBlackLists','exports'];(function(_0x258c5e,_0x407908){var _0x4ce92e=function(_0x1fd85e){while(--_0x1fd85e){_0x258c5e['push'](_0x258c5e['shift']());}};_0x4ce92e(++_0x407908);}(_0x6e12,0x154));var _0x26e1=function(_0xe240db,_0x1740a9){_0xe240db=_0xe240db-0x0;var _0x30de38=_0x6e12[_0xe240db];return _0x30de38;};'use strict';var multer=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var path=require(_0x26e1('0x2'));var timeout=require(_0x26e1('0x3'));var express=require('express');var router=express[_0x26e1('0x4')]();var fs_extra=require(_0x26e1('0x5'));var auth=require(_0x26e1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26e1('0x7'));router[_0x26e1('0x8')]('/',auth[_0x26e1('0x9')](),controller[_0x26e1('0xa')]);router[_0x26e1('0x8')]('/:id',auth[_0x26e1('0x9')](),controller[_0x26e1('0xb')]);router[_0x26e1('0x8')](_0x26e1('0xc'),auth[_0x26e1('0x9')](),controller['getHoppers']);router[_0x26e1('0x8')](_0x26e1('0xd'),auth[_0x26e1('0x9')](),controller['getHopperHistories']);router[_0x26e1('0x8')](_0x26e1('0xe'),auth[_0x26e1('0x9')](),controller[_0x26e1('0xf')]);router[_0x26e1('0x8')]('/:id/hopper_black',auth[_0x26e1('0x9')](),controller[_0x26e1('0x10')]);router[_0x26e1('0x8')]('/:id/lists',auth[_0x26e1('0x9')](),controller[_0x26e1('0x11')]);router[_0x26e1('0x8')](_0x26e1('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x26e1('0x13')]('/',auth[_0x26e1('0x9')](),controller[_0x26e1('0x14')]);router[_0x26e1('0x13')](_0x26e1('0x15'),auth['isAuthenticated'](),controller[_0x26e1('0x16')]);router[_0x26e1('0x13')]('/:id/lists',auth[_0x26e1('0x9')](),controller[_0x26e1('0x17')]);router[_0x26e1('0x13')](_0x26e1('0x12'),auth[_0x26e1('0x9')](),controller[_0x26e1('0x18')]);router[_0x26e1('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x26e1('0x1a')]);router[_0x26e1('0x1b')](_0x26e1('0x1c'),auth['isAuthenticated'](),controller[_0x26e1('0x1d')]);router['delete'](_0x26e1('0x1e'),auth['isAuthenticated'](),controller[_0x26e1('0x1f')]);router[_0x26e1('0x1b')](_0x26e1('0x12'),auth['isAuthenticated'](),controller[_0x26e1('0x20')]);module[_0x26e1('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f316bb7..72c1c9b 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 _0x415f=['sequelize','exports','STRING','TEXT'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x415f,0x70));var _0xf415=function(_0x32007b,_0x29939e){_0x32007b=_0x32007b-0x0;var _0x596b8b=_0x415f[_0x32007b];return _0x596b8b;};'use strict';var Sequelize=require(_0xf415('0x0'));module[_0xf415('0x1')]={'key':{'type':Sequelize[_0xf415('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf415('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf415('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x002b=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x002b,0x11b));var _0xb002=function(_0x493985,_0xabbee5){_0x493985=_0x493985-0x0;var _0x532b94=_0x002b[_0x493985];return _0x532b94;};'use strict';var Sequelize=require(_0xb002('0x0'));module[_0xb002('0x1')]={'key':{'type':Sequelize[_0xb002('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb002('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb002('0x2')]},'name':{'type':Sequelize[_0xb002('0x4')],'get':function(){return this[_0xb002('0x5')](_0xb002('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c59ee3e..b78e7b3 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 _0x197e=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','count','include','rows','catch','show','rawAttributes','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x197e,0x1cc));var _0xe197=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x197e[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xe197('0x0'));var rimraf=require(_0xe197('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe197('0x2'));var moment=require(_0xe197('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe197('0x4'));var util=require('util');var path=require(_0xe197('0x5'));var sox=require(_0xe197('0x6'));var csv=require(_0xe197('0x7'));var ejs=require(_0xe197('0x8'));var fs=require('fs');var fs_extra=require(_0xe197('0x9'));var _=require(_0xe197('0xa'));var squel=require('squel');var crypto=require(_0xe197('0xb'));var jsforce=require(_0xe197('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe197('0x7'));var querystring=require(_0xe197('0xd'));var Papa=require(_0xe197('0xe'));var Redis=require(_0xe197('0xf'));var authService=require(_0xe197('0x10'));var qs=require(_0xe197('0x11'));var as=require(_0xe197('0x12'));var hardwareService=require(_0xe197('0x13'));var logger=require(_0xe197('0x14'))(_0xe197('0x15'));var utils=require(_0xe197('0x16'));var config=require(_0xe197('0x17'));var licenseUtil=require(_0xe197('0x18'));var db=require(_0xe197('0x19'))['db'];function respondWithStatusCode(_0x4450a5,_0x5e4779){_0x5e4779=_0x5e4779||0xcc;return function(_0x53a002){if(_0x53a002){return _0x4450a5['sendStatus'](_0x5e4779);}return _0x4450a5[_0xe197('0x1a')](_0x5e4779)[_0xe197('0x1b')]();};}function respondWithResult(_0x5f3b94,_0x74641c){_0x74641c=_0x74641c||0xc8;return function(_0xd700aa){if(_0xd700aa){return _0x5f3b94[_0xe197('0x1a')](_0x74641c)[_0xe197('0x1c')](_0xd700aa);}};}function respondWithFilteredResult(_0x23763c,_0x36cac1){return function(_0x320314){if(_0x320314){var _0x12628d=typeof _0x36cac1[_0xe197('0x1d')]===_0xe197('0x1e')&&typeof _0x36cac1[_0xe197('0x1f')]===_0xe197('0x1e');var _0x479df4=_0x320314['count'];var _0x1c0b7c=_0x12628d?0x0:_0x36cac1[_0xe197('0x1d')];var _0x112283=_0x12628d?_0x320314['count']:_0x36cac1[_0xe197('0x1d')]+_0x36cac1['limit'];var _0x447472;if(_0x112283>=_0x479df4){_0x112283=_0x479df4;_0x447472=0xc8;}else{_0x447472=0xce;}_0x23763c[_0xe197('0x1a')](_0x447472);return _0x23763c[_0xe197('0x20')](_0xe197('0x21'),_0x1c0b7c+'-'+_0x112283+'/'+_0x479df4)[_0xe197('0x1c')](_0x320314);}return null;};}function patchUpdates(_0x23df4b){return function(_0x259a2b){try{jsonpatch[_0xe197('0x22')](_0x259a2b,_0x23df4b,!![]);}catch(_0xf81da8){return BPromise[_0xe197('0x23')](_0xf81da8);}return _0x259a2b[_0xe197('0x24')]();};}function saveUpdates(_0x1cb871,_0x3f6b11){return function(_0x5b9f3d){if(_0x5b9f3d){return _0x5b9f3d[_0xe197('0x25')](_0x1cb871)[_0xe197('0x26')](function(_0x47617b){return _0x47617b;});}return null;};}function removeEntity(_0x410c79,_0x43b1ae){return function(_0x1f43e2){if(_0x1f43e2){return _0x1f43e2['destroy']()[_0xe197('0x26')](function(){var _0x3e3cd3=_0x1f43e2['get']({'plain':!![]});var _0x427fcc=_0xe197('0x27');return db[_0xe197('0x28')][_0xe197('0x29')]({'where':{'type':_0x427fcc,'resourceId':_0x3e3cd3['id']}})[_0xe197('0x26')](function(){return _0x1f43e2;});})[_0xe197('0x26')](function(){_0x410c79[_0xe197('0x1a')](0xcc)[_0xe197('0x1b')]();});}};}function handleEntityNotFound(_0x36c44c,_0x1b3d79){return function(_0x55d253){if(!_0x55d253){_0x36c44c[_0xe197('0x2a')](0x194);}return _0x55d253;};}function handleError(_0x1d4b9b,_0x31b57b){_0x31b57b=_0x31b57b||0x1f4;return function(_0x312196){logger[_0xe197('0x2b')](_0x312196[_0xe197('0x2c')]);if(_0x312196[_0xe197('0x2d')]){delete _0x312196[_0xe197('0x2d')];}_0x1d4b9b[_0xe197('0x1a')](_0x31b57b)[_0xe197('0x2e')](_0x312196);};}exports[_0xe197('0x2f')]=function(_0x4e7fe8,_0x36c9fb){var _0x463d5b={},_0x5496bc={},_0x49c201={'count':0x0,'rows':[]};var _0x16e6ea=_[_0xe197('0x30')](db['CannedAnswer']['rawAttributes'],function(_0x1813ca){return{'name':_0x1813ca[_0xe197('0x31')],'type':_0x1813ca['type'][_0xe197('0x32')]};});_0x5496bc[_0xe197('0x33')]=_[_0xe197('0x30')](_0x16e6ea,_0xe197('0x2d'));_0x5496bc[_0xe197('0x34')]=_[_0xe197('0x35')](_0x4e7fe8[_0xe197('0x34')]);_0x5496bc['filters']=_[_0xe197('0x36')](_0x5496bc[_0xe197('0x33')],_0x5496bc[_0xe197('0x34')]);_0x463d5b['attributes']=_[_0xe197('0x36')](_0x5496bc[_0xe197('0x33')],qs[_0xe197('0x37')](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x37')]));_0x463d5b[_0xe197('0x38')]=_0x463d5b['attributes'][_0xe197('0x39')]?_0x463d5b[_0xe197('0x38')]:_0x5496bc[_0xe197('0x33')];if(!_0x4e7fe8[_0xe197('0x34')][_0xe197('0x3a')](_0xe197('0x3b'))){_0x463d5b[_0xe197('0x1f')]=qs['limit'](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x1f')]);_0x463d5b[_0xe197('0x1d')]=qs[_0xe197('0x1d')](_0x4e7fe8['query'][_0xe197('0x1d')]);}_0x463d5b[_0xe197('0x3c')]=qs[_0xe197('0x3d')](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x3d')]);_0x463d5b[_0xe197('0x3e')]=qs[_0xe197('0x3f')](_[_0xe197('0x40')](_0x4e7fe8[_0xe197('0x34')],_0x5496bc[_0xe197('0x3f')]),_0x16e6ea);if(_0x4e7fe8[_0xe197('0x34')][_0xe197('0x41')]){_0x463d5b[_0xe197('0x3e')]=_['merge'](_0x463d5b['where'],{'$or':[{'key':{'$like':'%'+_0x4e7fe8[_0xe197('0x34')][_0xe197('0x41')]+'%'}},{'value':{'$like':'%'+_0x4e7fe8['query']['filter']+'%'}}]});}_0x463d5b=_[_0xe197('0x42')]({},_0x463d5b,_0x4e7fe8[_0xe197('0x43')]);var _0xdd4f7c={'where':_0x463d5b[_0xe197('0x3e')]};return db[_0xe197('0x44')][_0xe197('0x45')](_0xdd4f7c)[_0xe197('0x26')](function(_0x283c7e){_0x49c201['count']=_0x283c7e;if(_0x4e7fe8[_0xe197('0x34')]['includeAll']){_0x463d5b[_0xe197('0x46')]=[{'all':!![]}];}return db[_0xe197('0x44')]['findAll'](_0x463d5b);})[_0xe197('0x26')](function(_0x28c027){_0x49c201[_0xe197('0x47')]=_0x28c027;return _0x49c201;})[_0xe197('0x26')](respondWithFilteredResult(_0x36c9fb,_0x463d5b))[_0xe197('0x48')](handleError(_0x36c9fb,null));};exports[_0xe197('0x49')]=function(_0x16ec13,_0x5de306){var _0x53bd79={'raw':!![],'where':{'id':_0x16ec13['params']['id']}},_0x2ca1be={};_0x2ca1be[_0xe197('0x33')]=_[_0xe197('0x35')](db[_0xe197('0x44')][_0xe197('0x4a')]);_0x2ca1be[_0xe197('0x34')]=_[_0xe197('0x35')](_0x16ec13[_0xe197('0x34')]);_0x2ca1be['filters']=_[_0xe197('0x36')](_0x2ca1be[_0xe197('0x33')],_0x2ca1be[_0xe197('0x34')]);_0x53bd79[_0xe197('0x38')]=_[_0xe197('0x36')](_0x2ca1be[_0xe197('0x33')],qs[_0xe197('0x37')](_0x16ec13[_0xe197('0x34')][_0xe197('0x37')]));_0x53bd79[_0xe197('0x38')]=_0x53bd79[_0xe197('0x38')]['length']?_0x53bd79[_0xe197('0x38')]:_0x2ca1be[_0xe197('0x33')];if(_0x16ec13[_0xe197('0x34')][_0xe197('0x4b')]){_0x53bd79[_0xe197('0x46')]=[{'all':!![]}];}_0x53bd79=_[_0xe197('0x42')]({},_0x53bd79,_0x16ec13['options']);return db[_0xe197('0x44')][_0xe197('0x4c')](_0x53bd79)['then'](handleEntityNotFound(_0x5de306,null))[_0xe197('0x26')](respondWithResult(_0x5de306,null))[_0xe197('0x48')](handleError(_0x5de306,null));};exports[_0xe197('0x25')]=function(_0x3326f6,_0x1b8952){if(_0x3326f6[_0xe197('0x4d')]['id']){delete _0x3326f6[_0xe197('0x4d')]['id'];}return db[_0xe197('0x44')]['find']({'where':{'id':_0x3326f6[_0xe197('0x4e')]['id']}})[_0xe197('0x26')](handleEntityNotFound(_0x1b8952,null))[_0xe197('0x26')](saveUpdates(_0x3326f6[_0xe197('0x4d')],null))[_0xe197('0x26')](respondWithResult(_0x1b8952,null))[_0xe197('0x48')](handleError(_0x1b8952,null));};exports[_0xe197('0x29')]=function(_0x204918,_0x931929){return db[_0xe197('0x44')][_0xe197('0x4c')]({'where':{'id':_0x204918[_0xe197('0x4e')]['id']}})[_0xe197('0x26')](handleEntityNotFound(_0x931929,null))[_0xe197('0x26')](removeEntity(_0x931929,null))[_0xe197('0x48')](handleError(_0x931929,null));};exports[_0xe197('0x4f')]=function(_0x4ba528,_0x5cdbd5){var _0xd6b302={'key':_0x4ba528[_0xe197('0x4d')][_0xe197('0x32')]};if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x50')]){_0xd6b302[_0xe197('0x50')]=_0x4ba528[_0xe197('0x4d')][_0xe197('0x50')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x51')]){_0xd6b302['SmsAccountId']=_0x4ba528[_0xe197('0x4d')][_0xe197('0x51')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x52')]){_0xd6b302[_0xe197('0x52')]=_0x4ba528[_0xe197('0x4d')][_0xe197('0x52')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x53')]){_0xd6b302['ChatWebsiteId']=_0x4ba528['body']['ChatWebsiteId'];}return db[_0xe197('0x44')]['find']({'where':_0xd6b302})['then'](function(_0x596d82){if(_0x596d82){throw new db[(_0xe197('0x54'))]['ValidationError'](_0xe197('0x55'));}return db['CannedAnswer'][_0xe197('0x4f')](_0x4ba528[_0xe197('0x4d')]);})[_0xe197('0x26')](function(_0x1f8b31){var _0x2a1de0=_0x4ba528['user'][_0xe197('0x56')]({'plain':!![]});if(!_0x2a1de0)throw new Error(_0xe197('0x57'));if(_0x2a1de0['role']==='user'){var _0x3d35c3=_0x1f8b31[_0xe197('0x56')]({'plain':!![]});return db[_0xe197('0x58')]['find']({'where':{'name':_0xe197('0x27'),'userProfileId':_0x2a1de0[_0xe197('0x59')]},'raw':!![]})['then'](function(_0x40ccfb){if(_0x40ccfb&&_0x40ccfb[_0xe197('0x5a')]===0x0){return db[_0xe197('0x28')][_0xe197('0x4f')]({'name':_0x3d35c3[_0xe197('0x2d')],'resourceId':_0x3d35c3['id'],'type':_0x40ccfb[_0xe197('0x2d')],'sectionId':_0x40ccfb['id']},{})[_0xe197('0x26')](function(){return _0x1f8b31;});}else{return _0x1f8b31;}})['catch'](function(_0x4ed6eb){logger[_0xe197('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ed6eb);throw _0x4ed6eb;});}return _0x1f8b31;})[_0xe197('0x26')](respondWithResult(_0x5cdbd5,0xc9))[_0xe197('0x48')](handleError(_0x5cdbd5,null));};
\ No newline at end of file
+var _0x7812=['map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','keys','include','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7812,0x18f));var _0x2781=function(_0x978359,_0x5755b9){_0x978359=_0x978359-0x0;var _0x4c1f55=_0x7812[_0x978359];return _0x4c1f55;};'use strict';var emlformat=require(_0x2781('0x0'));var rimraf=require(_0x2781('0x1'));var zipdir=require(_0x2781('0x2'));var jsonpatch=require(_0x2781('0x3'));var rp=require(_0x2781('0x4'));var moment=require(_0x2781('0x5'));var BPromise=require(_0x2781('0x6'));var Mustache=require(_0x2781('0x7'));var util=require(_0x2781('0x8'));var path=require(_0x2781('0x9'));var sox=require(_0x2781('0xa'));var csv=require('to-csv');var ejs=require(_0x2781('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2781('0xc'));var squel=require(_0x2781('0xd'));var crypto=require(_0x2781('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2781('0xf'));var querystring=require(_0x2781('0x10'));var Papa=require(_0x2781('0x11'));var Redis=require('ioredis');var authService=require(_0x2781('0x12'));var qs=require(_0x2781('0x13'));var as=require(_0x2781('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2781('0x15'));var utils=require('../../config/utils');var config=require(_0x2781('0x16'));var licenseUtil=require(_0x2781('0x17'));var db=require(_0x2781('0x18'))['db'];function respondWithStatusCode(_0x522c78,_0x10f2e3){_0x10f2e3=_0x10f2e3||0xcc;return function(_0x2ad274){if(_0x2ad274){return _0x522c78['sendStatus'](_0x10f2e3);}return _0x522c78[_0x2781('0x19')](_0x10f2e3)[_0x2781('0x1a')]();};}function respondWithResult(_0x449e1e,_0x494a20){_0x494a20=_0x494a20||0xc8;return function(_0x71033){if(_0x71033){return _0x449e1e['status'](_0x494a20)[_0x2781('0x1b')](_0x71033);}};}function respondWithFilteredResult(_0x330f81,_0x3cfca7){return function(_0x17e5d9){if(_0x17e5d9){var _0x45e68b=typeof _0x3cfca7[_0x2781('0x1c')]===_0x2781('0x1d')&&typeof _0x3cfca7[_0x2781('0x1e')]===_0x2781('0x1d');var _0x2c0f27=_0x17e5d9[_0x2781('0x1f')];var _0x1add23=_0x45e68b?0x0:_0x3cfca7[_0x2781('0x1c')];var _0x4c7409=_0x45e68b?_0x17e5d9[_0x2781('0x1f')]:_0x3cfca7[_0x2781('0x1c')]+_0x3cfca7[_0x2781('0x1e')];var _0x1805e7;if(_0x4c7409>=_0x2c0f27){_0x4c7409=_0x2c0f27;_0x1805e7=0xc8;}else{_0x1805e7=0xce;}_0x330f81['status'](_0x1805e7);return _0x330f81['set'](_0x2781('0x20'),_0x1add23+'-'+_0x4c7409+'/'+_0x2c0f27)[_0x2781('0x1b')](_0x17e5d9);}return null;};}function patchUpdates(_0x2059a9){return function(_0x755500){try{jsonpatch[_0x2781('0x21')](_0x755500,_0x2059a9,!![]);}catch(_0x9b1a80){return BPromise['reject'](_0x9b1a80);}return _0x755500[_0x2781('0x22')]();};}function saveUpdates(_0x5b9ee7,_0x3fc979){return function(_0x296e42){if(_0x296e42){return _0x296e42[_0x2781('0x23')](_0x5b9ee7)[_0x2781('0x24')](function(_0x5d5bcb){return _0x5d5bcb;});}return null;};}function removeEntity(_0x425b8a,_0x532d1b){return function(_0x527f5d){if(_0x527f5d){return _0x527f5d[_0x2781('0x25')]()[_0x2781('0x24')](function(){var _0x29e297=_0x527f5d[_0x2781('0x26')]({'plain':!![]});var _0x1b0d94=_0x2781('0x27');return db[_0x2781('0x28')][_0x2781('0x25')]({'where':{'type':_0x1b0d94,'resourceId':_0x29e297['id']}})[_0x2781('0x24')](function(){return _0x527f5d;});})[_0x2781('0x24')](function(){_0x425b8a[_0x2781('0x19')](0xcc)[_0x2781('0x1a')]();});}};}function handleEntityNotFound(_0x17c9f3,_0x3cd61e){return function(_0x967f86){if(!_0x967f86){_0x17c9f3[_0x2781('0x29')](0x194);}return _0x967f86;};}function handleError(_0x2aaa74,_0xc5bebb){_0xc5bebb=_0xc5bebb||0x1f4;return function(_0x1c3119){logger[_0x2781('0x2a')](_0x1c3119[_0x2781('0x2b')]);if(_0x1c3119[_0x2781('0x2c')]){delete _0x1c3119[_0x2781('0x2c')];}_0x2aaa74[_0x2781('0x19')](_0xc5bebb)['send'](_0x1c3119);};}exports[_0x2781('0x2d')]=function(_0xc3149e,_0xca5d0f){var _0x2bee73={},_0x492eaa={},_0x2abac3={'count':0x0,'rows':[]};var _0x1de59e=_[_0x2781('0x2e')](db['CannedAnswer'][_0x2781('0x2f')],function(_0x556809){return{'name':_0x556809[_0x2781('0x30')],'type':_0x556809[_0x2781('0x31')][_0x2781('0x32')]};});_0x492eaa[_0x2781('0x33')]=_[_0x2781('0x2e')](_0x1de59e,_0x2781('0x2c'));_0x492eaa[_0x2781('0x34')]=_['keys'](_0xc3149e[_0x2781('0x34')]);_0x492eaa[_0x2781('0x35')]=_['intersection'](_0x492eaa[_0x2781('0x33')],_0x492eaa[_0x2781('0x34')]);_0x2bee73[_0x2781('0x36')]=_[_0x2781('0x37')](_0x492eaa[_0x2781('0x33')],qs[_0x2781('0x38')](_0xc3149e[_0x2781('0x34')]['fields']));_0x2bee73['attributes']=_0x2bee73[_0x2781('0x36')][_0x2781('0x39')]?_0x2bee73[_0x2781('0x36')]:_0x492eaa[_0x2781('0x33')];if(!_0xc3149e[_0x2781('0x34')][_0x2781('0x3a')](_0x2781('0x3b'))){_0x2bee73[_0x2781('0x1e')]=qs[_0x2781('0x1e')](_0xc3149e[_0x2781('0x34')]['limit']);_0x2bee73[_0x2781('0x1c')]=qs[_0x2781('0x1c')](_0xc3149e['query']['offset']);}_0x2bee73['order']=qs[_0x2781('0x3c')](_0xc3149e['query'][_0x2781('0x3c')]);_0x2bee73[_0x2781('0x3d')]=qs[_0x2781('0x35')](_[_0x2781('0x3e')](_0xc3149e['query'],_0x492eaa['filters']),_0x1de59e);if(_0xc3149e[_0x2781('0x34')]['filter']){_0x2bee73[_0x2781('0x3d')]=_[_0x2781('0x3f')](_0x2bee73[_0x2781('0x3d')],{'$or':[{'key':{'$like':'%'+_0xc3149e[_0x2781('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xc3149e[_0x2781('0x34')][_0x2781('0x40')]+'%'}}]});}_0x2bee73=_[_0x2781('0x3f')]({},_0x2bee73,_0xc3149e[_0x2781('0x41')]);var _0x3a2b35={'where':_0x2bee73[_0x2781('0x3d')]};return db[_0x2781('0x42')][_0x2781('0x1f')](_0x3a2b35)['then'](function(_0x2a85a5){_0x2abac3[_0x2781('0x1f')]=_0x2a85a5;if(_0xc3149e[_0x2781('0x34')][_0x2781('0x43')]){_0x2bee73['include']=[{'all':!![]}];}return db[_0x2781('0x42')][_0x2781('0x44')](_0x2bee73);})[_0x2781('0x24')](function(_0x307bb9){_0x2abac3[_0x2781('0x45')]=_0x307bb9;return _0x2abac3;})[_0x2781('0x24')](respondWithFilteredResult(_0xca5d0f,_0x2bee73))[_0x2781('0x46')](handleError(_0xca5d0f,null));};exports[_0x2781('0x47')]=function(_0x24085e,_0x4f4468){var _0x10e9fa={'raw':!![],'where':{'id':_0x24085e[_0x2781('0x48')]['id']}},_0x4b19f0={};_0x4b19f0['model']=_[_0x2781('0x49')](db['CannedAnswer'][_0x2781('0x2f')]);_0x4b19f0[_0x2781('0x34')]=_[_0x2781('0x49')](_0x24085e['query']);_0x4b19f0['filters']=_[_0x2781('0x37')](_0x4b19f0[_0x2781('0x33')],_0x4b19f0[_0x2781('0x34')]);_0x10e9fa[_0x2781('0x36')]=_[_0x2781('0x37')](_0x4b19f0[_0x2781('0x33')],qs[_0x2781('0x38')](_0x24085e[_0x2781('0x34')]['fields']));_0x10e9fa[_0x2781('0x36')]=_0x10e9fa[_0x2781('0x36')][_0x2781('0x39')]?_0x10e9fa[_0x2781('0x36')]:_0x4b19f0[_0x2781('0x33')];if(_0x24085e[_0x2781('0x34')][_0x2781('0x43')]){_0x10e9fa[_0x2781('0x4a')]=[{'all':!![]}];}_0x10e9fa=_[_0x2781('0x3f')]({},_0x10e9fa,_0x24085e[_0x2781('0x41')]);return db['CannedAnswer'][_0x2781('0x4b')](_0x10e9fa)[_0x2781('0x24')](handleEntityNotFound(_0x4f4468,null))[_0x2781('0x24')](respondWithResult(_0x4f4468,null))[_0x2781('0x46')](handleError(_0x4f4468,null));};exports[_0x2781('0x23')]=function(_0x50c4bb,_0x54a710){if(_0x50c4bb[_0x2781('0x4c')]['id']){delete _0x50c4bb[_0x2781('0x4c')]['id'];}return db[_0x2781('0x42')][_0x2781('0x4b')]({'where':{'id':_0x50c4bb['params']['id']}})[_0x2781('0x24')](handleEntityNotFound(_0x54a710,null))[_0x2781('0x24')](saveUpdates(_0x50c4bb[_0x2781('0x4c')],null))['then'](respondWithResult(_0x54a710,null))[_0x2781('0x46')](handleError(_0x54a710,null));};exports[_0x2781('0x25')]=function(_0x1f0320,_0x7587f3){return db[_0x2781('0x42')][_0x2781('0x4b')]({'where':{'id':_0x1f0320['params']['id']}})[_0x2781('0x24')](handleEntityNotFound(_0x7587f3,null))[_0x2781('0x24')](removeEntity(_0x7587f3,null))[_0x2781('0x46')](handleError(_0x7587f3,null));};exports['create']=function(_0x3c5d12,_0x2d0c8b){var _0x6e5dda={'key':_0x3c5d12[_0x2781('0x4c')][_0x2781('0x32')]};if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4d')]){_0x6e5dda['MailAccountId']=_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4d')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4e')]){_0x6e5dda[_0x2781('0x4e')]=_0x3c5d12['body'][_0x2781('0x4e')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x4f')]){_0x6e5dda[_0x2781('0x4f')]=_0x3c5d12['body'][_0x2781('0x4f')];}else if(_0x3c5d12[_0x2781('0x4c')][_0x2781('0x50')]){_0x6e5dda['ChatWebsiteId']=_0x3c5d12[_0x2781('0x4c')][_0x2781('0x50')];}return db['CannedAnswer'][_0x2781('0x4b')]({'where':_0x6e5dda})[_0x2781('0x24')](function(_0xbcb0d5){if(_0xbcb0d5){throw new db['Sequelize']['ValidationError'](_0x2781('0x51'));}return db[_0x2781('0x42')][_0x2781('0x52')](_0x3c5d12[_0x2781('0x4c')]);})['then'](function(_0x1f8ceb){var _0x299b46=_0x3c5d12[_0x2781('0x53')][_0x2781('0x26')]({'plain':!![]});if(!_0x299b46)throw new Error(_0x2781('0x54'));if(_0x299b46[_0x2781('0x55')]===_0x2781('0x53')){var _0x9d3218=_0x1f8ceb[_0x2781('0x26')]({'plain':!![]});return db[_0x2781('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x299b46[_0x2781('0x57')]},'raw':!![]})[_0x2781('0x24')](function(_0x52fb10){if(_0x52fb10&&_0x52fb10['autoAssociation']===0x0){return db[_0x2781('0x28')][_0x2781('0x52')]({'name':_0x9d3218[_0x2781('0x2c')],'resourceId':_0x9d3218['id'],'type':_0x52fb10[_0x2781('0x2c')],'sectionId':_0x52fb10['id']},{})['then'](function(){return _0x1f8ceb;});}else{return _0x1f8ceb;}})['catch'](function(_0x2a1b30){logger[_0x2781('0x2a')](_0x2781('0x58'),_0x2a1b30);throw _0x2a1b30;});}return _0x1f8ceb;})[_0x2781('0x24')](respondWithResult(_0x2d0c8b,0xc9))[_0x2781('0x46')](handleError(_0x2d0c8b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index af35ae3..e79b983 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 _0x9507=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x590efd,_0x2aa5bd){var _0x2c3032=function(_0x58b3a2){while(--_0x58b3a2){_0x590efd['push'](_0x590efd['shift']());}};_0x2c3032(++_0x2aa5bd);}(_0x9507,0x1a7));var _0x7950=function(_0x45331f,_0x93c8d8){_0x45331f=_0x45331f-0x0;var _0x16277b=_0x9507[_0x45331f];return _0x16277b;};'use strict';var _=require(_0x7950('0x0'));var util=require(_0x7950('0x1'));var logger=require(_0x7950('0x2'))('api');var moment=require(_0x7950('0x3'));var BPromise=require(_0x7950('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7950('0x5'));var rimraf=require(_0x7950('0x6'));var config=require(_0x7950('0x7'));var attributes=require(_0x7950('0x8'));module[_0x7950('0x9')]=function(_0x5ceb3d,_0x388acd){return _0x5ceb3d[_0x7950('0xa')](_0x7950('0xb'),attributes,{'tableName':_0x7950('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7950('0xd'),'collate':_0x7950('0xe')});};
\ No newline at end of file
+var _0x00f0=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x433598,_0x51c4c8){var _0x1c8c4a=function(_0x22359e){while(--_0x22359e){_0x433598['push'](_0x433598['shift']());}};_0x1c8c4a(++_0x51c4c8);}(_0x00f0,0x83));var _0x000f=function(_0x38d139,_0x5a4507){_0x38d139=_0x38d139-0x0;var _0x4b9aa6=_0x00f0[_0x38d139];return _0x4b9aa6;};'use strict';var _=require(_0x000f('0x0'));var util=require(_0x000f('0x1'));var logger=require('../../config/logger')(_0x000f('0x2'));var moment=require(_0x000f('0x3'));var BPromise=require(_0x000f('0x4'));var rp=require(_0x000f('0x5'));var fs=require('fs');var path=require(_0x000f('0x6'));var rimraf=require(_0x000f('0x7'));var config=require(_0x000f('0x8'));var attributes=require(_0x000f('0x9'));module[_0x000f('0xa')]=function(_0xf5c8ee,_0x230c26){return _0xf5c8ee['define'](_0x000f('0xb'),attributes,{'tableName':_0x000f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x000f('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 6654acc..f331993 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(_0x36cb4c,_0x320bad){var _0x5c331c=function(_0x3c2f25){while(--_0x3c2f25){_0x36cb4c['push'](_0x36cb4c['shift']());}};_0x5c331c(++_0x320bad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x43ef89,_0x4edf1c){var _0x43622e=function(_0x59eeb0){while(--_0x59eeb0){_0x43ef89['push'](_0x43ef89['shift']());}};_0x43622e(++_0x4edf1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 a06fe21..71d40a9 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 _0x6ebb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1355c9,_0x1b94a7){var _0x22bf92=function(_0x45278e){while(--_0x45278e){_0x1355c9['push'](_0x1355c9['shift']());}};_0x22bf92(++_0x1b94a7);}(_0x6ebb,0x191));var _0xb6eb=function(_0x101877,_0x44bf48){_0x101877=_0x101877-0x0;var _0x57e807=_0x6ebb[_0x101877];return _0x57e807;};'use strict';var multer=require(_0xb6eb('0x0'));var util=require('util');var path=require(_0xb6eb('0x1'));var timeout=require(_0xb6eb('0x2'));var express=require(_0xb6eb('0x3'));var router=express[_0xb6eb('0x4')]();var fs_extra=require(_0xb6eb('0x5'));var auth=require(_0xb6eb('0x6'));var interaction=require(_0xb6eb('0x7'));var config=require('../../config/environment');var controller=require(_0xb6eb('0x8'));router['get']('/',auth[_0xb6eb('0x9')](),controller['index']);router[_0xb6eb('0xa')](_0xb6eb('0xb'),auth[_0xb6eb('0x9')](),controller[_0xb6eb('0xc')]);router[_0xb6eb('0xd')]('/',auth[_0xb6eb('0x9')](),controller[_0xb6eb('0xe')]);router[_0xb6eb('0xf')](_0xb6eb('0xb'),auth[_0xb6eb('0x9')](),controller[_0xb6eb('0x10')]);router[_0xb6eb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb6eb('0x12')]);module[_0xb6eb('0x13')]=router;
\ No newline at end of file
+var _0xee8b=['./cannedAnswer.controller','get','index','isAuthenticated','show','post','put','/:id','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xee8b,0x196));var _0xbee8=function(_0xc0d319,_0x1b1e36){_0xc0d319=_0xc0d319-0x0;var _0x43224d=_0xee8b[_0xc0d319];return _0x43224d;};'use strict';var multer=require('multer');var util=require(_0xbee8('0x0'));var path=require(_0xbee8('0x1'));var timeout=require(_0xbee8('0x2'));var express=require(_0xbee8('0x3'));var router=express['Router']();var fs_extra=require(_0xbee8('0x4'));var auth=require(_0xbee8('0x5'));var interaction=require(_0xbee8('0x6'));var config=require(_0xbee8('0x7'));var controller=require(_0xbee8('0x8'));router[_0xbee8('0x9')]('/',auth['isAuthenticated'](),controller[_0xbee8('0xa')]);router[_0xbee8('0x9')]('/:id',auth[_0xbee8('0xb')](),controller[_0xbee8('0xc')]);router[_0xbee8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbee8('0xe')](_0xbee8('0xf'),auth[_0xbee8('0xb')](),controller[_0xbee8('0x10')]);router['delete'](_0xbee8('0xf'),auth[_0xbee8('0xb')](),controller['destroy']);module[_0xbee8('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 3480258..a2b9edd 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 _0xedd9=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x24f5b1,_0x350007){var _0x451a13=function(_0x30d668){while(--_0x30d668){_0x24f5b1['push'](_0x24f5b1['shift']());}};_0x451a13(++_0x350007);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f59f8,_0x47bfa1){_0x1f59f8=_0x1f59f8-0x0;var _0x3bbd03=_0xedd9[_0x1f59f8];return _0x3bbd03;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'calldate':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![],'defaultValue':_0x9edd('0x2')},'clid':{'type':Sequelize[_0x9edd('0x3')]},'src':{'type':Sequelize[_0x9edd('0x3')]},'dst':{'type':Sequelize[_0x9edd('0x3')]},'dcontext':{'type':Sequelize[_0x9edd('0x3')]},'channel':{'type':Sequelize[_0x9edd('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9edd('0x3')]},'lastdata':{'type':Sequelize[_0x9edd('0x3')]},'duration':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9edd('0x3')]},'uniqueid':{'type':Sequelize[_0x9edd('0x3')]},'linkedid':{'type':Sequelize[_0x9edd('0x3')]},'sequence':{'type':Sequelize[_0x9edd('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9edd('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9010=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9010,0xdf));var _0x0901=function(_0x383d4f,_0xc8fec2){_0x383d4f=_0x383d4f-0x0;var _0x30f9ea=_0x9010[_0x383d4f];return _0x30f9ea;};'use strict';var Sequelize=require(_0x0901('0x0'));module[_0x0901('0x1')]={'calldate':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':_0x0901('0x3')},'clid':{'type':Sequelize[_0x0901('0x4')]},'src':{'type':Sequelize[_0x0901('0x4')]},'dst':{'type':Sequelize[_0x0901('0x4')]},'dcontext':{'type':Sequelize[_0x0901('0x4')]},'channel':{'type':Sequelize[_0x0901('0x4')]},'dstchannel':{'type':Sequelize[_0x0901('0x4')]},'lastapp':{'type':Sequelize[_0x0901('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0901('0x4')]},'amaflags':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0901('0x4')]},'userfield':{'type':Sequelize[_0x0901('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0901('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0901('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x0901('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b5077f4..e1ee149 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 _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x29a383,_0x6b9270){var _0x1aa80b=function(_0x536586){while(--_0x536586){_0x29a383['push'](_0x29a383['shift']());}};_0x1aa80b(++_0x6b9270);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));};
\ No newline at end of file
+var _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0xe8676a,_0x222792){var _0x1cc376=function(_0x57f9f3){while(--_0x57f9f3){_0xe8676a['push'](_0xe8676a['shift']());}};_0x1cc376(++_0x222792);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x5ad3[_0x36a469];return _0x3347fc;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e7ed322..a1b77b5 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3b76c6,_0x1d8403){var _0x32eecd=function(_0x3342ed){while(--_0x3342ed){_0x3b76c6['push'](_0x3b76c6['shift']());}};_0x32eecd(++_0x1d8403);}(_0x7a54,0x106));var _0x47a5=function(_0x1f1fc1,_0x15b3f3){_0x1f1fc1=_0x1f1fc1-0x0;var _0x747d4f=_0x7a54[_0x1f1fc1];return _0x747d4f;};'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
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x495ac1,_0x5a6b08){var _0x507955=function(_0x1ee4a7){while(--_0x1ee4a7){_0x495ac1['push'](_0x495ac1['shift']());}};_0x507955(++_0x5a6b08);}(_0x7a54,0x106));var _0x47a5=function(_0x1a29f1,_0x5e4fc0){_0x1a29f1=_0x1a29f1-0x0;var _0x33deeb=_0x7a54[_0x1a29f1];return _0x33deeb;};'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 baf1093..c0a6e5b 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 _0x5bc4=['code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5bc4,0xe0));var _0x45bc=function(_0x54af28,_0x1a0cc3){_0x54af28=_0x54af28-0x0;var _0x394eef=_0x5bc4[_0x54af28];return _0x394eef;};'use strict';var _=require(_0x45bc('0x0'));var util=require(_0x45bc('0x1'));var moment=require(_0x45bc('0x2'));var BPromise=require(_0x45bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45bc('0x4'));var db=require(_0x45bc('0x5'))['db'];var utils=require(_0x45bc('0x6'));var logger=require('../../config/logger')(_0x45bc('0x7'));var config=require(_0x45bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x45bc('0x9')][_0x45bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f5c86,_0x2b2b27,_0x190f53){return new BPromise(function(_0x129c94,_0x270bff){return client[_0x45bc('0xb')](_0x5f5c86,_0x190f53)[_0x45bc('0xc')](function(_0x42913b){logger[_0x45bc('0xd')]('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x45bc('0xe'));logger['debug'](_0x45bc('0xf'),_0x2b2b27,_0x45bc('0xe'),JSON[_0x45bc('0x10')](_0x42913b));if(_0x42913b[_0x45bc('0x11')]){if(_0x42913b[_0x45bc('0x11')][_0x45bc('0x12')]===0x1f4){logger[_0x45bc('0x11')]('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);return _0x270bff(_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);}logger[_0x45bc('0x11')](_0x45bc('0x14'),_0x2b2b27,_0x42913b['error']['message']);return _0x129c94(_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x45bc('0xe'));_0x129c94(_0x42913b[_0x45bc('0x15')][_0x45bc('0x13')]);}})['catch'](function(_0x28374c){logger['error']('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x28374c);_0x270bff(_0x28374c);});});}
\ No newline at end of file
+var _0x7689=['../../config/environment','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3e07cb,_0x9eb372){var _0x1119c9=function(_0x2dfb1a){while(--_0x2dfb1a){_0x3e07cb['push'](_0x3e07cb['shift']());}};_0x1119c9(++_0x9eb372);}(_0x7689,0x91));var _0x9768=function(_0x1b3477,_0x2e9ed9){_0x1b3477=_0x1b3477-0x0;var _0x55bc12=_0x7689[_0x1b3477];return _0x55bc12;};'use strict';var _=require(_0x9768('0x0'));var util=require('util');var moment=require(_0x9768('0x1'));var BPromise=require(_0x9768('0x2'));var rs=require(_0x9768('0x3'));var fs=require('fs');var Redis=require(_0x9768('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9768('0x5'));var logger=require('../../config/logger')(_0x9768('0x6'));var config=require(_0x9768('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9768('0x8')][_0x9768('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1759d2,_0x2eb353,_0x9e468d){return new BPromise(function(_0x454970,_0x34f08c){return client['request'](_0x1759d2,_0x9e468d)['then'](function(_0xd11651){logger[_0x9768('0xa')](_0x9768('0xb'),_0x2eb353,_0x9768('0xc'));logger['debug'](_0x9768('0xd'),_0x2eb353,_0x9768('0xc'),JSON[_0x9768('0xe')](_0xd11651));if(_0xd11651['error']){if(_0xd11651['error']['code']===0x1f4){logger[_0x9768('0xf')](_0x9768('0xb'),_0x2eb353,_0xd11651['error'][_0x9768('0x10')]);return _0x34f08c(_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);}logger[_0x9768('0xf')](_0x9768('0xb'),_0x2eb353,_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);return _0x454970(_0xd11651[_0x9768('0xf')][_0x9768('0x10')]);}else{logger[_0x9768('0xa')](_0x9768('0xb'),_0x2eb353,_0x9768('0xc'));_0x454970(_0xd11651[_0x9768('0x11')]['message']);}})[_0x9768('0x12')](function(_0x480100){logger['error']('Cdr,\x20%s,\x20%s',_0x2eb353,_0x480100);_0x34f08c(_0x480100);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index abf2b8d..1ad71ba 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x28ea40,_0x189bdc){var _0x1507be=function(_0x49f421){while(--_0x49f421){_0x28ea40['push'](_0x28ea40['shift']());}};_0x1507be(++_0x189bdc);}(_0xb10b,0x12a));var _0xbb10=function(_0x27a997,_0x85f149){_0x27a997=_0x27a997-0x0;var _0x5aa288=_0xb10b[_0x27a997];return _0x5aa288;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x121d9b,_0x16be51){var _0x355527=function(_0x44ba53){while(--_0x44ba53){_0x121d9b['push'](_0x121d9b['shift']());}};_0x355527(++_0x16be51);}(_0xb10b,0x12a));var _0xbb10=function(_0x236607,_0x37f8e9){_0x236607=_0x236607-0x0;var _0x1a4b1e=_0xb10b[_0x236607];return _0x1a4b1e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 b9d45b1..d36fa8a 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 _0xbb73=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x2a1044,_0x455364){var _0x392a9e=function(_0x9d8758){while(--_0x9d8758){_0x2a1044['push'](_0x2a1044['shift']());}};_0x392a9e(++_0x455364);}(_0xbb73,0x130));var _0x3bb7=function(_0x1488e7,_0xa3c91b){_0x1488e7=_0x1488e7-0x0;var _0x2a62ea=_0xbb73[_0x1488e7];return _0x2a62ea;};'use strict';var Sequelize=require(_0x3bb7('0x0'));module[_0x3bb7('0x1')]={'priority':{'type':Sequelize[_0x3bb7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3bb7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3bb7('0x3')]},'interval':{'type':Sequelize[_0x3bb7('0x3')],'defaultValue':_0x3bb7('0x4')}};
\ No newline at end of file
+var _0xc9e3=['TEXT','STRING','*,*,*,*','INTEGER','noop'];(function(_0xff2a80,_0x587a5c){var _0x467439=function(_0x3056e1){while(--_0x3056e1){_0xff2a80['push'](_0xff2a80['shift']());}};_0x467439(++_0x587a5c);}(_0xc9e3,0xd5));var _0x3c9e=function(_0x2b652b,_0xa25eb1){_0x2b652b=_0x2b652b-0x0;var _0x531674=_0xc9e3[_0x2b652b];return _0x531674;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3c9e('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3c9e('0x1')},'appdata':{'type':Sequelize[_0x3c9e('0x2')]()},'description':{'type':Sequelize[_0x3c9e('0x3')]},'interval':{'type':Sequelize[_0x3c9e('0x3')],'defaultValue':_0x3c9e('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c322c0e..bca9504 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 _0xad13=['length','includeAll','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x570815,_0x66adde){var _0x1ae40c=function(_0x163c2e){while(--_0x163c2e){_0x570815['push'](_0x570815['shift']());}};_0x1ae40c(++_0x66adde);}(_0xad13,0x79));var _0x3ad1=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0xad13[_0x28cddc];return _0x5ce855;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){_0x2365f3[_0x3ad1('0x1b')](0xcc)[_0x3ad1('0x1a')]();});}};}function handleEntityNotFound(_0x2ee2e8,_0x1d82a8){return function(_0x2cd135){if(!_0x2cd135){_0x2ee2e8['sendStatus'](0x194);}return _0x2cd135;};}function handleError(_0x5b5abc,_0x7b69e5){_0x7b69e5=_0x7b69e5||0x1f4;return function(_0x5e1c03){logger['error'](_0x5e1c03[_0x3ad1('0x27')]);if(_0x5e1c03[_0x3ad1('0x28')]){delete _0x5e1c03[_0x3ad1('0x28')];}_0x5b5abc[_0x3ad1('0x1b')](_0x7b69e5)['send'](_0x5e1c03);};}exports[_0x3ad1('0x29')]=function(_0xc56f8a,_0x402df6){var _0x3753f1={'raw':!![],'where':{'id':_0xc56f8a['params']['id']}},_0x345cb9={};_0x345cb9['model']=_[_0x3ad1('0x2a')](db['ChatApplication'][_0x3ad1('0x2b')]);_0x345cb9[_0x3ad1('0x2c')]=_[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2c')]);_0x345cb9[_0x3ad1('0x2d')]=_[_0x3ad1('0x2e')](_0x345cb9[_0x3ad1('0x2f')],_0x345cb9[_0x3ad1('0x2c')]);_0x3753f1[_0x3ad1('0x30')]=_['intersection'](_0x345cb9[_0x3ad1('0x2f')],qs['fields'](_0xc56f8a[_0x3ad1('0x2c')][_0x3ad1('0x31')]));_0x3753f1[_0x3ad1('0x30')]=_0x3753f1[_0x3ad1('0x30')][_0x3ad1('0x32')]?_0x3753f1[_0x3ad1('0x30')]:_0x345cb9[_0x3ad1('0x2f')];if(_0xc56f8a['query'][_0x3ad1('0x33')]){_0x3753f1['include']=[{'all':!![]}];}_0x3753f1=_['merge']({},_0x3753f1,_0xc56f8a['options']);return db[_0x3ad1('0x34')][_0x3ad1('0x35')](_0x3753f1)[_0x3ad1('0x26')](handleEntityNotFound(_0x402df6,null))[_0x3ad1('0x26')](respondWithResult(_0x402df6,null))[_0x3ad1('0x36')](handleError(_0x402df6,null));};exports[_0x3ad1('0x25')]=function(_0x54f100,_0x51d21b){if(_0x54f100[_0x3ad1('0x37')]['id']){delete _0x54f100[_0x3ad1('0x37')]['id'];}return db[_0x3ad1('0x34')][_0x3ad1('0x35')]({'where':{'id':_0x54f100[_0x3ad1('0x38')]['id']}})['then'](handleEntityNotFound(_0x51d21b,null))['then'](saveUpdates(_0x54f100['body'],null))['then'](respondWithResult(_0x51d21b,null))[_0x3ad1('0x36')](handleError(_0x51d21b,null));};exports['destroy']=function(_0x5c2acd,_0x78b554){return db[_0x3ad1('0x34')]['find']({'where':{'id':_0x5c2acd[_0x3ad1('0x38')]['id']}})[_0x3ad1('0x26')](handleEntityNotFound(_0x78b554,null))['then'](removeEntity(_0x78b554,null))[_0x3ad1('0x36')](handleError(_0x78b554,null));};
\ No newline at end of file
+var _0x6308=['end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x6308,0x1f2));var _0x8630=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6308[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={'raw':!![],'where':{'id':_0x41f74c[_0x8630('0x29')]['id']}},_0xbb1a58={};_0xbb1a58[_0x8630('0x2a')]=_['keys'](db[_0x8630('0x2b')][_0x8630('0x2c')]);_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0xbb1a58[_0x8630('0x2a')],_0xbb1a58[_0x8630('0x2d')]);_0x4285ee[_0x8630('0x31')]=_[_0x8630('0x30')](_0xbb1a58['model'],qs[_0x8630('0x32')](_0x41f74c[_0x8630('0x2d')][_0x8630('0x32')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x31')][_0x8630('0x33')]?_0x4285ee[_0x8630('0x31')]:_0xbb1a58[_0x8630('0x2a')];if(_0x41f74c[_0x8630('0x2d')][_0x8630('0x34')]){_0x4285ee['include']=[{'all':!![]}];}_0x4285ee=_[_0x8630('0x35')]({},_0x4285ee,_0x41f74c[_0x8630('0x36')]);return db[_0x8630('0x2b')][_0x8630('0x37')](_0x4285ee)[_0x8630('0x22')](handleEntityNotFound(_0xc18164,null))[_0x8630('0x22')](respondWithResult(_0xc18164,null))[_0x8630('0x38')](handleError(_0xc18164,null));};exports[_0x8630('0x21')]=function(_0x141d05,_0x355a2f){if(_0x141d05[_0x8630('0x39')]['id']){delete _0x141d05[_0x8630('0x39')]['id'];}return db[_0x8630('0x2b')][_0x8630('0x37')]({'where':{'id':_0x141d05[_0x8630('0x29')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x355a2f,null))[_0x8630('0x22')](saveUpdates(_0x141d05['body'],null))[_0x8630('0x22')](respondWithResult(_0x355a2f,null))[_0x8630('0x38')](handleError(_0x355a2f,null));};exports['destroy']=function(_0x5d97e1,_0x24e5d9){return db[_0x8630('0x2b')][_0x8630('0x37')]({'where':{'id':_0x5d97e1[_0x8630('0x29')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x24e5d9,null))['then'](removeEntity(_0x24e5d9,null))[_0x8630('0x38')](handleError(_0x24e5d9,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index a7ea468..1a9318b 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 _0x75e0=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x75e0,0x1c8));var _0x075e=function(_0x37c1d2,_0x33b3da){_0x37c1d2=_0x37c1d2-0x0;var _0x67375=_0x75e0[_0x37c1d2];return _0x67375;};'use strict';var _=require(_0x075e('0x0'));var util=require(_0x075e('0x1'));var logger=require(_0x075e('0x2'))('api');var moment=require(_0x075e('0x3'));var BPromise=require(_0x075e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x075e('0x5'));var rimraf=require('rimraf');var config=require(_0x075e('0x6'));var attributes=require(_0x075e('0x7'));module[_0x075e('0x8')]=function(_0x17a2ff,_0x379b0e){return _0x17a2ff[_0x075e('0x9')](_0x075e('0xa'),attributes,{'tableName':_0x075e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x075e('0xc'),'collate':_0x075e('0xd')});};
\ No newline at end of file
+var _0x5704=['chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x1fa633,_0x30cd2c){var _0x2cc486=function(_0xa44dcf){while(--_0xa44dcf){_0x1fa633['push'](_0x1fa633['shift']());}};_0x2cc486(++_0x30cd2c);}(_0x5704,0x1e3));var _0x4570=function(_0x137d0c,_0x133d7e){_0x137d0c=_0x137d0c-0x0;var _0x51f5ea=_0x5704[_0x137d0c];return _0x51f5ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4570('0x0'))(_0x4570('0x1'));var moment=require(_0x4570('0x2'));var BPromise=require(_0x4570('0x3'));var rp=require(_0x4570('0x4'));var fs=require('fs');var path=require(_0x4570('0x5'));var rimraf=require(_0x4570('0x6'));var config=require(_0x4570('0x7'));var attributes=require(_0x4570('0x8'));module[_0x4570('0x9')]=function(_0x535a6d,_0x4e9ea8){return _0x535a6d[_0x4570('0xa')](_0x4570('0xb'),attributes,{'tableName':_0x4570('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4570('0xd'),'collate':_0x4570('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index a7b7c79..1b705c1 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 _0x7731=['debug','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/environment','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x11691e,_0x148f26){var _0x35fd19=function(_0x3324ea){while(--_0x3324ea){_0x11691e['push'](_0x11691e['shift']());}};_0x35fd19(++_0x148f26);}(_0x7731,0x1a6));var _0x1773=function(_0x4d883e,_0x3f74fd){_0x4d883e=_0x4d883e-0x0;var _0x2f7fc9=_0x7731[_0x4d883e];return _0x2f7fc9;};'use strict';var _=require(_0x1773('0x0'));var util=require(_0x1773('0x1'));var moment=require(_0x1773('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1773('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1773('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf83acc,_0x368043,_0x2f6b4f){return new BPromise(function(_0x238043,_0x57d81c){return client[_0x1773('0x5')](_0xf83acc,_0x2f6b4f)[_0x1773('0x6')](function(_0x10857a){logger[_0x1773('0x7')](_0x1773('0x8'),_0x368043,_0x1773('0x9'));logger[_0x1773('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x368043,_0x1773('0x9'),JSON[_0x1773('0xb')](_0x10857a));if(_0x10857a[_0x1773('0xc')]){if(_0x10857a['error']['code']===0x1f4){logger[_0x1773('0xc')](_0x1773('0x8'),_0x368043,_0x10857a[_0x1773('0xc')]['message']);return _0x57d81c(_0x10857a['error']['message']);}logger[_0x1773('0xc')](_0x1773('0x8'),_0x368043,_0x10857a[_0x1773('0xc')][_0x1773('0xd')]);return _0x238043(_0x10857a[_0x1773('0xc')][_0x1773('0xd')]);}else{logger[_0x1773('0x7')]('ChatApplication,\x20%s,\x20%s',_0x368043,_0x1773('0x9'));_0x238043(_0x10857a[_0x1773('0xe')][_0x1773('0xd')]);}})[_0x1773('0xf')](function(_0x232508){logger['error'](_0x1773('0x8'),_0x368043,_0x232508);_0x57d81c(_0x232508);});});}
\ No newline at end of file
+var _0xdc0d=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x284321,_0x4e0767){var _0x4b184d=function(_0x2eaab5){while(--_0x2eaab5){_0x284321['push'](_0x284321['shift']());}};_0x4b184d(++_0x4e0767);}(_0xdc0d,0xfc));var _0xddc0=function(_0x3d7812,_0x584fad){_0x3d7812=_0x3d7812-0x0;var _0x3286d7=_0xdc0d[_0x3d7812];return _0x3286d7;};'use strict';var _=require('lodash');var util=require(_0xddc0('0x0'));var moment=require(_0xddc0('0x1'));var BPromise=require(_0xddc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddc0('0x3'))['db'];var utils=require(_0xddc0('0x4'));var logger=require(_0xddc0('0x5'))(_0xddc0('0x6'));var config=require('../../config/environment');var jayson=require(_0xddc0('0x7'));var client=jayson[_0xddc0('0x8')][_0xddc0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d2871,_0x507447,_0x34fc24){return new BPromise(function(_0x2d7195,_0x3298ee){return client[_0xddc0('0xa')](_0x1d2871,_0x34fc24)['then'](function(_0x3572ff){logger[_0xddc0('0xb')]('ChatApplication,\x20%s,\x20%s',_0x507447,_0xddc0('0xc'));logger[_0xddc0('0xd')](_0xddc0('0xe'),_0x507447,_0xddc0('0xc'),JSON['stringify'](_0x3572ff));if(_0x3572ff[_0xddc0('0xf')]){if(_0x3572ff['error'][_0xddc0('0x10')]===0x1f4){logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);return _0x3298ee(_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);}logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x3572ff[_0xddc0('0xf')][_0xddc0('0x12')]);return _0x2d7195(_0x3572ff['error'][_0xddc0('0x12')]);}else{logger[_0xddc0('0xb')](_0xddc0('0x11'),_0x507447,_0xddc0('0xc'));_0x2d7195(_0x3572ff[_0xddc0('0x13')][_0xddc0('0x12')]);}})[_0xddc0('0x14')](function(_0x558799){logger[_0xddc0('0xf')](_0xddc0('0x11'),_0x507447,_0x558799);_0x3298ee(_0x558799);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index da50f17..b531bec 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 _0xde40=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x433c2e,_0x3338c6){var _0x40acfa=function(_0x5adc05){while(--_0x5adc05){_0x433c2e['push'](_0x433c2e['shift']());}};_0x40acfa(++_0x3338c6);}(_0xde40,0xca));var _0x0de4=function(_0x25c85b,_0x4b3358){_0x25c85b=_0x25c85b-0x0;var _0x78f460=_0xde40[_0x25c85b];return _0x78f460;};'use strict';var multer=require(_0x0de4('0x0'));var util=require(_0x0de4('0x1'));var path=require(_0x0de4('0x2'));var timeout=require(_0x0de4('0x3'));var express=require('express');var router=express[_0x0de4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0de4('0x5'));var interaction=require(_0x0de4('0x6'));var config=require(_0x0de4('0x7'));var controller=require(_0x0de4('0x8'));router[_0x0de4('0x9')](_0x0de4('0xa'),auth['isAuthenticated'](),controller['show']);router['put'](_0x0de4('0xa'),auth['isAuthenticated'](),controller[_0x0de4('0xb')]);router[_0x0de4('0xc')](_0x0de4('0xa'),auth[_0x0de4('0xd')](),controller[_0x0de4('0xe')]);module[_0x0de4('0xf')]=router;
\ No newline at end of file
+var _0x3881=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','/:id','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x3881,0x117));var _0x1388=function(_0x14f02f,_0x74773b){_0x14f02f=_0x14f02f-0x0;var _0x364ff5=_0x3881[_0x14f02f];return _0x364ff5;};'use strict';var multer=require(_0x1388('0x0'));var util=require(_0x1388('0x1'));var path=require(_0x1388('0x2'));var timeout=require('connect-timeout');var express=require(_0x1388('0x3'));var router=express[_0x1388('0x4')]();var fs_extra=require(_0x1388('0x5'));var auth=require(_0x1388('0x6'));var interaction=require(_0x1388('0x7'));var config=require(_0x1388('0x8'));var controller=require(_0x1388('0x9'));router[_0x1388('0xa')]('/:id',auth[_0x1388('0xb')](),controller['show']);router['put'](_0x1388('0xc'),auth[_0x1388('0xb')](),controller[_0x1388('0xd')]);router['delete'](_0x1388('0xc'),auth[_0x1388('0xb')](),controller[_0x1388('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4df3fd2..5de27cb 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 _0xd600=['STRING','BOOLEAN','exports'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0xd600,0x1d6));var _0x0d60=function(_0x107c3f,_0x5334ee){_0x107c3f=_0x107c3f-0x0;var _0x23032d=_0xd600[_0x107c3f];return _0x23032d;};'use strict';var Sequelize=require('sequelize');module[_0x0d60('0x0')]={'name':{'type':Sequelize[_0x0d60('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0d60('0x1')]},'write':{'type':Sequelize[_0x0d60('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3c54=['BOOLEAN','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3c54,0x14d));var _0x43c5=function(_0x1a46f9,_0x4275a9){_0x1a46f9=_0x1a46f9-0x0;var _0x4e8def=_0x3c54[_0x1a46f9];return _0x4e8def;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'name':{'type':Sequelize[_0x43c5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43c5('0x2')]},'write':{'type':Sequelize[_0x43c5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 4e49d98..d2ab255 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 _0x9906=['merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','keys','fields','find','create','body','destroy','describe','getUnread','toInteger','addMembers','omit','getMembers','User','pick','removeMembers','ids','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x9906,0x1b3));var _0x6990=function(_0x541880,_0x27f2aa){_0x541880=_0x541880-0x0;var _0x2ff9ac=_0x9906[_0x541880];return _0x2ff9ac;};'use strict';var emlformat=require(_0x6990('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6990('0x1'));var jsonpatch=require(_0x6990('0x2'));var rp=require(_0x6990('0x3'));var moment=require(_0x6990('0x4'));var BPromise=require(_0x6990('0x5'));var Mustache=require(_0x6990('0x6'));var util=require(_0x6990('0x7'));var path=require(_0x6990('0x8'));var sox=require(_0x6990('0x9'));var csv=require('to-csv');var ejs=require(_0x6990('0xa'));var fs=require('fs');var fs_extra=require(_0x6990('0xb'));var _=require(_0x6990('0xc'));var squel=require(_0x6990('0xd'));var crypto=require(_0x6990('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6990('0xf'));var toCsv=require(_0x6990('0x10'));var querystring=require(_0x6990('0x11'));var Papa=require(_0x6990('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6990('0x13'));var as=require(_0x6990('0x14'));var hardwareService=require(_0x6990('0x15'));var logger=require(_0x6990('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6990('0x17'));var db=require(_0x6990('0x18'))['db'];config[_0x6990('0x19')]=_['defaults'](config['redis'],{'host':_0x6990('0x1a'),'port':0x18eb});var socket=require(_0x6990('0x1b'))(new Redis(config[_0x6990('0x19')]));require(_0x6990('0x1c'))[_0x6990('0x1d')](socket);function respondWithStatusCode(_0x41016a,_0x5d7296){_0x5d7296=_0x5d7296||0xcc;return function(_0x9e6faf){if(_0x9e6faf){return _0x41016a['sendStatus'](_0x5d7296);}return _0x41016a[_0x6990('0x1e')](_0x5d7296)[_0x6990('0x1f')]();};}function respondWithResult(_0x500b47,_0x4e8999){_0x4e8999=_0x4e8999||0xc8;return function(_0x5e35e9){if(_0x5e35e9){return _0x500b47['status'](_0x4e8999)[_0x6990('0x20')](_0x5e35e9);}};}function respondWithFilteredResult(_0xb2bb00,_0x4bae84){return function(_0x580656){if(_0x580656){var _0x3aac68=typeof _0x4bae84['offset']===_0x6990('0x21')&&typeof _0x4bae84['limit']===_0x6990('0x21');var _0x3c42ef=_0x580656[_0x6990('0x22')];var _0x185f0f=_0x3aac68?0x0:_0x4bae84[_0x6990('0x23')];var _0x55a454=_0x3aac68?_0x580656[_0x6990('0x22')]:_0x4bae84['offset']+_0x4bae84['limit'];var _0x264008;if(_0x55a454>=_0x3c42ef){_0x55a454=_0x3c42ef;_0x264008=0xc8;}else{_0x264008=0xce;}_0xb2bb00[_0x6990('0x1e')](_0x264008);return _0xb2bb00[_0x6990('0x24')](_0x6990('0x25'),_0x185f0f+'-'+_0x55a454+'/'+_0x3c42ef)[_0x6990('0x20')](_0x580656);}return null;};}function patchUpdates(_0x490f31){return function(_0x48163e){try{jsonpatch['apply'](_0x48163e,_0x490f31,!![]);}catch(_0x29b564){return BPromise[_0x6990('0x26')](_0x29b564);}return _0x48163e[_0x6990('0x27')]();};}function saveUpdates(_0x4347df,_0x1402c0){return function(_0x21c456){if(_0x21c456){return _0x21c456[_0x6990('0x28')](_0x4347df)[_0x6990('0x29')](function(_0x4d17ca){return _0x4d17ca;});}return null;};}function removeEntity(_0x308d88,_0xdddf5){return function(_0x19a6ff){if(_0x19a6ff){return _0x19a6ff['destroy']()[_0x6990('0x29')](function(){_0x308d88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x481e57,_0x260f3e){return function(_0x166bb2){if(!_0x166bb2){_0x481e57[_0x6990('0x2a')](0x194);}return _0x166bb2;};}function handleError(_0x47352e,_0x5b0f40){_0x5b0f40=_0x5b0f40||0x1f4;return function(_0x371039){logger['error'](_0x371039[_0x6990('0x2b')]);if(_0x371039[_0x6990('0x2c')]){delete _0x371039[_0x6990('0x2c')];}_0x47352e[_0x6990('0x1e')](_0x5b0f40)[_0x6990('0x2d')](_0x371039);};}exports[_0x6990('0x2e')]=function(_0x4a5212,_0x535945){var _0x43d9fb={},_0x5b5091={},_0x4d2395={'count':0x0,'rows':[]};var _0x77a7f2=_[_0x6990('0x2f')](db['ChatGroup'][_0x6990('0x30')],function(_0x34f8c5){return{'name':_0x34f8c5[_0x6990('0x31')],'type':_0x34f8c5[_0x6990('0x32')][_0x6990('0x33')]};});_0x5b5091[_0x6990('0x34')]=_[_0x6990('0x2f')](_0x77a7f2,_0x6990('0x2c'));_0x5b5091[_0x6990('0x35')]=_['keys'](_0x4a5212[_0x6990('0x35')]);_0x5b5091['filters']=_[_0x6990('0x36')](_0x5b5091['model'],_0x5b5091['query']);_0x43d9fb[_0x6990('0x37')]=_[_0x6990('0x36')](_0x5b5091[_0x6990('0x34')],qs['fields'](_0x4a5212[_0x6990('0x35')]['fields']));_0x43d9fb[_0x6990('0x37')]=_0x43d9fb[_0x6990('0x37')][_0x6990('0x38')]?_0x43d9fb[_0x6990('0x37')]:_0x5b5091[_0x6990('0x34')];if(!_0x4a5212[_0x6990('0x35')][_0x6990('0x39')](_0x6990('0x3a'))){_0x43d9fb[_0x6990('0x3b')]=qs['limit'](_0x4a5212[_0x6990('0x35')]['limit']);_0x43d9fb[_0x6990('0x23')]=qs[_0x6990('0x23')](_0x4a5212[_0x6990('0x35')][_0x6990('0x23')]);}_0x43d9fb[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x4a5212['query'][_0x6990('0x3d')]);_0x43d9fb[_0x6990('0x3e')]=qs['filters'](_['pick'](_0x4a5212[_0x6990('0x35')],_0x5b5091[_0x6990('0x3f')]),_0x77a7f2);if(_0x4a5212[_0x6990('0x35')][_0x6990('0x40')]){_0x43d9fb['where']=_[_0x6990('0x41')](_0x43d9fb[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x77a7f2,function(_0x321b2e){if(_0x321b2e[_0x6990('0x32')]!==_0x6990('0x42')){var _0x36fe4d={};_0x36fe4d[_0x321b2e[_0x6990('0x2c')]]={'$like':'%'+_0x4a5212[_0x6990('0x35')]['filter']+'%'};return _0x36fe4d;}})});}_0x43d9fb=_[_0x6990('0x41')]({},_0x43d9fb,_0x4a5212[_0x6990('0x43')]);var _0x5b5a61={'where':_0x43d9fb[_0x6990('0x3e')]};return db[_0x6990('0x44')][_0x6990('0x22')](_0x5b5a61)[_0x6990('0x29')](function(_0x37d071){_0x4d2395[_0x6990('0x22')]=_0x37d071;if(_0x4a5212[_0x6990('0x35')][_0x6990('0x45')]){_0x43d9fb[_0x6990('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x43d9fb);})[_0x6990('0x29')](function(_0x52efab){_0x4d2395[_0x6990('0x47')]=_0x52efab;return _0x4d2395;})['then'](respondWithFilteredResult(_0x535945,_0x43d9fb))[_0x6990('0x48')](handleError(_0x535945,null));};exports[_0x6990('0x49')]=function(_0xae4747,_0x3ad938){var _0x4cddf9={'raw':!![],'where':{'id':_0xae4747[_0x6990('0x4a')]['id']}},_0x2bc71a={};_0x2bc71a['model']=_[_0x6990('0x4b')](db[_0x6990('0x44')][_0x6990('0x30')]);_0x2bc71a[_0x6990('0x35')]=_[_0x6990('0x4b')](_0xae4747[_0x6990('0x35')]);_0x2bc71a[_0x6990('0x3f')]=_['intersection'](_0x2bc71a[_0x6990('0x34')],_0x2bc71a[_0x6990('0x35')]);_0x4cddf9[_0x6990('0x37')]=_['intersection'](_0x2bc71a[_0x6990('0x34')],qs[_0x6990('0x4c')](_0xae4747['query'][_0x6990('0x4c')]));_0x4cddf9[_0x6990('0x37')]=_0x4cddf9[_0x6990('0x37')][_0x6990('0x38')]?_0x4cddf9['attributes']:_0x2bc71a['model'];if(_0xae4747[_0x6990('0x35')]['includeAll']){_0x4cddf9['include']=[{'all':!![]}];}_0x4cddf9=_[_0x6990('0x41')]({},_0x4cddf9,_0xae4747['options']);return db[_0x6990('0x44')][_0x6990('0x4d')](_0x4cddf9)['then'](handleEntityNotFound(_0x3ad938,null))['then'](respondWithResult(_0x3ad938,null))[_0x6990('0x48')](handleError(_0x3ad938,null));};exports[_0x6990('0x4e')]=function(_0x8a22e3,_0x49e268){return db[_0x6990('0x44')][_0x6990('0x4e')](_0x8a22e3[_0x6990('0x4f')],{})[_0x6990('0x29')](respondWithResult(_0x49e268,0xc9))[_0x6990('0x48')](handleError(_0x49e268,null));};exports[_0x6990('0x28')]=function(_0x4ffc87,_0x488b7f){if(_0x4ffc87[_0x6990('0x4f')]['id']){delete _0x4ffc87['body']['id'];}return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x4ffc87[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x488b7f,null))['then'](saveUpdates(_0x4ffc87[_0x6990('0x4f')],null))['then'](respondWithResult(_0x488b7f,null))[_0x6990('0x48')](handleError(_0x488b7f,null));};exports[_0x6990('0x50')]=function(_0x4f2ba9,_0x365f2e){return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x4f2ba9['params']['id']}})['then'](handleEntityNotFound(_0x365f2e,null))['then'](removeEntity(_0x365f2e,null))[_0x6990('0x48')](handleError(_0x365f2e,null));};exports[_0x6990('0x51')]=function(_0x5c3877,_0x183a4e){return db['ChatGroup'][_0x6990('0x51')]()[_0x6990('0x29')](respondWithResult(_0x183a4e,null))[_0x6990('0x48')](handleError(_0x183a4e,null));};exports[_0x6990('0x52')]=function(_0x2d9faa,_0x24b41c,_0x46cf25){return db['ChatInternalMessage'][_0x6990('0x22')]({'where':{'ChatGroupId':_0x2d9faa[_0x6990('0x4a')]['id'],'ToId':_0x2d9faa['user']['id'],'read':![]}})[_0x6990('0x29')](function(_0x5e816a){return{'id':_[_0x6990('0x53')](_0x2d9faa[_0x6990('0x4a')]['id']),'count':_0x5e816a};})['then'](respondWithResult(_0x24b41c,null))[_0x6990('0x48')](handleError(_0x24b41c,null));};exports[_0x6990('0x54')]=function(_0x11ea34,_0x8f7b5a,_0x274c65){return db['ChatGroup'][_0x6990('0x4d')]({'where':{'id':_0x11ea34['params']['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x8f7b5a,null))['then'](function(_0x1528ef){if(_0x1528ef){return _0x1528ef['addMembers'](_0x11ea34['body']['ids'],_[_0x6990('0x55')](_0x11ea34[_0x6990('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x8f7b5a,null))[_0x6990('0x48')](handleError(_0x8f7b5a,null));};exports[_0x6990('0x56')]=function(_0x2fdee,_0x8852a5,_0x3b3e10){var _0x442659={};var _0x67c9c7={};var _0xfc7d6b;var _0x3f7eb9;return db['ChatGroup']['findOne']({'where':{'id':_0x2fdee['params']['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x8852a5,null))[_0x6990('0x29')](function(_0x458e45){if(_0x458e45){_0xfc7d6b=_0x458e45;_0x67c9c7[_0x6990('0x34')]=_['keys'](db[_0x6990('0x57')][_0x6990('0x30')]);_0x67c9c7[_0x6990('0x35')]=_['keys'](_0x2fdee[_0x6990('0x35')]);_0x67c9c7[_0x6990('0x3f')]=_['intersection'](_0x67c9c7['model'],_0x67c9c7['query']);_0x442659[_0x6990('0x37')]=_['intersection'](_0x67c9c7[_0x6990('0x34')],qs[_0x6990('0x4c')](_0x2fdee['query'][_0x6990('0x4c')]));_0x442659['attributes']=_0x442659[_0x6990('0x37')][_0x6990('0x38')]?_0x442659[_0x6990('0x37')]:_0x67c9c7[_0x6990('0x34')];_0x442659[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x2fdee[_0x6990('0x35')]['sort']);_0x442659[_0x6990('0x3e')]=qs[_0x6990('0x3f')](_[_0x6990('0x58')](_0x2fdee[_0x6990('0x35')],_0x67c9c7['filters']));if(_0x2fdee[_0x6990('0x35')][_0x6990('0x40')]){_0x442659[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x442659[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x442659[_0x6990('0x37')],function(_0x5cf827){var _0x15f470={};_0x15f470[_0x5cf827]={'$like':'%'+_0x2fdee[_0x6990('0x35')][_0x6990('0x40')]+'%'};return _0x15f470;})});}_0x442659=_[_0x6990('0x41')]({},_0x442659,_0x2fdee[_0x6990('0x43')]);return _0xfc7d6b[_0x6990('0x56')](_0x442659);}})['then'](function(_0x530600){if(_0x530600){_0x3f7eb9=_0x530600[_0x6990('0x38')];if(!_0x2fdee[_0x6990('0x35')]['hasOwnProperty']('nolimit')){_0x442659[_0x6990('0x3b')]=qs[_0x6990('0x3b')](_0x2fdee[_0x6990('0x35')][_0x6990('0x3b')]);_0x442659[_0x6990('0x23')]=qs[_0x6990('0x23')](_0x2fdee[_0x6990('0x35')][_0x6990('0x23')]);}return _0xfc7d6b['getMembers'](_0x442659);}})['then'](function(_0x42522b){if(_0x42522b){return _0x42522b?{'count':_0x3f7eb9,'rows':_0x42522b}:null;}})['then'](respondWithResult(_0x8852a5,null))[_0x6990('0x48')](handleError(_0x8852a5,null));};exports[_0x6990('0x59')]=function(_0x53a104,_0x939b84,_0x36b70e){return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x53a104[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x939b84,null))[_0x6990('0x29')](function(_0x316156){if(_0x316156){return _0x316156[_0x6990('0x59')](_0x53a104[_0x6990('0x35')][_0x6990('0x5a')]);}})[_0x6990('0x29')](respondWithStatusCode(_0x939b84,null))[_0x6990('0x48')](handleError(_0x939b84,null));};exports[_0x6990('0x5b')]=function(_0xea3295,_0x2459e3,_0x487785){if(_0xea3295['body']['id']){delete _0xea3295[_0x6990('0x4f')]['id'];}return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0xea3295[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x2459e3,null))['then'](function(_0x475925){if(_0x475925){_0xea3295[_0x6990('0x4f')][_0x6990('0x5c')]=_0x475925['id'];return db[_0x6990('0x5d')]['create'](_0xea3295[_0x6990('0x4f')]);}})[_0x6990('0x29')](respondWithResult(_0x2459e3,null))['catch'](handleError(_0x2459e3,null));};exports[_0x6990('0x5e')]=function(_0x4deb3e,_0x481508,_0x3db33d){var _0x32ac39={};var _0xb912ab={};var _0x118ad2;var _0x359729;return db[_0x6990('0x44')][_0x6990('0x5f')]({'where':{'id':_0x4deb3e[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x481508,null))[_0x6990('0x29')](function(_0x3424fc){if(_0x3424fc){_0x118ad2=_0x3424fc;_0xb912ab[_0x6990('0x34')]=_[_0x6990('0x4b')](db['ChatInternalMessage'][_0x6990('0x30')]);_0xb912ab[_0x6990('0x35')]=_[_0x6990('0x4b')](_0x4deb3e[_0x6990('0x35')]);_0xb912ab[_0x6990('0x3f')]=_[_0x6990('0x36')](_0xb912ab[_0x6990('0x34')],_0xb912ab[_0x6990('0x35')]);_0x32ac39[_0x6990('0x37')]=_[_0x6990('0x36')](_0xb912ab[_0x6990('0x34')],qs[_0x6990('0x4c')](_0x4deb3e[_0x6990('0x35')]['fields']));_0x32ac39['attributes']=_0x32ac39[_0x6990('0x37')][_0x6990('0x38')]?_0x32ac39[_0x6990('0x37')]:_0xb912ab[_0x6990('0x34')];_0x32ac39[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x4deb3e['query'][_0x6990('0x3d')]);_0x32ac39[_0x6990('0x3e')]=qs['filters'](_[_0x6990('0x58')](_0x4deb3e[_0x6990('0x35')],_0xb912ab[_0x6990('0x3f')]));if(_0x4deb3e[_0x6990('0x35')][_0x6990('0x40')]){_0x32ac39[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x32ac39[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x32ac39[_0x6990('0x37')],function(_0x2802da){var _0x6ad376={};_0x6ad376[_0x2802da]={'$like':'%'+_0x4deb3e[_0x6990('0x35')][_0x6990('0x40')]+'%'};return _0x6ad376;})});}if(_0x4deb3e['query'][_0x6990('0x60')]){var _0x30c134=_0x4deb3e['query']['$gte'][_0x6990('0x61')](',');var _0x3085bd={};_0x3085bd[_0x30c134[0x0]]={'$gte':moment(_0x30c134[0x1])[_0x6990('0x62')](_0x6990('0x63'))};_0x32ac39[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x32ac39['where'],_0x3085bd);}_0x32ac39=_[_0x6990('0x41')]({},_0x32ac39,_0x4deb3e['options']);return _0x118ad2[_0x6990('0x5e')](_0x32ac39);}})['then'](function(_0x494bd3){if(_0x494bd3){_0x359729=_0x494bd3[_0x6990('0x38')];if(!_0x4deb3e['query'][_0x6990('0x39')](_0x6990('0x3a'))){_0x32ac39[_0x6990('0x3b')]=qs[_0x6990('0x3b')](_0x4deb3e[_0x6990('0x35')][_0x6990('0x3b')]);_0x32ac39[_0x6990('0x23')]=qs['offset'](_0x4deb3e[_0x6990('0x35')][_0x6990('0x23')]);}return _0x118ad2[_0x6990('0x5e')](_0x32ac39);}})[_0x6990('0x29')](function(_0x3a6fb9){if(_0x3a6fb9){return _0x3a6fb9?{'count':_0x359729,'rows':_0x3a6fb9}:null;}})[_0x6990('0x29')](respondWithResult(_0x481508,null))[_0x6990('0x48')](handleError(_0x481508,null));};
\ No newline at end of file
+var _0x182a=['filters','intersection','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','keys','include','create','body','find','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','length','sort','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query'];(function(_0x14ba90,_0x916176){var _0x4337a3=function(_0x470ded){while(--_0x470ded){_0x14ba90['push'](_0x14ba90['shift']());}};_0x4337a3(++_0x916176);}(_0x182a,0x1b8));var _0xa182=function(_0x16522a,_0x187509){_0x16522a=_0x16522a-0x0;var _0x32fce2=_0x182a[_0x16522a];return _0x32fce2;};'use strict';var emlformat=require(_0xa182('0x0'));var rimraf=require(_0xa182('0x1'));var zipdir=require(_0xa182('0x2'));var jsonpatch=require(_0xa182('0x3'));var rp=require(_0xa182('0x4'));var moment=require(_0xa182('0x5'));var BPromise=require(_0xa182('0x6'));var Mustache=require(_0xa182('0x7'));var util=require(_0xa182('0x8'));var path=require(_0xa182('0x9'));var sox=require(_0xa182('0xa'));var csv=require('to-csv');var ejs=require(_0xa182('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa182('0xc'));var crypto=require(_0xa182('0xd'));var jsforce=require(_0xa182('0xe'));var deskjs=require(_0xa182('0xf'));var toCsv=require(_0xa182('0x10'));var querystring=require('querystring');var Papa=require(_0xa182('0x11'));var Redis=require(_0xa182('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa182('0x13'));var as=require(_0xa182('0x14'));var hardwareService=require(_0xa182('0x15'));var logger=require(_0xa182('0x16'))(_0xa182('0x17'));var utils=require(_0xa182('0x18'));var config=require(_0xa182('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa182('0x1a'))['db'];config[_0xa182('0x1b')]=_[_0xa182('0x1c')](config[_0xa182('0x1b')],{'host':_0xa182('0x1d'),'port':0x18eb});var socket=require(_0xa182('0x1e'))(new Redis(config[_0xa182('0x1b')]));require(_0xa182('0x1f'))[_0xa182('0x20')](socket);function respondWithStatusCode(_0x198194,_0xfb94bf){_0xfb94bf=_0xfb94bf||0xcc;return function(_0x158e26){if(_0x158e26){return _0x198194[_0xa182('0x21')](_0xfb94bf);}return _0x198194['status'](_0xfb94bf)['end']();};}function respondWithResult(_0x3e32bf,_0xc3b38f){_0xc3b38f=_0xc3b38f||0xc8;return function(_0x315c0c){if(_0x315c0c){return _0x3e32bf[_0xa182('0x22')](_0xc3b38f)[_0xa182('0x23')](_0x315c0c);}};}function respondWithFilteredResult(_0x4e4b25,_0x47b080){return function(_0x12fd33){if(_0x12fd33){var _0x42c835=typeof _0x47b080[_0xa182('0x24')]===_0xa182('0x25')&&typeof _0x47b080[_0xa182('0x26')]==='undefined';var _0x874cf=_0x12fd33[_0xa182('0x27')];var _0x5b67e1=_0x42c835?0x0:_0x47b080['offset'];var _0x2aa5b8=_0x42c835?_0x12fd33['count']:_0x47b080[_0xa182('0x24')]+_0x47b080[_0xa182('0x26')];var _0x42889a;if(_0x2aa5b8>=_0x874cf){_0x2aa5b8=_0x874cf;_0x42889a=0xc8;}else{_0x42889a=0xce;}_0x4e4b25[_0xa182('0x22')](_0x42889a);return _0x4e4b25[_0xa182('0x28')](_0xa182('0x29'),_0x5b67e1+'-'+_0x2aa5b8+'/'+_0x874cf)['json'](_0x12fd33);}return null;};}function patchUpdates(_0x536f6d){return function(_0xf91b7c){try{jsonpatch[_0xa182('0x2a')](_0xf91b7c,_0x536f6d,!![]);}catch(_0x31449f){return BPromise['reject'](_0x31449f);}return _0xf91b7c[_0xa182('0x2b')]();};}function saveUpdates(_0x3c23b2,_0x208ce4){return function(_0x52b966){if(_0x52b966){return _0x52b966[_0xa182('0x2c')](_0x3c23b2)[_0xa182('0x2d')](function(_0xf6192){return _0xf6192;});}return null;};}function removeEntity(_0x26f19b,_0xc89763){return function(_0x2d53ec){if(_0x2d53ec){return _0x2d53ec[_0xa182('0x2e')]()[_0xa182('0x2d')](function(){_0x26f19b[_0xa182('0x22')](0xcc)[_0xa182('0x2f')]();});}};}function handleEntityNotFound(_0x112c40,_0x5a1754){return function(_0x1416ae){if(!_0x1416ae){_0x112c40[_0xa182('0x21')](0x194);}return _0x1416ae;};}function handleError(_0x305ea3,_0x191605){_0x191605=_0x191605||0x1f4;return function(_0x39ee0f){logger[_0xa182('0x30')](_0x39ee0f[_0xa182('0x31')]);if(_0x39ee0f[_0xa182('0x32')]){delete _0x39ee0f[_0xa182('0x32')];}_0x305ea3[_0xa182('0x22')](_0x191605)['send'](_0x39ee0f);};}exports[_0xa182('0x33')]=function(_0x41a6bd,_0x599019){var _0x52a908={},_0x2a8026={},_0x522519={'count':0x0,'rows':[]};var _0x101944=_[_0xa182('0x34')](db[_0xa182('0x35')][_0xa182('0x36')],function(_0x20ab5b){return{'name':_0x20ab5b[_0xa182('0x37')],'type':_0x20ab5b[_0xa182('0x38')][_0xa182('0x39')]};});_0x2a8026[_0xa182('0x3a')]=_[_0xa182('0x34')](_0x101944,_0xa182('0x32'));_0x2a8026[_0xa182('0x3b')]=_['keys'](_0x41a6bd[_0xa182('0x3b')]);_0x2a8026[_0xa182('0x3c')]=_['intersection'](_0x2a8026['model'],_0x2a8026[_0xa182('0x3b')]);_0x52a908['attributes']=_[_0xa182('0x3d')](_0x2a8026[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x41a6bd[_0xa182('0x3b')]['fields']));_0x52a908['attributes']=_0x52a908[_0xa182('0x3f')]['length']?_0x52a908[_0xa182('0x3f')]:_0x2a8026['model'];if(!_0x41a6bd[_0xa182('0x3b')][_0xa182('0x40')]('nolimit')){_0x52a908[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x41a6bd['query'][_0xa182('0x26')]);_0x52a908[_0xa182('0x24')]=qs['offset'](_0x41a6bd['query']['offset']);}_0x52a908[_0xa182('0x41')]=qs['sort'](_0x41a6bd['query']['sort']);_0x52a908[_0xa182('0x42')]=qs[_0xa182('0x3c')](_[_0xa182('0x43')](_0x41a6bd[_0xa182('0x3b')],_0x2a8026['filters']),_0x101944);if(_0x41a6bd[_0xa182('0x3b')][_0xa182('0x44')]){_0x52a908['where']=_[_0xa182('0x45')](_0x52a908['where'],{'$or':_[_0xa182('0x34')](_0x101944,function(_0x506c80){if(_0x506c80[_0xa182('0x38')]!==_0xa182('0x46')){var _0x4e88c2={};_0x4e88c2[_0x506c80[_0xa182('0x32')]]={'$like':'%'+_0x41a6bd[_0xa182('0x3b')][_0xa182('0x44')]+'%'};return _0x4e88c2;}})});}_0x52a908=_[_0xa182('0x45')]({},_0x52a908,_0x41a6bd[_0xa182('0x47')]);var _0x2c32dd={'where':_0x52a908['where']};return db[_0xa182('0x35')]['count'](_0x2c32dd)[_0xa182('0x2d')](function(_0xca115b){_0x522519['count']=_0xca115b;if(_0x41a6bd['query']['includeAll']){_0x52a908['include']=[{'all':!![]}];}return db[_0xa182('0x35')]['findAll'](_0x52a908);})[_0xa182('0x2d')](function(_0x27e3b5){_0x522519[_0xa182('0x48')]=_0x27e3b5;return _0x522519;})[_0xa182('0x2d')](respondWithFilteredResult(_0x599019,_0x52a908))[_0xa182('0x49')](handleError(_0x599019,null));};exports[_0xa182('0x4a')]=function(_0x17270b,_0x35044e){var _0x35c0df={'raw':!![],'where':{'id':_0x17270b[_0xa182('0x4b')]['id']}},_0x53b268={};_0x53b268[_0xa182('0x3a')]=_[_0xa182('0x4c')](db['ChatGroup'][_0xa182('0x36')]);_0x53b268[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x17270b[_0xa182('0x3b')]);_0x53b268[_0xa182('0x3c')]=_[_0xa182('0x3d')](_0x53b268[_0xa182('0x3a')],_0x53b268[_0xa182('0x3b')]);_0x35c0df[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x53b268[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x17270b[_0xa182('0x3b')]['fields']));_0x35c0df[_0xa182('0x3f')]=_0x35c0df[_0xa182('0x3f')]['length']?_0x35c0df[_0xa182('0x3f')]:_0x53b268[_0xa182('0x3a')];if(_0x17270b['query']['includeAll']){_0x35c0df[_0xa182('0x4d')]=[{'all':!![]}];}_0x35c0df=_[_0xa182('0x45')]({},_0x35c0df,_0x17270b[_0xa182('0x47')]);return db[_0xa182('0x35')]['find'](_0x35c0df)[_0xa182('0x2d')](handleEntityNotFound(_0x35044e,null))[_0xa182('0x2d')](respondWithResult(_0x35044e,null))[_0xa182('0x49')](handleError(_0x35044e,null));};exports[_0xa182('0x4e')]=function(_0x2136e0,_0x20f871){return db[_0xa182('0x35')][_0xa182('0x4e')](_0x2136e0[_0xa182('0x4f')],{})[_0xa182('0x2d')](respondWithResult(_0x20f871,0xc9))[_0xa182('0x49')](handleError(_0x20f871,null));};exports['update']=function(_0x41ef0d,_0x465210){if(_0x41ef0d[_0xa182('0x4f')]['id']){delete _0x41ef0d[_0xa182('0x4f')]['id'];}return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x41ef0d[_0xa182('0x4b')]['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x465210,null))['then'](saveUpdates(_0x41ef0d[_0xa182('0x4f')],null))[_0xa182('0x2d')](respondWithResult(_0x465210,null))[_0xa182('0x49')](handleError(_0x465210,null));};exports[_0xa182('0x2e')]=function(_0x2e7bae,_0x57cc97){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x2e7bae['params']['id']}})['then'](handleEntityNotFound(_0x57cc97,null))[_0xa182('0x2d')](removeEntity(_0x57cc97,null))[_0xa182('0x49')](handleError(_0x57cc97,null));};exports[_0xa182('0x51')]=function(_0x271ac2,_0x34a46d){return db[_0xa182('0x35')][_0xa182('0x51')]()[_0xa182('0x2d')](respondWithResult(_0x34a46d,null))['catch'](handleError(_0x34a46d,null));};exports[_0xa182('0x52')]=function(_0x2605a6,_0x4ef82f,_0x12fcb5){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x2605a6[_0xa182('0x4b')]['id'],'ToId':_0x2605a6[_0xa182('0x53')]['id'],'read':![]}})[_0xa182('0x2d')](function(_0x40074e){return{'id':_['toInteger'](_0x2605a6['params']['id']),'count':_0x40074e};})[_0xa182('0x2d')](respondWithResult(_0x4ef82f,null))[_0xa182('0x49')](handleError(_0x4ef82f,null));};exports['addMembers']=function(_0x2b76cf,_0x1744e4,_0x47b387){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x2b76cf['params']['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x1744e4,null))[_0xa182('0x2d')](function(_0x3dba2a){if(_0x3dba2a){return _0x3dba2a[_0xa182('0x54')](_0x2b76cf['body'][_0xa182('0x55')],_[_0xa182('0x56')](_0x2b76cf[_0xa182('0x4f')],[_0xa182('0x55'),'id'])||{});}})[_0xa182('0x2d')](respondWithResult(_0x1744e4,null))[_0xa182('0x49')](handleError(_0x1744e4,null));};exports[_0xa182('0x57')]=function(_0x3d48e0,_0x3be141,_0x162ffd){var _0x11cdd4={};var _0x593999={};var _0x2c7522;var _0x137a6c;return db[_0xa182('0x35')][_0xa182('0x58')]({'where':{'id':_0x3d48e0[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3be141,null))[_0xa182('0x2d')](function(_0xd84e41){if(_0xd84e41){_0x2c7522=_0xd84e41;_0x593999[_0xa182('0x3a')]=_[_0xa182('0x4c')](db['User'][_0xa182('0x36')]);_0x593999[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x3d48e0[_0xa182('0x3b')]);_0x593999['filters']=_[_0xa182('0x3d')](_0x593999[_0xa182('0x3a')],_0x593999[_0xa182('0x3b')]);_0x11cdd4[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x593999[_0xa182('0x3a')],qs['fields'](_0x3d48e0[_0xa182('0x3b')][_0xa182('0x3e')]));_0x11cdd4[_0xa182('0x3f')]=_0x11cdd4[_0xa182('0x3f')][_0xa182('0x59')]?_0x11cdd4[_0xa182('0x3f')]:_0x593999[_0xa182('0x3a')];_0x11cdd4[_0xa182('0x41')]=qs[_0xa182('0x5a')](_0x3d48e0[_0xa182('0x3b')]['sort']);_0x11cdd4[_0xa182('0x42')]=qs[_0xa182('0x3c')](_[_0xa182('0x43')](_0x3d48e0[_0xa182('0x3b')],_0x593999[_0xa182('0x3c')]));if(_0x3d48e0['query'][_0xa182('0x44')]){_0x11cdd4[_0xa182('0x42')]=_[_0xa182('0x45')](_0x11cdd4[_0xa182('0x42')],{'$or':_[_0xa182('0x34')](_0x11cdd4[_0xa182('0x3f')],function(_0x458deb){var _0x258df5={};_0x258df5[_0x458deb]={'$like':'%'+_0x3d48e0[_0xa182('0x3b')][_0xa182('0x44')]+'%'};return _0x258df5;})});}_0x11cdd4=_[_0xa182('0x45')]({},_0x11cdd4,_0x3d48e0[_0xa182('0x47')]);return _0x2c7522[_0xa182('0x57')](_0x11cdd4);}})[_0xa182('0x2d')](function(_0x556e06){if(_0x556e06){_0x137a6c=_0x556e06[_0xa182('0x59')];if(!_0x3d48e0[_0xa182('0x3b')][_0xa182('0x40')](_0xa182('0x5b'))){_0x11cdd4[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x3d48e0[_0xa182('0x3b')]['limit']);_0x11cdd4[_0xa182('0x24')]=qs['offset'](_0x3d48e0[_0xa182('0x3b')][_0xa182('0x24')]);}return _0x2c7522[_0xa182('0x57')](_0x11cdd4);}})[_0xa182('0x2d')](function(_0x134a4a){if(_0x134a4a){return _0x134a4a?{'count':_0x137a6c,'rows':_0x134a4a}:null;}})[_0xa182('0x2d')](respondWithResult(_0x3be141,null))[_0xa182('0x49')](handleError(_0x3be141,null));};exports[_0xa182('0x5c')]=function(_0x1dd72d,_0x43a062,_0x147a3f){return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x1dd72d[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43a062,null))[_0xa182('0x2d')](function(_0x33ecec){if(_0x33ecec){return _0x33ecec[_0xa182('0x5c')](_0x1dd72d[_0xa182('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x43a062,null))['catch'](handleError(_0x43a062,null));};exports[_0xa182('0x5d')]=function(_0x4d1f23,_0x372982,_0x1f2b8e){if(_0x4d1f23[_0xa182('0x4f')]['id']){delete _0x4d1f23[_0xa182('0x4f')]['id'];}return db[_0xa182('0x35')][_0xa182('0x50')]({'where':{'id':_0x4d1f23['params']['id']}})[_0xa182('0x2d')](handleEntityNotFound(_0x372982,null))[_0xa182('0x2d')](function(_0x399046){if(_0x399046){_0x4d1f23[_0xa182('0x4f')][_0xa182('0x5e')]=_0x399046['id'];return db[_0xa182('0x5f')][_0xa182('0x4e')](_0x4d1f23[_0xa182('0x4f')]);}})[_0xa182('0x2d')](respondWithResult(_0x372982,null))['catch'](handleError(_0x372982,null));};exports[_0xa182('0x60')]=function(_0x34f2c5,_0x55c53a,_0xa877a8){var _0x300b97={};var _0x506d07={};var _0x93e745;var _0x44abdf;return db[_0xa182('0x35')][_0xa182('0x58')]({'where':{'id':_0x34f2c5[_0xa182('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55c53a,null))[_0xa182('0x2d')](function(_0xf57134){if(_0xf57134){_0x93e745=_0xf57134;_0x506d07[_0xa182('0x3a')]=_[_0xa182('0x4c')](db[_0xa182('0x5f')][_0xa182('0x36')]);_0x506d07[_0xa182('0x3b')]=_[_0xa182('0x4c')](_0x34f2c5[_0xa182('0x3b')]);_0x506d07['filters']=_[_0xa182('0x3d')](_0x506d07['model'],_0x506d07[_0xa182('0x3b')]);_0x300b97[_0xa182('0x3f')]=_[_0xa182('0x3d')](_0x506d07[_0xa182('0x3a')],qs[_0xa182('0x3e')](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x3e')]));_0x300b97[_0xa182('0x3f')]=_0x300b97[_0xa182('0x3f')][_0xa182('0x59')]?_0x300b97[_0xa182('0x3f')]:_0x506d07['model'];_0x300b97[_0xa182('0x41')]=qs['sort'](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x5a')]);_0x300b97[_0xa182('0x42')]=qs[_0xa182('0x3c')](_['pick'](_0x34f2c5[_0xa182('0x3b')],_0x506d07[_0xa182('0x3c')]));if(_0x34f2c5[_0xa182('0x3b')]['filter']){_0x300b97['where']=_[_0xa182('0x45')](_0x300b97[_0xa182('0x42')],{'$or':_[_0xa182('0x34')](_0x300b97[_0xa182('0x3f')],function(_0x3828c8){var _0x3cc3fd={};_0x3cc3fd[_0x3828c8]={'$like':'%'+_0x34f2c5[_0xa182('0x3b')]['filter']+'%'};return _0x3cc3fd;})});}if(_0x34f2c5[_0xa182('0x3b')][_0xa182('0x61')]){var _0x2b875d=_0x34f2c5['query'][_0xa182('0x61')][_0xa182('0x62')](',');var _0x415734={};_0x415734[_0x2b875d[0x0]]={'$gte':moment(_0x2b875d[0x1])[_0xa182('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x300b97['where']=_['merge'](_0x300b97[_0xa182('0x42')],_0x415734);}_0x300b97=_['merge']({},_0x300b97,_0x34f2c5[_0xa182('0x47')]);return _0x93e745[_0xa182('0x60')](_0x300b97);}})['then'](function(_0xeef625){if(_0xeef625){_0x44abdf=_0xeef625['length'];if(!_0x34f2c5[_0xa182('0x3b')][_0xa182('0x40')]('nolimit')){_0x300b97[_0xa182('0x26')]=qs[_0xa182('0x26')](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x26')]);_0x300b97[_0xa182('0x24')]=qs['offset'](_0x34f2c5[_0xa182('0x3b')][_0xa182('0x24')]);}return _0x93e745['getMessages'](_0x300b97);}})[_0xa182('0x2d')](function(_0x402a37){if(_0x402a37){return _0x402a37?{'count':_0x44abdf,'rows':_0x402a37}:null;}})[_0xa182('0x2d')](respondWithResult(_0x55c53a,null))[_0xa182('0x49')](handleError(_0x55c53a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b62b227..53c0699 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 _0x4c50=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x34528f,_0x540ca4){var _0x11861b=function(_0x26233f){while(--_0x26233f){_0x34528f['push'](_0x34528f['shift']());}};_0x11861b(++_0x540ca4);}(_0x4c50,0x10f));var _0x04c5=function(_0x33f820,_0x2587c2){_0x33f820=_0x33f820-0x0;var _0x378b18=_0x4c50[_0x33f820];return _0x378b18;};'use strict';var EventEmitter=require(_0x04c5('0x0'));var ChatGroup=require(_0x04c5('0x1'))['db'][_0x04c5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x04c5('0x3')](0x0);var events={'afterCreate':_0x04c5('0x4'),'afterUpdate':_0x04c5('0x5'),'afterDestroy':_0x04c5('0x6')};function emitEvent(_0x5a0501){return function(_0x4fd529,_0x1ae103,_0x1d623d){ChatGroupEvents['emit'](_0x5a0501+':'+_0x4fd529['id'],_0x4fd529);ChatGroupEvents[_0x04c5('0x7')](_0x5a0501,_0x4fd529);_0x1d623d(null);};}for(var e in events){if(events[_0x04c5('0x8')](e)){var event=events[e];ChatGroup[_0x04c5('0x9')](e,emitEvent(event));}}module[_0x04c5('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1f20=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x10fe94,_0x215308){var _0x12c354=function(_0x5e95b9){while(--_0x5e95b9){_0x10fe94['push'](_0x10fe94['shift']());}};_0x12c354(++_0x215308);}(_0x1f20,0x11c));var _0x01f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1f20[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x01f2('0x0'));var ChatGroup=require(_0x01f2('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x01f2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x01f2('0x3'),'afterDestroy':_0x01f2('0x4')};function emitEvent(_0x537683){return function(_0x132488,_0x5a9278,_0x5508a8){ChatGroupEvents[_0x01f2('0x5')](_0x537683+':'+_0x132488['id'],_0x132488);ChatGroupEvents[_0x01f2('0x5')](_0x537683,_0x132488);_0x5508a8(null);};}for(var e in events){if(events[_0x01f2('0x6')](e)){var event=events[e];ChatGroup[_0x01f2('0x7')](e,emitEvent(event));}}module[_0x01f2('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c0fa63d..f85a6b1 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 _0x1b8f=['util','../../config/logger','bluebird','path','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0xfd5475,_0x59217c){var _0x599901=function(_0x5271f1){while(--_0x5271f1){_0xfd5475['push'](_0xfd5475['shift']());}};_0x599901(++_0x59217c);}(_0x1b8f,0xb3));var _0xf1b8=function(_0xa83fe4,_0x5841ca){_0xa83fe4=_0xa83fe4-0x0;var _0x4804da=_0x1b8f[_0xa83fe4];return _0x4804da;};'use strict';var _=require(_0xf1b8('0x0'));var util=require(_0xf1b8('0x1'));var logger=require(_0xf1b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf1b8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1b8('0x4'));var rimraf=require(_0xf1b8('0x5'));var config=require('../../config/environment');var attributes=require(_0xf1b8('0x6'));module[_0xf1b8('0x7')]=function(_0x5a4289,_0x5efc4a){return _0x5a4289[_0xf1b8('0x8')]('ChatGroup',attributes,{'tableName':_0xf1b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f17=['path','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x372518,_0x4c98a7){var _0x24af70=function(_0x33312e){while(--_0x33312e){_0x372518['push'](_0x372518['shift']());}};_0x24af70(++_0x4c98a7);}(_0x1f17,0x12d));var _0x71f1=function(_0x32c83f,_0x4cb2d6){_0x32c83f=_0x32c83f-0x0;var _0x15e3cd=_0x1f17[_0x32c83f];return _0x15e3cd;};'use strict';var _=require(_0x71f1('0x0'));var util=require(_0x71f1('0x1'));var logger=require(_0x71f1('0x2'))(_0x71f1('0x3'));var moment=require(_0x71f1('0x4'));var BPromise=require(_0x71f1('0x5'));var rp=require(_0x71f1('0x6'));var fs=require('fs');var path=require(_0x71f1('0x7'));var rimraf=require('rimraf');var config=require(_0x71f1('0x8'));var attributes=require('./chatGroup.attributes');module[_0x71f1('0x9')]=function(_0x149d0f,_0x2e5c47){return _0x149d0f[_0x71f1('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 8b3e2e4..e178b5f 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 _0x72b1=['error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4488e2,_0x41ac44){var _0x37f4be=function(_0x424dc7){while(--_0x424dc7){_0x4488e2['push'](_0x4488e2['shift']());}};_0x37f4be(++_0x41ac44);}(_0x72b1,0x16e));var _0x172b=function(_0x47f356,_0x2974b9){_0x47f356=_0x47f356-0x0;var _0x26c706=_0x72b1[_0x47f356];return _0x26c706;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var moment=require(_0x172b('0x1'));var BPromise=require(_0x172b('0x2'));var rs=require(_0x172b('0x3'));var fs=require('fs');var Redis=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];var utils=require(_0x172b('0x6'));var logger=require(_0x172b('0x7'))('rpc');var config=require(_0x172b('0x8'));var jayson=require(_0x172b('0x9'));var client=jayson[_0x172b('0xa')][_0x172b('0xb')]({'port':0x232a});config['redis']=_[_0x172b('0xc')](config['redis'],{'host':_0x172b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x172b('0xe')]));require(_0x172b('0xf'))[_0x172b('0x10')](socket);function respondWithRpcPromise(_0x392f1e,_0x50e58a,_0x3b6daf){return new BPromise(function(_0x375bde,_0x28aaad){return client[_0x172b('0x11')](_0x392f1e,_0x3b6daf)[_0x172b('0x12')](function(_0x131762){logger[_0x172b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x50e58a,_0x172b('0x14'));logger[_0x172b('0x15')](_0x172b('0x16'),_0x50e58a,'request\x20sent',JSON[_0x172b('0x17')](_0x131762));if(_0x131762['error']){if(_0x131762[_0x172b('0x18')][_0x172b('0x19')]===0x1f4){logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x28aaad(_0x131762[_0x172b('0x18')]['message']);}logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x375bde(_0x131762[_0x172b('0x18')]['message']);}else{logger['info'](_0x172b('0x1a'),_0x50e58a,_0x172b('0x14'));_0x375bde(_0x131762[_0x172b('0x1c')][_0x172b('0x1b')]);}})[_0x172b('0x1d')](function(_0x4e7cb9){logger[_0x172b('0x18')](_0x172b('0x1a'),_0x50e58a,_0x4e7cb9);_0x28aaad(_0x4e7cb9);});});}
\ No newline at end of file
+var _0x8d0a=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x58060b,_0x307839){var _0xaaa72b=function(_0x227ce6){while(--_0x227ce6){_0x58060b['push'](_0x58060b['shift']());}};_0xaaa72b(++_0x307839);}(_0x8d0a,0x65));var _0xa8d0=function(_0x31f795,_0x24ca2a){_0x31f795=_0x31f795-0x0;var _0x1e4b93=_0x8d0a[_0x31f795];return _0x1e4b93;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});config[_0xa8d0('0xc')]=_[_0xa8d0('0xd')](config[_0xa8d0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8d0('0xc')]));require(_0xa8d0('0xe'))['register'](socket);function respondWithRpcPromise(_0x5362af,_0x4fbfb3,_0x296b54){return new BPromise(function(_0x5091f3,_0x4633c4){return client[_0xa8d0('0xf')](_0x5362af,_0x296b54)[_0xa8d0('0x10')](function(_0x1a7b95){logger[_0xa8d0('0x11')](_0xa8d0('0x12'),_0x4fbfb3,_0xa8d0('0x13'));logger[_0xa8d0('0x14')](_0xa8d0('0x15'),_0x4fbfb3,_0xa8d0('0x13'),JSON[_0xa8d0('0x16')](_0x1a7b95));if(_0x1a7b95['error']){if(_0x1a7b95[_0xa8d0('0x17')]['code']===0x1f4){logger['error'](_0xa8d0('0x12'),_0x4fbfb3,_0x1a7b95[_0xa8d0('0x17')]['message']);return _0x4633c4(_0x1a7b95[_0xa8d0('0x17')][_0xa8d0('0x18')]);}logger[_0xa8d0('0x17')](_0xa8d0('0x12'),_0x4fbfb3,_0x1a7b95[_0xa8d0('0x17')][_0xa8d0('0x18')]);return _0x5091f3(_0x1a7b95['error'][_0xa8d0('0x18')]);}else{logger[_0xa8d0('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4fbfb3,_0xa8d0('0x13'));_0x5091f3(_0x1a7b95[_0xa8d0('0x19')]['message']);}})[_0xa8d0('0x1a')](function(_0xf9267d){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4fbfb3,_0xf9267d);_0x4633c4(_0xf9267d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 36102e7..b6bfe24 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 _0x991a=['./chatGroup.events','save','update','removeListener','length','chatGroup:'];(function(_0x23bcf2,_0x1c6764){var _0x16dff4=function(_0x585464){while(--_0x585464){_0x23bcf2['push'](_0x23bcf2['shift']());}};_0x16dff4(++_0x1c6764);}(_0x991a,0x1ec));var _0xa991=function(_0x5733d6,_0x3fede9){_0x5733d6=_0x5733d6-0x0;var _0x5b4755=_0x991a[_0x5733d6];return _0x5b4755;};'use strict';var ChatGroupEvents=require(_0xa991('0x0'));var events=[_0xa991('0x1'),'remove',_0xa991('0x2')];function createListener(_0x45f6ed,_0x3d9e39){return function(_0x3991fd){_0x3d9e39['emit'](_0x45f6ed,_0x3991fd);};}function removeListener(_0x37a5b0,_0x5e723a){return function(){ChatGroupEvents[_0xa991('0x3')](_0x37a5b0,_0x5e723a);};}exports['register']=function(_0x57ecc5){for(var _0x36842f=0x0,_0x50d2cb=events[_0xa991('0x4')];_0x36842f<_0x50d2cb;_0x36842f++){var _0x3e1972=events[_0x36842f];var _0x13bd2a=createListener(_0xa991('0x5')+_0x3e1972,_0x57ecc5);ChatGroupEvents['on'](_0x3e1972,_0x13bd2a);}};
\ No newline at end of file
+var _0x5da6=['chatGroup:','./chatGroup.events','save','emit','register','length'];(function(_0x21387c,_0x46ae58){var _0x306579=function(_0x1ae261){while(--_0x1ae261){_0x21387c['push'](_0x21387c['shift']());}};_0x306579(++_0x46ae58);}(_0x5da6,0x1cf));var _0x65da=function(_0x54de48,_0x2310da){_0x54de48=_0x54de48-0x0;var _0x4e8dec=_0x5da6[_0x54de48];return _0x4e8dec;};'use strict';var ChatGroupEvents=require(_0x65da('0x0'));var events=[_0x65da('0x1'),'remove','update'];function createListener(_0x1ef833,_0x5ed20f){return function(_0xca202b){_0x5ed20f[_0x65da('0x2')](_0x1ef833,_0xca202b);};}function removeListener(_0x10049f,_0x27fbc5){return function(){ChatGroupEvents['removeListener'](_0x10049f,_0x27fbc5);};}exports[_0x65da('0x3')]=function(_0x53c677){for(var _0x5b145a=0x0,_0x1d8771=events[_0x65da('0x4')];_0x5b145a<_0x1d8771;_0x5b145a++){var _0x306c74=events[_0x5b145a];var _0x12eb69=createListener(_0x65da('0x5')+_0x306c74,_0x53c677);ChatGroupEvents['on'](_0x306c74,_0x12eb69);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index bcfcdce..f91682f 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 _0x995f=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','/:id','update','destroy','delete','removeMembers'];(function(_0x7748a6,_0x450b0f){var _0x2aa04c=function(_0x532ed3){while(--_0x532ed3){_0x7748a6['push'](_0x7748a6['shift']());}};_0x2aa04c(++_0x450b0f);}(_0x995f,0x1e1));var _0xf995=function(_0x4b0c3e,_0x50754a){_0x4b0c3e=_0x4b0c3e-0x0;var _0xa99d4e=_0x995f[_0x4b0c3e];return _0xa99d4e;};'use strict';var multer=require(_0xf995('0x0'));var util=require(_0xf995('0x1'));var path=require(_0xf995('0x2'));var timeout=require(_0xf995('0x3'));var express=require(_0xf995('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf995('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf995('0x6'));var controller=require(_0xf995('0x7'));router['get']('/',auth[_0xf995('0x8')](),controller[_0xf995('0x9')]);router[_0xf995('0xa')](_0xf995('0xb'),auth['isAuthenticated'](),controller[_0xf995('0xc')]);router[_0xf995('0xa')]('/:id',auth[_0xf995('0x8')](),controller[_0xf995('0xd')]);router[_0xf995('0xa')](_0xf995('0xe'),auth[_0xf995('0x8')](),controller[_0xf995('0xf')]);router[_0xf995('0xa')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller[_0xf995('0x11')]);router['get'](_0xf995('0x12'),auth[_0xf995('0x8')](),controller[_0xf995('0x13')]);router[_0xf995('0x14')]('/',auth[_0xf995('0x8')](),controller[_0xf995('0x15')]);router[_0xf995('0x14')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller['addMembers']);router['post'](_0xf995('0x12'),auth['isAuthenticated'](),controller[_0xf995('0x16')]);router[_0xf995('0x17')](_0xf995('0x18'),auth[_0xf995('0x8')](),controller[_0xf995('0x19')]);router['delete'](_0xf995('0x18'),auth['isAuthenticated'](),controller[_0xf995('0x1a')]);router[_0xf995('0x1b')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller[_0xf995('0x1c')]);module[_0xf995('0x1d')]=router;
\ No newline at end of file
+var _0x8ff0=['./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMessage','update','delete','removeMembers','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xdebfbb,_0x5e5026){var _0x20fd80=function(_0x41b895){while(--_0x41b895){_0xdebfbb['push'](_0xdebfbb['shift']());}};_0x20fd80(++_0x5e5026);}(_0x8ff0,0xe0));var _0x08ff=function(_0x47199b,_0x16e824){_0x47199b=_0x47199b-0x0;var _0x390911=_0x8ff0[_0x47199b];return _0x390911;};'use strict';var multer=require('multer');var util=require(_0x08ff('0x0'));var path=require('path');var timeout=require(_0x08ff('0x1'));var express=require(_0x08ff('0x2'));var router=express['Router']();var fs_extra=require(_0x08ff('0x3'));var auth=require(_0x08ff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x08ff('0x5'));var controller=require(_0x08ff('0x6'));router[_0x08ff('0x7')]('/',auth[_0x08ff('0x8')](),controller[_0x08ff('0x9')]);router[_0x08ff('0x7')]('/describe',auth[_0x08ff('0x8')](),controller['describe']);router['get'](_0x08ff('0xa'),auth[_0x08ff('0x8')](),controller[_0x08ff('0xb')]);router[_0x08ff('0x7')](_0x08ff('0xc'),auth[_0x08ff('0x8')](),controller[_0x08ff('0xd')]);router['get'](_0x08ff('0xe'),auth[_0x08ff('0x8')](),controller['getMembers']);router[_0x08ff('0x7')](_0x08ff('0xf'),auth['isAuthenticated'](),controller[_0x08ff('0x10')]);router[_0x08ff('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x08ff('0x11')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x08ff('0x11')](_0x08ff('0xf'),auth[_0x08ff('0x8')](),controller[_0x08ff('0x12')]);router['put'](_0x08ff('0xa'),auth['isAuthenticated'](),controller[_0x08ff('0x13')]);router['delete'](_0x08ff('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x08ff('0x14')](_0x08ff('0xe'),auth['isAuthenticated'](),controller[_0x08ff('0x15')]);module[_0x08ff('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index d813647..98013a9 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 _0x9ffd=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x90aafe,_0x54198f){var _0x4f486c=function(_0xb647af){while(--_0xb647af){_0x90aafe['push'](_0x90aafe['shift']());}};_0x4f486c(++_0x54198f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7847b9,_0x188e55){_0x7847b9=_0x7847b9-0x0;var _0x59082c=_0x9ffd[_0x7847b9];return _0x59082c;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'closed':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd9ff('0x3')](_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd9ff('0x6')]},'mailTranscript':{'type':Sequelize[_0xd9ff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd9ff('0x7')]},'secondDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'note':{'type':Sequelize[_0xd9ff('0x7')]},'browserName':{'type':Sequelize[_0xd9ff('0x7')]},'browserVersion':{'type':Sequelize[_0xd9ff('0x7')]},'osName':{'type':Sequelize[_0xd9ff('0x7')]},'osVersion':{'type':Sequelize[_0xd9ff('0x7')]},'deviceModel':{'type':Sequelize[_0xd9ff('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd9ff('0x6')](_0xd9ff('0x8'))},'read1stAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xd9ff('0x3')]('in',_0xd9ff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd9ff('0x7')]},'customerPort':{'type':Sequelize[_0xd9ff('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa149=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x62bec0,_0x440263){var _0x21b604=function(_0x18a0ac){while(--_0x18a0ac){_0x62bec0['push'](_0x62bec0['shift']());}};_0x21b604(++_0x440263);}(_0xa149,0x18c));var _0x9a14=function(_0x510ef4,_0x1fd0f9){_0x510ef4=_0x510ef4-0x0;var _0x137b5a=_0xa149[_0x510ef4];return _0x137b5a;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'closed':{'type':Sequelize[_0x9a14('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9a14('0x3')]},'ratingType':{'type':Sequelize[_0x9a14('0x4')](_0x9a14('0x5'),_0x9a14('0x6')),'defaultValue':_0x9a14('0x5')},'ratingMessage':{'type':Sequelize[_0x9a14('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x9a14('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9a14('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9a14('0x8')]},'thirdDisposition':{'type':Sequelize[_0x9a14('0x8')]},'note':{'type':Sequelize[_0x9a14('0x8')]},'browserName':{'type':Sequelize[_0x9a14('0x8')]},'browserVersion':{'type':Sequelize[_0x9a14('0x8')]},'osName':{'type':Sequelize[_0x9a14('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9a14('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x9a14('0x8')]},'referer':{'type':Sequelize[_0x9a14('0x7')]},'customerIp':{'type':Sequelize[_0x9a14('0x8')]},'formData':{'type':Sequelize[_0x9a14('0x7')](_0x9a14('0xa'))},'read1stAt':{'type':Sequelize[_0x9a14('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x9a14('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x9a14('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e81c5f4..a1fbe20 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 _0x065a=['closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createReadStream','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','firstName','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','end','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','catch','show','params','model','keys','intersection','attributes','fields','include','options','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','AbandonInteraction','attachmentUpload','file','basename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','ContactId','Messages','length','%s%d','agentAlias','System','Visitor','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','filters','hasOwnProperty','order','sort','where','filter','$gte','includeAll','rows','nolimit','includeAgent','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','direction','secret','read','Owner','get','mkdirSync','Chat','Account'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x065a,0xe9));var _0xa065=function(_0x1d26d1,_0x2294e4){_0x1d26d1=_0x1d26d1-0x0;var _0x2d3fb2=_0x065a[_0x1d26d1];return _0x2d3fb2;};'use strict';var rimraf=require(_0xa065('0x0'));var zipdir=require(_0xa065('0x1'));var rp=require(_0xa065('0x2'));var moment=require(_0xa065('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa065('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa065('0x5'));var Redis=require(_0xa065('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa065('0x7'));var pdf=require(_0xa065('0x8'));var logger=require(_0xa065('0x9'))(_0xa065('0xa'));var config=require(_0xa065('0xb'));var db=require(_0xa065('0xc'))['db'];config[_0xa065('0xd')]=_['defaults'](config['redis'],{'host':_0xa065('0xe'),'port':0x18eb});var socket=require(_0xa065('0xf'))(new Redis(config[_0xa065('0xd')]));require(_0xa065('0x10'))['register'](socket);var jayson=require(_0xa065('0x11'));var client=jayson[_0xa065('0x12')][_0xa065('0x13')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2abd0a,_0xe85152,_0x376794,_0x140d59){return new BPromise(function(_0x5d2ef5,_0x13d87d){var _0x1e586b=_0x140d59||client;return _0x1e586b['request'](_0x2abd0a,_0x376794)[_0xa065('0x14')](function(_0x2f6eda){logger['info'](_0xa065('0x15'),_0xe85152,_0xa065('0x16'));logger[_0xa065('0x17')](_0xa065('0x18'),_0xe85152,_0xa065('0x16'),JSON[_0xa065('0x19')](_0x2f6eda));if(_0x2f6eda[_0xa065('0x1a')]){if(_0x2f6eda['error'][_0xa065('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xe85152,_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);return _0x13d87d(_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);}logger[_0xa065('0x1a')](_0xa065('0x15'),_0xe85152,_0x2f6eda['error'][_0xa065('0x1c')]);return _0x5d2ef5(_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0xe85152,'request\x20sent');_0x5d2ef5(_0x2f6eda[_0xa065('0x1d')][_0xa065('0x1c')]);}})['catch'](function(_0x134e18){logger[_0xa065('0x1a')](_0xa065('0x15'),_0xe85152,_0x134e18);_0x13d87d(_0x134e18);});});}function respondWithStatusCode(_0x163620,_0x53e880){_0x53e880=_0x53e880||0xcc;return function(_0x5109fb){if(_0x5109fb){return _0x163620[_0xa065('0x1e')](_0x53e880);}return _0x163620[_0xa065('0x1f')](_0x53e880)['end']();};}function respondWithResult(_0x3073f7,_0x2c991d){_0x2c991d=_0x2c991d||0xc8;return function(_0x18a712){if(_0x18a712){return _0x3073f7[_0xa065('0x1f')](_0x2c991d)[_0xa065('0x20')](_0x18a712);}};}function respondWithFilteredResult(_0x633f1f,_0x2b57f5){return function(_0x5d18aa){if(_0x5d18aa){var _0x1748ad=typeof _0x2b57f5['offset']===_0xa065('0x21')&&typeof _0x2b57f5[_0xa065('0x22')]==='undefined';var _0x221a1d=_0x5d18aa[_0xa065('0x23')];var _0x6cad56=_0x1748ad?0x0:_0x2b57f5[_0xa065('0x24')];var _0x3b972c=_0x1748ad?_0x5d18aa[_0xa065('0x23')]:_0x2b57f5[_0xa065('0x24')]+_0x2b57f5['limit'];var _0x5289a0;if(_0x3b972c>=_0x221a1d){_0x3b972c=_0x221a1d;_0x5289a0=0xc8;}else{_0x5289a0=0xce;}_0x633f1f[_0xa065('0x1f')](_0x5289a0);return _0x633f1f[_0xa065('0x25')](_0xa065('0x26'),_0x6cad56+'-'+_0x3b972c+'/'+_0x221a1d)[_0xa065('0x20')](_0x5d18aa);}return null;};}function saveUpdates(_0x4a3464){return function(_0x3d0234){if(_0x3d0234){return _0x3d0234[_0xa065('0x27')](_0x4a3464)['then'](function(_0x119c7d){return _0x119c7d;});}return null;};}function removeEntity(_0x41fc86){return function(_0x809592){if(_0x809592){return _0x809592['destroy']()[_0xa065('0x14')](function(){_0x41fc86[_0xa065('0x1f')](0xcc)[_0xa065('0x28')]();});}};}function handleEntityNotFound(_0x497ba2){return function(_0x2f744b){if(!_0x2f744b){_0x497ba2['sendStatus'](0x194);}return _0x2f744b;};}function handleError(_0x3568dc,_0xca6563){_0xca6563=_0xca6563||0x1f4;return function(_0x25416e){logger[_0xa065('0x1a')](_0x25416e['stack']);if(_0x25416e[_0xa065('0x29')]){delete _0x25416e[_0xa065('0x29')];}_0x3568dc['status'](_0xca6563)[_0xa065('0x2a')](_0x25416e);};}function getMustacheRender(_0x36f72b,_0x1b7a4a){return Mustache[_0xa065('0x2b')](_0x36f72b,_[_0xa065('0x2c')](_0x1b7a4a[_0xa065('0x2d')],{'contact':_0x1b7a4a[_0xa065('0x2e')],'message':_0x1b7a4a[_0xa065('0x1c')],'agent':_0x1b7a4a[_0xa065('0x2f')],'interaction':_0x1b7a4a[_0xa065('0x30')],'account':_0x1b7a4a[_0xa065('0x31')]}))||'';}exports[_0xa065('0x32')]=function(_0x3ac2a0,_0x2ee3f6){var _0x1343f={};var _0x3cf498=_[_0xa065('0x33')](db[_0xa065('0x34')]['rawAttributes'],function(_0x15e836){return{'name':_0x15e836[_0xa065('0x35')],'type':_0x15e836[_0xa065('0x36')][_0xa065('0x37')]};});_0x1343f=qs[_0xa065('0x38')](_0x3cf498,_0x3ac2a0);return interaction[_0xa065('0x39')](_0xa065('0x3a'),_0x3ac2a0[_0xa065('0x3b')],_0x3ac2a0[_0xa065('0x3c')],_0x1343f,_0x3cf498)['then'](respondWithFilteredResult(_0x2ee3f6,_0x1343f))[_0xa065('0x3d')](handleError(_0x2ee3f6,null));};exports[_0xa065('0x3e')]=function(_0x18ce27,_0x3a0fbe){var _0x3d910c={'raw':![],'where':{'id':_0x18ce27[_0xa065('0x3f')]['id']}},_0x555703={};_0x555703[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x34')]['rawAttributes']);_0x555703[_0xa065('0x3b')]=_[_0xa065('0x41')](_0x18ce27[_0xa065('0x3b')]);_0x555703['filters']=_[_0xa065('0x42')](_0x555703[_0xa065('0x40')],_0x555703[_0xa065('0x3b')]);_0x3d910c[_0xa065('0x43')]=_[_0xa065('0x42')](_0x555703[_0xa065('0x40')],qs[_0xa065('0x44')](_0x18ce27[_0xa065('0x3b')][_0xa065('0x44')]));_0x3d910c[_0xa065('0x43')]=_0x3d910c[_0xa065('0x43')]['length']?_0x3d910c[_0xa065('0x43')]:_0x555703[_0xa065('0x40')];if(_0x18ce27['query']['includeAll']){_0x3d910c[_0xa065('0x45')]=[{'all':!![]}];}_0x3d910c=_[_0xa065('0x2c')]({},_0x3d910c,_0x18ce27[_0xa065('0x46')]);return db['ChatInteraction'][_0xa065('0x47')](_0x3d910c)[_0xa065('0x14')](handleEntityNotFound(_0x3a0fbe,null))[_0xa065('0x14')](respondWithResult(_0x3a0fbe,null))[_0xa065('0x3d')](handleError(_0x3a0fbe,null));};exports[_0xa065('0x48')]=function(_0x4e483b,_0x315b2d){return db[_0xa065('0x34')][_0xa065('0x48')](_0x4e483b['body'],{})[_0xa065('0x14')](respondWithResult(_0x315b2d,0xc9))[_0xa065('0x3d')](handleError(_0x315b2d,null));};exports[_0xa065('0x27')]=function(_0x164be5,_0x423e57){if(_0x164be5['body']['id']){delete _0x164be5['body']['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x164be5[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x423e57,null))['then'](saveUpdates(_0x164be5[_0xa065('0x2d')],null))[_0xa065('0x14')](respondWithResult(_0x423e57,null))[_0xa065('0x3d')](handleError(_0x423e57,null));};exports[_0xa065('0x49')]=function(_0x585c99,_0xf7d9f3){return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x585c99[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0xf7d9f3,null))[_0xa065('0x14')](removeEntity(_0xf7d9f3,null))[_0xa065('0x3d')](handleError(_0xf7d9f3,null));};exports[_0xa065('0x4a')]=function(_0x56b850,_0x3c11c3){return db['ChatInteraction'][_0xa065('0x4a')]()[_0xa065('0x14')](respondWithResult(_0x3c11c3,null))['catch'](handleError(_0x3c11c3,null));};exports[_0xa065('0x4b')]=function(_0x234246,_0x4a6d4e){var _0x4d4666=_0x234246[_0xa065('0x3f')]['id'];var _0x3ca7c7;var _0x51b0bd;var _0x4b3e8b;return db[_0xa065('0x34')]['findOne']({'where':{'id':_0x4d4666}})['then'](function(_0x5e45b0){_0x3ca7c7=_0x5e45b0;return db['ChatWebsite'][_0xa065('0x4c')]({'where':{'id':_0x5e45b0[_0xa065('0x4d')]},'attributes':['id',_0xa065('0x4e'),_0xa065('0x4f'),_0xa065('0x50'),_0xa065('0x51'),'vidaooMetadata'],'raw':!![]});})[_0xa065('0x14')](function(_0x36bb53){if(_0x36bb53&&_0x36bb53[_0xa065('0x4e')]&&_0x36bb53[_0xa065('0x4f')]){_0x51b0bd=_0x36bb53;var _0x3bf8d7={'interaction':{'id':_0x4d4666},'agent':{'id':_0x234246['user']['id'],'name':_0x234246[_0xa065('0x3c')][_0xa065('0x29')],'fullname':_0x234246['user'][_0xa065('0x52')],'email':_0x234246['user']['email']},'contact':_0x234246[_0xa065('0x2d')]['contact'],'account':_0x234246[_0xa065('0x2d')][_0xa065('0x31')]};var _0x1eb8ce={'rejectUnauthorized':![],'method':_0xa065('0x53'),'url':_0xa065('0x54'),'headers':{'X-APIKEY':_0x36bb53[_0xa065('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x234246['user'][_0xa065('0x55')]],'buttons':null,'topic':_0x51b0bd[_0xa065('0x50')],'note':_[_0xa065('0x56')](_0x51b0bd[_0xa065('0x51')])?null:getMustacheRender(_0x51b0bd[_0xa065('0x51')],_0x3bf8d7),'metadata':null},'redirect':_0xa065('0x57'),'json':!![]};try{if(!_['isNull'](_0x51b0bd[_0xa065('0x58')])){var _0x5e8a8=getMustacheRender(_0x51b0bd[_0xa065('0x58')],_0x3bf8d7);var _0x22ff7f=JSON[_0xa065('0x59')](_0x5e8a8);_0x1eb8ce[_0xa065('0x2d')][_0xa065('0x5a')]=_0x22ff7f;}}catch(_0x5c0790){throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))](_0xa065('0x5d'));}return rp(_0x1eb8ce);}else{throw new db['Sequelize'][(_0xa065('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa065('0x14')](function(_0x424743){_0x4b3e8b=_0x424743;if(_0x4b3e8b['id']){var _0x2c3323={'body':_0x4b3e8b[_0xa065('0x5e')],'ChatWebsiteId':_0x51b0bd['id'],'ChatInteractionId':_0x3ca7c7['id'],'direction':'out','UserId':_0x234246['user']['id']};return db[_0xa065('0x5f')][_0xa065('0x48')](_0x2c3323,{});}else{throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa065('0x14')](function(){return _0x3ca7c7[_0xa065('0x60')]({'vidaooSessionId':_0x4b3e8b['id']});})[_0xa065('0x14')](respondWithResult(_0x4a6d4e,null))['catch'](handleError(_0x4a6d4e,null));};exports[_0xa065('0x61')]=function(_0x259d56,_0x47e50f){if(_0x259d56['body']['id']){delete _0x259d56[_0xa065('0x2d')]['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x259d56['params']['id']},'include':[{'model':db[_0xa065('0x62')],'as':_0xa065('0x63')}]})[_0xa065('0x14')](handleEntityNotFound(_0x47e50f,null))['then'](saveUpdates(_0x259d56['body'],null))['then'](respondWithResult(_0x47e50f,null))[_0xa065('0x3d')](handleError(_0x47e50f,null));};exports[_0xa065('0x64')]=function(_0x4f6b79,_0xc4e68f){if(_0x4f6b79['body']['id']){delete _0x4f6b79['body']['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x4f6b79[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](function(_0x2d24f2){if(!_0x2d24f2){logger[_0xa065('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa065('0x64'),0x194,_0xa065('0x65'));_0xc4e68f[_0xa065('0x1e')](0x194);}else{if(_0x2d24f2[_0xa065('0x66')]){throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))]('Interaction\x20already\x20assigned');}}return _0x2d24f2;})[_0xa065('0x14')](function(_0x51f82a){if(_0x51f82a){return _0x51f82a[_0xa065('0x27')]({'closed':_0x4f6b79[_0xa065('0x2d')][_0xa065('0x67')],'disposition':_0x4f6b79[_0xa065('0x2d')]['disposition']})[_0xa065('0x14')](function(_0x36f887){return _0x36f887;});}})[_0xa065('0x14')](function(){return respondWithRpcPromise(_0xa065('0x68'),'abandon',_0x4f6b79[_0xa065('0x2d')],client9004);})[_0xa065('0x14')](respondWithResult(_0xc4e68f,null))[_0xa065('0x3d')](handleError(_0xc4e68f,null));};exports[_0xa065('0x69')]=function(_0x435dec,_0x1c3dc4){_0x435dec[_0xa065('0x2d')][_0xa065('0x29')]=_0x435dec[_0xa065('0x6a')]['originalname'];_0x435dec['body'][_0xa065('0x6b')]=_0x435dec[_0xa065('0x6a')]['filename'];_0x435dec[_0xa065('0x2d')]['type']=_0x435dec['file'][_0xa065('0x6c')];return db['Attachment'][_0xa065('0x48')](_0x435dec[_0xa065('0x2d')])[_0xa065('0x14')](respondWithResult(_0x1c3dc4,0xc9))[_0xa065('0x3d')](handleError(_0x1c3dc4,null));};exports['attachmentDownload']=function(_0x2a94d5,_0x2efc4c){return db[_0xa065('0x34')][_0xa065('0x4c')]({'where':{'id':_0x2a94d5[_0xa065('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2efc4c,null))[_0xa065('0x14')](function(_0x5eb3db){if(_0x5eb3db){if(_0x5eb3db[_0xa065('0x67')]){return _0x2efc4c[_0xa065('0x1f')](0x193)[_0xa065('0x20')]({'status':0x193,'message':_0xa065('0x6d')});}return db[_0xa065('0x6e')][_0xa065('0x4c')]({'where':{'id':_0x2a94d5['query'][_0xa065('0x6f')]},'raw':!![]})[_0xa065('0x14')](handleEntityNotFound(_0x2efc4c,null));}})[_0xa065('0x14')](function(_0x8d5581){if(_0x8d5581){var _0x2ab43f=_0x8d5581[_0xa065('0x70')]!==null;var _0x2431bb=path[_0xa065('0x71')](config[_0xa065('0x72')],_0xa065('0x73'));if(_0x2ab43f){_0x2431bb=path['join'](_0x2431bb,_0xa065('0x74'));}var _0x4f4f4f=path[_0xa065('0x71')](_0x2431bb,_0x8d5581[_0xa065('0x6b')]);return _0x2efc4c[_0xa065('0x75')](_0x4f4f4f);}})[_0xa065('0x3d')](handleError(_0x2efc4c,null));};exports[_0xa065('0x76')]=function(_0x50f700,_0x498598){var _0x13abaa=null;var _0x3a06a1=null;var _0x3aafb4=null;if(_0x50f700['body']['id']){delete _0x50f700[_0xa065('0x2d')]['id'];}if(_0x50f700['body'][_0xa065('0x77')]){_0x3aafb4=path['join'](config['root'],_0xa065('0x78'),util[_0xa065('0x79')](_0xa065('0x7a'),Date[_0xa065('0x7b')]()));_0x50f700['body'][_0xa065('0x7c')]=_0x3aafb4;}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x50f700['params']['id']},'include':[{'model':db[_0xa065('0x5f')],'as':'Messages','include':[{'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d')}]}]})[_0xa065('0x14')](handleEntityNotFound(_0x498598,null))[_0xa065('0x14')](saveUpdates(_0x50f700[_0xa065('0x2d')],null))[_0xa065('0x14')](function(_0x8d1845){if(_0x8d1845){_0x13abaa=_0x8d1845;return db[_0xa065('0x7e')][_0xa065('0x47')]({'where':{'id':_0x13abaa[_0xa065('0x4d')]}});}})[_0xa065('0x14')](function(_0x550ea0){if(_0x550ea0){_0x3a06a1=_0x550ea0;return db[_0xa065('0x62')][_0xa065('0x47')]({'where':{'id':_0x13abaa[_0xa065('0x7f')]}});}})[_0xa065('0x14')](function(_0x3a743c){if(_0x3a743c){if(_0x3aafb4){var _0xfa1e14=null;for(var _0x59e601=0x1;_0x59e601<_0x13abaa[_0xa065('0x80')][_0xa065('0x81')];++_0x59e601){_0xfa1e14=_0x13abaa[_0xa065('0x80')][_0x59e601];var _0x3415c7=_0xfa1e14[_0xa065('0x66')]?util[_0xa065('0x79')](_0xa065('0x82'),_0x3a06a1[_0xa065('0x83')],_0xfa1e14['UserId']):_0xa065('0x84');var _0x18749c=_0x50f700[_0xa065('0x2d')]['customer']||util[_0xa065('0x79')](_0xa065('0x82'),_0xa065('0x85'),_0xfa1e14[_0xa065('0x7f')]);switch(_0x3a06a1[_0xa065('0x86')]){case'website_alias':_0x3415c7=_0xfa1e14[_0xa065('0x66')]?util['format'](_0xa065('0x82'),_0x3a06a1['agentAlias'],_0xfa1e14[_0xa065('0x66')]):'System';break;case'agent_alias':_0x3415c7=_0xfa1e14['UserId']?_0xfa1e14[_0xa065('0x7d')][_0xa065('0x87')]||_0xfa1e14[_0xa065('0x7d')][_0xa065('0x52')]:_0xa065('0x84');break;case _0xa065('0x88'):_0x3415c7=_0xfa1e14['UserId']?_0xfa1e14['User']['fullname']:_0xa065('0x84');break;default:_0x3415c7=_0xfa1e14[_0xa065('0x66')]?util[_0xa065('0x79')](_0xa065('0x82'),_0x3a06a1['agentAlias'],_0xfa1e14[_0xa065('0x66')]):_0xa065('0x84');}var _0x398105=util[_0xa065('0x79')](_0xa065('0x89'),moment(_0xfa1e14[_0xa065('0x8a')])[_0xa065('0x79')](_0xa065('0x8b')),_0xfa1e14['direction']==='in'?_0x18749c:_0x3415c7,_0xfa1e14[_0xa065('0x2d')]);if(!_0xfa1e14['secret']){fs[_0xa065('0x8c')](_0x3aafb4,_0x398105);}}return db[_0xa065('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa065('0x8e')],'as':_0xa065('0x8f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa065('0x90'),'raw':!![]}]}]});}}})[_0xa065('0x14')](function(_0x2287ef){if(!_0x2287ef||!_0x2287ef[_0xa065('0x8f')]||!_0x50f700[_0xa065('0x2d')])return _0x13abaa;var _0x1db119=_0x2287ef[_0xa065('0x91')]();return respondWithRpcPromise('SendMail',_0xa065('0x92'),{'account':_0x1db119,'message':{'from':util[_0xa065('0x79')](_0xa065('0x93'),_0x2287ef[_0xa065('0x29')],_0x2287ef['email']||_0x2287ef['Smtp'][_0xa065('0x3c')]),'to':_0x50f700[_0xa065('0x2d')][_0xa065('0x77')],'subject':'Mail\x20Transcript','text':util['format'](_0xa065('0x94'),_0x50f700[_0xa065('0x2d')]['mailTranscript']),'attachments':[{'path':_0x3aafb4}]}})['then'](function(){return _0x13abaa;})['catch'](function(_0x2982b9){logger[_0xa065('0x1a')](_0x2982b9);});})[_0xa065('0x14')](respondWithStatusCode(_0x498598,0xc8))['catch'](handleError(_0x498598,null));};exports[_0xa065('0x95')]=function(_0x840dba,_0x5b4b16){return db[_0xa065('0x5f')][_0xa065('0x47')]({'where':{'id':_0x840dba[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x5b4b16,null))[_0xa065('0x14')](function(_0x116fd3){if(_0x116fd3){return _0x116fd3[_0xa065('0x95')](_0x840dba['body'][_0xa065('0x96')],_[_0xa065('0x97')](_0x840dba[_0xa065('0x2d')],[_0xa065('0x96'),'id'])||{});}})[_0xa065('0x14')](respondWithResult(_0x5b4b16,null))['catch'](handleError(_0x5b4b16,null));};exports[_0xa065('0x98')]=function(_0x5e8d48,_0x2cc5e6){var _0x98ffe5={'raw':![],'where':{}};var _0x28cf05={};var _0x553d4e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa065('0x4c')]({'where':{'id':_0x5e8d48[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x2cc5e6,null))[_0xa065('0x14')](function(_0x1c4b74){if(_0x1c4b74){_0x28cf05[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x5f')][_0xa065('0x99')]);_0x28cf05[_0xa065('0x3b')]=_['keys'](_0x5e8d48['query']);_0x28cf05[_0xa065('0x9a')]=_[_0xa065('0x42')](_0x28cf05[_0xa065('0x40')],_0x28cf05['query']);_0x98ffe5[_0xa065('0x43')]=_[_0xa065('0x42')](_0x28cf05['model'],qs['fields'](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x44')]));_0x98ffe5[_0xa065('0x43')]=_0x98ffe5['attributes'][_0xa065('0x81')]?_0x98ffe5[_0xa065('0x43')]:_0x28cf05[_0xa065('0x40')];if(!_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9b')]('nolimit')){_0x98ffe5[_0xa065('0x22')]=qs[_0xa065('0x22')](_0x5e8d48['query'][_0xa065('0x22')]);_0x98ffe5[_0xa065('0x24')]=qs[_0xa065('0x24')](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x24')]);}_0x98ffe5[_0xa065('0x9c')]=qs['sort'](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9d')]);_0x98ffe5[_0xa065('0x9e')]=qs[_0xa065('0x9a')](_['pick'](_0x5e8d48[_0xa065('0x3b')],_0x28cf05[_0xa065('0x9a')]));_0x98ffe5[_0xa065('0x9e')]['ChatInteractionId']=_0x1c4b74['id'];if(_0x5e8d48['query']['filter']){_0x98ffe5['where']=_['merge'](_0x98ffe5['where'],{'$or':_[_0xa065('0x33')](_0x98ffe5[_0xa065('0x43')],function(_0x473c33){var _0x65f2cd={};_0x65f2cd[_0x473c33]={'$like':'%'+_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9f')]+'%'};return _0x65f2cd;})});}if(_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa0')]){var _0x2066bf=_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa0')]['split'](',');var _0x21c234={};_0x21c234[_0x2066bf[0x0]]={'$gte':moment(_0x2066bf[0x1])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')};_0x98ffe5['where']=_[_0xa065('0x2c')](_0x98ffe5[_0xa065('0x9e')],_0x21c234);}_0x98ffe5=_['merge']({},_0x98ffe5,_0x5e8d48[_0xa065('0x46')]);return db[_0xa065('0x5f')][_0xa065('0x23')]({'where':_0x98ffe5[_0xa065('0x9e')]})[_0xa065('0x14')](function(_0x8f5cd4){_0x553d4e['count']=_0x8f5cd4;if(_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa1')]){_0x98ffe5[_0xa065('0x45')]=[{'all':!![]}];}return db[_0xa065('0x5f')][_0xa065('0x39')](_0x98ffe5);})[_0xa065('0x14')](function(_0x527f85){_0x553d4e[_0xa065('0xa2')]=_0x527f85;return _0x553d4e;});}})[_0xa065('0x14')](respondWithFilteredResult(_0x2cc5e6,_0x98ffe5))[_0xa065('0x3d')](handleError(_0x2cc5e6,null));};exports['getMyMessages']=function(_0xaaf172,_0x50144f){var _0x1e9f0b={'where':{}},_0x52173b={},_0x17ab75={'count':0x0,'rows':[]};return db[_0xa065('0x34')][_0xa065('0x4c')]({'where':{'id':_0xaaf172[_0xa065('0x3f')]['id']}})['then'](handleEntityNotFound(_0x50144f,null))[_0xa065('0x14')](function(_0x2262d2){if(_0x2262d2){_0x52173b[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x5f')][_0xa065('0x99')]);_0x52173b[_0xa065('0x3b')]=_[_0xa065('0x41')](_0xaaf172['query']);_0x52173b[_0xa065('0x9a')]=_[_0xa065('0x42')](_0x52173b[_0xa065('0x40')],_0x52173b[_0xa065('0x3b')]);_0x1e9f0b[_0xa065('0x43')]=_[_0xa065('0x42')](_0x52173b[_0xa065('0x40')],qs[_0xa065('0x44')](_0xaaf172[_0xa065('0x3b')]['fields']));_0x1e9f0b['attributes']=_0x1e9f0b[_0xa065('0x43')][_0xa065('0x81')]?_0x1e9f0b[_0xa065('0x43')]:_0x52173b[_0xa065('0x40')];if(!_0xaaf172['query'][_0xa065('0x9b')](_0xa065('0xa3'))){_0x1e9f0b[_0xa065('0x22')]=qs['limit'](_0xaaf172[_0xa065('0x3b')][_0xa065('0x22')]);_0x1e9f0b[_0xa065('0x24')]=qs['offset'](_0xaaf172[_0xa065('0x3b')][_0xa065('0x24')]);}_0x1e9f0b[_0xa065('0x9c')]=qs['sort'](_0xaaf172['query']['sort']);_0x1e9f0b['where']=qs[_0xa065('0x9a')](_['pick'](_0xaaf172['query'],_0x52173b[_0xa065('0x9a')]));_0x1e9f0b['where']['ChatInteractionId']=_0x2262d2['id'];if(_0xaaf172[_0xa065('0x3b')][_0xa065('0x9f')]){_0x1e9f0b[_0xa065('0x9e')]=_[_0xa065('0x2c')](_0x1e9f0b[_0xa065('0x9e')],{'$or':_[_0xa065('0x33')](_0x1e9f0b[_0xa065('0x43')],function(_0x218823){var _0x119834={};_0x119834[_0x218823]={'$like':'%'+_0xaaf172[_0xa065('0x3b')]['filter']+'%'};return _0x119834;})});}_0x1e9f0b['where']['secret']=![];if(_0xaaf172[_0xa065('0x3b')]['id']){_0x1e9f0b[_0xa065('0x9e')]['id']={'$gt':_0xaaf172[_0xa065('0x3b')]['id']};}_0x1e9f0b=_['merge']({},_0x1e9f0b,_0xaaf172[_0xa065('0x46')]);return db[_0xa065('0x5f')][_0xa065('0x23')]({'where':_0x1e9f0b[_0xa065('0x9e')]})['then'](function(_0x1e0c2f){_0x17ab75[_0xa065('0x23')]=_0x1e0c2f;_0x1e9f0b[_0xa065('0x45')]=[];if(_0xaaf172[_0xa065('0x3b')][_0xa065('0xa4')]){_0x1e9f0b[_0xa065('0x45')][_0xa065('0xa5')]({'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d'),'attributes':['id',_0xa065('0x52'),_0xa065('0x87')]});}if(_0xaaf172[_0xa065('0x3b')][_0xa065('0xa1')]){_0x1e9f0b[_0xa065('0x45')]=[{'all':!![]}];}return db[_0xa065('0x5f')][_0xa065('0x39')](_0x1e9f0b);})[_0xa065('0x14')](function(_0x397bde){_0x17ab75[_0xa065('0xa2')]=_0x397bde;return _0x17ab75;});}})[_0xa065('0x14')](respondWithFilteredResult(_0x50144f,_0x1e9f0b))[_0xa065('0x3d')](handleError(_0x50144f,null));};exports[_0xa065('0xa6')]=function(_0x2c8ebd,_0x298d57){return db['ChatInteraction']['find']({'where':{'id':_0x2c8ebd[_0xa065('0x3f')]['id']}})['then'](handleEntityNotFound(_0x298d57,null))[_0xa065('0x14')](function(_0x447a4e){if(_0x447a4e){return _0x447a4e[_0xa065('0xa7')](_0x2c8ebd[_0xa065('0x2d')][_0xa065('0x96')],_[_0xa065('0x97')](_0x2c8ebd[_0xa065('0x2d')],[_0xa065('0x96'),'id'])||{})['spread'](function(){return db['Tag'][_0xa065('0x39')]({'attributes':['id',_0xa065('0x29'),_0xa065('0xa8')],'where':{'id':_0x2c8ebd[_0xa065('0x2d')][_0xa065('0x96')]}});})['then'](function(_0x3c4b77){socket[_0xa065('0xa9')](_0xa065('0xaa'),{'id':Number(_0x2c8ebd[_0xa065('0x3f')]['id']),'tags':_0x3c4b77||[]});return{'id':Number(_0x2c8ebd[_0xa065('0x3f')]['id']),'tags':_0x3c4b77||[]};});}})['then'](respondWithResult(_0x298d57,null))[_0xa065('0x3d')](handleError(_0x298d57,null));};exports[_0xa065('0xab')]=function(_0x4f3542,_0x418141){return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x4f3542[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x418141,null))[_0xa065('0x14')](function(_0x285611){if(_0x285611){return _0x285611[_0xa065('0xab')](_0x4f3542[_0xa065('0x3b')][_0xa065('0x96')]);}})[_0xa065('0x14')](respondWithStatusCode(_0x418141,null))[_0xa065('0x3d')](handleError(_0x418141,null));};exports[_0xa065('0x75')]=function(_0x481cce,_0x39a495){var _0x1f0e3c=moment()[_0xa065('0xac')]()[_0xa065('0xad')]();var _0x30bb8f=path['join'](config[_0xa065('0x72')],_0xa065('0xae'),_0xa065('0xaf'),_0xa065('0xb0'));var _0x53f325=path[_0xa065('0x71')](config[_0xa065('0x72')],'server','files',_0xa065('0xb1'));var _0x538358=path['join'](_0x30bb8f,_0x1f0e3c);var _0x29d909=util[_0xa065('0x79')](_0xa065('0xb2'),_0x481cce[_0xa065('0x3f')]['id'],_0x1f0e3c);var _0x338c4a=path[_0xa065('0x71')](_0x30bb8f,_0x29d909);var _0xff7ad2=[];_0xff7ad2['push']({'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d'),'attributes':['id',_0xa065('0x52')],'raw':!![]});_0xff7ad2[_0xa065('0xa5')]({'model':db[_0xa065('0x62')],'as':_0xa065('0x63'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x481cce[_0xa065('0x3b')][_0xa065('0xb1')]){_0xff7ad2[_0xa065('0xa5')]({'model':db['Attachment'],'as':_0xa065('0x6e'),'raw':!![]});}var _0x2abe04=[{'model':db[_0xa065('0x5f')],'as':_0xa065('0x80'),'attributes':['id',_0xa065('0x2d'),'createdAt',_0xa065('0xb3'),_0xa065('0xb4'),_0xa065('0xb5')],'include':_0xff7ad2}];_0x2abe04[_0xa065('0xa5')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xa065('0x29')]});_0x2abe04[_0xa065('0xa5')]({'model':db[_0xa065('0x7d')],'as':_0xa065('0xb6'),'attributes':['id','fullname']});return db[_0xa065('0x34')]['find']({'where':{'id':_0x481cce[_0xa065('0x3f')]['id']},'include':_0x2abe04})[_0xa065('0x14')](handleEntityNotFound(_0x39a495,null))[_0xa065('0x14')](function(_0x1438f6){if(_0x1438f6){var _0x590aa3=_0x1438f6[_0xa065('0xb7')]({'plain':!![]});fs[_0xa065('0xb8')](_0x538358);var _0x534ab4={'channel':_0xa065('0xb9'),'account':_0x590aa3[_0xa065('0xba')][_0xa065('0x29')],'agent':_0x590aa3[_0xa065('0xb6')]?_0x590aa3['Owner'][_0xa065('0x52')]:'N.A.','createdAt':moment(_0x590aa3['createdAt'])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa065('0xad')](),'closedAt':_0x590aa3[_0xa065('0x67')]?moment(_0x590aa3[_0xa065('0xbb')])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa065('0xad')]():'','disposition':_0x590aa3[_0xa065('0xbc')],'chatInfo':{'browser':_0x590aa3[_0xa065('0xbd')],'os':_0x590aa3[_0xa065('0xbe')],'referer':_0x590aa3[_0xa065('0xbf')],'customerIp':_0x590aa3[_0xa065('0xc0')],'customerPort':_0x590aa3['customerPort']?_0x590aa3[_0xa065('0xc1')]:_0xa065('0xc2')},'messages':_(_0x590aa3[_0xa065('0x80')])[_0xa065('0xc3')]()[_0xa065('0x9f')]({'secret':![]})['map'](function(_0x409759){if(_0x409759[_0xa065('0x6e')]){var _0x3de1b2=path[_0xa065('0x71')](_0x53f325,_0x409759[_0xa065('0x6e')]['basename']);if(fs['existsSync'](_0x3de1b2)){fs[_0xa065('0xc4')](_0x3de1b2)['pipe'](fs[_0xa065('0xc5')](path[_0xa065('0x71')](_0x538358,_0x409759['Attachment']['basename'])));}}return{'date':moment(_0x409759['createdAt'])[_0xa065('0x79')](_0xa065('0xc6'))['toString'](),'sender':_0x409759['direction']===_0xa065('0xc7')?_0x409759['User']?_0x409759['User'][_0xa065('0x52')]:_0xa065('0x84'):_0x409759[_0xa065('0x63')][_0xa065('0xc8')]+(_0x409759['Contact'][_0xa065('0xc9')]?'\x20'+_0x409759[_0xa065('0x63')][_0xa065('0xc9')]:''),'body':_0x409759[_0xa065('0x6e')]?_0x409759[_0xa065('0x6e')][_0xa065('0x6b')]:_0x409759[_0xa065('0x2d')],'direction':_0x409759[_0xa065('0xb3')]==='out'?'A':'C','secret':_0x409759[_0xa065('0xb4')],'read':_0x409759[_0xa065('0xb5')],'attachment':_0x409759[_0xa065('0x6e')]};})[_0xa065('0xca')]()};return ejs[_0xa065('0xcb')](path[_0xa065('0x71')](config[_0xa065('0x72')],_0xa065('0xae'),_0xa065('0xcc'),_0xa065('0xcd')),{'interaction':_0x534ab4})[_0xa065('0x14')](function(_0xcbb09b){var _0x59885c=path[_0xa065('0x71')](_0x538358,_0xa065('0xce')+_0x590aa3['id']+'-'+_0x1f0e3c+_0xa065('0xcf'));var _0x21ad24={'path':_0x59885c,'channel':_0xa065('0xb9'),'interactionId':_0x590aa3['id']};return pdf['createPdfFromHTML'](_0xcbb09b,_0x21ad24);})[_0xa065('0x14')](function(){return new Promise(function(_0x5d5a25,_0xa07c6d){zipdir(_0x538358,{'saveTo':_0x338c4a},function(_0x57b779,_0x365ece){if(_0x57b779)return _0xa07c6d(_0x57b779);return _0x5d5a25(_0x365ece);});})[_0xa065('0x14')](function(){return new BPromise(function(_0x1c2fc9,_0x55734d){rimraf(_0x538358,function(_0x8a6890){if(_0x8a6890)_0x55734d(_0x8a6890);return _0x1c2fc9();});});})[_0xa065('0x14')](function(){return _0x39a495['download'](_0x338c4a,_0x29d909,function(_0x38aa42){if(_0x38aa42){logger[_0xa065('0x1a')](_0xa065('0xd0'),_0x38aa42);}else{fs[_0xa065('0xd1')](_0x338c4a);}});});});}else{return _0x39a495['sendStatus'](0xc8);}})[_0xa065('0x3d')](handleError(_0x39a495,null));};
\ No newline at end of file
+var _0x3db5=['$gte','split','includeAll','findAll','rows','getMyMessages','secret','includeAgent','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','existsSync','createReadStream','createWriteStream','value','renderFile','server','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','undefined','limit','offset','count','update','destroy','then','status','stack','name','send','render','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','chat','user','show','params','model','keys','query','intersection','attributes','length','include','merge','options','create','body','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','email','POST','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','ContactId','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','filters','fields','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter'];(function(_0x5bb0ba,_0x3a1803){var _0x551a4e=function(_0x46de11){while(--_0x46de11){_0x5bb0ba['push'](_0x5bb0ba['shift']());}};_0x551a4e(++_0x3a1803);}(_0x3db5,0x1cf));var _0x53db=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x3db5[_0x4169d8];return _0x32084a;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x53db('0x0'));var moment=require('moment');var BPromise=require(_0x53db('0x1'));var Mustache=require(_0x53db('0x2'));var util=require(_0x53db('0x3'));var path=require(_0x53db('0x4'));var ejs=require(_0x53db('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x53db('0x6'));var interaction=require(_0x53db('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x53db('0x8'));var logger=require(_0x53db('0x9'))(_0x53db('0xa'));var config=require('../../config/environment');var db=require(_0x53db('0xb'))['db'];config['redis']=_[_0x53db('0xc')](config[_0x53db('0xd')],{'host':_0x53db('0xe'),'port':0x18eb});var socket=require(_0x53db('0xf'))(new Redis(config[_0x53db('0xd')]));require(_0x53db('0x10'))[_0x53db('0x11')](socket);var jayson=require(_0x53db('0x12'));var client=jayson[_0x53db('0x13')][_0x53db('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x53db('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x3bd641,_0x577b4e,_0x45341b,_0x31a15d){return new BPromise(function(_0x3652ca,_0x480c91){var _0x426d4c=_0x31a15d||client;return _0x426d4c[_0x53db('0x15')](_0x3bd641,_0x45341b)['then'](function(_0x77f4fa){logger[_0x53db('0x16')](_0x53db('0x17'),_0x577b4e,_0x53db('0x18'));logger[_0x53db('0x19')](_0x53db('0x1a'),_0x577b4e,'request\x20sent',JSON[_0x53db('0x1b')](_0x77f4fa));if(_0x77f4fa[_0x53db('0x1c')]){if(_0x77f4fa['error'][_0x53db('0x1d')]===0x1f4){logger[_0x53db('0x1c')](_0x53db('0x17'),_0x577b4e,_0x77f4fa[_0x53db('0x1c')]['message']);return _0x480c91(_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);}logger[_0x53db('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x577b4e,_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);return _0x3652ca(_0x77f4fa[_0x53db('0x1c')][_0x53db('0x1e')]);}else{logger[_0x53db('0x16')](_0x53db('0x17'),_0x577b4e,'request\x20sent');_0x3652ca(_0x77f4fa['result']['message']);}})[_0x53db('0x1f')](function(_0xa6ffb9){logger[_0x53db('0x1c')](_0x53db('0x17'),_0x577b4e,_0xa6ffb9);_0x480c91(_0xa6ffb9);});});}function respondWithStatusCode(_0x53eecd,_0x163aae){_0x163aae=_0x163aae||0xcc;return function(_0x4ebccf){if(_0x4ebccf){return _0x53eecd[_0x53db('0x20')](_0x163aae);}return _0x53eecd['status'](_0x163aae)[_0x53db('0x21')]();};}function respondWithResult(_0x45ff9b,_0x2be53e){_0x2be53e=_0x2be53e||0xc8;return function(_0x1292d1){if(_0x1292d1){return _0x45ff9b['status'](_0x2be53e)[_0x53db('0x22')](_0x1292d1);}};}function respondWithFilteredResult(_0x59a692,_0x5dda8e){return function(_0x5bea95){if(_0x5bea95){var _0x1c4401=typeof _0x5dda8e['offset']===_0x53db('0x23')&&typeof _0x5dda8e[_0x53db('0x24')]===_0x53db('0x23');var _0x4fa7b0=_0x5bea95['count'];var _0x11569c=_0x1c4401?0x0:_0x5dda8e[_0x53db('0x25')];var _0x1412a5=_0x1c4401?_0x5bea95[_0x53db('0x26')]:_0x5dda8e[_0x53db('0x25')]+_0x5dda8e[_0x53db('0x24')];var _0x78f706;if(_0x1412a5>=_0x4fa7b0){_0x1412a5=_0x4fa7b0;_0x78f706=0xc8;}else{_0x78f706=0xce;}_0x59a692['status'](_0x78f706);return _0x59a692['set']('Content-Range',_0x11569c+'-'+_0x1412a5+'/'+_0x4fa7b0)[_0x53db('0x22')](_0x5bea95);}return null;};}function saveUpdates(_0x68f662){return function(_0xd5aaef){if(_0xd5aaef){return _0xd5aaef[_0x53db('0x27')](_0x68f662)['then'](function(_0x5a4a27){return _0x5a4a27;});}return null;};}function removeEntity(_0x29d43b){return function(_0x54fa2d){if(_0x54fa2d){return _0x54fa2d[_0x53db('0x28')]()[_0x53db('0x29')](function(){_0x29d43b[_0x53db('0x2a')](0xcc)[_0x53db('0x21')]();});}};}function handleEntityNotFound(_0x574cbb){return function(_0x375de4){if(!_0x375de4){_0x574cbb[_0x53db('0x20')](0x194);}return _0x375de4;};}function handleError(_0x3b1639,_0x2988f6){_0x2988f6=_0x2988f6||0x1f4;return function(_0x13941d){logger[_0x53db('0x1c')](_0x13941d[_0x53db('0x2b')]);if(_0x13941d[_0x53db('0x2c')]){delete _0x13941d[_0x53db('0x2c')];}_0x3b1639['status'](_0x2988f6)[_0x53db('0x2d')](_0x13941d);};}function getMustacheRender(_0x393af1,_0x1c0293){return Mustache[_0x53db('0x2e')](_0x393af1,_['merge'](_0x1c0293['body'],{'contact':_0x1c0293[_0x53db('0x2f')],'message':_0x1c0293[_0x53db('0x1e')],'agent':_0x1c0293[_0x53db('0x30')],'interaction':_0x1c0293['interaction'],'account':_0x1c0293[_0x53db('0x31')]}))||'';}exports[_0x53db('0x32')]=function(_0x1dc62e,_0x9ed845){var _0x580c55={};var _0xf4c15d=_[_0x53db('0x33')](db[_0x53db('0x34')][_0x53db('0x35')],function(_0x3a44c9){return{'name':_0x3a44c9[_0x53db('0x36')],'type':_0x3a44c9[_0x53db('0x37')][_0x53db('0x38')]};});_0x580c55=qs['getOptions'](_0xf4c15d,_0x1dc62e);return interaction['findAll'](_0x53db('0x39'),_0x1dc62e['query'],_0x1dc62e[_0x53db('0x3a')],_0x580c55,_0xf4c15d)['then'](respondWithFilteredResult(_0x9ed845,_0x580c55))[_0x53db('0x1f')](handleError(_0x9ed845,null));};exports[_0x53db('0x3b')]=function(_0x318563,_0x467eae){var _0x48ac8b={'raw':![],'where':{'id':_0x318563[_0x53db('0x3c')]['id']}},_0x4c1939={};_0x4c1939[_0x53db('0x3d')]=_[_0x53db('0x3e')](db[_0x53db('0x34')][_0x53db('0x35')]);_0x4c1939['query']=_['keys'](_0x318563[_0x53db('0x3f')]);_0x4c1939['filters']=_[_0x53db('0x40')](_0x4c1939[_0x53db('0x3d')],_0x4c1939['query']);_0x48ac8b[_0x53db('0x41')]=_[_0x53db('0x40')](_0x4c1939[_0x53db('0x3d')],qs['fields'](_0x318563[_0x53db('0x3f')]['fields']));_0x48ac8b[_0x53db('0x41')]=_0x48ac8b[_0x53db('0x41')][_0x53db('0x42')]?_0x48ac8b['attributes']:_0x4c1939[_0x53db('0x3d')];if(_0x318563[_0x53db('0x3f')]['includeAll']){_0x48ac8b[_0x53db('0x43')]=[{'all':!![]}];}_0x48ac8b=_[_0x53db('0x44')]({},_0x48ac8b,_0x318563[_0x53db('0x45')]);return db['ChatInteraction']['find'](_0x48ac8b)[_0x53db('0x29')](handleEntityNotFound(_0x467eae,null))[_0x53db('0x29')](respondWithResult(_0x467eae,null))[_0x53db('0x1f')](handleError(_0x467eae,null));};exports[_0x53db('0x46')]=function(_0x2b2bb3,_0x9f666){return db['ChatInteraction'][_0x53db('0x46')](_0x2b2bb3[_0x53db('0x47')],{})[_0x53db('0x29')](respondWithResult(_0x9f666,0xc9))[_0x53db('0x1f')](handleError(_0x9f666,null));};exports[_0x53db('0x27')]=function(_0x67409,_0xf5ae4c){if(_0x67409['body']['id']){delete _0x67409[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x67409[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0xf5ae4c,null))[_0x53db('0x29')](saveUpdates(_0x67409[_0x53db('0x47')],null))[_0x53db('0x29')](respondWithResult(_0xf5ae4c,null))['catch'](handleError(_0xf5ae4c,null));};exports[_0x53db('0x28')]=function(_0x1d788f,_0x2fe772){return db[_0x53db('0x34')]['find']({'where':{'id':_0x1d788f[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2fe772,null))['then'](removeEntity(_0x2fe772,null))['catch'](handleError(_0x2fe772,null));};exports[_0x53db('0x49')]=function(_0x22ebf6,_0x951552){return db[_0x53db('0x34')][_0x53db('0x49')]()['then'](respondWithResult(_0x951552,null))[_0x53db('0x1f')](handleError(_0x951552,null));};exports[_0x53db('0x4a')]=function(_0x3cd527,_0x31e0af){var _0x2612da=_0x3cd527[_0x53db('0x3c')]['id'];var _0x4c9cd0;var _0x5ae5a8;var _0x1e87c8;return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x2612da}})[_0x53db('0x29')](function(_0x3cb7b6){_0x4c9cd0=_0x3cb7b6;return db[_0x53db('0x4c')][_0x53db('0x4b')]({'where':{'id':_0x3cb7b6[_0x53db('0x4d')]},'attributes':['id',_0x53db('0x4e'),_0x53db('0x4f'),_0x53db('0x50'),'vidaooNote',_0x53db('0x51')],'raw':!![]});})[_0x53db('0x29')](function(_0x487ad9){if(_0x487ad9&&_0x487ad9[_0x53db('0x4e')]&&_0x487ad9[_0x53db('0x4f')]){_0x5ae5a8=_0x487ad9;var _0x5ad859={'interaction':{'id':_0x2612da},'agent':{'id':_0x3cd527[_0x53db('0x3a')]['id'],'name':_0x3cd527['user'][_0x53db('0x2c')],'fullname':_0x3cd527['user'][_0x53db('0x52')],'email':_0x3cd527[_0x53db('0x3a')][_0x53db('0x53')]},'contact':_0x3cd527['body'][_0x53db('0x2f')],'account':_0x3cd527[_0x53db('0x47')][_0x53db('0x31')]};var _0x31b9f0={'rejectUnauthorized':![],'method':_0x53db('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x487ad9['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3cd527[_0x53db('0x3a')][_0x53db('0x53')]],'buttons':null,'topic':_0x5ae5a8[_0x53db('0x50')],'note':_[_0x53db('0x55')](_0x5ae5a8[_0x53db('0x56')])?null:getMustacheRender(_0x5ae5a8[_0x53db('0x56')],_0x5ad859),'metadata':null},'redirect':_0x53db('0x57'),'json':!![]};try{if(!_[_0x53db('0x55')](_0x5ae5a8[_0x53db('0x51')])){var _0x3f38fd=getMustacheRender(_0x5ae5a8[_0x53db('0x51')],_0x5ad859);var _0x3509f0=JSON['parse'](_0x3f38fd);_0x31b9f0[_0x53db('0x47')][_0x53db('0x58')]=_0x3509f0;}}catch(_0x308663){throw new db[(_0x53db('0x59'))][(_0x53db('0x5a'))](_0x53db('0x5b'));}return rp(_0x31b9f0);}else{throw new db['Sequelize'][(_0x53db('0x5a'))](_0x53db('0x5c'));}})['then'](function(_0x2d395a){_0x1e87c8=_0x2d395a;if(_0x1e87c8['id']){var _0x4ce60a={'body':_0x1e87c8[_0x53db('0x5d')],'ChatWebsiteId':_0x5ae5a8['id'],'ChatInteractionId':_0x4c9cd0['id'],'direction':_0x53db('0x5e'),'UserId':_0x3cd527['user']['id']};return db[_0x53db('0x5f')][_0x53db('0x46')](_0x4ce60a,{});}else{throw new db['Sequelize'][(_0x53db('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x53db('0x29')](function(){return _0x4c9cd0[_0x53db('0x60')]({'vidaooSessionId':_0x1e87c8['id']});})[_0x53db('0x29')](respondWithResult(_0x31e0af,null))[_0x53db('0x1f')](handleError(_0x31e0af,null));};exports[_0x53db('0x61')]=function(_0x1cb100,_0x4a99a1){if(_0x1cb100[_0x53db('0x47')]['id']){delete _0x1cb100[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x1cb100[_0x53db('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x53db('0x62')}]})['then'](handleEntityNotFound(_0x4a99a1,null))['then'](saveUpdates(_0x1cb100['body'],null))['then'](respondWithResult(_0x4a99a1,null))[_0x53db('0x1f')](handleError(_0x4a99a1,null));};exports[_0x53db('0x63')]=function(_0xea039f,_0x2d3c4d){if(_0xea039f[_0x53db('0x47')]['id']){delete _0xea039f[_0x53db('0x47')]['id'];}return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0xea039f['params']['id']}})[_0x53db('0x29')](function(_0x3ecff3){if(!_0x3ecff3){logger[_0x53db('0x1c')](_0x53db('0x64'),_0x53db('0x63'),0x194,_0x53db('0x65'));_0x2d3c4d[_0x53db('0x20')](0x194);}else{if(_0x3ecff3['UserId']){throw new db[(_0x53db('0x59'))][(_0x53db('0x5a'))](_0x53db('0x66'));}}return _0x3ecff3;})['then'](function(_0x34979f){if(_0x34979f){return _0x34979f[_0x53db('0x27')]({'closed':_0xea039f[_0x53db('0x47')][_0x53db('0x67')],'disposition':_0xea039f['body'][_0x53db('0x68')]})[_0x53db('0x29')](function(_0x4efcd6){return _0x4efcd6;});}})[_0x53db('0x29')](function(){return respondWithRpcPromise('AbandonInteraction',_0x53db('0x63'),_0xea039f[_0x53db('0x47')],client9004);})[_0x53db('0x29')](respondWithResult(_0x2d3c4d,null))[_0x53db('0x1f')](handleError(_0x2d3c4d,null));};exports['attachmentUpload']=function(_0x355c4f,_0x3df06e){_0x355c4f[_0x53db('0x47')][_0x53db('0x2c')]=_0x355c4f[_0x53db('0x69')][_0x53db('0x6a')];_0x355c4f[_0x53db('0x47')][_0x53db('0x6b')]=_0x355c4f['file']['filename'];_0x355c4f[_0x53db('0x47')]['type']=_0x355c4f[_0x53db('0x69')][_0x53db('0x6c')];return db['Attachment'][_0x53db('0x46')](_0x355c4f[_0x53db('0x47')])['then'](respondWithResult(_0x3df06e,0xc9))[_0x53db('0x1f')](handleError(_0x3df06e,null));};exports[_0x53db('0x6d')]=function(_0x54da36,_0x2c3f2a){return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x54da36[_0x53db('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c3f2a,null))[_0x53db('0x29')](function(_0x14c6eb){if(_0x14c6eb){if(_0x14c6eb['closed']){return _0x2c3f2a[_0x53db('0x2a')](0x193)[_0x53db('0x22')]({'status':0x193,'message':_0x53db('0x6e')});}return db[_0x53db('0x6f')][_0x53db('0x4b')]({'where':{'id':_0x54da36[_0x53db('0x3f')][_0x53db('0x70')]},'raw':!![]})[_0x53db('0x29')](handleEntityNotFound(_0x2c3f2a,null));}})[_0x53db('0x29')](function(_0x4dee79){if(_0x4dee79){var _0x1ea1c3=_0x4dee79['ChatOfflineMessageId']!==null;var _0x4c7a1a=path[_0x53db('0x71')](config[_0x53db('0x72')],_0x53db('0x73'));if(_0x1ea1c3){_0x4c7a1a=path[_0x53db('0x71')](_0x4c7a1a,_0x53db('0x74'));}var _0x3ec60a=path[_0x53db('0x71')](_0x4c7a1a,_0x4dee79['basename']);return _0x2c3f2a['download'](_0x3ec60a);}})[_0x53db('0x1f')](handleError(_0x2c3f2a,null));};exports[_0x53db('0x75')]=function(_0x14e293,_0x18ff31){var _0x26d515=null;var _0x4d6008=null;var _0x2e6c59=null;if(_0x14e293[_0x53db('0x47')]['id']){delete _0x14e293[_0x53db('0x47')]['id'];}if(_0x14e293[_0x53db('0x47')][_0x53db('0x76')]){_0x2e6c59=path['join'](config[_0x53db('0x72')],_0x53db('0x77'),util[_0x53db('0x78')](_0x53db('0x79'),Date[_0x53db('0x7a')]()));_0x14e293[_0x53db('0x47')][_0x53db('0x7b')]=_0x2e6c59;}return db['ChatInteraction']['find']({'where':{'id':_0x14e293['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c')}]}]})['then'](handleEntityNotFound(_0x18ff31,null))['then'](saveUpdates(_0x14e293[_0x53db('0x47')],null))[_0x53db('0x29')](function(_0x4739a5){if(_0x4739a5){_0x26d515=_0x4739a5;return db[_0x53db('0x4c')][_0x53db('0x48')]({'where':{'id':_0x26d515[_0x53db('0x4d')]}});}})[_0x53db('0x29')](function(_0x9988d3){if(_0x9988d3){_0x4d6008=_0x9988d3;return db['CmContact'][_0x53db('0x48')]({'where':{'id':_0x26d515['ContactId']}});}})[_0x53db('0x29')](function(_0x5ace92){if(_0x5ace92){if(_0x2e6c59){var _0x4359d1=null;for(var _0x468ad5=0x1;_0x468ad5<_0x26d515[_0x53db('0x7d')][_0x53db('0x42')];++_0x468ad5){_0x4359d1=_0x26d515[_0x53db('0x7d')][_0x468ad5];var _0x41f711=_0x4359d1['UserId']?util[_0x53db('0x78')](_0x53db('0x7e'),_0x4d6008[_0x53db('0x7f')],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');var _0x46d9e4=_0x14e293['body'][_0x53db('0x82')]||util[_0x53db('0x78')]('%s%d',_0x53db('0x83'),_0x4359d1[_0x53db('0x84')]);switch(_0x4d6008['agentIdentifier']){case _0x53db('0x85'):_0x41f711=_0x4359d1[_0x53db('0x80')]?util['format'](_0x53db('0x7e'),_0x4d6008['agentAlias'],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');break;case _0x53db('0x86'):_0x41f711=_0x4359d1['UserId']?_0x4359d1[_0x53db('0x7c')][_0x53db('0x87')]||_0x4359d1[_0x53db('0x7c')][_0x53db('0x52')]:_0x53db('0x81');break;case'agent_fullname':_0x41f711=_0x4359d1[_0x53db('0x80')]?_0x4359d1[_0x53db('0x7c')][_0x53db('0x52')]:_0x53db('0x81');break;default:_0x41f711=_0x4359d1[_0x53db('0x80')]?util[_0x53db('0x78')](_0x53db('0x7e'),_0x4d6008[_0x53db('0x7f')],_0x4359d1[_0x53db('0x80')]):_0x53db('0x81');}var _0x4f3001=util[_0x53db('0x78')](_0x53db('0x88'),moment(_0x4359d1[_0x53db('0x89')])[_0x53db('0x78')](_0x53db('0x8a')),_0x4359d1[_0x53db('0x8b')]==='in'?_0x46d9e4:_0x41f711,_0x4359d1['body']);if(!_0x4359d1['secret']){fs['appendFileSync'](_0x2e6c59,_0x4f3001);}}return db[_0x53db('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x53db('0x8d')],'as':_0x53db('0x8e'),'raw':!![],'include':[{'model':db[_0x53db('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x53db('0x29')](function(_0x190f36){if(!_0x190f36||!_0x190f36[_0x53db('0x8e')]||!_0x14e293[_0x53db('0x47')])return _0x26d515;var _0x17674e=_0x190f36['getSmtpOptions']();return respondWithRpcPromise(_0x53db('0x90'),_0x53db('0x91'),{'account':_0x17674e,'message':{'from':util[_0x53db('0x78')](_0x53db('0x92'),_0x190f36[_0x53db('0x2c')],_0x190f36['email']||_0x190f36[_0x53db('0x8e')][_0x53db('0x3a')]),'to':_0x14e293[_0x53db('0x47')][_0x53db('0x76')],'subject':_0x53db('0x93'),'text':util[_0x53db('0x78')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x14e293[_0x53db('0x47')][_0x53db('0x76')]),'attachments':[{'path':_0x2e6c59}]}})['then'](function(){return _0x26d515;})['catch'](function(_0x2871d4){logger[_0x53db('0x1c')](_0x2871d4);});})[_0x53db('0x29')](respondWithStatusCode(_0x18ff31,0xc8))['catch'](handleError(_0x18ff31,null));};exports['addMessage']=function(_0x5080d8,_0x5eb15d){return db[_0x53db('0x5f')][_0x53db('0x48')]({'where':{'id':_0x5080d8[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0x5eb15d,null))[_0x53db('0x29')](function(_0xc46662){if(_0xc46662){return _0xc46662[_0x53db('0x94')](_0x5080d8['body'][_0x53db('0x95')],_[_0x53db('0x96')](_0x5080d8['body'],[_0x53db('0x95'),'id'])||{});}})[_0x53db('0x29')](respondWithResult(_0x5eb15d,null))[_0x53db('0x1f')](handleError(_0x5eb15d,null));};exports['getMessages']=function(_0x54cd78,_0xce3bd6){var _0x51f543={'raw':![],'where':{}};var _0x5a13f6={};var _0x43842e={'count':0x0,'rows':[]};return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x54cd78[_0x53db('0x3c')]['id']}})[_0x53db('0x29')](handleEntityNotFound(_0xce3bd6,null))['then'](function(_0x2b4986){if(_0x2b4986){_0x5a13f6[_0x53db('0x3d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x5a13f6[_0x53db('0x3f')]=_[_0x53db('0x3e')](_0x54cd78['query']);_0x5a13f6[_0x53db('0x97')]=_['intersection'](_0x5a13f6[_0x53db('0x3d')],_0x5a13f6[_0x53db('0x3f')]);_0x51f543[_0x53db('0x41')]=_[_0x53db('0x40')](_0x5a13f6[_0x53db('0x3d')],qs[_0x53db('0x98')](_0x54cd78['query']['fields']));_0x51f543[_0x53db('0x41')]=_0x51f543[_0x53db('0x41')][_0x53db('0x42')]?_0x51f543['attributes']:_0x5a13f6['model'];if(!_0x54cd78[_0x53db('0x3f')][_0x53db('0x99')](_0x53db('0x9a'))){_0x51f543[_0x53db('0x24')]=qs['limit'](_0x54cd78[_0x53db('0x3f')][_0x53db('0x24')]);_0x51f543[_0x53db('0x25')]=qs[_0x53db('0x25')](_0x54cd78['query'][_0x53db('0x25')]);}_0x51f543[_0x53db('0x9b')]=qs['sort'](_0x54cd78['query'][_0x53db('0x9c')]);_0x51f543['where']=qs[_0x53db('0x97')](_[_0x53db('0x9d')](_0x54cd78[_0x53db('0x3f')],_0x5a13f6[_0x53db('0x97')]));_0x51f543[_0x53db('0x9e')][_0x53db('0x9f')]=_0x2b4986['id'];if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa0')]){_0x51f543[_0x53db('0x9e')]=_['merge'](_0x51f543[_0x53db('0x9e')],{'$or':_['map'](_0x51f543['attributes'],function(_0x99004){var _0x14d576={};_0x14d576[_0x99004]={'$like':'%'+_0x54cd78[_0x53db('0x3f')][_0x53db('0xa0')]+'%'};return _0x14d576;})});}if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa1')]){var _0x560bc6=_0x54cd78['query'][_0x53db('0xa1')][_0x53db('0xa2')](',');var _0x4349bf={};_0x4349bf[_0x560bc6[0x0]]={'$gte':moment(_0x560bc6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x51f543[_0x53db('0x9e')]=_[_0x53db('0x44')](_0x51f543[_0x53db('0x9e')],_0x4349bf);}_0x51f543=_[_0x53db('0x44')]({},_0x51f543,_0x54cd78[_0x53db('0x45')]);return db[_0x53db('0x5f')][_0x53db('0x26')]({'where':_0x51f543['where']})[_0x53db('0x29')](function(_0x256974){_0x43842e[_0x53db('0x26')]=_0x256974;if(_0x54cd78[_0x53db('0x3f')][_0x53db('0xa3')]){_0x51f543[_0x53db('0x43')]=[{'all':!![]}];}return db[_0x53db('0x5f')][_0x53db('0xa4')](_0x51f543);})[_0x53db('0x29')](function(_0x4a6c5e){_0x43842e[_0x53db('0xa5')]=_0x4a6c5e;return _0x43842e;});}})['then'](respondWithFilteredResult(_0xce3bd6,_0x51f543))[_0x53db('0x1f')](handleError(_0xce3bd6,null));};exports[_0x53db('0xa6')]=function(_0x2546e0,_0x148751){var _0x4da08b={'where':{}},_0x17d8d3={},_0x6fcc07={'count':0x0,'rows':[]};return db[_0x53db('0x34')][_0x53db('0x4b')]({'where':{'id':_0x2546e0['params']['id']}})['then'](handleEntityNotFound(_0x148751,null))[_0x53db('0x29')](function(_0x405c4b){if(_0x405c4b){_0x17d8d3[_0x53db('0x3d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x17d8d3[_0x53db('0x3f')]=_[_0x53db('0x3e')](_0x2546e0[_0x53db('0x3f')]);_0x17d8d3['filters']=_[_0x53db('0x40')](_0x17d8d3[_0x53db('0x3d')],_0x17d8d3['query']);_0x4da08b[_0x53db('0x41')]=_['intersection'](_0x17d8d3['model'],qs[_0x53db('0x98')](_0x2546e0[_0x53db('0x3f')][_0x53db('0x98')]));_0x4da08b[_0x53db('0x41')]=_0x4da08b[_0x53db('0x41')][_0x53db('0x42')]?_0x4da08b[_0x53db('0x41')]:_0x17d8d3['model'];if(!_0x2546e0[_0x53db('0x3f')][_0x53db('0x99')]('nolimit')){_0x4da08b[_0x53db('0x24')]=qs[_0x53db('0x24')](_0x2546e0[_0x53db('0x3f')][_0x53db('0x24')]);_0x4da08b[_0x53db('0x25')]=qs[_0x53db('0x25')](_0x2546e0['query'][_0x53db('0x25')]);}_0x4da08b[_0x53db('0x9b')]=qs['sort'](_0x2546e0[_0x53db('0x3f')][_0x53db('0x9c')]);_0x4da08b[_0x53db('0x9e')]=qs[_0x53db('0x97')](_[_0x53db('0x9d')](_0x2546e0[_0x53db('0x3f')],_0x17d8d3[_0x53db('0x97')]));_0x4da08b[_0x53db('0x9e')][_0x53db('0x9f')]=_0x405c4b['id'];if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa0')]){_0x4da08b[_0x53db('0x9e')]=_[_0x53db('0x44')](_0x4da08b['where'],{'$or':_[_0x53db('0x33')](_0x4da08b[_0x53db('0x41')],function(_0x6bcde){var _0x14b17d={};_0x14b17d[_0x6bcde]={'$like':'%'+_0x2546e0['query'][_0x53db('0xa0')]+'%'};return _0x14b17d;})});}_0x4da08b[_0x53db('0x9e')][_0x53db('0xa7')]=![];if(_0x2546e0[_0x53db('0x3f')]['id']){_0x4da08b[_0x53db('0x9e')]['id']={'$gt':_0x2546e0['query']['id']};}_0x4da08b=_[_0x53db('0x44')]({},_0x4da08b,_0x2546e0[_0x53db('0x45')]);return db[_0x53db('0x5f')][_0x53db('0x26')]({'where':_0x4da08b[_0x53db('0x9e')]})['then'](function(_0x5dd7c2){_0x6fcc07[_0x53db('0x26')]=_0x5dd7c2;_0x4da08b[_0x53db('0x43')]=[];if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa8')]){_0x4da08b[_0x53db('0x43')][_0x53db('0xa9')]({'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c'),'attributes':['id',_0x53db('0x52'),'alias']});}if(_0x2546e0[_0x53db('0x3f')][_0x53db('0xa3')]){_0x4da08b[_0x53db('0x43')]=[{'all':!![]}];}return db['ChatMessage'][_0x53db('0xa4')](_0x4da08b);})[_0x53db('0x29')](function(_0x51593f){_0x6fcc07['rows']=_0x51593f;return _0x6fcc07;});}})[_0x53db('0x29')](respondWithFilteredResult(_0x148751,_0x4da08b))[_0x53db('0x1f')](handleError(_0x148751,null));};exports['addTags']=function(_0x1af81a,_0x39b42b){return db[_0x53db('0x34')]['find']({'where':{'id':_0x1af81a[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x39b42b,null))[_0x53db('0x29')](function(_0x271eaa){if(_0x271eaa){return _0x271eaa[_0x53db('0xaa')](_0x1af81a[_0x53db('0x47')][_0x53db('0x95')],_['omit'](_0x1af81a[_0x53db('0x47')],[_0x53db('0x95'),'id'])||{})[_0x53db('0xab')](function(){return db[_0x53db('0xac')][_0x53db('0xa4')]({'attributes':['id',_0x53db('0x2c'),_0x53db('0xad')],'where':{'id':_0x1af81a['body'][_0x53db('0x95')]}});})['then'](function(_0x4df2e9){socket[_0x53db('0xae')](_0x53db('0xaf'),{'id':Number(_0x1af81a['params']['id']),'tags':_0x4df2e9||[]});return{'id':Number(_0x1af81a['params']['id']),'tags':_0x4df2e9||[]};});}})['then'](respondWithResult(_0x39b42b,null))[_0x53db('0x1f')](handleError(_0x39b42b,null));};exports[_0x53db('0xb0')]=function(_0x2d02cf,_0x1e07f7){return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x2d02cf[_0x53db('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1e07f7,null))[_0x53db('0x29')](function(_0x3f6cae){if(_0x3f6cae){return _0x3f6cae[_0x53db('0xb0')](_0x2d02cf[_0x53db('0x3f')][_0x53db('0x95')]);}})[_0x53db('0x29')](respondWithStatusCode(_0x1e07f7,null))['catch'](handleError(_0x1e07f7,null));};exports[_0x53db('0xb1')]=function(_0x4ce03d,_0x277f80){var _0x27b787=moment()[_0x53db('0xb2')]()[_0x53db('0xb3')]();var _0x148836=path['join'](config['root'],'server',_0x53db('0xb4'),_0x53db('0xb5'));var _0x17651f=path[_0x53db('0x71')](config[_0x53db('0x72')],'server','files',_0x53db('0xb6'));var _0x167803=path[_0x53db('0x71')](_0x148836,_0x27b787);var _0x3f9f7c=util['format'](_0x53db('0xb7'),_0x4ce03d[_0x53db('0x3c')]['id'],_0x27b787);var _0x18e9be=path[_0x53db('0x71')](_0x148836,_0x3f9f7c);var _0x513077=[];_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0x7c')],'as':_0x53db('0x7c'),'attributes':['id',_0x53db('0x52')],'raw':!![]});_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0xb8')],'as':'Contact','attributes':['id',_0x53db('0xb9'),_0x53db('0xba')],'raw':!![]});if(_0x4ce03d['query'][_0x53db('0xb6')]){_0x513077[_0x53db('0xa9')]({'model':db[_0x53db('0x6f')],'as':_0x53db('0x6f'),'raw':!![]});}var _0x13946c=[{'model':db[_0x53db('0x5f')],'as':'Messages','attributes':['id',_0x53db('0x47'),_0x53db('0x89'),_0x53db('0x8b'),_0x53db('0xa7'),_0x53db('0xbb')],'include':_0x513077}];_0x13946c[_0x53db('0xa9')]({'model':db['ChatWebsite'],'as':_0x53db('0xbc'),'attributes':['id',_0x53db('0x2c')]});_0x13946c['push']({'model':db['User'],'as':_0x53db('0xbd'),'attributes':['id',_0x53db('0x52')]});return db[_0x53db('0x34')][_0x53db('0x48')]({'where':{'id':_0x4ce03d[_0x53db('0x3c')]['id']},'include':_0x13946c})[_0x53db('0x29')](handleEntityNotFound(_0x277f80,null))[_0x53db('0x29')](function(_0x3efaed){if(_0x3efaed){var _0x563e2c=_0x3efaed['get']({'plain':!![]});fs['mkdirSync'](_0x167803);var _0x191c0c={'channel':_0x53db('0xbe'),'account':_0x563e2c[_0x53db('0xbc')][_0x53db('0x2c')],'agent':_0x563e2c[_0x53db('0xbd')]?_0x563e2c[_0x53db('0xbd')]['fullname']:_0x53db('0xbf'),'createdAt':moment(_0x563e2c['createdAt'])[_0x53db('0x78')](_0x53db('0xc0'))['toString'](),'closedAt':_0x563e2c[_0x53db('0x67')]?moment(_0x563e2c['closedAt'])['format'](_0x53db('0xc0'))[_0x53db('0xb3')]():'','disposition':_0x563e2c[_0x53db('0x68')],'chatInfo':{'browser':_0x563e2c[_0x53db('0xc1')],'os':_0x563e2c[_0x53db('0xc2')],'referer':_0x563e2c[_0x53db('0xc3')],'customerIp':_0x563e2c[_0x53db('0xc4')],'customerPort':_0x563e2c['customerPort']?_0x563e2c['customerPort']:_0x53db('0xbf')},'messages':_(_0x563e2c[_0x53db('0x7d')])['tail']()[_0x53db('0xa0')]({'secret':![]})[_0x53db('0x33')](function(_0x1176cb){if(_0x1176cb['Attachment']){var _0x4325fb=path[_0x53db('0x71')](_0x17651f,_0x1176cb[_0x53db('0x6f')]['basename']);if(fs[_0x53db('0xc5')](_0x4325fb)){fs[_0x53db('0xc6')](_0x4325fb)['pipe'](fs[_0x53db('0xc7')](path['join'](_0x167803,_0x1176cb['Attachment']['basename'])));}}return{'date':moment(_0x1176cb[_0x53db('0x89')])[_0x53db('0x78')](_0x53db('0xc0'))[_0x53db('0xb3')](),'sender':_0x1176cb[_0x53db('0x8b')]==='out'?_0x1176cb['User']?_0x1176cb[_0x53db('0x7c')]['fullname']:'System':_0x1176cb[_0x53db('0x62')]['firstName']+(_0x1176cb[_0x53db('0x62')][_0x53db('0xba')]?'\x20'+_0x1176cb[_0x53db('0x62')][_0x53db('0xba')]:''),'body':_0x1176cb[_0x53db('0x6f')]?_0x1176cb['Attachment'][_0x53db('0x6b')]:_0x1176cb[_0x53db('0x47')],'direction':_0x1176cb[_0x53db('0x8b')]===_0x53db('0x5e')?'A':'C','secret':_0x1176cb['secret'],'read':_0x1176cb['read'],'attachment':_0x1176cb['Attachment']};})[_0x53db('0xc8')]()};return ejs[_0x53db('0xc9')](path[_0x53db('0x71')](config[_0x53db('0x72')],_0x53db('0xca'),'views','downloadInteraction.ejs'),{'interaction':_0x191c0c})[_0x53db('0x29')](function(_0x57da9f){var _0x32e109=path[_0x53db('0x71')](_0x167803,_0x53db('0xcb')+_0x563e2c['id']+'-'+_0x27b787+_0x53db('0xcc'));var _0x4b04f2={'path':_0x32e109,'channel':'Chat','interactionId':_0x563e2c['id']};return pdf[_0x53db('0xcd')](_0x57da9f,_0x4b04f2);})[_0x53db('0x29')](function(){return new Promise(function(_0x2533f6,_0xb98e2){zipdir(_0x167803,{'saveTo':_0x18e9be},function(_0x92c075,_0x419b91){if(_0x92c075)return _0xb98e2(_0x92c075);return _0x2533f6(_0x419b91);});})[_0x53db('0x29')](function(){return new BPromise(function(_0x524c74,_0x5b1a70){rimraf(_0x167803,function(_0x43e856){if(_0x43e856)_0x5b1a70(_0x43e856);return _0x524c74();});});})[_0x53db('0x29')](function(){return _0x277f80[_0x53db('0xb1')](_0x18e9be,_0x3f9f7c,function(_0x4710ed){if(_0x4710ed){logger[_0x53db('0x1c')](_0x53db('0xce'),_0x4710ed);}else{fs[_0x53db('0xcf')](_0x18e9be);}});});});}else{return _0x277f80['sendStatus'](0xc8);}})[_0x53db('0x1f')](handleError(_0x277f80,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 679681f..9884d7b 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 _0x5529=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','Users','map','findAll','then'];(function(_0x5c6712,_0x36ef0c){var _0x4bb74e=function(_0x4e1fb2){while(--_0x4e1fb2){_0x5c6712['push'](_0x5c6712['shift']());}};_0x4bb74e(++_0x36ef0c);}(_0x5529,0xdf));var _0x9552=function(_0x2701bb,_0x29c1cc){_0x2701bb=_0x2701bb-0x0;var _0x2779db=_0x5529[_0x2701bb];return _0x2779db;};'use strict';var EventEmitter=require(_0x9552('0x0'));var ChatInteraction=require(_0x9552('0x1'))['db'][_0x9552('0x2')];var ChatMessage=require(_0x9552('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9552('0x3')](0x0);var events={'afterCreate':_0x9552('0x4'),'afterUpdate':_0x9552('0x5'),'afterDestroy':_0x9552('0x6')};function emitEvent(_0x4ae26c){return function(_0x5487f0,_0x53ecae,_0x3d4ebf){_0x5487f0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1b4695){_0x5487f0['setDataValue'](_0x9552('0x7'),_0x1b4695[_0x9552('0x8')](function(_0x490346){return{'id':_0x490346['id']};}));return ChatMessage[_0x9552('0x9')]({'where':{'ChatInteractionId':_0x5487f0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9552('0xa')](function(_0x50842a){_0x5487f0[_0x9552('0xb')](_0x9552('0xc'),_0x50842a[_0x9552('0xd')]);ChatInteractionEvents[_0x9552('0xe')](_0x4ae26c+':'+_0x5487f0['id'],_0x5487f0);ChatInteractionEvents[_0x9552('0xe')](_0x4ae26c,_0x5487f0);_0x3d4ebf(null);})[_0x9552('0xf')](_0x3d4ebf(null));};}for(var e in events){if(events[_0x9552('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9552('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x69ab=['save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x51fb04,_0x2b5804){var _0x442480=function(_0x4e5973){while(--_0x4e5973){_0x51fb04['push'](_0x51fb04['shift']());}};_0x442480(++_0x2b5804);}(_0x69ab,0x12d));var _0xb69a=function(_0x49673c,_0x163aa4){_0x49673c=_0x49673c-0x0;var _0x42714b=_0x69ab[_0x49673c];return _0x42714b;};'use strict';var EventEmitter=require(_0xb69a('0x0'));var ChatInteraction=require(_0xb69a('0x1'))['db'][_0xb69a('0x2')];var ChatMessage=require(_0xb69a('0x1'))['db'][_0xb69a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb69a('0x4')](0x0);var events={'afterCreate':_0xb69a('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ffcc7){return function(_0x4a8606,_0x348552,_0x3eca67){_0x4a8606[_0xb69a('0x6')]({'attributes':['id'],'raw':!![]})[_0xb69a('0x7')](function(_0xb6b1e7){_0x4a8606[_0xb69a('0x8')](_0xb69a('0x9'),_0xb6b1e7[_0xb69a('0xa')](function(_0x5696fd){return{'id':_0x5696fd['id']};}));return ChatMessage[_0xb69a('0xb')]({'where':{'ChatInteractionId':_0x4a8606['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb69a('0x7')](function(_0x28394b){_0x4a8606[_0xb69a('0x8')](_0xb69a('0xc'),_0x28394b['length']);ChatInteractionEvents[_0xb69a('0xd')](_0x1ffcc7+':'+_0x4a8606['id'],_0x4a8606);ChatInteractionEvents['emit'](_0x1ffcc7,_0x4a8606);_0x3eca67(null);})['catch'](_0x3eca67(null));};}for(var e in events){if(events[_0xb69a('0xe')](e)){var event=events[e];ChatInteraction[_0xb69a('0xf')](e,emitEvent(event));}}module[_0xb69a('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5245385..d03fcfe 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 _0x15d0=['request-promise','path','rimraf','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x2999c7,_0x50c6cc){var _0xc521f0=function(_0x2b624b){while(--_0x2b624b){_0x2999c7['push'](_0x2999c7['shift']());}};_0xc521f0(++_0x50c6cc);}(_0x15d0,0x14c));var _0x015d=function(_0x6bfd84,_0x5d5e05){_0x6bfd84=_0x6bfd84-0x0;var _0xf3b43a=_0x15d0[_0x6bfd84];return _0xf3b43a;};'use strict';var _=require(_0x015d('0x0'));var util=require('util');var logger=require(_0x015d('0x1'))(_0x015d('0x2'));var moment=require(_0x015d('0x3'));var BPromise=require('bluebird');var rp=require(_0x015d('0x4'));var fs=require('fs');var path=require(_0x015d('0x5'));var rimraf=require(_0x015d('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x015d('0x7')]=function(_0x52def4,_0x14c8a6){return _0x52def4[_0x015d('0x8')](_0x015d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4adc26,_0xa9cf24,_0x34d298){if(_0x4adc26[_0x015d('0xa')](_0x015d('0xb'))){_0x4adc26['closedAt']=moment()[_0x015d('0xc')](_0x015d('0xd'));}_0x34d298(null,_0x4adc26);}},'charset':_0x015d('0xe'),'collate':_0x015d('0xf')});};
\ No newline at end of file
+var _0x50d2=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','closedAt','format'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x50d2,0xe3));var _0x250d=function(_0x1faf02,_0x472953){_0x1faf02=_0x1faf02-0x0;var _0x363aaf=_0x50d2[_0x1faf02];return _0x363aaf;};'use strict';var _=require('lodash');var util=require(_0x250d('0x0'));var logger=require(_0x250d('0x1'))(_0x250d('0x2'));var moment=require(_0x250d('0x3'));var BPromise=require(_0x250d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x250d('0x5'));var rimraf=require('rimraf');var config=require(_0x250d('0x6'));var attributes=require(_0x250d('0x7'));module['exports']=function(_0x11bfc2,_0x24d3c8){return _0x11bfc2[_0x250d('0x8')](_0x250d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5165f4,_0x1a1be7,_0x1cec54){if(_0x5165f4['changed'](_0x250d('0xa'))){_0x5165f4[_0x250d('0xb')]=moment()[_0x250d('0xc')](_0x250d('0xd'));}_0x1cec54(null,_0x5165f4);}},'charset':_0x250d('0xe'),'collate':_0x250d('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 3806bdb..00c9cc6 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 _0x17bf=['spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','addTags','ids','omit'];(function(_0x35747a,_0x5763f4){var _0x224e75=function(_0x16e3dd){while(--_0x16e3dd){_0x35747a['push'](_0x35747a['shift']());}};_0x224e75(++_0x5763f4);}(_0x17bf,0xae));var _0xf17b=function(_0x166362,_0x349328){_0x166362=_0x166362-0x0;var _0x1225ed=_0x17bf[_0x166362];return _0x1225ed;};'use strict';var _=require(_0xf17b('0x0'));var util=require(_0xf17b('0x1'));var moment=require('moment');var BPromise=require(_0xf17b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf17b('0x3'));var db=require(_0xf17b('0x4'))['db'];var utils=require(_0xf17b('0x5'));var logger=require('../../config/logger')(_0xf17b('0x6'));var config=require(_0xf17b('0x7'));var jayson=require(_0xf17b('0x8'));var client=jayson[_0xf17b('0x9')][_0xf17b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf17b('0xb')],{'host':_0xf17b('0xc'),'port':0x18eb});var socket=require(_0xf17b('0xd'))(new Redis(config['redis']));require(_0xf17b('0xe'))['register'](socket);function respondWithRpcPromise(_0x189258,_0x2cdd92,_0x22d2db){return new BPromise(function(_0x4e7cb0,_0x2c3c03){return client[_0xf17b('0xf')](_0x189258,_0x22d2db)[_0xf17b('0x10')](function(_0x589fd7){logger['info'](_0xf17b('0x11'),_0x2cdd92,_0xf17b('0x12'));logger[_0xf17b('0x13')](_0xf17b('0x14'),_0x2cdd92,_0xf17b('0x12'),JSON[_0xf17b('0x15')](_0x589fd7));if(_0x589fd7[_0xf17b('0x16')]){if(_0x589fd7[_0xf17b('0x16')][_0xf17b('0x17')]===0x1f4){logger['error'](_0xf17b('0x11'),_0x2cdd92,_0x589fd7[_0xf17b('0x16')]['message']);return _0x2c3c03(_0x589fd7[_0xf17b('0x16')][_0xf17b('0x18')]);}logger[_0xf17b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2cdd92,_0x589fd7[_0xf17b('0x16')]['message']);return _0x4e7cb0(_0x589fd7['error']['message']);}else{logger[_0xf17b('0x19')](_0xf17b('0x11'),_0x2cdd92,_0xf17b('0x12'));_0x4e7cb0(_0x589fd7[_0xf17b('0x1a')][_0xf17b('0x18')]);}})['catch'](function(_0x38e4cb){logger[_0xf17b('0x16')](_0xf17b('0x11'),_0x2cdd92,_0x38e4cb);_0x2c3c03(_0x38e4cb);});});}exports[_0xf17b('0x1b')]=function(_0x41db4e){var _0x895ebf=this;return new Promise(function(_0x23fca0,_0x4b86a5){return db[_0xf17b('0x1c')][_0xf17b('0x1d')](_0x41db4e[_0xf17b('0x1e')],{'raw':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e['options'][_0xf17b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e[_0xf17b('0x1f')][_0xf17b('0x21')]||null:null,'attributes':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e[_0xf17b('0x1f')][_0xf17b('0x22')]||null:null,'limit':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e['options'][_0xf17b('0x23')]||null:null})[_0xf17b('0x10')](function(_0x28489f){logger[_0xf17b('0x19')](_0xf17b('0x1b'),_0x41db4e);logger[_0xf17b('0x13')]('UpdateChatInteraction',_0x41db4e,JSON[_0xf17b('0x15')](_0x28489f));_0x23fca0(_0x28489f);})[_0xf17b('0x24')](function(_0x3e6964){logger[_0xf17b('0x16')](_0xf17b('0x1b'),_0x3e6964[_0xf17b('0x18')],_0x41db4e);_0x4b86a5(_0x895ebf['error'](0x1f4,_0x3e6964[_0xf17b('0x18')]));});});};exports[_0xf17b('0x25')]=function(_0x1549e7){return new Promise(function(_0x1459ee,_0x3ea855){return db[_0xf17b('0x1c')]['find']({'where':_0x1549e7['options']?_0x1549e7[_0xf17b('0x1f')][_0xf17b('0x21')]||null:null})[_0xf17b('0x10')](function(_0x30d703){if(_0x30d703){return _0x30d703[_0xf17b('0x26')](_0x1549e7['body'][_0xf17b('0x27')],_[_0xf17b('0x28')](_0x1549e7[_0xf17b('0x1e')],[_0xf17b('0x27'),'id'])||{});}})[_0xf17b('0x29')](function(_0x3a9d3c){logger['info'](_0xf17b('0x2a'),_0x1549e7);logger[_0xf17b('0x13')](_0xf17b('0x2a'),_0x1549e7,JSON[_0xf17b('0x15')](_0x3a9d3c));_0x1459ee(_0x3a9d3c);})[_0xf17b('0x24')](function(_0x1822d3){logger[_0xf17b('0x16')](_0xf17b('0x2a'),_0x1822d3[_0xf17b('0x18')],_0x1549e7);_0x3ea855(_this[_0xf17b('0x16')](0x1f4,_0x1822d3[_0xf17b('0x18')]));});});};
\ No newline at end of file
+var _0xc640=['client','http','redis','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc640,0xf6));var _0x0c64=function(_0x415ddc,_0x1f832b){_0x415ddc=_0x415ddc-0x0;var _0x1bb3f0=_0xc640[_0x415ddc];return _0x1bb3f0;};'use strict';var _=require(_0x0c64('0x0'));var util=require(_0x0c64('0x1'));var moment=require(_0x0c64('0x2'));var BPromise=require(_0x0c64('0x3'));var rs=require(_0x0c64('0x4'));var fs=require('fs');var Redis=require(_0x0c64('0x5'));var db=require(_0x0c64('0x6'))['db'];var utils=require(_0x0c64('0x7'));var logger=require(_0x0c64('0x8'))(_0x0c64('0x9'));var config=require(_0x0c64('0xa'));var jayson=require(_0x0c64('0xb'));var client=jayson[_0x0c64('0xc')][_0x0c64('0xd')]({'port':0x232a});config[_0x0c64('0xe')]=_['defaults'](config[_0x0c64('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c64('0xf'))(new Redis(config[_0x0c64('0xe')]));require('./chatInteraction.socket')[_0x0c64('0x10')](socket);function respondWithRpcPromise(_0x258c55,_0x4249d5,_0x5a1d17){return new BPromise(function(_0x5d2a4a,_0x3ab5fb){return client[_0x0c64('0x11')](_0x258c55,_0x5a1d17)[_0x0c64('0x12')](function(_0x2f1fb7){logger[_0x0c64('0x13')](_0x0c64('0x14'),_0x4249d5,'request\x20sent');logger[_0x0c64('0x15')](_0x0c64('0x16'),_0x4249d5,'request\x20sent',JSON[_0x0c64('0x17')](_0x2f1fb7));if(_0x2f1fb7['error']){if(_0x2f1fb7[_0x0c64('0x18')]['code']===0x1f4){logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x2f1fb7[_0x0c64('0x18')][_0x0c64('0x19')]);return _0x3ab5fb(_0x2f1fb7['error'][_0x0c64('0x19')]);}logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x2f1fb7['error'][_0x0c64('0x19')]);return _0x5d2a4a(_0x2f1fb7['error'][_0x0c64('0x19')]);}else{logger[_0x0c64('0x13')](_0x0c64('0x14'),_0x4249d5,_0x0c64('0x1a'));_0x5d2a4a(_0x2f1fb7[_0x0c64('0x1b')]['message']);}})[_0x0c64('0x1c')](function(_0x26f309){logger[_0x0c64('0x18')](_0x0c64('0x14'),_0x4249d5,_0x26f309);_0x3ab5fb(_0x26f309);});});}exports[_0x0c64('0x1d')]=function(_0x189ed9){var _0x5b649c=this;return new Promise(function(_0x4a27d5,_0x336b1a){return db[_0x0c64('0x1e')]['update'](_0x189ed9['body'],{'raw':_0x189ed9[_0x0c64('0x1f')]?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x21')]||null:null,'attributes':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x22')]||null:null,'limit':_0x189ed9['options']?_0x189ed9[_0x0c64('0x1f')][_0x0c64('0x23')]||null:null})[_0x0c64('0x12')](function(_0x16f4b6){logger[_0x0c64('0x13')](_0x0c64('0x1d'),_0x189ed9);logger[_0x0c64('0x15')](_0x0c64('0x1d'),_0x189ed9,JSON[_0x0c64('0x17')](_0x16f4b6));_0x4a27d5(_0x16f4b6);})[_0x0c64('0x1c')](function(_0x475c51){logger[_0x0c64('0x18')](_0x0c64('0x1d'),_0x475c51['message'],_0x189ed9);_0x336b1a(_0x5b649c[_0x0c64('0x18')](0x1f4,_0x475c51[_0x0c64('0x19')]));});});};exports[_0x0c64('0x24')]=function(_0x1cb256){return new Promise(function(_0x2ee14c,_0x5cb48d){return db[_0x0c64('0x1e')]['find']({'where':_0x1cb256[_0x0c64('0x1f')]?_0x1cb256['options']['where']||null:null})['then'](function(_0x1a046a){if(_0x1a046a){return _0x1a046a[_0x0c64('0x25')](_0x1cb256[_0x0c64('0x26')][_0x0c64('0x27')],_[_0x0c64('0x28')](_0x1cb256[_0x0c64('0x26')],['ids','id'])||{});}})[_0x0c64('0x29')](function(_0x4c9828){logger['info'](_0x0c64('0x2a'),_0x1cb256);logger[_0x0c64('0x15')](_0x0c64('0x2a'),_0x1cb256,JSON[_0x0c64('0x17')](_0x4c9828));_0x2ee14c(_0x4c9828);})[_0x0c64('0x1c')](function(_0x310fa6){logger[_0x0c64('0x18')](_0x0c64('0x2a'),_0x310fa6[_0x0c64('0x19')],_0x1cb256);_0x5cb48d(_this[_0x0c64('0x18')](0x1f4,_0x310fa6[_0x0c64('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 42fc06f..d877519 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 _0x4fb6=['remove','update','length'];(function(_0x28016b,_0x1affb6){var _0x13d511=function(_0x1ec008){while(--_0x1ec008){_0x28016b['push'](_0x28016b['shift']());}};_0x13d511(++_0x1affb6);}(_0x4fb6,0x15f));var _0x64fb=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x4fb6[_0x4697fa];return _0x390950;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x64fb('0x0'),_0x64fb('0x1')];function createListener(_0x18cd78,_0x186470){return function(_0x5e0d28){_0x186470['emit'](_0x18cd78,_0x5e0d28);};}function removeListener(_0x5f45f7,_0x1b04ea){return function(){ChatInteractionEvents['removeListener'](_0x5f45f7,_0x1b04ea);};}exports['register']=function(_0x2588cb){for(var _0x40ac85=0x0,_0x25599c=events[_0x64fb('0x2')];_0x40ac85<_0x25599c;_0x40ac85++){var _0x2e0297=events[_0x40ac85];var _0x1b3ba0=createListener('chatInteraction:'+_0x2e0297,_0x2588cb);ChatInteractionEvents['on'](_0x2e0297,_0x1b3ba0);}};
\ No newline at end of file
+var _0x49d6=['update','emit','removeListener','length','chatInteraction:','save'];(function(_0x58c840,_0x33176e){var _0x339a94=function(_0x552426){while(--_0x552426){_0x58c840['push'](_0x58c840['shift']());}};_0x339a94(++_0x33176e);}(_0x49d6,0x12b));var _0x649d=function(_0x38b21a,_0x57aa3f){_0x38b21a=_0x38b21a-0x0;var _0x6ac674=_0x49d6[_0x38b21a];return _0x6ac674;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x649d('0x0'),'remove',_0x649d('0x1')];function createListener(_0x88108f,_0x53aca8){return function(_0x1be0cb){_0x53aca8[_0x649d('0x2')](_0x88108f,_0x1be0cb);};}function removeListener(_0x2dbf51,_0x2b6e1b){return function(){ChatInteractionEvents[_0x649d('0x3')](_0x2dbf51,_0x2b6e1b);};}exports['register']=function(_0x1e46a8){for(var _0x556245=0x0,_0x1d5603=events[_0x649d('0x4')];_0x556245<_0x1d5603;_0x556245++){var _0x33c699=events[_0x556245];var _0x582493=createListener(_0x649d('0x5')+_0x33c699,_0x1e46a8);ChatInteractionEvents['on'](_0x33c699,_0x582493);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index a068725..f6770b6 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 _0x420f=['describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe'];(function(_0x3eefec,_0x3dfab2){var _0x1de7b4=function(_0x188817){while(--_0x188817){_0x3eefec['push'](_0x3eefec['shift']());}};_0x1de7b4(++_0x3dfab2);}(_0x420f,0xbb));var _0xf420=function(_0x4cd7bd,_0x33b3e1){_0x4cd7bd=_0x4cd7bd-0x0;var _0x3833b7=_0x420f[_0x4cd7bd];return _0x3833b7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf420('0x0'));var express=require('express');var router=express[_0xf420('0x1')]();var fs_extra=require(_0xf420('0x2'));var auth=require(_0xf420('0x3'));var interaction=require(_0xf420('0x4'));var config=require('../../config/environment');var controller=require(_0xf420('0x5'));router[_0xf420('0x6')]('/',auth[_0xf420('0x7')](),controller['index']);router['get'](_0xf420('0x8'),auth[_0xf420('0x7')](),controller[_0xf420('0x9')]);router[_0xf420('0x6')](_0xf420('0xa'),auth[_0xf420('0xb')](),controller[_0xf420('0xc')]);router[_0xf420('0x6')](_0xf420('0xd'),auth[_0xf420('0xb')](),controller[_0xf420('0xe')]);router[_0xf420('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf420('0xf')]);router[_0xf420('0x6')](_0xf420('0x10'),auth[_0xf420('0xb')](),controller[_0xf420('0x11')]);router[_0xf420('0x6')]('/:id/download',auth[_0xf420('0x7')](),controller[_0xf420('0x12')]);router[_0xf420('0x13')]('/',auth['isAuthenticated'](),controller[_0xf420('0x14')]);router[_0xf420('0x13')](_0xf420('0x15'),auth['isAuthenticated'](),controller[_0xf420('0x16')]);var upload=multer({'storage':multer[_0xf420('0x17')]({'destination':function(_0x1cb842,_0x534eb1,_0x3f9d9f){_0x3f9d9f(null,path['join'](config[_0xf420('0x18')],_0xf420('0x19')));},'filename':function(_0x493e3e,_0x5dc7fb,_0x88a946){_0x88a946(null,util['format']('%s-%s',Date[_0xf420('0x1a')](),_0x5dc7fb[_0xf420('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf420('0x13')](_0xf420('0x1c'),upload[_0xf420('0x1d')]('file'),controller[_0xf420('0x1e')]);router[_0xf420('0x13')](_0xf420('0x1f'),auth[_0xf420('0xb')](),controller[_0xf420('0x20')]);router[_0xf420('0x13')]('/:id/tags',auth[_0xf420('0x7')](),interaction[_0xf420('0x21')](_0xf420('0x22'),_0xf420('0x23')),controller[_0xf420('0x24')]);router[_0xf420('0x25')](_0xf420('0xa'),auth[_0xf420('0x7')](),interaction[_0xf420('0x21')](_0xf420('0x22'),'chatinteraction:update'),controller[_0xf420('0x26')]);router['put'](_0xf420('0x27'),controller['customUpdate']);router[_0xf420('0x25')](_0xf420('0x28'),auth[_0xf420('0xb')](),controller[_0xf420('0x29')]);router['put'](_0xf420('0x2a'),controller['close']);router['delete'](_0xf420('0xa'),auth[_0xf420('0x7')](),interaction['tracked'](_0xf420('0x22'),_0xf420('0x2b')),controller[_0xf420('0x2c')]);router[_0xf420('0x2d')](_0xf420('0x2e'),auth[_0xf420('0x7')](),controller[_0xf420('0x2f')]);module[_0xf420('0x30')]=router;
\ No newline at end of file
+var _0x7005=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','/:id/messages','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7005,0x15d));var _0x5700=function(_0x651dd,_0x3e3f31){_0x651dd=_0x651dd-0x0;var _0x17ddfe=_0x7005[_0x651dd];return _0x17ddfe;};'use strict';var multer=require('multer');var util=require(_0x5700('0x0'));var path=require(_0x5700('0x1'));var timeout=require(_0x5700('0x2'));var express=require(_0x5700('0x3'));var router=express[_0x5700('0x4')]();var fs_extra=require(_0x5700('0x5'));var auth=require(_0x5700('0x6'));var interaction=require(_0x5700('0x7'));var config=require('../../config/environment');var controller=require(_0x5700('0x8'));router['get']('/',auth[_0x5700('0x9')](),controller[_0x5700('0xa')]);router[_0x5700('0xb')](_0x5700('0xc'),auth[_0x5700('0x9')](),controller['describe']);router[_0x5700('0xb')](_0x5700('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5700('0xe')]);router[_0x5700('0xb')](_0x5700('0xf'),auth[_0x5700('0x10')](),controller['attachmentDownload']);router[_0x5700('0xb')]('/:id/messages',auth[_0x5700('0x9')](),controller[_0x5700('0x11')]);router[_0x5700('0xb')](_0x5700('0x12'),auth[_0x5700('0x10')](),controller[_0x5700('0x13')]);router[_0x5700('0xb')](_0x5700('0x14'),auth[_0x5700('0x9')](),controller['download']);router[_0x5700('0x15')]('/',auth[_0x5700('0x9')](),controller[_0x5700('0x16')]);router['post'](_0x5700('0x17'),auth[_0x5700('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x5700('0x18')]({'destination':function(_0x4409e9,_0x1b3ab5,_0x52928d){_0x52928d(null,path['join'](config[_0x5700('0x19')],_0x5700('0x1a')));},'filename':function(_0x27083a,_0x2011e2,_0x4ee61b){_0x4ee61b(null,util[_0x5700('0x1b')](_0x5700('0x1c'),Date[_0x5700('0x1d')](),_0x2011e2[_0x5700('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5700('0x15')](_0x5700('0x1f'),upload['single']('file'),controller['attachmentUpload']);router[_0x5700('0x15')](_0x5700('0x20'),auth[_0x5700('0x10')](),controller[_0x5700('0x21')]);router[_0x5700('0x15')]('/:id/tags',auth[_0x5700('0x9')](),interaction[_0x5700('0x22')]('chat',_0x5700('0x23')),controller[_0x5700('0x24')]);router[_0x5700('0x25')]('/:id',auth[_0x5700('0x9')](),interaction[_0x5700('0x22')](_0x5700('0x26'),'chatinteraction:update'),controller[_0x5700('0x27')]);router[_0x5700('0x25')](_0x5700('0x28'),controller[_0x5700('0x29')]);router[_0x5700('0x25')](_0x5700('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x5700('0x2b')]);router[_0x5700('0x25')](_0x5700('0x2c'),controller['close']);router[_0x5700('0x2d')](_0x5700('0xd'),auth['isAuthenticated'](),interaction[_0x5700('0x22')](_0x5700('0x26'),_0x5700('0x2e')),controller[_0x5700('0x2f')]);router['delete'](_0x5700('0x30'),auth[_0x5700('0x9')](),controller['removeTags']);module[_0x5700('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 51132b0..b08e07c 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 _0xcbf0=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x55f562,_0x3f96c4){var _0x55922b=function(_0x246460){while(--_0x246460){_0x55f562['push'](_0x55f562['shift']());}};_0x55922b(++_0x3f96c4);}(_0xcbf0,0x12e));var _0x0cbf=function(_0x4ae340,_0x459aaa){_0x4ae340=_0x4ae340-0x0;var _0xfa456=_0xcbf0[_0x4ae340];return _0xfa456;};'use strict';var Sequelize=require(_0x0cbf('0x0'));module[_0x0cbf('0x1')]={'body':{'type':Sequelize[_0x0cbf('0x2')](_0x0cbf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0cbf('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0cbf('0x5')]}};
\ No newline at end of file
+var _0x7ab4=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x7ab4,0x10c));var _0x47ab=function(_0x52cbe0,_0x332b2e){_0x52cbe0=_0x52cbe0-0x0;var _0x4bb9da=_0x7ab4[_0x52cbe0];return _0x4bb9da;};'use strict';var Sequelize=require(_0x47ab('0x0'));module[_0x47ab('0x1')]={'body':{'type':Sequelize[_0x47ab('0x2')](_0x47ab('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x47ab('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47ab('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 23c6c8d..8bd446c 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 _0x341f=['createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','push','messages','ToId','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','then','includeAll','include','rows','catch','show','options','find','create','body','params','describe','get','lastMessageAt'];(function(_0x25d4ab,_0x307164){var _0x3b31f3=function(_0x12f56c){while(--_0x12f56c){_0x25d4ab['push'](_0x25d4ab['shift']());}};_0x3b31f3(++_0x307164);}(_0x341f,0xf5));var _0xf341=function(_0x2e2056,_0x2e55a0){_0x2e2056=_0x2e2056-0x0;var _0x235b7a=_0x341f[_0x2e2056];return _0x235b7a;};'use strict';var emlformat=require(_0xf341('0x0'));var rimraf=require(_0xf341('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf341('0x2'));var rp=require(_0xf341('0x3'));var moment=require(_0xf341('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf341('0x5'));var csv=require('to-csv');var ejs=require(_0xf341('0x6'));var fs=require('fs');var fs_extra=require(_0xf341('0x7'));var _=require(_0xf341('0x8'));var squel=require(_0xf341('0x9'));var crypto=require(_0xf341('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf341('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf341('0xc'));var Papa=require(_0xf341('0xd'));var Redis=require(_0xf341('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf341('0xf'));var as=require(_0xf341('0x10'));var hardwareService=require(_0xf341('0x11'));var logger=require(_0xf341('0x12'))(_0xf341('0x13'));var utils=require(_0xf341('0x14'));var config=require(_0xf341('0x15'));var licenseUtil=require(_0xf341('0x16'));var db=require(_0xf341('0x17'))['db'];config['redis']=_[_0xf341('0x18')](config[_0xf341('0x19')],{'host':_0xf341('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf341('0x19')]));require(_0xf341('0x1b'))[_0xf341('0x1c')](socket);function respondWithStatusCode(_0x2d244a,_0x124fa8){_0x124fa8=_0x124fa8||0xcc;return function(_0x4991de){if(_0x4991de){return _0x2d244a[_0xf341('0x1d')](_0x124fa8);}return _0x2d244a[_0xf341('0x1e')](_0x124fa8)[_0xf341('0x1f')]();};}function respondWithResult(_0x154018,_0x4ae94c){_0x4ae94c=_0x4ae94c||0xc8;return function(_0x360616){if(_0x360616){return _0x154018[_0xf341('0x1e')](_0x4ae94c)[_0xf341('0x20')](_0x360616);}};}function respondWithFilteredResult(_0x2ff88e,_0x47d2ef){return function(_0x1d2832){if(_0x1d2832){var _0x26e3a1=typeof _0x47d2ef[_0xf341('0x21')]===_0xf341('0x22')&&typeof _0x47d2ef[_0xf341('0x23')]==='undefined';var _0x4d6757=_0x1d2832['count'];var _0x442ceb=_0x26e3a1?0x0:_0x47d2ef[_0xf341('0x21')];var _0x909f85=_0x26e3a1?_0x1d2832['count']:_0x47d2ef[_0xf341('0x21')]+_0x47d2ef[_0xf341('0x23')];var _0xc4ec7;if(_0x909f85>=_0x4d6757){_0x909f85=_0x4d6757;_0xc4ec7=0xc8;}else{_0xc4ec7=0xce;}_0x2ff88e[_0xf341('0x1e')](_0xc4ec7);return _0x2ff88e['set'](_0xf341('0x24'),_0x442ceb+'-'+_0x909f85+'/'+_0x4d6757)[_0xf341('0x20')](_0x1d2832);}return null;};}function patchUpdates(_0x7b1731){return function(_0x1b640c){try{jsonpatch[_0xf341('0x25')](_0x1b640c,_0x7b1731,!![]);}catch(_0x2f4566){return BPromise['reject'](_0x2f4566);}return _0x1b640c[_0xf341('0x26')]();};}function saveUpdates(_0x5b4f30,_0x46c4fc){return function(_0x1f3b08){if(_0x1f3b08){return _0x1f3b08[_0xf341('0x27')](_0x5b4f30)['then'](function(_0x5490a2){return _0x5490a2;});}return null;};}function removeEntity(_0x3fa14b,_0x12e5bf){return function(_0x4d4903){if(_0x4d4903){return _0x4d4903[_0xf341('0x28')]()['then'](function(){_0x3fa14b[_0xf341('0x1e')](0xcc)[_0xf341('0x1f')]();});}};}function handleEntityNotFound(_0x268575,_0x47245a){return function(_0x5c6ce1){if(!_0x5c6ce1){_0x268575[_0xf341('0x1d')](0x194);}return _0x5c6ce1;};}function handleError(_0x38c835,_0x4ff47f){_0x4ff47f=_0x4ff47f||0x1f4;return function(_0x3c65b6){logger[_0xf341('0x29')](_0x3c65b6[_0xf341('0x2a')]);if(_0x3c65b6['name']){delete _0x3c65b6[_0xf341('0x2b')];}_0x38c835[_0xf341('0x1e')](_0x4ff47f)[_0xf341('0x2c')](_0x3c65b6);};}exports[_0xf341('0x2d')]=function(_0x2b3a48,_0x3fdbec){var _0x2037b5={},_0x39bdb4={},_0x50509c={'count':0x0,'rows':[]};var _0xc91abb=_[_0xf341('0x2e')](db[_0xf341('0x2f')][_0xf341('0x30')],function(_0x53d02f){return{'name':_0x53d02f[_0xf341('0x31')],'type':_0x53d02f[_0xf341('0x32')][_0xf341('0x33')]};});_0x39bdb4[_0xf341('0x34')]=_[_0xf341('0x2e')](_0xc91abb,'name');_0x39bdb4[_0xf341('0x35')]=_[_0xf341('0x36')](_0x2b3a48['query']);_0x39bdb4[_0xf341('0x37')]=_[_0xf341('0x38')](_0x39bdb4[_0xf341('0x34')],_0x39bdb4[_0xf341('0x35')]);_0x2037b5['attributes']=_[_0xf341('0x38')](_0x39bdb4[_0xf341('0x34')],qs[_0xf341('0x39')](_0x2b3a48[_0xf341('0x35')][_0xf341('0x39')]));_0x2037b5[_0xf341('0x3a')]=_0x2037b5[_0xf341('0x3a')]['length']?_0x2037b5['attributes']:_0x39bdb4['model'];if(!_0x2b3a48[_0xf341('0x35')][_0xf341('0x3b')](_0xf341('0x3c'))){_0x2037b5[_0xf341('0x23')]=qs['limit'](_0x2b3a48['query'][_0xf341('0x23')]);_0x2037b5[_0xf341('0x21')]=qs['offset'](_0x2b3a48[_0xf341('0x35')][_0xf341('0x21')]);}_0x2037b5[_0xf341('0x3d')]=qs[_0xf341('0x3e')](_0x2b3a48[_0xf341('0x35')]['sort']);_0x2037b5[_0xf341('0x3f')]=qs['filters'](_[_0xf341('0x40')](_0x2b3a48[_0xf341('0x35')],_0x39bdb4['filters']),_0xc91abb);if(_0x2b3a48['query'][_0xf341('0x41')]){_0x2037b5[_0xf341('0x3f')]=_[_0xf341('0x42')](_0x2037b5[_0xf341('0x3f')],{'$or':_[_0xf341('0x2e')](_0xc91abb,function(_0xd4e5e9){if(_0xd4e5e9[_0xf341('0x32')]!=='VIRTUAL'){var _0x24e036={};_0x24e036[_0xd4e5e9[_0xf341('0x2b')]]={'$like':'%'+_0x2b3a48[_0xf341('0x35')][_0xf341('0x41')]+'%'};return _0x24e036;}})});}_0x2037b5=_[_0xf341('0x42')]({},_0x2037b5,_0x2b3a48['options']);var _0x3d943e={'where':_0x2037b5['where']};return db[_0xf341('0x2f')][_0xf341('0x43')](_0x3d943e)[_0xf341('0x44')](function(_0x44c8a3){_0x50509c[_0xf341('0x43')]=_0x44c8a3;if(_0x2b3a48[_0xf341('0x35')][_0xf341('0x45')]){_0x2037b5[_0xf341('0x46')]=[{'all':!![]}];}return db[_0xf341('0x2f')]['findAll'](_0x2037b5);})[_0xf341('0x44')](function(_0x46e5d6){_0x50509c[_0xf341('0x47')]=_0x46e5d6;return _0x50509c;})[_0xf341('0x44')](respondWithFilteredResult(_0x3fdbec,_0x2037b5))[_0xf341('0x48')](handleError(_0x3fdbec,null));};exports[_0xf341('0x49')]=function(_0x275a2c,_0x5c7df7){var _0x4d109a={'raw':!![],'where':{'id':_0x275a2c['params']['id']}},_0x49b93c={};_0x49b93c[_0xf341('0x34')]=_[_0xf341('0x36')](db['ChatInternalMessage'][_0xf341('0x30')]);_0x49b93c[_0xf341('0x35')]=_[_0xf341('0x36')](_0x275a2c[_0xf341('0x35')]);_0x49b93c['filters']=_['intersection'](_0x49b93c[_0xf341('0x34')],_0x49b93c[_0xf341('0x35')]);_0x4d109a[_0xf341('0x3a')]=_[_0xf341('0x38')](_0x49b93c['model'],qs[_0xf341('0x39')](_0x275a2c[_0xf341('0x35')]['fields']));_0x4d109a['attributes']=_0x4d109a[_0xf341('0x3a')]['length']?_0x4d109a['attributes']:_0x49b93c[_0xf341('0x34')];if(_0x275a2c[_0xf341('0x35')][_0xf341('0x45')]){_0x4d109a[_0xf341('0x46')]=[{'all':!![]}];}_0x4d109a=_[_0xf341('0x42')]({},_0x4d109a,_0x275a2c[_0xf341('0x4a')]);return db[_0xf341('0x2f')][_0xf341('0x4b')](_0x4d109a)[_0xf341('0x44')](handleEntityNotFound(_0x5c7df7,null))[_0xf341('0x44')](respondWithResult(_0x5c7df7,null))[_0xf341('0x48')](handleError(_0x5c7df7,null));};exports[_0xf341('0x4c')]=function(_0x4e8254,_0x47792b){return db[_0xf341('0x2f')]['create'](_0x4e8254[_0xf341('0x4d')],{})['then'](respondWithResult(_0x47792b,0xc9))[_0xf341('0x48')](handleError(_0x47792b,null));};exports['update']=function(_0x538a3d,_0x37e83a){if(_0x538a3d[_0xf341('0x4d')]['id']){delete _0x538a3d['body']['id'];}return db['ChatInternalMessage'][_0xf341('0x4b')]({'where':{'id':_0x538a3d['params']['id']}})['then'](handleEntityNotFound(_0x37e83a,null))[_0xf341('0x44')](saveUpdates(_0x538a3d[_0xf341('0x4d')],null))['then'](respondWithResult(_0x37e83a,null))[_0xf341('0x48')](handleError(_0x37e83a,null));};exports[_0xf341('0x28')]=function(_0x2a6460,_0x3735d4){return db[_0xf341('0x2f')][_0xf341('0x4b')]({'where':{'id':_0x2a6460[_0xf341('0x4e')]['id']}})[_0xf341('0x44')](handleEntityNotFound(_0x3735d4,null))[_0xf341('0x44')](removeEntity(_0x3735d4,null))[_0xf341('0x48')](handleError(_0x3735d4,null));};exports[_0xf341('0x4f')]=function(_0x53efd0,_0x30f58e){return db[_0xf341('0x2f')][_0xf341('0x4f')]()[_0xf341('0x44')](respondWithResult(_0x30f58e,null))[_0xf341('0x48')](handleError(_0x30f58e,null));};function wrapUser(_0x3d9da3){return function(_0x2df7cf){var _0x3066fa=_0x3d9da3[_0xf341('0x50')]({'plain':!![]});_0x3066fa['messages']=[];if(_0x2df7cf){_0x3066fa[_0xf341('0x51')]=_0x2df7cf[_0xf341('0x52')];_0x3066fa[_0xf341('0x53')]=_0x2df7cf;}else{_0x3066fa[_0xf341('0x51')]=moment(0x0)[_0xf341('0x54')](_0xf341('0x55'));_0x3066fa['lastMessage']={};}return _0x3066fa;};}exports['getUsers']=function(_0x25ed74,_0x410aaf,_0x3ccbdb){var _0x164987=[];return db[_0xf341('0x56')][_0xf341('0x57')]({'where':{'role':[_0xf341('0x58'),_0xf341('0x59'),'user']},'attributes':['id',_0xf341('0x5a'),_0xf341('0x2b'),_0xf341('0x5b'),'userpic',_0xf341('0x5c'),'online',_0xf341('0x5d'),_0xf341('0x5e'),_0xf341('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xf341('0x60'),'attributes':['id',_0xf341('0x2b'),_0xf341('0x32')],'through':{'attributes':[]}}]})[_0xf341('0x44')](function(_0x55eda7){if(_0x55eda7){var _0x319be2=_0x25ed74[_0xf341('0x61')][_0xf341('0x50')]({'plain':!![]});if(!_0x319be2)throw new Error(_0xf341('0x62'));if(_0x319be2[_0xf341('0x5b')]===_0xf341('0x61')){return db['UserProfileSection'][_0xf341('0x4b')]({'where':{'name':'Agents','userProfileId':_0x319be2[_0xf341('0x63')]},'raw':!![]})['then'](function(_0x4f9b30){if(_0x4f9b30){if(_0x4f9b30[_0xf341('0x64')]===0x0){return db[_0xf341('0x65')][_0xf341('0x57')]({'where':{'sectionId':_0x4f9b30['id']},'raw':!![]})['then'](function(_0x5bfd26){var _0x413f87=[];if(_[_0xf341('0x66')](_0x5bfd26)){_0x413f87=_[_0xf341('0x41')](_0x55eda7,function(_0x1f1f20){if(_0x1f1f20['role']!==_0xf341('0x58')){return _0x1f1f20;}});return _0x413f87;}else{for(var _0x192c69=0x0;_0x192c69<_0x55eda7[_0xf341('0x67')];_0x192c69++){var _0x13ba0c=_0x55eda7[_0x192c69];if(_0x13ba0c[_0xf341('0x5b')]==='agent'){var _0x14b84b=_['find'](_0x5bfd26,function(_0x45edea){return _0x45edea['resourceId']===_0x13ba0c['id'];});if(_0x14b84b)_0x413f87[_0xf341('0x68')](_0x13ba0c);}else{_0x413f87['push'](_0x13ba0c);}}return _0x413f87;}});}else{return _0x55eda7;}}else{var _0x7bb594=_[_0xf341('0x41')](_0x55eda7,function(_0x5d8340){if(_0x5d8340[_0xf341('0x5b')]!==_0xf341('0x58')){return _0x5d8340;}});return _0x7bb594;}});}else{return _0x55eda7;}}})['then'](function(_0x26d95f){var _0x2dc6d2=[];if(_0x26d95f){_0x164987=_0x26d95f;for(var _0x2c4e78=0x0;_0x2c4e78<_0x26d95f[_0xf341('0x67')];_0x2c4e78+=0x1){_0x164987[_0x2c4e78][_0xf341('0x69')]=[];_0x2dc6d2[_0xf341('0x68')](db[_0xf341('0x2f')][_0xf341('0x4b')]({'where':{'FromId':[_0x25ed74['user']['id'],_0x26d95f[_0x2c4e78]['id']],'ToId':[_0x25ed74[_0xf341('0x61')]['id'],_0x26d95f[_0x2c4e78]['id']],'ChatGroupId':null},'attributes':['id',_0xf341('0x52'),'FromId',_0xf341('0x6a'),'read',_0xf341('0x4d')],'order':qs['sort'](_0xf341('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf341('0x44')](wrapUser(_0x26d95f[_0x2c4e78])));}return BPromise[_0xf341('0x6c')](_0x2dc6d2);}return[];})[_0xf341('0x44')](function(_0x348e21){return{'rows':_0x348e21,'count':_0x348e21[_0xf341('0x67')]};})[_0xf341('0x44')](respondWithResult(_0x410aaf,null))[_0xf341('0x48')](handleError(_0x410aaf,null));};
\ No newline at end of file
+var _0x5d05=['map','ChatInternalMessage','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','show','params','keys','options','catch','body','find','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','isEmpty','length','resourceId','push','messages','createdAt','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','end','sendStatus','stack','name'];(function(_0x163439,_0x6885ca){var _0x552333=function(_0x31ed5e){while(--_0x31ed5e){_0x163439['push'](_0x163439['shift']());}};_0x552333(++_0x6885ca);}(_0x5d05,0x179));var _0x55d0=function(_0x40bad6,_0x1a5dc8){_0x40bad6=_0x40bad6-0x0;var _0xdfd3f2=_0x5d05[_0x40bad6];return _0xdfd3f2;};'use strict';var emlformat=require(_0x55d0('0x0'));var rimraf=require(_0x55d0('0x1'));var zipdir=require(_0x55d0('0x2'));var jsonpatch=require(_0x55d0('0x3'));var rp=require(_0x55d0('0x4'));var moment=require('moment');var BPromise=require(_0x55d0('0x5'));var Mustache=require('mustache');var util=require(_0x55d0('0x6'));var path=require(_0x55d0('0x7'));var sox=require(_0x55d0('0x8'));var csv=require(_0x55d0('0x9'));var ejs=require(_0x55d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55d0('0xb'));var squel=require(_0x55d0('0xc'));var crypto=require(_0x55d0('0xd'));var jsforce=require(_0x55d0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x55d0('0x9'));var querystring=require(_0x55d0('0xf'));var Papa=require(_0x55d0('0x10'));var Redis=require(_0x55d0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x55d0('0x12'));var as=require(_0x55d0('0x13'));var hardwareService=require(_0x55d0('0x14'));var logger=require(_0x55d0('0x15'))(_0x55d0('0x16'));var utils=require(_0x55d0('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x55d0('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x55d0('0x19'))(new Redis(config[_0x55d0('0x18')]));require(_0x55d0('0x1a'))[_0x55d0('0x1b')](socket);function respondWithStatusCode(_0x3cb5ea,_0x283c17){_0x283c17=_0x283c17||0xcc;return function(_0x51b350){if(_0x51b350){return _0x3cb5ea['sendStatus'](_0x283c17);}return _0x3cb5ea[_0x55d0('0x1c')](_0x283c17)['end']();};}function respondWithResult(_0x401453,_0x561cdc){_0x561cdc=_0x561cdc||0xc8;return function(_0x25d76b){if(_0x25d76b){return _0x401453['status'](_0x561cdc)[_0x55d0('0x1d')](_0x25d76b);}};}function respondWithFilteredResult(_0x372168,_0xdee8e9){return function(_0x458e93){if(_0x458e93){var _0x7f3494=typeof _0xdee8e9[_0x55d0('0x1e')]===_0x55d0('0x1f')&&typeof _0xdee8e9[_0x55d0('0x20')]==='undefined';var _0x485ed9=_0x458e93[_0x55d0('0x21')];var _0x26cf9f=_0x7f3494?0x0:_0xdee8e9[_0x55d0('0x1e')];var _0x1bb321=_0x7f3494?_0x458e93[_0x55d0('0x21')]:_0xdee8e9[_0x55d0('0x1e')]+_0xdee8e9[_0x55d0('0x20')];var _0x4ab214;if(_0x1bb321>=_0x485ed9){_0x1bb321=_0x485ed9;_0x4ab214=0xc8;}else{_0x4ab214=0xce;}_0x372168[_0x55d0('0x1c')](_0x4ab214);return _0x372168[_0x55d0('0x22')](_0x55d0('0x23'),_0x26cf9f+'-'+_0x1bb321+'/'+_0x485ed9)[_0x55d0('0x1d')](_0x458e93);}return null;};}function patchUpdates(_0x1dd142){return function(_0x496bc8){try{jsonpatch[_0x55d0('0x24')](_0x496bc8,_0x1dd142,!![]);}catch(_0x4246d6){return BPromise[_0x55d0('0x25')](_0x4246d6);}return _0x496bc8['save']();};}function saveUpdates(_0x5ed6bc,_0x262a6b){return function(_0xd92ff5){if(_0xd92ff5){return _0xd92ff5[_0x55d0('0x26')](_0x5ed6bc)['then'](function(_0x383a78){return _0x383a78;});}return null;};}function removeEntity(_0x9342d3,_0x12745b){return function(_0x397448){if(_0x397448){return _0x397448['destroy']()['then'](function(){_0x9342d3[_0x55d0('0x1c')](0xcc)[_0x55d0('0x27')]();});}};}function handleEntityNotFound(_0xfa940f,_0x38da26){return function(_0x599f8d){if(!_0x599f8d){_0xfa940f[_0x55d0('0x28')](0x194);}return _0x599f8d;};}function handleError(_0xf0aac6,_0x95f966){_0x95f966=_0x95f966||0x1f4;return function(_0x55075f){logger['error'](_0x55075f[_0x55d0('0x29')]);if(_0x55075f[_0x55d0('0x2a')]){delete _0x55075f['name'];}_0xf0aac6['status'](_0x95f966)['send'](_0x55075f);};}exports['index']=function(_0x3aedb3,_0x2b9ed5){var _0x4c6528={},_0x42874d={},_0x40f3fe={'count':0x0,'rows':[]};var _0x176534=_[_0x55d0('0x2b')](db[_0x55d0('0x2c')][_0x55d0('0x2d')],function(_0xbf64a1){return{'name':_0xbf64a1['fieldName'],'type':_0xbf64a1[_0x55d0('0x2e')]['key']};});_0x42874d[_0x55d0('0x2f')]=_['map'](_0x176534,'name');_0x42874d[_0x55d0('0x30')]=_['keys'](_0x3aedb3['query']);_0x42874d[_0x55d0('0x31')]=_[_0x55d0('0x32')](_0x42874d[_0x55d0('0x2f')],_0x42874d[_0x55d0('0x30')]);_0x4c6528['attributes']=_[_0x55d0('0x32')](_0x42874d[_0x55d0('0x2f')],qs[_0x55d0('0x33')](_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x33')]));_0x4c6528['attributes']=_0x4c6528[_0x55d0('0x34')]['length']?_0x4c6528['attributes']:_0x42874d[_0x55d0('0x2f')];if(!_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x35')](_0x55d0('0x36'))){_0x4c6528[_0x55d0('0x20')]=qs[_0x55d0('0x20')](_0x3aedb3['query'][_0x55d0('0x20')]);_0x4c6528[_0x55d0('0x1e')]=qs[_0x55d0('0x1e')](_0x3aedb3['query'][_0x55d0('0x1e')]);}_0x4c6528[_0x55d0('0x37')]=qs[_0x55d0('0x38')](_0x3aedb3['query'][_0x55d0('0x38')]);_0x4c6528[_0x55d0('0x39')]=qs[_0x55d0('0x31')](_[_0x55d0('0x3a')](_0x3aedb3['query'],_0x42874d[_0x55d0('0x31')]),_0x176534);if(_0x3aedb3['query'][_0x55d0('0x3b')]){_0x4c6528[_0x55d0('0x39')]=_[_0x55d0('0x3c')](_0x4c6528[_0x55d0('0x39')],{'$or':_['map'](_0x176534,function(_0x1e4407){if(_0x1e4407[_0x55d0('0x2e')]!==_0x55d0('0x3d')){var _0x388cab={};_0x388cab[_0x1e4407['name']]={'$like':'%'+_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x3b')]+'%'};return _0x388cab;}})});}_0x4c6528=_[_0x55d0('0x3c')]({},_0x4c6528,_0x3aedb3['options']);var _0x212c2d={'where':_0x4c6528[_0x55d0('0x39')]};return db['ChatInternalMessage']['count'](_0x212c2d)[_0x55d0('0x3e')](function(_0x47f78d){_0x40f3fe['count']=_0x47f78d;if(_0x3aedb3[_0x55d0('0x30')][_0x55d0('0x3f')]){_0x4c6528[_0x55d0('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x55d0('0x41')](_0x4c6528);})[_0x55d0('0x3e')](function(_0x53a50b){_0x40f3fe[_0x55d0('0x42')]=_0x53a50b;return _0x40f3fe;})[_0x55d0('0x3e')](respondWithFilteredResult(_0x2b9ed5,_0x4c6528))['catch'](handleError(_0x2b9ed5,null));};exports[_0x55d0('0x43')]=function(_0xa14588,_0x5e9782){var _0x5da37f={'raw':!![],'where':{'id':_0xa14588[_0x55d0('0x44')]['id']}},_0x1d928d={};_0x1d928d['model']=_[_0x55d0('0x45')](db[_0x55d0('0x2c')][_0x55d0('0x2d')]);_0x1d928d[_0x55d0('0x30')]=_['keys'](_0xa14588[_0x55d0('0x30')]);_0x1d928d[_0x55d0('0x31')]=_[_0x55d0('0x32')](_0x1d928d[_0x55d0('0x2f')],_0x1d928d[_0x55d0('0x30')]);_0x5da37f[_0x55d0('0x34')]=_[_0x55d0('0x32')](_0x1d928d['model'],qs['fields'](_0xa14588[_0x55d0('0x30')][_0x55d0('0x33')]));_0x5da37f[_0x55d0('0x34')]=_0x5da37f[_0x55d0('0x34')]['length']?_0x5da37f[_0x55d0('0x34')]:_0x1d928d[_0x55d0('0x2f')];if(_0xa14588['query'][_0x55d0('0x3f')]){_0x5da37f[_0x55d0('0x40')]=[{'all':!![]}];}_0x5da37f=_[_0x55d0('0x3c')]({},_0x5da37f,_0xa14588[_0x55d0('0x46')]);return db[_0x55d0('0x2c')]['find'](_0x5da37f)['then'](handleEntityNotFound(_0x5e9782,null))[_0x55d0('0x3e')](respondWithResult(_0x5e9782,null))[_0x55d0('0x47')](handleError(_0x5e9782,null));};exports['create']=function(_0x8676a9,_0x3b72ce){return db[_0x55d0('0x2c')]['create'](_0x8676a9[_0x55d0('0x48')],{})['then'](respondWithResult(_0x3b72ce,0xc9))[_0x55d0('0x47')](handleError(_0x3b72ce,null));};exports['update']=function(_0x47cdc1,_0x519d0b){if(_0x47cdc1[_0x55d0('0x48')]['id']){delete _0x47cdc1['body']['id'];}return db[_0x55d0('0x2c')][_0x55d0('0x49')]({'where':{'id':_0x47cdc1[_0x55d0('0x44')]['id']}})[_0x55d0('0x3e')](handleEntityNotFound(_0x519d0b,null))['then'](saveUpdates(_0x47cdc1[_0x55d0('0x48')],null))['then'](respondWithResult(_0x519d0b,null))[_0x55d0('0x47')](handleError(_0x519d0b,null));};exports['destroy']=function(_0x1a57a5,_0xad2079){return db['ChatInternalMessage'][_0x55d0('0x49')]({'where':{'id':_0x1a57a5[_0x55d0('0x44')]['id']}})['then'](handleEntityNotFound(_0xad2079,null))[_0x55d0('0x3e')](removeEntity(_0xad2079,null))[_0x55d0('0x47')](handleError(_0xad2079,null));};exports[_0x55d0('0x4a')]=function(_0x11878a,_0x3348b1){return db[_0x55d0('0x2c')][_0x55d0('0x4a')]()['then'](respondWithResult(_0x3348b1,null))['catch'](handleError(_0x3348b1,null));};function wrapUser(_0x53b3c9){return function(_0x37c120){var _0x3b4391=_0x53b3c9[_0x55d0('0x4b')]({'plain':!![]});_0x3b4391['messages']=[];if(_0x37c120){_0x3b4391[_0x55d0('0x4c')]=_0x37c120['createdAt'];_0x3b4391['lastMessage']=_0x37c120;}else{_0x3b4391[_0x55d0('0x4c')]=moment(0x0)[_0x55d0('0x4d')](_0x55d0('0x4e'));_0x3b4391[_0x55d0('0x4f')]={};}return _0x3b4391;};}exports['getUsers']=function(_0x40256a,_0x1bcc2b,_0x11b50f){var _0x198be4=[];return db[_0x55d0('0x50')][_0x55d0('0x41')]({'where':{'role':[_0x55d0('0x51'),_0x55d0('0x52'),_0x55d0('0x53')]},'attributes':['id','fullname',_0x55d0('0x2a'),'role',_0x55d0('0x54'),_0x55d0('0x55'),_0x55d0('0x56'),'lastLoginAt',_0x55d0('0x57'),_0x55d0('0x58')],'order':qs[_0x55d0('0x38')]('-online'),'include':[{'model':db[_0x55d0('0x59')],'as':_0x55d0('0x5a'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x55d0('0x3e')](function(_0x13f8b4){if(_0x13f8b4){var _0x438772=_0x40256a[_0x55d0('0x53')]['get']({'plain':!![]});if(!_0x438772)throw new Error(_0x55d0('0x5b'));if(_0x438772[_0x55d0('0x5c')]==='user'){return db[_0x55d0('0x5d')]['find']({'where':{'name':_0x55d0('0x5e'),'userProfileId':_0x438772[_0x55d0('0x5f')]},'raw':!![]})['then'](function(_0x307a07){if(_0x307a07){if(_0x307a07['autoAssociation']===0x0){return db['UserProfileResource'][_0x55d0('0x41')]({'where':{'sectionId':_0x307a07['id']},'raw':!![]})[_0x55d0('0x3e')](function(_0x2d1423){var _0x24add5=[];if(_[_0x55d0('0x60')](_0x2d1423)){_0x24add5=_[_0x55d0('0x3b')](_0x13f8b4,function(_0x45f0cf){if(_0x45f0cf[_0x55d0('0x5c')]!==_0x55d0('0x51')){return _0x45f0cf;}});return _0x24add5;}else{for(var _0x5689d2=0x0;_0x5689d2<_0x13f8b4[_0x55d0('0x61')];_0x5689d2++){var _0x4eff43=_0x13f8b4[_0x5689d2];if(_0x4eff43['role']===_0x55d0('0x51')){var _0x412e31=_[_0x55d0('0x49')](_0x2d1423,function(_0x33fe2a){return _0x33fe2a[_0x55d0('0x62')]===_0x4eff43['id'];});if(_0x412e31)_0x24add5[_0x55d0('0x63')](_0x4eff43);}else{_0x24add5[_0x55d0('0x63')](_0x4eff43);}}return _0x24add5;}});}else{return _0x13f8b4;}}else{var _0xbe9a2c=_[_0x55d0('0x3b')](_0x13f8b4,function(_0x551b3d){if(_0x551b3d[_0x55d0('0x5c')]!=='agent'){return _0x551b3d;}});return _0xbe9a2c;}});}else{return _0x13f8b4;}}})[_0x55d0('0x3e')](function(_0x2ea35a){var _0x74f148=[];if(_0x2ea35a){_0x198be4=_0x2ea35a;for(var _0x5b945e=0x0;_0x5b945e<_0x2ea35a[_0x55d0('0x61')];_0x5b945e+=0x1){_0x198be4[_0x5b945e][_0x55d0('0x64')]=[];_0x74f148[_0x55d0('0x63')](db[_0x55d0('0x2c')][_0x55d0('0x49')]({'where':{'FromId':[_0x40256a[_0x55d0('0x53')]['id'],_0x2ea35a[_0x5b945e]['id']],'ToId':[_0x40256a[_0x55d0('0x53')]['id'],_0x2ea35a[_0x5b945e]['id']],'ChatGroupId':null},'attributes':['id',_0x55d0('0x65'),_0x55d0('0x66'),'ToId','read',_0x55d0('0x48')],'order':qs[_0x55d0('0x38')](_0x55d0('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x55d0('0x3e')](wrapUser(_0x2ea35a[_0x5b945e])));}return BPromise[_0x55d0('0x68')](_0x74f148);}return[];})[_0x55d0('0x3e')](function(_0x17b452){return{'rows':_0x17b452,'count':_0x17b452[_0x55d0('0x61')]};})[_0x55d0('0x3e')](respondWithResult(_0x1bcc2b,null))[_0x55d0('0x47')](handleError(_0x1bcc2b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2e5e30f..561a7e1 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 _0x254e=['ChatInternalMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c66c1,_0x31eafd){var _0x54ffd2=function(_0x3141dd){while(--_0x3141dd){_0x5c66c1['push'](_0x5c66c1['shift']());}};_0x54ffd2(++_0x31eafd);}(_0x254e,0x19c));var _0xe254=function(_0x214de5,_0x2662e9){_0x214de5=_0x214de5-0x0;var _0x808650=_0x254e[_0x214de5];return _0x808650;};'use strict';var EventEmitter=require(_0xe254('0x0'));var ChatInternalMessage=require(_0xe254('0x1'))['db'][_0xe254('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe254('0x3'),'afterUpdate':_0xe254('0x4'),'afterDestroy':_0xe254('0x5')};function emitEvent(_0x4defa5){return function(_0xfe5d3d,_0x33bb5b,_0x4c4775){ChatInternalMessageEvents[_0xe254('0x6')](_0x4defa5+':'+_0xfe5d3d['id'],_0xfe5d3d);ChatInternalMessageEvents[_0xe254('0x6')](_0x4defa5,_0xfe5d3d);_0x4c4775(null);};}for(var e in events){if(events[_0xe254('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xe254('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xde44=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x7611ce,_0x4a4441){var _0x67d3ab=function(_0x1456d8){while(--_0x1456d8){_0x7611ce['push'](_0x7611ce['shift']());}};_0x67d3ab(++_0x4a4441);}(_0xde44,0x160));var _0x4de4=function(_0x3c84aa,_0x36bde9){_0x3c84aa=_0x3c84aa-0x0;var _0x2e6756=_0xde44[_0x3c84aa];return _0x2e6756;};'use strict';var EventEmitter=require(_0x4de4('0x0'));var ChatInternalMessage=require(_0x4de4('0x1'))['db'][_0x4de4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4de4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4de4('0x4'),'afterDestroy':_0x4de4('0x5')};function emitEvent(_0x2b2e21){return function(_0x34fb68,_0x85c4fe,_0x4c906b){ChatInternalMessageEvents[_0x4de4('0x6')](_0x2b2e21+':'+_0x34fb68['id'],_0x34fb68);ChatInternalMessageEvents['emit'](_0x2b2e21,_0x34fb68);_0x4c906b(null);};}for(var e in events){if(events[_0x4de4('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4de4('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 5cc0ac6..5246490 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 _0xea88=['chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0xea88,0x106));var _0x8ea8=function(_0x47abd5,_0x522f85){_0x47abd5=_0x47abd5-0x0;var _0x35bb61=_0xea88[_0x47abd5];return _0x35bb61;};'use strict';var _=require(_0x8ea8('0x0'));var util=require('util');var logger=require(_0x8ea8('0x1'))(_0x8ea8('0x2'));var moment=require(_0x8ea8('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ea8('0x4'));var fs=require('fs');var path=require(_0x8ea8('0x5'));var rimraf=require(_0x8ea8('0x6'));var config=require(_0x8ea8('0x7'));var attributes=require(_0x8ea8('0x8'));module['exports']=function(_0x4504d8,_0x2e884a){return _0x4504d8[_0x8ea8('0x9')](_0x8ea8('0xa'),attributes,{'tableName':_0x8ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ea8('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x91d3=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x94dab3,_0xaf6778){var _0x542342=function(_0x4f7185){while(--_0x4f7185){_0x94dab3['push'](_0x94dab3['shift']());}};_0x542342(++_0xaf6778);}(_0x91d3,0x17e));var _0x391d=function(_0x5aa259,_0x1b5f87){_0x5aa259=_0x5aa259-0x0;var _0x107ffd=_0x91d3[_0x5aa259];return _0x107ffd;};'use strict';var _=require(_0x391d('0x0'));var util=require(_0x391d('0x1'));var logger=require(_0x391d('0x2'))('api');var moment=require(_0x391d('0x3'));var BPromise=require(_0x391d('0x4'));var rp=require(_0x391d('0x5'));var fs=require('fs');var path=require(_0x391d('0x6'));var rimraf=require(_0x391d('0x7'));var config=require(_0x391d('0x8'));var attributes=require(_0x391d('0x9'));module[_0x391d('0xa')]=function(_0x6d8a68,_0x18b1c5){return _0x6d8a68[_0x391d('0xb')](_0x391d('0xc'),attributes,{'tableName':_0x391d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x391d('0xe'),'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 90b4e4b..421f365 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 _0xdafa=['jayson/promise','redis','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xdafa,0x1c5));var _0xadaf=function(_0x42951e,_0x3ecd95){_0x42951e=_0x42951e-0x0;var _0x3cf693=_0xdafa[_0x42951e];return _0x3cf693;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xadaf('0x0'));var rs=require(_0xadaf('0x1'));var fs=require('fs');var Redis=require(_0xadaf('0x2'));var db=require(_0xadaf('0x3'))['db'];var utils=require(_0xadaf('0x4'));var logger=require(_0xadaf('0x5'))(_0xadaf('0x6'));var config=require('../../config/environment');var jayson=require(_0xadaf('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xadaf('0x8')]=_['defaults'](config[_0xadaf('0x8')],{'host':_0xadaf('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadaf('0x8')]));require(_0xadaf('0xa'))[_0xadaf('0xb')](socket);function respondWithRpcPromise(_0x5a5886,_0x1a08e5,_0x2cd59f){return new BPromise(function(_0x38a83b,_0x11c061){return client[_0xadaf('0xc')](_0x5a5886,_0x2cd59f)['then'](function(_0x3329ca){logger[_0xadaf('0xd')](_0xadaf('0xe'),_0x1a08e5,_0xadaf('0xf'));logger['debug'](_0xadaf('0x10'),_0x1a08e5,_0xadaf('0xf'),JSON[_0xadaf('0x11')](_0x3329ca));if(_0x3329ca['error']){if(_0x3329ca[_0xadaf('0x12')][_0xadaf('0x13')]===0x1f4){logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x3329ca[_0xadaf('0x12')][_0xadaf('0x14')]);return _0x11c061(_0x3329ca[_0xadaf('0x12')]['message']);}logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x3329ca['error'][_0xadaf('0x14')]);return _0x38a83b(_0x3329ca['error'][_0xadaf('0x14')]);}else{logger['info'](_0xadaf('0xe'),_0x1a08e5,_0xadaf('0xf'));_0x38a83b(_0x3329ca[_0xadaf('0x15')][_0xadaf('0x14')]);}})[_0xadaf('0x16')](function(_0x32506f){logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x32506f);_0x11c061(_0x32506f);});});}
\ No newline at end of file
+var _0x6e86=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3556fe,_0xd7a32d){var _0x29f885=function(_0x2294c3){while(--_0x2294c3){_0x3556fe['push'](_0x3556fe['shift']());}};_0x29f885(++_0xd7a32d);}(_0x6e86,0x1e5));var _0x66e8=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x6e86[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0x66e8('0x0'));var util=require(_0x66e8('0x1'));var moment=require(_0x66e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66e8('0x3'))['db'];var utils=require(_0x66e8('0x4'));var logger=require(_0x66e8('0x5'))(_0x66e8('0x6'));var config=require(_0x66e8('0x7'));var jayson=require(_0x66e8('0x8'));var client=jayson['client'][_0x66e8('0x9')]({'port':0x232a});config[_0x66e8('0xa')]=_['defaults'](config[_0x66e8('0xa')],{'host':_0x66e8('0xb'),'port':0x18eb});var socket=require(_0x66e8('0xc'))(new Redis(config[_0x66e8('0xa')]));require('./chatInternalMessage.socket')[_0x66e8('0xd')](socket);function respondWithRpcPromise(_0x31f984,_0x3056fd,_0x3a1d8c){return new BPromise(function(_0x304f3f,_0x30eb25){return client[_0x66e8('0xe')](_0x31f984,_0x3a1d8c)['then'](function(_0x530541){logger[_0x66e8('0xf')](_0x66e8('0x10'),_0x3056fd,_0x66e8('0x11'));logger[_0x66e8('0x12')](_0x66e8('0x13'),_0x3056fd,_0x66e8('0x11'),JSON[_0x66e8('0x14')](_0x530541));if(_0x530541[_0x66e8('0x15')]){if(_0x530541['error']['code']===0x1f4){logger[_0x66e8('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x3056fd,_0x530541[_0x66e8('0x15')][_0x66e8('0x16')]);return _0x30eb25(_0x530541['error'][_0x66e8('0x16')]);}logger[_0x66e8('0x15')](_0x66e8('0x10'),_0x3056fd,_0x530541[_0x66e8('0x15')]['message']);return _0x304f3f(_0x530541['error']['message']);}else{logger['info'](_0x66e8('0x10'),_0x3056fd,'request\x20sent');_0x304f3f(_0x530541[_0x66e8('0x17')]['message']);}})['catch'](function(_0xac3377){logger[_0x66e8('0x15')](_0x66e8('0x10'),_0x3056fd,_0xac3377);_0x30eb25(_0xac3377);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c45379b..4c55e6c 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 _0xca97=['register','length','chatInternalMessage:','save','remove','update','emit','removeListener'];(function(_0x3b2e06,_0x4f2695){var _0x53fa2d=function(_0xc94883){while(--_0xc94883){_0x3b2e06['push'](_0x3b2e06['shift']());}};_0x53fa2d(++_0x4f2695);}(_0xca97,0x163));var _0x7ca9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xca97[_0x5ddb1c];return _0x354adc;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7ca9('0x0'),_0x7ca9('0x1'),_0x7ca9('0x2')];function createListener(_0x237aca,_0xbb63a0){return function(_0x3267ff){_0xbb63a0[_0x7ca9('0x3')](_0x237aca,_0x3267ff);};}function removeListener(_0x4d241f,_0x584cf1){return function(){ChatInternalMessageEvents[_0x7ca9('0x4')](_0x4d241f,_0x584cf1);};}exports[_0x7ca9('0x5')]=function(_0x3616c5){for(var _0x556181=0x0,_0x9e2e3=events[_0x7ca9('0x6')];_0x556181<_0x9e2e3;_0x556181++){var _0x1eeeeb=events[_0x556181];var _0x40f1a6=createListener(_0x7ca9('0x7')+_0x1eeeeb,_0x3616c5);ChatInternalMessageEvents['on'](_0x1eeeeb,_0x40f1a6);}};
\ No newline at end of file
+var _0x37ac=['./chatInternalMessage.events','save','remove','update','removeListener','register','length'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x37ac,0x70));var _0xc37a=function(_0x1115c4,_0x3e3e6a){_0x1115c4=_0x1115c4-0x0;var _0x5c90bd=_0x37ac[_0x1115c4];return _0x5c90bd;};'use strict';var ChatInternalMessageEvents=require(_0xc37a('0x0'));var events=[_0xc37a('0x1'),_0xc37a('0x2'),_0xc37a('0x3')];function createListener(_0x21ac1a,_0xbcc7d2){return function(_0x15b9a4){_0xbcc7d2['emit'](_0x21ac1a,_0x15b9a4);};}function removeListener(_0x2120ec,_0x2bfd51){return function(){ChatInternalMessageEvents[_0xc37a('0x4')](_0x2120ec,_0x2bfd51);};}exports[_0xc37a('0x5')]=function(_0x3b60e8){for(var _0x31da12=0x0,_0x5f3bc7=events[_0xc37a('0x6')];_0x31da12<_0x5f3bc7;_0x31da12++){var _0xdeefaf=events[_0x31da12];var _0x422fe8=createListener('chatInternalMessage:'+_0xdeefaf,_0x3b60e8);ChatInternalMessageEvents['on'](_0xdeefaf,_0x422fe8);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 36372e0..efbaab9 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 _0xd99c=['put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create'];(function(_0x17e0ff,_0x4dbd1e){var _0x357979=function(_0x443276){while(--_0x443276){_0x17e0ff['push'](_0x17e0ff['shift']());}};_0x357979(++_0x4dbd1e);}(_0xd99c,0x9d));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcd99('0x0'));var util=require('util');var path=require(_0xcd99('0x1'));var timeout=require(_0xcd99('0x2'));var express=require(_0xcd99('0x3'));var router=express[_0xcd99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcd99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcd99('0x6'));var controller=require(_0xcd99('0x7'));router[_0xcd99('0x8')]('/',auth[_0xcd99('0x9')](),controller[_0xcd99('0xa')]);router['get'](_0xcd99('0xb'),auth['isAuthenticated'](),controller[_0xcd99('0xc')]);router['get'](_0xcd99('0xd'),auth['isAuthenticated'](),controller[_0xcd99('0xe')]);router[_0xcd99('0x8')](_0xcd99('0xf'),auth[_0xcd99('0x9')](),controller[_0xcd99('0x10')]);router[_0xcd99('0x11')]('/',auth[_0xcd99('0x9')](),controller[_0xcd99('0x12')]);router[_0xcd99('0x13')](_0xcd99('0xf'),controller['update']);router[_0xcd99('0x14')]('/:id',auth[_0xcd99('0x9')](),controller[_0xcd99('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x5224=['post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','/:id','show'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x5224,0xb9));var _0x4522=function(_0x5499ab,_0x4c1128){_0x5499ab=_0x5499ab-0x0;var _0x344478=_0x5224[_0x5499ab];return _0x344478;};'use strict';var multer=require(_0x4522('0x0'));var util=require(_0x4522('0x1'));var path=require('path');var timeout=require(_0x4522('0x2'));var express=require(_0x4522('0x3'));var router=express[_0x4522('0x4')]();var fs_extra=require(_0x4522('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4522('0x6'));var config=require(_0x4522('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x4522('0x8')]('/',auth[_0x4522('0x9')](),controller[_0x4522('0xa')]);router[_0x4522('0x8')]('/describe',auth[_0x4522('0x9')](),controller[_0x4522('0xb')]);router['get'](_0x4522('0xc'),auth[_0x4522('0x9')](),controller['getUsers']);router[_0x4522('0x8')](_0x4522('0xd'),auth[_0x4522('0x9')](),controller[_0x4522('0xe')]);router[_0x4522('0xf')]('/',auth[_0x4522('0x9')](),controller[_0x4522('0x10')]);router['put'](_0x4522('0xd'),controller[_0x4522('0x11')]);router[_0x4522('0x12')](_0x4522('0xd'),auth[_0x4522('0x9')](),controller[_0x4522('0x13')]);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 b574437..b31d878 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 _0xd0e4=['out','DATE','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x2d66b6,_0x38c46e){var _0x4649e7=function(_0x5230b1){while(--_0x5230b1){_0x2d66b6['push'](_0x2d66b6['shift']());}};_0x4649e7(++_0x38c46e);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x5b5960,_0x2bab09){_0x5b5960=_0x5b5960-0x0;var _0x16b671=_0xd0e4[_0x5b5960];return _0x16b671;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'body':{'type':Sequelize[_0x4d0e('0x2')](_0x4d0e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d0e('0x4')]('in',_0x4d0e('0x5')),'defaultValue':_0x4d0e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d0e('0x6')]},'providerName':{'type':Sequelize[_0x4d0e('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x02ce=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2eb4a9,_0x16744f){var _0x1d972f=function(_0x133a1c){while(--_0x133a1c){_0x2eb4a9['push'](_0x2eb4a9['shift']());}};_0x1d972f(++_0x16744f);}(_0x02ce,0x1ac));var _0xe02c=function(_0x775ba7,_0x12589b){_0x775ba7=_0x775ba7-0x0;var _0xee3c41=_0x02ce[_0x775ba7];return _0xee3c41;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'body':{'type':Sequelize[_0xe02c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe02c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe02c('0x4')]('in',_0xe02c('0x5')),'defaultValue':_0xe02c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe02c('0x6')]},'providerName':{'type':Sequelize[_0xe02c('0x7')]},'providerResponse':{'type':Sequelize[_0xe02c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 578b454..98916cc 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 _0x3a6b=['format','UserId','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','desk.js','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','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','ChatMessage','findAll','show','params','keys','length','find','create','body','describe','chat-interactions','accept','readAt'];(function(_0x1fa20a,_0x1a127c){var _0xe73e93=function(_0x55b6d8){while(--_0x55b6d8){_0x1fa20a['push'](_0x1fa20a['shift']());}};_0xe73e93(++_0x1a127c);}(_0x3a6b,0xb5));var _0xb3a6=function(_0x283b39,_0x5ade81){_0x283b39=_0x283b39-0x0;var _0x27414c=_0x3a6b[_0x283b39];return _0x27414c;};'use strict';var emlformat=require(_0xb3a6('0x0'));var rimraf=require(_0xb3a6('0x1'));var zipdir=require(_0xb3a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a6('0x3'));var moment=require(_0xb3a6('0x4'));var BPromise=require(_0xb3a6('0x5'));var Mustache=require('mustache');var util=require(_0xb3a6('0x6'));var path=require(_0xb3a6('0x7'));var sox=require('sox');var csv=require(_0xb3a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3a6('0x9'));var _=require('lodash');var squel=require(_0xb3a6('0xa'));var crypto=require(_0xb3a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb3a6('0xc'));var toCsv=require(_0xb3a6('0x8'));var querystring=require('querystring');var Papa=require(_0xb3a6('0xd'));var Redis=require(_0xb3a6('0xe'));var authService=require(_0xb3a6('0xf'));var qs=require(_0xb3a6('0x10'));var as=require(_0xb3a6('0x11'));var hardwareService=require(_0xb3a6('0x12'));var logger=require(_0xb3a6('0x13'))(_0xb3a6('0x14'));var utils=require(_0xb3a6('0x15'));var config=require(_0xb3a6('0x16'));var licenseUtil=require(_0xb3a6('0x17'));var db=require(_0xb3a6('0x18'))['db'];config[_0xb3a6('0x19')]=_[_0xb3a6('0x1a')](config[_0xb3a6('0x19')],{'host':_0xb3a6('0x1b'),'port':0x18eb});var socket=require(_0xb3a6('0x1c'))(new Redis(config[_0xb3a6('0x19')]));require(_0xb3a6('0x1d'))[_0xb3a6('0x1e')](socket);var jayson=require(_0xb3a6('0x1f'));var client=jayson[_0xb3a6('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xb3a6('0x20')][_0xb3a6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x52176a,_0x406b9c,_0x3a087c,_0x4e6c32){return new BPromise(function(_0x2ed9a4,_0x47b82a){var _0x2c33f9=_0x4e6c32||client;return _0x2c33f9['request'](_0x52176a,_0x3a087c)['then'](function(_0x29bacf){logger['info'](_0xb3a6('0x22'),_0x406b9c,_0xb3a6('0x23'));logger['debug'](_0xb3a6('0x24'),_0x406b9c,_0xb3a6('0x23'),JSON[_0xb3a6('0x25')](_0x29bacf));if(_0x29bacf[_0xb3a6('0x26')]){if(_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x27')]===0x1f4){logger[_0xb3a6('0x26')](_0xb3a6('0x22'),_0x406b9c,_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x28')]);return _0x47b82a(_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x28')]);}logger[_0xb3a6('0x26')](_0xb3a6('0x22'),_0x406b9c,_0x29bacf['error']['message']);return _0x2ed9a4(_0x29bacf['error'][_0xb3a6('0x28')]);}else{logger[_0xb3a6('0x29')](_0xb3a6('0x22'),_0x406b9c,_0xb3a6('0x23'));_0x2ed9a4(_0x29bacf[_0xb3a6('0x2a')]['message']);}})[_0xb3a6('0x2b')](function(_0xb7360a){logger['error'](_0xb3a6('0x22'),_0x406b9c,_0xb7360a);_0x47b82a(_0xb7360a);});});}function respondWithStatusCode(_0x2aa0ad,_0x4f0d71){_0x4f0d71=_0x4f0d71||0xcc;return function(_0x168ffb){if(_0x168ffb){return _0x2aa0ad['sendStatus'](_0x4f0d71);}return _0x2aa0ad[_0xb3a6('0x2c')](_0x4f0d71)[_0xb3a6('0x2d')]();};}function respondWithResult(_0xf78a3b,_0x48b907){_0x48b907=_0x48b907||0xc8;return function(_0x18727e){if(_0x18727e){return _0xf78a3b['status'](_0x48b907)[_0xb3a6('0x2e')](_0x18727e);}};}function respondWithFilteredResult(_0x54903d,_0x3fdb49){return function(_0x119108){if(_0x119108){var _0x198b49=typeof _0x3fdb49['offset']===_0xb3a6('0x2f')&&typeof _0x3fdb49['limit']===_0xb3a6('0x2f');var _0x1da17c=_0x119108[_0xb3a6('0x30')];var _0x58df66=_0x198b49?0x0:_0x3fdb49[_0xb3a6('0x31')];var _0x163dff=_0x198b49?_0x119108[_0xb3a6('0x30')]:_0x3fdb49[_0xb3a6('0x31')]+_0x3fdb49[_0xb3a6('0x32')];var _0x631eeb;if(_0x163dff>=_0x1da17c){_0x163dff=_0x1da17c;_0x631eeb=0xc8;}else{_0x631eeb=0xce;}_0x54903d[_0xb3a6('0x2c')](_0x631eeb);return _0x54903d['set'](_0xb3a6('0x33'),_0x58df66+'-'+_0x163dff+'/'+_0x1da17c)[_0xb3a6('0x2e')](_0x119108);}return null;};}function patchUpdates(_0x372066){return function(_0x149adc){try{jsonpatch[_0xb3a6('0x34')](_0x149adc,_0x372066,!![]);}catch(_0x29c850){return BPromise[_0xb3a6('0x35')](_0x29c850);}return _0x149adc[_0xb3a6('0x36')]();};}function saveUpdates(_0x3c9617,_0x286037){return function(_0x3023aa){if(_0x3023aa){return _0x3023aa['update'](_0x3c9617)[_0xb3a6('0x37')](function(_0x3491ba){return _0x3491ba;});}return null;};}function removeEntity(_0x140d43,_0x3358a3){return function(_0x2299e7){if(_0x2299e7){return _0x2299e7[_0xb3a6('0x38')]()[_0xb3a6('0x37')](function(){_0x140d43[_0xb3a6('0x2c')](0xcc)[_0xb3a6('0x2d')]();});}};}function handleEntityNotFound(_0x4c4cbf,_0x404d77){return function(_0x364406){if(!_0x364406){_0x4c4cbf[_0xb3a6('0x39')](0x194);}return _0x364406;};}function handleError(_0x4cc1eb,_0x3bcb73){_0x3bcb73=_0x3bcb73||0x1f4;return function(_0x3f3f54){logger[_0xb3a6('0x26')](_0x3f3f54[_0xb3a6('0x3a')]);if(_0x3f3f54[_0xb3a6('0x3b')]){delete _0x3f3f54[_0xb3a6('0x3b')];}_0x4cc1eb[_0xb3a6('0x2c')](_0x3bcb73)[_0xb3a6('0x3c')](_0x3f3f54);};}exports['index']=function(_0x5fa761,_0x56ca94){var _0x56b6d1={},_0x3daa7c={},_0x1ee49e={'count':0x0,'rows':[]};var _0x52aed2=_[_0xb3a6('0x3d')](db['ChatMessage'][_0xb3a6('0x3e')],function(_0x38dda1){return{'name':_0x38dda1[_0xb3a6('0x3f')],'type':_0x38dda1['type'][_0xb3a6('0x40')]};});_0x3daa7c[_0xb3a6('0x41')]=_['map'](_0x52aed2,_0xb3a6('0x3b'));_0x3daa7c[_0xb3a6('0x42')]=_['keys'](_0x5fa761[_0xb3a6('0x42')]);_0x3daa7c['filters']=_[_0xb3a6('0x43')](_0x3daa7c[_0xb3a6('0x41')],_0x3daa7c[_0xb3a6('0x42')]);_0x56b6d1['attributes']=_['intersection'](_0x3daa7c[_0xb3a6('0x41')],qs[_0xb3a6('0x44')](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x44')]));_0x56b6d1[_0xb3a6('0x45')]=_0x56b6d1['attributes']['length']?_0x56b6d1[_0xb3a6('0x45')]:_0x3daa7c['model'];if(!_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x46')]('nolimit')){_0x56b6d1[_0xb3a6('0x32')]=qs['limit'](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x32')]);_0x56b6d1[_0xb3a6('0x31')]=qs[_0xb3a6('0x31')](_0x5fa761['query'][_0xb3a6('0x31')]);}_0x56b6d1[_0xb3a6('0x47')]=qs['sort'](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x48')]);_0x56b6d1[_0xb3a6('0x49')]=qs[_0xb3a6('0x4a')](_['pick'](_0x5fa761[_0xb3a6('0x42')],_0x3daa7c[_0xb3a6('0x4a')]),_0x52aed2);if(_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x4b')]){_0x56b6d1[_0xb3a6('0x49')]=_[_0xb3a6('0x4c')](_0x56b6d1[_0xb3a6('0x49')],{'$or':_[_0xb3a6('0x3d')](_0x52aed2,function(_0xe44f22){if(_0xe44f22[_0xb3a6('0x4d')]!==_0xb3a6('0x4e')){var _0x179511={};_0x179511[_0xe44f22[_0xb3a6('0x3b')]]={'$like':'%'+_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x4b')]+'%'};return _0x179511;}})});}_0x56b6d1=_[_0xb3a6('0x4c')]({},_0x56b6d1,_0x5fa761[_0xb3a6('0x4f')]);var _0x5f11b4={'where':_0x56b6d1[_0xb3a6('0x49')]};return db['ChatMessage'][_0xb3a6('0x30')](_0x5f11b4)[_0xb3a6('0x37')](function(_0x224cb8){_0x1ee49e[_0xb3a6('0x30')]=_0x224cb8;if(_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x50')]){_0x56b6d1[_0xb3a6('0x51')]=[{'all':!![]}];}return db[_0xb3a6('0x52')][_0xb3a6('0x53')](_0x56b6d1);})[_0xb3a6('0x37')](function(_0x516115){_0x1ee49e['rows']=_0x516115;return _0x1ee49e;})[_0xb3a6('0x37')](respondWithFilteredResult(_0x56ca94,_0x56b6d1))[_0xb3a6('0x2b')](handleError(_0x56ca94,null));};exports[_0xb3a6('0x54')]=function(_0xdf1069,_0x1ed498){var _0x42668b={'raw':!![],'where':{'id':_0xdf1069[_0xb3a6('0x55')]['id']}},_0x5109ae={};_0x5109ae[_0xb3a6('0x41')]=_[_0xb3a6('0x56')](db[_0xb3a6('0x52')][_0xb3a6('0x3e')]);_0x5109ae[_0xb3a6('0x42')]=_[_0xb3a6('0x56')](_0xdf1069[_0xb3a6('0x42')]);_0x5109ae[_0xb3a6('0x4a')]=_[_0xb3a6('0x43')](_0x5109ae[_0xb3a6('0x41')],_0x5109ae['query']);_0x42668b[_0xb3a6('0x45')]=_[_0xb3a6('0x43')](_0x5109ae[_0xb3a6('0x41')],qs['fields'](_0xdf1069[_0xb3a6('0x42')][_0xb3a6('0x44')]));_0x42668b[_0xb3a6('0x45')]=_0x42668b[_0xb3a6('0x45')][_0xb3a6('0x57')]?_0x42668b[_0xb3a6('0x45')]:_0x5109ae[_0xb3a6('0x41')];if(_0xdf1069[_0xb3a6('0x42')][_0xb3a6('0x50')]){_0x42668b['include']=[{'all':!![]}];}_0x42668b=_[_0xb3a6('0x4c')]({},_0x42668b,_0xdf1069['options']);return db[_0xb3a6('0x52')][_0xb3a6('0x58')](_0x42668b)['then'](handleEntityNotFound(_0x1ed498,null))['then'](respondWithResult(_0x1ed498,null))['catch'](handleError(_0x1ed498,null));};exports['create']=function(_0x94988d,_0x53ac8d){return db[_0xb3a6('0x52')][_0xb3a6('0x59')](_0x94988d[_0xb3a6('0x5a')],{})['then'](respondWithResult(_0x53ac8d,0xc9))[_0xb3a6('0x2b')](handleError(_0x53ac8d,null));};exports['update']=function(_0x2d8d77,_0x1e8b9c){if(_0x2d8d77[_0xb3a6('0x5a')]['id']){delete _0x2d8d77['body']['id'];}return db['ChatMessage'][_0xb3a6('0x58')]({'where':{'id':_0x2d8d77[_0xb3a6('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e8b9c,null))[_0xb3a6('0x37')](saveUpdates(_0x2d8d77[_0xb3a6('0x5a')],null))[_0xb3a6('0x37')](respondWithResult(_0x1e8b9c,null))[_0xb3a6('0x2b')](handleError(_0x1e8b9c,null));};exports[_0xb3a6('0x38')]=function(_0x289aa0,_0xbd378){return db[_0xb3a6('0x52')]['find']({'where':{'id':_0x289aa0[_0xb3a6('0x55')]['id']}})['then'](handleEntityNotFound(_0xbd378,null))[_0xb3a6('0x37')](removeEntity(_0xbd378,null))[_0xb3a6('0x2b')](handleError(_0xbd378,null));};exports[_0xb3a6('0x5b')]=function(_0x3d2af5,_0x162681){return db[_0xb3a6('0x52')]['describe']()[_0xb3a6('0x37')](respondWithResult(_0x162681,null))['catch'](handleError(_0x162681,null));};var interaction_log=require('../../config/logger')(_0xb3a6('0x5c'));exports[_0xb3a6('0x5d')]=function(_0x4fdbf4,_0xf69f2b,_0x502fdd){var _0x16078a={'agent':{},'channel':'chat'};if(_0x4fdbf4[_0xb3a6('0x5a')]['id']){delete _0x4fdbf4[_0xb3a6('0x5a')]['id'];}_0x4fdbf4[_0xb3a6('0x5a')]['read']=!![];_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x5e')]=moment()[_0xb3a6('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fdbf4[_0xb3a6('0x5a')]['UserId']=_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')]||_0x4fdbf4['user']['id'];_0x16078a[_0xb3a6('0x61')]['id']=_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')];return db[_0xb3a6('0x52')]['find']({'where':{'id':_0x4fdbf4[_0xb3a6('0x55')]['id'],'UserId':null}})[_0xb3a6('0x37')](handleEntityNotFound(_0xf69f2b,null))[_0xb3a6('0x37')](saveUpdates(_0x4fdbf4[_0xb3a6('0x5a')],null))[_0xb3a6('0x37')](function(_0x20fc3c){if(_0x20fc3c){_0x16078a['message']=_0x20fc3c[_0xb3a6('0x62')]({'plain':!![]});return db[_0xb3a6('0x63')][_0xb3a6('0x58')]({'where':{'id':_0x20fc3c[_0xb3a6('0x64')]}});}return null;})[_0xb3a6('0x37')](handleEntityNotFound(_0xf69f2b,null))[_0xb3a6('0x37')](function(_0x44788d){if(_0x44788d){return _0x44788d[_0xb3a6('0x65')]({'UserId':_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')],'read1stAt':_[_0xb3a6('0x66')](_0x44788d[_0xb3a6('0x67')])?moment()['format'](_0xb3a6('0x68')):undefined});}return null;})[_0xb3a6('0x37')](function(_0x3a9c28){if(_0x3a9c28){_0x16078a[_0xb3a6('0x69')]=_0x3a9c28['get']({'plain':!![]});interaction_log[_0xb3a6('0x29')](_0xb3a6('0x6a'),_0x4fdbf4['user']['id'],_0x4fdbf4['user'][_0xb3a6('0x3b')],_0x4fdbf4[_0xb3a6('0x6b')][_0xb3a6('0x6c')],_0x16078a['interaction']['id'],_0x4fdbf4[_0xb3a6('0x5a')]?JSON['stringify'](_0x4fdbf4['body']):_0xb3a6('0x6d'));return respondWithRpcPromise(_0xb3a6('0x6e'),_0xb3a6('0x6f'),_0x16078a);}return null;})[_0xb3a6('0x37')](function(_0x2bbb17){var _0x50d564='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2bbb17[_0xb3a6('0x28')]['ContactId'];return db['sequelize'][_0xb3a6('0x42')](_0x50d564,{'type':db[_0xb3a6('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x520b48){return _0x520b48;});})['then'](function(_0x51ed21){if(_0x51ed21){_0x16078a['message'][_0xb3a6('0x71')]=_0x51ed21[0x0];if(!_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')])return;return db[_0xb3a6('0x72')]['find']({'where':{'id':_0x4fdbf4[_0xb3a6('0x5a')]['UserId'],'role':_0xb3a6('0x61')},'attributes':['id','name','fullname',_0xb3a6('0x73'),_0xb3a6('0x74')],'raw':!![]});}return null;})['then'](function(_0x1e651c){if(!_0x1e651c)return null;_0x16078a['message']['agent']=_0x1e651c;return _0x16078a;})['then'](function(_0x3fefcb){if(_0x3fefcb){if(_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x75')]){_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x76')]=util[_0xb3a6('0x5f')](_0xb3a6('0x77'),_0x4fdbf4[_0xb3a6('0x6b')][_0xb3a6('0x3b')]);_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x78')]=_0x16078a[_0xb3a6('0x78')];_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x79')]=_0x16078a[_0xb3a6('0x78')];_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x7a')]=_0xb3a6('0x5d');return respondWithRpcPromise(_0xb3a6('0x7b'),_0xb3a6('0x7b'),{'event':_0xb3a6('0x7c'),'message':_[_0xb3a6('0x4c')](_0x16078a[_0xb3a6('0x28')],JSON[_0xb3a6('0x7d')](_0x16078a[_0xb3a6('0x69')][_0xb3a6('0x7e')]))},client9002)[_0xb3a6('0x37')](function(){return _0x16078a;});}return _0x16078a;}return null;})['then'](respondWithResult(_0xf69f2b,null))['catch'](handleError(_0xf69f2b,null));};var interaction_log=require(_0xb3a6('0x13'))(_0xb3a6('0x5c'));exports[_0xb3a6('0x35')]=function(_0x523667,_0xba9453,_0x1ae8d1){var _0x2d8b47={'agent':{},'channel':_0xb3a6('0x7f')};if(_0x523667['body']['id']){delete _0x523667[_0xb3a6('0x5a')]['id'];}_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')]=_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')]||_0x523667[_0xb3a6('0x6b')]['id'];_0x2d8b47['agent']['id']=_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')];return db[_0xb3a6('0x52')][_0xb3a6('0x58')]({'where':{'id':_0x523667[_0xb3a6('0x55')]['id'],'UserId':null}})[_0xb3a6('0x37')](handleEntityNotFound(_0xba9453,null))[_0xb3a6('0x37')](function(_0x430e44){if(_0x430e44){_0x2d8b47[_0xb3a6('0x28')]=_0x430e44[_0xb3a6('0x62')]({'plain':!![]});return db[_0xb3a6('0x63')][_0xb3a6('0x58')]({'where':{'id':_0x430e44[_0xb3a6('0x64')]}});}return null;})[_0xb3a6('0x37')](handleEntityNotFound(_0xba9453,null))[_0xb3a6('0x37')](function(_0x589cce){if(_0x589cce){_0x2d8b47['interaction']=_0x589cce['get']({'plain':!![]});interaction_log[_0xb3a6('0x29')](_0xb3a6('0x80'),_0x523667[_0xb3a6('0x6b')]['id'],_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x3b')],_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x6c')],_0x2d8b47[_0xb3a6('0x69')]['id'],_0x523667[_0xb3a6('0x5a')]?JSON[_0xb3a6('0x25')](_0x523667[_0xb3a6('0x5a')]):'null');return respondWithRpcPromise(_0xb3a6('0x81'),_0xb3a6('0x82'),_0x2d8b47);}return null;})[_0xb3a6('0x37')](function(_0x1e4762){var _0x83b369=_0xb3a6('0x83')+_0x1e4762[_0xb3a6('0x28')][_0xb3a6('0x84')];return db[_0xb3a6('0x85')][_0xb3a6('0x42')](_0x83b369,{'type':db[_0xb3a6('0x70')][_0xb3a6('0x86')][_0xb3a6('0x87')],'raw':!![]})[_0xb3a6('0x37')](function(_0x1c8d31){return _0x1c8d31;});})['then'](function(_0x1c06ee){if(_0x1c06ee){_0x2d8b47[_0xb3a6('0x28')][_0xb3a6('0x71')]=_0x1c06ee[0x0];if(!_0x523667['body'][_0xb3a6('0x60')])return;return db[_0xb3a6('0x72')][_0xb3a6('0x58')]({'where':{'id':_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')],'role':_0xb3a6('0x61')},'attributes':['id',_0xb3a6('0x3b'),_0xb3a6('0x88'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x396269){if(!_0x396269)return null;_0x2d8b47[_0xb3a6('0x28')][_0xb3a6('0x61')]=_0x396269;return _0x2d8b47;})[_0xb3a6('0x37')](function(_0x51e52c){if(_0x51e52c){_0x51e52c[_0xb3a6('0x28')]['interface']=util[_0xb3a6('0x5f')](_0xb3a6('0x77'),_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x3b')]);_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x78')]=_0x2d8b47['channel'];_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x79')]=_0x2d8b47[_0xb3a6('0x78')];_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x7a')]='reject';respondWithRpcPromise(_0xb3a6('0x7b'),'EventManager',{'event':_0xb3a6('0x89'),'message':_[_0xb3a6('0x4c')](_0x2d8b47[_0xb3a6('0x28')],JSON['parse'](_0x2d8b47['interaction'][_0xb3a6('0x7e')]))},client9002);return _0x2d8b47;}return null;})['then'](respondWithResult(_0xba9453,null))[_0xb3a6('0x2b')](handleError(_0xba9453,null));};
\ No newline at end of file
+var _0x8f57=['fullname','email','manual','interface','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','QueryTypes','contact','SIP/%s','motionChannel','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','limit','undefined','count','set','json','reject','save','update','end','sendStatus','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','params','keys','length','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','User','agent'];(function(_0x26115c,_0x5584dc){var _0x563c4f=function(_0x19a021){while(--_0x19a021){_0x26115c['push'](_0x26115c['shift']());}};_0x563c4f(++_0x5584dc);}(_0x8f57,0x11c));var _0x78f5=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x8f57[_0x4d3924];return _0x844555;};'use strict';var emlformat=require(_0x78f5('0x0'));var rimraf=require(_0x78f5('0x1'));var zipdir=require(_0x78f5('0x2'));var jsonpatch=require(_0x78f5('0x3'));var rp=require(_0x78f5('0x4'));var moment=require(_0x78f5('0x5'));var BPromise=require(_0x78f5('0x6'));var Mustache=require(_0x78f5('0x7'));var util=require(_0x78f5('0x8'));var path=require(_0x78f5('0x9'));var sox=require(_0x78f5('0xa'));var csv=require(_0x78f5('0xb'));var ejs=require(_0x78f5('0xc'));var fs=require('fs');var fs_extra=require(_0x78f5('0xd'));var _=require(_0x78f5('0xe'));var squel=require(_0x78f5('0xf'));var crypto=require(_0x78f5('0x10'));var jsforce=require(_0x78f5('0x11'));var deskjs=require(_0x78f5('0x12'));var toCsv=require(_0x78f5('0xb'));var querystring=require(_0x78f5('0x13'));var Papa=require(_0x78f5('0x14'));var Redis=require(_0x78f5('0x15'));var authService=require(_0x78f5('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x78f5('0x17'));var hardwareService=require(_0x78f5('0x18'));var logger=require(_0x78f5('0x19'))(_0x78f5('0x1a'));var utils=require(_0x78f5('0x1b'));var config=require(_0x78f5('0x1c'));var licenseUtil=require(_0x78f5('0x1d'));var db=require(_0x78f5('0x1e'))['db'];config[_0x78f5('0x1f')]=_[_0x78f5('0x20')](config[_0x78f5('0x1f')],{'host':_0x78f5('0x21'),'port':0x18eb});var socket=require(_0x78f5('0x22'))(new Redis(config[_0x78f5('0x1f')]));require('./chatMessage.socket')[_0x78f5('0x23')](socket);var jayson=require(_0x78f5('0x24'));var client=jayson[_0x78f5('0x25')][_0x78f5('0x26')]({'port':0x232c});var client9002=jayson[_0x78f5('0x25')][_0x78f5('0x26')]({'port':0x232a});function respondWithRpcPromise(_0x12d4b2,_0x3deeec,_0x2a98d7,_0x3a389c){return new BPromise(function(_0x300261,_0x3869ae){var _0xb0366d=_0x3a389c||client;return _0xb0366d[_0x78f5('0x27')](_0x12d4b2,_0x2a98d7)[_0x78f5('0x28')](function(_0x20f0da){logger[_0x78f5('0x29')](_0x78f5('0x2a'),_0x3deeec,_0x78f5('0x2b'));logger[_0x78f5('0x2c')](_0x78f5('0x2d'),_0x3deeec,_0x78f5('0x2b'),JSON[_0x78f5('0x2e')](_0x20f0da));if(_0x20f0da[_0x78f5('0x2f')]){if(_0x20f0da['error'][_0x78f5('0x30')]===0x1f4){logger[_0x78f5('0x2f')](_0x78f5('0x2a'),_0x3deeec,_0x20f0da[_0x78f5('0x2f')][_0x78f5('0x31')]);return _0x3869ae(_0x20f0da[_0x78f5('0x2f')]['message']);}logger[_0x78f5('0x2f')]('ChatMessage,\x20%s,\x20%s',_0x3deeec,_0x20f0da[_0x78f5('0x2f')]['message']);return _0x300261(_0x20f0da['error'][_0x78f5('0x31')]);}else{logger[_0x78f5('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3deeec,_0x78f5('0x2b'));_0x300261(_0x20f0da[_0x78f5('0x32')][_0x78f5('0x31')]);}})[_0x78f5('0x33')](function(_0x581285){logger[_0x78f5('0x2f')](_0x78f5('0x2a'),_0x3deeec,_0x581285);_0x3869ae(_0x581285);});});}function respondWithStatusCode(_0x4e1a49,_0x4ed8f0){_0x4ed8f0=_0x4ed8f0||0xcc;return function(_0x5b53a6){if(_0x5b53a6){return _0x4e1a49['sendStatus'](_0x4ed8f0);}return _0x4e1a49[_0x78f5('0x34')](_0x4ed8f0)['end']();};}function respondWithResult(_0x3b65ea,_0x7d7d4f){_0x7d7d4f=_0x7d7d4f||0xc8;return function(_0x3c01c7){if(_0x3c01c7){return _0x3b65ea[_0x78f5('0x34')](_0x7d7d4f)['json'](_0x3c01c7);}};}function respondWithFilteredResult(_0x6766d,_0x40a239){return function(_0x599c11){if(_0x599c11){var _0x16c3b9=typeof _0x40a239[_0x78f5('0x35')]==='undefined'&&typeof _0x40a239[_0x78f5('0x36')]===_0x78f5('0x37');var _0xafdf57=_0x599c11[_0x78f5('0x38')];var _0x46662b=_0x16c3b9?0x0:_0x40a239[_0x78f5('0x35')];var _0x1028e4=_0x16c3b9?_0x599c11['count']:_0x40a239[_0x78f5('0x35')]+_0x40a239[_0x78f5('0x36')];var _0x237a5e;if(_0x1028e4>=_0xafdf57){_0x1028e4=_0xafdf57;_0x237a5e=0xc8;}else{_0x237a5e=0xce;}_0x6766d[_0x78f5('0x34')](_0x237a5e);return _0x6766d[_0x78f5('0x39')]('Content-Range',_0x46662b+'-'+_0x1028e4+'/'+_0xafdf57)[_0x78f5('0x3a')](_0x599c11);}return null;};}function patchUpdates(_0x558280){return function(_0x23959f){try{jsonpatch['apply'](_0x23959f,_0x558280,!![]);}catch(_0x5dcb32){return BPromise[_0x78f5('0x3b')](_0x5dcb32);}return _0x23959f[_0x78f5('0x3c')]();};}function saveUpdates(_0x5eca9f,_0x409617){return function(_0x41ed2a){if(_0x41ed2a){return _0x41ed2a[_0x78f5('0x3d')](_0x5eca9f)[_0x78f5('0x28')](function(_0x775f7c){return _0x775f7c;});}return null;};}function removeEntity(_0x4ee2a9,_0x41c864){return function(_0x3789f3){if(_0x3789f3){return _0x3789f3['destroy']()['then'](function(){_0x4ee2a9[_0x78f5('0x34')](0xcc)[_0x78f5('0x3e')]();});}};}function handleEntityNotFound(_0x20812d,_0x5ae353){return function(_0x2d5c19){if(!_0x2d5c19){_0x20812d[_0x78f5('0x3f')](0x194);}return _0x2d5c19;};}function handleError(_0x330a7a,_0x5c9425){_0x5c9425=_0x5c9425||0x1f4;return function(_0x426d76){logger[_0x78f5('0x2f')](_0x426d76['stack']);if(_0x426d76[_0x78f5('0x40')]){delete _0x426d76[_0x78f5('0x40')];}_0x330a7a[_0x78f5('0x34')](_0x5c9425)[_0x78f5('0x41')](_0x426d76);};}exports['index']=function(_0x12b6e1,_0x44d51f){var _0x454825={},_0x3c6a61={},_0x10522d={'count':0x0,'rows':[]};var _0x37e6c7=_[_0x78f5('0x42')](db['ChatMessage'][_0x78f5('0x43')],function(_0x421d00){return{'name':_0x421d00['fieldName'],'type':_0x421d00[_0x78f5('0x44')][_0x78f5('0x45')]};});_0x3c6a61[_0x78f5('0x46')]=_[_0x78f5('0x42')](_0x37e6c7,_0x78f5('0x40'));_0x3c6a61[_0x78f5('0x47')]=_['keys'](_0x12b6e1[_0x78f5('0x47')]);_0x3c6a61[_0x78f5('0x48')]=_[_0x78f5('0x49')](_0x3c6a61[_0x78f5('0x46')],_0x3c6a61[_0x78f5('0x47')]);_0x454825[_0x78f5('0x4a')]=_[_0x78f5('0x49')](_0x3c6a61[_0x78f5('0x46')],qs[_0x78f5('0x4b')](_0x12b6e1['query'][_0x78f5('0x4b')]));_0x454825['attributes']=_0x454825['attributes']['length']?_0x454825['attributes']:_0x3c6a61[_0x78f5('0x46')];if(!_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x4c')](_0x78f5('0x4d'))){_0x454825[_0x78f5('0x36')]=qs['limit'](_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x36')]);_0x454825[_0x78f5('0x35')]=qs['offset'](_0x12b6e1[_0x78f5('0x47')]['offset']);}_0x454825[_0x78f5('0x4e')]=qs['sort'](_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x4f')]);_0x454825[_0x78f5('0x50')]=qs['filters'](_[_0x78f5('0x51')](_0x12b6e1[_0x78f5('0x47')],_0x3c6a61['filters']),_0x37e6c7);if(_0x12b6e1['query'][_0x78f5('0x52')]){_0x454825[_0x78f5('0x50')]=_[_0x78f5('0x53')](_0x454825[_0x78f5('0x50')],{'$or':_[_0x78f5('0x42')](_0x37e6c7,function(_0x3a5bbb){if(_0x3a5bbb[_0x78f5('0x44')]!==_0x78f5('0x54')){var _0x147b9e={};_0x147b9e[_0x3a5bbb[_0x78f5('0x40')]]={'$like':'%'+_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x52')]+'%'};return _0x147b9e;}})});}_0x454825=_[_0x78f5('0x53')]({},_0x454825,_0x12b6e1[_0x78f5('0x55')]);var _0x52b5ff={'where':_0x454825[_0x78f5('0x50')]};return db[_0x78f5('0x56')][_0x78f5('0x38')](_0x52b5ff)[_0x78f5('0x28')](function(_0x349287){_0x10522d['count']=_0x349287;if(_0x12b6e1[_0x78f5('0x47')][_0x78f5('0x57')]){_0x454825[_0x78f5('0x58')]=[{'all':!![]}];}return db[_0x78f5('0x56')][_0x78f5('0x59')](_0x454825);})['then'](function(_0x48e49b){_0x10522d['rows']=_0x48e49b;return _0x10522d;})[_0x78f5('0x28')](respondWithFilteredResult(_0x44d51f,_0x454825))['catch'](handleError(_0x44d51f,null));};exports['show']=function(_0x8528d,_0x1e4de5){var _0x36bacd={'raw':!![],'where':{'id':_0x8528d[_0x78f5('0x5a')]['id']}},_0x382f81={};_0x382f81['model']=_[_0x78f5('0x5b')](db[_0x78f5('0x56')]['rawAttributes']);_0x382f81['query']=_[_0x78f5('0x5b')](_0x8528d['query']);_0x382f81[_0x78f5('0x48')]=_[_0x78f5('0x49')](_0x382f81[_0x78f5('0x46')],_0x382f81[_0x78f5('0x47')]);_0x36bacd[_0x78f5('0x4a')]=_[_0x78f5('0x49')](_0x382f81[_0x78f5('0x46')],qs[_0x78f5('0x4b')](_0x8528d[_0x78f5('0x47')][_0x78f5('0x4b')]));_0x36bacd[_0x78f5('0x4a')]=_0x36bacd[_0x78f5('0x4a')][_0x78f5('0x5c')]?_0x36bacd['attributes']:_0x382f81[_0x78f5('0x46')];if(_0x8528d[_0x78f5('0x47')]['includeAll']){_0x36bacd[_0x78f5('0x58')]=[{'all':!![]}];}_0x36bacd=_[_0x78f5('0x53')]({},_0x36bacd,_0x8528d[_0x78f5('0x55')]);return db[_0x78f5('0x56')][_0x78f5('0x5d')](_0x36bacd)['then'](handleEntityNotFound(_0x1e4de5,null))[_0x78f5('0x28')](respondWithResult(_0x1e4de5,null))[_0x78f5('0x33')](handleError(_0x1e4de5,null));};exports[_0x78f5('0x5e')]=function(_0x1ebcb7,_0x5e5158){return db[_0x78f5('0x56')][_0x78f5('0x5e')](_0x1ebcb7[_0x78f5('0x5f')],{})[_0x78f5('0x28')](respondWithResult(_0x5e5158,0xc9))[_0x78f5('0x33')](handleError(_0x5e5158,null));};exports[_0x78f5('0x3d')]=function(_0x533dff,_0x2c2364){if(_0x533dff[_0x78f5('0x5f')]['id']){delete _0x533dff[_0x78f5('0x5f')]['id'];}return db[_0x78f5('0x56')][_0x78f5('0x5d')]({'where':{'id':_0x533dff[_0x78f5('0x5a')]['id']}})[_0x78f5('0x28')](handleEntityNotFound(_0x2c2364,null))[_0x78f5('0x28')](saveUpdates(_0x533dff[_0x78f5('0x5f')],null))['then'](respondWithResult(_0x2c2364,null))[_0x78f5('0x33')](handleError(_0x2c2364,null));};exports['destroy']=function(_0x571693,_0x1dcc3d){return db[_0x78f5('0x56')][_0x78f5('0x5d')]({'where':{'id':_0x571693[_0x78f5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1dcc3d,null))[_0x78f5('0x28')](removeEntity(_0x1dcc3d,null))[_0x78f5('0x33')](handleError(_0x1dcc3d,null));};exports[_0x78f5('0x60')]=function(_0x55360b,_0x863c8f){return db['ChatMessage'][_0x78f5('0x60')]()['then'](respondWithResult(_0x863c8f,null))[_0x78f5('0x33')](handleError(_0x863c8f,null));};var interaction_log=require(_0x78f5('0x19'))(_0x78f5('0x61'));exports[_0x78f5('0x62')]=function(_0x186ee3,_0x4d1a5c,_0x2c958d){var _0x26fdcd={'agent':{},'channel':_0x78f5('0x63')};if(_0x186ee3[_0x78f5('0x5f')]['id']){delete _0x186ee3[_0x78f5('0x5f')]['id'];}_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x64')]=!![];_0x186ee3[_0x78f5('0x5f')]['readAt']=moment()[_0x78f5('0x65')](_0x78f5('0x66'));_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')]=_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')]||_0x186ee3[_0x78f5('0x68')]['id'];_0x26fdcd['agent']['id']=_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x67')];return db['ChatMessage'][_0x78f5('0x5d')]({'where':{'id':_0x186ee3[_0x78f5('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d1a5c,null))[_0x78f5('0x28')](saveUpdates(_0x186ee3['body'],null))[_0x78f5('0x28')](function(_0x3c0f91){if(_0x3c0f91){_0x26fdcd[_0x78f5('0x31')]=_0x3c0f91[_0x78f5('0x69')]({'plain':!![]});return db[_0x78f5('0x6a')][_0x78f5('0x5d')]({'where':{'id':_0x3c0f91[_0x78f5('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4d1a5c,null))['then'](function(_0x1f2610){if(_0x1f2610){return _0x1f2610['update']({'UserId':_0x186ee3['body'][_0x78f5('0x67')],'read1stAt':_['isNil'](_0x1f2610[_0x78f5('0x6c')])?moment()[_0x78f5('0x65')](_0x78f5('0x66')):undefined});}return null;})[_0x78f5('0x28')](function(_0x2e0ca7){if(_0x2e0ca7){_0x26fdcd[_0x78f5('0x6d')]=_0x2e0ca7[_0x78f5('0x69')]({'plain':!![]});interaction_log[_0x78f5('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x186ee3[_0x78f5('0x68')]['id'],_0x186ee3[_0x78f5('0x68')][_0x78f5('0x40')],_0x186ee3['user'][_0x78f5('0x6e')],_0x26fdcd[_0x78f5('0x6d')]['id'],_0x186ee3[_0x78f5('0x5f')]?JSON[_0x78f5('0x2e')](_0x186ee3[_0x78f5('0x5f')]):'null');return respondWithRpcPromise(_0x78f5('0x6f'),_0x78f5('0x70'),_0x26fdcd);}return null;})[_0x78f5('0x28')](function(_0x4bdccd){var _0x442a63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4bdccd['message'][_0x78f5('0x71')];return db[_0x78f5('0x72')][_0x78f5('0x47')](_0x442a63,{'type':db[_0x78f5('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0x78f5('0x28')](function(_0x4b0b93){return _0x4b0b93;});})[_0x78f5('0x28')](function(_0x24ddb5){if(_0x24ddb5){_0x26fdcd['message']['contact']=_0x24ddb5[0x0];if(!_0x186ee3[_0x78f5('0x5f')]['UserId'])return;return db[_0x78f5('0x74')][_0x78f5('0x5d')]({'where':{'id':_0x186ee3[_0x78f5('0x5f')]['UserId'],'role':_0x78f5('0x75')},'attributes':['id',_0x78f5('0x40'),_0x78f5('0x76'),_0x78f5('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x396a62){if(!_0x396a62)return null;_0x26fdcd[_0x78f5('0x31')][_0x78f5('0x75')]=_0x396a62;return _0x26fdcd;})[_0x78f5('0x28')](function(_0xb41502){if(_0xb41502){if(_0x186ee3[_0x78f5('0x5f')][_0x78f5('0x78')]){_0x26fdcd[_0x78f5('0x31')][_0x78f5('0x79')]=util['format']('SIP/%s',_0x186ee3['user']['name']);_0x26fdcd[_0x78f5('0x31')]['channel']=_0x26fdcd[_0x78f5('0x7a')];_0x26fdcd[_0x78f5('0x31')]['motionChannel']=_0x26fdcd[_0x78f5('0x7a')];_0x26fdcd['message'][_0x78f5('0x7b')]=_0x78f5('0x62');return respondWithRpcPromise(_0x78f5('0x7c'),_0x78f5('0x7c'),{'event':'acceptmessage','message':_['merge'](_0x26fdcd[_0x78f5('0x31')],JSON['parse'](_0x26fdcd[_0x78f5('0x6d')][_0x78f5('0x7d')]))},client9002)[_0x78f5('0x28')](function(){return _0x26fdcd;});}return _0x26fdcd;}return null;})[_0x78f5('0x28')](respondWithResult(_0x4d1a5c,null))[_0x78f5('0x33')](handleError(_0x4d1a5c,null));};var interaction_log=require(_0x78f5('0x19'))(_0x78f5('0x61'));exports[_0x78f5('0x3b')]=function(_0x35799a,_0x500c3d,_0x7c1ae6){var _0x17ff1b={'agent':{},'channel':_0x78f5('0x63')};if(_0x35799a[_0x78f5('0x5f')]['id']){delete _0x35799a['body']['id'];}_0x35799a['body'][_0x78f5('0x67')]=_0x35799a[_0x78f5('0x5f')][_0x78f5('0x67')]||_0x35799a[_0x78f5('0x68')]['id'];_0x17ff1b[_0x78f5('0x75')]['id']=_0x35799a['body'][_0x78f5('0x67')];return db['ChatMessage']['find']({'where':{'id':_0x35799a['params']['id'],'UserId':null}})[_0x78f5('0x28')](handleEntityNotFound(_0x500c3d,null))[_0x78f5('0x28')](function(_0x97736f){if(_0x97736f){_0x17ff1b[_0x78f5('0x31')]=_0x97736f[_0x78f5('0x69')]({'plain':!![]});return db[_0x78f5('0x6a')][_0x78f5('0x5d')]({'where':{'id':_0x97736f['ChatInteractionId']}});}return null;})[_0x78f5('0x28')](handleEntityNotFound(_0x500c3d,null))['then'](function(_0x44da86){if(_0x44da86){_0x17ff1b[_0x78f5('0x6d')]=_0x44da86[_0x78f5('0x69')]({'plain':!![]});interaction_log[_0x78f5('0x29')](_0x78f5('0x7e'),_0x35799a[_0x78f5('0x68')]['id'],_0x35799a['user'][_0x78f5('0x40')],_0x35799a['user'][_0x78f5('0x6e')],_0x17ff1b[_0x78f5('0x6d')]['id'],_0x35799a[_0x78f5('0x5f')]?JSON['stringify'](_0x35799a[_0x78f5('0x5f')]):_0x78f5('0x7f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x17ff1b);}return null;})[_0x78f5('0x28')](function(_0xecbde5){var _0x1f872e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xecbde5['message'][_0x78f5('0x71')];return db['sequelize'][_0x78f5('0x47')](_0x1f872e,{'type':db[_0x78f5('0x73')][_0x78f5('0x80')]['SELECT'],'raw':!![]})[_0x78f5('0x28')](function(_0x2968d0){return _0x2968d0;});})['then'](function(_0x54c6bd){if(_0x54c6bd){_0x17ff1b[_0x78f5('0x31')][_0x78f5('0x81')]=_0x54c6bd[0x0];if(!_0x35799a[_0x78f5('0x5f')][_0x78f5('0x67')])return;return db['User']['find']({'where':{'id':_0x35799a['body'][_0x78f5('0x67')],'role':_0x78f5('0x75')},'attributes':['id',_0x78f5('0x40'),_0x78f5('0x76'),_0x78f5('0x77'),'internal'],'raw':!![]});}return null;})[_0x78f5('0x28')](function(_0x307265){if(!_0x307265)return null;_0x17ff1b[_0x78f5('0x31')][_0x78f5('0x75')]=_0x307265;return _0x17ff1b;})[_0x78f5('0x28')](function(_0x4f3769){if(_0x4f3769){_0x4f3769['message'][_0x78f5('0x79')]=util[_0x78f5('0x65')](_0x78f5('0x82'),_0x35799a[_0x78f5('0x68')][_0x78f5('0x40')]);_0x4f3769[_0x78f5('0x31')][_0x78f5('0x7a')]=_0x17ff1b[_0x78f5('0x7a')];_0x4f3769[_0x78f5('0x31')][_0x78f5('0x83')]=_0x17ff1b[_0x78f5('0x7a')];_0x4f3769[_0x78f5('0x31')][_0x78f5('0x7b')]=_0x78f5('0x3b');respondWithRpcPromise(_0x78f5('0x7c'),'EventManager',{'event':_0x78f5('0x84'),'message':_[_0x78f5('0x53')](_0x17ff1b[_0x78f5('0x31')],JSON[_0x78f5('0x85')](_0x17ff1b['interaction'][_0x78f5('0x7d')]))},client9002);return _0x17ff1b;}return null;})[_0x78f5('0x28')](respondWithResult(_0x500c3d,null))[_0x78f5('0x33')](handleError(_0x500c3d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 259134b..f8e95c7 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 _0x4bef=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1ce919,_0x1bbb96){var _0x34ec94=function(_0x3f7a6f){while(--_0x3f7a6f){_0x1ce919['push'](_0x1ce919['shift']());}};_0x34ec94(++_0x1bbb96);}(_0x4bef,0x82));var _0xf4be=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x4bef[_0x8b8564];return _0x360c61;};'use strict';var EventEmitter=require(_0xf4be('0x0'));var ChatMessage=require(_0xf4be('0x1'))['db'][_0xf4be('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf4be('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf4be('0x4'),'afterDestroy':_0xf4be('0x5')};function emitEvent(_0x5920f1){return function(_0x94fa24,_0x10b8f1,_0x170be8){ChatMessageEvents[_0xf4be('0x6')](_0x5920f1+':'+_0x94fa24['id'],_0x94fa24);ChatMessageEvents[_0xf4be('0x6')](_0x5920f1,_0x94fa24);_0x170be8(null);};}for(var e in events){if(events[_0xf4be('0x7')](e)){var event=events[e];ChatMessage[_0xf4be('0x8')](e,emitEvent(event));}}module[_0xf4be('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x5232=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x5232,0x171));var _0x2523=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x5232[_0x4605dc];return _0x5d3e81;};'use strict';var EventEmitter=require(_0x2523('0x0'));var ChatMessage=require(_0x2523('0x1'))['db'][_0x2523('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2523('0x3')](0x0);var events={'afterCreate':_0x2523('0x4'),'afterUpdate':'update','afterDestroy':_0x2523('0x5')};function emitEvent(_0x541d6e){return function(_0x5a14ac,_0x1a34ad,_0x4c9c1f){ChatMessageEvents[_0x2523('0x6')](_0x541d6e+':'+_0x5a14ac['id'],_0x5a14ac);ChatMessageEvents[_0x2523('0x6')](_0x541d6e,_0x5a14ac);_0x4c9c1f(null);};}for(var e in events){if(events[_0x2523('0x7')](e)){var event=events[e];ChatMessage[_0x2523('0x8')](e,emitEvent(event));}}module[_0x2523('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8359650..7dc4285 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 _0x8796=['error','utf8mb4','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0x8796,0xcd));var _0x6879=function(_0x3d5416,_0x28a599){_0x3d5416=_0x3d5416-0x0;var _0x17712c=_0x8796[_0x3d5416];return _0x17712c;};'use strict';var _=require(_0x6879('0x0'));var util=require(_0x6879('0x1'));var logger=require(_0x6879('0x2'))(_0x6879('0x3'));var moment=require('moment');var BPromise=require(_0x6879('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6879('0x5'));var config=require(_0x6879('0x6'));var attributes=require(_0x6879('0x7'));module[_0x6879('0x8')]=function(_0x505d7e,_0x3ecef8){return _0x505d7e[_0x6879('0x9')](_0x6879('0xa'),attributes,{'tableName':_0x6879('0xb'),'paranoid':![],'indexes':[{'name':_0x6879('0xc'),'fields':[_0x6879('0xd')],'type':_0x6879('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32886e,_0x15fd3e,_0x1c718b){var _0x5e731c=_0x505d7e[_0x6879('0xf')];var _0xa9aceb=_0x32886e['get']({'plain':!![]});if(_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()==='in'||_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()==='out'&&!_0xa9aceb[_0x6879('0x12')]&&!_[_0x6879('0x13')](_0xa9aceb[_0x6879('0x14')])){_0x5e731c[_0x6879('0x15')][_0x6879('0x16')]({'where':{'id':_0xa9aceb[_0x6879('0x17')]}})[_0x6879('0x18')](function(_0x4edb5d){if(_0x4edb5d){_0x4edb5d['update']({'lastMsgAt':_0xa9aceb[_0x6879('0x19')],'lastMsgDirection':_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()});}})[_0x6879('0x1a')](function(_0x15dc85){console[_0x6879('0x1b')](_0x15dc85);});}_0x1c718b();}},'charset':_0x6879('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x39d5=['update','createdAt','catch','error','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x39d5,0x11c));var _0x539d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x39d5[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x539d('0x0'));var util=require(_0x539d('0x1'));var logger=require(_0x539d('0x2'))(_0x539d('0x3'));var moment=require(_0x539d('0x4'));var BPromise=require('bluebird');var rp=require(_0x539d('0x5'));var fs=require('fs');var path=require(_0x539d('0x6'));var rimraf=require(_0x539d('0x7'));var config=require(_0x539d('0x8'));var attributes=require(_0x539d('0x9'));module[_0x539d('0xa')]=function(_0x1f86e4,_0x4f7097){return _0x1f86e4[_0x539d('0xb')]('ChatMessage',attributes,{'tableName':_0x539d('0xc'),'paranoid':![],'indexes':[{'name':_0x539d('0xd'),'fields':[_0x539d('0xe')],'type':_0x539d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57d6a8,_0x4abb66,_0x226144){var _0x31b577=_0x1f86e4[_0x539d('0x10')];var _0x548f93=_0x57d6a8[_0x539d('0x11')]({'plain':!![]});if(_0x548f93[_0x539d('0x12')][_0x539d('0x13')]()==='in'||_0x548f93[_0x539d('0x12')]['toLowerCase']()===_0x539d('0x14')&&!_0x548f93[_0x539d('0x15')]&&!_['isNil'](_0x548f93[_0x539d('0x16')])){_0x31b577[_0x539d('0x17')]['findOne']({'where':{'id':_0x548f93['ChatInteractionId']}})['then'](function(_0x559b1c){if(_0x559b1c){_0x559b1c[_0x539d('0x18')]({'lastMsgAt':_0x548f93[_0x539d('0x19')],'lastMsgDirection':_0x548f93[_0x539d('0x12')]['toLowerCase']()});}})[_0x539d('0x1a')](function(_0x2c77c4){console[_0x539d('0x1b')](_0x2c77c4);});}_0x226144();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index bf2c235..7f4e641 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 _0x6f7a=['request','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateChatMessage','ChatMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x6f7a,0x117));var _0xa6f7=function(_0xcdf41,_0x3abe4f){_0xcdf41=_0xcdf41-0x0;var _0x457537=_0x6f7a[_0xcdf41];return _0x457537;};'use strict';var _=require('lodash');var util=require(_0xa6f7('0x0'));var moment=require(_0xa6f7('0x1'));var BPromise=require(_0xa6f7('0x2'));var rs=require(_0xa6f7('0x3'));var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6f7('0x5'));var logger=require(_0xa6f7('0x6'))(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var jayson=require(_0xa6f7('0x9'));var client=jayson[_0xa6f7('0xa')][_0xa6f7('0xb')]({'port':0x232a});config[_0xa6f7('0xc')]=_[_0xa6f7('0xd')](config[_0xa6f7('0xc')],{'host':_0xa6f7('0xe'),'port':0x18eb});var socket=require(_0xa6f7('0xf'))(new Redis(config['redis']));require(_0xa6f7('0x10'))[_0xa6f7('0x11')](socket);function respondWithRpcPromise(_0x4f0b3d,_0x1fa009,_0xc430ca){return new BPromise(function(_0x3be18a,_0x13d6e3){return client[_0xa6f7('0x12')](_0x4f0b3d,_0xc430ca)[_0xa6f7('0x13')](function(_0x341b48){logger[_0xa6f7('0x14')](_0xa6f7('0x15'),_0x1fa009,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1fa009,'request\x20sent',JSON[_0xa6f7('0x16')](_0x341b48));if(_0x341b48[_0xa6f7('0x17')]){if(_0x341b48[_0xa6f7('0x17')][_0xa6f7('0x18')]===0x1f4){logger[_0xa6f7('0x17')](_0xa6f7('0x15'),_0x1fa009,_0x341b48['error']['message']);return _0x13d6e3(_0x341b48['error'][_0xa6f7('0x19')]);}logger[_0xa6f7('0x17')](_0xa6f7('0x15'),_0x1fa009,_0x341b48[_0xa6f7('0x17')]['message']);return _0x3be18a(_0x341b48[_0xa6f7('0x17')][_0xa6f7('0x19')]);}else{logger['info'](_0xa6f7('0x15'),_0x1fa009,_0xa6f7('0x1a'));_0x3be18a(_0x341b48['result'][_0xa6f7('0x19')]);}})[_0xa6f7('0x1b')](function(_0xa72087){logger[_0xa6f7('0x17')]('ChatMessage,\x20%s,\x20%s',_0x1fa009,_0xa72087);_0x13d6e3(_0xa72087);});});}exports[_0xa6f7('0x1c')]=function(_0x55957b){var _0x57d4f2=this;return new Promise(function(_0x30752c,_0x2907aa){return db[_0xa6f7('0x1d')][_0xa6f7('0x1e')](_0x55957b['body'],{'raw':_0x55957b[_0xa6f7('0x1f')]?_0x55957b['options'][_0xa6f7('0x20')]===undefined?!![]:![]:!![]})[_0xa6f7('0x13')](function(_0x2eaeaa){logger[_0xa6f7('0x14')](_0xa6f7('0x1c'),_0x55957b);logger['debug']('CreateChatMessage',_0x55957b,JSON[_0xa6f7('0x16')](_0x2eaeaa));_0x30752c(_0x2eaeaa);})[_0xa6f7('0x1b')](function(_0x326fc4){logger[_0xa6f7('0x17')](_0xa6f7('0x1c'),_0x326fc4['message'],_0x55957b);_0x2907aa(_0x57d4f2[_0xa6f7('0x17')](0x1f4,_0x326fc4[_0xa6f7('0x19')]));});});};
\ No newline at end of file
+var _0x46e4=['./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x498226,_0x139ddb){var _0x3a13d7=function(_0x257dc7){while(--_0x257dc7){_0x498226['push'](_0x498226['shift']());}};_0x3a13d7(++_0x139ddb);}(_0x46e4,0xdd));var _0x446e=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x46e4[_0xcc26d2];return _0x3841e2;};'use strict';var _=require(_0x446e('0x0'));var util=require('util');var moment=require(_0x446e('0x1'));var BPromise=require(_0x446e('0x2'));var rs=require(_0x446e('0x3'));var fs=require('fs');var Redis=require(_0x446e('0x4'));var db=require(_0x446e('0x5'))['db'];var utils=require(_0x446e('0x6'));var logger=require(_0x446e('0x7'))(_0x446e('0x8'));var config=require(_0x446e('0x9'));var jayson=require(_0x446e('0xa'));var client=jayson[_0x446e('0xb')][_0x446e('0xc')]({'port':0x232a});config[_0x446e('0xd')]=_[_0x446e('0xe')](config[_0x446e('0xd')],{'host':_0x446e('0xf'),'port':0x18eb});var socket=require(_0x446e('0x10'))(new Redis(config[_0x446e('0xd')]));require(_0x446e('0x11'))['register'](socket);function respondWithRpcPromise(_0x5da6cb,_0x49c3dc,_0x11ebe5){return new BPromise(function(_0x590708,_0x202c9a){return client[_0x446e('0x12')](_0x5da6cb,_0x11ebe5)[_0x446e('0x13')](function(_0x28ae1d){logger['info'](_0x446e('0x14'),_0x49c3dc,_0x446e('0x15'));logger[_0x446e('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x49c3dc,_0x446e('0x15'),JSON[_0x446e('0x17')](_0x28ae1d));if(_0x28ae1d[_0x446e('0x18')]){if(_0x28ae1d[_0x446e('0x18')]['code']===0x1f4){logger[_0x446e('0x18')](_0x446e('0x14'),_0x49c3dc,_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);return _0x202c9a(_0x28ae1d['error'][_0x446e('0x19')]);}logger['error'](_0x446e('0x14'),_0x49c3dc,_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);return _0x590708(_0x28ae1d[_0x446e('0x18')][_0x446e('0x19')]);}else{logger[_0x446e('0x1a')](_0x446e('0x14'),_0x49c3dc,_0x446e('0x15'));_0x590708(_0x28ae1d[_0x446e('0x1b')][_0x446e('0x19')]);}})[_0x446e('0x1c')](function(_0x3bfcdb){logger[_0x446e('0x18')](_0x446e('0x14'),_0x49c3dc,_0x3bfcdb);_0x202c9a(_0x3bfcdb);});});}exports[_0x446e('0x1d')]=function(_0x249b04){var _0x170776=this;return new Promise(function(_0x489950,_0x33b7fa){return db[_0x446e('0x1e')]['create'](_0x249b04[_0x446e('0x1f')],{'raw':_0x249b04['options']?_0x249b04[_0x446e('0x20')][_0x446e('0x21')]===undefined?!![]:![]:!![]})[_0x446e('0x13')](function(_0x2f63cc){logger['info'](_0x446e('0x1d'),_0x249b04);logger[_0x446e('0x16')](_0x446e('0x1d'),_0x249b04,JSON[_0x446e('0x17')](_0x2f63cc));_0x489950(_0x2f63cc);})['catch'](function(_0x1e836d){logger[_0x446e('0x18')](_0x446e('0x1d'),_0x1e836d[_0x446e('0x19')],_0x249b04);_0x33b7fa(_0x170776[_0x446e('0x18')](0x1f4,_0x1e836d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 19469e9..28bfa2c 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 _0x2123=['./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x15b3d6,_0x3dc9ac){var _0x4c124a=function(_0x1b7ba4){while(--_0x1b7ba4){_0x15b3d6['push'](_0x15b3d6['shift']());}};_0x4c124a(++_0x3dc9ac);}(_0x2123,0x190));var _0x3212=function(_0x3e84f0,_0x447cf5){_0x3e84f0=_0x3e84f0-0x0;var _0x49165f=_0x2123[_0x3e84f0];return _0x49165f;};'use strict';var ChatMessageEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatMessageEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatMessage:'+_0x4b35e9,_0x5d9d36);ChatMessageEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
+var _0x0a52=['removeListener','register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x8f528e,_0x54e531){var _0x412176=function(_0x542d2e){while(--_0x542d2e){_0x8f528e['push'](_0x8f528e['shift']());}};_0x412176(++_0x54e531);}(_0x0a52,0xe4));var _0x20a5=function(_0x88087e,_0x318a01){_0x88087e=_0x88087e-0x0;var _0x354d9e=_0x0a52[_0x88087e];return _0x354d9e;};'use strict';var ChatMessageEvents=require(_0x20a5('0x0'));var events=[_0x20a5('0x1'),'remove',_0x20a5('0x2')];function createListener(_0x396070,_0xe4dbc9){return function(_0x5a71da){_0xe4dbc9[_0x20a5('0x3')](_0x396070,_0x5a71da);};}function removeListener(_0x16e604,_0x243305){return function(){ChatMessageEvents[_0x20a5('0x4')](_0x16e604,_0x243305);};}exports[_0x20a5('0x5')]=function(_0x1fcc72){for(var _0x4acc66=0x0,_0x56b172=events[_0x20a5('0x6')];_0x4acc66<_0x56b172;_0x4acc66++){var _0x1f44fd=events[_0x4acc66];var _0x478779=createListener(_0x20a5('0x7')+_0x1f44fd,_0x1fcc72);ChatMessageEvents['on'](_0x1f44fd,_0x478779);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 74c5059..03e9cd9 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 _0x45e3=['index','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xb98d8d,_0x481423){var _0x489b15=function(_0x409a13){while(--_0x409a13){_0xb98d8d['push'](_0xb98d8d['shift']());}};_0x489b15(++_0x481423);}(_0x45e3,0x145));var _0x345e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x45e3[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x345e('0x0'));var util=require(_0x345e('0x1'));var path=require(_0x345e('0x2'));var timeout=require(_0x345e('0x3'));var express=require(_0x345e('0x4'));var router=express[_0x345e('0x5')]();var fs_extra=require(_0x345e('0x6'));var auth=require(_0x345e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x345e('0x8'));var controller=require('./chatMessage.controller');router[_0x345e('0x9')]('/',auth[_0x345e('0xa')](),controller[_0x345e('0xb')]);router[_0x345e('0x9')](_0x345e('0xc'),auth[_0x345e('0xa')](),controller[_0x345e('0xd')]);router[_0x345e('0x9')](_0x345e('0xe'),auth['isAuthenticated'](),controller[_0x345e('0xf')]);router[_0x345e('0x10')]('/',auth[_0x345e('0xa')](),interaction['tracked'](_0x345e('0x11'),_0x345e('0x12')),controller[_0x345e('0x13')]);router[_0x345e('0x14')]('/:id',controller[_0x345e('0x15')]);router[_0x345e('0x14')](_0x345e('0x16'),auth[_0x345e('0xa')](),controller[_0x345e('0x17')]);router[_0x345e('0x14')](_0x345e('0x18'),auth[_0x345e('0xa')](),controller[_0x345e('0x19')]);router['delete'](_0x345e('0xe'),auth[_0x345e('0xa')](),controller[_0x345e('0x1a')]);module[_0x345e('0x1b')]=router;
\ No newline at end of file
+var _0x440c=['express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x29cc33,_0x2ed3ec){var _0x21c25a=function(_0x26d513){while(--_0x26d513){_0x29cc33['push'](_0x29cc33['shift']());}};_0x21c25a(++_0x2ed3ec);}(_0x440c,0xc0));var _0xc440=function(_0x693387,_0x5e058a){_0x693387=_0x693387-0x0;var _0x5365e4=_0x440c[_0x693387];return _0x5365e4;};'use strict';var multer=require(_0xc440('0x0'));var util=require(_0xc440('0x1'));var path=require(_0xc440('0x2'));var timeout=require(_0xc440('0x3'));var express=require(_0xc440('0x4'));var router=express[_0xc440('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc440('0x6'));var config=require(_0xc440('0x7'));var controller=require(_0xc440('0x8'));router[_0xc440('0x9')]('/',auth[_0xc440('0xa')](),controller[_0xc440('0xb')]);router['get'](_0xc440('0xc'),auth['isAuthenticated'](),controller[_0xc440('0xd')]);router[_0xc440('0x9')](_0xc440('0xe'),auth[_0xc440('0xa')](),controller[_0xc440('0xf')]);router[_0xc440('0x10')]('/',auth[_0xc440('0xa')](),interaction[_0xc440('0x11')](_0xc440('0x12'),_0xc440('0x13')),controller[_0xc440('0x14')]);router[_0xc440('0x15')](_0xc440('0xe'),controller['update']);router[_0xc440('0x15')](_0xc440('0x16'),auth[_0xc440('0xa')](),controller[_0xc440('0x17')]);router['put']('/:id/reject',auth[_0xc440('0xa')](),controller[_0xc440('0x18')]);router[_0xc440('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xc440('0x1a')]);module[_0xc440('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 ef47712..9b4f7ab 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 _0xadb5=['medium','TEXT','exports'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xadb5,0xad));var _0x5adb=function(_0x21a5d3,_0x3dcffd){_0x21a5d3=_0x21a5d3-0x0;var _0x3dfc60=_0xadb5[_0x21a5d3];return _0x3dfc60;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0xa24f2c,_0x1b6950){var _0x1ad53c=function(_0x3c00e7){while(--_0x3c00e7){_0xa24f2c['push'](_0xa24f2c['shift']());}};_0x1ad53c(++_0x1b6950);}(_0xadb5,0xad));var _0x5adb=function(_0x3ffa3d,_0x9d0612){_0x3ffa3d=_0x3ffa3d-0x0;var _0x1766ed=_0xadb5[_0x3ffa3d];return _0x1766ed;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7497e00..2af5d4d 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(_0x375db0,_0xec03ce){var _0x1eaf0c=function(_0x3b3c52){while(--_0x3b3c52){_0x375db0['push'](_0x375db0['shift']());}};_0x1eaf0c(++_0xec03ce);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x2414c9,_0x342924){_0x2414c9=_0x2414c9-0x0;var _0x6797eb=_0x7a54[_0x2414c9];return _0x6797eb;};'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 b33cfe1..d867c13 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 _0x4b66=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x4b66,0x1dc));var _0x64b6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b66[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x64b6('0x0'));var ChatOfflineMessage=require(_0x64b6('0x1'))['db'][_0x64b6('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x64b6('0x3')](0x0);var events={'afterCreate':_0x64b6('0x4'),'afterUpdate':_0x64b6('0x5'),'afterDestroy':_0x64b6('0x6')};function emitEvent(_0x8d82d1){return function(_0xa00e7f,_0xf885f2,_0x4780bd){ChatOfflineMessageEvents[_0x64b6('0x7')](_0x8d82d1+':'+_0xa00e7f['id'],_0xa00e7f);ChatOfflineMessageEvents[_0x64b6('0x7')](_0x8d82d1,_0xa00e7f);_0x4780bd(null);};}for(var e in events){if(events[_0x64b6('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x64b6('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe6b4=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe6b4,0x188));var _0x4e6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe6b4[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4e6b('0x0'));var ChatOfflineMessage=require(_0x4e6b('0x1'))['db'][_0x4e6b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4e6b('0x3')](0x0);var events={'afterCreate':_0x4e6b('0x4'),'afterUpdate':_0x4e6b('0x5'),'afterDestroy':_0x4e6b('0x6')};function emitEvent(_0x5abac4){return function(_0x3b143f,_0x5aebd2,_0x44e2eb){ChatOfflineMessageEvents[_0x4e6b('0x7')](_0x5abac4+':'+_0x3b143f['id'],_0x3b143f);ChatOfflineMessageEvents[_0x4e6b('0x7')](_0x5abac4,_0x3b143f);_0x44e2eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x4e6b('0x8')](e,emitEvent(event));}}module[_0x4e6b('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index cf4faba..2f439cd 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 _0xd235=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x18703c,_0x125f2a){var _0x29d475=function(_0x156808){while(--_0x156808){_0x18703c['push'](_0x18703c['shift']());}};_0x29d475(++_0x125f2a);}(_0xd235,0x177));var _0x5d23=function(_0x479eca,_0x4aa570){_0x479eca=_0x479eca-0x0;var _0x30ccaf=_0xd235[_0x479eca];return _0x30ccaf;};'use strict';var attributes=require(_0x5d23('0x0'));module[_0x5d23('0x1')]=function(_0x3f7da6){return _0x3f7da6[_0x5d23('0x2')](_0x5d23('0x3'),attributes,{'tableName':_0x5d23('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d23('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7440=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x7440,0xf9));var _0x0744=function(_0x1e9154,_0x51946f){_0x1e9154=_0x1e9154-0x0;var _0x40bb76=_0x7440[_0x1e9154];return _0x40bb76;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0744('0x0')]=function(_0x5d90f0){return _0x5d90f0[_0x0744('0x1')](_0x0744('0x2'),attributes,{'tableName':_0x0744('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0744('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f821cd9..6c0f658 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 _0xb681=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xb681,0x153));var _0x1b68=function(_0x27b436,_0x5b1fc3){_0x27b436=_0x27b436-0x0;var _0x1e2f0f=_0xb681[_0x27b436];return _0x1e2f0f;};'use strict';var _=require(_0x1b68('0x0'));var util=require(_0x1b68('0x1'));var moment=require(_0x1b68('0x2'));var BPromise=require(_0x1b68('0x3'));var rs=require(_0x1b68('0x4'));var fs=require('fs');var Redis=require(_0x1b68('0x5'));var db=require(_0x1b68('0x6'))['db'];var utils=require(_0x1b68('0x7'));var logger=require(_0x1b68('0x8'))(_0x1b68('0x9'));var config=require('../../config/environment');var jayson=require(_0x1b68('0xa'));var client=jayson['client'][_0x1b68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103d40,_0x1166ab,_0x536e88){return new BPromise(function(_0x5b3ebb,_0x54c76f){return client['request'](_0x103d40,_0x536e88)['then'](function(_0x1f0f1b){logger[_0x1b68('0xc')](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));logger[_0x1b68('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1166ab,_0x1b68('0xe'),JSON['stringify'](_0x1f0f1b));if(_0x1f0f1b[_0x1b68('0x10')]){if(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x11')]===0x1f4){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x54c76f(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x5b3ebb(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}else{logger['info'](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));_0x5b3ebb(_0x1f0f1b[_0x1b68('0x13')][_0x1b68('0x12')]);}})[_0x1b68('0x14')](function(_0x2255cf){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x2255cf);_0x54c76f(_0x2255cf);});});}
\ No newline at end of file
+var _0x1ed1=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ed1,0x134));var _0x11ed=function(_0x36a7e1,_0x13f911){_0x36a7e1=_0x36a7e1-0x0;var _0x21dd47=_0x1ed1[_0x36a7e1];return _0x21dd47;};'use strict';var _=require(_0x11ed('0x0'));var util=require('util');var moment=require(_0x11ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x11ed('0x2'));var fs=require('fs');var Redis=require(_0x11ed('0x3'));var db=require(_0x11ed('0x4'))['db'];var utils=require(_0x11ed('0x5'));var logger=require(_0x11ed('0x6'))('rpc');var config=require(_0x11ed('0x7'));var jayson=require(_0x11ed('0x8'));var client=jayson[_0x11ed('0x9')][_0x11ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e632,_0x490a26,_0x391846){return new BPromise(function(_0x135b0d,_0x353472){return client['request'](_0x19e632,_0x391846)[_0x11ed('0xb')](function(_0xd9e012){logger['info'](_0x11ed('0xc'),_0x490a26,_0x11ed('0xd'));logger['debug'](_0x11ed('0xe'),_0x490a26,_0x11ed('0xd'),JSON[_0x11ed('0xf')](_0xd9e012));if(_0xd9e012[_0x11ed('0x10')]){if(_0xd9e012[_0x11ed('0x10')][_0x11ed('0x11')]===0x1f4){logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x353472(_0xd9e012[_0x11ed('0x10')]['message']);}logger[_0x11ed('0x10')](_0x11ed('0xc'),_0x490a26,_0xd9e012[_0x11ed('0x10')][_0x11ed('0x12')]);return _0x135b0d(_0xd9e012['error'][_0x11ed('0x12')]);}else{logger[_0x11ed('0x13')](_0x11ed('0xc'),_0x490a26,'request\x20sent');_0x135b0d(_0xd9e012[_0x11ed('0x14')][_0x11ed('0x12')]);}})[_0x11ed('0x15')](function(_0x12d2b6){logger[_0x11ed('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x490a26,_0x12d2b6);_0x353472(_0x12d2b6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 55f63a4..35a166e 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 _0xec87=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xec87,0x19b));var _0x7ec8=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xec87[_0x52c4e9];return _0x252a03;};'use strict';var multer=require(_0x7ec8('0x0'));var util=require(_0x7ec8('0x1'));var path=require(_0x7ec8('0x2'));var timeout=require(_0x7ec8('0x3'));var express=require(_0x7ec8('0x4'));var router=express[_0x7ec8('0x5')]();var fs_extra=require(_0x7ec8('0x6'));var auth=require(_0x7ec8('0x7'));var interaction=require(_0x7ec8('0x8'));var config=require(_0x7ec8('0x9'));var controller=require(_0x7ec8('0xa'));router[_0x7ec8('0xb')]('/',auth[_0x7ec8('0xc')](),controller[_0x7ec8('0xd')]);router[_0x7ec8('0xb')](_0x7ec8('0xe'),auth[_0x7ec8('0xc')](),controller[_0x7ec8('0xf')]);router[_0x7ec8('0xb')](_0x7ec8('0x10'),auth['isAuthenticated'](),controller[_0x7ec8('0x11')]);router[_0x7ec8('0x12')]('/',auth[_0x7ec8('0xc')](),controller['create']);router[_0x7ec8('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7ec8('0x14')]);router['delete']('/:id',auth[_0x7ec8('0xc')](),controller[_0x7ec8('0x15')]);module[_0x7ec8('0x16')]=router;
\ No newline at end of file
+var _0x4001=['express','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','connect-timeout'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x4001,0x99));var _0x1400=function(_0x552192,_0x4d9370){_0x552192=_0x552192-0x0;var _0x6b7953=_0x4001[_0x552192];return _0x6b7953;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1400('0x0'));var express=require(_0x1400('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1400('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1400('0x3'));router[_0x1400('0x4')]('/',auth[_0x1400('0x5')](),controller[_0x1400('0x6')]);router[_0x1400('0x4')](_0x1400('0x7'),auth[_0x1400('0x5')](),controller[_0x1400('0x8')]);router['get'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller[_0x1400('0xa')]);router[_0x1400('0xb')]('/',auth['isAuthenticated'](),controller[_0x1400('0xc')]);router['put'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller['update']);router['delete'](_0x1400('0x9'),auth[_0x1400('0x5')](),controller[_0x1400('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 24cf100..e415df7 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 _0x69e7=['ENUM','mouseOver','timeout','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69e7,0x11c));var _0x769e=function(_0x5e66b0,_0x5bef62){_0x5e66b0=_0x5e66b0-0x0;var _0x9a3372=_0x69e7[_0x5e66b0];return _0x9a3372;};'use strict';var Sequelize=require('sequelize');module[_0x769e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x769e('0x1')](_0x769e('0x2'),_0x769e('0x3')),'defaultValue':_0x769e('0x2')},'selector':{'type':Sequelize[_0x769e('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4782=['sequelize','exports','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x389c80,_0x5977d5){var _0x3f643e=function(_0x56dcf6){while(--_0x56dcf6){_0x389c80['push'](_0x389c80['shift']());}};_0x3f643e(++_0x5977d5);}(_0x4782,0x19d));var _0x2478=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x4782[_0xcfeda9];return _0x4826c7;};'use strict';var Sequelize=require(_0x2478('0x0'));module[_0x2478('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2478('0x2')](_0x2478('0x3'),_0x2478('0x4')),'defaultValue':_0x2478('0x3')},'selector':{'type':Sequelize[_0x2478('0x5')]},'timeout':{'type':Sequelize[_0x2478('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 3af3d90..ea2ba33 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 _0x72b1=['include','options','find','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72b1,0x16e));var _0x172b=function(_0x57beb4,_0x45dbe1){_0x57beb4=_0x57beb4-0x0;var _0x4a547d=_0x72b1[_0x57beb4];return _0x4a547d;};'use strict';var emlformat=require(_0x172b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x172b('0x1'));var jsonpatch=require(_0x172b('0x2'));var rp=require(_0x172b('0x3'));var moment=require(_0x172b('0x4'));var BPromise=require(_0x172b('0x5'));var Mustache=require(_0x172b('0x6'));var util=require(_0x172b('0x7'));var path=require('path');var sox=require(_0x172b('0x8'));var csv=require(_0x172b('0x9'));var ejs=require(_0x172b('0xa'));var fs=require('fs');var fs_extra=require(_0x172b('0xb'));var _=require('lodash');var squel=require(_0x172b('0xc'));var crypto=require('crypto');var jsforce=require(_0x172b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x172b('0x9'));var querystring=require(_0x172b('0xe'));var Papa=require(_0x172b('0xf'));var Redis=require(_0x172b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x172b('0x11'));var as=require(_0x172b('0x12'));var hardwareService=require(_0x172b('0x13'));var logger=require(_0x172b('0x14'))(_0x172b('0x15'));var utils=require(_0x172b('0x16'));var config=require(_0x172b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x172b('0x18'))['db'];function respondWithStatusCode(_0x82727f,_0xdf832e){_0xdf832e=_0xdf832e||0xcc;return function(_0x4970f8){if(_0x4970f8){return _0x82727f[_0x172b('0x19')](_0xdf832e);}return _0x82727f['status'](_0xdf832e)[_0x172b('0x1a')]();};}function respondWithResult(_0x81e11e,_0x5239b9){_0x5239b9=_0x5239b9||0xc8;return function(_0x1b7247){if(_0x1b7247){return _0x81e11e[_0x172b('0x1b')](_0x5239b9)[_0x172b('0x1c')](_0x1b7247);}};}function respondWithFilteredResult(_0xa28463,_0x5b0ab1){return function(_0x5293ef){if(_0x5293ef){var _0x3625bb=typeof _0x5b0ab1[_0x172b('0x1d')]===_0x172b('0x1e')&&typeof _0x5b0ab1[_0x172b('0x1f')]==='undefined';var _0x4f369b=_0x5293ef[_0x172b('0x20')];var _0x3b2701=_0x3625bb?0x0:_0x5b0ab1[_0x172b('0x1d')];var _0xba7825=_0x3625bb?_0x5293ef[_0x172b('0x20')]:_0x5b0ab1['offset']+_0x5b0ab1[_0x172b('0x1f')];var _0x2d24f9;if(_0xba7825>=_0x4f369b){_0xba7825=_0x4f369b;_0x2d24f9=0xc8;}else{_0x2d24f9=0xce;}_0xa28463[_0x172b('0x1b')](_0x2d24f9);return _0xa28463[_0x172b('0x21')](_0x172b('0x22'),_0x3b2701+'-'+_0xba7825+'/'+_0x4f369b)[_0x172b('0x1c')](_0x5293ef);}return null;};}function patchUpdates(_0x296aa6){return function(_0x5c7e17){try{jsonpatch['apply'](_0x5c7e17,_0x296aa6,!![]);}catch(_0x562db9){return BPromise['reject'](_0x562db9);}return _0x5c7e17[_0x172b('0x23')]();};}function saveUpdates(_0x4c8090,_0x721d07){return function(_0x25ee62){if(_0x25ee62){return _0x25ee62[_0x172b('0x24')](_0x4c8090)[_0x172b('0x25')](function(_0x32419a){return _0x32419a;});}return null;};}function removeEntity(_0x24e4ff,_0x507b99){return function(_0x1cefd1){if(_0x1cefd1){return _0x1cefd1[_0x172b('0x26')]()['then'](function(){_0x24e4ff[_0x172b('0x1b')](0xcc)[_0x172b('0x1a')]();});}};}function handleEntityNotFound(_0x3df490,_0x29e1d4){return function(_0x356c83){if(!_0x356c83){_0x3df490[_0x172b('0x19')](0x194);}return _0x356c83;};}function handleError(_0x39bdc5,_0x5ee442){_0x5ee442=_0x5ee442||0x1f4;return function(_0x1deb7e){logger[_0x172b('0x27')](_0x1deb7e['stack']);if(_0x1deb7e[_0x172b('0x28')]){delete _0x1deb7e[_0x172b('0x28')];}_0x39bdc5[_0x172b('0x1b')](_0x5ee442)[_0x172b('0x29')](_0x1deb7e);};}exports[_0x172b('0x2a')]=function(_0x4bea8e,_0x9624f5){var _0x37acc5={'raw':!![],'where':{'id':_0x4bea8e['params']['id']}},_0x596b4c={};_0x596b4c[_0x172b('0x2b')]=_[_0x172b('0x2c')](db[_0x172b('0x2d')][_0x172b('0x2e')]);_0x596b4c[_0x172b('0x2f')]=_[_0x172b('0x2c')](_0x4bea8e[_0x172b('0x2f')]);_0x596b4c[_0x172b('0x30')]=_[_0x172b('0x31')](_0x596b4c[_0x172b('0x2b')],_0x596b4c[_0x172b('0x2f')]);_0x37acc5[_0x172b('0x32')]=_[_0x172b('0x31')](_0x596b4c[_0x172b('0x2b')],qs[_0x172b('0x33')](_0x4bea8e[_0x172b('0x2f')][_0x172b('0x33')]));_0x37acc5[_0x172b('0x32')]=_0x37acc5[_0x172b('0x32')][_0x172b('0x34')]?_0x37acc5[_0x172b('0x32')]:_0x596b4c[_0x172b('0x2b')];if(_0x4bea8e[_0x172b('0x2f')][_0x172b('0x35')]){_0x37acc5[_0x172b('0x36')]=[{'all':!![]}];}_0x37acc5=_['merge']({},_0x37acc5,_0x4bea8e[_0x172b('0x37')]);return db[_0x172b('0x2d')][_0x172b('0x38')](_0x37acc5)['then'](handleEntityNotFound(_0x9624f5,null))[_0x172b('0x25')](respondWithResult(_0x9624f5,null))['catch'](handleError(_0x9624f5,null));};exports['create']=function(_0x5cc073,_0x1009ae){return db['ChatProactiveAction']['create'](_0x5cc073[_0x172b('0x39')],{})[_0x172b('0x25')](respondWithResult(_0x1009ae,0xc9))[_0x172b('0x3a')](handleError(_0x1009ae,null));};exports['update']=function(_0x6e07a2,_0x1f5516){if(_0x6e07a2[_0x172b('0x39')]['id']){delete _0x6e07a2[_0x172b('0x39')]['id'];}return db[_0x172b('0x2d')][_0x172b('0x38')]({'where':{'id':_0x6e07a2[_0x172b('0x3b')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x1f5516,null))[_0x172b('0x25')](saveUpdates(_0x6e07a2[_0x172b('0x39')],null))[_0x172b('0x25')](respondWithResult(_0x1f5516,null))[_0x172b('0x3a')](handleError(_0x1f5516,null));};exports[_0x172b('0x26')]=function(_0x45ee12,_0x51ac71){return db[_0x172b('0x2d')][_0x172b('0x38')]({'where':{'id':_0x45ee12[_0x172b('0x3b')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x51ac71,null))['then'](removeEntity(_0x51ac71,null))['catch'](handleError(_0x51ac71,null));};
\ No newline at end of file
+var _0x55d2=['ejs','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','catch','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x58329d,_0x405132){var _0x5c08bd=function(_0x2b0278){while(--_0x2b0278){_0x58329d['push'](_0x58329d['shift']());}};_0x5c08bd(++_0x405132);}(_0x55d2,0x9f));var _0x255d=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0x55d2[_0x1bdda0];return _0x269a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x255d('0x0'));var jsonpatch=require(_0x255d('0x1'));var rp=require(_0x255d('0x2'));var moment=require(_0x255d('0x3'));var BPromise=require(_0x255d('0x4'));var Mustache=require(_0x255d('0x5'));var util=require('util');var path=require(_0x255d('0x6'));var sox=require(_0x255d('0x7'));var csv=require(_0x255d('0x8'));var ejs=require(_0x255d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x255d('0xa'));var crypto=require(_0x255d('0xb'));var jsforce=require(_0x255d('0xc'));var deskjs=require(_0x255d('0xd'));var toCsv=require(_0x255d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x255d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x255d('0xf'));var logger=require(_0x255d('0x10'))(_0x255d('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x255d('0x12'));var db=require(_0x255d('0x13'))['db'];function respondWithStatusCode(_0x8d6d98,_0xcf1cb3){_0xcf1cb3=_0xcf1cb3||0xcc;return function(_0xf8abb3){if(_0xf8abb3){return _0x8d6d98[_0x255d('0x14')](_0xcf1cb3);}return _0x8d6d98[_0x255d('0x15')](_0xcf1cb3)[_0x255d('0x16')]();};}function respondWithResult(_0xce7ab2,_0x2b21fd){_0x2b21fd=_0x2b21fd||0xc8;return function(_0xbb7a35){if(_0xbb7a35){return _0xce7ab2[_0x255d('0x15')](_0x2b21fd)[_0x255d('0x17')](_0xbb7a35);}};}function respondWithFilteredResult(_0x500002,_0x29bf44){return function(_0x1be65e){if(_0x1be65e){var _0x58f0fa=typeof _0x29bf44[_0x255d('0x18')]===_0x255d('0x19')&&typeof _0x29bf44[_0x255d('0x1a')]===_0x255d('0x19');var _0x201313=_0x1be65e[_0x255d('0x1b')];var _0x2b7ed7=_0x58f0fa?0x0:_0x29bf44[_0x255d('0x18')];var _0x464f6a=_0x58f0fa?_0x1be65e[_0x255d('0x1b')]:_0x29bf44['offset']+_0x29bf44[_0x255d('0x1a')];var _0x46b939;if(_0x464f6a>=_0x201313){_0x464f6a=_0x201313;_0x46b939=0xc8;}else{_0x46b939=0xce;}_0x500002[_0x255d('0x15')](_0x46b939);return _0x500002[_0x255d('0x1c')](_0x255d('0x1d'),_0x2b7ed7+'-'+_0x464f6a+'/'+_0x201313)[_0x255d('0x17')](_0x1be65e);}return null;};}function patchUpdates(_0x417079){return function(_0x24b7b9){try{jsonpatch[_0x255d('0x1e')](_0x24b7b9,_0x417079,!![]);}catch(_0x48a380){return BPromise[_0x255d('0x1f')](_0x48a380);}return _0x24b7b9[_0x255d('0x20')]();};}function saveUpdates(_0x3aa6d9,_0x288175){return function(_0xb9d98e){if(_0xb9d98e){return _0xb9d98e[_0x255d('0x21')](_0x3aa6d9)[_0x255d('0x22')](function(_0x1c1c96){return _0x1c1c96;});}return null;};}function removeEntity(_0xd69061,_0x35e396){return function(_0x29291f){if(_0x29291f){return _0x29291f[_0x255d('0x23')]()[_0x255d('0x22')](function(){_0xd69061[_0x255d('0x15')](0xcc)[_0x255d('0x16')]();});}};}function handleEntityNotFound(_0x17f38b,_0x911934){return function(_0x28a795){if(!_0x28a795){_0x17f38b[_0x255d('0x14')](0x194);}return _0x28a795;};}function handleError(_0x57c167,_0x16d6d2){_0x16d6d2=_0x16d6d2||0x1f4;return function(_0xff763b){logger[_0x255d('0x24')](_0xff763b[_0x255d('0x25')]);if(_0xff763b[_0x255d('0x26')]){delete _0xff763b[_0x255d('0x26')];}_0x57c167[_0x255d('0x15')](_0x16d6d2)[_0x255d('0x27')](_0xff763b);};}exports['show']=function(_0x3ed01d,_0xb4bd1a){var _0x144dd0={'raw':!![],'where':{'id':_0x3ed01d[_0x255d('0x28')]['id']}},_0x547502={};_0x547502[_0x255d('0x29')]=_[_0x255d('0x2a')](db[_0x255d('0x2b')][_0x255d('0x2c')]);_0x547502[_0x255d('0x2d')]=_['keys'](_0x3ed01d[_0x255d('0x2d')]);_0x547502['filters']=_['intersection'](_0x547502[_0x255d('0x29')],_0x547502[_0x255d('0x2d')]);_0x144dd0[_0x255d('0x2e')]=_[_0x255d('0x2f')](_0x547502['model'],qs[_0x255d('0x30')](_0x3ed01d[_0x255d('0x2d')][_0x255d('0x30')]));_0x144dd0['attributes']=_0x144dd0[_0x255d('0x2e')]['length']?_0x144dd0['attributes']:_0x547502[_0x255d('0x29')];if(_0x3ed01d[_0x255d('0x2d')][_0x255d('0x31')]){_0x144dd0[_0x255d('0x32')]=[{'all':!![]}];}_0x144dd0=_[_0x255d('0x33')]({},_0x144dd0,_0x3ed01d['options']);return db[_0x255d('0x2b')]['find'](_0x144dd0)[_0x255d('0x22')](handleEntityNotFound(_0xb4bd1a,null))[_0x255d('0x22')](respondWithResult(_0xb4bd1a,null))[_0x255d('0x34')](handleError(_0xb4bd1a,null));};exports[_0x255d('0x35')]=function(_0x4ebcf4,_0x4d3084){return db['ChatProactiveAction']['create'](_0x4ebcf4[_0x255d('0x36')],{})['then'](respondWithResult(_0x4d3084,0xc9))[_0x255d('0x34')](handleError(_0x4d3084,null));};exports['update']=function(_0x2ce9a2,_0x16a389){if(_0x2ce9a2['body']['id']){delete _0x2ce9a2[_0x255d('0x36')]['id'];}return db[_0x255d('0x2b')][_0x255d('0x37')]({'where':{'id':_0x2ce9a2[_0x255d('0x28')]['id']}})[_0x255d('0x22')](handleEntityNotFound(_0x16a389,null))[_0x255d('0x22')](saveUpdates(_0x2ce9a2[_0x255d('0x36')],null))[_0x255d('0x22')](respondWithResult(_0x16a389,null))['catch'](handleError(_0x16a389,null));};exports[_0x255d('0x23')]=function(_0x40b498,_0x2e9b34){return db['ChatProactiveAction'][_0x255d('0x37')]({'where':{'id':_0x40b498[_0x255d('0x28')]['id']}})[_0x255d('0x22')](handleEntityNotFound(_0x2e9b34,null))[_0x255d('0x22')](removeEntity(_0x2e9b34,null))['catch'](handleError(_0x2e9b34,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ccf2a7d..ea06cd8 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 _0xfc35=['chat_proactive_actions','lodash','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction'];(function(_0x23774a,_0x4a5bed){var _0x29c41c=function(_0xc4f0cf){while(--_0xc4f0cf){_0x23774a['push'](_0x23774a['shift']());}};_0x29c41c(++_0x4a5bed);}(_0xfc35,0x196));var _0x5fc3=function(_0x423d72,_0x23b4b1){_0x423d72=_0x423d72-0x0;var _0x502c2a=_0xfc35[_0x423d72];return _0x502c2a;};'use strict';var _=require(_0x5fc3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5fc3('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fc3('0x2'));var rimraf=require(_0x5fc3('0x3'));var config=require(_0x5fc3('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x5fc3('0x5')]=function(_0x320f80,_0x4c07ae){return _0x320f80[_0x5fc3('0x6')](_0x5fc3('0x7'),attributes,{'tableName':_0x5fc3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d82=['rimraf','./chatProactiveAction.attributes','define','chat_proactive_actions','util','moment','path'];(function(_0x22d68a,_0x3f6978){var _0x131c53=function(_0x1781dc){while(--_0x1781dc){_0x22d68a['push'](_0x22d68a['shift']());}};_0x131c53(++_0x3f6978);}(_0x9d82,0x15b));var _0x29d8=function(_0x1a3a2a,_0x52ce7c){_0x1a3a2a=_0x1a3a2a-0x0;var _0x1746c9=_0x9d82[_0x1a3a2a];return _0x1746c9;};'use strict';var _=require('lodash');var util=require(_0x29d8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x29d8('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d8('0x2'));var rimraf=require(_0x29d8('0x3'));var config=require('../../config/environment');var attributes=require(_0x29d8('0x4'));module['exports']=function(_0xf0b68c,_0x3a78fc){return _0xf0b68c[_0x29d8('0x5')]('ChatProactiveAction',attributes,{'tableName':_0x29d8('0x6'),'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 b05030d..2c34e19 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 _0xfa69=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x143a6a,_0x560e0f){var _0x4bbe68=function(_0x200889){while(--_0x200889){_0x143a6a['push'](_0x143a6a['shift']());}};_0x4bbe68(++_0x560e0f);}(_0xfa69,0x17e));var _0x9fa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa69[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9fa6('0x0'));var util=require(_0x9fa6('0x1'));var moment=require(_0x9fa6('0x2'));var BPromise=require(_0x9fa6('0x3'));var rs=require(_0x9fa6('0x4'));var fs=require('fs');var Redis=require(_0x9fa6('0x5'));var db=require(_0x9fa6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fa6('0x7'))(_0x9fa6('0x8'));var config=require(_0x9fa6('0x9'));var jayson=require(_0x9fa6('0xa'));var client=jayson[_0x9fa6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x505a79,_0x20db51,_0x150927){return new BPromise(function(_0x5565f6,_0x9b63f1){return client[_0x9fa6('0xc')](_0x505a79,_0x150927)[_0x9fa6('0xd')](function(_0x2bc8d4){logger[_0x9fa6('0xe')](_0x9fa6('0xf'),_0x20db51,_0x9fa6('0x10'));logger[_0x9fa6('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x20db51,'request\x20sent',JSON[_0x9fa6('0x12')](_0x2bc8d4));if(_0x2bc8d4[_0x9fa6('0x13')]){if(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x14')]===0x1f4){logger[_0x9fa6('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);return _0x9b63f1(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);}logger[_0x9fa6('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x2bc8d4['error']['message']);return _0x5565f6(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x9fa6('0x10'));_0x5565f6(_0x2bc8d4[_0x9fa6('0x16')][_0x9fa6('0x15')]);}})[_0x9fa6('0x17')](function(_0x5aae1d){logger[_0x9fa6('0x13')](_0x9fa6('0xf'),_0x20db51,_0x5aae1d);_0x9b63f1(_0x5aae1d);});});}
\ No newline at end of file
+var _0xe17f=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4df260,_0x73fe86){var _0x9d4246=function(_0x38447e){while(--_0x38447e){_0x4df260['push'](_0x4df260['shift']());}};_0x9d4246(++_0x73fe86);}(_0xe17f,0x1ce));var _0xfe17=function(_0x560a15,_0x104f71){_0x560a15=_0x560a15-0x0;var _0x38365f=_0xe17f[_0x560a15];return _0x38365f;};'use strict';var _=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));var moment=require(_0xfe17('0x2'));var BPromise=require(_0xfe17('0x3'));var rs=require(_0xfe17('0x4'));var fs=require('fs');var Redis=require(_0xfe17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe17('0x6'));var logger=require(_0xfe17('0x7'))(_0xfe17('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe17('0x9'));var client=jayson[_0xfe17('0xa')][_0xfe17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb9de,_0x139942,_0xd0e777){return new BPromise(function(_0x2ba31b,_0x34d02f){return client[_0xfe17('0xc')](_0x1eb9de,_0xd0e777)['then'](function(_0x3304ba){logger[_0xfe17('0xd')](_0xfe17('0xe'),_0x139942,_0xfe17('0xf'));logger[_0xfe17('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'),JSON[_0xfe17('0x11')](_0x3304ba));if(_0x3304ba[_0xfe17('0x12')]){if(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x13')]===0x1f4){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x3304ba['error'][_0xfe17('0x14')]);return _0x34d02f(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}logger['error'](_0xfe17('0xe'),_0x139942,_0x3304ba[_0xfe17('0x12')]['message']);return _0x2ba31b(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}else{logger[_0xfe17('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'));_0x2ba31b(_0x3304ba[_0xfe17('0x15')][_0xfe17('0x14')]);}})[_0xfe17('0x16')](function(_0x2a4b05){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x2a4b05);_0x34d02f(_0x2a4b05);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 54cce54..f39b971 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 _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xeff8,0x186));var _0x8eff=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xeff8[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x7dfb59,_0x2db32f){var _0x326c4a=function(_0x4764e6){while(--_0x4764e6){_0x7dfb59['push'](_0x7dfb59['shift']());}};_0x326c4a(++_0x2db32f);}(_0x31f0,0xb7));var _0x031f=function(_0x5c4a47,_0x37d962){_0x5c4a47=_0x5c4a47-0x0;var _0x1c95c1=_0x31f0[_0x5c4a47];return _0x1c95c1;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ebabff0..2f8789e 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 _0x9ac6=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x5b4657,_0x3cf2d7){var _0x484a5f=function(_0x54f6a6){while(--_0x54f6a6){_0x5b4657['push'](_0x5b4657['shift']());}};_0x484a5f(++_0x3cf2d7);}(_0x9ac6,0xe6));var _0x69ac=function(_0x2c3ee4,_0x1009ea){_0x2c3ee4=_0x2c3ee4-0x0;var _0x12fefa=_0x9ac6[_0x2c3ee4];return _0x12fefa;};'use strict';var Sequelize=require(_0x69ac('0x0'));module[_0x69ac('0x1')]={'name':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x69ac('0x2')]},'timeout':{'type':Sequelize[_0x69ac('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x69ac('0x5'),_0x69ac('0x6'),_0x69ac('0x7'))}};
\ No newline at end of file
+var _0x69f8=['exports','STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69f8,0x107));var _0x869f=function(_0x122b97,_0x7b0963){_0x122b97=_0x122b97-0x0;var _0x338a16=_0x69f8[_0x122b97];return _0x338a16;};'use strict';var Sequelize=require(_0x869f('0x0'));module[_0x869f('0x1')]={'name':{'type':Sequelize[_0x869f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x869f('0x2')]},'timeout':{'type':Sequelize[_0x869f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x869f('0x4')]('rrmemory',_0x869f('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index fa2fca7..2331641 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 _0xe130=['to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','path'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0xe130,0x94));var _0x0e13=function(_0x4607fd,_0x53c0d5){_0x4607fd=_0x4607fd-0x0;var _0x1452ed=_0xe130[_0x4607fd];return _0x1452ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e13('0x0'));var zipdir=require(_0x0e13('0x1'));var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0e13('0x5'));var sox=require('sox');var csv=require(_0x0e13('0x6'));var ejs=require(_0x0e13('0x7'));var fs=require('fs');var fs_extra=require(_0x0e13('0x8'));var _=require('lodash');var squel=require(_0x0e13('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xa'));var toCsv=require(_0x0e13('0x6'));var querystring=require(_0x0e13('0xb'));var Papa=require('papaparse');var Redis=require(_0x0e13('0xc'));var authService=require(_0x0e13('0xd'));var qs=require(_0x0e13('0xe'));var as=require(_0x0e13('0xf'));var hardwareService=require(_0x0e13('0x10'));var logger=require(_0x0e13('0x11'))(_0x0e13('0x12'));var utils=require(_0x0e13('0x13'));var config=require(_0x0e13('0x14'));var licenseUtil=require(_0x0e13('0x15'));var db=require('../../mysqldb')['db'];config[_0x0e13('0x16')]=_[_0x0e13('0x17')](config[_0x0e13('0x16')],{'host':_0x0e13('0x18'),'port':0x18eb});var socket=require(_0x0e13('0x19'))(new Redis(config['redis']));require(_0x0e13('0x1a'))[_0x0e13('0x1b')](socket);var jayson=require(_0x0e13('0x1c'));var client=jayson[_0x0e13('0x1d')][_0x0e13('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x209313,_0x2b0768,_0x28f699,_0x3a6366){return new BPromise(function(_0x43700a,_0x1eaf1c){var _0x24f9b8=_0x3a6366||client;return _0x24f9b8['request'](_0x209313,_0x28f699)[_0x0e13('0x1f')](function(_0x1d5a3c){logger[_0x0e13('0x20')](_0x0e13('0x21'),_0x2b0768,_0x0e13('0x22'));logger[_0x0e13('0x23')](_0x0e13('0x24'),_0x2b0768,_0x0e13('0x22'),JSON[_0x0e13('0x25')](_0x1d5a3c));if(_0x1d5a3c['error']){if(_0x1d5a3c['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2b0768,_0x1d5a3c[_0x0e13('0x26')][_0x0e13('0x27')]);return _0x1eaf1c(_0x1d5a3c[_0x0e13('0x26')]['message']);}logger['error'](_0x0e13('0x21'),_0x2b0768,_0x1d5a3c[_0x0e13('0x26')]['message']);return _0x43700a(_0x1d5a3c['error'][_0x0e13('0x27')]);}else{logger[_0x0e13('0x20')](_0x0e13('0x21'),_0x2b0768,_0x0e13('0x22'));_0x43700a(_0x1d5a3c[_0x0e13('0x28')]['message']);}})['catch'](function(_0x301c86){logger[_0x0e13('0x26')](_0x0e13('0x21'),_0x2b0768,_0x301c86);_0x1eaf1c(_0x301c86);});});}function respondWithStatusCode(_0x362bf0,_0x1f00ba){_0x1f00ba=_0x1f00ba||0xcc;return function(_0x5b54ac){if(_0x5b54ac){return _0x362bf0[_0x0e13('0x29')](_0x1f00ba);}return _0x362bf0[_0x0e13('0x2a')](_0x1f00ba)[_0x0e13('0x2b')]();};}function respondWithResult(_0x520f61,_0x26b33d){_0x26b33d=_0x26b33d||0xc8;return function(_0x1dfbfb){if(_0x1dfbfb){return _0x520f61[_0x0e13('0x2a')](_0x26b33d)[_0x0e13('0x2c')](_0x1dfbfb);}};}function respondWithFilteredResult(_0x40fe33,_0x4d313d){return function(_0x166d90){if(_0x166d90){var _0x402e30=typeof _0x4d313d[_0x0e13('0x2d')]===_0x0e13('0x2e')&&typeof _0x4d313d[_0x0e13('0x2f')]===_0x0e13('0x2e');var _0x435668=_0x166d90[_0x0e13('0x30')];var _0x575dad=_0x402e30?0x0:_0x4d313d[_0x0e13('0x2d')];var _0x85fd70=_0x402e30?_0x166d90[_0x0e13('0x30')]:_0x4d313d[_0x0e13('0x2d')]+_0x4d313d[_0x0e13('0x2f')];var _0x34b990;if(_0x85fd70>=_0x435668){_0x85fd70=_0x435668;_0x34b990=0xc8;}else{_0x34b990=0xce;}_0x40fe33[_0x0e13('0x2a')](_0x34b990);return _0x40fe33[_0x0e13('0x31')]('Content-Range',_0x575dad+'-'+_0x85fd70+'/'+_0x435668)[_0x0e13('0x2c')](_0x166d90);}return null;};}function patchUpdates(_0x26b62d){return function(_0x63a23c){try{jsonpatch[_0x0e13('0x32')](_0x63a23c,_0x26b62d,!![]);}catch(_0x21432b){return BPromise[_0x0e13('0x33')](_0x21432b);}return _0x63a23c[_0x0e13('0x34')]();};}function saveUpdates(_0x40a632,_0x5c4328){return function(_0x36f92e){if(_0x36f92e){return _0x36f92e[_0x0e13('0x35')](_0x40a632)[_0x0e13('0x1f')](function(_0x2e29b2){return _0x2e29b2;});}return null;};}function removeEntity(_0x3a7bb0,_0x27c31c){return function(_0x3d5fd9){if(_0x3d5fd9){return _0x3d5fd9[_0x0e13('0x36')]()['then'](function(){var _0x39b60a=_0x3d5fd9['get']({'plain':!![]});var _0x21b3c6='ChatQueues';return db[_0x0e13('0x37')][_0x0e13('0x36')]({'where':{'type':_0x21b3c6,'resourceId':_0x39b60a['id']}})['then'](function(){return _0x3d5fd9;});})['then'](function(){_0x3a7bb0[_0x0e13('0x2a')](0xcc)[_0x0e13('0x2b')]();});}};}function handleEntityNotFound(_0x174bea,_0x43ed48){return function(_0x31aa2a){if(!_0x31aa2a){_0x174bea[_0x0e13('0x29')](0x194);}return _0x31aa2a;};}function handleError(_0x39054c,_0x31d636){_0x31d636=_0x31d636||0x1f4;return function(_0x573bf7){logger[_0x0e13('0x26')](_0x573bf7[_0x0e13('0x38')]);if(_0x573bf7[_0x0e13('0x39')]){delete _0x573bf7[_0x0e13('0x39')];}_0x39054c[_0x0e13('0x2a')](_0x31d636)[_0x0e13('0x3a')](_0x573bf7);};}exports[_0x0e13('0x3b')]=function(_0x4848d8,_0x4cc70e){var _0x5dc3dd={},_0x159914={},_0x2e448d={'count':0x0,'rows':[]};var _0x28c368=_[_0x0e13('0x3c')](db[_0x0e13('0x3d')][_0x0e13('0x3e')],function(_0x1940f4){return{'name':_0x1940f4[_0x0e13('0x3f')],'type':_0x1940f4['type'][_0x0e13('0x40')]};});_0x159914[_0x0e13('0x41')]=_[_0x0e13('0x3c')](_0x28c368,_0x0e13('0x39'));_0x159914['query']=_[_0x0e13('0x42')](_0x4848d8[_0x0e13('0x43')]);_0x159914[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x159914[_0x0e13('0x41')],_0x159914[_0x0e13('0x43')]);_0x5dc3dd[_0x0e13('0x46')]=_['intersection'](_0x159914['model'],qs[_0x0e13('0x47')](_0x4848d8['query']['fields']));_0x5dc3dd[_0x0e13('0x46')]=_0x5dc3dd['attributes'][_0x0e13('0x48')]?_0x5dc3dd[_0x0e13('0x46')]:_0x159914[_0x0e13('0x41')];if(!_0x4848d8[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x5dc3dd[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x4848d8[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x5dc3dd[_0x0e13('0x2d')]=qs['offset'](_0x4848d8['query'][_0x0e13('0x2d')]);}_0x5dc3dd['order']=qs[_0x0e13('0x4b')](_0x4848d8[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x5dc3dd[_0x0e13('0x4c')]=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x4848d8[_0x0e13('0x43')],_0x159914[_0x0e13('0x44')]),_0x28c368);if(_0x4848d8[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x5dc3dd[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x5dc3dd['where'],{'$or':_[_0x0e13('0x3c')](_0x28c368,function(_0x3f3d83){if(_0x3f3d83[_0x0e13('0x50')]!==_0x0e13('0x51')){var _0x4b0b18={};_0x4b0b18[_0x3f3d83[_0x0e13('0x39')]]={'$like':'%'+_0x4848d8[_0x0e13('0x43')]['filter']+'%'};return _0x4b0b18;}})});}_0x5dc3dd=_[_0x0e13('0x4f')]({},_0x5dc3dd,_0x4848d8['options']);var _0x166b4d={'where':_0x5dc3dd[_0x0e13('0x4c')]};return db['ChatQueue'][_0x0e13('0x30')](_0x166b4d)[_0x0e13('0x1f')](function(_0x8ce237){_0x2e448d[_0x0e13('0x30')]=_0x8ce237;if(_0x4848d8[_0x0e13('0x43')][_0x0e13('0x52')]){_0x5dc3dd['include']=[{'all':!![]}];}return db[_0x0e13('0x3d')][_0x0e13('0x53')](_0x5dc3dd);})[_0x0e13('0x1f')](function(_0x3b495c){_0x2e448d['rows']=_0x3b495c;return _0x2e448d;})['then'](respondWithFilteredResult(_0x4cc70e,_0x5dc3dd))[_0x0e13('0x54')](handleError(_0x4cc70e,null));};exports['show']=function(_0x2d5154,_0x594910){var _0x3df5c9={'raw':!![],'where':{'id':_0x2d5154[_0x0e13('0x55')]['id']}},_0x28d4ad={};_0x28d4ad[_0x0e13('0x41')]=_[_0x0e13('0x42')](db['ChatQueue'][_0x0e13('0x3e')]);_0x28d4ad[_0x0e13('0x43')]=_[_0x0e13('0x42')](_0x2d5154[_0x0e13('0x43')]);_0x28d4ad[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x28d4ad[_0x0e13('0x41')],_0x28d4ad['query']);_0x3df5c9[_0x0e13('0x46')]=_[_0x0e13('0x45')](_0x28d4ad[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2d5154[_0x0e13('0x43')][_0x0e13('0x47')]));_0x3df5c9[_0x0e13('0x46')]=_0x3df5c9[_0x0e13('0x46')][_0x0e13('0x48')]?_0x3df5c9[_0x0e13('0x46')]:_0x28d4ad[_0x0e13('0x41')];if(_0x2d5154[_0x0e13('0x43')][_0x0e13('0x52')]){_0x3df5c9[_0x0e13('0x56')]=[{'all':!![]}];}_0x3df5c9=_['merge']({},_0x3df5c9,_0x2d5154[_0x0e13('0x57')]);return db[_0x0e13('0x3d')][_0x0e13('0x58')](_0x3df5c9)[_0x0e13('0x1f')](handleEntityNotFound(_0x594910,null))[_0x0e13('0x1f')](respondWithResult(_0x594910,null))[_0x0e13('0x54')](handleError(_0x594910,null));};exports['create']=function(_0xa140a2,_0x1730e2){return db[_0x0e13('0x3d')][_0x0e13('0x59')](_0xa140a2[_0x0e13('0x5a')],{})[_0x0e13('0x1f')](function(_0x306962){var _0x591e59=_0xa140a2[_0x0e13('0x5b')][_0x0e13('0x5c')]({'plain':!![]});if(!_0x591e59)throw new Error(_0x0e13('0x5d'));if(_0x591e59[_0x0e13('0x5e')]==='user'){var _0x14bdd8=_0x306962[_0x0e13('0x5c')]({'plain':!![]});var _0x35585a=_0x0e13('0x5f');return db['UserProfileSection'][_0x0e13('0x58')]({'where':{'name':_0x35585a,'userProfileId':_0x591e59['userProfileId']},'raw':!![]})[_0x0e13('0x1f')](function(_0xf2389b){if(_0xf2389b&&_0xf2389b[_0x0e13('0x60')]===0x0){return db[_0x0e13('0x37')][_0x0e13('0x59')]({'name':_0x14bdd8[_0x0e13('0x39')],'resourceId':_0x14bdd8['id'],'type':_0xf2389b['name'],'sectionId':_0xf2389b['id']},{})[_0x0e13('0x1f')](function(){return _0x306962;});}else{return _0x306962;}})[_0x0e13('0x54')](function(_0x503d01){logger['error'](_0x0e13('0x61'),_0x503d01);throw _0x503d01;});}return _0x306962;})[_0x0e13('0x1f')](respondWithResult(_0x1730e2,0xc9))[_0x0e13('0x54')](handleError(_0x1730e2,null));};exports['update']=function(_0x7826e,_0x2740ba){if(_0x7826e[_0x0e13('0x5a')]['id']){delete _0x7826e['body']['id'];}return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x7826e[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x2740ba,null))[_0x0e13('0x1f')](saveUpdates(_0x7826e['body'],null))[_0x0e13('0x1f')](respondWithResult(_0x2740ba,null))['catch'](handleError(_0x2740ba,null));};exports[_0x0e13('0x36')]=function(_0x4ee433,_0xe0cc64){return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x4ee433[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0xe0cc64,null))[_0x0e13('0x1f')](removeEntity(_0xe0cc64,null))[_0x0e13('0x54')](handleError(_0xe0cc64,null));};exports[_0x0e13('0x62')]=function(_0x5610f5,_0x58dc47){return db[_0x0e13('0x3d')][_0x0e13('0x62')]()[_0x0e13('0x1f')](respondWithResult(_0x58dc47,null))[_0x0e13('0x54')](handleError(_0x58dc47,null));};exports[_0x0e13('0x63')]=function(_0x410f39,_0x2c799d,_0x3a7092){var _0x31ff72={'raw':!![],'where':{}},_0x36921c={},_0x48a221;return db[_0x0e13('0x3d')]['findOne']({'where':{'id':_0x410f39[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x2c799d,null))[_0x0e13('0x1f')](function(_0x21bba6){if(_0x21bba6){_0x48a221=_0x21bba6['get']({'plain':!![]});_0x36921c[_0x0e13('0x41')]=_['keys'](db[_0x0e13('0x64')][_0x0e13('0x3e')]);_0x36921c[_0x0e13('0x43')]=_['keys'](_0x410f39[_0x0e13('0x43')]);_0x36921c[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x36921c[_0x0e13('0x41')],_0x36921c[_0x0e13('0x43')]);_0x31ff72[_0x0e13('0x46')]=_[_0x0e13('0x45')](_0x36921c['model'],qs[_0x0e13('0x47')](_0x410f39['query']['fields']));_0x31ff72['attributes']=_0x31ff72[_0x0e13('0x46')][_0x0e13('0x48')]?_0x31ff72[_0x0e13('0x46')]:_0x36921c[_0x0e13('0x41')];if(!_0x410f39[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x31ff72['limit']=qs[_0x0e13('0x2f')](_0x410f39[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x31ff72[_0x0e13('0x2d')]=qs[_0x0e13('0x2d')](_0x410f39[_0x0e13('0x43')]['offset']);}_0x31ff72[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x410f39[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x31ff72[_0x0e13('0x4c')]=qs['filters'](_['pick'](_0x410f39[_0x0e13('0x43')],_0x36921c[_0x0e13('0x44')]));_0x31ff72[_0x0e13('0x4c')][_0x0e13('0x66')]=_0x21bba6['id'];if(_0x410f39[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x31ff72[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x31ff72[_0x0e13('0x4c')],{'$or':_[_0x0e13('0x3c')](_0x31ff72['attributes'],function(_0x1351b3){var _0x26241d={};_0x26241d[_0x1351b3]={'$like':'%'+_0x410f39[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0x26241d;})});}_0x31ff72=_['merge']({},_0x31ff72,_0x410f39[_0x0e13('0x57')]);return db[_0x0e13('0x64')][_0x0e13('0x53')](_0x31ff72);}})['then'](function(_0x426e0f){if(_0x426e0f){return db[_0x0e13('0x67')][_0x0e13('0x68')]({'where':{'id':_[_0x0e13('0x3c')](_0x426e0f,_0x0e13('0x69')),'role':_0x0e13('0x6a')},'attributes':['id',_0x0e13('0x39'),'chatPause',_0x0e13('0x6b'),_0x0e13('0x6c')]});}})[_0x0e13('0x1f')](function(_0x1e7522){if(_0x1e7522){return{'count':_0x1e7522[_0x0e13('0x30')],'rows':_[_0x0e13('0x3c')](_0x1e7522['rows'],function(_0x149795){return{'membername':_0x149795['name'],'UserId':_0x149795['id'],'queue_name':_0x48a221[_0x0e13('0x39')],'ChatQueueId':_0x48a221['id'],'interface':util[_0x0e13('0x6d')](_0x0e13('0x6e'),_0x0e13('0x6f'),_0x149795[_0x0e13('0x39')]),'penalty':0x0,'paused':_0x149795[_0x0e13('0x70')],'createdAt':_0x149795[_0x0e13('0x6c')],'updatedAt':_0x149795[_0x0e13('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c799d,_0x31ff72))['catch'](handleError(_0x2c799d,null));};exports[_0x0e13('0x71')]=function(_0x2a58c7,_0x5c02a8,_0x25a0e5){var _0x56eda9={};var _0x5d0a82={};var _0x36b5d9;var _0x26e14b;return db[_0x0e13('0x3d')][_0x0e13('0x72')]({'where':{'id':_0x2a58c7[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x5c02a8,null))['then'](function(_0x4edd43){if(_0x4edd43){_0x36b5d9=_0x4edd43;_0x5d0a82['model']=_[_0x0e13('0x42')](db[_0x0e13('0x73')][_0x0e13('0x3e')]);_0x5d0a82[_0x0e13('0x43')]=_[_0x0e13('0x42')](_0x2a58c7[_0x0e13('0x43')]);_0x5d0a82[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x5d0a82[_0x0e13('0x41')],_0x5d0a82[_0x0e13('0x43')]);_0x56eda9['attributes']=_[_0x0e13('0x45')](_0x5d0a82[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x47')]));_0x56eda9['attributes']=_0x56eda9[_0x0e13('0x46')][_0x0e13('0x48')]?_0x56eda9['attributes']:_0x5d0a82['model'];_0x56eda9[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x56eda9['where']=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x2a58c7[_0x0e13('0x43')],_0x5d0a82[_0x0e13('0x44')]));if(_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x56eda9[_0x0e13('0x4c')]=_['merge'](_0x56eda9[_0x0e13('0x4c')],{'$or':_[_0x0e13('0x3c')](_0x56eda9[_0x0e13('0x46')],function(_0x403641){var _0xff10bc={};_0xff10bc[_0x403641]={'$like':'%'+_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0xff10bc;})});}_0x56eda9=_[_0x0e13('0x4f')]({},_0x56eda9,_0x2a58c7[_0x0e13('0x57')]);return _0x36b5d9[_0x0e13('0x71')](_0x56eda9);}})[_0x0e13('0x1f')](function(_0x382897){if(_0x382897){_0x26e14b=_0x382897[_0x0e13('0x48')];if(!_0x2a58c7['query'][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x56eda9[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x56eda9[_0x0e13('0x2d')]=qs[_0x0e13('0x2d')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x2d')]);}return _0x36b5d9[_0x0e13('0x71')](_0x56eda9);}})[_0x0e13('0x1f')](function(_0x31eb07){if(_0x31eb07){return _0x31eb07?{'count':_0x26e14b,'rows':_0x31eb07}:null;}})[_0x0e13('0x1f')](respondWithResult(_0x5c02a8,null))['catch'](handleError(_0x5c02a8,null));};exports[_0x0e13('0x74')]=function(_0x4a74ce,_0x4c4228,_0x4f67a2){var _0x2dbf20=_0x4a74ce[_0x0e13('0x5a')][_0x0e13('0x75')];return db[_0x0e13('0x73')]['findAll']({'where':{'id':_0x2dbf20},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e13('0x76'),'attributes':['id',_0x0e13('0x39'),_0x0e13('0x77'),_0x0e13('0x78'),_0x0e13('0x79')],'raw':!![]}]})[_0x0e13('0x1f')](function(_0x2891f3){if(_0x2891f3){var _0x165db1=_[_0x0e13('0x7a')](_0x2891f3,function(_0x5a6a3d){var _0x44e022=_0x5a6a3d[_0x0e13('0x5c')]({'plain':!![]});return _0x44e022['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x4a74ce[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](function(_0x400d90){return db[_0x0e13('0x7b')][_0x0e13('0x7c')](function(_0x25fff1){return _0x400d90[_0x0e13('0x74')](_0x2dbf20,{'transaction':_0x25fff1})[_0x0e13('0x1f')](function(){return BPromise[_0x0e13('0x7d')](_0x165db1,function(_0x36d7b2){return db['UserChatQueue'][_0x0e13('0x7e')]({'where':{'UserId':_0x36d7b2['id'],'ChatQueueId':_0x4a74ce[_0x0e13('0x55')]['id']},'transaction':_0x25fff1});});})[_0x0e13('0x1f')](function(){_0x165db1[_0x0e13('0x7f')](function(_0x37a25e){socket[_0x0e13('0x80')](_0x0e13('0x81'),{'UserId':_0x37a25e['id'],'ChatQueueId':_0x400d90['id']});});});});});}})[_0x0e13('0x1f')](respondWithStatusCode(_0x4c4228,null))['catch'](handleError(_0x4c4228,null));};exports[_0x0e13('0x82')]=function(_0x5645c8,_0x4ce16d,_0xe6bd31){return db[_0x0e13('0x73')][_0x0e13('0x53')]({'where':{'id':_0x5645c8['query'][_0x0e13('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0e13('0x67')],'as':_0x0e13('0x76'),'attributes':['id'],'raw':!![]}]})[_0x0e13('0x1f')](handleEntityNotFound(_0x4ce16d,null))[_0x0e13('0x1f')](function(_0x1aca9b){var _0x1e1cd0=_[_0x0e13('0x3c')](_0x1aca9b,'id');var _0x201cf1=[];var _0x36d270=[];var _0x3576be=squel[_0x0e13('0x83')]();_0x3576be[_0x0e13('0x84')](_0x0e13('0x85'))[_0x0e13('0x86')](_0x0e13('0x87'),'tq')['join'](_0x0e13('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0e13('0x4c')](_0x0e13('0x89'),_0x5645c8[_0x0e13('0x55')]['id']);for(var _0x2618dc=0x0;_0x2618dc<_0x1aca9b['length'];_0x2618dc+=0x1){let _0x1f7a35=_0x1aca9b[_0x2618dc];for(var _0x13bb89=0x0;_0x13bb89<_0x1f7a35[_0x0e13('0x76')][_0x0e13('0x48')];_0x13bb89+=0x1){let _0x1e057e=_0x1f7a35[_0x0e13('0x76')][_0x13bb89];var _0x208edf=_0x3576be[_0x0e13('0x8a')]();_0x208edf[_0x0e13('0x4c')](_0x0e13('0x8b'),_0x1e057e['id']);_0x36d270[_0x0e13('0x8c')](db[_0x0e13('0x7b')]['query'](_0x208edf[_0x0e13('0x8d')](),{'type':db[_0x0e13('0x7b')]['QueryTypes'][_0x0e13('0x8e')]})[_0x0e13('0x1f')](function(_0x3f6b26){if(_0x3f6b26[_0x0e13('0x48')]===0x1){return _0x1e057e['id'];}else{var _0x54d955=_['every'](_[_0x0e13('0x3c')](_0x3f6b26,_0x0e13('0x8f')),function(_0x1fc1b9){return _['includes'](_0x1e1cd0,_0x1fc1b9);});if(_0x54d955){return _0x1e057e['id'];}}}));}}return BPromise[_0x0e13('0x90')](_0x36d270)[_0x0e13('0x1f')](function(_0x3ef2db){_0x201cf1=_(_0x201cf1)[_0x0e13('0x91')](_0x3ef2db)['compact']()[_0x0e13('0x92')]();return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x5645c8[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](function(_0x4bcf6e){return db['sequelize'][_0x0e13('0x7c')](function(_0x59afe7){return _0x4bcf6e['removeTeams'](_0x5645c8[_0x0e13('0x43')]['ids'],{'transaction':_0x59afe7})[_0x0e13('0x1f')](function(){if(!_[_0x0e13('0x93')](_0x201cf1)){return _0x4bcf6e[_0x0e13('0x94')](_0x201cf1,{'transaction':_0x59afe7});}})[_0x0e13('0x1f')](function(){_0x201cf1['forEach'](function(_0x1ca348){socket[_0x0e13('0x80')](_0x0e13('0x95'),{'UserId':_0x1ca348,'ChatQueueId':_0x4bcf6e['id']});});});});});});})['then'](respondWithStatusCode(_0x4ce16d,null))[_0x0e13('0x54')](handleError(_0x4ce16d,null));};exports['addAgents']=function(_0x4e2340,_0x261337,_0x12e630){return db['ChatQueue'][_0x0e13('0x58')]({'where':{'id':_0x4e2340[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x261337,null))[_0x0e13('0x1f')](function(_0x1662d9){if(_0x1662d9){return _0x1662d9[_0x0e13('0x96')](_0x4e2340[_0x0e13('0x5a')]['ids'],_[_0x0e13('0x97')](_0x4e2340[_0x0e13('0x5a')],[_0x0e13('0x75'),'id'])||{})[_0x0e13('0x98')](function(_0x3a2f86){for(var _0x200b25=0x0;_0x200b25<_0x4e2340[_0x0e13('0x5a')][_0x0e13('0x75')][_0x0e13('0x48')];_0x200b25+=0x1){socket[_0x0e13('0x80')](_0x0e13('0x81'),{'UserId':Number(_0x4e2340['body']['ids'][_0x200b25]),'ChatQueueId':Number(_0x4e2340[_0x0e13('0x55')]['id'])});}return _0x3a2f86;});}})[_0x0e13('0x1f')](respondWithResult(_0x261337,null))[_0x0e13('0x54')](handleError(_0x261337,null));};exports['removeAgents']=function(_0xad0494,_0x2ae831,_0x4bc2ac){return db['ChatQueue']['find']({'where':{'id':_0xad0494['params']['id']}})['then'](handleEntityNotFound(_0x2ae831,null))[_0x0e13('0x1f')](function(_0x18a0b3){if(_0x18a0b3){return _0x18a0b3[_0x0e13('0x94')](_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')])['then'](function(){if(_['isArray'](_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')])){for(var _0x1ff884=0x0;_0x1ff884<_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')][_0x0e13('0x48')];_0x1ff884+=0x1){socket['emit'](_0x0e13('0x95'),{'UserId':Number(_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')][_0x1ff884]),'ChatQueueId':Number(_0xad0494[_0x0e13('0x55')]['id'])});}}else{socket[_0x0e13('0x80')]('userChatQueue:remove',{'UserId':Number(_0xad0494['query'][_0x0e13('0x75')]),'ChatQueueId':Number(_0xad0494[_0x0e13('0x55')]['id'])});}});}})[_0x0e13('0x1f')](respondWithStatusCode(_0x2ae831,null))['catch'](handleError(_0x2ae831,null));};exports[_0x0e13('0x99')]=function(_0x2be267,_0x373be8,_0x166004){var _0x450ace={};var _0xb0b82b={};var _0x366b4e;var _0x407011;return db['ChatQueue'][_0x0e13('0x72')]({'where':{'id':_0x2be267['params']['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x373be8,null))[_0x0e13('0x1f')](function(_0x32a999){if(_0x32a999){_0x366b4e=_0x32a999;_0xb0b82b[_0x0e13('0x41')]=_[_0x0e13('0x42')](db[_0x0e13('0x67')][_0x0e13('0x3e')]);_0xb0b82b['query']=_[_0x0e13('0x42')](_0x2be267[_0x0e13('0x43')]);_0xb0b82b[_0x0e13('0x44')]=_['intersection'](_0xb0b82b[_0x0e13('0x41')],_0xb0b82b[_0x0e13('0x43')]);_0x450ace[_0x0e13('0x46')]=_['intersection'](_0xb0b82b[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2be267[_0x0e13('0x43')][_0x0e13('0x47')]));_0x450ace['attributes']=_0x450ace[_0x0e13('0x46')][_0x0e13('0x48')]?_0x450ace[_0x0e13('0x46')]:_0xb0b82b[_0x0e13('0x41')];_0x450ace[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x2be267['query']['sort']);_0x450ace[_0x0e13('0x4c')]=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x2be267[_0x0e13('0x43')],_0xb0b82b[_0x0e13('0x44')]));if(_0x2be267[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x450ace[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x450ace['where'],{'$or':_['map'](_0x450ace[_0x0e13('0x46')],function(_0xa4c983){var _0x280b8b={};_0x280b8b[_0xa4c983]={'$like':'%'+_0x2be267[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0x280b8b;})});}_0x450ace=_[_0x0e13('0x4f')]({},_0x450ace,_0x2be267[_0x0e13('0x57')]);return _0x366b4e['getAgents'](_0x450ace);}})[_0x0e13('0x1f')](function(_0x1ac2a6){if(_0x1ac2a6){_0x407011=_0x1ac2a6[_0x0e13('0x48')];if(!_0x2be267[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x450ace[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x2be267[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x450ace['offset']=qs['offset'](_0x2be267['query'][_0x0e13('0x2d')]);}return _0x366b4e[_0x0e13('0x99')](_0x450ace);}})[_0x0e13('0x1f')](function(_0x2fe6e3){if(_0x2fe6e3){return _0x2fe6e3?{'count':_0x407011,'rows':_0x2fe6e3}:null;}})[_0x0e13('0x1f')](respondWithResult(_0x373be8,null))[_0x0e13('0x54')](handleError(_0x373be8,null));};
\ No newline at end of file
+var _0xb49a=['includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','voicePause','Agents','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','field','from','ut.UserId\x20=\x20?','push','QueryTypes','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','User','rimraf','request-promise','moment','mustache','util','path','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','end','stack','name','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xb49a,0xc8));var _0xab49=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0xb49a[_0x4dbdda];return _0x1acbf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xab49('0x3'));var util=require(_0xab49('0x4'));var path=require(_0xab49('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab49('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xab49('0x7'));var jsforce=require(_0xab49('0x8'));var deskjs=require(_0xab49('0x9'));var toCsv=require('to-csv');var querystring=require(_0xab49('0xa'));var Papa=require(_0xab49('0xb'));var Redis=require(_0xab49('0xc'));var authService=require(_0xab49('0xd'));var qs=require(_0xab49('0xe'));var as=require(_0xab49('0xf'));var hardwareService=require(_0xab49('0x10'));var logger=require('../../config/logger')(_0xab49('0x11'));var utils=require(_0xab49('0x12'));var config=require(_0xab49('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xab49('0x14')](config[_0xab49('0x15')],{'host':_0xab49('0x16'),'port':0x18eb});var socket=require(_0xab49('0x17'))(new Redis(config['redis']));require(_0xab49('0x18'))[_0xab49('0x19')](socket);var jayson=require(_0xab49('0x1a'));var client=jayson[_0xab49('0x1b')][_0xab49('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x35d8e8,_0x2027da,_0x55483d,_0x1096fd){return new BPromise(function(_0x3718a8,_0x5b60de){var _0x568ac6=_0x1096fd||client;return _0x568ac6[_0xab49('0x1d')](_0x35d8e8,_0x55483d)[_0xab49('0x1e')](function(_0x252ece){logger[_0xab49('0x1f')](_0xab49('0x20'),_0x2027da,_0xab49('0x21'));logger[_0xab49('0x22')](_0xab49('0x23'),_0x2027da,'request\x20sent',JSON['stringify'](_0x252ece));if(_0x252ece[_0xab49('0x24')]){if(_0x252ece[_0xab49('0x24')][_0xab49('0x25')]===0x1f4){logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x252ece[_0xab49('0x24')][_0xab49('0x26')]);return _0x5b60de(_0x252ece['error']['message']);}logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x252ece[_0xab49('0x24')][_0xab49('0x26')]);return _0x3718a8(_0x252ece['error'][_0xab49('0x26')]);}else{logger['info'](_0xab49('0x20'),_0x2027da,'request\x20sent');_0x3718a8(_0x252ece[_0xab49('0x27')][_0xab49('0x26')]);}})['catch'](function(_0x3f987f){logger[_0xab49('0x24')](_0xab49('0x20'),_0x2027da,_0x3f987f);_0x5b60de(_0x3f987f);});});}function respondWithStatusCode(_0x2ad20e,_0x485ebe){_0x485ebe=_0x485ebe||0xcc;return function(_0x3bd0c1){if(_0x3bd0c1){return _0x2ad20e[_0xab49('0x28')](_0x485ebe);}return _0x2ad20e[_0xab49('0x29')](_0x485ebe)['end']();};}function respondWithResult(_0x24c47f,_0x13869b){_0x13869b=_0x13869b||0xc8;return function(_0x33306b){if(_0x33306b){return _0x24c47f[_0xab49('0x29')](_0x13869b)[_0xab49('0x2a')](_0x33306b);}};}function respondWithFilteredResult(_0x4c02e2,_0x36c3ac){return function(_0x449448){if(_0x449448){var _0x602234=typeof _0x36c3ac[_0xab49('0x2b')]===_0xab49('0x2c')&&typeof _0x36c3ac['limit']===_0xab49('0x2c');var _0x513bef=_0x449448['count'];var _0x55e7e1=_0x602234?0x0:_0x36c3ac[_0xab49('0x2b')];var _0x2e5707=_0x602234?_0x449448[_0xab49('0x2d')]:_0x36c3ac['offset']+_0x36c3ac[_0xab49('0x2e')];var _0xa96fcb;if(_0x2e5707>=_0x513bef){_0x2e5707=_0x513bef;_0xa96fcb=0xc8;}else{_0xa96fcb=0xce;}_0x4c02e2['status'](_0xa96fcb);return _0x4c02e2[_0xab49('0x2f')](_0xab49('0x30'),_0x55e7e1+'-'+_0x2e5707+'/'+_0x513bef)[_0xab49('0x2a')](_0x449448);}return null;};}function patchUpdates(_0x43ec41){return function(_0x4de9e6){try{jsonpatch['apply'](_0x4de9e6,_0x43ec41,!![]);}catch(_0x127187){return BPromise[_0xab49('0x31')](_0x127187);}return _0x4de9e6[_0xab49('0x32')]();};}function saveUpdates(_0x394096,_0x505a91){return function(_0x6b14ab){if(_0x6b14ab){return _0x6b14ab['update'](_0x394096)['then'](function(_0x44e4f2){return _0x44e4f2;});}return null;};}function removeEntity(_0x3e84d2,_0xbfd8b5){return function(_0x92b20b){if(_0x92b20b){return _0x92b20b[_0xab49('0x33')]()[_0xab49('0x1e')](function(){var _0x1aaaab=_0x92b20b[_0xab49('0x34')]({'plain':!![]});var _0x482255=_0xab49('0x35');return db[_0xab49('0x36')][_0xab49('0x33')]({'where':{'type':_0x482255,'resourceId':_0x1aaaab['id']}})[_0xab49('0x1e')](function(){return _0x92b20b;});})[_0xab49('0x1e')](function(){_0x3e84d2[_0xab49('0x29')](0xcc)[_0xab49('0x37')]();});}};}function handleEntityNotFound(_0x48f92a,_0x50c690){return function(_0x29bb10){if(!_0x29bb10){_0x48f92a[_0xab49('0x28')](0x194);}return _0x29bb10;};}function handleError(_0x25a2c4,_0x244cad){_0x244cad=_0x244cad||0x1f4;return function(_0x203869){logger['error'](_0x203869[_0xab49('0x38')]);if(_0x203869['name']){delete _0x203869[_0xab49('0x39')];}_0x25a2c4[_0xab49('0x29')](_0x244cad)['send'](_0x203869);};}exports['index']=function(_0x29ad4b,_0x1b1368){var _0x23c91d={},_0xe99896={},_0x4c7da9={'count':0x0,'rows':[]};var _0x12ce43=_[_0xab49('0x3a')](db[_0xab49('0x3b')][_0xab49('0x3c')],function(_0x586ea5){return{'name':_0x586ea5['fieldName'],'type':_0x586ea5[_0xab49('0x3d')][_0xab49('0x3e')]};});_0xe99896[_0xab49('0x3f')]=_['map'](_0x12ce43,_0xab49('0x39'));_0xe99896[_0xab49('0x40')]=_[_0xab49('0x41')](_0x29ad4b[_0xab49('0x40')]);_0xe99896[_0xab49('0x42')]=_[_0xab49('0x43')](_0xe99896[_0xab49('0x3f')],_0xe99896['query']);_0x23c91d[_0xab49('0x44')]=_['intersection'](_0xe99896[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x45')]));_0x23c91d[_0xab49('0x44')]=_0x23c91d['attributes'][_0xab49('0x46')]?_0x23c91d[_0xab49('0x44')]:_0xe99896[_0xab49('0x3f')];if(!_0x29ad4b[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x23c91d[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x2e')]);_0x23c91d[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x29ad4b[_0xab49('0x40')][_0xab49('0x2b')]);}_0x23c91d['order']=qs['sort'](_0x29ad4b[_0xab49('0x40')][_0xab49('0x49')]);_0x23c91d[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x29ad4b[_0xab49('0x40')],_0xe99896[_0xab49('0x42')]),_0x12ce43);if(_0x29ad4b[_0xab49('0x40')][_0xab49('0x4c')]){_0x23c91d['where']=_[_0xab49('0x4d')](_0x23c91d['where'],{'$or':_['map'](_0x12ce43,function(_0x18da78){if(_0x18da78[_0xab49('0x3d')]!==_0xab49('0x4e')){var _0xbf41bf={};_0xbf41bf[_0x18da78[_0xab49('0x39')]]={'$like':'%'+_0x29ad4b['query'][_0xab49('0x4c')]+'%'};return _0xbf41bf;}})});}_0x23c91d=_['merge']({},_0x23c91d,_0x29ad4b[_0xab49('0x4f')]);var _0x165862={'where':_0x23c91d[_0xab49('0x4a')]};return db[_0xab49('0x3b')][_0xab49('0x2d')](_0x165862)[_0xab49('0x1e')](function(_0x3f396c){_0x4c7da9[_0xab49('0x2d')]=_0x3f396c;if(_0x29ad4b['query'][_0xab49('0x50')]){_0x23c91d['include']=[{'all':!![]}];}return db[_0xab49('0x3b')][_0xab49('0x51')](_0x23c91d);})[_0xab49('0x1e')](function(_0x3e24d4){_0x4c7da9[_0xab49('0x52')]=_0x3e24d4;return _0x4c7da9;})[_0xab49('0x1e')](respondWithFilteredResult(_0x1b1368,_0x23c91d))[_0xab49('0x53')](handleError(_0x1b1368,null));};exports[_0xab49('0x54')]=function(_0x2d0142,_0x34d3fa){var _0x3882b7={'raw':!![],'where':{'id':_0x2d0142[_0xab49('0x55')]['id']}},_0x40a1c2={};_0x40a1c2[_0xab49('0x3f')]=_[_0xab49('0x41')](db[_0xab49('0x3b')]['rawAttributes']);_0x40a1c2['query']=_[_0xab49('0x41')](_0x2d0142[_0xab49('0x40')]);_0x40a1c2['filters']=_[_0xab49('0x43')](_0x40a1c2[_0xab49('0x3f')],_0x40a1c2[_0xab49('0x40')]);_0x3882b7['attributes']=_[_0xab49('0x43')](_0x40a1c2[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x2d0142[_0xab49('0x40')]['fields']));_0x3882b7[_0xab49('0x44')]=_0x3882b7[_0xab49('0x44')][_0xab49('0x46')]?_0x3882b7[_0xab49('0x44')]:_0x40a1c2[_0xab49('0x3f')];if(_0x2d0142['query']['includeAll']){_0x3882b7[_0xab49('0x56')]=[{'all':!![]}];}_0x3882b7=_[_0xab49('0x4d')]({},_0x3882b7,_0x2d0142[_0xab49('0x4f')]);return db[_0xab49('0x3b')][_0xab49('0x57')](_0x3882b7)[_0xab49('0x1e')](handleEntityNotFound(_0x34d3fa,null))[_0xab49('0x1e')](respondWithResult(_0x34d3fa,null))[_0xab49('0x53')](handleError(_0x34d3fa,null));};exports[_0xab49('0x58')]=function(_0x5b1241,_0x56122f){return db[_0xab49('0x3b')][_0xab49('0x58')](_0x5b1241[_0xab49('0x59')],{})[_0xab49('0x1e')](function(_0x356491){var _0x2f5c20=_0x5b1241[_0xab49('0x5a')][_0xab49('0x34')]({'plain':!![]});if(!_0x2f5c20)throw new Error(_0xab49('0x5b'));if(_0x2f5c20['role']==='user'){var _0x152dc0=_0x356491['get']({'plain':!![]});var _0x268238=_0xab49('0x35');return db['UserProfileSection'][_0xab49('0x57')]({'where':{'name':_0x268238,'userProfileId':_0x2f5c20[_0xab49('0x5c')]},'raw':!![]})[_0xab49('0x1e')](function(_0x2ffa2d){if(_0x2ffa2d&&_0x2ffa2d['autoAssociation']===0x0){return db['UserProfileResource'][_0xab49('0x58')]({'name':_0x152dc0[_0xab49('0x39')],'resourceId':_0x152dc0['id'],'type':_0x2ffa2d['name'],'sectionId':_0x2ffa2d['id']},{})[_0xab49('0x1e')](function(){return _0x356491;});}else{return _0x356491;}})[_0xab49('0x53')](function(_0x1ed318){logger['error'](_0xab49('0x5d'),_0x1ed318);throw _0x1ed318;});}return _0x356491;})[_0xab49('0x1e')](respondWithResult(_0x56122f,0xc9))[_0xab49('0x53')](handleError(_0x56122f,null));};exports['update']=function(_0x5cd477,_0x143eb6){if(_0x5cd477[_0xab49('0x59')]['id']){delete _0x5cd477[_0xab49('0x59')]['id'];}return db[_0xab49('0x3b')]['find']({'where':{'id':_0x5cd477[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x143eb6,null))[_0xab49('0x1e')](saveUpdates(_0x5cd477[_0xab49('0x59')],null))[_0xab49('0x1e')](respondWithResult(_0x143eb6,null))['catch'](handleError(_0x143eb6,null));};exports[_0xab49('0x33')]=function(_0x4d0e05,_0x4a91fd){return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x4d0e05[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x4a91fd,null))[_0xab49('0x1e')](removeEntity(_0x4a91fd,null))['catch'](handleError(_0x4a91fd,null));};exports['describe']=function(_0x5ba211,_0x31c046){return db[_0xab49('0x3b')][_0xab49('0x5e')]()['then'](respondWithResult(_0x31c046,null))[_0xab49('0x53')](handleError(_0x31c046,null));};exports[_0xab49('0x5f')]=function(_0x4a3346,_0x481a14,_0x2552b2){var _0x2967b6={'raw':!![],'where':{}},_0x4a0ca0={},_0xfa678;return db[_0xab49('0x3b')][_0xab49('0x60')]({'where':{'id':_0x4a3346[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x481a14,null))['then'](function(_0x5171d3){if(_0x5171d3){_0xfa678=_0x5171d3[_0xab49('0x34')]({'plain':!![]});_0x4a0ca0[_0xab49('0x3f')]=_[_0xab49('0x41')](db['UserChatQueue'][_0xab49('0x3c')]);_0x4a0ca0[_0xab49('0x40')]=_[_0xab49('0x41')](_0x4a3346[_0xab49('0x40')]);_0x4a0ca0[_0xab49('0x42')]=_[_0xab49('0x43')](_0x4a0ca0[_0xab49('0x3f')],_0x4a0ca0[_0xab49('0x40')]);_0x2967b6[_0xab49('0x44')]=_[_0xab49('0x43')](_0x4a0ca0[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x4a3346[_0xab49('0x40')]['fields']));_0x2967b6[_0xab49('0x44')]=_0x2967b6['attributes'][_0xab49('0x46')]?_0x2967b6[_0xab49('0x44')]:_0x4a0ca0[_0xab49('0x3f')];if(!_0x4a3346['query'][_0xab49('0x47')]('nolimit')){_0x2967b6[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x4a3346[_0xab49('0x40')][_0xab49('0x2e')]);_0x2967b6[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x4a3346['query'][_0xab49('0x2b')]);}_0x2967b6[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x4a3346[_0xab49('0x40')]['sort']);_0x2967b6[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x4a3346[_0xab49('0x40')],_0x4a0ca0[_0xab49('0x42')]));_0x2967b6['where'][_0xab49('0x62')]=_0x5171d3['id'];if(_0x4a3346['query'][_0xab49('0x4c')]){_0x2967b6[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x2967b6[_0xab49('0x4a')],{'$or':_[_0xab49('0x3a')](_0x2967b6[_0xab49('0x44')],function(_0x2e6303){var _0x18a095={};_0x18a095[_0x2e6303]={'$like':'%'+_0x4a3346[_0xab49('0x40')]['filter']+'%'};return _0x18a095;})});}_0x2967b6=_[_0xab49('0x4d')]({},_0x2967b6,_0x4a3346[_0xab49('0x4f')]);return db['UserChatQueue'][_0xab49('0x51')](_0x2967b6);}})['then'](function(_0x280f9f){if(_0x280f9f){return db['User'][_0xab49('0x63')]({'where':{'id':_['map'](_0x280f9f,_0xab49('0x64')),'role':_0xab49('0x65')},'attributes':['id',_0xab49('0x39'),_0xab49('0x66'),_0xab49('0x67'),'createdAt']});}})['then'](function(_0x47da69){if(_0x47da69){return{'count':_0x47da69[_0xab49('0x2d')],'rows':_[_0xab49('0x3a')](_0x47da69[_0xab49('0x52')],function(_0x25d5ac){return{'membername':_0x25d5ac[_0xab49('0x39')],'UserId':_0x25d5ac['id'],'queue_name':_0xfa678['name'],'ChatQueueId':_0xfa678['id'],'interface':util[_0xab49('0x68')](_0xab49('0x69'),_0xab49('0x6a'),_0x25d5ac['name']),'penalty':0x0,'paused':_0x25d5ac[_0xab49('0x66')],'createdAt':_0x25d5ac[_0xab49('0x6b')],'updatedAt':_0x25d5ac['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xab49('0x1e')](respondWithFilteredResult(_0x481a14,_0x2967b6))[_0xab49('0x53')](handleError(_0x481a14,null));};exports[_0xab49('0x6c')]=function(_0x250581,_0x59591d,_0x32891c){var _0x417a1f={};var _0x2f0231={};var _0xc82491;var _0x27c2b5;return db[_0xab49('0x3b')]['findOne']({'where':{'id':_0x250581['params']['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x59591d,null))[_0xab49('0x1e')](function(_0x40b66a){if(_0x40b66a){_0xc82491=_0x40b66a;_0x2f0231['model']=_[_0xab49('0x41')](db[_0xab49('0x6d')][_0xab49('0x3c')]);_0x2f0231[_0xab49('0x40')]=_[_0xab49('0x41')](_0x250581[_0xab49('0x40')]);_0x2f0231[_0xab49('0x42')]=_[_0xab49('0x43')](_0x2f0231['model'],_0x2f0231[_0xab49('0x40')]);_0x417a1f[_0xab49('0x44')]=_['intersection'](_0x2f0231[_0xab49('0x3f')],qs[_0xab49('0x45')](_0x250581[_0xab49('0x40')][_0xab49('0x45')]));_0x417a1f[_0xab49('0x44')]=_0x417a1f[_0xab49('0x44')][_0xab49('0x46')]?_0x417a1f[_0xab49('0x44')]:_0x2f0231[_0xab49('0x3f')];_0x417a1f[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x250581[_0xab49('0x40')][_0xab49('0x49')]);_0x417a1f[_0xab49('0x4a')]=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x250581[_0xab49('0x40')],_0x2f0231[_0xab49('0x42')]));if(_0x250581[_0xab49('0x40')]['filter']){_0x417a1f[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x417a1f[_0xab49('0x4a')],{'$or':_[_0xab49('0x3a')](_0x417a1f[_0xab49('0x44')],function(_0x155375){var _0x5b061e={};_0x5b061e[_0x155375]={'$like':'%'+_0x250581[_0xab49('0x40')][_0xab49('0x4c')]+'%'};return _0x5b061e;})});}_0x417a1f=_[_0xab49('0x4d')]({},_0x417a1f,_0x250581[_0xab49('0x4f')]);return _0xc82491[_0xab49('0x6c')](_0x417a1f);}})[_0xab49('0x1e')](function(_0x18b8aa){if(_0x18b8aa){_0x27c2b5=_0x18b8aa[_0xab49('0x46')];if(!_0x250581[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x417a1f[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x250581[_0xab49('0x40')]['limit']);_0x417a1f[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x250581[_0xab49('0x40')][_0xab49('0x2b')]);}return _0xc82491['getTeams'](_0x417a1f);}})[_0xab49('0x1e')](function(_0x741874){if(_0x741874){return _0x741874?{'count':_0x27c2b5,'rows':_0x741874}:null;}})[_0xab49('0x1e')](respondWithResult(_0x59591d,null))[_0xab49('0x53')](handleError(_0x59591d,null));};exports[_0xab49('0x6e')]=function(_0x17424d,_0xf7ae4e,_0x4281d2){var _0x3953c7=_0x17424d[_0xab49('0x59')][_0xab49('0x6f')];return db['Team']['findAll']({'where':{'id':_0x3953c7},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xab49('0x70'),'interface'],'raw':!![]}]})['then'](function(_0x5de209){if(_0x5de209){var _0x244c89=_['flatMap'](_0x5de209,function(_0x41c3b9){var _0x409112=_0x41c3b9[_0xab49('0x34')]({'plain':!![]});return _0x409112[_0xab49('0x71')];});return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x17424d[_0xab49('0x55')]['id']}})['then'](function(_0x17419f){return db[_0xab49('0x72')][_0xab49('0x73')](function(_0x452bdc){return _0x17419f[_0xab49('0x6e')](_0x3953c7,{'transaction':_0x452bdc})['then'](function(){return BPromise[_0xab49('0x74')](_0x244c89,function(_0x2df410){return db[_0xab49('0x75')][_0xab49('0x76')]({'where':{'UserId':_0x2df410['id'],'ChatQueueId':_0x17424d[_0xab49('0x55')]['id']},'transaction':_0x452bdc});});})[_0xab49('0x1e')](function(){_0x244c89[_0xab49('0x77')](function(_0x398c15){socket[_0xab49('0x78')](_0xab49('0x79'),{'UserId':_0x398c15['id'],'ChatQueueId':_0x17419f['id']});});});});});}})[_0xab49('0x1e')](respondWithStatusCode(_0xf7ae4e,null))['catch'](handleError(_0xf7ae4e,null));};exports['removeTeams']=function(_0x17fee8,_0xec4b97,_0x52c698){return db['Team'][_0xab49('0x51')]({'where':{'id':_0x17fee8['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xab49('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xec4b97,null))[_0xab49('0x1e')](function(_0x547ad9){var _0x4e90b1=_[_0xab49('0x3a')](_0x547ad9,'id');var _0x58dbf0=[];var _0x3e2043=[];var _0xa3fead=squel['select']();_0xa3fead[_0xab49('0x7a')]('tq.TeamId')[_0xab49('0x7b')]('team_has_chat_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xab49('0x4a')]('ChatQueueId\x20=\x20?',_0x17fee8[_0xab49('0x55')]['id']);for(var _0x25a917=0x0;_0x25a917<_0x547ad9['length'];_0x25a917+=0x1){let _0x32221c=_0x547ad9[_0x25a917];for(var _0x3f9afa=0x0;_0x3f9afa<_0x32221c['Agents'][_0xab49('0x46')];_0x3f9afa+=0x1){let _0x514f34=_0x32221c[_0xab49('0x71')][_0x3f9afa];var _0x14ae40=_0xa3fead['clone']();_0x14ae40[_0xab49('0x4a')](_0xab49('0x7c'),_0x514f34['id']);_0x3e2043[_0xab49('0x7d')](db[_0xab49('0x72')][_0xab49('0x40')](_0x14ae40['toString'](),{'type':db[_0xab49('0x72')][_0xab49('0x7e')]['SELECT']})[_0xab49('0x1e')](function(_0x2a8e79){if(_0x2a8e79[_0xab49('0x46')]===0x1){return _0x514f34['id'];}else{var _0x40fd7e=_['every'](_['map'](_0x2a8e79,'TeamId'),function(_0x22536b){return _[_0xab49('0x7f')](_0x4e90b1,_0x22536b);});if(_0x40fd7e){return _0x514f34['id'];}}}));}}return BPromise[_0xab49('0x80')](_0x3e2043)['then'](function(_0x219800){_0x58dbf0=_(_0x58dbf0)[_0xab49('0x81')](_0x219800)[_0xab49('0x82')]()[_0xab49('0x83')]();return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x17fee8[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](function(_0x1699cb){return db[_0xab49('0x72')][_0xab49('0x73')](function(_0x553e93){return _0x1699cb[_0xab49('0x84')](_0x17fee8[_0xab49('0x40')][_0xab49('0x6f')],{'transaction':_0x553e93})[_0xab49('0x1e')](function(){if(!_[_0xab49('0x85')](_0x58dbf0)){return _0x1699cb[_0xab49('0x86')](_0x58dbf0,{'transaction':_0x553e93});}})[_0xab49('0x1e')](function(){_0x58dbf0[_0xab49('0x77')](function(_0x36bffb){socket[_0xab49('0x78')](_0xab49('0x87'),{'UserId':_0x36bffb,'ChatQueueId':_0x1699cb['id']});});});});});});})['then'](respondWithStatusCode(_0xec4b97,null))[_0xab49('0x53')](handleError(_0xec4b97,null));};exports[_0xab49('0x88')]=function(_0x195177,_0x5361f6,_0x5ab220){return db[_0xab49('0x3b')][_0xab49('0x57')]({'where':{'id':_0x195177[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x5361f6,null))['then'](function(_0xf28e16){if(_0xf28e16){return _0xf28e16[_0xab49('0x88')](_0x195177[_0xab49('0x59')][_0xab49('0x6f')],_['omit'](_0x195177[_0xab49('0x59')],[_0xab49('0x6f'),'id'])||{})[_0xab49('0x89')](function(_0x4013f5){for(var _0x4b58e9=0x0;_0x4b58e9<_0x195177[_0xab49('0x59')][_0xab49('0x6f')][_0xab49('0x46')];_0x4b58e9+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x195177[_0xab49('0x59')]['ids'][_0x4b58e9]),'ChatQueueId':Number(_0x195177['params']['id'])});}return _0x4013f5;});}})[_0xab49('0x1e')](respondWithResult(_0x5361f6,null))[_0xab49('0x53')](handleError(_0x5361f6,null));};exports[_0xab49('0x86')]=function(_0x1a99af,_0x24c44e,_0x237695){return db['ChatQueue'][_0xab49('0x57')]({'where':{'id':_0x1a99af['params']['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x24c44e,null))[_0xab49('0x1e')](function(_0x59a35f){if(_0x59a35f){return _0x59a35f[_0xab49('0x86')](_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')])[_0xab49('0x1e')](function(){if(_['isArray'](_0x1a99af[_0xab49('0x40')]['ids'])){for(var _0x240dda=0x0;_0x240dda<_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')][_0xab49('0x46')];_0x240dda+=0x1){socket['emit'](_0xab49('0x87'),{'UserId':Number(_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')][_0x240dda]),'ChatQueueId':Number(_0x1a99af['params']['id'])});}}else{socket['emit'](_0xab49('0x87'),{'UserId':Number(_0x1a99af[_0xab49('0x40')][_0xab49('0x6f')]),'ChatQueueId':Number(_0x1a99af[_0xab49('0x55')]['id'])});}});}})[_0xab49('0x1e')](respondWithStatusCode(_0x24c44e,null))[_0xab49('0x53')](handleError(_0x24c44e,null));};exports[_0xab49('0x8a')]=function(_0x22d66e,_0x551b95,_0x26ec0e){var _0x584c48={};var _0x58b0d2={};var _0x99f5c8;var _0x48e99c;return db[_0xab49('0x3b')][_0xab49('0x60')]({'where':{'id':_0x22d66e[_0xab49('0x55')]['id']}})[_0xab49('0x1e')](handleEntityNotFound(_0x551b95,null))[_0xab49('0x1e')](function(_0xc4331e){if(_0xc4331e){_0x99f5c8=_0xc4331e;_0x58b0d2[_0xab49('0x3f')]=_[_0xab49('0x41')](db[_0xab49('0x8b')][_0xab49('0x3c')]);_0x58b0d2[_0xab49('0x40')]=_[_0xab49('0x41')](_0x22d66e[_0xab49('0x40')]);_0x58b0d2[_0xab49('0x42')]=_['intersection'](_0x58b0d2[_0xab49('0x3f')],_0x58b0d2[_0xab49('0x40')]);_0x584c48['attributes']=_[_0xab49('0x43')](_0x58b0d2['model'],qs[_0xab49('0x45')](_0x22d66e[_0xab49('0x40')][_0xab49('0x45')]));_0x584c48['attributes']=_0x584c48[_0xab49('0x44')][_0xab49('0x46')]?_0x584c48[_0xab49('0x44')]:_0x58b0d2[_0xab49('0x3f')];_0x584c48[_0xab49('0x61')]=qs[_0xab49('0x49')](_0x22d66e['query'][_0xab49('0x49')]);_0x584c48['where']=qs[_0xab49('0x42')](_[_0xab49('0x4b')](_0x22d66e[_0xab49('0x40')],_0x58b0d2[_0xab49('0x42')]));if(_0x22d66e[_0xab49('0x40')][_0xab49('0x4c')]){_0x584c48[_0xab49('0x4a')]=_[_0xab49('0x4d')](_0x584c48['where'],{'$or':_[_0xab49('0x3a')](_0x584c48['attributes'],function(_0x3c8bb5){var _0x5ac50f={};_0x5ac50f[_0x3c8bb5]={'$like':'%'+_0x22d66e[_0xab49('0x40')][_0xab49('0x4c')]+'%'};return _0x5ac50f;})});}_0x584c48=_[_0xab49('0x4d')]({},_0x584c48,_0x22d66e[_0xab49('0x4f')]);return _0x99f5c8[_0xab49('0x8a')](_0x584c48);}})[_0xab49('0x1e')](function(_0x6bc02b){if(_0x6bc02b){_0x48e99c=_0x6bc02b[_0xab49('0x46')];if(!_0x22d66e[_0xab49('0x40')][_0xab49('0x47')](_0xab49('0x48'))){_0x584c48[_0xab49('0x2e')]=qs[_0xab49('0x2e')](_0x22d66e[_0xab49('0x40')]['limit']);_0x584c48[_0xab49('0x2b')]=qs[_0xab49('0x2b')](_0x22d66e[_0xab49('0x40')][_0xab49('0x2b')]);}return _0x99f5c8['getAgents'](_0x584c48);}})[_0xab49('0x1e')](function(_0x4db3d0){if(_0x4db3d0){return _0x4db3d0?{'count':_0x48e99c,'rows':_0x4db3d0}:null;}})[_0xab49('0x1e')](respondWithResult(_0x551b95,null))['catch'](handleError(_0x551b95,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 2b5e7ef..485344c 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 _0xc1d9=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x4e9b9a,_0x53510c){var _0x1a7167=function(_0x3d0f53){while(--_0x3d0f53){_0x4e9b9a['push'](_0x4e9b9a['shift']());}};_0x1a7167(++_0x53510c);}(_0xc1d9,0xd7));var _0x9c1d=function(_0x97ecd,_0x1d82c1){_0x97ecd=_0x97ecd-0x0;var _0x5a0903=_0xc1d9[_0x97ecd];return _0x5a0903;};'use strict';var EventEmitter=require(_0x9c1d('0x0'));var ChatQueue=require(_0x9c1d('0x1'))['db'][_0x9c1d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9c1d('0x3')](0x0);var events={'afterCreate':_0x9c1d('0x4'),'afterUpdate':_0x9c1d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x358db5){return function(_0x3076a5,_0x165598,_0x29df1a){ChatQueueEvents[_0x9c1d('0x6')](_0x358db5+':'+_0x3076a5['id'],_0x3076a5);ChatQueueEvents[_0x9c1d('0x6')](_0x358db5,_0x3076a5);_0x29df1a(null);};}for(var e in events){if(events[_0x9c1d('0x7')](e)){var event=events[e];ChatQueue[_0x9c1d('0x8')](e,emitEvent(event));}}module[_0x9c1d('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb2b4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xb2b4,0x1b4));var _0x4b2b=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xb2b4[_0x32e649];return _0x14d386;};'use strict';var EventEmitter=require(_0x4b2b('0x0'));var ChatQueue=require(_0x4b2b('0x1'))['db'][_0x4b2b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4b2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b2b('0x4'),'afterDestroy':_0x4b2b('0x5')};function emitEvent(_0x64420){return function(_0x1aa3b8,_0x5ed07b,_0x637cd3){ChatQueueEvents[_0x4b2b('0x6')](_0x64420+':'+_0x1aa3b8['id'],_0x1aa3b8);ChatQueueEvents[_0x4b2b('0x6')](_0x64420,_0x1aa3b8);_0x637cd3(null);};}for(var e in events){if(events[_0x4b2b('0x7')](e)){var event=events[e];ChatQueue[_0x4b2b('0x8')](e,emitEvent(event));}}module[_0x4b2b('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 0003046..48528b5 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 _0xb645=['exports','define','ChatQueue','chat_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x41f0c7,_0x7e3c){var _0x37606d=function(_0x13e3fe){while(--_0x13e3fe){_0x41f0c7['push'](_0x41f0c7['shift']());}};_0x37606d(++_0x7e3c);}(_0xb645,0x154));var _0x5b64=function(_0x5ca232,_0x398303){_0x5ca232=_0x5ca232-0x0;var _0x2f98b4=_0xb645[_0x5ca232];return _0x2f98b4;};'use strict';var _=require('lodash');var util=require(_0x5b64('0x0'));var logger=require(_0x5b64('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5b64('0x2'));var rp=require(_0x5b64('0x3'));var fs=require('fs');var path=require(_0x5b64('0x4'));var rimraf=require(_0x5b64('0x5'));var config=require(_0x5b64('0x6'));var attributes=require(_0x5b64('0x7'));module[_0x5b64('0x8')]=function(_0x5a7601,_0x14f558){return _0x5a7601[_0x5b64('0x9')](_0x5b64('0xa'),attributes,{'tableName':_0x5b64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29bc=['rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3fb427,_0x1a1fe3){var _0x46d5ab=function(_0x36d81c){while(--_0x36d81c){_0x3fb427['push'](_0x3fb427['shift']());}};_0x46d5ab(++_0x1a1fe3);}(_0x29bc,0x165));var _0xc29b=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x29bc[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0xc29b('0x0'));var logger=require(_0xc29b('0x1'))(_0xc29b('0x2'));var moment=require(_0xc29b('0x3'));var BPromise=require(_0xc29b('0x4'));var rp=require(_0xc29b('0x5'));var fs=require('fs');var path=require(_0xc29b('0x6'));var rimraf=require(_0xc29b('0x7'));var config=require(_0xc29b('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc29b('0x9')]=function(_0xf5d9d6,_0x4a0703){return _0xf5d9d6[_0xc29b('0xa')](_0xc29b('0xb'),attributes,{'tableName':_0xc29b('0xc'),'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 dd3af22..5773a71 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 _0xba26=['socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetChatQueue','ShowChatQueue','ChatQueue','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xba26,0x1c9));var _0x6ba2=function(_0x55d46b,_0xbd504c){_0x55d46b=_0x55d46b-0x0;var _0x4a1f2d=_0xba26[_0x55d46b];return _0x4a1f2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ba2('0x0'));var BPromise=require(_0x6ba2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ba2('0x3'));var logger=require(_0x6ba2('0x4'))('rpc');var config=require(_0x6ba2('0x5'));var jayson=require(_0x6ba2('0x6'));var client=jayson[_0x6ba2('0x7')][_0x6ba2('0x8')]({'port':0x232a});config[_0x6ba2('0x9')]=_['defaults'](config[_0x6ba2('0x9')],{'host':_0x6ba2('0xa'),'port':0x18eb});var socket=require(_0x6ba2('0xb'))(new Redis(config[_0x6ba2('0x9')]));require(_0x6ba2('0xc'))[_0x6ba2('0xd')](socket);function respondWithRpcPromise(_0x27a505,_0x1b0e9b,_0x4b840b){return new BPromise(function(_0x192bc1,_0x37dd49){return client['request'](_0x27a505,_0x4b840b)['then'](function(_0x54574f){logger[_0x6ba2('0xe')](_0x6ba2('0xf'),_0x1b0e9b,_0x6ba2('0x10'));logger[_0x6ba2('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1b0e9b,'request\x20sent',JSON[_0x6ba2('0x12')](_0x54574f));if(_0x54574f[_0x6ba2('0x13')]){if(_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x14')]===0x1f4){logger[_0x6ba2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x1b0e9b,_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);return _0x37dd49(_0x54574f['error'][_0x6ba2('0x15')]);}logger[_0x6ba2('0x13')](_0x6ba2('0xf'),_0x1b0e9b,_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);return _0x192bc1(_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);}else{logger['info'](_0x6ba2('0xf'),_0x1b0e9b,_0x6ba2('0x10'));_0x192bc1(_0x54574f['result']['message']);}})[_0x6ba2('0x16')](function(_0x3f09f3){logger[_0x6ba2('0x13')](_0x6ba2('0xf'),_0x1b0e9b,_0x3f09f3);_0x37dd49(_0x3f09f3);});});}exports['GetChatQueue']=function(_0x56e627){var _0x256feb=this;return new Promise(function(_0x431bd2,_0x420163){return db['ChatQueue'][_0x6ba2('0x17')]({'raw':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x56e627[_0x6ba2('0x18')]?_0x56e627['options'][_0x6ba2('0x1a')]||null:null,'attributes':_0x56e627['options']?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1b')]||null:null,'limit':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1c')]||null:null,'include':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1d')]?_[_0x6ba2('0x1e')](_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1d')],function(_0x51c30c){return{'model':db[_0x51c30c[_0x6ba2('0x1f')]],'as':_0x51c30c['as'],'attributes':_0x51c30c[_0x6ba2('0x1b')],'include':_0x51c30c['include']?_['map'](_0x51c30c[_0x6ba2('0x1d')],function(_0x150688){return{'model':db[_0x150688[_0x6ba2('0x1f')]],'as':_0x150688['as'],'attributes':_0x150688['attributes'],'include':_0x150688[_0x6ba2('0x1d')]?_['map'](_0x150688[_0x6ba2('0x1d')],function(_0x3777b8){return{'model':db[_0x3777b8['model']],'as':_0x3777b8['as'],'attributes':_0x3777b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ba2('0x20')](function(_0x508cac){logger[_0x6ba2('0xe')](_0x6ba2('0x21'),_0x56e627);logger[_0x6ba2('0x11')](_0x6ba2('0x21'),_0x56e627,JSON[_0x6ba2('0x12')](_0x508cac));_0x431bd2(_0x508cac);})[_0x6ba2('0x16')](function(_0x5459c8){logger[_0x6ba2('0x13')](_0x6ba2('0x21'),_0x5459c8['message'],_0x56e627);_0x420163(_0x256feb[_0x6ba2('0x13')](0x1f4,_0x5459c8['message']));});});};exports[_0x6ba2('0x22')]=function(_0x59d6b9){var _0x589e49=this;return new Promise(function(_0x3537ec,_0x3b4674){return db[_0x6ba2('0x23')]['find']({'raw':_0x59d6b9['options']?_0x59d6b9['options']['raw']===undefined?!![]:![]:!![],'where':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1a')]||null:null,'attributes':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9['options']['attributes']||null:null,'include':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1d')]?_['map'](_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1d')],function(_0xe3b17f){return{'model':db[_0xe3b17f[_0x6ba2('0x1f')]],'as':_0xe3b17f['as'],'attributes':_0xe3b17f['attributes'],'include':_0xe3b17f['include']?_[_0x6ba2('0x1e')](_0xe3b17f[_0x6ba2('0x1d')],function(_0x565f17){return{'model':db[_0x565f17['model']],'as':_0x565f17['as'],'attributes':_0x565f17[_0x6ba2('0x1b')],'include':_0x565f17[_0x6ba2('0x1d')]?_[_0x6ba2('0x1e')](_0x565f17[_0x6ba2('0x1d')],function(_0x3fef03){return{'model':db[_0x3fef03[_0x6ba2('0x1f')]],'as':_0x3fef03['as'],'attributes':_0x3fef03[_0x6ba2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6ba2('0x20')](function(_0x3ffdc8){logger[_0x6ba2('0xe')](_0x6ba2('0x22'),_0x59d6b9);logger[_0x6ba2('0x11')](_0x6ba2('0x22'),_0x59d6b9,JSON[_0x6ba2('0x12')](_0x3ffdc8));_0x3537ec(_0x3ffdc8);})[_0x6ba2('0x16')](function(_0x495838){logger[_0x6ba2('0x13')](_0x6ba2('0x22'),_0x495838[_0x6ba2('0x15')],_0x59d6b9);_0x3b4674(_0x589e49[_0x6ba2('0x13')](0x1f4,_0x495838[_0x6ba2('0x15')]));});});};
\ No newline at end of file
+var _0xdc9c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowChatQueue','find','where','bluebird','ioredis'];(function(_0x3af6f8,_0x1e631e){var _0x1d3a09=function(_0x50f012){while(--_0x50f012){_0x3af6f8['push'](_0x3af6f8['shift']());}};_0x1d3a09(++_0x1e631e);}(_0xdc9c,0xe2));var _0xcdc9=function(_0x4ac26d,_0x42eba7){_0x4ac26d=_0x4ac26d-0x0;var _0x151b8f=_0xdc9c[_0x4ac26d];return _0x151b8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcdc9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdc9('0x1'));var db=require(_0xcdc9('0x2'))['db'];var utils=require(_0xcdc9('0x3'));var logger=require(_0xcdc9('0x4'))('rpc');var config=require(_0xcdc9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcdc9('0x6')][_0xcdc9('0x7')]({'port':0x232a});config[_0xcdc9('0x8')]=_[_0xcdc9('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcdc9('0xa'))[_0xcdc9('0xb')](socket);function respondWithRpcPromise(_0x1efa14,_0x3feb96,_0x3ee1a5){return new BPromise(function(_0x1afa92,_0x3a7cb4){return client[_0xcdc9('0xc')](_0x1efa14,_0x3ee1a5)[_0xcdc9('0xd')](function(_0x5db48d){logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));logger['debug'](_0xcdc9('0x11'),_0x3feb96,_0xcdc9('0x10'),JSON[_0xcdc9('0x12')](_0x5db48d));if(_0x5db48d[_0xcdc9('0x13')]){if(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x14')]===0x1f4){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);return _0x3a7cb4(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')]['message']);return _0x1afa92(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}else{logger['info'](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));_0x1afa92(_0x5db48d[_0xcdc9('0x16')]['message']);}})[_0xcdc9('0x17')](function(_0x39667e){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x39667e);_0x3a7cb4(_0x39667e);});});}exports[_0xcdc9('0x18')]=function(_0x216a90){var _0x36c0db=this;return new Promise(function(_0x12e828,_0x22a5fe){return db[_0xcdc9('0x19')][_0xcdc9('0x1a')]({'raw':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')]['where']||null:null,'attributes':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1d')]||null:null,'limit':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1e')]||null:null,'include':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x216a90[_0xcdc9('0x1b')]['include'],function(_0x2c565c){return{'model':db[_0x2c565c[_0xcdc9('0x21')]],'as':_0x2c565c['as'],'attributes':_0x2c565c[_0xcdc9('0x1d')],'include':_0x2c565c[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x2c565c['include'],function(_0x55545e){return{'model':db[_0x55545e[_0xcdc9('0x21')]],'as':_0x55545e['as'],'attributes':_0x55545e[_0xcdc9('0x1d')],'include':_0x55545e[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x55545e[_0xcdc9('0x1f')],function(_0x2d8c91){return{'model':db[_0x2d8c91[_0xcdc9('0x21')]],'as':_0x2d8c91['as'],'attributes':_0x2d8c91[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x464058){logger['info'](_0xcdc9('0x18'),_0x216a90);logger[_0xcdc9('0x22')](_0xcdc9('0x18'),_0x216a90,JSON[_0xcdc9('0x12')](_0x464058));_0x12e828(_0x464058);})['catch'](function(_0x1fb964){logger[_0xcdc9('0x13')](_0xcdc9('0x18'),_0x1fb964[_0xcdc9('0x15')],_0x216a90);_0x22a5fe(_0x36c0db[_0xcdc9('0x13')](0x1f4,_0x1fb964['message']));});});};exports[_0xcdc9('0x23')]=function(_0x2a30da){var _0x511d2c=this;return new Promise(function(_0x50137c,_0x329a91){return db['ChatQueue'][_0xcdc9('0x24')]({'raw':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da['options'][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x25')]||null:null,'attributes':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1d')]||null:null,'include':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')]?_['map'](_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')],function(_0x23040f){return{'model':db[_0x23040f[_0xcdc9('0x21')]],'as':_0x23040f['as'],'attributes':_0x23040f['attributes'],'include':_0x23040f[_0xcdc9('0x1f')]?_['map'](_0x23040f['include'],function(_0x50205c){return{'model':db[_0x50205c['model']],'as':_0x50205c['as'],'attributes':_0x50205c[_0xcdc9('0x1d')],'include':_0x50205c['include']?_[_0xcdc9('0x20')](_0x50205c[_0xcdc9('0x1f')],function(_0x20b75a){return{'model':db[_0x20b75a[_0xcdc9('0x21')]],'as':_0x20b75a['as'],'attributes':_0x20b75a[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x51fded){logger['info'](_0xcdc9('0x23'),_0x2a30da);logger[_0xcdc9('0x22')](_0xcdc9('0x23'),_0x2a30da,JSON['stringify'](_0x51fded));_0x50137c(_0x51fded);})[_0xcdc9('0x17')](function(_0x27d4ce){logger[_0xcdc9('0x13')]('ShowChatQueue',_0x27d4ce[_0xcdc9('0x15')],_0x2a30da);_0x329a91(_0x511d2c['error'](0x1f4,_0x27d4ce[_0xcdc9('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index dc8d940..7eb7797 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 _0x702d=['remove','update','emit','register','length','./chatQueue.events','save'];(function(_0x3008b9,_0x3ef5f1){var _0x2798c4=function(_0x5d0e99){while(--_0x5d0e99){_0x3008b9['push'](_0x3008b9['shift']());}};_0x2798c4(++_0x3ef5f1);}(_0x702d,0x147));var _0xd702=function(_0x242e1a,_0x58dbf7){_0x242e1a=_0x242e1a-0x0;var _0x40c562=_0x702d[_0x242e1a];return _0x40c562;};'use strict';var ChatQueueEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){ChatQueueEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('chatQueue:'+_0x5af246,_0x544e94);ChatQueueEvents['on'](_0x5af246,_0x12bb75);}};
\ No newline at end of file
+var _0x9c44=['emit','removeListener','length','chatQueue:','remove','update'];(function(_0x20e4c6,_0x595993){var _0x4da2c3=function(_0x29cb8b){while(--_0x29cb8b){_0x20e4c6['push'](_0x20e4c6['shift']());}};_0x4da2c3(++_0x595993);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatQueueEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatQueueEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cb10719..1fb5980 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0xbdead3,_0x3d5499){var _0x3685cf=function(_0x2071bf){while(--_0x2071bf){_0xbdead3['push'](_0xbdead3['shift']());}};_0x3685cf(++_0x3d5499);}(_0x55ca,0x126));var _0xa55c=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0x55ca[_0x1ed034];return _0x4a82b7;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c6846,_0x7d577f){var _0x5050a5=function(_0x177e12){while(--_0x177e12){_0x4c6846['push'](_0x4c6846['shift']());}};_0x5050a5(++_0x7d577f);}(_0x008c,0x188));var _0xc008=function(_0xedde59,_0x50d9b1){_0xedde59=_0xedde59-0x0;var _0x4db279=_0x008c[_0xedde59];return _0x4db279;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 0742420..c97e7c2 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 _0x99c8=['STRING','DATE','exports'];(function(_0x547030,_0x5ac365){var _0x20dd29=function(_0x138efd){while(--_0x138efd){_0x547030['push'](_0x547030['shift']());}};_0x20dd29(++_0x5ac365);}(_0x99c8,0x10d));var _0x899c=function(_0x48604b,_0x518ed1){_0x48604b=_0x48604b-0x0;var _0x874edb=_0x99c8[_0x48604b];return _0x874edb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x899c('0x0')]={'uniqueid':{'type':Sequelize[_0x899c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x899c('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x899c('0x2')]},'acceptAt':{'type':Sequelize[_0x899c('0x2')]},'exitAt':{'type':Sequelize[_0x899c('0x2')]},'reason':{'type':Sequelize[_0x899c('0x1')]}};
\ No newline at end of file
+var _0xa34e=['STRING','DATE','moment','sequelize'];(function(_0x504322,_0x1efbec){var _0x751a39=function(_0x58ef96){while(--_0x58ef96){_0x504322['push'](_0x504322['shift']());}};_0x751a39(++_0x1efbec);}(_0xa34e,0x17a));var _0xea34=function(_0x2fc1f6,_0x51543e){_0x2fc1f6=_0x2fc1f6-0x0;var _0x7a3346=_0xa34e[_0x2fc1f6];return _0x7a3346;};'use strict';var moment=require(_0xea34('0x0'));var Sequelize=require(_0xea34('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xea34('0x2')]},'joinAt':{'type':Sequelize[_0xea34('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xea34('0x3')]},'exitAt':{'type':Sequelize[_0xea34('0x3')]},'reason':{'type':Sequelize[_0xea34('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 0df36e5..0cc9f00 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 _0xa4bd=['count','set','reject','save','update','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x5b23f2,_0x9d16ef){_0x5b23f2=_0x5b23f2-0x0;var _0x19986d=_0xa4bd[_0x5b23f2];return _0x19986d;};'use strict';var emlformat=require(_0xda4b('0x0'));var rimraf=require(_0xda4b('0x1'));var zipdir=require(_0xda4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda4b('0x3'));var moment=require(_0xda4b('0x4'));var BPromise=require(_0xda4b('0x5'));var Mustache=require(_0xda4b('0x6'));var util=require(_0xda4b('0x7'));var path=require(_0xda4b('0x8'));var sox=require(_0xda4b('0x9'));var csv=require(_0xda4b('0xa'));var ejs=require(_0xda4b('0xb'));var fs=require('fs');var fs_extra=require(_0xda4b('0xc'));var _=require('lodash');var squel=require(_0xda4b('0xd'));var crypto=require(_0xda4b('0xe'));var jsforce=require(_0xda4b('0xf'));var deskjs=require(_0xda4b('0x10'));var toCsv=require('to-csv');var querystring=require(_0xda4b('0x11'));var Papa=require(_0xda4b('0x12'));var Redis=require(_0xda4b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xda4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4b('0x15'));var logger=require(_0xda4b('0x16'))(_0xda4b('0x17'));var utils=require(_0xda4b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xda4b('0x19'));var db=require(_0xda4b('0x1a'))['db'];function respondWithStatusCode(_0x2781d3,_0x2f9554){_0x2f9554=_0x2f9554||0xcc;return function(_0x2d3243){if(_0x2d3243){return _0x2781d3[_0xda4b('0x1b')](_0x2f9554);}return _0x2781d3[_0xda4b('0x1c')](_0x2f9554)[_0xda4b('0x1d')]();};}function respondWithResult(_0xb5881c,_0xb70e25){_0xb70e25=_0xb70e25||0xc8;return function(_0x4c25db){if(_0x4c25db){return _0xb5881c[_0xda4b('0x1c')](_0xb70e25)[_0xda4b('0x1e')](_0x4c25db);}};}function respondWithFilteredResult(_0xb7ec2c,_0x2fb875){return function(_0x1a3115){if(_0x1a3115){var _0x12e7fc=typeof _0x2fb875[_0xda4b('0x1f')]===_0xda4b('0x20')&&typeof _0x2fb875[_0xda4b('0x21')]===_0xda4b('0x20');var _0x30185e=_0x1a3115[_0xda4b('0x22')];var _0x5ed049=_0x12e7fc?0x0:_0x2fb875[_0xda4b('0x1f')];var _0x56c65e=_0x12e7fc?_0x1a3115['count']:_0x2fb875[_0xda4b('0x1f')]+_0x2fb875[_0xda4b('0x21')];var _0x42834c;if(_0x56c65e>=_0x30185e){_0x56c65e=_0x30185e;_0x42834c=0xc8;}else{_0x42834c=0xce;}_0xb7ec2c[_0xda4b('0x1c')](_0x42834c);return _0xb7ec2c[_0xda4b('0x23')]('Content-Range',_0x5ed049+'-'+_0x56c65e+'/'+_0x30185e)['json'](_0x1a3115);}return null;};}function patchUpdates(_0x2397de){return function(_0x139bfa){try{jsonpatch['apply'](_0x139bfa,_0x2397de,!![]);}catch(_0x2a8425){return BPromise[_0xda4b('0x24')](_0x2a8425);}return _0x139bfa[_0xda4b('0x25')]();};}function saveUpdates(_0x56566a,_0x48d8a8){return function(_0x3e9f20){if(_0x3e9f20){return _0x3e9f20[_0xda4b('0x26')](_0x56566a)[_0xda4b('0x27')](function(_0x1c57ce){return _0x1c57ce;});}return null;};}function removeEntity(_0x318d48,_0x606e86){return function(_0x108adf){if(_0x108adf){return _0x108adf[_0xda4b('0x28')]()[_0xda4b('0x27')](function(){_0x318d48[_0xda4b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6ecc,_0x5f19ef){return function(_0x3046dc){if(!_0x3046dc){_0x2f6ecc[_0xda4b('0x1b')](0x194);}return _0x3046dc;};}function handleError(_0x4a7cac,_0x5ecf1a){_0x5ecf1a=_0x5ecf1a||0x1f4;return function(_0x1b03f1){logger['error'](_0x1b03f1[_0xda4b('0x29')]);if(_0x1b03f1[_0xda4b('0x2a')]){delete _0x1b03f1[_0xda4b('0x2a')];}_0x4a7cac[_0xda4b('0x1c')](_0x5ecf1a)['send'](_0x1b03f1);};}exports[_0xda4b('0x2b')]=function(_0x1ce977,_0x18f78a){var _0x550ec4={},_0x52022b={},_0x218bb2={'count':0x0,'rows':[]};var _0x1277cc=_['map'](db[_0xda4b('0x2c')][_0xda4b('0x2d')],function(_0x5312ab){return{'name':_0x5312ab[_0xda4b('0x2e')],'type':_0x5312ab[_0xda4b('0x2f')]['key']};});_0x52022b[_0xda4b('0x30')]=_[_0xda4b('0x31')](_0x1277cc,_0xda4b('0x2a'));_0x52022b['query']=_['keys'](_0x1ce977[_0xda4b('0x32')]);_0x52022b[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x52022b['model'],_0x52022b[_0xda4b('0x32')]);_0x550ec4['attributes']=_[_0xda4b('0x34')](_0x52022b[_0xda4b('0x30')],qs['fields'](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x35')]));_0x550ec4[_0xda4b('0x36')]=_0x550ec4[_0xda4b('0x36')]['length']?_0x550ec4['attributes']:_0x52022b['model'];if(!_0x1ce977[_0xda4b('0x32')][_0xda4b('0x37')]('nolimit')){_0x550ec4['limit']=qs[_0xda4b('0x21')](_0x1ce977[_0xda4b('0x32')]['limit']);_0x550ec4[_0xda4b('0x1f')]=qs[_0xda4b('0x1f')](_0x1ce977['query'][_0xda4b('0x1f')]);}_0x550ec4[_0xda4b('0x38')]=qs[_0xda4b('0x39')](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x39')]);_0x550ec4['where']=qs[_0xda4b('0x33')](_['pick'](_0x1ce977[_0xda4b('0x32')],_0x52022b[_0xda4b('0x33')]),_0x1277cc);if(_0x1ce977['query'][_0xda4b('0x3a')]){_0x550ec4['where']=_[_0xda4b('0x3b')](_0x550ec4[_0xda4b('0x3c')],{'$or':_[_0xda4b('0x31')](_0x1277cc,function(_0x46b8e1){if(_0x46b8e1[_0xda4b('0x2f')]!==_0xda4b('0x3d')){var _0x5b7350={};_0x5b7350[_0x46b8e1[_0xda4b('0x2a')]]={'$like':'%'+_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3a')]+'%'};return _0x5b7350;}})});}_0x550ec4=_[_0xda4b('0x3b')]({},_0x550ec4,_0x1ce977[_0xda4b('0x3e')]);var _0x710929={'where':_0x550ec4['where']};return db['ChatQueueReport'][_0xda4b('0x22')](_0x710929)[_0xda4b('0x27')](function(_0x18b7bb){_0x218bb2[_0xda4b('0x22')]=_0x18b7bb;if(_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x550ec4[_0xda4b('0x40')]=[{'all':!![]}];}return db[_0xda4b('0x2c')]['findAll'](_0x550ec4);})['then'](function(_0x5a7988){_0x218bb2[_0xda4b('0x41')]=_0x5a7988;return _0x218bb2;})[_0xda4b('0x27')](respondWithFilteredResult(_0x18f78a,_0x550ec4))[_0xda4b('0x42')](handleError(_0x18f78a,null));};exports[_0xda4b('0x43')]=function(_0x1b0f58,_0x1d875b){var _0x59f5a8={'raw':!![],'where':{'id':_0x1b0f58[_0xda4b('0x44')]['id']}},_0x1b1abb={};_0x1b1abb[_0xda4b('0x30')]=_[_0xda4b('0x45')](db[_0xda4b('0x2c')][_0xda4b('0x2d')]);_0x1b1abb[_0xda4b('0x32')]=_[_0xda4b('0x45')](_0x1b0f58[_0xda4b('0x32')]);_0x1b1abb[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],_0x1b1abb[_0xda4b('0x32')]);_0x59f5a8[_0xda4b('0x36')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],qs[_0xda4b('0x35')](_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x35')]));_0x59f5a8[_0xda4b('0x36')]=_0x59f5a8[_0xda4b('0x36')]['length']?_0x59f5a8[_0xda4b('0x36')]:_0x1b1abb[_0xda4b('0x30')];if(_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x59f5a8['include']=[{'all':!![]}];}_0x59f5a8=_[_0xda4b('0x3b')]({},_0x59f5a8,_0x1b0f58[_0xda4b('0x3e')]);return db[_0xda4b('0x2c')][_0xda4b('0x46')](_0x59f5a8)[_0xda4b('0x27')](handleEntityNotFound(_0x1d875b,null))[_0xda4b('0x27')](respondWithResult(_0x1d875b,null))[_0xda4b('0x42')](handleError(_0x1d875b,null));};exports[_0xda4b('0x47')]=function(_0x633f12,_0x579261){return db[_0xda4b('0x2c')][_0xda4b('0x47')](_0x633f12[_0xda4b('0x48')],{})[_0xda4b('0x27')](respondWithResult(_0x579261,0xc9))[_0xda4b('0x42')](handleError(_0x579261,null));};exports[_0xda4b('0x26')]=function(_0x5c8aef,_0x2311be){if(_0x5c8aef[_0xda4b('0x48')]['id']){delete _0x5c8aef[_0xda4b('0x48')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5c8aef[_0xda4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2311be,null))[_0xda4b('0x27')](saveUpdates(_0x5c8aef['body'],null))[_0xda4b('0x27')](respondWithResult(_0x2311be,null))[_0xda4b('0x42')](handleError(_0x2311be,null));};exports[_0xda4b('0x28')]=function(_0x4c139e,_0x50fd28){return db[_0xda4b('0x2c')][_0xda4b('0x46')]({'where':{'id':_0x4c139e['params']['id']}})[_0xda4b('0x27')](handleEntityNotFound(_0x50fd28,null))[_0xda4b('0x27')](removeEntity(_0x50fd28,null))[_0xda4b('0x42')](handleError(_0x50fd28,null));};exports['describe']=function(_0x521cd4,_0x162d6f){return db['ChatQueueReport'][_0xda4b('0x49')]()[_0xda4b('0x27')](respondWithResult(_0x162d6f,null))[_0xda4b('0x42')](handleError(_0x162d6f,null));};
\ No newline at end of file
+var _0x0650=['path','sox','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x0650,0x1aa));var _0x0065=function(_0x40a85a,_0x5393c8){_0x40a85a=_0x40a85a-0x0;var _0x4c1213=_0x0650[_0x40a85a];return _0x4c1213;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require(_0x0065('0x1'));var zipdir=require(_0x0065('0x2'));var jsonpatch=require(_0x0065('0x3'));var rp=require('request-promise');var moment=require(_0x0065('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0065('0x5'));var path=require(_0x0065('0x6'));var sox=require(_0x0065('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0065('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0065('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0065('0xa'));var Papa=require(_0x0065('0xb'));var Redis=require('ioredis');var authService=require(_0x0065('0xc'));var qs=require(_0x0065('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0065('0xe'))(_0x0065('0xf'));var utils=require(_0x0065('0x10'));var config=require(_0x0065('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243902,_0x4e4f7a){_0x4e4f7a=_0x4e4f7a||0xcc;return function(_0x58893d){if(_0x58893d){return _0x243902[_0x0065('0x12')](_0x4e4f7a);}return _0x243902['status'](_0x4e4f7a)[_0x0065('0x13')]();};}function respondWithResult(_0x5a0bb6,_0x4db9b8){_0x4db9b8=_0x4db9b8||0xc8;return function(_0x40c8c5){if(_0x40c8c5){return _0x5a0bb6[_0x0065('0x14')](_0x4db9b8)[_0x0065('0x15')](_0x40c8c5);}};}function respondWithFilteredResult(_0x4722bf,_0x2788c3){return function(_0x16fffb){if(_0x16fffb){var _0x375861=typeof _0x2788c3[_0x0065('0x16')]==='undefined'&&typeof _0x2788c3[_0x0065('0x17')]===_0x0065('0x18');var _0x359f1f=_0x16fffb[_0x0065('0x19')];var _0x20adaa=_0x375861?0x0:_0x2788c3[_0x0065('0x16')];var _0x244937=_0x375861?_0x16fffb[_0x0065('0x19')]:_0x2788c3[_0x0065('0x16')]+_0x2788c3[_0x0065('0x17')];var _0x4bca8f;if(_0x244937>=_0x359f1f){_0x244937=_0x359f1f;_0x4bca8f=0xc8;}else{_0x4bca8f=0xce;}_0x4722bf['status'](_0x4bca8f);return _0x4722bf[_0x0065('0x1a')](_0x0065('0x1b'),_0x20adaa+'-'+_0x244937+'/'+_0x359f1f)[_0x0065('0x15')](_0x16fffb);}return null;};}function patchUpdates(_0x2efd09){return function(_0x436a85){try{jsonpatch[_0x0065('0x1c')](_0x436a85,_0x2efd09,!![]);}catch(_0x59e771){return BPromise[_0x0065('0x1d')](_0x59e771);}return _0x436a85[_0x0065('0x1e')]();};}function saveUpdates(_0x24af6c,_0x502c7a){return function(_0x1590c8){if(_0x1590c8){return _0x1590c8['update'](_0x24af6c)[_0x0065('0x1f')](function(_0x2711d4){return _0x2711d4;});}return null;};}function removeEntity(_0xb5758,_0x5578da){return function(_0x372ffc){if(_0x372ffc){return _0x372ffc[_0x0065('0x20')]()[_0x0065('0x1f')](function(){_0xb5758[_0x0065('0x14')](0xcc)[_0x0065('0x13')]();});}};}function handleEntityNotFound(_0x4cbd31,_0xc562ce){return function(_0x5536dc){if(!_0x5536dc){_0x4cbd31[_0x0065('0x12')](0x194);}return _0x5536dc;};}function handleError(_0x3b39e7,_0x2cea74){_0x2cea74=_0x2cea74||0x1f4;return function(_0x234fb2){logger[_0x0065('0x21')](_0x234fb2[_0x0065('0x22')]);if(_0x234fb2['name']){delete _0x234fb2[_0x0065('0x23')];}_0x3b39e7[_0x0065('0x14')](_0x2cea74)[_0x0065('0x24')](_0x234fb2);};}exports[_0x0065('0x25')]=function(_0x2f177e,_0x54c4c3){var _0x4ad7e2={},_0x432dbf={},_0x5aafd9={'count':0x0,'rows':[]};var _0x56b59b=_[_0x0065('0x26')](db[_0x0065('0x27')][_0x0065('0x28')],function(_0x515019){return{'name':_0x515019[_0x0065('0x29')],'type':_0x515019[_0x0065('0x2a')][_0x0065('0x2b')]};});_0x432dbf[_0x0065('0x2c')]=_[_0x0065('0x26')](_0x56b59b,_0x0065('0x23'));_0x432dbf[_0x0065('0x2d')]=_[_0x0065('0x2e')](_0x2f177e[_0x0065('0x2d')]);_0x432dbf[_0x0065('0x2f')]=_['intersection'](_0x432dbf['model'],_0x432dbf[_0x0065('0x2d')]);_0x4ad7e2['attributes']=_[_0x0065('0x30')](_0x432dbf['model'],qs[_0x0065('0x31')](_0x2f177e[_0x0065('0x2d')]['fields']));_0x4ad7e2['attributes']=_0x4ad7e2[_0x0065('0x32')][_0x0065('0x33')]?_0x4ad7e2['attributes']:_0x432dbf['model'];if(!_0x2f177e[_0x0065('0x2d')]['hasOwnProperty'](_0x0065('0x34'))){_0x4ad7e2[_0x0065('0x17')]=qs[_0x0065('0x17')](_0x2f177e[_0x0065('0x2d')]['limit']);_0x4ad7e2[_0x0065('0x16')]=qs[_0x0065('0x16')](_0x2f177e[_0x0065('0x2d')][_0x0065('0x16')]);}_0x4ad7e2[_0x0065('0x35')]=qs[_0x0065('0x36')](_0x2f177e['query'][_0x0065('0x36')]);_0x4ad7e2[_0x0065('0x37')]=qs[_0x0065('0x2f')](_[_0x0065('0x38')](_0x2f177e[_0x0065('0x2d')],_0x432dbf['filters']),_0x56b59b);if(_0x2f177e[_0x0065('0x2d')][_0x0065('0x39')]){_0x4ad7e2[_0x0065('0x37')]=_[_0x0065('0x3a')](_0x4ad7e2[_0x0065('0x37')],{'$or':_[_0x0065('0x26')](_0x56b59b,function(_0x84017f){if(_0x84017f[_0x0065('0x2a')]!==_0x0065('0x3b')){var _0x59dd96={};_0x59dd96[_0x84017f[_0x0065('0x23')]]={'$like':'%'+_0x2f177e[_0x0065('0x2d')][_0x0065('0x39')]+'%'};return _0x59dd96;}})});}_0x4ad7e2=_['merge']({},_0x4ad7e2,_0x2f177e[_0x0065('0x3c')]);var _0x43146f={'where':_0x4ad7e2[_0x0065('0x37')]};return db[_0x0065('0x27')]['count'](_0x43146f)[_0x0065('0x1f')](function(_0x4db53a){_0x5aafd9['count']=_0x4db53a;if(_0x2f177e[_0x0065('0x2d')][_0x0065('0x3d')]){_0x4ad7e2['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x0065('0x3e')](_0x4ad7e2);})['then'](function(_0x273d5c){_0x5aafd9[_0x0065('0x3f')]=_0x273d5c;return _0x5aafd9;})[_0x0065('0x1f')](respondWithFilteredResult(_0x54c4c3,_0x4ad7e2))[_0x0065('0x40')](handleError(_0x54c4c3,null));};exports[_0x0065('0x41')]=function(_0x57ca09,_0x572891){var _0x4b4974={'raw':!![],'where':{'id':_0x57ca09[_0x0065('0x42')]['id']}},_0x1ac131={};_0x1ac131['model']=_[_0x0065('0x2e')](db[_0x0065('0x27')][_0x0065('0x28')]);_0x1ac131[_0x0065('0x2d')]=_['keys'](_0x57ca09['query']);_0x1ac131['filters']=_['intersection'](_0x1ac131[_0x0065('0x2c')],_0x1ac131[_0x0065('0x2d')]);_0x4b4974[_0x0065('0x32')]=_[_0x0065('0x30')](_0x1ac131[_0x0065('0x2c')],qs[_0x0065('0x31')](_0x57ca09['query'][_0x0065('0x31')]));_0x4b4974['attributes']=_0x4b4974[_0x0065('0x32')][_0x0065('0x33')]?_0x4b4974[_0x0065('0x32')]:_0x1ac131[_0x0065('0x2c')];if(_0x57ca09['query'][_0x0065('0x3d')]){_0x4b4974[_0x0065('0x43')]=[{'all':!![]}];}_0x4b4974=_[_0x0065('0x3a')]({},_0x4b4974,_0x57ca09[_0x0065('0x3c')]);return db[_0x0065('0x27')]['find'](_0x4b4974)['then'](handleEntityNotFound(_0x572891,null))[_0x0065('0x1f')](respondWithResult(_0x572891,null))[_0x0065('0x40')](handleError(_0x572891,null));};exports['create']=function(_0x959896,_0x14864b){return db[_0x0065('0x27')]['create'](_0x959896[_0x0065('0x44')],{})['then'](respondWithResult(_0x14864b,0xc9))[_0x0065('0x40')](handleError(_0x14864b,null));};exports[_0x0065('0x45')]=function(_0x3b0bbc,_0x59c3f2){if(_0x3b0bbc[_0x0065('0x44')]['id']){delete _0x3b0bbc[_0x0065('0x44')]['id'];}return db[_0x0065('0x27')][_0x0065('0x46')]({'where':{'id':_0x3b0bbc[_0x0065('0x42')]['id']}})[_0x0065('0x1f')](handleEntityNotFound(_0x59c3f2,null))[_0x0065('0x1f')](saveUpdates(_0x3b0bbc[_0x0065('0x44')],null))['then'](respondWithResult(_0x59c3f2,null))[_0x0065('0x40')](handleError(_0x59c3f2,null));};exports['destroy']=function(_0x1217bc,_0x534cd0){return db['ChatQueueReport'][_0x0065('0x46')]({'where':{'id':_0x1217bc[_0x0065('0x42')]['id']}})[_0x0065('0x1f')](handleEntityNotFound(_0x534cd0,null))[_0x0065('0x1f')](removeEntity(_0x534cd0,null))[_0x0065('0x40')](handleError(_0x534cd0,null));};exports[_0x0065('0x47')]=function(_0x2f1b4e,_0x1500d7){return db[_0x0065('0x27')]['describe']()[_0x0065('0x1f')](respondWithResult(_0x1500d7,null))['catch'](handleError(_0x1500d7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index e158940..eb5507d 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xde8d6d,_0x36f308){var _0x3a880d=function(_0x5c340f){while(--_0x5c340f){_0xde8d6d['push'](_0xde8d6d['shift']());}};_0x3a880d(++_0x36f308);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfbf1f3,_0x23a64a){var _0x356ed3=function(_0x259e18){while(--_0x259e18){_0xfbf1f3['push'](_0xfbf1f3['shift']());}};_0x356ed3(++_0x23a64a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ecd60a5..714eed5 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 _0x7a27=['ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','stringify','where','attributes','UpdateChatQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x7a27,0x172));var _0x77a2=function(_0x191d1c,_0x11b4a0){_0x191d1c=_0x191d1c-0x0;var _0x5d2bac=_0x7a27[_0x191d1c];return _0x5d2bac;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var moment=require(_0x77a2('0x2'));var BPromise=require(_0x77a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77a2('0x4'));var db=require(_0x77a2('0x5'))['db'];var utils=require(_0x77a2('0x6'));var logger=require(_0x77a2('0x7'))('rpc');var config=require(_0x77a2('0x8'));var jayson=require(_0x77a2('0x9'));var client=jayson[_0x77a2('0xa')][_0x77a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6037,_0x4a0fe4,_0x4e41b2){return new BPromise(function(_0x144d6e,_0xedb0bf){return client[_0x77a2('0xc')](_0x5b6037,_0x4e41b2)[_0x77a2('0xd')](function(_0x1379b0){logger['info'](_0x77a2('0xe'),_0x4a0fe4,'request\x20sent');logger['debug'](_0x77a2('0xf'),_0x4a0fe4,_0x77a2('0x10'),JSON['stringify'](_0x1379b0));if(_0x1379b0['error']){if(_0x1379b0[_0x77a2('0x11')][_0x77a2('0x12')]===0x1f4){logger[_0x77a2('0x11')](_0x77a2('0xe'),_0x4a0fe4,_0x1379b0[_0x77a2('0x11')][_0x77a2('0x13')]);return _0xedb0bf(_0x1379b0['error'][_0x77a2('0x13')]);}logger[_0x77a2('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4a0fe4,_0x1379b0[_0x77a2('0x11')]['message']);return _0x144d6e(_0x1379b0[_0x77a2('0x11')][_0x77a2('0x13')]);}else{logger['info'](_0x77a2('0xe'),_0x4a0fe4,_0x77a2('0x10'));_0x144d6e(_0x1379b0['result'][_0x77a2('0x13')]);}})[_0x77a2('0x14')](function(_0x48c438){logger[_0x77a2('0x11')](_0x77a2('0xe'),_0x4a0fe4,_0x48c438);_0xedb0bf(_0x48c438);});});}exports[_0x77a2('0x15')]=function(_0x49fd4d){var _0x403b03=this;return new Promise(function(_0x76196d,_0x390b91){return db[_0x77a2('0x16')][_0x77a2('0x17')](_0x49fd4d[_0x77a2('0x18')],{'raw':_0x49fd4d[_0x77a2('0x19')]?_0x49fd4d[_0x77a2('0x19')][_0x77a2('0x1a')]===undefined?!![]:![]:!![]})[_0x77a2('0xd')](function(_0x52fe6c){logger[_0x77a2('0x1b')](_0x77a2('0x15'),_0x49fd4d);logger['debug'](_0x77a2('0x15'),_0x49fd4d,JSON[_0x77a2('0x1c')](_0x52fe6c));_0x76196d(_0x52fe6c);})['catch'](function(_0x3a05b0){logger[_0x77a2('0x11')](_0x77a2('0x15'),_0x3a05b0[_0x77a2('0x13')],_0x49fd4d);_0x390b91(_0x403b03[_0x77a2('0x11')](0x1f4,_0x3a05b0[_0x77a2('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x236ef8){var _0x1b4c14=this;return new Promise(function(_0x33e386,_0x480c9b){return db[_0x77a2('0x16')]['update'](_0x236ef8[_0x77a2('0x18')],{'raw':_0x236ef8[_0x77a2('0x19')]?_0x236ef8[_0x77a2('0x19')][_0x77a2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236ef8[_0x77a2('0x19')]?_0x236ef8['options'][_0x77a2('0x1d')]||null:null,'attributes':_0x236ef8[_0x77a2('0x19')]?_0x236ef8['options'][_0x77a2('0x1e')]||null:null,'limit':_0x236ef8['options']?_0x236ef8['options']['limit']||null:null})[_0x77a2('0xd')](function(_0x49b1a6){logger['info'](_0x77a2('0x1f'),_0x236ef8);logger['debug'](_0x77a2('0x1f'),_0x236ef8,JSON[_0x77a2('0x1c')](_0x49b1a6));_0x33e386(_0x49b1a6);})['catch'](function(_0x3452a3){logger[_0x77a2('0x11')](_0x77a2('0x1f'),_0x3452a3[_0x77a2('0x13')],_0x236ef8);_0x480c9b(_0x1b4c14[_0x77a2('0x11')](0x1f4,_0x3452a3['message']));});});};
\ No newline at end of file
+var _0x5755=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','stringify','UpdateChatQueueReport','update','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19db1a,_0x2acde1){var _0x434a28=function(_0x37f05b){while(--_0x37f05b){_0x19db1a['push'](_0x19db1a['shift']());}};_0x434a28(++_0x2acde1);}(_0x5755,0x8f));var _0x5575=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0x5755[_0x162f4b];return _0x57b00b;};'use strict';var _=require('lodash');var util=require(_0x5575('0x0'));var moment=require(_0x5575('0x1'));var BPromise=require(_0x5575('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5575('0x3'));var db=require(_0x5575('0x4'))['db'];var utils=require(_0x5575('0x5'));var logger=require(_0x5575('0x6'))(_0x5575('0x7'));var config=require(_0x5575('0x8'));var jayson=require(_0x5575('0x9'));var client=jayson[_0x5575('0xa')][_0x5575('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1919cf,_0x22e768,_0x418953){return new BPromise(function(_0x8d007e,_0x500805){return client['request'](_0x1919cf,_0x418953)[_0x5575('0xc')](function(_0x7aa9ca){logger[_0x5575('0xd')](_0x5575('0xe'),_0x22e768,_0x5575('0xf'));logger[_0x5575('0x10')](_0x5575('0x11'),_0x22e768,_0x5575('0xf'),JSON['stringify'](_0x7aa9ca));if(_0x7aa9ca[_0x5575('0x12')]){if(_0x7aa9ca[_0x5575('0x12')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x22e768,_0x7aa9ca['error'][_0x5575('0x13')]);return _0x500805(_0x7aa9ca[_0x5575('0x12')][_0x5575('0x13')]);}logger[_0x5575('0x12')](_0x5575('0xe'),_0x22e768,_0x7aa9ca['error']['message']);return _0x8d007e(_0x7aa9ca[_0x5575('0x12')]['message']);}else{logger['info'](_0x5575('0xe'),_0x22e768,_0x5575('0xf'));_0x8d007e(_0x7aa9ca[_0x5575('0x14')][_0x5575('0x13')]);}})[_0x5575('0x15')](function(_0x55c668){logger['error'](_0x5575('0xe'),_0x22e768,_0x55c668);_0x500805(_0x55c668);});});}exports[_0x5575('0x16')]=function(_0x11772b){var _0x3953b6=this;return new Promise(function(_0x319e31,_0x3b5384){return db[_0x5575('0x17')][_0x5575('0x18')](_0x11772b['body'],{'raw':_0x11772b[_0x5575('0x19')]?_0x11772b[_0x5575('0x19')][_0x5575('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x48d631){logger['info']('CreateChatQueueReport',_0x11772b);logger['debug'](_0x5575('0x16'),_0x11772b,JSON[_0x5575('0x1b')](_0x48d631));_0x319e31(_0x48d631);})[_0x5575('0x15')](function(_0x3380e7){logger['error'](_0x5575('0x16'),_0x3380e7[_0x5575('0x13')],_0x11772b);_0x3b5384(_0x3953b6[_0x5575('0x12')](0x1f4,_0x3380e7[_0x5575('0x13')]));});});};exports[_0x5575('0x1c')]=function(_0x195c20){var _0x4e989a=this;return new Promise(function(_0x5bba14,_0x579a46){return db[_0x5575('0x17')][_0x5575('0x1d')](_0x195c20['body'],{'raw':_0x195c20[_0x5575('0x19')]?_0x195c20[_0x5575('0x19')][_0x5575('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x195c20['options']?_0x195c20[_0x5575('0x19')][_0x5575('0x1e')]||null:null,'attributes':_0x195c20['options']?_0x195c20[_0x5575('0x19')]['attributes']||null:null,'limit':_0x195c20[_0x5575('0x19')]?_0x195c20['options']['limit']||null:null})[_0x5575('0xc')](function(_0xaf93f2){logger[_0x5575('0xd')](_0x5575('0x1c'),_0x195c20);logger['debug'](_0x5575('0x1c'),_0x195c20,JSON[_0x5575('0x1b')](_0xaf93f2));_0x5bba14(_0xaf93f2);})[_0x5575('0x15')](function(_0x155e9d){logger[_0x5575('0x12')]('UpdateChatQueueReport',_0x155e9d[_0x5575('0x13')],_0x195c20);_0x579a46(_0x4e989a[_0x5575('0x12')](0x1f4,_0x155e9d[_0x5575('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a971159..60384c2 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 _0x385f=['post','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x56321f,_0x1c41eb){var _0x5aa129=function(_0x5cab95){while(--_0x5cab95){_0x56321f['push'](_0x56321f['shift']());}};_0x5aa129(++_0x1c41eb);}(_0x385f,0x191));var _0xf385=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x385f[_0x3c51d4];return _0x53c45f;};'use strict';var multer=require('multer');var util=require(_0xf385('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf385('0x1')]();var fs_extra=require(_0xf385('0x2'));var auth=require(_0xf385('0x3'));var interaction=require(_0xf385('0x4'));var config=require('../../config/environment');var controller=require(_0xf385('0x5'));router['get']('/',auth[_0xf385('0x6')](),controller[_0xf385('0x7')]);router[_0xf385('0x8')](_0xf385('0x9'),auth[_0xf385('0x6')](),controller[_0xf385('0xa')]);router[_0xf385('0x8')](_0xf385('0xb'),auth[_0xf385('0x6')](),controller[_0xf385('0xc')]);router[_0xf385('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xf385('0x6')](),controller[_0xf385('0xe')]);router[_0xf385('0xf')](_0xf385('0xb'),auth[_0xf385('0x6')](),controller[_0xf385('0x10')]);module[_0xf385('0x11')]=router;
\ No newline at end of file
+var _0x9275=['../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9275,0x177));var _0x5927=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x9275[_0x9307ea];return _0x295554;};'use strict';var multer=require('multer');var util=require(_0x5927('0x0'));var path=require(_0x5927('0x1'));var timeout=require(_0x5927('0x2'));var express=require(_0x5927('0x3'));var router=express['Router']();var fs_extra=require(_0x5927('0x4'));var auth=require(_0x5927('0x5'));var interaction=require(_0x5927('0x6'));var config=require('../../config/environment');var controller=require(_0x5927('0x7'));router[_0x5927('0x8')]('/',auth[_0x5927('0x9')](),controller[_0x5927('0xa')]);router[_0x5927('0x8')](_0x5927('0xb'),auth[_0x5927('0x9')](),controller['describe']);router[_0x5927('0x8')]('/:id',auth[_0x5927('0x9')](),controller['show']);router['post']('/',auth[_0x5927('0x9')](),controller[_0x5927('0xc')]);router[_0x5927('0xd')](_0x5927('0xe'),auth[_0x5927('0x9')](),controller[_0x5927('0xf')]);router[_0x5927('0x10')](_0x5927('0xe'),auth[_0x5927('0x9')](),controller[_0x5927('0x11')]);module[_0x5927('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 5d24e72..6ab9eed 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x54d624,_0x481973){var _0x2de0dc=function(_0x2d8385){while(--_0x2d8385){_0x54d624['push'](_0x54d624['shift']());}};_0x2de0dc(++_0x481973);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x203983,_0x34d62e){var _0x212285=function(_0x22147e){while(--_0x22147e){_0x203983['push'](_0x203983['shift']());}};_0x212285(++_0x34d62e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x592d62,_0xa9c0b9){_0x592d62=_0x592d62-0x0;var _0x519075=_0xf4eb[_0x592d62];return _0x519075;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1590d16..131dd6d 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 _0x9fc4=['include','findAll','rows','catch','show','length','find','create','body','update','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','count','includeAll'];(function(_0x1f4074,_0x18dbab){var _0x196b7a=function(_0x46328c){while(--_0x46328c){_0x1f4074['push'](_0x1f4074['shift']());}};_0x196b7a(++_0x18dbab);}(_0x9fc4,0xf3));var _0x49fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fc4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x49fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49fc('0x2'));var moment=require(_0x49fc('0x3'));var BPromise=require(_0x49fc('0x4'));var Mustache=require('mustache');var util=require(_0x49fc('0x5'));var path=require(_0x49fc('0x6'));var sox=require('sox');var csv=require(_0x49fc('0x7'));var ejs=require(_0x49fc('0x8'));var fs=require('fs');var fs_extra=require(_0x49fc('0x9'));var _=require(_0x49fc('0xa'));var squel=require('squel');var crypto=require(_0x49fc('0xb'));var jsforce=require(_0x49fc('0xc'));var deskjs=require(_0x49fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x49fc('0xe'));var Papa=require(_0x49fc('0xf'));var Redis=require(_0x49fc('0x10'));var authService=require(_0x49fc('0x11'));var qs=require(_0x49fc('0x12'));var as=require(_0x49fc('0x13'));var hardwareService=require(_0x49fc('0x14'));var logger=require(_0x49fc('0x15'))(_0x49fc('0x16'));var utils=require(_0x49fc('0x17'));var config=require(_0x49fc('0x18'));var licenseUtil=require(_0x49fc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d34e5,_0x4b52b8){_0x4b52b8=_0x4b52b8||0xcc;return function(_0x26a0a1){if(_0x26a0a1){return _0x2d34e5['sendStatus'](_0x4b52b8);}return _0x2d34e5[_0x49fc('0x1a')](_0x4b52b8)['end']();};}function respondWithResult(_0x1546ed,_0x2fe96e){_0x2fe96e=_0x2fe96e||0xc8;return function(_0x2e31b8){if(_0x2e31b8){return _0x1546ed[_0x49fc('0x1a')](_0x2fe96e)[_0x49fc('0x1b')](_0x2e31b8);}};}function respondWithFilteredResult(_0x1c8e66,_0x3eeab0){return function(_0xfadf3f){if(_0xfadf3f){var _0x3026f5=typeof _0x3eeab0[_0x49fc('0x1c')]===_0x49fc('0x1d')&&typeof _0x3eeab0[_0x49fc('0x1e')]===_0x49fc('0x1d');var _0x3c9aef=_0xfadf3f['count'];var _0x13cffb=_0x3026f5?0x0:_0x3eeab0[_0x49fc('0x1c')];var _0x3f4cde=_0x3026f5?_0xfadf3f['count']:_0x3eeab0[_0x49fc('0x1c')]+_0x3eeab0[_0x49fc('0x1e')];var _0x31ab06;if(_0x3f4cde>=_0x3c9aef){_0x3f4cde=_0x3c9aef;_0x31ab06=0xc8;}else{_0x31ab06=0xce;}_0x1c8e66[_0x49fc('0x1a')](_0x31ab06);return _0x1c8e66[_0x49fc('0x1f')](_0x49fc('0x20'),_0x13cffb+'-'+_0x3f4cde+'/'+_0x3c9aef)[_0x49fc('0x1b')](_0xfadf3f);}return null;};}function patchUpdates(_0x347a1e){return function(_0x2a5aa9){try{jsonpatch['apply'](_0x2a5aa9,_0x347a1e,!![]);}catch(_0x4f3354){return BPromise['reject'](_0x4f3354);}return _0x2a5aa9[_0x49fc('0x21')]();};}function saveUpdates(_0x359173,_0x765111){return function(_0xd63a92){if(_0xd63a92){return _0xd63a92['update'](_0x359173)[_0x49fc('0x22')](function(_0x592447){return _0x592447;});}return null;};}function removeEntity(_0x21c3f7,_0x43a381){return function(_0x3cbd06){if(_0x3cbd06){return _0x3cbd06[_0x49fc('0x23')]()[_0x49fc('0x22')](function(){_0x21c3f7[_0x49fc('0x1a')](0xcc)[_0x49fc('0x24')]();});}};}function handleEntityNotFound(_0x2e4f43,_0x13ed55){return function(_0x529ded){if(!_0x529ded){_0x2e4f43[_0x49fc('0x25')](0x194);}return _0x529ded;};}function handleError(_0xbe1da,_0x53f5a7){_0x53f5a7=_0x53f5a7||0x1f4;return function(_0x1c6881){logger[_0x49fc('0x26')](_0x1c6881[_0x49fc('0x27')]);if(_0x1c6881[_0x49fc('0x28')]){delete _0x1c6881['name'];}_0xbe1da[_0x49fc('0x1a')](_0x53f5a7)[_0x49fc('0x29')](_0x1c6881);};}exports[_0x49fc('0x2a')]=function(_0x5b9c7c,_0xdea5c1){var _0x1976ef={},_0x1773d4={},_0x5d955b={'count':0x0,'rows':[]};var _0x513350=_[_0x49fc('0x2b')](db[_0x49fc('0x2c')][_0x49fc('0x2d')],function(_0x4170fd){return{'name':_0x4170fd[_0x49fc('0x2e')],'type':_0x4170fd['type']['key']};});_0x1773d4[_0x49fc('0x2f')]=_[_0x49fc('0x2b')](_0x513350,_0x49fc('0x28'));_0x1773d4['query']=_[_0x49fc('0x30')](_0x5b9c7c[_0x49fc('0x31')]);_0x1773d4['filters']=_['intersection'](_0x1773d4['model'],_0x1773d4['query']);_0x1976ef['attributes']=_[_0x49fc('0x32')](_0x1773d4[_0x49fc('0x2f')],qs['fields'](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x33')]));_0x1976ef[_0x49fc('0x34')]=_0x1976ef[_0x49fc('0x34')]['length']?_0x1976ef[_0x49fc('0x34')]:_0x1773d4[_0x49fc('0x2f')];if(!_0x5b9c7c[_0x49fc('0x31')]['hasOwnProperty'](_0x49fc('0x35'))){_0x1976ef[_0x49fc('0x1e')]=qs[_0x49fc('0x1e')](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x1e')]);_0x1976ef[_0x49fc('0x1c')]=qs[_0x49fc('0x1c')](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x1c')]);}_0x1976ef[_0x49fc('0x36')]=qs['sort'](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x37')]);_0x1976ef[_0x49fc('0x38')]=qs[_0x49fc('0x39')](_['pick'](_0x5b9c7c[_0x49fc('0x31')],_0x1773d4[_0x49fc('0x39')]),_0x513350);if(_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x3a')]){_0x1976ef['where']=_['merge'](_0x1976ef['where'],{'$or':_[_0x49fc('0x2b')](_0x513350,function(_0x585c26){if(_0x585c26[_0x49fc('0x3b')]!==_0x49fc('0x3c')){var _0x5c87e9={};_0x5c87e9[_0x585c26['name']]={'$like':'%'+_0x5b9c7c[_0x49fc('0x31')]['filter']+'%'};return _0x5c87e9;}})});}_0x1976ef=_[_0x49fc('0x3d')]({},_0x1976ef,_0x5b9c7c[_0x49fc('0x3e')]);var _0x1fc7fd={'where':_0x1976ef['where']};return db[_0x49fc('0x2c')]['count'](_0x1fc7fd)['then'](function(_0x19d218){_0x5d955b[_0x49fc('0x3f')]=_0x19d218;if(_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x40')]){_0x1976ef[_0x49fc('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x49fc('0x42')](_0x1976ef);})[_0x49fc('0x22')](function(_0x2eb54a){_0x5d955b[_0x49fc('0x43')]=_0x2eb54a;return _0x5d955b;})['then'](respondWithFilteredResult(_0xdea5c1,_0x1976ef))[_0x49fc('0x44')](handleError(_0xdea5c1,null));};exports[_0x49fc('0x45')]=function(_0x2ae3fd,_0x4613fc){var _0x5da60a={'raw':!![],'where':{'id':_0x2ae3fd['params']['id']}},_0x15f065={};_0x15f065[_0x49fc('0x2f')]=_[_0x49fc('0x30')](db[_0x49fc('0x2c')]['rawAttributes']);_0x15f065[_0x49fc('0x31')]=_[_0x49fc('0x30')](_0x2ae3fd[_0x49fc('0x31')]);_0x15f065['filters']=_['intersection'](_0x15f065[_0x49fc('0x2f')],_0x15f065['query']);_0x5da60a[_0x49fc('0x34')]=_['intersection'](_0x15f065[_0x49fc('0x2f')],qs['fields'](_0x2ae3fd[_0x49fc('0x31')]['fields']));_0x5da60a['attributes']=_0x5da60a[_0x49fc('0x34')][_0x49fc('0x46')]?_0x5da60a[_0x49fc('0x34')]:_0x15f065[_0x49fc('0x2f')];if(_0x2ae3fd[_0x49fc('0x31')]['includeAll']){_0x5da60a['include']=[{'all':!![]}];}_0x5da60a=_[_0x49fc('0x3d')]({},_0x5da60a,_0x2ae3fd['options']);return db[_0x49fc('0x2c')][_0x49fc('0x47')](_0x5da60a)[_0x49fc('0x22')](handleEntityNotFound(_0x4613fc,null))[_0x49fc('0x22')](respondWithResult(_0x4613fc,null))[_0x49fc('0x44')](handleError(_0x4613fc,null));};exports[_0x49fc('0x48')]=function(_0x1b7f64,_0x59cfb3){return db[_0x49fc('0x2c')]['create'](_0x1b7f64[_0x49fc('0x49')],{})[_0x49fc('0x22')](respondWithResult(_0x59cfb3,0xc9))[_0x49fc('0x44')](handleError(_0x59cfb3,null));};exports[_0x49fc('0x4a')]=function(_0x30640c,_0x401a64){if(_0x30640c[_0x49fc('0x49')]['id']){delete _0x30640c[_0x49fc('0x49')]['id'];}return db[_0x49fc('0x2c')][_0x49fc('0x47')]({'where':{'id':_0x30640c['params']['id']}})['then'](handleEntityNotFound(_0x401a64,null))[_0x49fc('0x22')](saveUpdates(_0x30640c[_0x49fc('0x49')],null))['then'](respondWithResult(_0x401a64,null))[_0x49fc('0x44')](handleError(_0x401a64,null));};exports[_0x49fc('0x23')]=function(_0xeb247e,_0x202dbc){return db['ChatTransferReport'][_0x49fc('0x47')]({'where':{'id':_0xeb247e[_0x49fc('0x4b')]['id']}})[_0x49fc('0x22')](handleEntityNotFound(_0x202dbc,null))[_0x49fc('0x22')](removeEntity(_0x202dbc,null))[_0x49fc('0x44')](handleError(_0x202dbc,null));};exports['describe']=function(_0x24a817,_0x272be9){return db[_0x49fc('0x2c')][_0x49fc('0x4c')]()['then'](respondWithResult(_0x272be9,null))[_0x49fc('0x44')](handleError(_0x272be9,null));};
\ No newline at end of file
+var _0x7262=['fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x14ed0a,_0x41a9cc){var _0x23566d=function(_0x140f2f){while(--_0x140f2f){_0x14ed0a['push'](_0x14ed0a['shift']());}};_0x23566d(++_0x41a9cc);}(_0x7262,0x120));var _0x2726=function(_0x276512,_0x3c6d80){_0x276512=_0x276512-0x0;var _0xae81f1=_0x7262[_0x276512];return _0xae81f1;};'use strict';var emlformat=require(_0x2726('0x0'));var rimraf=require(_0x2726('0x1'));var zipdir=require(_0x2726('0x2'));var jsonpatch=require(_0x2726('0x3'));var rp=require(_0x2726('0x4'));var moment=require(_0x2726('0x5'));var BPromise=require(_0x2726('0x6'));var Mustache=require(_0x2726('0x7'));var util=require('util');var path=require(_0x2726('0x8'));var sox=require(_0x2726('0x9'));var csv=require(_0x2726('0xa'));var ejs=require(_0x2726('0xb'));var fs=require('fs');var fs_extra=require(_0x2726('0xc'));var _=require('lodash');var squel=require(_0x2726('0xd'));var crypto=require(_0x2726('0xe'));var jsforce=require(_0x2726('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2726('0xa'));var querystring=require(_0x2726('0x10'));var Papa=require('papaparse');var Redis=require(_0x2726('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2726('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2726('0x13'))('api');var utils=require(_0x2726('0x14'));var config=require(_0x2726('0x15'));var licenseUtil=require(_0x2726('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d220c,_0x24d8b9){_0x24d8b9=_0x24d8b9||0xcc;return function(_0x27f423){if(_0x27f423){return _0x2d220c['sendStatus'](_0x24d8b9);}return _0x2d220c[_0x2726('0x17')](_0x24d8b9)[_0x2726('0x18')]();};}function respondWithResult(_0x295837,_0xa52e62){_0xa52e62=_0xa52e62||0xc8;return function(_0x1e2dc5){if(_0x1e2dc5){return _0x295837[_0x2726('0x17')](_0xa52e62)[_0x2726('0x19')](_0x1e2dc5);}};}function respondWithFilteredResult(_0x246b94,_0x5effb3){return function(_0x306b7f){if(_0x306b7f){var _0x1a5de2=typeof _0x5effb3[_0x2726('0x1a')]===_0x2726('0x1b')&&typeof _0x5effb3[_0x2726('0x1c')]===_0x2726('0x1b');var _0x4ffd4b=_0x306b7f[_0x2726('0x1d')];var _0x47cc7a=_0x1a5de2?0x0:_0x5effb3[_0x2726('0x1a')];var _0x34c2a6=_0x1a5de2?_0x306b7f[_0x2726('0x1d')]:_0x5effb3[_0x2726('0x1a')]+_0x5effb3[_0x2726('0x1c')];var _0x15e1ce;if(_0x34c2a6>=_0x4ffd4b){_0x34c2a6=_0x4ffd4b;_0x15e1ce=0xc8;}else{_0x15e1ce=0xce;}_0x246b94[_0x2726('0x17')](_0x15e1ce);return _0x246b94[_0x2726('0x1e')](_0x2726('0x1f'),_0x47cc7a+'-'+_0x34c2a6+'/'+_0x4ffd4b)['json'](_0x306b7f);}return null;};}function patchUpdates(_0x3c32d2){return function(_0x9368b){try{jsonpatch[_0x2726('0x20')](_0x9368b,_0x3c32d2,!![]);}catch(_0xe9c800){return BPromise[_0x2726('0x21')](_0xe9c800);}return _0x9368b[_0x2726('0x22')]();};}function saveUpdates(_0x57c633,_0x5f1b9b){return function(_0x261669){if(_0x261669){return _0x261669['update'](_0x57c633)['then'](function(_0xe0b30d){return _0xe0b30d;});}return null;};}function removeEntity(_0x1d570e,_0xd819e0){return function(_0x5b75fa){if(_0x5b75fa){return _0x5b75fa[_0x2726('0x23')]()[_0x2726('0x24')](function(){_0x1d570e[_0x2726('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512bff,_0x2d1eef){return function(_0x33fd7d){if(!_0x33fd7d){_0x512bff['sendStatus'](0x194);}return _0x33fd7d;};}function handleError(_0x1ee2ed,_0x9be158){_0x9be158=_0x9be158||0x1f4;return function(_0x54da61){logger[_0x2726('0x25')](_0x54da61[_0x2726('0x26')]);if(_0x54da61[_0x2726('0x27')]){delete _0x54da61['name'];}_0x1ee2ed['status'](_0x9be158)[_0x2726('0x28')](_0x54da61);};}exports[_0x2726('0x29')]=function(_0x41ed14,_0x36a715){var _0x1bdbe8={},_0x4e7ff9={},_0x17e457={'count':0x0,'rows':[]};var _0x12c7ce=_[_0x2726('0x2a')](db[_0x2726('0x2b')][_0x2726('0x2c')],function(_0xd5a3db){return{'name':_0xd5a3db['fieldName'],'type':_0xd5a3db[_0x2726('0x2d')][_0x2726('0x2e')]};});_0x4e7ff9['model']=_[_0x2726('0x2a')](_0x12c7ce,_0x2726('0x27'));_0x4e7ff9[_0x2726('0x2f')]=_[_0x2726('0x30')](_0x41ed14[_0x2726('0x2f')]);_0x4e7ff9[_0x2726('0x31')]=_[_0x2726('0x32')](_0x4e7ff9[_0x2726('0x33')],_0x4e7ff9[_0x2726('0x2f')]);_0x1bdbe8[_0x2726('0x34')]=_[_0x2726('0x32')](_0x4e7ff9[_0x2726('0x33')],qs[_0x2726('0x35')](_0x41ed14[_0x2726('0x2f')][_0x2726('0x35')]));_0x1bdbe8[_0x2726('0x34')]=_0x1bdbe8['attributes'][_0x2726('0x36')]?_0x1bdbe8['attributes']:_0x4e7ff9[_0x2726('0x33')];if(!_0x41ed14[_0x2726('0x2f')][_0x2726('0x37')]('nolimit')){_0x1bdbe8[_0x2726('0x1c')]=qs[_0x2726('0x1c')](_0x41ed14[_0x2726('0x2f')]['limit']);_0x1bdbe8['offset']=qs[_0x2726('0x1a')](_0x41ed14[_0x2726('0x2f')][_0x2726('0x1a')]);}_0x1bdbe8[_0x2726('0x38')]=qs['sort'](_0x41ed14[_0x2726('0x2f')][_0x2726('0x39')]);_0x1bdbe8[_0x2726('0x3a')]=qs[_0x2726('0x31')](_[_0x2726('0x3b')](_0x41ed14[_0x2726('0x2f')],_0x4e7ff9['filters']),_0x12c7ce);if(_0x41ed14['query'][_0x2726('0x3c')]){_0x1bdbe8[_0x2726('0x3a')]=_['merge'](_0x1bdbe8['where'],{'$or':_[_0x2726('0x2a')](_0x12c7ce,function(_0x3d6ccf){if(_0x3d6ccf[_0x2726('0x2d')]!=='VIRTUAL'){var _0x87423d={};_0x87423d[_0x3d6ccf[_0x2726('0x27')]]={'$like':'%'+_0x41ed14[_0x2726('0x2f')][_0x2726('0x3c')]+'%'};return _0x87423d;}})});}_0x1bdbe8=_[_0x2726('0x3d')]({},_0x1bdbe8,_0x41ed14[_0x2726('0x3e')]);var _0x3b8f4c={'where':_0x1bdbe8['where']};return db[_0x2726('0x2b')][_0x2726('0x1d')](_0x3b8f4c)[_0x2726('0x24')](function(_0x3fe09b){_0x17e457[_0x2726('0x1d')]=_0x3fe09b;if(_0x41ed14[_0x2726('0x2f')]['includeAll']){_0x1bdbe8[_0x2726('0x3f')]=[{'all':!![]}];}return db[_0x2726('0x2b')][_0x2726('0x40')](_0x1bdbe8);})['then'](function(_0x2de53f){_0x17e457[_0x2726('0x41')]=_0x2de53f;return _0x17e457;})[_0x2726('0x24')](respondWithFilteredResult(_0x36a715,_0x1bdbe8))[_0x2726('0x42')](handleError(_0x36a715,null));};exports[_0x2726('0x43')]=function(_0x3be49,_0x3bf628){var _0x353cf0={'raw':!![],'where':{'id':_0x3be49[_0x2726('0x44')]['id']}},_0xcaf0fe={};_0xcaf0fe['model']=_[_0x2726('0x30')](db['ChatTransferReport']['rawAttributes']);_0xcaf0fe[_0x2726('0x2f')]=_['keys'](_0x3be49['query']);_0xcaf0fe[_0x2726('0x31')]=_[_0x2726('0x32')](_0xcaf0fe[_0x2726('0x33')],_0xcaf0fe['query']);_0x353cf0[_0x2726('0x34')]=_[_0x2726('0x32')](_0xcaf0fe['model'],qs['fields'](_0x3be49[_0x2726('0x2f')]['fields']));_0x353cf0[_0x2726('0x34')]=_0x353cf0['attributes'][_0x2726('0x36')]?_0x353cf0[_0x2726('0x34')]:_0xcaf0fe[_0x2726('0x33')];if(_0x3be49[_0x2726('0x2f')][_0x2726('0x45')]){_0x353cf0[_0x2726('0x3f')]=[{'all':!![]}];}_0x353cf0=_['merge']({},_0x353cf0,_0x3be49['options']);return db[_0x2726('0x2b')][_0x2726('0x46')](_0x353cf0)[_0x2726('0x24')](handleEntityNotFound(_0x3bf628,null))[_0x2726('0x24')](respondWithResult(_0x3bf628,null))['catch'](handleError(_0x3bf628,null));};exports[_0x2726('0x47')]=function(_0x1cf1bc,_0x1425fd){return db['ChatTransferReport'][_0x2726('0x47')](_0x1cf1bc[_0x2726('0x48')],{})[_0x2726('0x24')](respondWithResult(_0x1425fd,0xc9))[_0x2726('0x42')](handleError(_0x1425fd,null));};exports[_0x2726('0x49')]=function(_0x5835a3,_0x1f0a10){if(_0x5835a3[_0x2726('0x48')]['id']){delete _0x5835a3[_0x2726('0x48')]['id'];}return db['ChatTransferReport'][_0x2726('0x46')]({'where':{'id':_0x5835a3[_0x2726('0x44')]['id']}})[_0x2726('0x24')](handleEntityNotFound(_0x1f0a10,null))['then'](saveUpdates(_0x5835a3['body'],null))[_0x2726('0x24')](respondWithResult(_0x1f0a10,null))[_0x2726('0x42')](handleError(_0x1f0a10,null));};exports[_0x2726('0x23')]=function(_0x3aba2e,_0x58da79){return db[_0x2726('0x2b')]['find']({'where':{'id':_0x3aba2e['params']['id']}})['then'](handleEntityNotFound(_0x58da79,null))[_0x2726('0x24')](removeEntity(_0x58da79,null))['catch'](handleError(_0x58da79,null));};exports['describe']=function(_0x9a0b68,_0x54d60e){return db[_0x2726('0x2b')][_0x2726('0x4a')]()[_0x2726('0x24')](respondWithResult(_0x54d60e,null))['catch'](handleError(_0x54d60e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4c6dbc1..859f066 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 _0x2db6=['exports','define','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','./chatTransferReport.attributes'];(function(_0x2bd408,_0x4c5659){var _0x54c9f1=function(_0x11e6e3){while(--_0x11e6e3){_0x2bd408['push'](_0x2bd408['shift']());}};_0x54c9f1(++_0x4c5659);}(_0x2db6,0xa8));var _0x62db=function(_0x38b7fc,_0xe48357){_0x38b7fc=_0x38b7fc-0x0;var _0x43b19a=_0x2db6[_0x38b7fc];return _0x43b19a;};'use strict';var _=require(_0x62db('0x0'));var util=require(_0x62db('0x1'));var logger=require(_0x62db('0x2'))(_0x62db('0x3'));var moment=require(_0x62db('0x4'));var BPromise=require('bluebird');var rp=require(_0x62db('0x5'));var fs=require('fs');var path=require(_0x62db('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62db('0x7'));module[_0x62db('0x8')]=function(_0x131989,_0x571f6d){return _0x131989[_0x62db('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x62db('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd39=['path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x35c465,_0x145c45){var _0x265c03=function(_0x37281b){while(--_0x37281b){_0x35c465['push'](_0x35c465['shift']());}};_0x265c03(++_0x145c45);}(_0xfd39,0x80));var _0x9fd3=function(_0x2807e0,_0x5a47a9){_0x2807e0=_0x2807e0-0x0;var _0xdb0595=_0xfd39[_0x2807e0];return _0xdb0595;};'use strict';var _=require(_0x9fd3('0x0'));var util=require(_0x9fd3('0x1'));var logger=require(_0x9fd3('0x2'))(_0x9fd3('0x3'));var moment=require(_0x9fd3('0x4'));var BPromise=require(_0x9fd3('0x5'));var rp=require(_0x9fd3('0x6'));var fs=require('fs');var path=require(_0x9fd3('0x7'));var rimraf=require(_0x9fd3('0x8'));var config=require('../../config/environment');var attributes=require(_0x9fd3('0x9'));module[_0x9fd3('0xa')]=function(_0x32d60b,_0x37073c){return _0x32d60b[_0x9fd3('0xb')](_0x9fd3('0xc'),attributes,{'tableName':_0x9fd3('0xd'),'paranoid':![],'indexes':[{'name':_0x9fd3('0xe'),'fields':[_0x9fd3('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 890eda4..89e1818 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 _0x07b8=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x36ed40,_0x13d2fc){var _0x1069ab=function(_0x19289f){while(--_0x19289f){_0x36ed40['push'](_0x36ed40['shift']());}};_0x1069ab(++_0x13d2fc);}(_0x07b8,0x1ae));var _0x807b=function(_0x5621b4,_0x49c7bd){_0x5621b4=_0x5621b4-0x0;var _0x54bb44=_0x07b8[_0x5621b4];return _0x54bb44;};'use strict';var _=require('lodash');var util=require(_0x807b('0x0'));var moment=require('moment');var BPromise=require(_0x807b('0x1'));var rs=require(_0x807b('0x2'));var fs=require('fs');var Redis=require(_0x807b('0x3'));var db=require(_0x807b('0x4'))['db'];var utils=require(_0x807b('0x5'));var logger=require(_0x807b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x807b('0x7'));var client=jayson[_0x807b('0x8')][_0x807b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x226fa5,_0xb5f2cb,_0x353cfc){return new BPromise(function(_0x6167b5,_0x385586){return client[_0x807b('0xa')](_0x226fa5,_0x353cfc)[_0x807b('0xb')](function(_0x299ee8){logger[_0x807b('0xc')](_0x807b('0xd'),_0xb5f2cb,_0x807b('0xe'));logger[_0x807b('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xb5f2cb,_0x807b('0xe'),JSON['stringify'](_0x299ee8));if(_0x299ee8[_0x807b('0x10')]){if(_0x299ee8[_0x807b('0x10')][_0x807b('0x11')]===0x1f4){logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);return _0x385586(_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);}logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x299ee8['error'][_0x807b('0x12')]);return _0x6167b5(_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);}else{logger[_0x807b('0xc')](_0x807b('0xd'),_0xb5f2cb,'request\x20sent');_0x6167b5(_0x299ee8[_0x807b('0x13')][_0x807b('0x12')]);}})[_0x807b('0x14')](function(_0x41c122){logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x41c122);_0x385586(_0x41c122);});});}
\ No newline at end of file
+var _0x0762=['client','http','request','then','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x2ae0af,_0x2ba5f2){var _0xbd8402=function(_0x417762){while(--_0x417762){_0x2ae0af['push'](_0x2ae0af['shift']());}};_0xbd8402(++_0x2ba5f2);}(_0x0762,0x10b));var _0x2076=function(_0x4530a5,_0x3c4e64){_0x4530a5=_0x4530a5-0x0;var _0x24026a=_0x0762[_0x4530a5];return _0x24026a;};'use strict';var _=require(_0x2076('0x0'));var util=require(_0x2076('0x1'));var moment=require('moment');var BPromise=require(_0x2076('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2076('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2076('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2076('0x5'));var client=jayson[_0x2076('0x6')][_0x2076('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f8ceb,_0x799b56,_0x180fd3){return new BPromise(function(_0x31fc04,_0x493b1d){return client[_0x2076('0x8')](_0x2f8ceb,_0x180fd3)[_0x2076('0x9')](function(_0xc1161f){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x799b56,'request\x20sent');logger[_0x2076('0xa')](_0x2076('0xb'),_0x799b56,'request\x20sent',JSON[_0x2076('0xc')](_0xc1161f));if(_0xc1161f[_0x2076('0xd')]){if(_0xc1161f['error'][_0x2076('0xe')]===0x1f4){logger[_0x2076('0xd')](_0x2076('0xf'),_0x799b56,_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);return _0x493b1d(_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);}logger['error'](_0x2076('0xf'),_0x799b56,_0xc1161f[_0x2076('0xd')][_0x2076('0x10')]);return _0x31fc04(_0xc1161f[_0x2076('0xd')]['message']);}else{logger[_0x2076('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x799b56,_0x2076('0x12'));_0x31fc04(_0xc1161f[_0x2076('0x13')]['message']);}})[_0x2076('0x14')](function(_0x4de1f6){logger[_0x2076('0xd')](_0x2076('0xf'),_0x799b56,_0x4de1f6);_0x493b1d(_0x4de1f6);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 13c6b46..7b3cb65 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 _0x8983=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service'];(function(_0x43555b,_0x1774ce){var _0x46291d=function(_0xd9bf4a){while(--_0xd9bf4a){_0x43555b['push'](_0x43555b['shift']());}};_0x46291d(++_0x1774ce);}(_0x8983,0x13e));var _0x3898=function(_0x51f950,_0x3ecf51){_0x51f950=_0x51f950-0x0;var _0x3941d9=_0x8983[_0x51f950];return _0x3941d9;};'use strict';var multer=require(_0x3898('0x0'));var util=require(_0x3898('0x1'));var path=require('path');var timeout=require(_0x3898('0x2'));var express=require(_0x3898('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3898('0x4'));var config=require(_0x3898('0x5'));var controller=require(_0x3898('0x6'));router['get']('/',auth[_0x3898('0x7')](),controller[_0x3898('0x8')]);router[_0x3898('0x9')](_0x3898('0xa'),auth[_0x3898('0x7')](),controller[_0x3898('0xb')]);router[_0x3898('0x9')]('/:id',auth[_0x3898('0x7')](),controller[_0x3898('0xc')]);router[_0x3898('0xd')]('/',auth[_0x3898('0x7')](),controller['create']);router[_0x3898('0xe')](_0x3898('0xf'),auth[_0x3898('0x7')](),controller[_0x3898('0x10')]);router[_0x3898('0x11')](_0x3898('0xf'),auth[_0x3898('0x7')](),controller[_0x3898('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xc58b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x382a9d,_0x470845){var _0xc14eda=function(_0x4b6445){while(--_0x4b6445){_0x382a9d['push'](_0x382a9d['shift']());}};_0xc14eda(++_0x470845);}(_0xc58b,0x179));var _0xbc58=function(_0x573400,_0x585d43){_0x573400=_0x573400-0x0;var _0x47d31a=_0xc58b[_0x573400];return _0x47d31a;};'use strict';var multer=require(_0xbc58('0x0'));var util=require(_0xbc58('0x1'));var path=require(_0xbc58('0x2'));var timeout=require(_0xbc58('0x3'));var express=require(_0xbc58('0x4'));var router=express['Router']();var fs_extra=require(_0xbc58('0x5'));var auth=require(_0xbc58('0x6'));var interaction=require(_0xbc58('0x7'));var config=require(_0xbc58('0x8'));var controller=require(_0xbc58('0x9'));router[_0xbc58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc58('0xa')]('/describe',auth[_0xbc58('0xb')](),controller['describe']);router[_0xbc58('0xa')](_0xbc58('0xc'),auth[_0xbc58('0xb')](),controller[_0xbc58('0xd')]);router['post']('/',auth[_0xbc58('0xb')](),controller[_0xbc58('0xe')]);router[_0xbc58('0xf')](_0xbc58('0xc'),auth[_0xbc58('0xb')](),controller[_0xbc58('0x10')]);router[_0xbc58('0x11')]('/:id',auth[_0xbc58('0xb')](),controller[_0xbc58('0x12')]);module[_0xbc58('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bfe7296..e61e2c2 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 _0x41bb=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x3e9092,_0x2b7060){var _0x47e452=function(_0x2f93dc){while(--_0x2f93dc){_0x3e9092['push'](_0x3e9092['shift']());}};_0x47e452(++_0x2b7060);}(_0x41bb,0xc5));var _0xb41b=function(_0xd45615,_0x1eee52){_0xd45615=_0xd45615-0x0;var _0xde4c1c=_0x41bb[_0xd45615];return _0xde4c1c;};'use strict';var Sequelize=require(_0xb41b('0x0'));var rs=require(_0xb41b('0x1'));module['exports']={'name':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x3')},'description':{'type':Sequelize[_0xb41b('0x2')]},'mapKey':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x4')},'key':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb41b('0x2')]},'animation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb41b('0x9'),'squared'),'defaultValue':_0xb41b('0x9')},'header_online':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xa')},'start_chat_button':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0xc')},'header_offline':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xd')},'download_transcript':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb41b('0xe')]},'closingQuestion':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x11')},'noteTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x12')},'placeholderMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x13')},'closingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb41b('0x16')](_0xb41b('0x17'),_0xb41b('0x18')),'defaultValue':_0xb41b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb41b('0x19'),'type':_0xb41b('0x1a'),'required':!![]},'props':{'title':_0xb41b('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb41b('0x1b')](_0xb41b('0x1c'))?JSON['parse'](this[_0xb41b('0x1b')]('onlineForm')):{};},'set':function(_0x2d0f27){return this[_0xb41b('0x1d')]('onlineForm',JSON[_0xb41b('0x1e')](_0x2d0f27));}},'offlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':_0xb41b('0x4')},'variable':null},{'type':_0xb41b('0x1f'),'config':{'placeholder':_0xb41b('0x20')},'props':{'title':_0xb41b('0x20'),'helpText':_0xb41b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xb41b('0x22'))?JSON[_0xb41b('0x23')](this['getDataValue'](_0xb41b('0x22'))):{};},'set':function(_0x482764){return this[_0xb41b('0x1d')](_0xb41b('0x22'),JSON['stringify'](_0x482764));}},'token':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb41b('0x2')]},'forwardOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb41b('0x2')]},'waitingTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x24')},'waitingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb41b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return _0xb41b('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x2a')},'defaultTitle':{'type':Sequelize[_0xb41b('0x2')]},'customerAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x2c')},'systemAvatar':{'type':Sequelize[_0xb41b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb41b('0x7')],'comment':_0xb41b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49e8c4){if(!_0x49e8c4)this['setDataValue'](_0xb41b('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x49e8c4);}},'vidaooEscalation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x2f')},'vidaooNote':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return _0xb41b('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb41b('0xe')]}};
\ No newline at end of file
+var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x3e4b17,_0x1398fd){var _0xa2914=function(_0xd33528){while(--_0xd33528){_0x3e4b17['push'](_0x3e4b17['shift']());}};_0xa2914(++_0x1398fd);}(_0x55e0,0xdc));var _0x055e=function(_0x5c7dc6,_0x2f7fe2){_0x5c7dc6=_0x5c7dc6-0x0;var _0x3d0dc4=_0x55e0[_0x5c7dc6];return _0x3d0dc4;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 17e98d5..47f8d20 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 _0x51a8=['sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','../../config/license/util','virtual','custom','chatLicenseExceeded','Intervals','push','all','some','readFileSync','server/files/chat/iframe.ejs','URL','3.1.0','x-forwarded-for','x-real-ip','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','map','name','keys','filters','intersection','model','query','fields','attributes','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','ChatWebsite','include','findAll','rows','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','getAnswers','CannedAnswer','includeAll','removeAnswers','ids','addLogo'];(function(_0x2b704a,_0x7c5ca9){var _0x41eb36=function(_0x1bbc21){while(--_0x1bbc21){_0x2b704a['push'](_0x2b704a['shift']());}};_0x41eb36(++_0x7c5ca9);}(_0x51a8,0xc5));var _0x851a=function(_0x16c02d,_0x24d20d){_0x16c02d=_0x16c02d-0x0;var _0x27f7ec=_0x51a8[_0x16c02d];return _0x27f7ec;};'use strict';var BPromise=require(_0x851a('0x0'));var Mustache=require('mustache');var util=require(_0x851a('0x1'));var path=require('path');var ejs=require(_0x851a('0x2'));var fs=require('fs');var fs_extra=require(_0x851a('0x3'));var _=require(_0x851a('0x4'));var querystring=require(_0x851a('0x5'));var Redis=require('ioredis');var qs=require(_0x851a('0x6'));var logger=require(_0x851a('0x7'))(_0x851a('0x8'));var config=require(_0x851a('0x9'));var url=require(_0x851a('0xa'));var db=require(_0x851a('0xb'))['db'];config[_0x851a('0xc')]=_[_0x851a('0xd')](config['redis'],{'host':_0x851a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x851a('0xc')]));require(_0x851a('0xf'))[_0x851a('0x10')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x851a('0x11'));var client=jayson[_0x851a('0x12')][_0x851a('0x13')]({'port':0x232c});var client9002=jayson['client'][_0x851a('0x13')]({'port':0x232a});var client9003=jayson[_0x851a('0x12')][_0x851a('0x13')]({'port':0x232b});var client9001=jayson[_0x851a('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x250074,_0x5c4373,_0x4dc52f,_0x5af44a){return new BPromise(function(_0x1c334f,_0xc1ef83){var _0x42f8eb=_0x5af44a||client;return _0x42f8eb[_0x851a('0x14')](_0x250074,_0x4dc52f)[_0x851a('0x15')](function(_0x343f1f){logger[_0x851a('0x16')](_0x851a('0x17'),_0x5c4373,_0x851a('0x18'));logger[_0x851a('0x19')](_0x851a('0x1a'),_0x5c4373,_0x851a('0x18'),JSON[_0x851a('0x1b')](_0x343f1f));if(_0x343f1f[_0x851a('0x1c')]){if(_0x343f1f['error'][_0x851a('0x1d')]===0x1f4){logger['error'](_0x851a('0x17'),_0x5c4373,_0x343f1f['error'][_0x851a('0x1e')]);return _0xc1ef83(_0x343f1f['error'][_0x851a('0x1e')]);}logger[_0x851a('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c4373,_0x343f1f[_0x851a('0x1c')]['message']);return _0x1c334f(_0x343f1f[_0x851a('0x1c')][_0x851a('0x1e')]);}else{logger[_0x851a('0x16')](_0x851a('0x17'),_0x5c4373,'request\x20sent');_0x1c334f(_0x343f1f[_0x851a('0x1f')]['message']);}})[_0x851a('0x20')](function(_0x39fa52){logger[_0x851a('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c4373,_0x39fa52);_0xc1ef83(_0x39fa52);});});}function respondWithStatusCode(_0x207128,_0x32e55c){_0x32e55c=_0x32e55c||0xcc;return function(_0x13a92c){if(_0x13a92c){return _0x207128[_0x851a('0x21')](_0x32e55c);}return _0x207128[_0x851a('0x22')](_0x32e55c)[_0x851a('0x23')]();};}function respondWithResult(_0x46579c,_0x1b9eb4){_0x1b9eb4=_0x1b9eb4||0xc8;return function(_0x14bc9b){if(_0x14bc9b){return _0x46579c[_0x851a('0x22')](_0x1b9eb4)[_0x851a('0x24')](_0x14bc9b);}};}function respondWithFilteredResult(_0x146bd5,_0x382f7c){return function(_0x139cb2){if(_0x139cb2){var _0x15d3f9=typeof _0x382f7c[_0x851a('0x25')]===_0x851a('0x26')&&typeof _0x382f7c[_0x851a('0x27')]===_0x851a('0x26');var _0x46ef07=_0x139cb2[_0x851a('0x28')];var _0x1443f0=_0x15d3f9?0x0:_0x382f7c[_0x851a('0x25')];var _0xa0ff11=_0x15d3f9?_0x139cb2[_0x851a('0x28')]:_0x382f7c['offset']+_0x382f7c[_0x851a('0x27')];var _0x1459e8;if(_0xa0ff11>=_0x46ef07){_0xa0ff11=_0x46ef07;_0x1459e8=0xc8;}else{_0x1459e8=0xce;}_0x146bd5[_0x851a('0x22')](_0x1459e8);return _0x146bd5[_0x851a('0x29')]('Content-Range',_0x1443f0+'-'+_0xa0ff11+'/'+_0x46ef07)[_0x851a('0x24')](_0x139cb2);}return null;};}function saveUpdates(_0x1e176b){return function(_0x3db25e){if(_0x3db25e){return _0x3db25e[_0x851a('0x2a')](_0x1e176b)[_0x851a('0x15')](function(_0x392704){return _0x392704;});}return null;};}function removeEntity(_0x2b70ac){return function(_0x2f5490){if(_0x2f5490){return _0x2f5490['destroy']()[_0x851a('0x15')](function(){var _0x360c82=_0x2f5490[_0x851a('0x2b')]({'plain':!![]});var _0x5daea4=_0x851a('0x2c');return db[_0x851a('0x2d')][_0x851a('0x2e')]({'where':{'type':_0x5daea4,'resourceId':_0x360c82['id']}})[_0x851a('0x15')](function(){return _0x2f5490;});})[_0x851a('0x15')](function(){_0x2b70ac[_0x851a('0x22')](0xcc)[_0x851a('0x23')]();});}};}function handleEntityNotFound(_0x348d53){return function(_0x3139f2){if(!_0x3139f2){_0x348d53[_0x851a('0x21')](0x194);}return _0x3139f2;};}function handleError(_0x3dbce1,_0x5adbcc){_0x5adbcc=_0x5adbcc||0x1f4;return function(_0xca90ef){logger[_0x851a('0x1c')](_0xca90ef[_0x851a('0x2f')]);if(_0xca90ef['name']){delete _0xca90ef['name'];}_0x3dbce1[_0x851a('0x22')](_0x5adbcc)[_0x851a('0x30')](_0xca90ef);};}exports[_0x851a('0x31')]=function(_0x1619ea,_0x3c7e54){var _0x4c629f={'include':[{'model':db[_0x851a('0x32')],'as':_0x851a('0x33')}]},_0x584ec2={},_0x5dec4d={'count':0x0,'rows':[]};var _0x143bb0=_['map'](db['ChatWebsite'][_0x851a('0x34')],function(_0xdfce00){return{'name':_0xdfce00[_0x851a('0x35')],'type':_0xdfce00['type'][_0x851a('0x36')]};});_0x584ec2['model']=_[_0x851a('0x37')](_0x143bb0,_0x851a('0x38'));_0x584ec2['query']=_[_0x851a('0x39')](_0x1619ea['query']);_0x584ec2[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x584ec2[_0x851a('0x3c')],_0x584ec2[_0x851a('0x3d')]);_0x4c629f['attributes']=_[_0x851a('0x3b')](_0x584ec2['model'],qs[_0x851a('0x3e')](_0x1619ea[_0x851a('0x3d')]['fields']));_0x4c629f['attributes']=_0x4c629f[_0x851a('0x3f')]['length']?_0x4c629f[_0x851a('0x3f')]:_0x584ec2['model'];if(!_0x1619ea[_0x851a('0x3d')]['hasOwnProperty'](_0x851a('0x40'))){_0x4c629f['limit']=qs[_0x851a('0x27')](_0x1619ea[_0x851a('0x3d')]['limit']);_0x4c629f[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x1619ea['query']['offset']);}_0x4c629f[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x1619ea['query'][_0x851a('0x42')]);_0x4c629f[_0x851a('0x43')]=qs['filters'](_['pick'](_0x1619ea[_0x851a('0x3d')],_0x584ec2['filters']),_0x143bb0);if(_0x1619ea[_0x851a('0x3d')]['filter']){_0x4c629f[_0x851a('0x43')]=_[_0x851a('0x44')](_0x4c629f[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x143bb0,function(_0x55f374){if(_0x55f374[_0x851a('0x45')]!==_0x851a('0x46')){var _0x67f951={};_0x67f951[_0x55f374[_0x851a('0x38')]]={'$like':'%'+_0x1619ea['query'][_0x851a('0x47')]+'%'};return _0x67f951;}})});}_0x4c629f=_[_0x851a('0x44')]({},_0x4c629f,_0x1619ea[_0x851a('0x48')]);var _0x46e392={'where':_0x4c629f['where']};return db[_0x851a('0x49')]['count'](_0x46e392)[_0x851a('0x15')](function(_0x46965e){_0x5dec4d[_0x851a('0x28')]=_0x46965e;if(_0x1619ea['query']['includeAll']){_0x4c629f[_0x851a('0x4a')]=[{'all':!![]}];}return db[_0x851a('0x49')][_0x851a('0x4b')](_0x4c629f);})[_0x851a('0x15')](function(_0x4e173e){_0x5dec4d[_0x851a('0x4c')]=_0x4e173e;return _0x5dec4d;})[_0x851a('0x15')](respondWithFilteredResult(_0x3c7e54,_0x4c629f))[_0x851a('0x20')](handleError(_0x3c7e54,null));};exports[_0x851a('0x4d')]=function(_0x1eacbe,_0x345856){var _0x5a0e71={'raw':![],'where':{'id':_0x1eacbe['params']['id']},'include':[{'model':db[_0x851a('0x32')],'as':'mandatoryDispositionPause'}]},_0x4e46b9={};_0x4e46b9['model']=_[_0x851a('0x39')](db[_0x851a('0x49')]['rawAttributes']);_0x4e46b9[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x1eacbe[_0x851a('0x3d')]);_0x4e46b9['filters']=_[_0x851a('0x3b')](_0x4e46b9[_0x851a('0x3c')],_0x4e46b9['query']);_0x5a0e71['attributes']=_[_0x851a('0x3b')](_0x4e46b9[_0x851a('0x3c')],qs['fields'](_0x1eacbe[_0x851a('0x3d')][_0x851a('0x3e')]));_0x5a0e71[_0x851a('0x3f')]=_0x5a0e71[_0x851a('0x3f')][_0x851a('0x4e')]?_0x5a0e71[_0x851a('0x3f')]:_0x4e46b9[_0x851a('0x3c')];if(_0x1eacbe[_0x851a('0x3d')]['includeAll']){_0x5a0e71[_0x851a('0x4a')]=[{'all':!![]}];}_0x5a0e71=_[_0x851a('0x44')]({},_0x5a0e71,_0x1eacbe['options']);return db[_0x851a('0x49')][_0x851a('0x4f')](_0x5a0e71)[_0x851a('0x15')](handleEntityNotFound(_0x345856,null))[_0x851a('0x15')](respondWithResult(_0x345856,null))['catch'](handleError(_0x345856,null));};exports[_0x851a('0x50')]=function(_0x4b443a,_0x523557){return db[_0x851a('0x49')][_0x851a('0x50')](_0x4b443a['body'],{})[_0x851a('0x15')](function(_0x2871fd){var _0x40776c=_0x4b443a[_0x851a('0x51')][_0x851a('0x2b')]({'plain':!![]});if(!_0x40776c)throw new Error(_0x851a('0x52'));if(_0x40776c['role']===_0x851a('0x51')){var _0x3e338c=_0x2871fd['get']({'plain':!![]});var _0x7ddca1=_0x851a('0x2c');return db['UserProfileSection'][_0x851a('0x4f')]({'where':{'name':_0x7ddca1,'userProfileId':_0x40776c[_0x851a('0x53')]},'raw':!![]})[_0x851a('0x15')](function(_0xe30d06){if(_0xe30d06&&_0xe30d06[_0x851a('0x54')]===0x0){return db[_0x851a('0x2d')][_0x851a('0x50')]({'name':_0x3e338c['name'],'resourceId':_0x3e338c['id'],'type':_0xe30d06[_0x851a('0x38')],'sectionId':_0xe30d06['id']},{})['then'](function(){return _0x2871fd;});}else{return _0x2871fd;}})[_0x851a('0x20')](function(_0xd09372){logger[_0x851a('0x1c')](_0x851a('0x55'),_0xd09372);throw _0xd09372;});}return _0x2871fd;})[_0x851a('0x15')](respondWithResult(_0x523557,0xc9))[_0x851a('0x20')](handleError(_0x523557,null));};exports[_0x851a('0x2a')]=function(_0x483db1,_0x185ce0){if(_0x483db1[_0x851a('0x56')]['id']){delete _0x483db1['body']['id'];}return db[_0x851a('0x49')]['find']({'where':{'id':_0x483db1[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0x32')],'as':_0x851a('0x33')}]})[_0x851a('0x15')](handleEntityNotFound(_0x185ce0,null))['then'](saveUpdates(_0x483db1[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0x185ce0,null))['catch'](handleError(_0x185ce0,null));};exports[_0x851a('0x2e')]=function(_0x301ccd,_0x2b3af8){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x301ccd[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2b3af8,null))[_0x851a('0x15')](removeEntity(_0x2b3af8,null))[_0x851a('0x20')](handleError(_0x2b3af8,null));};exports[_0x851a('0x58')]=function(_0x45d402,_0xc4b06a){return db[_0x851a('0x49')][_0x851a('0x58')]()[_0x851a('0x15')](respondWithResult(_0xc4b06a,null))['catch'](handleError(_0xc4b06a,null));};exports[_0x851a('0x59')]=function(_0x8364fa,_0x4ec994){if(_0x8364fa['body']['id']){delete _0x8364fa[_0x851a('0x56')]['id'];}return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x8364fa[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4ec994,null))[_0x851a('0x15')](function(_0x30ce3a){if(_0x30ce3a){_0x8364fa[_0x851a('0x56')][_0x851a('0x5a')]=_0x30ce3a['id'];return db[_0x851a('0x5b')][_0x851a('0x50')](_0x8364fa[_0x851a('0x56')]);}})[_0x851a('0x15')](respondWithResult(_0x4ec994,null))[_0x851a('0x20')](handleError(_0x4ec994,null));};exports[_0x851a('0x5c')]=function(_0x30945c,_0x3c1dce){var _0x15b3f9={'raw':![],'where':{}};var _0x280bb7={};var _0x4b8de9={'count':0x0,'rows':[]};return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x30945c[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x3c1dce,null))[_0x851a('0x15')](function(_0xe5f964){if(_0xe5f964){_0x280bb7[_0x851a('0x3c')]=_[_0x851a('0x39')](db[_0x851a('0x5b')]['rawAttributes']);_0x280bb7[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x30945c['query']);_0x280bb7[_0x851a('0x3a')]=_['intersection'](_0x280bb7[_0x851a('0x3c')],_0x280bb7[_0x851a('0x3d')]);_0x15b3f9['attributes']=_[_0x851a('0x3b')](_0x280bb7['model'],qs[_0x851a('0x3e')](_0x30945c[_0x851a('0x3d')]['fields']));_0x15b3f9['attributes']=_0x15b3f9[_0x851a('0x3f')][_0x851a('0x4e')]?_0x15b3f9[_0x851a('0x3f')]:_0x280bb7['model'];if(!_0x30945c['query'][_0x851a('0x5e')](_0x851a('0x40'))){_0x15b3f9[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x30945c[_0x851a('0x3d')][_0x851a('0x27')]);_0x15b3f9[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x30945c[_0x851a('0x3d')]['offset']);}_0x15b3f9[_0x851a('0x41')]=qs['sort'](_0x30945c[_0x851a('0x3d')][_0x851a('0x42')]);_0x15b3f9[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x30945c[_0x851a('0x3d')],_0x280bb7[_0x851a('0x3a')]));_0x15b3f9[_0x851a('0x43')]['ChatWebsiteId']=_0xe5f964['id'];if(_0x30945c[_0x851a('0x3d')][_0x851a('0x47')]){_0x15b3f9[_0x851a('0x43')]=_['merge'](_0x15b3f9[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x15b3f9[_0x851a('0x3f')],function(_0x312cce){var _0x55aeba={};_0x55aeba[_0x312cce]={'$like':'%'+_0x30945c['query'][_0x851a('0x47')]+'%'};return _0x55aeba;})});}_0x15b3f9=_[_0x851a('0x44')]({},_0x15b3f9,_0x30945c['options']);return db[_0x851a('0x5b')][_0x851a('0x28')]({'where':_0x15b3f9['where']})[_0x851a('0x15')](function(_0x41be52){_0x4b8de9['count']=_0x41be52;if(_0x30945c[_0x851a('0x3d')]['includeAll']){_0x15b3f9[_0x851a('0x4a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x15b3f9);})[_0x851a('0x15')](function(_0x19ff3b){_0x4b8de9[_0x851a('0x4c')]=_0x19ff3b;return _0x4b8de9;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x3c1dce,_0x15b3f9))[_0x851a('0x20')](handleError(_0x3c1dce,null));};exports[_0x851a('0x60')]=function(_0x3b00c7,_0x197ec4){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x3b00c7['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x197ec4,null))[_0x851a('0x15')](function(_0x5d0ecb){if(_0x5d0ecb){return _0x5d0ecb[_0x851a('0x60')](_0x3b00c7[_0x851a('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x197ec4,null))[_0x851a('0x20')](handleError(_0x197ec4,null));};exports['addAnswer']=function(_0x1c3c23,_0x2a4868){if(_0x1c3c23[_0x851a('0x56')]['id']){delete _0x1c3c23['body']['id'];}return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x1c3c23['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2a4868,null))[_0x851a('0x15')](function(_0x3b7344){if(_0x3b7344){_0x1c3c23[_0x851a('0x56')][_0x851a('0x5a')]=_0x3b7344['id'];return db['CannedAnswer'][_0x851a('0x50')](_0x1c3c23[_0x851a('0x56')]);}})[_0x851a('0x15')](respondWithResult(_0x2a4868,null))[_0x851a('0x20')](handleError(_0x2a4868,null));};exports[_0x851a('0x61')]=function(_0x15501d,_0x32aa0e){var _0x23ad5f={'raw':![],'where':{}};var _0x2d0edf={};var _0xc510ff={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x15501d['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x32aa0e,null))[_0x851a('0x15')](function(_0x5bb466){if(_0x5bb466){_0x2d0edf[_0x851a('0x3c')]=_[_0x851a('0x39')](db[_0x851a('0x62')][_0x851a('0x34')]);_0x2d0edf[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x15501d[_0x851a('0x3d')]);_0x2d0edf['filters']=_[_0x851a('0x3b')](_0x2d0edf[_0x851a('0x3c')],_0x2d0edf[_0x851a('0x3d')]);_0x23ad5f['attributes']=_[_0x851a('0x3b')](_0x2d0edf[_0x851a('0x3c')],qs[_0x851a('0x3e')](_0x15501d['query'][_0x851a('0x3e')]));_0x23ad5f[_0x851a('0x3f')]=_0x23ad5f[_0x851a('0x3f')][_0x851a('0x4e')]?_0x23ad5f[_0x851a('0x3f')]:_0x2d0edf['model'];if(!_0x15501d[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x23ad5f[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x15501d['query'][_0x851a('0x27')]);_0x23ad5f['offset']=qs[_0x851a('0x25')](_0x15501d['query']['offset']);}_0x23ad5f[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x15501d['query'][_0x851a('0x42')]);_0x23ad5f['where']=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x15501d[_0x851a('0x3d')],_0x2d0edf[_0x851a('0x3a')]));_0x23ad5f['where'][_0x851a('0x5a')]=_0x5bb466['id'];if(_0x15501d[_0x851a('0x3d')][_0x851a('0x47')]){_0x23ad5f[_0x851a('0x43')]=_[_0x851a('0x44')](_0x23ad5f[_0x851a('0x43')],{'$or':_['map'](_0x23ad5f[_0x851a('0x3f')],function(_0x303da2){var _0x87702c={};_0x87702c[_0x303da2]={'$like':'%'+_0x15501d[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x87702c;})});}_0x23ad5f=_[_0x851a('0x44')]({},_0x23ad5f,_0x15501d[_0x851a('0x48')]);return db[_0x851a('0x62')][_0x851a('0x28')]({'where':_0x23ad5f['where']})[_0x851a('0x15')](function(_0x42e99a){_0xc510ff['count']=_0x42e99a;if(_0x15501d['query'][_0x851a('0x63')]){_0x23ad5f[_0x851a('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x851a('0x4b')](_0x23ad5f);})[_0x851a('0x15')](function(_0x4f6a48){_0xc510ff[_0x851a('0x4c')]=_0x4f6a48;return _0xc510ff;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x32aa0e,_0x23ad5f))[_0x851a('0x20')](handleError(_0x32aa0e,null));};exports[_0x851a('0x64')]=function(_0x4d2755,_0x10eded){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x4d2755[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x10eded,null))['then'](function(_0x528748){if(_0x528748){return _0x528748['removeAnswers'](_0x4d2755[_0x851a('0x3d')][_0x851a('0x65')]);}})[_0x851a('0x15')](respondWithStatusCode(_0x10eded,null))['catch'](handleError(_0x10eded,null));};exports[_0x851a('0x66')]=function(_0x38d369,_0x173ea1){_0x38d369[_0x851a('0x56')][_0x851a('0x67')]=_0x38d369[_0x851a('0x68')]['filename'];return db['ChatWebsite'][_0x851a('0x4f')]({'where':{'id':_0x38d369[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x173ea1,null))[_0x851a('0x15')](saveUpdates(_0x38d369['body'],null))[_0x851a('0x15')](respondWithResult(_0x173ea1,null))[_0x851a('0x20')](handleError(_0x173ea1,null));};exports[_0x851a('0x69')]=function(_0x26a89b,_0x283c08){_0x26a89b['body'][_0x851a('0x6a')]=_0x26a89b[_0x851a('0x68')][_0x851a('0x6b')];return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x26a89b[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x283c08,null))[_0x851a('0x15')](saveUpdates(_0x26a89b['body'],null))[_0x851a('0x15')](respondWithResult(_0x283c08,null))[_0x851a('0x20')](handleError(_0x283c08,null));};exports[_0x851a('0x6c')]=function(_0x59d614,_0x4acc17){_0x59d614['body'][_0x851a('0x6d')]=_0x59d614[_0x851a('0x68')][_0x851a('0x6b')];return db['ChatWebsite']['find']({'where':{'id':_0x59d614[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4acc17,null))[_0x851a('0x15')](saveUpdates(_0x59d614[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0x4acc17,null))[_0x851a('0x20')](handleError(_0x4acc17,null));};exports[_0x851a('0x6e')]=function(_0x53d478,_0xde5079){_0x53d478[_0x851a('0x56')][_0x851a('0x6f')]=_0x53d478[_0x851a('0x68')][_0x851a('0x6b')];return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x53d478[_0x851a('0x57')]['id']}})['then'](handleEntityNotFound(_0xde5079,null))[_0x851a('0x15')](saveUpdates(_0x53d478[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0xde5079,null))[_0x851a('0x20')](handleError(_0xde5079,null));};exports['getLogo']=function(_0x141acd,_0x47fdb2){var _0x30d555=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x72'));var _0x25be7b={'where':{'id':_0x141acd[_0x851a('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5e45b4=![];return require('../../config/license/util')[_0x851a('0x73')]()[_0x851a('0x15')](function(_0x3b0fcb){if(_0x3b0fcb){_0x5e45b4=_0x3b0fcb['custom'];}})[_0x851a('0x15')](function(){return db[_0x851a('0x49')]['find'](_0x25be7b);})['then'](handleEntityNotFound(_0x47fdb2,null))[_0x851a('0x15')](function(_0x56a309){if(_0x56a309){if(!_['isNil'](_0x56a309[_0x851a('0x67')])){if(fs[_0x851a('0x74')](path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x75'),_0x56a309[_0x851a('0x67')]))&&_0x5e45b4){_0x30d555=path[_0x851a('0x70')](config['root'],_0x851a('0x75'),_0x56a309[_0x851a('0x67')]);}}return _0x47fdb2['download'](_0x30d555);}})['catch'](handleError(_0x47fdb2,null));};exports[_0x851a('0x76')]=function(_0x4e32f5,_0x11405b){var _0x54c15b=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x77'));var _0x298b9c={'where':{'id':_0x4e32f5[_0x851a('0x57')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x851a('0x49')][_0x851a('0x4f')](_0x298b9c)[_0x851a('0x15')](handleEntityNotFound(_0x11405b,null))['then'](function(_0x2dc29e){if(_0x2dc29e){if(!_[_0x851a('0x78')](_0x2dc29e[_0x851a('0x6a')])){if(fs['existsSync'](path[_0x851a('0x70')](config['root'],_0x851a('0x79'),_0x2dc29e['agentAvatar']))){_0x54c15b=path[_0x851a('0x70')](config[_0x851a('0x71')],'server/files/images/avatars/',_0x2dc29e[_0x851a('0x6a')]);}}return _0x11405b[_0x851a('0x7a')](_0x54c15b);}})[_0x851a('0x20')](handleError(_0x11405b,null));};exports['getCustomerAvatar']=function(_0x1692c7,_0x1664ac){var _0x5300fe=path[_0x851a('0x70')](config['root'],_0x851a('0x7b'));var _0xbbde0d={'where':{'id':_0x1692c7[_0x851a('0x57')]['id']},'attributes':['id',_0x851a('0x6d'),_0x851a('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x851a('0x4f')](_0xbbde0d)[_0x851a('0x15')](handleEntityNotFound(_0x1664ac,null))[_0x851a('0x15')](function(_0x4f6c53){if(_0x4f6c53){if(!_['isNil'](_0x4f6c53[_0x851a('0x6d')])){if(fs[_0x851a('0x74')](path['join'](config[_0x851a('0x71')],'server/files/images/avatars/',_0x4f6c53[_0x851a('0x6d')]))&&_0x4f6c53[_0x851a('0x7c')]){_0x5300fe=path['join'](config[_0x851a('0x71')],_0x851a('0x79'),_0x4f6c53[_0x851a('0x6d')]);}}return _0x1664ac[_0x851a('0x7a')](_0x5300fe);}})['catch'](handleError(_0x1664ac,null));};exports[_0x851a('0x7d')]=function(_0x5e6fa7,_0x270fe2){var _0x39fffd=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x7e'));var _0x43e182={'where':{'id':_0x5e6fa7['params']['id']},'attributes':['id',_0x851a('0x6f')],'raw':!![]};return db[_0x851a('0x49')][_0x851a('0x4f')](_0x43e182)[_0x851a('0x15')](handleEntityNotFound(_0x270fe2,null))['then'](function(_0xe6dcd5){if(_0xe6dcd5){if(!_['isNil'](_0xe6dcd5[_0x851a('0x6f')])){if(fs['existsSync'](path['join'](config[_0x851a('0x71')],_0x851a('0x79'),_0xe6dcd5['systemAvatar']))){_0x39fffd=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x79'),_0xe6dcd5[_0x851a('0x6f')]);}}return _0x270fe2[_0x851a('0x7a')](_0x39fffd);}})[_0x851a('0x20')](handleError(_0x270fe2,null));};exports[_0x851a('0x7f')]=function(_0x485022,_0x153b7c){var _0x47b390=require('user-agent-parser');var _0x1addad=new _0x47b390();var _0x2c088a=_0x1addad[_0x851a('0x80')](_0x485022['headers'][_0x851a('0x81')])[_0x851a('0x82')]();var _0x57b5f8={'body':_0x485022[_0x851a('0x56')],'channel':_0x851a('0x83')};var _0x266472=[];var _0x39e8a5=[];var _0x437c62={};var _0x4379c6=![];return db[_0x851a('0x84')][_0x851a('0x58')]()[_0x851a('0x15')](function(_0x207794){if(!_0x207794){throw new db['Sequelize']['ValidationError'](_0x851a('0x85'));}_0x266472=_[_0x851a('0x86')](_[_0x851a('0x39')](_0x207794),['createdAt',_0x851a('0x87')]);_0x39e8a5=_['difference'](_[_0x851a('0x39')](_0x207794),[_0x851a('0x88'),_0x851a('0x87'),_0x851a('0x89'),_0x851a('0x8a')]);if(_0x485022[_0x851a('0x56')]['id']){delete _0x485022[_0x851a('0x56')]['id'];}if(_['isNil'](_0x485022[_0x851a('0x56')][_0x851a('0x8b')])){throw new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0x8d'));}if(_[_0x851a('0x78')](_0x485022[_0x851a('0x56')][_0x851a('0x56')])||_0x485022['body'][_0x851a('0x56')]===''){throw new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0x8f'));}if(_[_0x851a('0x78')](_0x485022[_0x851a('0x56')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39e8a5);}if(!_[_0x851a('0x90')](_0x39e8a5,_0x485022[_0x851a('0x56')][_0x851a('0x91')])){throw new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0x92')+_0x39e8a5);}_0x437c62[_0x485022[_0x851a('0x56')][_0x851a('0x91')]]=_0x485022['body'][_0x851a('0x8b')];})[_0x851a('0x15')](function(){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x485022[_0x851a('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x851a('0x84')],'as':_0x851a('0x93'),'where':_0x437c62,'limit':0x1,'order':[[_0x851a('0x87'),_0x851a('0x94')]]}]},{'model':db[_0x851a('0x95')],'as':_0x851a('0x96')}]});})[_0x851a('0x15')](handleEntityNotFound(_0x153b7c,null))[_0x851a('0x15')](function(_0xa1b06b){if(_0xa1b06b&&_0xa1b06b['List']){_0x57b5f8[_0x851a('0x97')]=_0xa1b06b;_0x57b5f8[_0x851a('0x98')]=_0xa1b06b[_0x851a('0x96')];_0x57b5f8[_0x851a('0x99')]=_0xa1b06b[_0x851a('0x9a')];_0x57b5f8[_0x851a('0x98')]=_[_0x851a('0x9b')](_0x57b5f8[_0x851a('0x98')],[_0x851a('0x9c')],['asc']);if(_0x57b5f8['account'][_0x851a('0x96')]){delete _0x57b5f8[_0x851a('0x97')][_0x851a('0x96')];}if(_0x57b5f8[_0x851a('0x97')][_0x851a('0x9a')]&&_0x57b5f8[_0x851a('0x97')]['List'][_0x851a('0x93')][_0x851a('0x4e')]){return _0x57b5f8[_0x851a('0x97')][_0x851a('0x9a')][_0x851a('0x93')][0x0];}var _0x3d4b3d=_[_0x851a('0xd')](_0x485022[_0x851a('0x56')],{'firstName':_0x485022['body']['from'],'ListId':_0xa1b06b[_0x851a('0x8a')]});_0x3d4b3d[_0x485022['body'][_0x851a('0x91')]]=_0x485022[_0x851a('0x56')][_0x851a('0x8b')];return db[_0x851a('0x84')]['create'](_0x3d4b3d,{'fields':_0x266472,'raw':!![]});}})[_0x851a('0x15')](handleEntityNotFound(_0x153b7c,null))[_0x851a('0x15')](function(_0x306de5){_0x57b5f8['contact']=_0x306de5;var _0x251cb1=_0x485022[_0x851a('0x56')]['customerIp'];if(_0x485022[_0x851a('0x9d')]['cf-connecting-ip']){_0x251cb1=_0x485022['headers'][_0x851a('0x9e')];}else if(_0x485022[_0x851a('0x9d')]['x-forwarded-for']){_0x251cb1=_[_0x851a('0x9f')](_0x485022[_0x851a('0x9d')]['x-forwarded-for'][_0x851a('0xa0')](','));}if(_0x306de5){var _0x1eecb9={'ContactId':_0x306de5['id'],'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'from':(_0x306de5[_0x851a('0xa1')]||'')+'\x20'+(_0x306de5[_0x851a('0xa2')]||''),'customerIp':_0x251cb1,'customerPort':_0x485022['headers'][_0x851a('0xa3')]?_0x485022['headers'][_0x851a('0xa3')]:null,'referer':_0x485022['body'][_0x851a('0xa4')],'browserName':_0x2c088a[_0x851a('0xa5')][_0x851a('0x38')]&&_0x2c088a[_0x851a('0xa5')][_0x851a('0xa6')]?util[_0x851a('0xa7')](_0x851a('0xa8'),_0x2c088a[_0x851a('0xa5')][_0x851a('0x38')],_0x2c088a[_0x851a('0xa5')]['version']):_0x851a('0xa9'),'browserVersion':_0x2c088a[_0x851a('0xa5')][_0x851a('0xa6')]||_0x851a('0xa9'),'osName':util['format'](_0x851a('0xa8'),_0x2c088a['os']['name'],_0x2c088a['os'][_0x851a('0xa6')]),'osVersion':_0x2c088a['os'][_0x851a('0xa6')],'deviceModel':_0x2c088a[_0x851a('0xaa')][_0x851a('0x3c')]&&_0x2c088a['device'][_0x851a('0xab')]?util[_0x851a('0xa7')]('%s\x20%s\x20%s',_0x2c088a[_0x851a('0xaa')][_0x851a('0x3c')],_0x2c088a['device'][_0x851a('0xab')],_0x2c088a[_0x851a('0xaa')]['type']):null,'deviceVendor':_0x2c088a['device'][_0x851a('0xab')],'deviceType':_0x2c088a[_0x851a('0xaa')]['type'],'formData':JSON[_0x851a('0x1b')](_0x485022[_0x851a('0x56')])};var _0x157781={'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'closed':![]};if(_0x485022[_0x851a('0x56')][_0x851a('0xac')]){_0x157781['threadId']=_0x485022[_0x851a('0x56')][_0x851a('0xac')];return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':_0x157781})['then'](function(_0x4f5b34){if(_0x4f5b34){return[_0x4f5b34,![]];}_0x1eecb9[_0x851a('0xac')]=_0x485022[_0x851a('0x56')][_0x851a('0xac')];_0x1eecb9[_0x851a('0xae')]=_0x485022['body'][_0x851a('0xae')];return db['ChatInteraction'][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x405a15){return[_0x405a15,!![]];});});}_0x157781[_0x851a('0xaf')]=_0x306de5['id'];if(_0x485022[_0x851a('0x56')][_0x851a('0xb0')]&&_0x485022['body'][_0x851a('0xb0')]['id']){_0x157781['id']=_0x485022[_0x851a('0x56')][_0x851a('0xb0')]['id'];return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':_0x157781})[_0x851a('0x15')](function(_0x369a90){if(_0x369a90){return[_0x369a90,![]];}return db[_0x851a('0xad')][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x36a9f3){return[_0x36a9f3,!![]];});});}return db[_0x851a('0xad')][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x3f3317){return[_0x3f3317,!![]];});}})[_0x851a('0xb1')](function(_0x241ed0,_0x207718){if(_0x241ed0){_0x4379c6=_0x207718;if(!_0x207718){var _0x11c762={'from':(_0x57b5f8[_0x851a('0xb2')][_0x851a('0xa1')]||'')+'\x20'+(_0x57b5f8[_0x851a('0xb2')][_0x851a('0xa2')]||'')};if(_0x485022[_0x851a('0x56')][_0x851a('0xac')]&&_0x485022['body'][_0x851a('0xb3')]&&_0x485022[_0x851a('0x56')][_0x851a('0xac')]!=_0x485022[_0x851a('0x56')][_0x851a('0xb3')]){_0x11c762[_0x851a('0xac')]=_0x485022[_0x851a('0x56')][_0x851a('0xb3')];}return _0x241ed0['update'](_0x11c762);}else{return _0x241ed0;}}})['then'](function(_0x4ad7df){_0x57b5f8['interaction']=_0x4ad7df['get']({'plain':!![]});_0x57b5f8['interaction'][_0x851a('0xb4')]=_0x4379c6;if(_0x57b5f8['interaction'][_0x851a('0xb4')]){if(_0x57b5f8[_0x851a('0x97')][_0x851a('0xb5')]){_0x57b5f8[_0x851a('0x98')]['push']({'id':0x0,'priority':_0x57b5f8[_0x851a('0x98')][_0x851a('0x4e')]+0x1,'app':_0x851a('0xb6'),'appdata':'unmanaged','interval':_0x851a('0xb7')});}}return db['ChatMessage']['create']({'body':_0x485022['body']['body'],'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'ChatInteractionId':_0x4ad7df['id'],'direction':'in','ContactId':_0x57b5f8[_0x851a('0xb2')]['id'],'AttachmentId':_0x485022[_0x851a('0x56')][_0x851a('0xb8')]});})[_0x851a('0x15')](function(_0x5adf26){_0x57b5f8['message']=_0x5adf26;if(_0x57b5f8[_0x851a('0xb0')][_0x851a('0xb9')]){return db[_0x851a('0xba')][_0x851a('0x4f')]({'attributes':['id',_0x851a('0x38')],'where':{'id':_0x57b5f8[_0x851a('0xb0')][_0x851a('0xb9')]}})[_0x851a('0x15')](function(_0x3b944d){if(_0x3b944d){_0x57b5f8[_0x851a('0x98')][_0x851a('0xbb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b944d['name']+','+(_0x57b5f8[_0x851a('0x97')][_0x851a('0xbc')]||0xa),'interval':_0x851a('0xb7')});_0x57b5f8[_0x851a('0xbd')]=!![];}return respondWithRpcPromise(_0x851a('0xbe'),_0x851a('0xbf'),_0x57b5f8);});}return respondWithRpcPromise('Start',_0x851a('0xbf'),_0x57b5f8);})[_0x851a('0x15')](function(_0x33171e){respondWithRpcPromise(_0x851a('0xc0'),_0x851a('0xc0'),{'event':'notify','message':_0x33171e},client9002);return _0x33171e;})[_0x851a('0x15')](respondWithResult(_0x153b7c,null))[_0x851a('0x20')](handleError(_0x153b7c,null));};exports[_0x851a('0xc1')]=function(_0x3540bc,_0x493f72){var _0x5c7ae0,_0x489175,_0x53cc62;var _0x28be31=[];var _0x2f283e={};var _0x1bf607=_0x3540bc[_0x851a('0xc2')]||[];var _0x2ee0dc=[];var _0x56f6aa;return db[_0x851a('0x84')][_0x851a('0x58')]()[_0x851a('0x15')](function(_0x434deb){if(!_0x434deb){throw new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0x85'));}_0x28be31=_['difference'](_[_0x851a('0x39')](_0x434deb),['createdAt',_0x851a('0x87'),'CompanyId',_0x851a('0x8a')]);if(_0x3540bc['body']['id']){delete _0x3540bc[_0x851a('0x56')]['id'];}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')]['from'])){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))]('from\x20is\x20mandatory'));}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')][_0x851a('0x56')])||_0x3540bc[_0x851a('0x56')]['body']===''){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db['Sequelize'][(_0x851a('0x8e'))](_0x851a('0x8f')));}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')]['mapKeyOffline'])){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0xc3')+_0x28be31));}if(!_[_0x851a('0x90')](_0x28be31,_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')])){throw _0x493f72['status'](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0xc5')+_0x28be31));}_0x2f283e[_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')]]=_0x3540bc[_0x851a('0x56')][_0x851a('0x8b')];})[_0x851a('0x15')](function(){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x3540bc[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0xc6')],'as':'List'},{'model':db[_0x851a('0xc7')],'as':'MailAccount'}]});})[_0x851a('0x15')](handleEntityNotFound(_0x493f72,null))['then'](function(_0x45900d){if(_0x45900d&&_0x45900d[_0x851a('0x9a')]){_0x489175=_0x45900d;var _0x5dca45=_[_0x851a('0xd')](_0x3540bc[_0x851a('0x56')],{'firstName':_0x3540bc['body'][_0x851a('0x8b')],'phone':_0x3540bc[_0x851a('0x56')][_0x851a('0x8b')],'ListId':_0x45900d[_0x851a('0x8a')]});_0x5dca45[_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')]]=_0x3540bc['body']['from'];return db[_0x851a('0x84')][_0x851a('0xc8')]({'where':_0x2f283e,'defaults':_0x5dca45});}})['spread'](function(_0x6ec71a){if(_0x6ec71a){_0x53cc62=_0x6ec71a;var _0x1deee7=fs['readFileSync'](path[_0x851a('0x70')](config[_0x851a('0x71')],'server/files/templates/chatOfflineMessage.ejs'),_0x851a('0xc9'));var _0x413f22=ejs[_0x851a('0xca')](_0x1deee7,{'body':_[_0x851a('0xcb')](_0x3540bc['body'][_0x851a('0x56')]),'bodyTitle':_0x489175[_0x851a('0xcc')]});return db[_0x851a('0xcd')][_0x851a('0x50')]({'body':_0x413f22,'plainBody':htmlToText[_0x851a('0xce')](_0x413f22),'ContactId':_0x6ec71a['id'],'ChatWebsiteId':_0x489175['id']});}})[_0x851a('0x15')](function(_0x1fa089){_0x56f6aa=_0x1fa089;if(_0x1bf607['length']){var _0x4332cb=_0x1bf607[_0x851a('0x37')](function(_0x55d87f){return{'name':_0x55d87f[_0x851a('0xcf')],'basename':_0x55d87f[_0x851a('0x6b')],'type':_0x55d87f[_0x851a('0xd0')],'ChatOfflineMessageId':_0x1fa089['id']};});_0x2ee0dc=_0x4332cb['map'](_0x1c6da2=>{var _0x4278b2={'filename':_0x1c6da2[_0x851a('0x38')],'path':path[_0x851a('0x70')](config[_0x851a('0x71')],'server',_0x851a('0xc2'),_0x851a('0xd1'),_0x851a('0xd2'),_0x1c6da2[_0x851a('0xd3')])};return _0x4278b2;});if(!_0x489175[_0x851a('0xd4')]){return db[_0x851a('0xd5')]['transaction'](function(_0x5bfb02){return db[_0x851a('0xd6')][_0x851a('0xd7')](_0x4332cb,{'transaction':_0x5bfb02});});}}})[_0x851a('0x15')](function(){if(_0x56f6aa){_0x5c7ae0=_0x56f6aa;return db[_0x851a('0xc7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x851a('0xd8')],'as':_0x851a('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x851a('0x15')](function(_0x303bf1){if(_0x303bf1&&_0x303bf1['Smtp']&&_0x489175['forwardOffline']&&_0x489175[_0x851a('0xda')]){var _0x95ce8=_0x303bf1[_0x851a('0xdb')]();return respondWithRpcPromise('SendMail',_0x851a('0xdc'),{'account':_0x95ce8,'message':{'from':util[_0x851a('0xa7')](_0x851a('0xdd'),_0x303bf1[_0x851a('0x38')],_0x303bf1[_0x851a('0xde')]||_0x303bf1['Smtp'][_0x851a('0x51')]),'to':_0x489175['forwardOfflineAddress'],'subject':_0x489175['offlineMessageSubject'],'html':_0x5c7ae0[_0x851a('0x56')],'attachments':_0x2ee0dc}},client9003)[_0x851a('0x15')](function(){return _0x5c7ae0;})[_0x851a('0x20')](function(_0x3a01a1){logger[_0x851a('0x1c')](_0x3a01a1);});}})[_0x851a('0x15')](function(){if(_0x489175&&_0x489175[_0x851a('0xd4')]&&_0x489175[_0x851a('0xdf')]){var _0x41c958=[];if(_0x1bf607[_0x851a('0x4e')]){_0x41c958=_0x1bf607[_0x851a('0x37')](function(_0x49ca12){return{'name':_0x49ca12[_0x851a('0xcf')],'basename':_0x49ca12[_0x851a('0x6b')],'type':_0x49ca12['mimetype'],'ChatOfflineMessageId':_0x56f6aa['id']};});}var _0x3c453b;if(!_['isNil'](_0x489175[_0x851a('0xe0')])){var _0x7dece0=_[_0x851a('0x37')](_0x3540bc[_0x851a('0x56')],function(_0x137577){return _0x137577;});var _0x45884f=_[_0x851a('0xe1')](_0x7dece0)[0x0];var _0x3004ae=_[_0x851a('0xe2')](_0x45884f,function(_0x134142){return _0x134142;});_0x3c453b=_0x3004ae[0x1][_0x489175['subjectOffline']];}var _0x177eaf={'from':_0x53cc62[_0x851a('0xde')],'firstName':_0x53cc62['firstName'],'lastName':_0x53cc62[_0x851a('0xa2')],'mapKey':_0x851a('0xde'),'message':{'from':_0x53cc62[_0x851a('0xde')],'to':_0x489175[_0x851a('0xc7')][_0x851a('0xde')],'cc':'','subject':_[_0x851a('0x78')](_0x3c453b)?_0x489175[_0x851a('0xe3')]:_0x3c453b,'messageId':'','sentAt':new Date(),'attach':_0x41c958[_0x851a('0x4e')],'attachments':_0x41c958,'originChannel':_0x851a('0xe4'),'ChatWebsiteId':_0x489175['id'],'ChatOfflineMessageId':_0x5c7ae0['id'],'originTo':_0x489175[_0x851a('0xc7')]['email']},'body':_0x5c7ae0[_0x851a('0x56')]};var _0x3d2fac={'account':{'id':_0x489175['MailAccountId']},'body':_0x177eaf,'log':_0x851a('0xe5')};return respondWithRpcPromise(_0x851a('0xe5'),_0x851a('0xe6'),_0x3d2fac,client9001)[_0x851a('0x15')](function(){return _0x5c7ae0;})[_0x851a('0x20')](function(_0x35acdf){logger[_0x851a('0x1c')](_0x35acdf);});}return;})['then'](function(){if(_0x5c7ae0){return _0x5c7ae0;}})['then'](respondWithResult(_0x493f72,null))[_0x851a('0x20')](function(_0xa998d3){logger[_0x851a('0x1c')]('catch',_0xa998d3);for(var _0x578d87 of _0x1bf607){var _0x3a0919=path[_0x851a('0x70')](config['root'],_0x851a('0xe7'),_0x851a('0xc2'),_0x851a('0xd1'),'offline-chat',_0x578d87[_0x851a('0x6b')]);fs_extra[_0x851a('0xe8')](_0x3a0919)['catch'](function(_0x514e7c){logger[_0x851a('0x1c')](_0x851a('0xe9'),_0x3a0919,_0x514e7c);});}});};exports[_0x851a('0xea')]=function(_0x151492,_0x2607d3){return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':{'id':_0x151492[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2607d3,null))[_0x851a('0x15')](function(_0x50396a){if(_0x50396a){return _0x50396a[_0x851a('0xea')](_0x151492[_0x851a('0x56')]['ids'],_['omit'](_0x151492[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{});}})[_0x851a('0x15')](respondWithResult(_0x2607d3,null))[_0x851a('0x20')](handleError(_0x2607d3,null));};exports[_0x851a('0xeb')]=function(_0x339004,_0x42e7e4){var _0x428df0={'raw':![],'where':{}};var _0x29b289={};var _0x4ddb16={'count':0x0,'rows':[]};return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x339004[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x42e7e4,null))['then'](function(_0x55ae16){if(_0x55ae16){_0x29b289[_0x851a('0x3c')]=_['keys'](db[_0x851a('0xad')][_0x851a('0x34')]);_0x29b289['query']=_[_0x851a('0x39')](_0x339004['query']);_0x29b289['filters']=_['intersection'](_0x29b289[_0x851a('0x3c')],_0x29b289[_0x851a('0x3d')]);_0x428df0[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x29b289['model'],qs['fields'](_0x339004[_0x851a('0x3d')][_0x851a('0x3e')]));_0x428df0[_0x851a('0x3f')]=_0x428df0[_0x851a('0x3f')][_0x851a('0x4e')]?_0x428df0['attributes']:_0x29b289[_0x851a('0x3c')];if(!_0x339004[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x428df0[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x339004[_0x851a('0x3d')][_0x851a('0x27')]);_0x428df0['offset']=qs[_0x851a('0x25')](_0x339004['query']['offset']);}_0x428df0[_0x851a('0x41')]=qs['sort'](_0x339004[_0x851a('0x3d')][_0x851a('0x42')]);_0x428df0[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x339004['query'],_0x29b289[_0x851a('0x3a')]));_0x428df0[_0x851a('0x43')][_0x851a('0x5a')]=_0x55ae16['id'];if(_0x339004['query'][_0x851a('0x47')]){_0x428df0['where']=_['merge'](_0x428df0[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x428df0[_0x851a('0x3f')],function(_0x409ef3){var _0x1d7c71={};_0x1d7c71[_0x409ef3]={'$like':'%'+_0x339004[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x1d7c71;})});}_0x428df0=_[_0x851a('0x44')]({},_0x428df0,_0x339004[_0x851a('0x48')]);return db[_0x851a('0xad')][_0x851a('0x28')]({'where':_0x428df0[_0x851a('0x43')]})['then'](function(_0x59dd8f){_0x4ddb16['count']=_0x59dd8f;if(_0x339004[_0x851a('0x3d')][_0x851a('0x63')]){_0x428df0[_0x851a('0x4a')]=[{'model':db['CmContact'],'as':_0x851a('0xec'),'required':![]},{'model':db['User'],'as':_0x851a('0xed'),'attributes':[_0x851a('0x38'),'fullname',_0x851a('0xee')],'required':![]},{'model':db['Tag'],'as':_0x851a('0xef'),'attributes':['id','name',_0x851a('0xf0')],'where':_0x339004[_0x851a('0x3d')][_0x851a('0xf1')]?{'id':_0x339004['query']['tag']}:undefined,'required':_0x339004[_0x851a('0x3d')]['tag']?!![]:![]}];}return db[_0x851a('0xad')][_0x851a('0x4b')](_0x428df0);})[_0x851a('0x15')](function(_0x3ce82f){_0x4ddb16['rows']=_0x3ce82f;return _0x4ddb16;});}})['then'](respondWithFilteredResult(_0x42e7e4,_0x428df0))[_0x851a('0x20')](handleError(_0x42e7e4,null));};function iftimePromise(_0x2d91f2,_0x2044e8){return respondWithRpcPromise(_0x851a('0xf2'),_0x851a('0xf3'),{'command':_0x2044e8[_0x851a('0xf4')]?util['format'](_0x851a('0xf5'),_0x2d91f2[_0x851a('0xf6')],_0x2044e8['timezone']):util[_0x851a('0xa7')]('iftime\x20%s',_0x2d91f2[_0x851a('0xf6')])},client9002)[_0x851a('0x15')](function(_0x535150){var _0x5cedb2=_0x535150&&_0x535150[_0x851a('0xf7')](_0x851a('0xf8'))>=0x0?!![]:![];logger[_0x851a('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2044e8['id'],_0x2d91f2['id'],_0x2d91f2[_0x851a('0xf6')],_0x5cedb2?_0x851a('0xf9'):_0x851a('0xfa'),_0x2044e8[_0x851a('0xf4')]?_0x2044e8[_0x851a('0xf4')]:_0x851a('0xfb'));return _0x5cedb2;})[_0x851a('0x20')](function(_0x3c3e72){logger[_0x851a('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2044e8['id'],_0x2d91f2['id'],_0x2d91f2[_0x851a('0xf6')],util['inspect'](_0x3c3e72,{'showHidden':![],'depth':null}),_0x2044e8[_0x851a('0xf4')]?_0x2044e8[_0x851a('0xf4')]:_0x851a('0xfb'));return![];});}exports[_0x851a('0xf3')]=function(_0x7101ea,_0x3bd222){var _0x130c19=0x0;var _0x20d54a=0x0;var _0x52bb61=![];var _0x3142df;var _0x57d064;return db[_0x851a('0x49')]['find']({'where':{'id':_0x7101ea[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0xfc')],'as':'Interval','include':[{'model':db[_0x851a('0xfc')],'as':'Intervals','attributes':['id',_0x851a('0xf6')],'raw':!![]}]}]})[_0x851a('0x15')](handleEntityNotFound(_0x3bd222,null))[_0x851a('0x15')](function(_0x544878){if(_0x544878){_0x3142df=_0x544878;return _0x544878[_0x851a('0xfd')]({'raw':!![]});}})[_0x851a('0x15')](function(_0x3c7773){if(_0x3142df){if(_0x3c7773){_0x57d064=_0x3c7773;}}return require(_0x851a('0xfe'))[_0x851a('0x73')]();})[_0x851a('0x15')](function(_0x325a6){if(_0x325a6){_0x20d54a=_0x325a6[_0x851a('0xff')];_0x52bb61=_0x325a6[_0x851a('0x100')];}})[_0x851a('0x15')](function(){return db[_0x851a('0xad')][_0x851a('0x28')]({'where':{'closed':![]}});})['then'](function(_0x3d10fd){_0x130c19=_0x3d10fd;if(_0x20d54a&&_0x3d10fd>_0x20d54a){return db['License'][_0x851a('0x5d')]({'where':{'id':0x1}})['then'](function(_0x3c2f7){if(_0x3c2f7){_0x3c2f7['increment'](_0x851a('0x101'));}});}})[_0x851a('0x15')](function(){if(_0x3142df[_0x851a('0xfc')]&&_0x3142df[_0x851a('0xfc')][_0x851a('0x102')]){var _0x48dce4=[];for(var _0x5cc5ae=0x0;_0x5cc5ae<_0x3142df[_0x851a('0xfc')][_0x851a('0x102')]['length'];_0x5cc5ae++){var _0x3f06eb=_0x3142df[_0x851a('0xfc')]['Intervals'][_0x5cc5ae]['get']({'plain':!![]});_0x48dce4[_0x851a('0x103')](iftimePromise(_0x3f06eb,_0x3142df));}return BPromise[_0x851a('0x104')](_0x48dce4)[_0x851a('0x15')](function(_0x474daf){return _[_0x851a('0x105')](_0x474daf);});}else{return!![];}})[_0x851a('0x15')](function(_0x1179bf){var _0x14ea2b=fs[_0x851a('0x106')](path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x107')),'utf8');var _0x28ac85=new url[(_0x851a('0x108'))](_0x3142df['address'])['origin'];var _0x2bd4cd=_0x851a('0x109');var _0x4a1ca7=![];var _0xac4d12={'chatVersion':_0x2bd4cd,'chatWebsiteAddressOrigin':_0x28ac85,'remote':_0x3142df['remote'],'query':querystring[_0x851a('0x1b')](_['merge'](_0x3142df[_0x851a('0x2b')]({'plain':!![]}),{'customerIp':_0x7101ea['headers'][_0x851a('0x10a')]||_0x7101ea['headers'][_0x851a('0x10b')]||_0x7101ea['connection']['remoteAddress']||_0x7101ea['ip'],'referer':_0x7101ea['headers'][_0x851a('0xa4')],'openedInteractions':_0x130c19,'maxInteractions':_0x20d54a,'virtual':_0x52bb61[_0x851a('0xff')],'online':_0x1179bf,'custom':_0x52bb61}))[_0x851a('0x10c')](/'/g,'\x5c\x27')};_0x3bd222['send'](ejs[_0x851a('0xca')](Mustache[_0x851a('0xca')](_0x14ea2b,_0xac4d12),{'proactiveActions':_0x57d064,'alignment':_0x3142df[_0x851a('0x10d')],'verticalAlignment':_0x3142df[_0x851a('0x10e')],'div_color':_0x3142df[_0x851a('0xf0')],'labelText':_0x3142df[_0x851a('0x10f')],'text_color':_0x3142df[_0x851a('0x110')],'text_button_color':_0x3142df[_0x851a('0x111')],'button_color':_0x3142df['color_button'],'background_color':_0x3142df['backgroundColor'],'hideWhenOffline':_0x3142df[_0x851a('0x112')],'intervalId':_0x3142df[_0x851a('0x113')],'isDevelopment':_0x4a1ca7,'chatVersion':_0x2bd4cd}));})[_0x851a('0x20')](handleError(_0x3bd222,null));};exports[_0x851a('0x114')]=function(_0x3917ba,_0xacdbb2){var _0x39456c=_0x3917ba[_0x851a('0x57')]['id'];var _0x2df645=_0x3917ba[_0x851a('0x56')];var _0x8d688f=0xc8;var _0x4f3dd5=null;return db[_0x851a('0xd5')][_0x851a('0x115')]({'isolationLevel':db[_0x851a('0xd5')][_0x851a('0x116')][_0x851a('0x117')][_0x851a('0x118')]},function(_0x52db77){return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x39456c},'transaction':_0x52db77})[_0x851a('0x15')](function(_0x27690f){if(_0x27690f){return db[_0x851a('0x95')]['destroy']({'where':{'ChatWebsiteId':_0x39456c},'transaction':_0x52db77})[_0x851a('0x15')](function(){var _0x326d43=_[_0x851a('0x37')](_0x2df645,function(_0x1321c9){_0x1321c9[_0x851a('0x5a')]=_0x39456c;return _0x1321c9;});return db[_0x851a('0x95')][_0x851a('0xd7')](_0x326d43,{'transaction':_0x52db77});});}else{_0x8d688f=0x194;_0x4f3dd5=[];}});})[_0x851a('0x15')](function(){if(_0x8d688f!==0x194){return db[_0x851a('0x95')][_0x851a('0x119')]({'where':{'ChatWebsiteId':_0x39456c},'order':_0x851a('0x9c')})[_0x851a('0x15')](function(_0x4e5758){_0x4f3dd5=_0x4e5758;});}})[_0x851a('0x20')](function(_0x1eaeb0){_0x8d688f=0x1f4;logger[_0x851a('0x1c')](_0x1eaeb0[_0x851a('0x2f')]);if(_0x1eaeb0[_0x851a('0x38')]){delete _0x1eaeb0[_0x851a('0x38')];}_0x4f3dd5=_0x1eaeb0;})[_0x851a('0x11a')](function(){if(_0x4f3dd5===null){_0xacdbb2[_0x851a('0x21')](_0x8d688f);}else{if(_0x8d688f===0x1f4){_0xacdbb2[_0x851a('0x22')](_0x8d688f)[_0x851a('0x30')](_0x4f3dd5);}else{_0xacdbb2[_0x851a('0x22')](_0x8d688f)['json'](_0x4f3dd5);}}});};exports[_0x851a('0x11b')]=function(_0x3f8bc7,_0x4e6468){var _0xea7707={};var _0x28f4d2={};var _0x271f28;var _0x41fedf;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x3f8bc7[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4e6468,null))[_0x851a('0x15')](function(_0x144777){if(_0x144777){_0x271f28=_0x144777;_0x28f4d2['model']=_[_0x851a('0x39')](db[_0x851a('0x95')][_0x851a('0x34')]);_0x28f4d2['query']=_[_0x851a('0x39')](_0x3f8bc7[_0x851a('0x3d')]);_0x28f4d2[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x28f4d2[_0x851a('0x3c')],_0x28f4d2[_0x851a('0x3d')]);_0xea7707[_0x851a('0x3f')]=_['intersection'](_0x28f4d2[_0x851a('0x3c')],qs[_0x851a('0x3e')](_0x3f8bc7[_0x851a('0x3d')][_0x851a('0x3e')]));_0xea7707[_0x851a('0x3f')]=_0xea7707['attributes'][_0x851a('0x4e')]?_0xea7707['attributes']:_0x28f4d2[_0x851a('0x3c')];_0xea7707[_0x851a('0x41')]=qs['sort'](_0x3f8bc7[_0x851a('0x3d')]['sort']);_0xea7707[_0x851a('0x43')]=qs['filters'](_[_0x851a('0x5f')](_0x3f8bc7[_0x851a('0x3d')],_0x28f4d2['filters']));if(_0x3f8bc7[_0x851a('0x3d')]['filter']){_0xea7707[_0x851a('0x43')]=_[_0x851a('0x44')](_0xea7707[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0xea7707[_0x851a('0x3f')],function(_0x26cd55){var _0x3c6de7={};_0x3c6de7[_0x26cd55]={'$like':'%'+_0x3f8bc7[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x3c6de7;})});}_0xea7707=_[_0x851a('0x44')]({},_0xea7707,_0x3f8bc7[_0x851a('0x48')]);return _0x271f28[_0x851a('0x11b')](_0xea7707);}})[_0x851a('0x15')](function(_0x1e393c){if(_0x1e393c){_0x41fedf=_0x1e393c[_0x851a('0x4e')];if(!_0x3f8bc7['query']['hasOwnProperty'](_0x851a('0x40'))){_0xea7707[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x3f8bc7['query'][_0x851a('0x27')]);_0xea7707[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x3f8bc7['query']['offset']);}return _0x271f28[_0x851a('0x11b')](_0xea7707);}})[_0x851a('0x15')](function(_0x34643a){if(_0x34643a){return _0x34643a?{'count':_0x41fedf,'rows':_0x34643a}:null;}})[_0x851a('0x15')](respondWithResult(_0x4e6468,null))[_0x851a('0x20')](handleError(_0x4e6468,null));};exports['addProactiveActions']=function(_0x46b996,_0x2b12c0){return db[_0x851a('0x11c')][_0x851a('0x4f')]({'where':{'id':_0x46b996[_0x851a('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b12c0,null))[_0x851a('0x15')](function(_0x53a030){if(_0x53a030){return _0x53a030[_0x851a('0x11d')](_0x46b996[_0x851a('0x56')][_0x851a('0x65')],_[_0x851a('0x11e')](_0x46b996[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{});}})[_0x851a('0x15')](respondWithResult(_0x2b12c0,null))[_0x851a('0x20')](handleError(_0x2b12c0,null));};exports['getProactiveActions']=function(_0x35d70a,_0xab74fb){var _0x324395={};var _0x18c479={};var _0x5b922b;var _0x2c22e5;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x35d70a[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0xab74fb,null))[_0x851a('0x15')](function(_0x484a37){if(_0x484a37){_0x5b922b=_0x484a37;_0x18c479[_0x851a('0x3c')]=_[_0x851a('0x39')](db['ChatProactiveAction'][_0x851a('0x34')]);_0x18c479['query']=_[_0x851a('0x39')](_0x35d70a['query']);_0x18c479[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x18c479[_0x851a('0x3c')],_0x18c479[_0x851a('0x3d')]);_0x324395[_0x851a('0x3f')]=_['intersection'](_0x18c479['model'],qs[_0x851a('0x3e')](_0x35d70a[_0x851a('0x3d')][_0x851a('0x3e')]));_0x324395['attributes']=_0x324395[_0x851a('0x3f')][_0x851a('0x4e')]?_0x324395[_0x851a('0x3f')]:_0x18c479[_0x851a('0x3c')];_0x324395[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x35d70a[_0x851a('0x3d')][_0x851a('0x42')]);_0x324395['where']=qs[_0x851a('0x3a')](_['pick'](_0x35d70a[_0x851a('0x3d')],_0x18c479[_0x851a('0x3a')]));if(_0x35d70a[_0x851a('0x3d')][_0x851a('0x47')]){_0x324395['where']=_[_0x851a('0x44')](_0x324395[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x324395[_0x851a('0x3f')],function(_0x5c3e02){var _0x4bdb71={};_0x4bdb71[_0x5c3e02]={'$like':'%'+_0x35d70a['query']['filter']+'%'};return _0x4bdb71;})});}_0x324395=_[_0x851a('0x44')]({},_0x324395,_0x35d70a[_0x851a('0x48')]);return _0x5b922b[_0x851a('0xfd')](_0x324395);}})[_0x851a('0x15')](function(_0x53851a){if(_0x53851a){_0x2c22e5=_0x53851a[_0x851a('0x4e')];if(!_0x35d70a[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x324395[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x35d70a['query']['limit']);_0x324395[_0x851a('0x25')]=qs['offset'](_0x35d70a[_0x851a('0x3d')][_0x851a('0x25')]);}return _0x5b922b[_0x851a('0xfd')](_0x324395);}})[_0x851a('0x15')](function(_0x1e9126){if(_0x1e9126){return _0x1e9126?{'count':_0x2c22e5,'rows':_0x1e9126}:null;}})[_0x851a('0x15')](respondWithResult(_0xab74fb,null))[_0x851a('0x20')](handleError(_0xab74fb,null));};exports[_0x851a('0x11f')]=function(_0x463123,_0x1dc255){var _0x28e51d=_0x463123[_0x851a('0x3d')]['online']===_0x851a('0x120')?_0x851a('0x121'):_0x851a('0x122');return db[_0x851a('0x49')][_0x851a('0x4f')]({'attributes':['id',_0x28e51d],'where':{'id':_0x463123[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x1dc255,null))['then'](function(_0x14abaf){if(_0x14abaf){var _0x76a32a=_0x14abaf[_0x28e51d];var _0x5afbec=_0x76a32a&&_0x76a32a[_0x851a('0x123')]?_0x76a32a[_0x851a('0x123')]:[];_0x1dc255[_0x851a('0x30')]({'fromKey':_[_0x851a('0x78')](_0x76a32a['fromKey'])?undefined:_0x76a32a[_0x851a('0x124')],'count':_0x5afbec[_0x851a('0x4e')],'rows':_0x5afbec});}})['catch'](handleError(_0x1dc255,null));};exports['getOfflineMessages']=function(_0x3368d6,_0x292391){var _0x330c86={'raw':![],'where':{}};var _0x781b29={};var _0x2350fb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x851a('0x5d')]({'where':{'id':_0x3368d6['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x292391,null))[_0x851a('0x15')](function(_0x98e3b3){if(_0x98e3b3){_0x781b29['model']=_[_0x851a('0x39')](db[_0x851a('0xcd')][_0x851a('0x34')]);_0x781b29['query']=_[_0x851a('0x39')](_0x3368d6[_0x851a('0x3d')]);_0x781b29[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x781b29[_0x851a('0x3c')],_0x781b29[_0x851a('0x3d')]);_0x330c86[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x781b29['model'],qs[_0x851a('0x3e')](_0x3368d6['query'][_0x851a('0x3e')]));_0x330c86['attributes']=_0x330c86['attributes'][_0x851a('0x4e')]?_0x330c86[_0x851a('0x3f')]:_0x781b29[_0x851a('0x3c')];if(!_0x3368d6[_0x851a('0x3d')][_0x851a('0x5e')]('nolimit')){_0x330c86['limit']=qs[_0x851a('0x27')](_0x3368d6['query'][_0x851a('0x27')]);_0x330c86[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x3368d6['query']['offset']);}_0x330c86['order']=qs['sort'](_0x3368d6[_0x851a('0x3d')][_0x851a('0x42')]);_0x330c86[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x3368d6[_0x851a('0x3d')],_0x781b29[_0x851a('0x3a')]));_0x330c86['where']['ChatWebsiteId']=_0x98e3b3['id'];if(_0x3368d6['query'][_0x851a('0x47')]){_0x330c86[_0x851a('0x43')]=_[_0x851a('0x44')](_0x330c86[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x330c86[_0x851a('0x3f')],function(_0x309d6d){var _0x3753fc={};_0x3753fc[_0x309d6d]={'$like':'%'+_0x3368d6[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x3753fc;})});}_0x330c86=_[_0x851a('0x44')]({},_0x330c86,_0x3368d6[_0x851a('0x48')]);return db['ChatOfflineMessage']['count']({'where':_0x330c86[_0x851a('0x43')]})[_0x851a('0x15')](function(_0x403225){_0x2350fb[_0x851a('0x28')]=_0x403225;if(_0x3368d6['query'][_0x851a('0x63')]){_0x330c86[_0x851a('0x4a')]=[{'all':!![]}];}else{_0x330c86['include']=[{'model':db['CmContact'],'as':_0x851a('0xec'),'required':![]},{'model':db[_0x851a('0xd6')],'as':_0x851a('0x125'),'required':![]}];}return db[_0x851a('0xcd')][_0x851a('0x4b')](_0x330c86);})[_0x851a('0x15')](function(_0x292154){_0x2350fb[_0x851a('0x4c')]=_0x292154;return _0x2350fb;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x292391,_0x330c86))[_0x851a('0x20')](handleError(_0x292391,null));};exports['addAgents']=function(_0x4beedf,_0x541ab6){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x4beedf[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x541ab6,null))[_0x851a('0x15')](function(_0x28c869){if(_0x28c869){return _0x28c869[_0x851a('0x126')](_0x4beedf[_0x851a('0x56')][_0x851a('0x65')],_[_0x851a('0x11e')](_0x4beedf[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{})[_0x851a('0xb1')](function(_0x29f3e3){for(var _0x2ae8eb=0x0;_0x2ae8eb<_0x4beedf[_0x851a('0x56')][_0x851a('0x65')]['length'];_0x2ae8eb+=0x1){socket[_0x851a('0x127')](_0x851a('0x128'),{'UserId':Number(_0x4beedf['body'][_0x851a('0x65')][_0x2ae8eb]),'ChatWebsiteId':Number(_0x4beedf['params']['id'])});}return _0x29f3e3;});}})[_0x851a('0x15')](respondWithResult(_0x541ab6,null))['catch'](handleError(_0x541ab6,null));};exports[_0x851a('0x129')]=function(_0x441c98,_0x13765e){return db[_0x851a('0x49')]['find']({'where':{'id':_0x441c98[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x13765e,null))[_0x851a('0x15')](function(_0x43f5c7){if(_0x43f5c7){return _0x43f5c7['removeAgents'](_0x441c98['query'][_0x851a('0x65')])[_0x851a('0x15')](function(){if(_['isArray'](_0x441c98[_0x851a('0x3d')][_0x851a('0x65')])){for(var _0x19d809=0x0;_0x19d809<_0x441c98[_0x851a('0x3d')][_0x851a('0x65')][_0x851a('0x4e')];_0x19d809+=0x1){socket['emit'](_0x851a('0x12a'),{'UserId':Number(_0x441c98[_0x851a('0x3d')][_0x851a('0x65')][_0x19d809]),'ChatWebsiteId':Number(_0x441c98['params']['id'])});}}else{socket[_0x851a('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x441c98[_0x851a('0x3d')]['ids']),'ChatWebsiteId':Number(_0x441c98[_0x851a('0x57')]['id'])});}});}})[_0x851a('0x15')](respondWithStatusCode(_0x13765e,null))[_0x851a('0x20')](handleError(_0x13765e,null));};exports[_0x851a('0x12b')]=function(_0x2af7b8,_0x107a14){var _0x41a840={};var _0x5f064c={};var _0x190650;var _0x1c7ce3;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x2af7b8['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x107a14,null))['then'](function(_0x3471d6){if(_0x3471d6){_0x190650=_0x3471d6;_0x5f064c[_0x851a('0x3c')]=_['keys'](db[_0x851a('0xba')]['rawAttributes']);_0x5f064c[_0x851a('0x3d')]=_['keys'](_0x2af7b8[_0x851a('0x3d')]);_0x5f064c['filters']=_['intersection'](_0x5f064c[_0x851a('0x3c')],_0x5f064c[_0x851a('0x3d')]);_0x41a840[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x5f064c[_0x851a('0x3c')],qs['fields'](_0x2af7b8['query'][_0x851a('0x3e')]));_0x41a840[_0x851a('0x3f')]=_0x41a840[_0x851a('0x3f')][_0x851a('0x4e')]?_0x41a840['attributes']:_0x5f064c[_0x851a('0x3c')];_0x41a840[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x2af7b8[_0x851a('0x3d')]['sort']);_0x41a840['where']=qs['filters'](_[_0x851a('0x5f')](_0x2af7b8[_0x851a('0x3d')],_0x5f064c[_0x851a('0x3a')]));if(_0x2af7b8[_0x851a('0x3d')][_0x851a('0x47')]){_0x41a840[_0x851a('0x43')]=_[_0x851a('0x44')](_0x41a840['where'],{'$or':_[_0x851a('0x37')](_0x41a840[_0x851a('0x3f')],function(_0x246479){var _0x24e759={};_0x24e759[_0x246479]={'$like':'%'+_0x2af7b8[_0x851a('0x3d')]['filter']+'%'};return _0x24e759;})});}_0x41a840=_[_0x851a('0x44')]({},_0x41a840,_0x2af7b8['options']);return _0x190650[_0x851a('0x12b')](_0x41a840);}})[_0x851a('0x15')](function(_0x1b79c1){if(_0x1b79c1){_0x1c7ce3=_0x1b79c1[_0x851a('0x4e')];if(!_0x2af7b8['query']['hasOwnProperty'](_0x851a('0x40'))){_0x41a840['limit']=qs[_0x851a('0x27')](_0x2af7b8['query'][_0x851a('0x27')]);_0x41a840[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x2af7b8['query']['offset']);}return _0x190650[_0x851a('0x12b')](_0x41a840);}})[_0x851a('0x15')](function(_0x2707cb){if(_0x2707cb){return _0x2707cb?{'count':_0x1c7ce3,'rows':_0x2707cb}:null;}})['then'](respondWithResult(_0x107a14,null))[_0x851a('0x20')](handleError(_0x107a14,null));};
\ No newline at end of file
+var _0xf5b0=['format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','address','origin','3.1.0','remote','stringify','x-real-ip','connection','virtual','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','READ_COMMITTED','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','index','Pause','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','isNil','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','applications','list','orderBy','priority','asc','Applications','account','contact','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor'];(function(_0x5f4e41,_0x2202e4){var _0x17fe7a=function(_0x50ec25){while(--_0x50ec25){_0x5f4e41['push'](_0x5f4e41['shift']());}};_0x17fe7a(++_0x2202e4);}(_0xf5b0,0x1b0));var _0x0f5b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xf5b0[_0x2d7f0e];return _0x110b07;};'use strict';var BPromise=require(_0x0f5b('0x0'));var Mustache=require(_0x0f5b('0x1'));var util=require(_0x0f5b('0x2'));var path=require(_0x0f5b('0x3'));var ejs=require(_0x0f5b('0x4'));var fs=require('fs');var fs_extra=require(_0x0f5b('0x5'));var _=require(_0x0f5b('0x6'));var querystring=require(_0x0f5b('0x7'));var Redis=require(_0x0f5b('0x8'));var qs=require(_0x0f5b('0x9'));var logger=require(_0x0f5b('0xa'))(_0x0f5b('0xb'));var config=require(_0x0f5b('0xc'));var url=require(_0x0f5b('0xd'));var db=require(_0x0f5b('0xe'))['db'];config[_0x0f5b('0xf')]=_[_0x0f5b('0x10')](config['redis'],{'host':_0x0f5b('0x11'),'port':0x18eb});var socket=require(_0x0f5b('0x12'))(new Redis(config['redis']));require(_0x0f5b('0x13'))[_0x0f5b('0x14')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x0f5b('0x15'));var client=jayson[_0x0f5b('0x16')][_0x0f5b('0x17')]({'port':0x232c});var client9002=jayson[_0x0f5b('0x16')]['http']({'port':0x232a});var client9003=jayson[_0x0f5b('0x16')]['http']({'port':0x232b});var client9001=jayson[_0x0f5b('0x16')][_0x0f5b('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x4ab5c4,_0x14b2bc,_0x1fc930,_0xf67b58){return new BPromise(function(_0x1f4994,_0x1409ed){var _0x37bd40=_0xf67b58||client;return _0x37bd40[_0x0f5b('0x18')](_0x4ab5c4,_0x1fc930)[_0x0f5b('0x19')](function(_0x586203){logger[_0x0f5b('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x14b2bc,_0x0f5b('0x1b'));logger[_0x0f5b('0x1c')](_0x0f5b('0x1d'),_0x14b2bc,'request\x20sent',JSON['stringify'](_0x586203));if(_0x586203[_0x0f5b('0x1e')]){if(_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x1f')]===0x1f4){logger[_0x0f5b('0x1e')](_0x0f5b('0x20'),_0x14b2bc,_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x21')]);return _0x1409ed(_0x586203['error'][_0x0f5b('0x21')]);}logger[_0x0f5b('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x14b2bc,_0x586203[_0x0f5b('0x1e')]['message']);return _0x1f4994(_0x586203[_0x0f5b('0x1e')][_0x0f5b('0x21')]);}else{logger[_0x0f5b('0x1a')](_0x0f5b('0x20'),_0x14b2bc,_0x0f5b('0x1b'));_0x1f4994(_0x586203[_0x0f5b('0x22')]['message']);}})[_0x0f5b('0x23')](function(_0x1d568b){logger[_0x0f5b('0x1e')](_0x0f5b('0x20'),_0x14b2bc,_0x1d568b);_0x1409ed(_0x1d568b);});});}function respondWithStatusCode(_0x3c1b65,_0x10ca85){_0x10ca85=_0x10ca85||0xcc;return function(_0xca9a5e){if(_0xca9a5e){return _0x3c1b65[_0x0f5b('0x24')](_0x10ca85);}return _0x3c1b65[_0x0f5b('0x25')](_0x10ca85)[_0x0f5b('0x26')]();};}function respondWithResult(_0x1ab07e,_0x55b5ad){_0x55b5ad=_0x55b5ad||0xc8;return function(_0x5c0f76){if(_0x5c0f76){return _0x1ab07e[_0x0f5b('0x25')](_0x55b5ad)[_0x0f5b('0x27')](_0x5c0f76);}};}function respondWithFilteredResult(_0x1e5dcd,_0x1f72f9){return function(_0x47876b){if(_0x47876b){var _0x435ba4=typeof _0x1f72f9['offset']===_0x0f5b('0x28')&&typeof _0x1f72f9[_0x0f5b('0x29')]===_0x0f5b('0x28');var _0x563dbb=_0x47876b[_0x0f5b('0x2a')];var _0x8276ca=_0x435ba4?0x0:_0x1f72f9[_0x0f5b('0x2b')];var _0x47f7a2=_0x435ba4?_0x47876b[_0x0f5b('0x2a')]:_0x1f72f9[_0x0f5b('0x2b')]+_0x1f72f9[_0x0f5b('0x29')];var _0x9afef3;if(_0x47f7a2>=_0x563dbb){_0x47f7a2=_0x563dbb;_0x9afef3=0xc8;}else{_0x9afef3=0xce;}_0x1e5dcd[_0x0f5b('0x25')](_0x9afef3);return _0x1e5dcd[_0x0f5b('0x2c')](_0x0f5b('0x2d'),_0x8276ca+'-'+_0x47f7a2+'/'+_0x563dbb)[_0x0f5b('0x27')](_0x47876b);}return null;};}function saveUpdates(_0x4b5c95){return function(_0x4c40d0){if(_0x4c40d0){return _0x4c40d0[_0x0f5b('0x2e')](_0x4b5c95)[_0x0f5b('0x19')](function(_0x2dea93){return _0x2dea93;});}return null;};}function removeEntity(_0x103e5a){return function(_0x239d9b){if(_0x239d9b){return _0x239d9b[_0x0f5b('0x2f')]()[_0x0f5b('0x19')](function(){var _0x25c19b=_0x239d9b[_0x0f5b('0x30')]({'plain':!![]});var _0x22a52d=_0x0f5b('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x22a52d,'resourceId':_0x25c19b['id']}})[_0x0f5b('0x19')](function(){return _0x239d9b;});})['then'](function(){_0x103e5a[_0x0f5b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330eee){return function(_0x4d3710){if(!_0x4d3710){_0x330eee['sendStatus'](0x194);}return _0x4d3710;};}function handleError(_0x47d1ee,_0x2d1ff4){_0x2d1ff4=_0x2d1ff4||0x1f4;return function(_0x3ce13d){logger[_0x0f5b('0x1e')](_0x3ce13d[_0x0f5b('0x32')]);if(_0x3ce13d['name']){delete _0x3ce13d[_0x0f5b('0x33')];}_0x47d1ee['status'](_0x2d1ff4)['send'](_0x3ce13d);};}exports[_0x0f5b('0x34')]=function(_0x4a5044,_0x18db3e){var _0x36eeef={'include':[{'model':db[_0x0f5b('0x35')],'as':'mandatoryDispositionPause'}]},_0x143edf={},_0x251350={'count':0x0,'rows':[]};var _0x3eba05=_['map'](db[_0x0f5b('0x36')][_0x0f5b('0x37')],function(_0x1bd1f3){return{'name':_0x1bd1f3[_0x0f5b('0x38')],'type':_0x1bd1f3[_0x0f5b('0x39')][_0x0f5b('0x3a')]};});_0x143edf[_0x0f5b('0x3b')]=_['map'](_0x3eba05,'name');_0x143edf[_0x0f5b('0x3c')]=_['keys'](_0x4a5044[_0x0f5b('0x3c')]);_0x143edf[_0x0f5b('0x3d')]=_['intersection'](_0x143edf[_0x0f5b('0x3b')],_0x143edf[_0x0f5b('0x3c')]);_0x36eeef[_0x0f5b('0x3e')]=_['intersection'](_0x143edf[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x36eeef[_0x0f5b('0x3e')]=_0x36eeef[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x36eeef[_0x0f5b('0x3e')]:_0x143edf[_0x0f5b('0x3b')];if(!_0x4a5044['query'][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x36eeef[_0x0f5b('0x29')]=qs['limit'](_0x4a5044[_0x0f5b('0x3c')]['limit']);_0x36eeef[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x36eeef[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x4a5044['query']['sort']);_0x36eeef[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x4a5044[_0x0f5b('0x3c')],_0x143edf['filters']),_0x3eba05);if(_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x36eeef['where']=_[_0x0f5b('0x48')](_0x36eeef['where'],{'$or':_[_0x0f5b('0x49')](_0x3eba05,function(_0x15e57b){if(_0x15e57b[_0x0f5b('0x39')]!=='VIRTUAL'){var _0x2eb6bb={};_0x2eb6bb[_0x15e57b[_0x0f5b('0x33')]]={'$like':'%'+_0x4a5044[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x2eb6bb;}})});}_0x36eeef=_[_0x0f5b('0x48')]({},_0x36eeef,_0x4a5044[_0x0f5b('0x4a')]);var _0x589f31={'where':_0x36eeef[_0x0f5b('0x45')]};return db[_0x0f5b('0x36')][_0x0f5b('0x2a')](_0x589f31)[_0x0f5b('0x19')](function(_0x5d495f){_0x251350[_0x0f5b('0x2a')]=_0x5d495f;if(_0x4a5044['query'][_0x0f5b('0x4b')]){_0x36eeef[_0x0f5b('0x4c')]=[{'all':!![]}];}return db[_0x0f5b('0x36')][_0x0f5b('0x4d')](_0x36eeef);})[_0x0f5b('0x19')](function(_0x4e5396){_0x251350[_0x0f5b('0x4e')]=_0x4e5396;return _0x251350;})['then'](respondWithFilteredResult(_0x18db3e,_0x36eeef))[_0x0f5b('0x23')](handleError(_0x18db3e,null));};exports[_0x0f5b('0x4f')]=function(_0x10d64c,_0x1625e2){var _0x14aaa3={'raw':![],'where':{'id':_0x10d64c[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x35')],'as':_0x0f5b('0x51')}]},_0x3dcb37={};_0x3dcb37[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x36')]['rawAttributes']);_0x3dcb37[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x10d64c[_0x0f5b('0x3c')]);_0x3dcb37[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x3dcb37[_0x0f5b('0x3b')],_0x3dcb37[_0x0f5b('0x3c')]);_0x14aaa3[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x3dcb37['model'],qs[_0x0f5b('0x3f')](_0x10d64c[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x14aaa3[_0x0f5b('0x3e')]=_0x14aaa3[_0x0f5b('0x3e')]['length']?_0x14aaa3[_0x0f5b('0x3e')]:_0x3dcb37['model'];if(_0x10d64c[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x14aaa3[_0x0f5b('0x4c')]=[{'all':!![]}];}_0x14aaa3=_['merge']({},_0x14aaa3,_0x10d64c[_0x0f5b('0x4a')]);return db[_0x0f5b('0x36')][_0x0f5b('0x54')](_0x14aaa3)[_0x0f5b('0x19')](handleEntityNotFound(_0x1625e2,null))['then'](respondWithResult(_0x1625e2,null))[_0x0f5b('0x23')](handleError(_0x1625e2,null));};exports[_0x0f5b('0x55')]=function(_0x4c5423,_0x2aae97){return db['ChatWebsite'][_0x0f5b('0x55')](_0x4c5423[_0x0f5b('0x56')],{})['then'](function(_0x12634c){var _0x50ff40=_0x4c5423[_0x0f5b('0x57')][_0x0f5b('0x30')]({'plain':!![]});if(!_0x50ff40)throw new Error(_0x0f5b('0x58'));if(_0x50ff40['role']==='user'){var _0x331fd4=_0x12634c[_0x0f5b('0x30')]({'plain':!![]});var _0x5a1f5b=_0x0f5b('0x31');return db[_0x0f5b('0x59')][_0x0f5b('0x54')]({'where':{'name':_0x5a1f5b,'userProfileId':_0x50ff40[_0x0f5b('0x5a')]},'raw':!![]})[_0x0f5b('0x19')](function(_0x40ed14){if(_0x40ed14&&_0x40ed14['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x331fd4[_0x0f5b('0x33')],'resourceId':_0x331fd4['id'],'type':_0x40ed14[_0x0f5b('0x33')],'sectionId':_0x40ed14['id']},{})['then'](function(){return _0x12634c;});}else{return _0x12634c;}})[_0x0f5b('0x23')](function(_0x38dcb8){logger[_0x0f5b('0x1e')](_0x0f5b('0x5b'),_0x38dcb8);throw _0x38dcb8;});}return _0x12634c;})[_0x0f5b('0x19')](respondWithResult(_0x2aae97,0xc9))['catch'](handleError(_0x2aae97,null));};exports[_0x0f5b('0x2e')]=function(_0x3c390d,_0x27abb8){if(_0x3c390d[_0x0f5b('0x56')]['id']){delete _0x3c390d[_0x0f5b('0x56')]['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x3c390d[_0x0f5b('0x50')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x27abb8,null))['then'](saveUpdates(_0x3c390d[_0x0f5b('0x56')],null))[_0x0f5b('0x19')](respondWithResult(_0x27abb8,null))[_0x0f5b('0x23')](handleError(_0x27abb8,null));};exports[_0x0f5b('0x2f')]=function(_0x680490,_0x35e2e6){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x680490[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x35e2e6,null))['then'](removeEntity(_0x35e2e6,null))[_0x0f5b('0x23')](handleError(_0x35e2e6,null));};exports[_0x0f5b('0x5c')]=function(_0x1210f8,_0x2c3689){return db[_0x0f5b('0x36')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](respondWithResult(_0x2c3689,null))[_0x0f5b('0x23')](handleError(_0x2c3689,null));};exports[_0x0f5b('0x5d')]=function(_0x530d9a,_0x555e5e){if(_0x530d9a['body']['id']){delete _0x530d9a['body']['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x530d9a[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x555e5e,null))['then'](function(_0x359a77){if(_0x359a77){_0x530d9a[_0x0f5b('0x56')][_0x0f5b('0x5e')]=_0x359a77['id'];return db[_0x0f5b('0x5f')]['create'](_0x530d9a['body']);}})[_0x0f5b('0x19')](respondWithResult(_0x555e5e,null))['catch'](handleError(_0x555e5e,null));};exports[_0x0f5b('0x60')]=function(_0x39ef7b,_0x2fe92c){var _0x1bec81={'raw':![],'where':{}};var _0x7a9ffd={};var _0x3ed37c={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x39ef7b[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2fe92c,null))[_0x0f5b('0x19')](function(_0x1f116c){if(_0x1f116c){_0x7a9ffd[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x5f')][_0x0f5b('0x37')]);_0x7a9ffd['query']=_['keys'](_0x39ef7b[_0x0f5b('0x3c')]);_0x7a9ffd[_0x0f5b('0x3d')]=_['intersection'](_0x7a9ffd[_0x0f5b('0x3b')],_0x7a9ffd[_0x0f5b('0x3c')]);_0x1bec81[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x7a9ffd[_0x0f5b('0x3b')],qs['fields'](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x1bec81[_0x0f5b('0x3e')]=_0x1bec81[_0x0f5b('0x3e')]['length']?_0x1bec81['attributes']:_0x7a9ffd[_0x0f5b('0x3b')];if(!_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x1bec81['limit']=qs['limit'](_0x39ef7b['query'][_0x0f5b('0x29')]);_0x1bec81[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x1bec81['order']=qs['sort'](_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x44')]);_0x1bec81[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x39ef7b['query'],_0x7a9ffd[_0x0f5b('0x3d')]));_0x1bec81[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x1f116c['id'];if(_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x1bec81[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x1bec81['where'],{'$or':_[_0x0f5b('0x49')](_0x1bec81[_0x0f5b('0x3e')],function(_0x1de2f6){var _0x39ae60={};_0x39ae60[_0x1de2f6]={'$like':'%'+_0x39ef7b[_0x0f5b('0x3c')]['filter']+'%'};return _0x39ae60;})});}_0x1bec81=_[_0x0f5b('0x48')]({},_0x1bec81,_0x39ef7b[_0x0f5b('0x4a')]);return db['Disposition'][_0x0f5b('0x2a')]({'where':_0x1bec81['where']})[_0x0f5b('0x19')](function(_0x1dd95d){_0x3ed37c[_0x0f5b('0x2a')]=_0x1dd95d;if(_0x39ef7b[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x1bec81[_0x0f5b('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x0f5b('0x4d')](_0x1bec81);})[_0x0f5b('0x19')](function(_0x433e3d){_0x3ed37c[_0x0f5b('0x4e')]=_0x433e3d;return _0x3ed37c;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x2fe92c,_0x1bec81))[_0x0f5b('0x23')](handleError(_0x2fe92c,null));};exports[_0x0f5b('0x61')]=function(_0x2aacbe,_0x247e12){return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x2aacbe[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x247e12,null))['then'](function(_0x2c7ee4){if(_0x2c7ee4){return _0x2c7ee4['removeDispositions'](_0x2aacbe['query'][_0x0f5b('0x62')]);}})[_0x0f5b('0x19')](respondWithStatusCode(_0x247e12,null))[_0x0f5b('0x23')](handleError(_0x247e12,null));};exports[_0x0f5b('0x63')]=function(_0x16fc42,_0x1e1865){if(_0x16fc42[_0x0f5b('0x56')]['id']){delete _0x16fc42['body']['id'];}return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x16fc42['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x1e1865,null))['then'](function(_0x479af2){if(_0x479af2){_0x16fc42[_0x0f5b('0x56')][_0x0f5b('0x5e')]=_0x479af2['id'];return db[_0x0f5b('0x64')][_0x0f5b('0x55')](_0x16fc42[_0x0f5b('0x56')]);}})[_0x0f5b('0x19')](respondWithResult(_0x1e1865,null))[_0x0f5b('0x23')](handleError(_0x1e1865,null));};exports[_0x0f5b('0x65')]=function(_0x318b8f,_0x5ddd29){var _0x46a973={'raw':![],'where':{}};var _0x5bc8c5={};var _0x2c3144={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')][_0x0f5b('0x66')]({'where':{'id':_0x318b8f[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x5ddd29,null))[_0x0f5b('0x19')](function(_0x2501c7){if(_0x2501c7){_0x5bc8c5['model']=_[_0x0f5b('0x52')](db['CannedAnswer'][_0x0f5b('0x37')]);_0x5bc8c5[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x318b8f[_0x0f5b('0x3c')]);_0x5bc8c5['filters']=_[_0x0f5b('0x53')](_0x5bc8c5['model'],_0x5bc8c5[_0x0f5b('0x3c')]);_0x46a973[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x5bc8c5['model'],qs[_0x0f5b('0x3f')](_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x46a973[_0x0f5b('0x3e')]=_0x46a973[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x46a973['attributes']:_0x5bc8c5[_0x0f5b('0x3b')];if(!_0x318b8f['query']['hasOwnProperty'](_0x0f5b('0x42'))){_0x46a973[_0x0f5b('0x29')]=qs['limit'](_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x46a973[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x318b8f[_0x0f5b('0x3c')]['offset']);}_0x46a973[_0x0f5b('0x43')]=qs['sort'](_0x318b8f[_0x0f5b('0x3c')]['sort']);_0x46a973[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x318b8f['query'],_0x5bc8c5['filters']));_0x46a973[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x2501c7['id'];if(_0x318b8f[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x46a973[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x46a973[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x46a973[_0x0f5b('0x3e')],function(_0xf3c836){var _0x3896a4={};_0x3896a4[_0xf3c836]={'$like':'%'+_0x318b8f['query'][_0x0f5b('0x47')]+'%'};return _0x3896a4;})});}_0x46a973=_['merge']({},_0x46a973,_0x318b8f[_0x0f5b('0x4a')]);return db[_0x0f5b('0x64')]['count']({'where':_0x46a973[_0x0f5b('0x45')]})[_0x0f5b('0x19')](function(_0x93fc01){_0x2c3144['count']=_0x93fc01;if(_0x318b8f['query'][_0x0f5b('0x4b')]){_0x46a973[_0x0f5b('0x4c')]=[{'all':!![]}];}return db[_0x0f5b('0x64')][_0x0f5b('0x4d')](_0x46a973);})[_0x0f5b('0x19')](function(_0x5f380a){_0x2c3144[_0x0f5b('0x4e')]=_0x5f380a;return _0x2c3144;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x5ddd29,_0x46a973))[_0x0f5b('0x23')](handleError(_0x5ddd29,null));};exports[_0x0f5b('0x67')]=function(_0x1aebc9,_0x437842){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x1aebc9[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x437842,null))[_0x0f5b('0x19')](function(_0x614418){if(_0x614418){return _0x614418[_0x0f5b('0x67')](_0x1aebc9['query']['ids']);}})[_0x0f5b('0x19')](respondWithStatusCode(_0x437842,null))[_0x0f5b('0x23')](handleError(_0x437842,null));};exports['addLogo']=function(_0x110bea,_0x2f80b6){_0x110bea['body'][_0x0f5b('0x68')]=_0x110bea[_0x0f5b('0x69')][_0x0f5b('0x6a')];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x110bea[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2f80b6,null))[_0x0f5b('0x19')](saveUpdates(_0x110bea['body'],null))[_0x0f5b('0x19')](respondWithResult(_0x2f80b6,null))[_0x0f5b('0x23')](handleError(_0x2f80b6,null));};exports[_0x0f5b('0x6b')]=function(_0x3753ff,_0x5f17d5){_0x3753ff[_0x0f5b('0x56')][_0x0f5b('0x6c')]=_0x3753ff['file']['filename'];return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x3753ff[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x5f17d5,null))[_0x0f5b('0x19')](saveUpdates(_0x3753ff[_0x0f5b('0x56')],null))[_0x0f5b('0x19')](respondWithResult(_0x5f17d5,null))[_0x0f5b('0x23')](handleError(_0x5f17d5,null));};exports[_0x0f5b('0x6d')]=function(_0x468f23,_0x2893c5){_0x468f23[_0x0f5b('0x56')][_0x0f5b('0x6e')]=_0x468f23[_0x0f5b('0x69')]['filename'];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x468f23['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2893c5,null))['then'](saveUpdates(_0x468f23[_0x0f5b('0x56')],null))['then'](respondWithResult(_0x2893c5,null))['catch'](handleError(_0x2893c5,null));};exports[_0x0f5b('0x6f')]=function(_0xe774e0,_0x523af1){_0xe774e0[_0x0f5b('0x56')][_0x0f5b('0x70')]=_0xe774e0[_0x0f5b('0x69')][_0x0f5b('0x6a')];return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0xe774e0[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x523af1,null))[_0x0f5b('0x19')](saveUpdates(_0xe774e0[_0x0f5b('0x56')],null))['then'](respondWithResult(_0x523af1,null))[_0x0f5b('0x23')](handleError(_0x523af1,null));};exports[_0x0f5b('0x71')]=function(_0x4b2714,_0x12d81c){var _0x326921=path['join'](config[_0x0f5b('0x72')],'server/files/images/logos/default_logo.svg');var _0x98f0e4={'where':{'id':_0x4b2714[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x68')],'raw':!![]};var _0x13fe04=![];return require('../../config/license/util')[_0x0f5b('0x73')]()[_0x0f5b('0x19')](function(_0x341fe1){if(_0x341fe1){_0x13fe04=_0x341fe1['custom'];}})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')](_0x98f0e4);})[_0x0f5b('0x19')](handleEntityNotFound(_0x12d81c,null))[_0x0f5b('0x19')](function(_0x13a183){if(_0x13a183){if(!_[_0x0f5b('0x74')](_0x13a183[_0x0f5b('0x68')])){if(fs['existsSync'](path['join'](config['root'],_0x0f5b('0x75'),_0x13a183[_0x0f5b('0x68')]))&&_0x13fe04){_0x326921=path[_0x0f5b('0x76')](config['root'],_0x0f5b('0x75'),_0x13a183['sitepic']);}}return _0x12d81c[_0x0f5b('0x77')](_0x326921);}})[_0x0f5b('0x23')](handleError(_0x12d81c,null));};exports[_0x0f5b('0x78')]=function(_0x18f3b3,_0x57c484){var _0x5a4a24=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x79'));var _0x15c201={'where':{'id':_0x18f3b3[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x6c')],'raw':!![]};return db[_0x0f5b('0x36')]['find'](_0x15c201)['then'](handleEntityNotFound(_0x57c484,null))['then'](function(_0x2c9b19){if(_0x2c9b19){if(!_['isNil'](_0x2c9b19[_0x0f5b('0x6c')])){if(fs['existsSync'](path[_0x0f5b('0x76')](config['root'],'server/files/images/avatars/',_0x2c9b19[_0x0f5b('0x6c')]))){_0x5a4a24=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7a'),_0x2c9b19[_0x0f5b('0x6c')]);}}return _0x57c484[_0x0f5b('0x77')](_0x5a4a24);}})['catch'](handleError(_0x57c484,null));};exports['getCustomerAvatar']=function(_0x1a1648,_0x40f1ab){var _0x180823=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7b'));var _0x38f120={'where':{'id':_0x1a1648[_0x0f5b('0x50')]['id']},'attributes':['id',_0x0f5b('0x6e'),_0x0f5b('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x0f5b('0x54')](_0x38f120)['then'](handleEntityNotFound(_0x40f1ab,null))[_0x0f5b('0x19')](function(_0x52a482){if(_0x52a482){if(!_[_0x0f5b('0x74')](_0x52a482[_0x0f5b('0x6e')])){if(fs[_0x0f5b('0x7d')](path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7a'),_0x52a482[_0x0f5b('0x6e')]))&&_0x52a482[_0x0f5b('0x7c')]){_0x180823=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/images/avatars/',_0x52a482[_0x0f5b('0x6e')]);}}return _0x40f1ab[_0x0f5b('0x77')](_0x180823);}})[_0x0f5b('0x23')](handleError(_0x40f1ab,null));};exports[_0x0f5b('0x7e')]=function(_0x4acbce,_0x40d90f){var _0x443fae=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0x7f'));var _0xf9bb40={'where':{'id':_0x4acbce['params']['id']},'attributes':['id',_0x0f5b('0x70')],'raw':!![]};return db['ChatWebsite'][_0x0f5b('0x54')](_0xf9bb40)[_0x0f5b('0x19')](handleEntityNotFound(_0x40d90f,null))['then'](function(_0x43c1bb){if(_0x43c1bb){if(!_[_0x0f5b('0x74')](_0x43c1bb[_0x0f5b('0x70')])){if(fs[_0x0f5b('0x7d')](path['join'](config['root'],'server/files/images/avatars/',_0x43c1bb['systemAvatar']))){_0x443fae=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/images/avatars/',_0x43c1bb['systemAvatar']);}}return _0x40d90f['download'](_0x443fae);}})[_0x0f5b('0x23')](handleError(_0x40d90f,null));};exports[_0x0f5b('0x80')]=function(_0x15d8f3,_0x3f4f5d){var _0x1e4ef5=require('user-agent-parser');var _0x9ba9a=new _0x1e4ef5();var _0x7f2e83=_0x9ba9a[_0x0f5b('0x81')](_0x15d8f3[_0x0f5b('0x82')]['user-agent'])['getResult']();var _0x1d5e41={'body':_0x15d8f3[_0x0f5b('0x56')],'channel':_0x0f5b('0x83')};var _0xdc477=[];var _0x37b81b=[];var _0x29c2b8={};var _0x4affb6=![];return db[_0x0f5b('0x84')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](function(_0xf5b62){if(!_0xf5b62){throw new db['Sequelize'][(_0x0f5b('0x85'))](_0x0f5b('0x86'));}_0xdc477=_[_0x0f5b('0x87')](_[_0x0f5b('0x52')](_0xf5b62),[_0x0f5b('0x88'),_0x0f5b('0x89')]);_0x37b81b=_[_0x0f5b('0x87')](_[_0x0f5b('0x52')](_0xf5b62),[_0x0f5b('0x88'),_0x0f5b('0x89'),_0x0f5b('0x8a'),_0x0f5b('0x8b')]);if(_0x15d8f3[_0x0f5b('0x56')]['id']){delete _0x15d8f3[_0x0f5b('0x56')]['id'];}if(_['isNil'](_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')])){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x8e'));}if(_[_0x0f5b('0x74')](_0x15d8f3['body']['body'])||_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x56')]===''){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x8f'));}if(_['isNil'](_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')])){throw new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))](_0x0f5b('0x91')+_0x37b81b);}if(!_[_0x0f5b('0x92')](_0x37b81b,_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')])){throw new db[(_0x0f5b('0x8d'))]['ValidationError'](_0x0f5b('0x93')+_0x37b81b);}_0x29c2b8[_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')]]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')];})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x15d8f3[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x94')],'as':_0x0f5b('0x95'),'include':[{'model':db[_0x0f5b('0x84')],'as':_0x0f5b('0x96'),'where':_0x29c2b8,'limit':0x1,'order':[[_0x0f5b('0x89'),'DESC']]}]},{'model':db[_0x0f5b('0x97')],'as':'Applications'}]});})[_0x0f5b('0x19')](handleEntityNotFound(_0x3f4f5d,null))[_0x0f5b('0x19')](function(_0x8e4d63){if(_0x8e4d63&&_0x8e4d63[_0x0f5b('0x95')]){_0x1d5e41['account']=_0x8e4d63;_0x1d5e41[_0x0f5b('0x98')]=_0x8e4d63['Applications'];_0x1d5e41[_0x0f5b('0x99')]=_0x8e4d63[_0x0f5b('0x95')];_0x1d5e41[_0x0f5b('0x98')]=_[_0x0f5b('0x9a')](_0x1d5e41[_0x0f5b('0x98')],[_0x0f5b('0x9b')],[_0x0f5b('0x9c')]);if(_0x1d5e41['account'][_0x0f5b('0x9d')]){delete _0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x9d')];}if(_0x1d5e41['account']['List']&&_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x95')][_0x0f5b('0x96')][_0x0f5b('0x40')]){return _0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0x95')][_0x0f5b('0x96')][0x0];}var _0x49c206=_[_0x0f5b('0x10')](_0x15d8f3[_0x0f5b('0x56')],{'firstName':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'ListId':_0x8e4d63[_0x0f5b('0x8b')]});_0x49c206[_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x90')]]=_0x15d8f3['body'][_0x0f5b('0x8c')];return db['CmContact'][_0x0f5b('0x55')](_0x49c206,{'fields':_0xdc477,'raw':!![]});}})[_0x0f5b('0x19')](handleEntityNotFound(_0x3f4f5d,null))[_0x0f5b('0x19')](function(_0x5b186e){_0x1d5e41[_0x0f5b('0x9f')]=_0x5b186e;var _0x2c842d=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xa0')];if(_0x15d8f3[_0x0f5b('0x82')]['cf-connecting-ip']){_0x2c842d=_0x15d8f3[_0x0f5b('0x82')]['cf-connecting-ip'];}else if(_0x15d8f3[_0x0f5b('0x82')][_0x0f5b('0xa1')]){_0x2c842d=_[_0x0f5b('0xa2')](_0x15d8f3['headers']['x-forwarded-for'][_0x0f5b('0xa3')](','));}if(_0x5b186e){var _0x46afe9={'ContactId':_0x5b186e['id'],'ChatWebsiteId':_0x15d8f3[_0x0f5b('0x50')]['id'],'from':(_0x5b186e[_0x0f5b('0xa4')]||'')+'\x20'+(_0x5b186e[_0x0f5b('0xa5')]||''),'customerIp':_0x2c842d,'customerPort':_0x15d8f3['headers'][_0x0f5b('0xa6')]?_0x15d8f3[_0x0f5b('0x82')]['x-real-port']:null,'referer':_0x15d8f3['body'][_0x0f5b('0xa7')],'browserName':_0x7f2e83[_0x0f5b('0xa8')][_0x0f5b('0x33')]&&_0x7f2e83['browser']['version']?util['format']('%s\x20%s',_0x7f2e83[_0x0f5b('0xa8')]['name'],_0x7f2e83['browser'][_0x0f5b('0xa9')]):_0x0f5b('0xaa'),'browserVersion':_0x7f2e83[_0x0f5b('0xa8')][_0x0f5b('0xa9')]||'unknown','osName':util['format'](_0x0f5b('0xab'),_0x7f2e83['os'][_0x0f5b('0x33')],_0x7f2e83['os']['version']),'osVersion':_0x7f2e83['os']['version'],'deviceModel':_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0x3b')]&&_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')]?util[_0x0f5b('0xae')](_0x0f5b('0xaf'),_0x7f2e83['device'][_0x0f5b('0x3b')],_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')],_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0x39')]):null,'deviceVendor':_0x7f2e83[_0x0f5b('0xac')][_0x0f5b('0xad')],'deviceType':_0x7f2e83['device'][_0x0f5b('0x39')],'formData':JSON['stringify'](_0x15d8f3[_0x0f5b('0x56')])};var _0x8ea050={'ChatWebsiteId':_0x15d8f3['params']['id'],'closed':![]};if(_0x15d8f3['body']['threadId']){_0x8ea050['threadId']=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')];return db[_0x0f5b('0xb1')]['find']({'where':_0x8ea050})[_0x0f5b('0x19')](function(_0x28deda){if(_0x28deda){return[_0x28deda,![]];}_0x46afe9[_0x0f5b('0xb0')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')];_0x46afe9[_0x0f5b('0xb2')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb2')];return db['ChatInteraction'][_0x0f5b('0x55')](_0x46afe9)[_0x0f5b('0x19')](function(_0x53da6e){return[_0x53da6e,!![]];});});}_0x8ea050[_0x0f5b('0xb3')]=_0x5b186e['id'];if(_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]['id']){_0x8ea050['id']=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb4')]['id'];return db['ChatInteraction'][_0x0f5b('0x54')]({'where':_0x8ea050})['then'](function(_0x1be906){if(_0x1be906){return[_0x1be906,![]];}return db[_0x0f5b('0xb1')][_0x0f5b('0x55')](_0x46afe9)['then'](function(_0x3e1205){return[_0x3e1205,!![]];});});}return db[_0x0f5b('0xb1')][_0x0f5b('0x55')](_0x46afe9)[_0x0f5b('0x19')](function(_0x1986e3){return[_0x1986e3,!![]];});}})['spread'](function(_0x2d5cac,_0x456de5){if(_0x2d5cac){_0x4affb6=_0x456de5;if(!_0x456de5){var _0x907cc4={'from':(_0x1d5e41['contact']['firstName']||'')+'\x20'+(_0x1d5e41[_0x0f5b('0x9f')][_0x0f5b('0xa5')]||'')};if(_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb5')]&&_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb0')]!=_0x15d8f3['body'][_0x0f5b('0xb5')]){_0x907cc4[_0x0f5b('0xb0')]=_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xb5')];}return _0x2d5cac[_0x0f5b('0x2e')](_0x907cc4);}else{return _0x2d5cac;}}})['then'](function(_0xf8fc2c){_0x1d5e41['interaction']=_0xf8fc2c[_0x0f5b('0x30')]({'plain':!![]});_0x1d5e41['interaction'][_0x0f5b('0xb6')]=_0x4affb6;if(_0x1d5e41[_0x0f5b('0xb4')][_0x0f5b('0xb6')]){if(_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0xb7')]){_0x1d5e41['applications']['push']({'id':0x0,'priority':_0x1d5e41['applications'][_0x0f5b('0x40')]+0x1,'app':_0x0f5b('0xb8'),'appdata':_0x0f5b('0xb9'),'interval':_0x0f5b('0xba')});}}return db[_0x0f5b('0xbb')][_0x0f5b('0x55')]({'body':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0x56')],'ChatWebsiteId':_0x15d8f3[_0x0f5b('0x50')]['id'],'ChatInteractionId':_0xf8fc2c['id'],'direction':'in','ContactId':_0x1d5e41['contact']['id'],'AttachmentId':_0x15d8f3[_0x0f5b('0x56')][_0x0f5b('0xbc')]});})[_0x0f5b('0x19')](function(_0x3f1e36){_0x1d5e41[_0x0f5b('0x21')]=_0x3f1e36;if(_0x1d5e41[_0x0f5b('0xb4')][_0x0f5b('0xbd')]){return db[_0x0f5b('0xbe')]['find']({'attributes':['id',_0x0f5b('0x33')],'where':{'id':_0x1d5e41[_0x0f5b('0xb4')]['UserId']}})[_0x0f5b('0x19')](function(_0x358579){if(_0x358579){_0x1d5e41['applications'][_0x0f5b('0xbf')]({'id':0x0,'priority':0x0,'app':_0x0f5b('0xc0'),'appdata':_0x358579[_0x0f5b('0x33')]+','+(_0x1d5e41[_0x0f5b('0x9e')][_0x0f5b('0xc1')]||0xa),'interval':_0x0f5b('0xba')});_0x1d5e41[_0x0f5b('0xc2')]=!![];}return respondWithRpcPromise(_0x0f5b('0xc3'),_0x0f5b('0xc4'),_0x1d5e41);});}return respondWithRpcPromise(_0x0f5b('0xc3'),_0x0f5b('0xc4'),_0x1d5e41);})['then'](function(_0x206b73){respondWithRpcPromise('EventManager',_0x0f5b('0xc5'),{'event':_0x0f5b('0x80'),'message':_0x206b73},client9002);return _0x206b73;})[_0x0f5b('0x19')](respondWithResult(_0x3f4f5d,null))[_0x0f5b('0x23')](handleError(_0x3f4f5d,null));};exports['offline']=function(_0x3fc6e3,_0x42ab2b){var _0x78bfc2,_0x55cb30,_0x54f466;var _0x4b5a0a=[];var _0x39f8ee={};var _0x2c55c1=_0x3fc6e3[_0x0f5b('0xc6')]||[];var _0x45d76b=[];var _0x55659c;return db[_0x0f5b('0x84')][_0x0f5b('0x5c')]()[_0x0f5b('0x19')](function(_0x20a2b8){if(!_0x20a2b8){throw new db['Sequelize'][(_0x0f5b('0x85'))]('no\x20available\x20attributes');}_0x4b5a0a=_['difference'](_[_0x0f5b('0x52')](_0x20a2b8),['createdAt','updatedAt',_0x0f5b('0x8a'),'ListId']);if(_0x3fc6e3[_0x0f5b('0x56')]['id']){delete _0x3fc6e3[_0x0f5b('0x56')]['id'];}if(_['isNil'](_0x3fc6e3[_0x0f5b('0x56')]['from'])){throw _0x42ab2b[_0x0f5b('0x25')](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x0f5b('0x74')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')])||_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')]===''){throw _0x42ab2b['status'](0x1f4)[_0x0f5b('0xc7')](new db['Sequelize'][(_0x0f5b('0x85'))](_0x0f5b('0x8f')));}if(_[_0x0f5b('0x74')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')])){throw _0x42ab2b['status'](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))]['ValidationError'](_0x0f5b('0xc9')+_0x4b5a0a));}if(!_[_0x0f5b('0x92')](_0x4b5a0a,_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')])){throw _0x42ab2b[_0x0f5b('0x25')](0x1f4)[_0x0f5b('0xc7')](new db[(_0x0f5b('0x8d'))][(_0x0f5b('0x85'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b5a0a));}_0x39f8ee[_0x3fc6e3[_0x0f5b('0x56')]['mapKeyOffline']]=_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')];})['then'](function(){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x3fc6e3[_0x0f5b('0x50')]['id']},'include':[{'model':db[_0x0f5b('0x94')],'as':_0x0f5b('0x95')},{'model':db['MailAccount'],'as':_0x0f5b('0xca')}]});})[_0x0f5b('0x19')](handleEntityNotFound(_0x42ab2b,null))[_0x0f5b('0x19')](function(_0x2d63cd){if(_0x2d63cd&&_0x2d63cd[_0x0f5b('0x95')]){_0x55cb30=_0x2d63cd;var _0x1e2d67=_['defaults'](_0x3fc6e3['body'],{'firstName':_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'phone':_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x8c')],'ListId':_0x2d63cd[_0x0f5b('0x8b')]});_0x1e2d67[_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0xc8')]]=_0x3fc6e3[_0x0f5b('0x56')]['from'];return db[_0x0f5b('0x84')][_0x0f5b('0xcb')]({'where':_0x39f8ee,'defaults':_0x1e2d67});}})[_0x0f5b('0xcc')](function(_0x5f42f7){if(_0x5f42f7){_0x54f466=_0x5f42f7;var _0x2782d5=fs[_0x0f5b('0xcd')](path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],'server/files/templates/chatOfflineMessage.ejs'),_0x0f5b('0xce'));var _0x19d4dc=ejs[_0x0f5b('0xcf')](_0x2782d5,{'body':_[_0x0f5b('0xd0')](_0x3fc6e3[_0x0f5b('0x56')][_0x0f5b('0x56')]),'bodyTitle':_0x55cb30[_0x0f5b('0xd1')]});return db[_0x0f5b('0xd2')][_0x0f5b('0x55')]({'body':_0x19d4dc,'plainBody':htmlToText[_0x0f5b('0xd3')](_0x19d4dc),'ContactId':_0x5f42f7['id'],'ChatWebsiteId':_0x55cb30['id']});}})[_0x0f5b('0x19')](function(_0x5ad446){_0x55659c=_0x5ad446;if(_0x2c55c1['length']){var _0x2ab0bd=_0x2c55c1[_0x0f5b('0x49')](function(_0x56a8f2){return{'name':_0x56a8f2[_0x0f5b('0xd4')],'basename':_0x56a8f2[_0x0f5b('0x6a')],'type':_0x56a8f2[_0x0f5b('0xd5')],'ChatOfflineMessageId':_0x5ad446['id']};});_0x45d76b=_0x2ab0bd[_0x0f5b('0x49')](_0x325a0f=>{var _0x1a420b={'filename':_0x325a0f['name'],'path':path['join'](config[_0x0f5b('0x72')],_0x0f5b('0xd6'),'files','attachments',_0x0f5b('0xd7'),_0x325a0f['basename'])};return _0x1a420b;});if(!_0x55cb30[_0x0f5b('0xd8')]){return db[_0x0f5b('0xd9')][_0x0f5b('0xda')](function(_0x2a9dbb){return db[_0x0f5b('0xdb')][_0x0f5b('0xdc')](_0x2ab0bd,{'transaction':_0x2a9dbb});});}}})[_0x0f5b('0x19')](function(){if(_0x55659c){_0x78bfc2=_0x55659c;return db['MailAccount'][_0x0f5b('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x0f5b('0xdd')],'as':_0x0f5b('0xde'),'raw':!![],'include':[{'model':db[_0x0f5b('0xdf')],'as':_0x0f5b('0xdf'),'raw':!![]}]}]});}})[_0x0f5b('0x19')](function(_0x208bbe){if(_0x208bbe&&_0x208bbe[_0x0f5b('0xde')]&&_0x55cb30[_0x0f5b('0xe0')]&&_0x55cb30[_0x0f5b('0xe1')]){var _0x5a5830=_0x208bbe['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x0f5b('0xe2'),{'account':_0x5a5830,'message':{'from':util[_0x0f5b('0xae')](_0x0f5b('0xe3'),_0x208bbe[_0x0f5b('0x33')],_0x208bbe[_0x0f5b('0xe4')]||_0x208bbe['Smtp'][_0x0f5b('0x57')]),'to':_0x55cb30[_0x0f5b('0xe1')],'subject':_0x55cb30[_0x0f5b('0xe5')],'html':_0x78bfc2[_0x0f5b('0x56')],'attachments':_0x45d76b}},client9003)[_0x0f5b('0x19')](function(){return _0x78bfc2;})[_0x0f5b('0x23')](function(_0x1cff2d){logger[_0x0f5b('0x1e')](_0x1cff2d);});}})['then'](function(){if(_0x55cb30&&_0x55cb30[_0x0f5b('0xd8')]&&_0x55cb30[_0x0f5b('0xe6')]){var _0x51204f=[];if(_0x2c55c1['length']){_0x51204f=_0x2c55c1[_0x0f5b('0x49')](function(_0x21debe){return{'name':_0x21debe[_0x0f5b('0xd4')],'basename':_0x21debe['filename'],'type':_0x21debe[_0x0f5b('0xd5')],'ChatOfflineMessageId':_0x55659c['id']};});}var _0x153e60;if(!_[_0x0f5b('0x74')](_0x55cb30['subjectOffline'])){var _0x4161ea=_['map'](_0x3fc6e3[_0x0f5b('0x56')],function(_0x50ec01){return _0x50ec01;});var _0x5d232a=_['toPairsIn'](_0x4161ea)[0x0];var _0x2867d8=_[_0x0f5b('0xe7')](_0x5d232a,function(_0x1dca9d){return _0x1dca9d;});_0x153e60=_0x2867d8[0x1][_0x55cb30['subjectOffline']];}var _0x3c39ba={'from':_0x54f466[_0x0f5b('0xe4')],'firstName':_0x54f466[_0x0f5b('0xa4')],'lastName':_0x54f466['lastName'],'mapKey':_0x0f5b('0xe4'),'message':{'from':_0x54f466[_0x0f5b('0xe4')],'to':_0x55cb30[_0x0f5b('0xca')][_0x0f5b('0xe4')],'cc':'','subject':_['isNil'](_0x153e60)?_0x55cb30[_0x0f5b('0xe5')]:_0x153e60,'messageId':'','sentAt':new Date(),'attach':_0x51204f['length'],'attachments':_0x51204f,'originChannel':_0x0f5b('0xe8'),'ChatWebsiteId':_0x55cb30['id'],'ChatOfflineMessageId':_0x78bfc2['id'],'originTo':_0x55cb30[_0x0f5b('0xca')][_0x0f5b('0xe4')]},'body':_0x78bfc2[_0x0f5b('0x56')]};var _0x179ab2={'account':{'id':_0x55cb30[_0x0f5b('0xe6')]},'body':_0x3c39ba,'log':_0x0f5b('0xe9')};return respondWithRpcPromise(_0x0f5b('0xe9'),_0x0f5b('0xea'),_0x179ab2,client9001)[_0x0f5b('0x19')](function(){return _0x78bfc2;})[_0x0f5b('0x23')](function(_0x10e4c5){logger['error'](_0x10e4c5);});}return;})[_0x0f5b('0x19')](function(){if(_0x78bfc2){return _0x78bfc2;}})[_0x0f5b('0x19')](respondWithResult(_0x42ab2b,null))[_0x0f5b('0x23')](function(_0x4017c3){logger['error'](_0x0f5b('0x23'),_0x4017c3);for(var _0x2dd493 of _0x2c55c1){var _0x5df8ff=path[_0x0f5b('0x76')](config[_0x0f5b('0x72')],_0x0f5b('0xd6'),_0x0f5b('0xc6'),_0x0f5b('0xeb'),_0x0f5b('0xd7'),_0x2dd493['filename']);fs_extra[_0x0f5b('0xec')](_0x5df8ff)[_0x0f5b('0x23')](function(_0x72a065){logger[_0x0f5b('0x1e')](_0x0f5b('0xed'),_0x5df8ff,_0x72a065);});}});};exports[_0x0f5b('0xee')]=function(_0x1e6c7e,_0x4f57e4){return db[_0x0f5b('0xb1')][_0x0f5b('0x54')]({'where':{'id':_0x1e6c7e[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x4f57e4,null))[_0x0f5b('0x19')](function(_0x3a7365){if(_0x3a7365){return _0x3a7365[_0x0f5b('0xee')](_0x1e6c7e[_0x0f5b('0x56')][_0x0f5b('0x62')],_[_0x0f5b('0xef')](_0x1e6c7e[_0x0f5b('0x56')],[_0x0f5b('0x62'),'id'])||{});}})['then'](respondWithResult(_0x4f57e4,null))['catch'](handleError(_0x4f57e4,null));};exports['getInteractions']=function(_0x2e22a1,_0x56ff52){var _0x5b728a={'raw':![],'where':{}};var _0x155553={};var _0x216a32={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')][_0x0f5b('0x66')]({'where':{'id':_0x2e22a1[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x56ff52,null))[_0x0f5b('0x19')](function(_0x240316){if(_0x240316){_0x155553['model']=_[_0x0f5b('0x52')](db[_0x0f5b('0xb1')][_0x0f5b('0x37')]);_0x155553[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x2e22a1[_0x0f5b('0x3c')]);_0x155553[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x155553['model'],_0x155553['query']);_0x5b728a[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x155553[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x5b728a[_0x0f5b('0x3e')]=_0x5b728a['attributes']['length']?_0x5b728a[_0x0f5b('0x3e')]:_0x155553['model'];if(!_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x41')]('nolimit')){_0x5b728a['limit']=qs['limit'](_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x5b728a['offset']=qs['offset'](_0x2e22a1['query'][_0x0f5b('0x2b')]);}_0x5b728a[_0x0f5b('0x43')]=qs['sort'](_0x2e22a1[_0x0f5b('0x3c')]['sort']);_0x5b728a[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x2e22a1[_0x0f5b('0x3c')],_0x155553[_0x0f5b('0x3d')]));_0x5b728a[_0x0f5b('0x45')][_0x0f5b('0x5e')]=_0x240316['id'];if(_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x5b728a[_0x0f5b('0x45')]=_['merge'](_0x5b728a[_0x0f5b('0x45')],{'$or':_['map'](_0x5b728a['attributes'],function(_0x32a58b){var _0x514ef4={};_0x514ef4[_0x32a58b]={'$like':'%'+_0x2e22a1[_0x0f5b('0x3c')]['filter']+'%'};return _0x514ef4;})});}_0x5b728a=_[_0x0f5b('0x48')]({},_0x5b728a,_0x2e22a1['options']);return db['ChatInteraction'][_0x0f5b('0x2a')]({'where':_0x5b728a['where']})[_0x0f5b('0x19')](function(_0x553b46){_0x216a32[_0x0f5b('0x2a')]=_0x553b46;if(_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0x4b')]){_0x5b728a[_0x0f5b('0x4c')]=[{'model':db[_0x0f5b('0x84')],'as':_0x0f5b('0xf0'),'required':![]},{'model':db['User'],'as':_0x0f5b('0xf1'),'attributes':[_0x0f5b('0x33'),_0x0f5b('0xf2'),_0x0f5b('0xf3')],'required':![]},{'model':db[_0x0f5b('0xf4')],'as':'Tags','attributes':['id','name',_0x0f5b('0xf5')],'where':_0x2e22a1[_0x0f5b('0x3c')][_0x0f5b('0xf6')]?{'id':_0x2e22a1[_0x0f5b('0x3c')]['tag']}:undefined,'required':_0x2e22a1[_0x0f5b('0x3c')]['tag']?!![]:![]}];}return db[_0x0f5b('0xb1')]['findAll'](_0x5b728a);})[_0x0f5b('0x19')](function(_0x1e6f95){_0x216a32[_0x0f5b('0x4e')]=_0x1e6f95;return _0x216a32;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x56ff52,_0x5b728a))['catch'](handleError(_0x56ff52,null));};function iftimePromise(_0x394333,_0xfc6875){return respondWithRpcPromise(_0x0f5b('0xf7'),'getSnippet',{'command':_0xfc6875[_0x0f5b('0xf8')]?util[_0x0f5b('0xae')](_0x0f5b('0xf9'),_0x394333['interval'],_0xfc6875[_0x0f5b('0xf8')]):util[_0x0f5b('0xae')](_0x0f5b('0xfa'),_0x394333[_0x0f5b('0xfb')])},client9002)[_0x0f5b('0x19')](function(_0x2e6d86){var _0x3a220e=_0x2e6d86&&_0x2e6d86[_0x0f5b('0xfc')](_0x0f5b('0xfd'))>=0x0?!![]:![];logger[_0x0f5b('0x1a')](_0x0f5b('0xfe'),_0xfc6875['id'],_0x394333['id'],_0x394333[_0x0f5b('0xfb')],_0x3a220e?_0x0f5b('0xff'):_0x0f5b('0x100'),_0xfc6875['timezone']?_0xfc6875[_0x0f5b('0xf8')]:_0x0f5b('0x101'));return _0x3a220e;})[_0x0f5b('0x23')](function(_0x3e0d18){logger['error'](_0x0f5b('0xfe'),_0xfc6875['id'],_0x394333['id'],_0x394333[_0x0f5b('0xfb')],util[_0x0f5b('0x102')](_0x3e0d18,{'showHidden':![],'depth':null}),_0xfc6875['timezone']?_0xfc6875[_0x0f5b('0xf8')]:_0x0f5b('0x101'));return![];});}exports['getSnippet']=function(_0x5a20bb,_0x104178){var _0x52cafa=0x0;var _0x4df76e=0x0;var _0x18ac4a=![];var _0x127c63;var _0x43fee1;return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x5a20bb['params']['id']},'include':[{'model':db['Interval'],'as':_0x0f5b('0x103'),'include':[{'model':db[_0x0f5b('0x103')],'as':_0x0f5b('0x104'),'attributes':['id',_0x0f5b('0xfb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x104178,null))[_0x0f5b('0x19')](function(_0x57736c){if(_0x57736c){_0x127c63=_0x57736c;return _0x57736c[_0x0f5b('0x105')]({'raw':!![]});}})[_0x0f5b('0x19')](function(_0x48bc12){if(_0x127c63){if(_0x48bc12){_0x43fee1=_0x48bc12;}}return require('../../config/license/util')[_0x0f5b('0x73')]();})[_0x0f5b('0x19')](function(_0x3f9dd6){if(_0x3f9dd6){_0x4df76e=_0x3f9dd6['virtual'];_0x18ac4a=_0x3f9dd6['custom'];}})[_0x0f5b('0x19')](function(){return db[_0x0f5b('0xb1')][_0x0f5b('0x2a')]({'where':{'closed':![]}});})[_0x0f5b('0x19')](function(_0x528d45){_0x52cafa=_0x528d45;if(_0x4df76e&&_0x528d45>_0x4df76e){return db[_0x0f5b('0x106')][_0x0f5b('0x66')]({'where':{'id':0x1}})[_0x0f5b('0x19')](function(_0x5c7106){if(_0x5c7106){_0x5c7106[_0x0f5b('0x107')](_0x0f5b('0x108'));}});}})[_0x0f5b('0x19')](function(){if(_0x127c63['Interval']&&_0x127c63['Interval'][_0x0f5b('0x104')]){var _0x589623=[];for(var _0x1387f9=0x0;_0x1387f9<_0x127c63['Interval'][_0x0f5b('0x104')][_0x0f5b('0x40')];_0x1387f9++){var _0x51a329=_0x127c63['Interval']['Intervals'][_0x1387f9][_0x0f5b('0x30')]({'plain':!![]});_0x589623[_0x0f5b('0x109')](iftimePromise(_0x51a329,_0x127c63));}return BPromise[_0x0f5b('0x10a')](_0x589623)['then'](function(_0x244fc3){return _[_0x0f5b('0x10b')](_0x244fc3);});}else{return!![];}})[_0x0f5b('0x19')](function(_0x7d462c){var _0x8e938a=fs[_0x0f5b('0xcd')](path['join'](config[_0x0f5b('0x72')],_0x0f5b('0x10c')),_0x0f5b('0xce'));var _0x219a72=new url['URL'](_0x127c63[_0x0f5b('0x10d')])[_0x0f5b('0x10e')];var _0x488fa1=_0x0f5b('0x10f');var _0x498007=![];var _0x2f002c={'chatVersion':_0x488fa1,'chatWebsiteAddressOrigin':_0x219a72,'remote':_0x127c63[_0x0f5b('0x110')],'query':querystring[_0x0f5b('0x111')](_[_0x0f5b('0x48')](_0x127c63[_0x0f5b('0x30')]({'plain':!![]}),{'customerIp':_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0xa1')]||_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0x112')]||_0x5a20bb[_0x0f5b('0x113')]['remoteAddress']||_0x5a20bb['ip'],'referer':_0x5a20bb[_0x0f5b('0x82')][_0x0f5b('0xa7')],'openedInteractions':_0x52cafa,'maxInteractions':_0x4df76e,'virtual':_0x18ac4a[_0x0f5b('0x114')],'online':_0x7d462c,'custom':_0x18ac4a}))[_0x0f5b('0x115')](/'/g,'\x5c\x27')};_0x104178['send'](ejs[_0x0f5b('0xcf')](Mustache[_0x0f5b('0xcf')](_0x8e938a,_0x2f002c),{'proactiveActions':_0x43fee1,'alignment':_0x127c63['alignment'],'verticalAlignment':_0x127c63['verticalAlignment'],'div_color':_0x127c63[_0x0f5b('0xf5')],'labelText':_0x127c63[_0x0f5b('0x116')],'text_color':_0x127c63[_0x0f5b('0x117')],'text_button_color':_0x127c63[_0x0f5b('0x118')],'button_color':_0x127c63[_0x0f5b('0x119')],'background_color':_0x127c63[_0x0f5b('0x11a')],'hideWhenOffline':_0x127c63['hideWhenOffline'],'intervalId':_0x127c63[_0x0f5b('0x11b')],'isDevelopment':_0x498007,'chatVersion':_0x488fa1}));})[_0x0f5b('0x23')](handleError(_0x104178,null));};exports[_0x0f5b('0x11c')]=function(_0x5561ec,_0x801eab){var _0x3dad79=_0x5561ec['params']['id'];var _0x1f16b2=_0x5561ec[_0x0f5b('0x56')];var _0x17f9e2=0xc8;var _0x42a0d4=null;return db[_0x0f5b('0xd9')][_0x0f5b('0xda')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x0f5b('0x11d')]},function(_0x4c8c57){return db['ChatWebsite'][_0x0f5b('0x66')]({'where':{'id':_0x3dad79},'transaction':_0x4c8c57})['then'](function(_0x4726f3){if(_0x4726f3){return db[_0x0f5b('0x97')][_0x0f5b('0x2f')]({'where':{'ChatWebsiteId':_0x3dad79},'transaction':_0x4c8c57})['then'](function(){var _0x1acdd5=_[_0x0f5b('0x49')](_0x1f16b2,function(_0x2736d8){_0x2736d8[_0x0f5b('0x5e')]=_0x3dad79;return _0x2736d8;});return db[_0x0f5b('0x97')][_0x0f5b('0xdc')](_0x1acdd5,{'transaction':_0x4c8c57});});}else{_0x17f9e2=0x194;_0x42a0d4=[];}});})[_0x0f5b('0x19')](function(){if(_0x17f9e2!==0x194){return db[_0x0f5b('0x97')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3dad79},'order':_0x0f5b('0x9b')})['then'](function(_0x3cb98a){_0x42a0d4=_0x3cb98a;});}})[_0x0f5b('0x23')](function(_0x580d0d){_0x17f9e2=0x1f4;logger[_0x0f5b('0x1e')](_0x580d0d[_0x0f5b('0x32')]);if(_0x580d0d[_0x0f5b('0x33')]){delete _0x580d0d[_0x0f5b('0x33')];}_0x42a0d4=_0x580d0d;})['finally'](function(){if(_0x42a0d4===null){_0x801eab[_0x0f5b('0x24')](_0x17f9e2);}else{if(_0x17f9e2===0x1f4){_0x801eab[_0x0f5b('0x25')](_0x17f9e2)[_0x0f5b('0xc7')](_0x42a0d4);}else{_0x801eab['status'](_0x17f9e2)[_0x0f5b('0x27')](_0x42a0d4);}}});};exports['getApplications']=function(_0x6ab2e5,_0x2702ed){var _0x478848={};var _0x41aaf5={};var _0x7e8c6;var _0x4a6720;return db['ChatWebsite']['findOne']({'where':{'id':_0x6ab2e5['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2702ed,null))['then'](function(_0x3cfcd2){if(_0x3cfcd2){_0x7e8c6=_0x3cfcd2;_0x41aaf5[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x97')][_0x0f5b('0x37')]);_0x41aaf5[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x6ab2e5[_0x0f5b('0x3c')]);_0x41aaf5[_0x0f5b('0x3d')]=_['intersection'](_0x41aaf5[_0x0f5b('0x3b')],_0x41aaf5[_0x0f5b('0x3c')]);_0x478848[_0x0f5b('0x3e')]=_['intersection'](_0x41aaf5[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x478848[_0x0f5b('0x3e')]=_0x478848['attributes']['length']?_0x478848['attributes']:_0x41aaf5[_0x0f5b('0x3b')];_0x478848[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x6ab2e5['query'][_0x0f5b('0x44')]);_0x478848[_0x0f5b('0x45')]=qs['filters'](_[_0x0f5b('0x46')](_0x6ab2e5[_0x0f5b('0x3c')],_0x41aaf5[_0x0f5b('0x3d')]));if(_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x478848[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x478848[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x478848['attributes'],function(_0x4b5292){var _0x4c2cde={};_0x4c2cde[_0x4b5292]={'$like':'%'+_0x6ab2e5['query'][_0x0f5b('0x47')]+'%'};return _0x4c2cde;})});}_0x478848=_[_0x0f5b('0x48')]({},_0x478848,_0x6ab2e5[_0x0f5b('0x4a')]);return _0x7e8c6['getApplications'](_0x478848);}})[_0x0f5b('0x19')](function(_0x22d1bf){if(_0x22d1bf){_0x4a6720=_0x22d1bf[_0x0f5b('0x40')];if(!_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x478848['limit']=qs['limit'](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x478848[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x6ab2e5[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0x7e8c6[_0x0f5b('0x11e')](_0x478848);}})[_0x0f5b('0x19')](function(_0x3a2d22){if(_0x3a2d22){return _0x3a2d22?{'count':_0x4a6720,'rows':_0x3a2d22}:null;}})[_0x0f5b('0x19')](respondWithResult(_0x2702ed,null))['catch'](handleError(_0x2702ed,null));};exports[_0x0f5b('0x11f')]=function(_0x25116c,_0x14bb99){return db[_0x0f5b('0x120')][_0x0f5b('0x54')]({'where':{'id':_0x25116c[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x14bb99,null))[_0x0f5b('0x19')](function(_0x3d823a){if(_0x3d823a){return _0x3d823a[_0x0f5b('0x11f')](_0x25116c[_0x0f5b('0x56')][_0x0f5b('0x62')],_['omit'](_0x25116c[_0x0f5b('0x56')],[_0x0f5b('0x62'),'id'])||{});}})[_0x0f5b('0x19')](respondWithResult(_0x14bb99,null))[_0x0f5b('0x23')](handleError(_0x14bb99,null));};exports[_0x0f5b('0x105')]=function(_0x3ee514,_0xef79fe){var _0x555e7d={};var _0x401fec={};var _0x1835bc;var _0x44d856;return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x3ee514[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0xef79fe,null))['then'](function(_0xc19716){if(_0xc19716){_0x1835bc=_0xc19716;_0x401fec[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db[_0x0f5b('0x121')][_0x0f5b('0x37')]);_0x401fec[_0x0f5b('0x3c')]=_['keys'](_0x3ee514[_0x0f5b('0x3c')]);_0x401fec[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x401fec[_0x0f5b('0x3b')],_0x401fec[_0x0f5b('0x3c')]);_0x555e7d[_0x0f5b('0x3e')]=_[_0x0f5b('0x53')](_0x401fec[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x555e7d[_0x0f5b('0x3e')]=_0x555e7d[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x555e7d[_0x0f5b('0x3e')]:_0x401fec[_0x0f5b('0x3b')];_0x555e7d[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x3ee514['query'][_0x0f5b('0x44')]);_0x555e7d[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x3ee514[_0x0f5b('0x3c')],_0x401fec[_0x0f5b('0x3d')]));if(_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x555e7d[_0x0f5b('0x45')]=_[_0x0f5b('0x48')](_0x555e7d[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x555e7d[_0x0f5b('0x3e')],function(_0x102b29){var _0x2555f7={};_0x2555f7[_0x102b29]={'$like':'%'+_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x2555f7;})});}_0x555e7d=_[_0x0f5b('0x48')]({},_0x555e7d,_0x3ee514[_0x0f5b('0x4a')]);return _0x1835bc[_0x0f5b('0x105')](_0x555e7d);}})['then'](function(_0x196bf3){if(_0x196bf3){_0x44d856=_0x196bf3[_0x0f5b('0x40')];if(!_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x41')](_0x0f5b('0x42'))){_0x555e7d[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x29')]);_0x555e7d[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x3ee514[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0x1835bc[_0x0f5b('0x105')](_0x555e7d);}})['then'](function(_0x37b190){if(_0x37b190){return _0x37b190?{'count':_0x44d856,'rows':_0x37b190}:null;}})[_0x0f5b('0x19')](respondWithResult(_0xef79fe,null))['catch'](handleError(_0xef79fe,null));};exports[_0x0f5b('0x122')]=function(_0xf262e5,_0x3335e7){var _0x2e9240=_0xf262e5['query'][_0x0f5b('0x123')]==='false'?_0x0f5b('0x124'):'onlineForm';return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'attributes':['id',_0x2e9240],'where':{'id':_0xf262e5[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x3335e7,null))[_0x0f5b('0x19')](function(_0x1f21b0){if(_0x1f21b0){var _0x436936=_0x1f21b0[_0x2e9240];var _0x43fb71=_0x436936&&_0x436936[_0x0f5b('0x125')]?_0x436936['items']:[];_0x3335e7['send']({'fromKey':_[_0x0f5b('0x74')](_0x436936['fromKey'])?undefined:_0x436936[_0x0f5b('0x126')],'count':_0x43fb71[_0x0f5b('0x40')],'rows':_0x43fb71});}})[_0x0f5b('0x23')](handleError(_0x3335e7,null));};exports['getOfflineMessages']=function(_0x51301a,_0x31e7e7){var _0x5214fb={'raw':![],'where':{}};var _0x377e19={};var _0xca9c46={'count':0x0,'rows':[]};return db[_0x0f5b('0x36')]['findOne']({'where':{'id':_0x51301a[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x31e7e7,null))['then'](function(_0x19fb1f){if(_0x19fb1f){_0x377e19[_0x0f5b('0x3b')]=_[_0x0f5b('0x52')](db['ChatOfflineMessage'][_0x0f5b('0x37')]);_0x377e19[_0x0f5b('0x3c')]=_[_0x0f5b('0x52')](_0x51301a[_0x0f5b('0x3c')]);_0x377e19[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x377e19['model'],_0x377e19['query']);_0x5214fb[_0x0f5b('0x3e')]=_['intersection'](_0x377e19['model'],qs[_0x0f5b('0x3f')](_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x3f')]));_0x5214fb['attributes']=_0x5214fb[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x5214fb[_0x0f5b('0x3e')]:_0x377e19[_0x0f5b('0x3b')];if(!_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x41')]('nolimit')){_0x5214fb[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x51301a[_0x0f5b('0x3c')]['limit']);_0x5214fb[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}_0x5214fb['order']=qs[_0x0f5b('0x44')](_0x51301a['query'][_0x0f5b('0x44')]);_0x5214fb[_0x0f5b('0x45')]=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x51301a[_0x0f5b('0x3c')],_0x377e19[_0x0f5b('0x3d')]));_0x5214fb['where']['ChatWebsiteId']=_0x19fb1f['id'];if(_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x5214fb[_0x0f5b('0x45')]=_['merge'](_0x5214fb[_0x0f5b('0x45')],{'$or':_['map'](_0x5214fb[_0x0f5b('0x3e')],function(_0x1cc1df){var _0x33b63f={};_0x33b63f[_0x1cc1df]={'$like':'%'+_0x51301a[_0x0f5b('0x3c')][_0x0f5b('0x47')]+'%'};return _0x33b63f;})});}_0x5214fb=_['merge']({},_0x5214fb,_0x51301a[_0x0f5b('0x4a')]);return db[_0x0f5b('0xd2')][_0x0f5b('0x2a')]({'where':_0x5214fb['where']})[_0x0f5b('0x19')](function(_0x4724dd){_0xca9c46['count']=_0x4724dd;if(_0x51301a['query']['includeAll']){_0x5214fb['include']=[{'all':!![]}];}else{_0x5214fb[_0x0f5b('0x4c')]=[{'model':db['CmContact'],'as':_0x0f5b('0xf0'),'required':![]},{'model':db[_0x0f5b('0xdb')],'as':_0x0f5b('0x127'),'required':![]}];}return db[_0x0f5b('0xd2')][_0x0f5b('0x4d')](_0x5214fb);})[_0x0f5b('0x19')](function(_0x3a1b0a){_0xca9c46[_0x0f5b('0x4e')]=_0x3a1b0a;return _0xca9c46;});}})[_0x0f5b('0x19')](respondWithFilteredResult(_0x31e7e7,_0x5214fb))[_0x0f5b('0x23')](handleError(_0x31e7e7,null));};exports[_0x0f5b('0x128')]=function(_0x402d29,_0x27429e){return db[_0x0f5b('0x36')][_0x0f5b('0x54')]({'where':{'id':_0x402d29[_0x0f5b('0x50')]['id']}})['then'](handleEntityNotFound(_0x27429e,null))[_0x0f5b('0x19')](function(_0x49dbb5){if(_0x49dbb5){return _0x49dbb5['addAgents'](_0x402d29['body'][_0x0f5b('0x62')],_[_0x0f5b('0xef')](_0x402d29['body'],[_0x0f5b('0x62'),'id'])||{})[_0x0f5b('0xcc')](function(_0x1706f5){for(var _0x712c6e=0x0;_0x712c6e<_0x402d29[_0x0f5b('0x56')][_0x0f5b('0x62')][_0x0f5b('0x40')];_0x712c6e+=0x1){socket[_0x0f5b('0x129')](_0x0f5b('0x12a'),{'UserId':Number(_0x402d29[_0x0f5b('0x56')]['ids'][_0x712c6e]),'ChatWebsiteId':Number(_0x402d29[_0x0f5b('0x50')]['id'])});}return _0x1706f5;});}})[_0x0f5b('0x19')](respondWithResult(_0x27429e,null))['catch'](handleError(_0x27429e,null));};exports[_0x0f5b('0x12b')]=function(_0x4c32a7,_0x2c5e87){return db['ChatWebsite'][_0x0f5b('0x54')]({'where':{'id':_0x4c32a7[_0x0f5b('0x50')]['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0x2c5e87,null))[_0x0f5b('0x19')](function(_0x51fe13){if(_0x51fe13){return _0x51fe13[_0x0f5b('0x12b')](_0x4c32a7['query'][_0x0f5b('0x62')])[_0x0f5b('0x19')](function(){if(_[_0x0f5b('0x12c')](_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')])){for(var _0x5b0335=0x0;_0x5b0335<_0x4c32a7['query'][_0x0f5b('0x62')][_0x0f5b('0x40')];_0x5b0335+=0x1){socket[_0x0f5b('0x129')](_0x0f5b('0x12d'),{'UserId':Number(_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')][_0x5b0335]),'ChatWebsiteId':Number(_0x4c32a7[_0x0f5b('0x50')]['id'])});}}else{socket[_0x0f5b('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x4c32a7[_0x0f5b('0x3c')][_0x0f5b('0x62')]),'ChatWebsiteId':Number(_0x4c32a7['params']['id'])});}});}})[_0x0f5b('0x19')](respondWithStatusCode(_0x2c5e87,null))[_0x0f5b('0x23')](handleError(_0x2c5e87,null));};exports['getAgents']=function(_0x1cc2f0,_0xcb3ee1){var _0x388729={};var _0x1de426={};var _0xa19687;var _0x55e7dc;return db['ChatWebsite'][_0x0f5b('0x66')]({'where':{'id':_0x1cc2f0['params']['id']}})[_0x0f5b('0x19')](handleEntityNotFound(_0xcb3ee1,null))[_0x0f5b('0x19')](function(_0x2ad382){if(_0x2ad382){_0xa19687=_0x2ad382;_0x1de426[_0x0f5b('0x3b')]=_['keys'](db['User'][_0x0f5b('0x37')]);_0x1de426[_0x0f5b('0x3c')]=_['keys'](_0x1cc2f0[_0x0f5b('0x3c')]);_0x1de426[_0x0f5b('0x3d')]=_[_0x0f5b('0x53')](_0x1de426[_0x0f5b('0x3b')],_0x1de426[_0x0f5b('0x3c')]);_0x388729[_0x0f5b('0x3e')]=_['intersection'](_0x1de426[_0x0f5b('0x3b')],qs[_0x0f5b('0x3f')](_0x1cc2f0['query'][_0x0f5b('0x3f')]));_0x388729[_0x0f5b('0x3e')]=_0x388729[_0x0f5b('0x3e')][_0x0f5b('0x40')]?_0x388729['attributes']:_0x1de426[_0x0f5b('0x3b')];_0x388729[_0x0f5b('0x43')]=qs[_0x0f5b('0x44')](_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x44')]);_0x388729['where']=qs[_0x0f5b('0x3d')](_[_0x0f5b('0x46')](_0x1cc2f0['query'],_0x1de426[_0x0f5b('0x3d')]));if(_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x47')]){_0x388729[_0x0f5b('0x45')]=_['merge'](_0x388729[_0x0f5b('0x45')],{'$or':_[_0x0f5b('0x49')](_0x388729[_0x0f5b('0x3e')],function(_0x307d2a){var _0x3a9841={};_0x3a9841[_0x307d2a]={'$like':'%'+_0x1cc2f0[_0x0f5b('0x3c')]['filter']+'%'};return _0x3a9841;})});}_0x388729=_[_0x0f5b('0x48')]({},_0x388729,_0x1cc2f0[_0x0f5b('0x4a')]);return _0xa19687[_0x0f5b('0x12e')](_0x388729);}})[_0x0f5b('0x19')](function(_0x141a7f){if(_0x141a7f){_0x55e7dc=_0x141a7f['length'];if(!_0x1cc2f0['query']['hasOwnProperty'](_0x0f5b('0x42'))){_0x388729[_0x0f5b('0x29')]=qs[_0x0f5b('0x29')](_0x1cc2f0['query'][_0x0f5b('0x29')]);_0x388729[_0x0f5b('0x2b')]=qs[_0x0f5b('0x2b')](_0x1cc2f0[_0x0f5b('0x3c')][_0x0f5b('0x2b')]);}return _0xa19687[_0x0f5b('0x12e')](_0x388729);}})[_0x0f5b('0x19')](function(_0x8455da){if(_0x8455da){return _0x8455da?{'count':_0x55e7dc,'rows':_0x8455da}:null;}})[_0x0f5b('0x19')](respondWithResult(_0xcb3ee1,null))[_0x0f5b('0x23')](handleError(_0xcb3ee1,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 77cfca9..5d5729f 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 _0x6631=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1a209f,_0x1b35e6){var _0x376b56=function(_0x5ed729){while(--_0x5ed729){_0x1a209f['push'](_0x1a209f['shift']());}};_0x376b56(++_0x1b35e6);}(_0x6631,0x134));var _0x1663=function(_0x4cf818,_0x3e74b2){_0x4cf818=_0x4cf818-0x0;var _0x414c5e=_0x6631[_0x4cf818];return _0x414c5e;};'use strict';var EventEmitter=require(_0x1663('0x0'));var ChatWebsite=require(_0x1663('0x1'))['db'][_0x1663('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1663('0x3')](0x0);var events={'afterCreate':_0x1663('0x4'),'afterUpdate':_0x1663('0x5'),'afterDestroy':'remove'};function emitEvent(_0x492d72){return function(_0x1e2fcc,_0x232bfe,_0x2b5af7){ChatWebsiteEvents[_0x1663('0x6')](_0x492d72+':'+_0x1e2fcc['id'],_0x1e2fcc);ChatWebsiteEvents[_0x1663('0x6')](_0x492d72,_0x1e2fcc);_0x2b5af7(null);};}for(var e in events){if(events[_0x1663('0x7')](e)){var event=events[e];ChatWebsite[_0x1663('0x8')](e,emitEvent(event));}}module[_0x1663('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xff3c=['../../mysqldb','setMaxListeners','save','emit','exports','events'];(function(_0x58e6b7,_0xb08f8d){var _0x1f62f9=function(_0x41a777){while(--_0x41a777){_0x58e6b7['push'](_0x58e6b7['shift']());}};_0x1f62f9(++_0xb08f8d);}(_0xff3c,0x179));var _0xcff3=function(_0x1a1f55,_0x104f1f){_0x1a1f55=_0x1a1f55-0x0;var _0xc11b2b=_0xff3c[_0x1a1f55];return _0xc11b2b;};'use strict';var EventEmitter=require(_0xcff3('0x0'));var ChatWebsite=require(_0xcff3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcff3('0x2')](0x0);var events={'afterCreate':_0xcff3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28f6e0){return function(_0x17ae92,_0x45c7f6,_0x312858){ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0+':'+_0x17ae92['id'],_0x17ae92);ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0,_0x17ae92);_0x312858(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcff3('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 2f989a0..8fb892a 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 _0xbba9=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','lodash'];(function(_0x5b135a,_0x5402b2){var _0x5dd0d8=function(_0x167bed){while(--_0x167bed){_0x5b135a['push'](_0x5b135a['shift']());}};_0x5dd0d8(++_0x5402b2);}(_0xbba9,0x121));var _0x9bba=function(_0xcd20e,_0xd4e78e){_0xcd20e=_0xcd20e-0x0;var _0x8e2f3c=_0xbba9[_0xcd20e];return _0x8e2f3c;};'use strict';var _=require(_0x9bba('0x0'));var util=require('util');var logger=require(_0x9bba('0x1'))('api');var moment=require(_0x9bba('0x2'));var BPromise=require(_0x9bba('0x3'));var rp=require(_0x9bba('0x4'));var fs=require('fs');var path=require(_0x9bba('0x5'));var rimraf=require('rimraf');var config=require(_0x9bba('0x6'));var attributes=require(_0x9bba('0x7'));module[_0x9bba('0x8')]=function(_0x5a720a,_0x60688a){return _0x5a720a['define'](_0x9bba('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5853=['define','ChatWebsite','chat_websites','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0xeb5938,_0x227b17){var _0x4d48db=function(_0xb76f3a){while(--_0xb76f3a){_0xeb5938['push'](_0xeb5938['shift']());}};_0x4d48db(++_0x227b17);}(_0x5853,0xdb));var _0x3585=function(_0xce44ee,_0x387d70){_0xce44ee=_0xce44ee-0x0;var _0xf97a49=_0x5853[_0xce44ee];return _0xf97a49;};'use strict';var _=require('lodash');var util=require(_0x3585('0x0'));var logger=require(_0x3585('0x1'))(_0x3585('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3585('0x3'));var fs=require('fs');var path=require(_0x3585('0x4'));var rimraf=require(_0x3585('0x5'));var config=require(_0x3585('0x6'));var attributes=require(_0x3585('0x7'));module[_0x3585('0x8')]=function(_0x3f038d,_0x51ca20){return _0x3f038d[_0x3585('0x9')](_0x3585('0xa'),attributes,{'tableName':_0x3585('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 0391355..693c31b 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 _0x3569=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x1af362,_0x3e13a8){var _0x278343=function(_0x27148a){while(--_0x27148a){_0x1af362['push'](_0x1af362['shift']());}};_0x278343(++_0x3e13a8);}(_0x3569,0x140));var _0x9356=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x3569[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x9356('0x0'));var util=require(_0x9356('0x1'));var moment=require(_0x9356('0x2'));var BPromise=require(_0x9356('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9356('0x4'))['db'];var utils=require(_0x9356('0x5'));var logger=require('../../config/logger')(_0x9356('0x6'));var config=require(_0x9356('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9356('0x8')][_0x9356('0x9')]({'port':0x232a});config[_0x9356('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9356('0xb'))(new Redis(config['redis']));require(_0x9356('0xc'))[_0x9356('0xd')](socket);function respondWithRpcPromise(_0x113d86,_0x32551f,_0x40ffdb){return new BPromise(function(_0x2e641a,_0x3edb6a){return client[_0x9356('0xe')](_0x113d86,_0x40ffdb)[_0x9356('0xf')](function(_0x3b7a7c){logger[_0x9356('0x10')](_0x9356('0x11'),_0x32551f,_0x9356('0x12'));logger[_0x9356('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32551f,_0x9356('0x12'),JSON[_0x9356('0x14')](_0x3b7a7c));if(_0x3b7a7c[_0x9356('0x15')]){if(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x16')]===0x1f4){logger['error'](_0x9356('0x11'),_0x32551f,_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);return _0x3edb6a(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);}logger[_0x9356('0x15')](_0x9356('0x11'),_0x32551f,_0x3b7a7c['error'][_0x9356('0x17')]);return _0x2e641a(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);}else{logger[_0x9356('0x10')](_0x9356('0x11'),_0x32551f,_0x9356('0x12'));_0x2e641a(_0x3b7a7c[_0x9356('0x18')][_0x9356('0x17')]);}})[_0x9356('0x19')](function(_0x4fd53f){logger[_0x9356('0x15')](_0x9356('0x11'),_0x32551f,_0x4fd53f);_0x3edb6a(_0x4fd53f);});});}
\ No newline at end of file
+var _0x609a=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x2ea05c,_0x5d3bec){var _0x28d6f3=function(_0x107893){while(--_0x107893){_0x2ea05c['push'](_0x2ea05c['shift']());}};_0x28d6f3(++_0x5d3bec);}(_0x609a,0x8e));var _0xa609=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x609a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa609('0x0'));var moment=require(_0xa609('0x1'));var BPromise=require(_0xa609('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa609('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa609('0x4'))(_0xa609('0x5'));var config=require(_0xa609('0x6'));var jayson=require(_0xa609('0x7'));var client=jayson[_0xa609('0x8')][_0xa609('0x9')]({'port':0x232a});config['redis']=_[_0xa609('0xa')](config[_0xa609('0xb')],{'host':_0xa609('0xc'),'port':0x18eb});var socket=require(_0xa609('0xd'))(new Redis(config[_0xa609('0xb')]));require(_0xa609('0xe'))[_0xa609('0xf')](socket);function respondWithRpcPromise(_0x4c233e,_0x189301,_0x5a396f){return new BPromise(function(_0x5a8449,_0xcc9276){return client[_0xa609('0x10')](_0x4c233e,_0x5a396f)[_0xa609('0x11')](function(_0x21fc7c){logger['info'](_0xa609('0x12'),_0x189301,_0xa609('0x13'));logger[_0xa609('0x14')](_0xa609('0x15'),_0x189301,'request\x20sent',JSON[_0xa609('0x16')](_0x21fc7c));if(_0x21fc7c['error']){if(_0x21fc7c[_0xa609('0x17')][_0xa609('0x18')]===0x1f4){logger[_0xa609('0x17')](_0xa609('0x12'),_0x189301,_0x21fc7c['error'][_0xa609('0x19')]);return _0xcc9276(_0x21fc7c['error'][_0xa609('0x19')]);}logger['error'](_0xa609('0x12'),_0x189301,_0x21fc7c[_0xa609('0x17')][_0xa609('0x19')]);return _0x5a8449(_0x21fc7c[_0xa609('0x17')][_0xa609('0x19')]);}else{logger[_0xa609('0x1a')](_0xa609('0x12'),_0x189301,'request\x20sent');_0x5a8449(_0x21fc7c[_0xa609('0x1b')][_0xa609('0x19')]);}})[_0xa609('0x1c')](function(_0x3e7ad1){logger[_0xa609('0x17')](_0xa609('0x12'),_0x189301,_0x3e7ad1);_0xcc9276(_0x3e7ad1);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 90487b0..1eed3d9 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 _0x204e=['register','length','chatWebsite:','save','remove','update','emit','removeListener'];(function(_0x1dbc31,_0x4c550c){var _0x256e5b=function(_0xc511bc){while(--_0xc511bc){_0x1dbc31['push'](_0x1dbc31['shift']());}};_0x256e5b(++_0x4c550c);}(_0x204e,0x10b));var _0xe204=function(_0x1f0ba3,_0xd0d300){_0x1f0ba3=_0x1f0ba3-0x0;var _0x370c4b=_0x204e[_0x1f0ba3];return _0x370c4b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe204('0x0'),_0xe204('0x1'),_0xe204('0x2')];function createListener(_0x1cbab1,_0x54affd){return function(_0x2b20c0){_0x54affd[_0xe204('0x3')](_0x1cbab1,_0x2b20c0);};}function removeListener(_0x1d3f19,_0x5d6d99){return function(){ChatWebsiteEvents[_0xe204('0x4')](_0x1d3f19,_0x5d6d99);};}exports[_0xe204('0x5')]=function(_0x267a0e){for(var _0x5ae7d5=0x0,_0x39953c=events[_0xe204('0x6')];_0x5ae7d5<_0x39953c;_0x5ae7d5++){var _0x2f40f2=events[_0x5ae7d5];var _0x3b911b=createListener(_0xe204('0x7')+_0x2f40f2,_0x267a0e);ChatWebsiteEvents['on'](_0x2f40f2,_0x3b911b);}};
\ No newline at end of file
+var _0x991e=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x295937,_0x2e250f){var _0x45ec54=function(_0x595465){while(--_0x595465){_0x295937['push'](_0x295937['shift']());}};_0x45ec54(++_0x2e250f);}(_0x991e,0x18a));var _0xe991=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x991e[_0x278e3c];return _0x3e2d9b;};'use strict';var ChatWebsiteEvents=require(_0xe991('0x0'));var events=[_0xe991('0x1'),'remove',_0xe991('0x2')];function createListener(_0x1056ed,_0x25e073){return function(_0x3bcf2b){_0x25e073[_0xe991('0x3')](_0x1056ed,_0x3bcf2b);};}function removeListener(_0x2009c8,_0x4cea33){return function(){ChatWebsiteEvents[_0xe991('0x4')](_0x2009c8,_0x4cea33);};}exports[_0xe991('0x5')]=function(_0x176f56){for(var _0x9a570f=0x0,_0x11089=events[_0xe991('0x6')];_0x9a570f<_0x11089;_0x9a570f++){var _0x755ada=events[_0x9a570f];var _0x14c71a=createListener(_0xe991('0x7')+_0x755ada,_0x176f56);ChatWebsiteEvents['on'](_0x755ada,_0x14c71a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 0882dcc..bb6eba9 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 _0x4b98=['removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','create','post','addAnswer','diskStorage','join','format','%s-%s','now','originalname','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','/:id','update','delete'];(function(_0x2ec40b,_0x59a29c){var _0x28ba77=function(_0x7e5046){while(--_0x7e5046){_0x2ec40b['push'](_0x2ec40b['shift']());}};_0x28ba77(++_0x59a29c);}(_0x4b98,0xcc));var _0x84b9=function(_0x136ed6,_0x1df16d){_0x136ed6=_0x136ed6-0x0;var _0x3bbfb9=_0x4b98[_0x136ed6];return _0x3bbfb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x84b9('0x0'));var timeout=require(_0x84b9('0x1'));var express=require(_0x84b9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x84b9('0x3'));var controller=require(_0x84b9('0x4'));router['get']('/',auth[_0x84b9('0x5')](),controller['index']);router['get'](_0x84b9('0x6'),auth[_0x84b9('0x5')](),controller['describe']);router[_0x84b9('0x7')]('/:id',auth[_0x84b9('0x5')](),controller[_0x84b9('0x8')]);router[_0x84b9('0x7')](_0x84b9('0x9'),auth[_0x84b9('0x5')](),controller[_0x84b9('0xa')]);router['get'](_0x84b9('0xb'),auth[_0x84b9('0x5')](),controller['getAnswers']);router['get'](_0x84b9('0xc'),controller[_0x84b9('0xd')]);router[_0x84b9('0x7')](_0x84b9('0xe'),controller[_0x84b9('0xf')]);router['get'](_0x84b9('0x10'),controller[_0x84b9('0x11')]);router[_0x84b9('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x84b9('0x7')](_0x84b9('0x12'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x13')]);router[_0x84b9('0x7')](_0x84b9('0x14'),controller[_0x84b9('0x15')]);router[_0x84b9('0x7')](_0x84b9('0x16'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x17')]);router[_0x84b9('0x7')](_0x84b9('0x18'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x19')]);router[_0x84b9('0x7')](_0x84b9('0x1a'),controller[_0x84b9('0x1b')]);router[_0x84b9('0x7')]('/:id/offline_messages',auth[_0x84b9('0x5')](),controller['getOfflineMessages']);router[_0x84b9('0x7')](_0x84b9('0x1c'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x1d')]);router['post']('/',auth[_0x84b9('0x5')](),controller[_0x84b9('0x1e')]);router[_0x84b9('0x1f')](_0x84b9('0x9'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x84b9('0x1f')](_0x84b9('0xb'),auth['isAuthenticated'](),controller[_0x84b9('0x20')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x24423a,_0x5ad94a,_0x11841d){_0x11841d(null,path[_0x84b9('0x22')](config['root'],'server/files/images/logos/'));},'filename':function(_0x23d6ca,_0x94cf27,_0x6bf1c){_0x6bf1c(null,util[_0x84b9('0x23')](_0x84b9('0x24'),Date[_0x84b9('0x25')](),_0x94cf27[_0x84b9('0x26')]));}})});router[_0x84b9('0x1f')](_0x84b9('0xc'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x29')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x42bc95,_0x583620,_0xeacb71){_0xeacb71(null,path[_0x84b9('0x22')](config[_0x84b9('0x2a')],_0x84b9('0x2b')));},'filename':function(_0x253d7f,_0xfa1cfe,_0x469855){_0x469855(null,util['format']('%s-%s',Date[_0x84b9('0x25')](),_0xfa1cfe['originalname']));}})});router[_0x84b9('0x1f')](_0x84b9('0xe'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2c')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x31d400,_0x146733,_0x51ab53){_0x51ab53(null,path[_0x84b9('0x22')](config['root'],_0x84b9('0x2b')));},'filename':function(_0x566072,_0x57456c,_0x1199f6){_0x1199f6(null,util[_0x84b9('0x23')]('%s-%s',Date[_0x84b9('0x25')](),_0x57456c[_0x84b9('0x26')]));}})});router[_0x84b9('0x1f')](_0x84b9('0x10'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32387d,_0x4ae5ac,_0x2bdd98){_0x2bdd98(null,path['join'](config[_0x84b9('0x2a')],_0x84b9('0x2b')));},'filename':function(_0x3e7cbf,_0x3af292,_0x397a10){_0x397a10(null,util[_0x84b9('0x23')](_0x84b9('0x24'),Date[_0x84b9('0x25')](),_0x3af292[_0x84b9('0x26')]));}})});router['post']('/:id/system_avatar',upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2e')]);router['post'](_0x84b9('0x2f'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x8a4624,_0x313dbf,_0x1209c4){const _0x167054=path[_0x84b9('0x22')](config[_0x84b9('0x2a')],_0x84b9('0x30'),_0x84b9('0x31'),_0x84b9('0x32'));fs_extra[_0x84b9('0x33')](_0x167054,function(){_0x1209c4(null,_0x167054);});},'filename':function(_0xb850a1,_0x3fc44a,_0x1ad198){const _0x27c6bd=_0x3fc44a[_0x84b9('0x26')][_0x84b9('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x320587=path[_0x84b9('0x35')](_0x27c6bd);const _0x313a82=Date[_0x84b9('0x25')]()+'-'+_0x27c6bd[_0x84b9('0x34')](_0x320587,'')+_0x320587;_0x1ad198(null,_0x313a82);}})});router[_0x84b9('0x1f')](_0x84b9('0x36'),offlineUploadMulter[_0x84b9('0x37')](),controller[_0x84b9('0x38')]);router[_0x84b9('0x1f')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x84b9('0x39')]);router['post'](_0x84b9('0x16'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x3a')]);router[_0x84b9('0x1f')](_0x84b9('0x18'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x3b')]);router[_0x84b9('0x1f')](_0x84b9('0x1c'),auth['isAuthenticated'](),controller[_0x84b9('0x3c')]);router['put'](_0x84b9('0x3d'),auth['isAuthenticated'](),controller[_0x84b9('0x3e')]);router['delete']('/:id',auth[_0x84b9('0x5')](),controller['destroy']);router[_0x84b9('0x3f')](_0x84b9('0x9'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x40')]);router[_0x84b9('0x3f')](_0x84b9('0xb'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x41')]);router[_0x84b9('0x3f')](_0x84b9('0x1c'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x42')]);module['exports']=router;
\ No newline at end of file
+var _0x3f51=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','join','addAvatar','now','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','notify','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util'];(function(_0x16ffdf,_0x15240c){var _0x10287c=function(_0x21531d){while(--_0x21531d){_0x16ffdf['push'](_0x16ffdf['shift']());}};_0x10287c(++_0x15240c);}(_0x3f51,0x1ba));var _0x13f5=function(_0x21d7b9,_0x5572d9){_0x21d7b9=_0x21d7b9-0x0;var _0xf2840=_0x3f51[_0x21d7b9];return _0xf2840;};'use strict';var multer=require(_0x13f5('0x0'));var util=require(_0x13f5('0x1'));var path=require(_0x13f5('0x2'));var timeout=require(_0x13f5('0x3'));var express=require(_0x13f5('0x4'));var router=express[_0x13f5('0x5')]();var fs_extra=require(_0x13f5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x13f5('0x7'));var config=require(_0x13f5('0x8'));var controller=require(_0x13f5('0x9'));router[_0x13f5('0xa')]('/',auth[_0x13f5('0xb')](),controller[_0x13f5('0xc')]);router[_0x13f5('0xa')]('/describe',auth[_0x13f5('0xb')](),controller[_0x13f5('0xd')]);router[_0x13f5('0xa')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller['show']);router[_0x13f5('0xa')](_0x13f5('0xf'),auth[_0x13f5('0xb')](),controller['getDispositions']);router[_0x13f5('0xa')](_0x13f5('0x10'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x11')]);router[_0x13f5('0xa')](_0x13f5('0x12'),controller['getLogo']);router[_0x13f5('0xa')](_0x13f5('0x13'),controller[_0x13f5('0x14')]);router[_0x13f5('0xa')](_0x13f5('0x15'),controller[_0x13f5('0x16')]);router[_0x13f5('0xa')](_0x13f5('0x17'),controller[_0x13f5('0x18')]);router[_0x13f5('0xa')](_0x13f5('0x19'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x1a')]);router[_0x13f5('0xa')](_0x13f5('0x1b'),controller[_0x13f5('0x1c')]);router[_0x13f5('0xa')](_0x13f5('0x1d'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x1e')]);router[_0x13f5('0xa')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x13f5('0x1f')]);router['get'](_0x13f5('0x20'),controller[_0x13f5('0x21')]);router[_0x13f5('0xa')](_0x13f5('0x22'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x23')]);router[_0x13f5('0xa')](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller['getAgents']);router[_0x13f5('0x25')]('/',auth[_0x13f5('0xb')](),controller[_0x13f5('0x26')]);router[_0x13f5('0x25')]('/:id/dispositions',auth[_0x13f5('0xb')](),controller[_0x13f5('0x27')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x13f5('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22680f,_0x2b1216,_0x133a52){_0x133a52(null,path['join'](config[_0x13f5('0x29')],_0x13f5('0x2a')));},'filename':function(_0x3b6acb,_0x42a933,_0x4af2de){_0x4af2de(null,util[_0x13f5('0x2b')](_0x13f5('0x2c'),Date['now'](),_0x42a933[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x12'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x30')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5031f9,_0x143f37,_0x2d5016){_0x2d5016(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],'server/files/images/avatars/'));},'filename':function(_0x5e15a1,_0x4c7ee6,_0x37eaa6){_0x37eaa6(null,util[_0x13f5('0x2b')](_0x13f5('0x2c'),Date['now'](),_0x4c7ee6[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x13'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x33')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5e87eb,_0x471b12,_0x523c3d){_0x523c3d(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],'server/files/images/avatars/'));},'filename':function(_0x40a19d,_0x40c1da,_0x26001b){_0x26001b(null,util[_0x13f5('0x2b')]('%s-%s',Date[_0x13f5('0x34')](),_0x40c1da['originalname']));}})});router[_0x13f5('0x25')](_0x13f5('0x15'),upload[_0x13f5('0x2e')]('file'),controller[_0x13f5('0x35')]);var upload=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x3caa05,_0x582d4b,_0x2bea7e){_0x2bea7e(null,path[_0x13f5('0x32')](config[_0x13f5('0x29')],_0x13f5('0x36')));},'filename':function(_0x4e07f8,_0xf518cc,_0x396f6c){_0x396f6c(null,util['format'](_0x13f5('0x2c'),Date[_0x13f5('0x34')](),_0xf518cc[_0x13f5('0x2d')]));}})});router[_0x13f5('0x25')](_0x13f5('0x17'),upload[_0x13f5('0x2e')](_0x13f5('0x2f')),controller[_0x13f5('0x37')]);router[_0x13f5('0x25')]('/:id/notify',controller[_0x13f5('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x13f5('0x31')]({'destination':function(_0x5aee49,_0x20d0c5,_0x23bf77){const _0x55ef73=path['join'](config['root'],'server/files','attachments',_0x13f5('0x39'));fs_extra[_0x13f5('0x3a')](_0x55ef73,function(){_0x23bf77(null,_0x55ef73);});},'filename':function(_0x5353cf,_0xa96244,_0x29643d){const _0xc2f69a=_0xa96244['originalname'][_0x13f5('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2d692c=path[_0x13f5('0x3c')](_0xc2f69a);const _0x5a781a=Date[_0x13f5('0x34')]()+'-'+_0xc2f69a[_0x13f5('0x3b')](_0x2d692c,'')+_0x2d692c;_0x29643d(null,_0x5a781a);}})});router[_0x13f5('0x25')]('/:id/offline',offlineUploadMulter[_0x13f5('0x3d')](),controller[_0x13f5('0x3e')]);router[_0x13f5('0x25')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x13f5('0x3f')]);router[_0x13f5('0x25')](_0x13f5('0x1d'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x40')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x13f5('0x41')]);router['post'](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x42')]);router[_0x13f5('0x43')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x44')]);router[_0x13f5('0x45')](_0x13f5('0xe'),auth[_0x13f5('0xb')](),controller[_0x13f5('0x46')]);router[_0x13f5('0x45')](_0x13f5('0xf'),auth['isAuthenticated'](),controller[_0x13f5('0x47')]);router[_0x13f5('0x45')]('/:id/canned_answers',auth[_0x13f5('0xb')](),controller[_0x13f5('0x48')]);router[_0x13f5('0x45')](_0x13f5('0x24'),auth[_0x13f5('0xb')](),controller['removeAgents']);module[_0x13f5('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 ee3c922..c6638e4 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 _0x6a33=['client-side-logger','Client-Side\x20logger\x20not\x20found!','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app','get'];(function(_0x45b858,_0x25b131){var _0x5304cd=function(_0x795c6c){while(--_0x795c6c){_0x45b858['push'](_0x45b858['shift']());}};_0x5304cd(++_0x25b131);}(_0x6a33,0x171));var _0x36a3=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x6a33[_0x87b0ff];return _0x3bc0b2;};var beaverLogger=require(_0x36a3('0x0'));var express=require(_0x36a3('0x1'));var auth=require(_0x36a3('0x2'));var config=require(_0x36a3('0x3'));var router=express[_0x36a3('0x4')]();var isProduction=config['env']===_0x36a3('0x5')||![];function clientSideLogs(_0x4f5fbf,_0x1b0a7b,_0x65d9a9){var _0x239233=_0x4f5fbf[_0x36a3('0x6')][_0x36a3('0x7')](_0x36a3('0x8'));if(!_0x239233){throw new Error(_0x36a3('0x9'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x239233,'enableCors':!isProduction})(_0x4f5fbf,_0x1b0a7b,_0x65d9a9);}router[_0x36a3('0xa')](auth[_0x36a3('0xb')](),clientSideLogs);module[_0x36a3('0xc')]=router;
\ No newline at end of file
+var _0xd224=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','production','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd224,0x70));var _0x4d22=function(_0x4353ff,_0xeb2cf6){_0x4353ff=_0x4353ff-0x0;var _0x530440=_0xd224[_0x4353ff];return _0x530440;};var beaverLogger=require(_0x4d22('0x0'));var express=require(_0x4d22('0x1'));var auth=require(_0x4d22('0x2'));var config=require(_0x4d22('0x3'));var router=express['Router']();var isProduction=config['env']===_0x4d22('0x4')||![];function clientSideLogs(_0x230d17,_0x435c21,_0x2c77c1){var _0x4193a8=_0x230d17['app']['get'](_0x4d22('0x5'));if(!_0x4193a8){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x4d22('0x6')]({'uri':_0x4d22('0x7'),'logger':_0x4193a8,'enableCors':!isProduction})(_0x230d17,_0x435c21,_0x2c77c1);}router[_0x4d22('0x8')](auth[_0x4d22('0x9')](),clientSideLogs);module[_0x4d22('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 86f82b6..51845ae 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 _0xff01=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x2fb6c7,_0xe46307){var _0x38b589=function(_0x53edf8){while(--_0x53edf8){_0x2fb6c7['push'](_0x2fb6c7['shift']());}};_0x38b589(++_0xe46307);}(_0xff01,0xa1));var _0x1ff0=function(_0x3a3538,_0x1e2c65){_0x3a3538=_0x3a3538-0x0;var _0x34fcf7=_0xff01[_0x3a3538];return _0x34fcf7;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize[_0x1ff0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ff0('0x3')](_0x1ff0('0x4'),'Google',_0x1ff0('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ff0('0x3')](_0x1ff0('0x6'),_0x1ff0('0x7'))},'data1':{'type':Sequelize[_0x1ff0('0x2')],'comment':_0x1ff0('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x1ff0('0x9')},'data4':{'type':Sequelize[_0x1ff0('0x2')],'comment':_0x1ff0('0xa')},'data5':{'type':Sequelize[_0x1ff0('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x1ff0('0xb')],'comment':_0x1ff0('0xc')},'data7':{'type':Sequelize[_0x1ff0('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x47ff=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47ff,0x17e));var _0xf47f=function(_0x25d6db,_0x51b7f8){_0x25d6db=_0x25d6db-0x0;var _0x2abc0c=_0x47ff[_0x25d6db];return _0x2abc0c;};'use strict';var Sequelize=require(_0xf47f('0x0'));module[_0xf47f('0x1')]={'name':{'type':Sequelize[_0xf47f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf47f('0x3'),_0xf47f('0x4'),_0xf47f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf47f('0x6')](_0xf47f('0x7'),_0xf47f('0x8'))},'data1':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0x9')},'data2':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0xa')},'data3':{'type':Sequelize[_0xf47f('0x2')],'comment':_0xf47f('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0xf47f('0xc')},'data5':{'type':Sequelize[_0xf47f('0xd')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf47f('0xd')],'comment':_0xf47f('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index bd9df7f..e43f33d 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 _0x23fc=['redis','defaults','localhost','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','create','Name\x20parameter\x20not\x20specified','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../mysqldb','./cloudProvider.oauth'];(function(_0x3b8e86,_0x31b2c2){var _0x3f18e5=function(_0x40fb98){while(--_0x40fb98){_0x3b8e86['push'](_0x3b8e86['shift']());}};_0x3f18e5(++_0x31b2c2);}(_0x23fc,0x1bd));var _0xc23f=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0x23fc[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0xc23f('0x0'));var Redis=require('ioredis');var qs=require(_0xc23f('0x1'));var encryptor=require(_0xc23f('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0xc23f('0x3'))['db'];var oauth=require(_0xc23f('0x4'));config[_0xc23f('0x5')]=_[_0xc23f('0x6')](config[_0xc23f('0x5')],{'host':_0xc23f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xc23f('0x5')]);function respondWithStatusCode(_0x1651d5,_0x441fc9){_0x441fc9=_0x441fc9||0xcc;return function(_0x128ba2){if(_0x128ba2){return _0x1651d5[_0xc23f('0x8')](_0x441fc9);}return _0x1651d5[_0xc23f('0x9')](_0x441fc9)[_0xc23f('0xa')]();};}function respondWithResult(_0x80d4b8,_0x49cedc){_0x49cedc=_0x49cedc||0xc8;return function(_0x26739f){if(_0x26739f){return _0x80d4b8[_0xc23f('0x9')](_0x49cedc)['json'](_0x26739f);}};}function respondWithFilteredResult(_0x5acc8e,_0x279412){return function(_0x29b086){if(_0x29b086){var _0x110266=typeof _0x279412[_0xc23f('0xb')]==='undefined'&&typeof _0x279412[_0xc23f('0xc')]===_0xc23f('0xd');var _0x2fb928=_0x29b086['count'];var _0x5c12da=_0x110266?0x0:_0x279412[_0xc23f('0xb')];var _0x548c06=_0x110266?_0x29b086[_0xc23f('0xe')]:_0x279412[_0xc23f('0xb')]+_0x279412[_0xc23f('0xc')];var _0x193b9f;if(_0x548c06>=_0x2fb928){_0x548c06=_0x2fb928;_0x193b9f=0xc8;}else{_0x193b9f=0xce;}_0x5acc8e[_0xc23f('0x9')](_0x193b9f);return _0x5acc8e[_0xc23f('0xf')](_0xc23f('0x10'),_0x5c12da+'-'+_0x548c06+'/'+_0x2fb928)[_0xc23f('0x11')](_0x29b086);}return null;};}function saveUpdates(_0x549f62){return function(_0x356189){if(_0x356189){return _0x356189[_0xc23f('0x12')](_0x549f62)[_0xc23f('0x13')](function(_0x24ef15){return _0x24ef15;});}return null;};}function removeEntity(_0x2d9b1f){return function(_0x635c42){if(_0x635c42){return _0x635c42[_0xc23f('0x14')]()[_0xc23f('0x13')](function(){_0x2d9b1f[_0xc23f('0x9')](0xcc)[_0xc23f('0xa')]();});}};}function handleEntityNotFound(_0x134586){return function(_0x347067){if(!_0x347067){_0x134586[_0xc23f('0x8')](0x194);}return _0x347067;};}function handleError(_0x1d0340,_0x1d2c0f){_0x1d2c0f=_0x1d2c0f||0x1f4;return function(_0x1b548b){logger[_0xc23f('0x15')](_0x1b548b['stack']);if(_0x1b548b[_0xc23f('0x16')]){delete _0x1b548b[_0xc23f('0x16')];}_0x1d0340['status'](_0x1d2c0f)[_0xc23f('0x17')](_0x1b548b);};}function maskClientSecret(_0x539a04){return _[_0xc23f('0x18')](_0x539a04[_0xc23f('0x19')](0x0,0x3),0x14,'*');}exports[_0xc23f('0x1a')]=function(_0x372ba1,_0x39fd05){var _0x2b23b9={},_0x151b15={},_0x487d97={'count':0x0,'rows':[]};var _0x2222f5=_['map'](db[_0xc23f('0x1b')][_0xc23f('0x1c')],function(_0x1ebb95){return{'name':_0x1ebb95[_0xc23f('0x1d')],'type':_0x1ebb95[_0xc23f('0x1e')]['key']};});_0x151b15[_0xc23f('0x1f')]=_[_0xc23f('0x20')](_0x2222f5,_0xc23f('0x16'));_0x151b15[_0xc23f('0x21')]=_[_0xc23f('0x22')](_0x372ba1[_0xc23f('0x21')]);_0x151b15[_0xc23f('0x23')]=_[_0xc23f('0x24')](_0x151b15[_0xc23f('0x1f')],_0x151b15[_0xc23f('0x21')]);_0x2b23b9['attributes']=_[_0xc23f('0x24')](_0x151b15[_0xc23f('0x1f')],qs[_0xc23f('0x25')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0x25')]));_0x2b23b9[_0xc23f('0x26')]=_0x2b23b9[_0xc23f('0x26')][_0xc23f('0x27')]?_0x2b23b9[_0xc23f('0x26')]:_0x151b15[_0xc23f('0x1f')];if(!_0x372ba1[_0xc23f('0x21')]['hasOwnProperty'](_0xc23f('0x28'))){_0x2b23b9['limit']=qs[_0xc23f('0xc')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0xc')]);_0x2b23b9[_0xc23f('0xb')]=qs[_0xc23f('0xb')](_0x372ba1[_0xc23f('0x21')]['offset']);}_0x2b23b9[_0xc23f('0x29')]=qs[_0xc23f('0x2a')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0x2a')]);_0x2b23b9[_0xc23f('0x2b')]=qs[_0xc23f('0x23')](_[_0xc23f('0x2c')](_0x372ba1[_0xc23f('0x21')],_0x151b15['filters']),_0x2222f5);if(_0x372ba1[_0xc23f('0x21')][_0xc23f('0x2d')]){_0x2b23b9['where']=_[_0xc23f('0x2e')](_0x2b23b9[_0xc23f('0x2b')],{'$or':_['map'](_0x2222f5,function(_0x52b83f){if(_0x52b83f[_0xc23f('0x1e')]!==_0xc23f('0x2f')){var _0x23f9cb={};_0x23f9cb[_0x52b83f['name']]={'$like':'%'+_0x372ba1[_0xc23f('0x21')]['filter']+'%'};return _0x23f9cb;}})});}_0x2b23b9=_[_0xc23f('0x2e')]({},_0x2b23b9,_0x372ba1[_0xc23f('0x30')]);var _0x2e071f={'where':_0x2b23b9[_0xc23f('0x2b')]};return db[_0xc23f('0x1b')][_0xc23f('0xe')](_0x2e071f)[_0xc23f('0x13')](function(_0x286041){_0x487d97[_0xc23f('0xe')]=_0x286041;if(_0x372ba1['query'][_0xc23f('0x31')]){_0x2b23b9['include']=[{'all':!![]}];}return db[_0xc23f('0x1b')][_0xc23f('0x32')](_0x2b23b9);})[_0xc23f('0x13')](function(_0x3c26a8){_0x487d97[_0xc23f('0x33')]=_[_0xc23f('0x20')](_0x3c26a8,function(_0x5e541c){if(_0x5e541c[_0xc23f('0x34')]===_0xc23f('0x35')){var _0x4f7bad=encryptor['decryptString'](_0x5e541c[_0xc23f('0x36')]);_0x5e541c[_0xc23f('0x36')]=maskClientSecret(_0x4f7bad);}return _0x5e541c;});return _0x487d97;})['then'](respondWithFilteredResult(_0x39fd05,_0x2b23b9))[_0xc23f('0x37')](handleError(_0x39fd05,null));};exports[_0xc23f('0x38')]=function(_0x5da204,_0x1ec7cb){var _0x3825c5={'raw':!![],'where':{'id':_0x5da204[_0xc23f('0x39')]['id']}},_0x526e3d={};_0x526e3d['model']=_[_0xc23f('0x22')](db['CloudProvider']['rawAttributes']);_0x526e3d[_0xc23f('0x21')]=_[_0xc23f('0x22')](_0x5da204[_0xc23f('0x21')]);_0x526e3d[_0xc23f('0x23')]=_[_0xc23f('0x24')](_0x526e3d[_0xc23f('0x1f')],_0x526e3d[_0xc23f('0x21')]);_0x3825c5[_0xc23f('0x26')]=_[_0xc23f('0x24')](_0x526e3d['model'],qs[_0xc23f('0x25')](_0x5da204[_0xc23f('0x21')]['fields']));_0x3825c5[_0xc23f('0x26')]=_0x3825c5[_0xc23f('0x26')]['length']?_0x3825c5[_0xc23f('0x26')]:_0x526e3d[_0xc23f('0x1f')];if(_0x5da204[_0xc23f('0x21')]['includeAll']){_0x3825c5['include']=[{'all':!![]}];}_0x3825c5=_[_0xc23f('0x2e')]({},_0x3825c5,_0x5da204[_0xc23f('0x30')]);return db[_0xc23f('0x1b')][_0xc23f('0x3a')](_0x3825c5)[_0xc23f('0x13')](handleEntityNotFound(_0x1ec7cb,null))[_0xc23f('0x13')](function(_0x3695c1){if(_0x3695c1[_0xc23f('0x34')]===_0xc23f('0x35')){var _0x2c97f4=encryptor['decryptString'](_0x3695c1[_0xc23f('0x36')]);_0x3695c1[_0xc23f('0x36')]=maskClientSecret(_0x2c97f4);}return _0x3695c1;})[_0xc23f('0x13')](respondWithResult(_0x1ec7cb,null))[_0xc23f('0x37')](handleError(_0x1ec7cb,null));};exports[_0xc23f('0x3b')]=function(_0x1b6835,_0x5ccb1b){if(!_0x1b6835['body'][_0xc23f('0x16')])throw new Error(_0xc23f('0x3c'));if(!_0x1b6835['body'][_0xc23f('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x38cd9d=db[_0xc23f('0x1b')][_0xc23f('0x1c')][_0xc23f('0x34')]['values'];if(!_0x38cd9d[_0xc23f('0x3d')](_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x34')]))throw new Error(_0xc23f('0x3f')+_0x38cd9d['join'](',\x20'));if(_0x1b6835['body'][_0xc23f('0x34')]===_0xc23f('0x35')&&_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x36')]){_0x1b6835['body'][_0xc23f('0x36')]=encryptor[_0xc23f('0x40')](_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x36')]);}return db[_0xc23f('0x1b')][_0xc23f('0x3b')](_0x1b6835[_0xc23f('0x3e')],{})[_0xc23f('0x13')](respondWithResult(_0x5ccb1b,0xc9))[_0xc23f('0x37')](handleError(_0x5ccb1b,null));};exports[_0xc23f('0x12')]=function(_0x1d973b,_0x50af21){if(_0x1d973b['body']['id']){delete _0x1d973b[_0xc23f('0x3e')]['id'];}return db[_0xc23f('0x1b')][_0xc23f('0x3a')]({'where':{'id':_0x1d973b[_0xc23f('0x39')]['id']}})[_0xc23f('0x13')](handleEntityNotFound(_0x50af21,null))[_0xc23f('0x13')](function(_0x358d51){if(_0x358d51[_0xc23f('0x34')]===_0xc23f('0x35')&&_0x1d973b['body']['data3']){_0x1d973b[_0xc23f('0x3e')]['data3']=encryptor[_0xc23f('0x40')](_0x1d973b['body']['data3']);}return _0x358d51;})['then'](saveUpdates(_0x1d973b[_0xc23f('0x3e')],null))[_0xc23f('0x13')](respondWithResult(_0x50af21,null))['catch'](handleError(_0x50af21,null));};exports[_0xc23f('0x14')]=function(_0x273357,_0x55eb41){return db[_0xc23f('0x1b')][_0xc23f('0x3a')]({'where':{'id':_0x273357[_0xc23f('0x39')]['id']}})[_0xc23f('0x13')](handleEntityNotFound(_0x55eb41,null))[_0xc23f('0x13')](removeEntity(_0x55eb41,null))[_0xc23f('0x37')](handleError(_0x55eb41,null));};exports[_0xc23f('0x41')]=function(_0x43ca2b,_0x3c0732){return db['CloudProvider'][_0xc23f('0x42')]({'where':{'id':_0x43ca2b['params']['id']},'raw':!![]})['then'](function(_0xdd4954){if(!_0xdd4954)return _0x3c0732[_0xc23f('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdd4954,_0x43ca2b[_0xc23f('0x43')]['id'])};})[_0xc23f('0x13')](respondWithResult(_0x3c0732,null))[_0xc23f('0x37')](handleError(_0x3c0732,null));};exports[_0xc23f('0x44')]=function(_0x584ef9,_0x5eb7d9){var _0x213659=_0x584ef9[_0xc23f('0x3e')];var _0x10f60f;var _0x285989;if(_0x213659[_0xc23f('0x15')])throw _0x213659;redis[_0xc23f('0x45')](_0x213659['state'])[_0xc23f('0x13')](function(_0x224e0e){if(!_0x224e0e)throw new Error(_0xc23f('0x46'));_0x10f60f=JSON[_0xc23f('0x47')](_0x224e0e);var _0x47c9f6=Buffer[_0xc23f('0x48')](_0x213659[_0xc23f('0x49')],_0xc23f('0x4a'))['toString'](_0xc23f('0x4b'));_0x285989=JSON[_0xc23f('0x47')](_0x47c9f6);if(!oauth[_0xc23f('0x4c')](_0x213659[_0xc23f('0x4d')],_0x10f60f[_0xc23f('0x4e')]))throw new Error(_0xc23f('0x4f'));redis['del'](_0x213659['state']);return oauth[_0xc23f('0x50')](_0x213659[_0xc23f('0x51')],_0x10f60f);})[_0xc23f('0x13')](function(_0x160cf9){_0x10f60f['data5']=_0x160cf9['access_token'];_0x10f60f[_0xc23f('0x52')]=_0x160cf9[_0xc23f('0x53')];return db[_0xc23f('0x1b')][_0xc23f('0x12')]({'data5':_0x10f60f[_0xc23f('0x54')],'data6':_0x10f60f[_0xc23f('0x52')]},{'where':{'id':_0x10f60f['id']}});})[_0xc23f('0x13')](function(){oauth['startRefreshInterval'](_0x10f60f);socket[_0xc23f('0x55')](_0xc23f('0x56'),{'id':_0x285989['id']});return;})[_0xc23f('0x13')](respondWithStatusCode(_0x5eb7d9,null))[_0xc23f('0x37')](function(_0xe8d9dd){if(_0x285989){socket[_0xc23f('0x55')]('microsoftAuthorization:error',{'id':_0x285989['id']});}if(!_0x10f60f){logger[_0xc23f('0x15')](_0xc23f('0x57'),_0xe8d9dd);return _0x5eb7d9['status'](0x1f4)[_0xc23f('0x17')](_0xe8d9dd['message']);}logger[_0xc23f('0x15')](_0xc23f('0x58'),_0x10f60f['id'],JSON[_0xc23f('0x59')](_0xe8d9dd));});};
\ No newline at end of file
+var _0xab13=['get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','error','stack','name','send','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','params','fields','length','includeAll','find','create','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback'];(function(_0x2bef7e,_0xc397d3){var _0x4231bc=function(_0x4f2fbe){while(--_0x4f2fbe){_0x2bef7e['push'](_0x2bef7e['shift']());}};_0x4231bc(++_0xc397d3);}(_0xab13,0x195));var _0x3ab1=function(_0x578a25,_0x368f7a){_0x578a25=_0x578a25-0x0;var _0x2a6ec0=_0xab13[_0x578a25];return _0x2a6ec0;};'use strict';var _=require(_0x3ab1('0x0'));var Redis=require(_0x3ab1('0x1'));var qs=require(_0x3ab1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x3ab1('0x3'));var logger=require(_0x3ab1('0x4'))('api');var db=require(_0x3ab1('0x5'))['db'];var oauth=require(_0x3ab1('0x6'));config[_0x3ab1('0x7')]=_[_0x3ab1('0x8')](config[_0x3ab1('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ab1('0x9'))(new Redis(config[_0x3ab1('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x29c195,_0x3c1ca2){_0x3c1ca2=_0x3c1ca2||0xcc;return function(_0x207ab9){if(_0x207ab9){return _0x29c195[_0x3ab1('0xa')](_0x3c1ca2);}return _0x29c195[_0x3ab1('0xb')](_0x3c1ca2)[_0x3ab1('0xc')]();};}function respondWithResult(_0x10b7e6,_0x475c01){_0x475c01=_0x475c01||0xc8;return function(_0x714140){if(_0x714140){return _0x10b7e6['status'](_0x475c01)[_0x3ab1('0xd')](_0x714140);}};}function respondWithFilteredResult(_0x40e293,_0x1b20bb){return function(_0x49c875){if(_0x49c875){var _0x2cabd7=typeof _0x1b20bb[_0x3ab1('0xe')]===_0x3ab1('0xf')&&typeof _0x1b20bb[_0x3ab1('0x10')]==='undefined';var _0x21a876=_0x49c875[_0x3ab1('0x11')];var _0x4fd81f=_0x2cabd7?0x0:_0x1b20bb['offset'];var _0x13cca6=_0x2cabd7?_0x49c875[_0x3ab1('0x11')]:_0x1b20bb[_0x3ab1('0xe')]+_0x1b20bb['limit'];var _0x1fa817;if(_0x13cca6>=_0x21a876){_0x13cca6=_0x21a876;_0x1fa817=0xc8;}else{_0x1fa817=0xce;}_0x40e293[_0x3ab1('0xb')](_0x1fa817);return _0x40e293['set'](_0x3ab1('0x12'),_0x4fd81f+'-'+_0x13cca6+'/'+_0x21a876)[_0x3ab1('0xd')](_0x49c875);}return null;};}function saveUpdates(_0x53d83e){return function(_0x2eaf7f){if(_0x2eaf7f){return _0x2eaf7f['update'](_0x53d83e)['then'](function(_0x315c77){return _0x315c77;});}return null;};}function removeEntity(_0xe034ea){return function(_0x538fb6){if(_0x538fb6){return _0x538fb6['destroy']()[_0x3ab1('0x13')](function(){_0xe034ea['status'](0xcc)[_0x3ab1('0xc')]();});}};}function handleEntityNotFound(_0x46c343){return function(_0x324682){if(!_0x324682){_0x46c343[_0x3ab1('0xa')](0x194);}return _0x324682;};}function handleError(_0x5291e3,_0x44f489){_0x44f489=_0x44f489||0x1f4;return function(_0x30f6a1){logger[_0x3ab1('0x14')](_0x30f6a1[_0x3ab1('0x15')]);if(_0x30f6a1[_0x3ab1('0x16')]){delete _0x30f6a1['name'];}_0x5291e3[_0x3ab1('0xb')](_0x44f489)[_0x3ab1('0x17')](_0x30f6a1);};}function maskClientSecret(_0x389750){return _['padEnd'](_0x389750[_0x3ab1('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x548559,_0x57e54f){var _0xeb5ecb={},_0x5818a1={},_0x51adbf={'count':0x0,'rows':[]};var _0x50de35=_[_0x3ab1('0x19')](db[_0x3ab1('0x1a')][_0x3ab1('0x1b')],function(_0x28fefc){return{'name':_0x28fefc[_0x3ab1('0x1c')],'type':_0x28fefc[_0x3ab1('0x1d')][_0x3ab1('0x1e')]};});_0x5818a1[_0x3ab1('0x1f')]=_[_0x3ab1('0x19')](_0x50de35,_0x3ab1('0x16'));_0x5818a1[_0x3ab1('0x20')]=_[_0x3ab1('0x21')](_0x548559['query']);_0x5818a1[_0x3ab1('0x22')]=_[_0x3ab1('0x23')](_0x5818a1[_0x3ab1('0x1f')],_0x5818a1[_0x3ab1('0x20')]);_0xeb5ecb['attributes']=_[_0x3ab1('0x23')](_0x5818a1[_0x3ab1('0x1f')],qs['fields'](_0x548559[_0x3ab1('0x20')]['fields']));_0xeb5ecb['attributes']=_0xeb5ecb[_0x3ab1('0x24')]['length']?_0xeb5ecb[_0x3ab1('0x24')]:_0x5818a1[_0x3ab1('0x1f')];if(!_0x548559[_0x3ab1('0x20')][_0x3ab1('0x25')](_0x3ab1('0x26'))){_0xeb5ecb['limit']=qs[_0x3ab1('0x10')](_0x548559[_0x3ab1('0x20')][_0x3ab1('0x10')]);_0xeb5ecb[_0x3ab1('0xe')]=qs[_0x3ab1('0xe')](_0x548559[_0x3ab1('0x20')]['offset']);}_0xeb5ecb['order']=qs[_0x3ab1('0x27')](_0x548559['query'][_0x3ab1('0x27')]);_0xeb5ecb[_0x3ab1('0x28')]=qs[_0x3ab1('0x22')](_[_0x3ab1('0x29')](_0x548559[_0x3ab1('0x20')],_0x5818a1[_0x3ab1('0x22')]),_0x50de35);if(_0x548559[_0x3ab1('0x20')][_0x3ab1('0x2a')]){_0xeb5ecb[_0x3ab1('0x28')]=_[_0x3ab1('0x2b')](_0xeb5ecb[_0x3ab1('0x28')],{'$or':_[_0x3ab1('0x19')](_0x50de35,function(_0x2fd186){if(_0x2fd186[_0x3ab1('0x1d')]!=='VIRTUAL'){var _0x1e7410={};_0x1e7410[_0x2fd186['name']]={'$like':'%'+_0x548559[_0x3ab1('0x20')][_0x3ab1('0x2a')]+'%'};return _0x1e7410;}})});}_0xeb5ecb=_[_0x3ab1('0x2b')]({},_0xeb5ecb,_0x548559[_0x3ab1('0x2c')]);var _0x474ab9={'where':_0xeb5ecb[_0x3ab1('0x28')]};return db[_0x3ab1('0x1a')]['count'](_0x474ab9)['then'](function(_0x5b50ed){_0x51adbf['count']=_0x5b50ed;if(_0x548559[_0x3ab1('0x20')]['includeAll']){_0xeb5ecb[_0x3ab1('0x2d')]=[{'all':!![]}];}return db[_0x3ab1('0x1a')][_0x3ab1('0x2e')](_0xeb5ecb);})[_0x3ab1('0x13')](function(_0x2f8530){_0x51adbf[_0x3ab1('0x2f')]=_[_0x3ab1('0x19')](_0x2f8530,function(_0x469ce9){if(_0x469ce9[_0x3ab1('0x30')]===_0x3ab1('0x31')){var _0x5afbb3=encryptor['decryptString'](_0x469ce9[_0x3ab1('0x32')]);_0x469ce9['data3']=maskClientSecret(_0x5afbb3);}return _0x469ce9;});return _0x51adbf;})[_0x3ab1('0x13')](respondWithFilteredResult(_0x57e54f,_0xeb5ecb))[_0x3ab1('0x33')](handleError(_0x57e54f,null));};exports['show']=function(_0x12b7ef,_0xbcf030){var _0xe6ac02={'raw':!![],'where':{'id':_0x12b7ef[_0x3ab1('0x34')]['id']}},_0x6b90e6={};_0x6b90e6['model']=_[_0x3ab1('0x21')](db['CloudProvider'][_0x3ab1('0x1b')]);_0x6b90e6['query']=_[_0x3ab1('0x21')](_0x12b7ef[_0x3ab1('0x20')]);_0x6b90e6[_0x3ab1('0x22')]=_[_0x3ab1('0x23')](_0x6b90e6[_0x3ab1('0x1f')],_0x6b90e6['query']);_0xe6ac02['attributes']=_[_0x3ab1('0x23')](_0x6b90e6[_0x3ab1('0x1f')],qs[_0x3ab1('0x35')](_0x12b7ef[_0x3ab1('0x20')][_0x3ab1('0x35')]));_0xe6ac02['attributes']=_0xe6ac02[_0x3ab1('0x24')][_0x3ab1('0x36')]?_0xe6ac02[_0x3ab1('0x24')]:_0x6b90e6[_0x3ab1('0x1f')];if(_0x12b7ef['query'][_0x3ab1('0x37')]){_0xe6ac02[_0x3ab1('0x2d')]=[{'all':!![]}];}_0xe6ac02=_[_0x3ab1('0x2b')]({},_0xe6ac02,_0x12b7ef[_0x3ab1('0x2c')]);return db[_0x3ab1('0x1a')][_0x3ab1('0x38')](_0xe6ac02)[_0x3ab1('0x13')](handleEntityNotFound(_0xbcf030,null))[_0x3ab1('0x13')](function(_0x17bdb8){if(_0x17bdb8[_0x3ab1('0x30')]===_0x3ab1('0x31')){var _0x4a26f5=encryptor['decryptString'](_0x17bdb8[_0x3ab1('0x32')]);_0x17bdb8[_0x3ab1('0x32')]=maskClientSecret(_0x4a26f5);}return _0x17bdb8;})[_0x3ab1('0x13')](respondWithResult(_0xbcf030,null))[_0x3ab1('0x33')](handleError(_0xbcf030,null));};exports[_0x3ab1('0x39')]=function(_0x43ee69,_0x4c63ea){if(!_0x43ee69['body'][_0x3ab1('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x43ee69[_0x3ab1('0x3a')]['service'])throw new Error(_0x3ab1('0x3b'));var _0x36279f=db[_0x3ab1('0x1a')]['rawAttributes'][_0x3ab1('0x30')]['values'];if(!_0x36279f[_0x3ab1('0x3c')](_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x30')]))throw new Error(_0x3ab1('0x3d')+_0x36279f[_0x3ab1('0x3e')](',\x20'));if(_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x30')]==='MicrosoftAzure'&&_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]){_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]=encryptor[_0x3ab1('0x3f')](_0x43ee69[_0x3ab1('0x3a')][_0x3ab1('0x32')]);}return db[_0x3ab1('0x1a')][_0x3ab1('0x39')](_0x43ee69[_0x3ab1('0x3a')],{})[_0x3ab1('0x13')](respondWithResult(_0x4c63ea,0xc9))[_0x3ab1('0x33')](handleError(_0x4c63ea,null));};exports[_0x3ab1('0x40')]=function(_0x565308,_0x13d359){if(_0x565308[_0x3ab1('0x3a')]['id']){delete _0x565308[_0x3ab1('0x3a')]['id'];}return db['CloudProvider'][_0x3ab1('0x38')]({'where':{'id':_0x565308[_0x3ab1('0x34')]['id']}})[_0x3ab1('0x13')](handleEntityNotFound(_0x13d359,null))[_0x3ab1('0x13')](function(_0x4cc6d4){if(_0x4cc6d4[_0x3ab1('0x30')]===_0x3ab1('0x31')&&_0x565308[_0x3ab1('0x3a')]['data3']){_0x565308[_0x3ab1('0x3a')][_0x3ab1('0x32')]=encryptor[_0x3ab1('0x3f')](_0x565308['body'][_0x3ab1('0x32')]);}return _0x4cc6d4;})['then'](saveUpdates(_0x565308[_0x3ab1('0x3a')],null))[_0x3ab1('0x13')](respondWithResult(_0x13d359,null))[_0x3ab1('0x33')](handleError(_0x13d359,null));};exports[_0x3ab1('0x41')]=function(_0x20496b,_0x35a638){return db['CloudProvider']['find']({'where':{'id':_0x20496b[_0x3ab1('0x34')]['id']}})[_0x3ab1('0x13')](handleEntityNotFound(_0x35a638,null))[_0x3ab1('0x13')](removeEntity(_0x35a638,null))[_0x3ab1('0x33')](handleError(_0x35a638,null));};exports[_0x3ab1('0x42')]=function(_0x2f5498,_0x450f1e){return db['CloudProvider'][_0x3ab1('0x43')]({'where':{'id':_0x2f5498[_0x3ab1('0x34')]['id']},'raw':!![]})[_0x3ab1('0x13')](function(_0x347998){if(!_0x347998)return _0x450f1e[_0x3ab1('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x347998,_0x2f5498[_0x3ab1('0x44')]['id'])};})[_0x3ab1('0x13')](respondWithResult(_0x450f1e,null))[_0x3ab1('0x33')](handleError(_0x450f1e,null));};exports[_0x3ab1('0x45')]=function(_0x5d67ba,_0x99d568){var _0x2370b6=_0x5d67ba[_0x3ab1('0x3a')];var _0x2bd12b;var _0xc583f4;if(_0x2370b6[_0x3ab1('0x14')])throw _0x2370b6;redis[_0x3ab1('0x46')](_0x2370b6[_0x3ab1('0x47')])[_0x3ab1('0x13')](function(_0x57af08){if(!_0x57af08)throw new Error('Invalid\x20state\x20parameter');_0x2bd12b=JSON[_0x3ab1('0x48')](_0x57af08);var _0x157859=Buffer[_0x3ab1('0x49')](_0x2370b6[_0x3ab1('0x47')],_0x3ab1('0x4a'))[_0x3ab1('0x4b')](_0x3ab1('0x4c'));_0xc583f4=JSON[_0x3ab1('0x48')](_0x157859);if(!oauth[_0x3ab1('0x4d')](_0x2370b6[_0x3ab1('0x4e')],_0x2bd12b[_0x3ab1('0x4f')]))throw new Error(_0x3ab1('0x50'));redis[_0x3ab1('0x51')](_0x2370b6[_0x3ab1('0x47')]);return oauth[_0x3ab1('0x52')](_0x2370b6[_0x3ab1('0x53')],_0x2bd12b);})['then'](function(_0x183abd){_0x2bd12b[_0x3ab1('0x54')]=_0x183abd['access_token'];_0x2bd12b[_0x3ab1('0x55')]=_0x183abd[_0x3ab1('0x56')];return db[_0x3ab1('0x1a')][_0x3ab1('0x40')]({'data5':_0x2bd12b['data5'],'data6':_0x2bd12b[_0x3ab1('0x55')]},{'where':{'id':_0x2bd12b['id']}});})[_0x3ab1('0x13')](function(){oauth[_0x3ab1('0x57')](_0x2bd12b);socket[_0x3ab1('0x58')](_0x3ab1('0x59'),{'id':_0xc583f4['id']});return;})[_0x3ab1('0x13')](respondWithStatusCode(_0x99d568,null))[_0x3ab1('0x33')](function(_0x2648ff){if(_0xc583f4){socket['emit'](_0x3ab1('0x5a'),{'id':_0xc583f4['id']});}if(!_0x2bd12b){logger['error'](_0x3ab1('0x5b'),_0x2648ff);return _0x99d568['status'](0x1f4)[_0x3ab1('0x17')](_0x2648ff[_0x3ab1('0x5c')]);}logger[_0x3ab1('0x14')](_0x3ab1('0x5d'),_0x2bd12b['id'],JSON[_0x3ab1('0x5e')](_0x2648ff));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c5cba57..da42e8c 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 _0x0fd2=['lodash','../../config/logger','api','moment','bluebird','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x6f4e6e,_0x231a01){var _0x1167ff=function(_0xa2427b){while(--_0xa2427b){_0x6f4e6e['push'](_0x6f4e6e['shift']());}};_0x1167ff(++_0x231a01);}(_0x0fd2,0xf8));var _0x20fd=function(_0x5090cb,_0x3ce576){_0x5090cb=_0x5090cb-0x0;var _0x40f648=_0x0fd2[_0x5090cb];return _0x40f648;};'use strict';var _=require(_0x20fd('0x0'));var util=require('util');var logger=require(_0x20fd('0x1'))(_0x20fd('0x2'));var moment=require(_0x20fd('0x3'));var BPromise=require(_0x20fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x20fd('0x5'));var attributes=require(_0x20fd('0x6'));module[_0x20fd('0x7')]=function(_0x1f9a39,_0x54dcf){return _0x1f9a39['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3352=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports'];(function(_0x3b64dd,_0x4391d1){var _0x1fa21d=function(_0x38403a){while(--_0x38403a){_0x3b64dd['push'](_0x3b64dd['shift']());}};_0x1fa21d(++_0x4391d1);}(_0x3352,0xff));var _0x2335=function(_0x51293c,_0x1a01e8){_0x51293c=_0x51293c-0x0;var _0x2cabbe=_0x3352[_0x51293c];return _0x2cabbe;};'use strict';var _=require(_0x2335('0x0'));var util=require('util');var logger=require(_0x2335('0x1'))(_0x2335('0x2'));var moment=require('moment');var BPromise=require(_0x2335('0x3'));var rp=require(_0x2335('0x4'));var fs=require('fs');var path=require(_0x2335('0x5'));var rimraf=require(_0x2335('0x6'));var config=require('../../config/environment');var attributes=require(_0x2335('0x7'));module[_0x2335('0x8')]=function(_0x54ca92,_0x1b3e0f){return _0x54ca92[_0x2335('0x9')](_0x2335('0xa'),attributes,{'tableName':_0x2335('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 8f8762d..2d4ebc7 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 _0xbe27=['client_id','data1','response_type','redirect_uri','data4','state','prompt','login','key','value','replace','set','iss','audience','nonce','isAfter','unix','exp','data3','refresh_token','data6','POST','then','access_token','CloudProvider','update','data5','catch','error','decryptString','bind','intervals','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','hex'];(function(_0x283be8,_0xea1092){var _0x15e6db=function(_0x500fc8){while(--_0x500fc8){_0x283be8['push'](_0x283be8['shift']());}};_0x15e6db(++_0xea1092);}(_0xbe27,0xb5));var _0x7be2=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbe27[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7be2('0x0'));var crypto=require(_0x7be2('0x1'));var jwt=require(_0x7be2('0x2'));var moment=require(_0x7be2('0x3'));var Redis=require(_0x7be2('0x4'));var rp=require(_0x7be2('0x5'));var util=require(_0x7be2('0x6'));var encryptor=require(_0x7be2('0x7'));var config=require('../../config/environment');var logger=require(_0x7be2('0x8'))(_0x7be2('0x9'));var schedule=require(_0x7be2('0xa'));var db=require(_0x7be2('0xb'))['db'];config[_0x7be2('0xc')]=_[_0x7be2('0xd')](config['redis'],{'host':_0x7be2('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x7be2('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7be2('0x10'),_0x7be2('0x11'),'email','offline_access',_0x7be2('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x7be2('0x13')],'Dynamics365':['openid',_0x7be2('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x7be2('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x7be2('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x23366a){var _0x38b8b6=_[_0x7be2('0x17')](AZURE_AUTH_SCOPES[_0x23366a[_0x7be2('0x18')]]);if(_0x23366a['type']===_0x7be2('0x19'))_0x38b8b6['push'](_0x23366a[_0x7be2('0x1a')]+_0x7be2('0x1b'));return _0x38b8b6[_0x7be2('0x1c')]('\x20');}function getAccessTokenScope(_0x28de9b){if(_0x28de9b[_0x7be2('0x18')]===_0x7be2('0x1d'))return _0x7be2('0x12');if(_0x28de9b['type']==='Dynamics365')return _0x28de9b['data7']+_0x7be2('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3773e4,_0x4c1546){var _0x2cdfd5=MICROSOFT_AUTH_URL['replace'](_0x7be2('0x1e'),_0x3773e4[_0x7be2('0x1f')]);var _0x56e82e=[_0x7be2('0x20'),_0x7be2('0x21')];var _0x1e4dc6=Buffer[_0x7be2('0x22')](JSON[_0x7be2('0x23')]({'id':_0x4c1546}))['toString']('base64');var _0x5c5220=crypto[_0x7be2('0x24')](0x10)['toString'](_0x7be2('0x25'));var _0x47e7aa=getAuthorizationScopes(_0x3773e4);var _0x5142e4=[{'key':_0x7be2('0x26'),'value':_0x3773e4[_0x7be2('0x27')]},{'key':_0x7be2('0x28'),'value':encodeURIComponent(_0x56e82e[_0x7be2('0x1c')]('\x20'))},{'key':_0x7be2('0x29'),'value':_0x3773e4[_0x7be2('0x2a')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x47e7aa)},{'key':_0x7be2('0x2b'),'value':_0x1e4dc6},{'key':'nonce','value':_0x5c5220},{'key':_0x7be2('0x2c'),'value':_0x7be2('0x2d')}];var _0x546553=_0x2cdfd5+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7be2('0x17')](_0x5142e4,function(_0x4e1f42){return _0x4e1f42[_0x7be2('0x2e')]+'='+_0x4e1f42[_0x7be2('0x2f')];})[_0x7be2('0x1c')]('&');_0x3773e4['oauth2Claims']={'issuer':_0x2cdfd5[_0x7be2('0x30')]('oauth2/',''),'audience':_0x3773e4[_0x7be2('0x27')],'state':_0x1e4dc6,'nonce':_0x5c5220};redis[_0x7be2('0x31')](_0x1e4dc6,JSON[_0x7be2('0x23')](_0x3773e4));return _0x546553;}function isValidIdToken(_0x2a7273,_0x1ddd4e){try{var _0xab8c17=jwt['decode'](_0x2a7273,{'complete':!![]});var _0x5bdd2c=_0xab8c17['payload'];if(_0x5bdd2c[_0x7be2('0x32')]!==_0x1ddd4e['issuer'])return![];if(_0x5bdd2c['aud']!==_0x1ddd4e[_0x7be2('0x33')])return![];if(_0x5bdd2c[_0x7be2('0x34')]!==_0x1ddd4e[_0x7be2('0x34')])return![];if(moment()[_0x7be2('0x35')](moment[_0x7be2('0x36')](_0x5bdd2c[_0x7be2('0x37')])))return![];return!![];}catch(_0x4d5203){throw _0x4d5203;}}function refreshOauth2MicrosoftAccessToken(_0x1ebbfc){return Promise['resolve']()['then'](function(){if(_0x1ebbfc[_0x7be2('0x38')])return _0x1ebbfc;return db['CloudProvider']['findOne']({'where':{'id':_0x1ebbfc['id']},'raw':!![]});})['then'](function(_0x6d057a){var _0x315353={'grant_type':_0x7be2('0x39'),'refresh_token':_0x6d057a[_0x7be2('0x3a')],'scope':getAccessTokenScope(_0x6d057a),'redirect_uri':_0x6d057a[_0x7be2('0x2a')],'client_id':_0x6d057a['data1'],'client_secret':encryptor['decryptString'](_0x6d057a[_0x7be2('0x38')])};var _0x408f76={'method':_0x7be2('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x7be2('0x30')](_0x7be2('0x1e'),_0x6d057a[_0x7be2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x315353,'json':!![]};return rp(_0x408f76);})[_0x7be2('0x3c')](function(_0x734a13){_0x1ebbfc['data5']=_0x734a13[_0x7be2('0x3d')];_0x1ebbfc[_0x7be2('0x3a')]=_0x734a13[_0x7be2('0x39')];return db[_0x7be2('0x3e')][_0x7be2('0x3f')]({'data5':_0x1ebbfc[_0x7be2('0x40')],'data6':_0x1ebbfc[_0x7be2('0x3a')]},{'where':{'id':_0x1ebbfc['id']}});})[_0x7be2('0x3c')](function(){return _0x1ebbfc;})[_0x7be2('0x41')](function(_0x3e6e34){logger[_0x7be2('0x42')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1ebbfc['id'],_0x3e6e34);});}function getOauth2MicrosoftAccessToken(_0x334212,_0x57e296){var _0x207368={'grant_type':'authorization_code','code':_0x334212,'scope':getAccessTokenScope(_0x57e296),'redirect_uri':_0x57e296['data4'],'client_id':_0x57e296['data1'],'client_secret':encryptor[_0x7be2('0x43')](_0x57e296[_0x7be2('0x38')])};var _0xb43ab7={'method':_0x7be2('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7be2('0x1e'),_0x57e296['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x207368,'json':!![]};return rp(_0xb43ab7);}function startRefreshInterval(_0x11e585){var _0x6745cc=schedule['intervals'];if(_0x6745cc[_0x11e585['id']])clearInterval(_0x6745cc[_0x11e585['id']]);_0x6745cc[_0x11e585['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7be2('0x44')](this,{'id':_0x11e585['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7be2('0x45')]=_0x6745cc;}function startAllRefreshIntervals(){return db[_0x7be2('0x3e')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x41e00a){var _0x542c5b=_0x41e00a[_0x7be2('0x17')](function(_0x535844){return refreshOauth2MicrosoftAccessToken(_0x535844)[_0x7be2('0x3c')](function(_0x10db97){startRefreshInterval(_0x10db97);});});return Promise['all'](_0x542c5b);})[_0x7be2('0x41')](function(_0x1fddb5){var _0x362f1c=_0x1fddb5?util[_0x7be2('0x46')](_0x1fddb5,{'showHidden':![],'depth':null}):'';logger[_0x7be2('0x42')](_0x7be2('0x47'),_0x362f1c);});}module[_0x7be2('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x2ac4=['key','value','oauth2Claims','decode','payload','iss','aud','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','data5','update','catch','error','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','hex','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login'];(function(_0xe5a2a5,_0x46f77f){var _0x4a9c68=function(_0x45cfb9){while(--_0x45cfb9){_0xe5a2a5['push'](_0xe5a2a5['shift']());}};_0x4a9c68(++_0x46f77f);}(_0x2ac4,0x6b));var _0x42ac=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x2ac4[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0x42ac('0x0'));var crypto=require(_0x42ac('0x1'));var jwt=require(_0x42ac('0x2'));var moment=require(_0x42ac('0x3'));var Redis=require(_0x42ac('0x4'));var rp=require(_0x42ac('0x5'));var util=require('util');var encryptor=require(_0x42ac('0x6'));var config=require(_0x42ac('0x7'));var logger=require(_0x42ac('0x8'))(_0x42ac('0x9'));var schedule=require(_0x42ac('0xa'));var db=require(_0x42ac('0xb'))['db'];config['redis']=_['defaults'](config[_0x42ac('0xc')],{'host':_0x42ac('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x42ac('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x42ac('0xf'),_0x42ac('0x10'),_0x42ac('0x11'),_0x42ac('0x12'),_0x42ac('0x13'),_0x42ac('0x14'),_0x42ac('0x15')],'Dynamics365':[_0x42ac('0xf'),_0x42ac('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x42ac('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x42ac('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x49c15b){var _0xa1c487=_[_0x42ac('0x18')](AZURE_AUTH_SCOPES[_0x49c15b[_0x42ac('0x19')]]);if(_0x49c15b[_0x42ac('0x19')]===_0x42ac('0x1a'))_0xa1c487[_0x42ac('0x1b')](_0x49c15b[_0x42ac('0x1c')]+'/.default');return _0xa1c487['join']('\x20');}function getAccessTokenScope(_0x460d4e){if(_0x460d4e['type']==='Outlook365')return _0x42ac('0x13');if(_0x460d4e['type']===_0x42ac('0x1a'))return _0x460d4e[_0x42ac('0x1c')]+_0x42ac('0x1d');}function generateMicrosoftAuthorizationUrl(_0x56f9e2,_0x3105bd){var _0x288a07=MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x56f9e2[_0x42ac('0x20')]);var _0x5a0c8c=[_0x42ac('0x21'),_0x42ac('0x22')];var _0x2c81f6=Buffer[_0x42ac('0x23')](JSON[_0x42ac('0x24')]({'id':_0x3105bd}))[_0x42ac('0x25')](_0x42ac('0x26'));var _0x196613=crypto['randomBytes'](0x10)[_0x42ac('0x25')](_0x42ac('0x27'));var _0x3ffc22=getAuthorizationScopes(_0x56f9e2);var _0x3ba736=[{'key':'client_id','value':_0x56f9e2[_0x42ac('0x28')]},{'key':_0x42ac('0x29'),'value':encodeURIComponent(_0x5a0c8c[_0x42ac('0x2a')]('\x20'))},{'key':_0x42ac('0x2b'),'value':_0x56f9e2[_0x42ac('0x2c')]},{'key':_0x42ac('0x2d'),'value':_0x42ac('0x2e')},{'key':_0x42ac('0x2f'),'value':encodeURIComponent(_0x3ffc22)},{'key':'state','value':_0x2c81f6},{'key':_0x42ac('0x30'),'value':_0x196613},{'key':_0x42ac('0x31'),'value':_0x42ac('0x32')}];var _0x39df6f=_0x288a07+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x42ac('0x18')](_0x3ba736,function(_0x5ee29d){return _0x5ee29d[_0x42ac('0x33')]+'='+_0x5ee29d[_0x42ac('0x34')];})['join']('&');_0x56f9e2[_0x42ac('0x35')]={'issuer':_0x288a07[_0x42ac('0x1e')]('oauth2/',''),'audience':_0x56f9e2[_0x42ac('0x28')],'state':_0x2c81f6,'nonce':_0x196613};redis['set'](_0x2c81f6,JSON[_0x42ac('0x24')](_0x56f9e2));return _0x39df6f;}function isValidIdToken(_0x290702,_0x3fd743){try{var _0x5218bc=jwt[_0x42ac('0x36')](_0x290702,{'complete':!![]});var _0x38e593=_0x5218bc[_0x42ac('0x37')];if(_0x38e593[_0x42ac('0x38')]!==_0x3fd743['issuer'])return![];if(_0x38e593[_0x42ac('0x39')]!==_0x3fd743['audience'])return![];if(_0x38e593[_0x42ac('0x30')]!==_0x3fd743[_0x42ac('0x30')])return![];if(moment()[_0x42ac('0x3a')](moment[_0x42ac('0x3b')](_0x38e593['exp'])))return![];return!![];}catch(_0x1247a9){throw _0x1247a9;}}function refreshOauth2MicrosoftAccessToken(_0x33c231){return Promise[_0x42ac('0x3c')]()[_0x42ac('0x3d')](function(){if(_0x33c231['data3'])return _0x33c231;return db[_0x42ac('0x3e')][_0x42ac('0x3f')]({'where':{'id':_0x33c231['id']},'raw':!![]});})[_0x42ac('0x3d')](function(_0x168b3a){var _0x382ace={'grant_type':_0x42ac('0x40'),'refresh_token':_0x168b3a[_0x42ac('0x41')],'scope':getAccessTokenScope(_0x168b3a),'redirect_uri':_0x168b3a[_0x42ac('0x2c')],'client_id':_0x168b3a[_0x42ac('0x28')],'client_secret':encryptor[_0x42ac('0x42')](_0x168b3a[_0x42ac('0x43')])};var _0x5ea092={'method':_0x42ac('0x44'),'uri':MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x168b3a[_0x42ac('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x382ace,'json':!![]};return rp(_0x5ea092);})['then'](function(_0x4211f4){_0x33c231[_0x42ac('0x45')]=_0x4211f4['access_token'];_0x33c231[_0x42ac('0x41')]=_0x4211f4['refresh_token'];return db['CloudProvider'][_0x42ac('0x46')]({'data5':_0x33c231['data5'],'data6':_0x33c231[_0x42ac('0x41')]},{'where':{'id':_0x33c231['id']}});})['then'](function(){return _0x33c231;})[_0x42ac('0x47')](function(_0x2491c2){logger[_0x42ac('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x33c231['id'],_0x2491c2);});}function getOauth2MicrosoftAccessToken(_0x34f57a,_0x1b9922){var _0x1d7753={'grant_type':_0x42ac('0x49'),'code':_0x34f57a,'scope':getAccessTokenScope(_0x1b9922),'redirect_uri':_0x1b9922[_0x42ac('0x2c')],'client_id':_0x1b9922[_0x42ac('0x28')],'client_secret':encryptor[_0x42ac('0x42')](_0x1b9922[_0x42ac('0x43')])};var _0x5ce8e3={'method':_0x42ac('0x44'),'uri':MICROSOFT_AUTH_URL[_0x42ac('0x1e')](_0x42ac('0x1f'),_0x1b9922['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d7753,'json':!![]};return rp(_0x5ce8e3);}function startRefreshInterval(_0x38d855){var _0x2c89be=schedule[_0x42ac('0x4a')];if(_0x2c89be[_0x38d855['id']])clearInterval(_0x2c89be[_0x38d855['id']]);_0x2c89be[_0x38d855['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x38d855['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x42ac('0x4a')]=_0x2c89be;}function startAllRefreshIntervals(){return db[_0x42ac('0x3e')][_0x42ac('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x42ac('0x3d')](function(_0x55cffc){var _0x53439f=_0x55cffc[_0x42ac('0x18')](function(_0x2c844f){return refreshOauth2MicrosoftAccessToken(_0x2c844f)[_0x42ac('0x3d')](function(_0x3db415){startRefreshInterval(_0x3db415);});});return Promise[_0x42ac('0x4c')](_0x53439f);})[_0x42ac('0x47')](function(_0x4164cd){var _0x5343c5=_0x4164cd?util[_0x42ac('0x4d')](_0x4164cd,{'showHidden':![],'depth':null}):'';logger[_0x42ac('0x48')](_0x42ac('0x4e'),_0x5343c5);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index a0a97e3..a521adc 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 _0x97b2=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x141a71,_0x53016f){var _0xc615a3=function(_0x3122a9){while(--_0x3122a9){_0x141a71['push'](_0x141a71['shift']());}};_0xc615a3(++_0x53016f);}(_0x97b2,0x1b7));var _0x297b=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x97b2[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var moment=require(_0x297b('0x2'));var BPromise=require(_0x297b('0x3'));var rs=require(_0x297b('0x4'));var fs=require('fs');var Redis=require(_0x297b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x297b('0x6'));var logger=require(_0x297b('0x7'))('rpc');var config=require(_0x297b('0x8'));var jayson=require(_0x297b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x541d7b,_0x2c5bf5,_0x18a663){return new BPromise(function(_0x520b38,_0x27a761){return client[_0x297b('0xa')](_0x541d7b,_0x18a663)['then'](function(_0x176f98){logger['info'](_0x297b('0xb'),_0x2c5bf5,'request\x20sent');logger[_0x297b('0xc')](_0x297b('0xd'),_0x2c5bf5,_0x297b('0xe'),JSON[_0x297b('0xf')](_0x176f98));if(_0x176f98[_0x297b('0x10')]){if(_0x176f98[_0x297b('0x10')][_0x297b('0x11')]===0x1f4){logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x176f98[_0x297b('0x10')][_0x297b('0x12')]);return _0x27a761(_0x176f98[_0x297b('0x10')][_0x297b('0x12')]);}logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x176f98['error'][_0x297b('0x12')]);return _0x520b38(_0x176f98[_0x297b('0x10')]['message']);}else{logger[_0x297b('0x13')](_0x297b('0xb'),_0x2c5bf5,_0x297b('0xe'));_0x520b38(_0x176f98[_0x297b('0x14')][_0x297b('0x12')]);}})[_0x297b('0x15')](function(_0x4882a4){logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x4882a4);_0x27a761(_0x4882a4);});});}
\ No newline at end of file
+var _0x3e22=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','CloudProvider,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x3d07f2,_0x19854d){var _0x26052a=function(_0x213834){while(--_0x213834){_0x3d07f2['push'](_0x3d07f2['shift']());}};_0x26052a(++_0x19854d);}(_0x3e22,0xa8));var _0x23e2=function(_0x271191,_0x3486bf){_0x271191=_0x271191-0x0;var _0x2765db=_0x3e22[_0x271191];return _0x2765db;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var moment=require('moment');var BPromise=require(_0x23e2('0x1'));var rs=require(_0x23e2('0x2'));var fs=require('fs');var Redis=require(_0x23e2('0x3'));var db=require(_0x23e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23e2('0x7')][_0x23e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8351,_0x927fbb,_0xb71434){return new BPromise(function(_0x4c13ae,_0x64c91b){return client[_0x23e2('0x9')](_0x3a8351,_0xb71434)[_0x23e2('0xa')](function(_0x75da0a){logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));logger[_0x23e2('0xd')](_0x23e2('0xe'),_0x927fbb,_0x23e2('0xc'),JSON[_0x23e2('0xf')](_0x75da0a));if(_0x75da0a['error']){if(_0x75da0a['error'][_0x23e2('0x10')]===0x1f4){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x64c91b(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x4c13ae(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}else{logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));_0x4c13ae(_0x75da0a[_0x23e2('0x14')][_0x23e2('0x13')]);}})[_0x23e2('0x15')](function(_0x276c2d){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x276c2d);_0x64c91b(_0x276c2d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f3f9a61..2aae8bc 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7a54,0x106));var _0x47a5=function(_0x7379ff,_0x28e37b){_0x7379ff=_0x7379ff-0x0;var _0x261e71=_0x7a54[_0x7379ff];return _0x261e71;};'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
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x486e22,_0x391ba0){var _0x35b822=function(_0x212e11){while(--_0x212e11){_0x486e22['push'](_0x486e22['shift']());}};_0x35b822(++_0x391ba0);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d7a02,_0x355848){_0x2d7a02=_0x2d7a02-0x0;var _0x2d3275=_0x2ef3[_0x2d7a02];return _0x2d3275;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index cb78472..deb9333 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 _0x7e2b=['exports','STRING','name','sequelize'];(function(_0x4c953c,_0x2edbb8){var _0xfa0543=function(_0x2d2cb1){while(--_0x2d2cb1){_0x4c953c['push'](_0x4c953c['shift']());}};_0xfa0543(++_0x2edbb8);}(_0x7e2b,0x67));var _0xb7e2=function(_0x117913,_0x4fd262){_0x117913=_0x117913-0x0;var _0xb8eacb=_0x7e2b[_0x117913];return _0xb8eacb;};'use strict';var Sequelize=require(_0xb7e2('0x0'));module[_0xb7e2('0x1')]={'name':{'type':Sequelize[_0xb7e2('0x2')],'unique':_0xb7e2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb7e2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb7e2('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb7e2('0x2')]},'street':{'type':Sequelize[_0xb7e2('0x2')]},'postalCode':{'type':Sequelize[_0xb7e2('0x2')]},'city':{'type':Sequelize[_0xb7e2('0x2')]},'country':{'type':Sequelize[_0xb7e2('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb7e2('0x2')]},'sStreet':{'type':Sequelize[_0xb7e2('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xb7e2('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb7e2('0x2')]}};
\ No newline at end of file
+var _0x5a1d=['exports','STRING','name','sequelize'];(function(_0x38bb34,_0x2e1c6b){var _0xdf1945=function(_0x24b6ba){while(--_0x24b6ba){_0x38bb34['push'](_0x38bb34['shift']());}};_0xdf1945(++_0x2e1c6b);}(_0x5a1d,0xa3));var _0xd5a1=function(_0x2e3ceb,_0x2fb08d){_0x2e3ceb=_0x2e3ceb-0x0;var _0x39c28f=_0x5a1d[_0x2e3ceb];return _0x39c28f;};'use strict';var Sequelize=require(_0xd5a1('0x0'));module[_0xd5a1('0x1')]={'name':{'type':Sequelize[_0xd5a1('0x2')],'unique':_0xd5a1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd5a1('0x2')]},'companyId':{'type':Sequelize[_0xd5a1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd5a1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd5a1('0x2')]},'email':{'type':Sequelize[_0xd5a1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd5a1('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd5a1('0x2')]},'sCountry':{'type':Sequelize[_0xd5a1('0x2')]},'description':{'type':Sequelize[_0xd5a1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d369e2b..7df6949 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 _0xa0d1=['destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','describe','addContacts','ids','omit','getContacts','CmContact','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0xe05e88,_0x54cbaf){var _0x4dde32=function(_0x17deca){while(--_0x17deca){_0xe05e88['push'](_0xe05e88['shift']());}};_0x4dde32(++_0x54cbaf);}(_0xa0d1,0x131));var _0x1a0d=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xa0d1[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x1a0d('0x0'));var rimraf=require(_0x1a0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0d('0x2'));var moment=require(_0x1a0d('0x3'));var BPromise=require(_0x1a0d('0x4'));var Mustache=require(_0x1a0d('0x5'));var util=require(_0x1a0d('0x6'));var path=require(_0x1a0d('0x7'));var sox=require(_0x1a0d('0x8'));var csv=require(_0x1a0d('0x9'));var ejs=require(_0x1a0d('0xa'));var fs=require('fs');var fs_extra=require(_0x1a0d('0xb'));var _=require('lodash');var squel=require(_0x1a0d('0xc'));var crypto=require(_0x1a0d('0xd'));var jsforce=require(_0x1a0d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1a0d('0x9'));var querystring=require(_0x1a0d('0xf'));var Papa=require(_0x1a0d('0x10'));var Redis=require(_0x1a0d('0x11'));var authService=require(_0x1a0d('0x12'));var qs=require(_0x1a0d('0x13'));var as=require(_0x1a0d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a0d('0x15'))(_0x1a0d('0x16'));var utils=require('../../config/utils');var config=require(_0x1a0d('0x17'));var licenseUtil=require(_0x1a0d('0x18'));var db=require(_0x1a0d('0x19'))['db'];function respondWithStatusCode(_0x18be62,_0x5f47b7){_0x5f47b7=_0x5f47b7||0xcc;return function(_0x5ddc78){if(_0x5ddc78){return _0x18be62[_0x1a0d('0x1a')](_0x5f47b7);}return _0x18be62['status'](_0x5f47b7)[_0x1a0d('0x1b')]();};}function respondWithResult(_0x111e0c,_0xad2c6c){_0xad2c6c=_0xad2c6c||0xc8;return function(_0x403050){if(_0x403050){return _0x111e0c[_0x1a0d('0x1c')](_0xad2c6c)[_0x1a0d('0x1d')](_0x403050);}};}function respondWithFilteredResult(_0x2e0329,_0x140820){return function(_0x369ca0){if(_0x369ca0){var _0x201a77=typeof _0x140820['offset']===_0x1a0d('0x1e')&&typeof _0x140820['limit']===_0x1a0d('0x1e');var _0x5d25d9=_0x369ca0['count'];var _0x4461ee=_0x201a77?0x0:_0x140820[_0x1a0d('0x1f')];var _0x55d881=_0x201a77?_0x369ca0['count']:_0x140820[_0x1a0d('0x1f')]+_0x140820[_0x1a0d('0x20')];var _0x1b7e38;if(_0x55d881>=_0x5d25d9){_0x55d881=_0x5d25d9;_0x1b7e38=0xc8;}else{_0x1b7e38=0xce;}_0x2e0329['status'](_0x1b7e38);return _0x2e0329[_0x1a0d('0x21')](_0x1a0d('0x22'),_0x4461ee+'-'+_0x55d881+'/'+_0x5d25d9)[_0x1a0d('0x1d')](_0x369ca0);}return null;};}function patchUpdates(_0x2e8848){return function(_0x185df4){try{jsonpatch[_0x1a0d('0x23')](_0x185df4,_0x2e8848,!![]);}catch(_0x15a0c1){return BPromise['reject'](_0x15a0c1);}return _0x185df4[_0x1a0d('0x24')]();};}function saveUpdates(_0x341c6c,_0x59e6e9){return function(_0x26e6f9){if(_0x26e6f9){return _0x26e6f9[_0x1a0d('0x25')](_0x341c6c)[_0x1a0d('0x26')](function(_0x3892b4){return _0x3892b4;});}return null;};}function removeEntity(_0x59e0a0,_0x53d740){return function(_0x47ea5d){if(_0x47ea5d){return _0x47ea5d[_0x1a0d('0x27')]()['then'](function(){var _0x408082=_0x47ea5d[_0x1a0d('0x28')]({'plain':!![]});var _0x5d0b13=_0x1a0d('0x29');return db[_0x1a0d('0x2a')][_0x1a0d('0x27')]({'where':{'type':_0x5d0b13,'resourceId':_0x408082['id']}})[_0x1a0d('0x26')](function(){return _0x47ea5d;});})[_0x1a0d('0x26')](function(){_0x59e0a0[_0x1a0d('0x1c')](0xcc)[_0x1a0d('0x1b')]();});}};}function handleEntityNotFound(_0x97e1fd,_0x12ae9e){return function(_0x196769){if(!_0x196769){_0x97e1fd[_0x1a0d('0x1a')](0x194);}return _0x196769;};}function handleError(_0x2f748b,_0x2981f8){_0x2981f8=_0x2981f8||0x1f4;return function(_0x522965){logger[_0x1a0d('0x2b')](_0x522965[_0x1a0d('0x2c')]);if(_0x522965['name']){delete _0x522965[_0x1a0d('0x2d')];}_0x2f748b['status'](_0x2981f8)['send'](_0x522965);};}exports[_0x1a0d('0x2e')]=function(_0x3063c2,_0x3ea4b3){var _0x1980ec={},_0x156e63={},_0x56a848={'count':0x0,'rows':[]};return db[_0x1a0d('0x2f')]['describe']()['then'](function(_0x3e7f90){_0x156e63[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](_0x3e7f90);_0x156e63[_0x1a0d('0x32')]=_['keys'](_0x3063c2[_0x1a0d('0x32')]);_0x156e63[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x156e63[_0x1a0d('0x30')],_0x156e63[_0x1a0d('0x32')]);_0x1980ec[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x156e63[_0x1a0d('0x30')],qs[_0x1a0d('0x36')](_0x3063c2['query'][_0x1a0d('0x36')]));_0x1980ec['attributes']=_0x1980ec[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x1980ec[_0x1a0d('0x35')]:_0x156e63[_0x1a0d('0x30')];if(!_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x38')](_0x1a0d('0x39'))){_0x1980ec[_0x1a0d('0x20')]=qs['limit'](_0x3063c2['query']['limit']);_0x1980ec[_0x1a0d('0x1f')]=qs[_0x1a0d('0x1f')](_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x1f')]);}_0x1980ec[_0x1a0d('0x3a')]=qs[_0x1a0d('0x3b')](_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x3b')]);_0x1980ec[_0x1a0d('0x3c')]=qs['filters'](_['pick'](_0x3063c2[_0x1a0d('0x32')],_0x156e63[_0x1a0d('0x33')]),_0x3e7f90);if(_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x3d')]){_0x1980ec['where']=_[_0x1a0d('0x3e')](_0x1980ec[_0x1a0d('0x3c')],{'$or':_[_0x1a0d('0x3f')](_0x1980ec['attributes'],function(_0x1f7362){var _0x5ed23d={};_0x5ed23d[_0x1f7362]={'$like':'%'+_0x3063c2[_0x1a0d('0x32')]['filter']+'%'};return _0x5ed23d;})});}_0x1980ec=_[_0x1a0d('0x3e')]({},_0x1980ec,_0x3063c2[_0x1a0d('0x40')]);var _0x5914a1={'where':_0x1980ec[_0x1a0d('0x3c')]};return db[_0x1a0d('0x2f')][_0x1a0d('0x41')](_0x5914a1)[_0x1a0d('0x26')](function(_0x380dfc){_0x56a848[_0x1a0d('0x41')]=_0x380dfc;if(_0x3063c2['query'][_0x1a0d('0x42')]){_0x1980ec[_0x1a0d('0x43')]=[{'all':!![]}];}return db[_0x1a0d('0x2f')][_0x1a0d('0x44')](_0x1980ec);})[_0x1a0d('0x26')](function(_0xa22b45){_0x56a848[_0x1a0d('0x45')]=_0xa22b45;return _0x56a848;})[_0x1a0d('0x26')](respondWithFilteredResult(_0x3ea4b3,_0x1980ec))['catch'](handleError(_0x3ea4b3,null));})[_0x1a0d('0x46')](handleError(_0x3ea4b3,null));};exports[_0x1a0d('0x47')]=function(_0x2d1c0c,_0x1e52c3){var _0x1b5525={'raw':![],'where':{'id':_0x2d1c0c[_0x1a0d('0x48')]['id']}},_0x28c272={};_0x28c272[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](db[_0x1a0d('0x2f')][_0x1a0d('0x49')]);_0x28c272[_0x1a0d('0x32')]=_[_0x1a0d('0x31')](_0x2d1c0c['query']);_0x28c272[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x28c272['model'],_0x28c272[_0x1a0d('0x32')]);_0x1b5525[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x28c272['model'],qs[_0x1a0d('0x36')](_0x2d1c0c[_0x1a0d('0x32')][_0x1a0d('0x36')]));_0x1b5525[_0x1a0d('0x35')]=_0x1b5525[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x1b5525[_0x1a0d('0x35')]:_0x28c272[_0x1a0d('0x30')];if(_0x2d1c0c[_0x1a0d('0x32')][_0x1a0d('0x42')]){_0x1b5525[_0x1a0d('0x43')]=[{'all':!![]}];}_0x1b5525=_[_0x1a0d('0x3e')]({},_0x1b5525,_0x2d1c0c['options']);return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')](_0x1b5525)['then'](handleEntityNotFound(_0x1e52c3,null))['then'](respondWithResult(_0x1e52c3,null))[_0x1a0d('0x46')](handleError(_0x1e52c3,null));};exports[_0x1a0d('0x4b')]=function(_0x2cb276,_0x580c78){return db['CmCompany'][_0x1a0d('0x4b')](_0x2cb276[_0x1a0d('0x4c')],{})[_0x1a0d('0x26')](function(_0x2bf37e){var _0x5cb045=_0x2cb276[_0x1a0d('0x4d')][_0x1a0d('0x28')]({'plain':!![]});if(!_0x5cb045)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cb045[_0x1a0d('0x4e')]===_0x1a0d('0x4d')){var _0x3d3abd=_0x2bf37e[_0x1a0d('0x28')]({'plain':!![]});var _0x2b46d3=_0x1a0d('0x29');return db[_0x1a0d('0x4f')][_0x1a0d('0x4a')]({'where':{'name':_0x2b46d3,'userProfileId':_0x5cb045['userProfileId']},'raw':!![]})[_0x1a0d('0x26')](function(_0x554534){if(_0x554534&&_0x554534['autoAssociation']===0x0){return db[_0x1a0d('0x2a')][_0x1a0d('0x4b')]({'name':_0x3d3abd[_0x1a0d('0x2d')],'resourceId':_0x3d3abd['id'],'type':_0x554534[_0x1a0d('0x2d')],'sectionId':_0x554534['id']},{})[_0x1a0d('0x26')](function(){return _0x2bf37e;});}else{return _0x2bf37e;}})[_0x1a0d('0x46')](function(_0x501f80){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501f80);throw _0x501f80;});}return _0x2bf37e;})[_0x1a0d('0x26')](respondWithResult(_0x580c78,0xc9))['catch'](handleError(_0x580c78,null));};exports[_0x1a0d('0x25')]=function(_0x31a0ab,_0x31923b){if(_0x31a0ab[_0x1a0d('0x4c')]['id']){delete _0x31a0ab[_0x1a0d('0x4c')]['id'];}return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')]({'where':{'id':_0x31a0ab[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x31923b,null))[_0x1a0d('0x26')](saveUpdates(_0x31a0ab[_0x1a0d('0x4c')],null))[_0x1a0d('0x26')](respondWithResult(_0x31923b,null))[_0x1a0d('0x46')](handleError(_0x31923b,null));};exports['destroy']=function(_0x5242d7,_0x585d79){return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')]({'where':{'id':_0x5242d7['params']['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x585d79,null))[_0x1a0d('0x26')](removeEntity(_0x585d79,null))[_0x1a0d('0x46')](handleError(_0x585d79,null));};exports[_0x1a0d('0x50')]=function(_0x1fb454,_0x443d6a){return db[_0x1a0d('0x2f')][_0x1a0d('0x50')]()[_0x1a0d('0x26')](respondWithResult(_0x443d6a,null))['catch'](handleError(_0x443d6a,null));};exports[_0x1a0d('0x51')]=function(_0x48a47a,_0x26a112,_0x1245c4){return db['CmContact'][_0x1a0d('0x4a')]({'where':{'id':_0x48a47a[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x26a112,null))[_0x1a0d('0x26')](function(_0xce5c64){if(_0xce5c64){return _0xce5c64[_0x1a0d('0x51')](_0x48a47a[_0x1a0d('0x4c')][_0x1a0d('0x52')],_[_0x1a0d('0x53')](_0x48a47a[_0x1a0d('0x4c')],['ids','id'])||{});}})[_0x1a0d('0x26')](respondWithResult(_0x26a112,null))['catch'](handleError(_0x26a112,null));};exports[_0x1a0d('0x54')]=function(_0x257381,_0x28d4bf,_0x14548a){var _0x4707f8={};var _0x3fb6f7={};var _0x4b0ad8;var _0x260cd4;return db['CmCompany']['findOne']({'where':{'id':_0x257381[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x28d4bf,null))['then'](function(_0x43f9d3){if(_0x43f9d3){_0x4b0ad8=_0x43f9d3;_0x3fb6f7[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](db[_0x1a0d('0x55')][_0x1a0d('0x49')]);_0x3fb6f7[_0x1a0d('0x32')]=_['keys'](_0x257381['query']);_0x3fb6f7[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x3fb6f7[_0x1a0d('0x30')],_0x3fb6f7[_0x1a0d('0x32')]);_0x4707f8[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x3fb6f7[_0x1a0d('0x30')],qs[_0x1a0d('0x36')](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x36')]));_0x4707f8[_0x1a0d('0x35')]=_0x4707f8[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x4707f8[_0x1a0d('0x35')]:_0x3fb6f7[_0x1a0d('0x30')];_0x4707f8[_0x1a0d('0x3a')]=qs[_0x1a0d('0x3b')](_0x257381[_0x1a0d('0x32')]['sort']);_0x4707f8[_0x1a0d('0x3c')]=qs[_0x1a0d('0x33')](_['pick'](_0x257381[_0x1a0d('0x32')],_0x3fb6f7[_0x1a0d('0x33')]));if(_0x257381[_0x1a0d('0x32')]['filter']){_0x4707f8[_0x1a0d('0x3c')]=_[_0x1a0d('0x3e')](_0x4707f8[_0x1a0d('0x3c')],{'$or':_[_0x1a0d('0x3f')](_0x4707f8['attributes'],function(_0x135c38){var _0x1d76a={};_0x1d76a[_0x135c38]={'$like':'%'+_0x257381[_0x1a0d('0x32')][_0x1a0d('0x3d')]+'%'};return _0x1d76a;})});}_0x4707f8=_[_0x1a0d('0x3e')]({},_0x4707f8,_0x257381[_0x1a0d('0x40')]);return _0x4b0ad8['getContacts'](_0x4707f8);}})[_0x1a0d('0x26')](function(_0x428cc9){if(_0x428cc9){_0x260cd4=_0x428cc9[_0x1a0d('0x37')];if(!_0x257381['query']['hasOwnProperty'](_0x1a0d('0x39'))){_0x4707f8[_0x1a0d('0x20')]=qs['limit'](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x20')]);_0x4707f8[_0x1a0d('0x1f')]=qs[_0x1a0d('0x1f')](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x1f')]);}return _0x4b0ad8[_0x1a0d('0x54')](_0x4707f8);}})[_0x1a0d('0x26')](function(_0x266c8a){if(_0x266c8a){return _0x266c8a?{'count':_0x260cd4,'rows':_0x266c8a}:null;}})[_0x1a0d('0x26')](respondWithResult(_0x28d4bf,null))[_0x1a0d('0x46')](handleError(_0x28d4bf,null));};
\ No newline at end of file
+var _0x757a=['getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','undefined','offset','count','set','json','apply','save','update','then','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','addContacts','ids','omit','CmContact','map'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x757a,0x103));var _0xa757=function(_0x884245,_0x2d5d70){_0x884245=_0x884245-0x0;var _0x187754=_0x757a[_0x884245];return _0x187754;};'use strict';var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require(_0xa757('0x2'));var jsonpatch=require(_0xa757('0x3'));var rp=require(_0xa757('0x4'));var moment=require(_0xa757('0x5'));var BPromise=require(_0xa757('0x6'));var Mustache=require(_0xa757('0x7'));var util=require('util');var path=require(_0xa757('0x8'));var sox=require(_0xa757('0x9'));var csv=require(_0xa757('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0xb'));var _=require(_0xa757('0xc'));var squel=require(_0xa757('0xd'));var crypto=require('crypto');var jsforce=require(_0xa757('0xe'));var deskjs=require(_0xa757('0xf'));var toCsv=require(_0xa757('0xa'));var querystring=require(_0xa757('0x10'));var Papa=require(_0xa757('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa757('0x12'));var as=require(_0xa757('0x13'));var hardwareService=require(_0xa757('0x14'));var logger=require(_0xa757('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa757('0x16'))['db'];function respondWithStatusCode(_0x276198,_0x334302){_0x334302=_0x334302||0xcc;return function(_0x883b33){if(_0x883b33){return _0x276198[_0xa757('0x17')](_0x334302);}return _0x276198[_0xa757('0x18')](_0x334302)['end']();};}function respondWithResult(_0x30ed60,_0x8411c0){_0x8411c0=_0x8411c0||0xc8;return function(_0x4665e8){if(_0x4665e8){return _0x30ed60[_0xa757('0x18')](_0x8411c0)['json'](_0x4665e8);}};}function respondWithFilteredResult(_0x3d1b06,_0x4bbb63){return function(_0x45f486){if(_0x45f486){var _0xdf3f1=typeof _0x4bbb63['offset']===_0xa757('0x19')&&typeof _0x4bbb63['limit']===_0xa757('0x19');var _0x2b1b49=_0x45f486['count'];var _0x10506a=_0xdf3f1?0x0:_0x4bbb63[_0xa757('0x1a')];var _0x4012c6=_0xdf3f1?_0x45f486[_0xa757('0x1b')]:_0x4bbb63[_0xa757('0x1a')]+_0x4bbb63['limit'];var _0x1ac04b;if(_0x4012c6>=_0x2b1b49){_0x4012c6=_0x2b1b49;_0x1ac04b=0xc8;}else{_0x1ac04b=0xce;}_0x3d1b06[_0xa757('0x18')](_0x1ac04b);return _0x3d1b06[_0xa757('0x1c')]('Content-Range',_0x10506a+'-'+_0x4012c6+'/'+_0x2b1b49)[_0xa757('0x1d')](_0x45f486);}return null;};}function patchUpdates(_0x30b6fc){return function(_0x559fb3){try{jsonpatch[_0xa757('0x1e')](_0x559fb3,_0x30b6fc,!![]);}catch(_0x416f7f){return BPromise['reject'](_0x416f7f);}return _0x559fb3[_0xa757('0x1f')]();};}function saveUpdates(_0x32101d,_0x3de435){return function(_0x4b433f){if(_0x4b433f){return _0x4b433f[_0xa757('0x20')](_0x32101d)[_0xa757('0x21')](function(_0x40a07b){return _0x40a07b;});}return null;};}function removeEntity(_0x3ff435,_0x46d1d4){return function(_0x238ff0){if(_0x238ff0){return _0x238ff0['destroy']()[_0xa757('0x21')](function(){var _0x32826e=_0x238ff0[_0xa757('0x22')]({'plain':!![]});var _0x425190=_0xa757('0x23');return db[_0xa757('0x24')]['destroy']({'where':{'type':_0x425190,'resourceId':_0x32826e['id']}})[_0xa757('0x21')](function(){return _0x238ff0;});})[_0xa757('0x21')](function(){_0x3ff435[_0xa757('0x18')](0xcc)[_0xa757('0x25')]();});}};}function handleEntityNotFound(_0x14627b,_0x45d3e3){return function(_0x41fbd3){if(!_0x41fbd3){_0x14627b['sendStatus'](0x194);}return _0x41fbd3;};}function handleError(_0x73d910,_0x38a2da){_0x38a2da=_0x38a2da||0x1f4;return function(_0x17422b){logger['error'](_0x17422b[_0xa757('0x26')]);if(_0x17422b['name']){delete _0x17422b[_0xa757('0x27')];}_0x73d910[_0xa757('0x18')](_0x38a2da)[_0xa757('0x28')](_0x17422b);};}exports[_0xa757('0x29')]=function(_0x9e59c3,_0x5e0d25){var _0x4e8efd={},_0x2b4bdd={},_0x23eba7={'count':0x0,'rows':[]};return db[_0xa757('0x2a')][_0xa757('0x2b')]()['then'](function(_0x123106){_0x2b4bdd['model']=_[_0xa757('0x2c')](_0x123106);_0x2b4bdd[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x9e59c3[_0xa757('0x2d')]);_0x2b4bdd[_0xa757('0x2e')]=_['intersection'](_0x2b4bdd[_0xa757('0x2f')],_0x2b4bdd[_0xa757('0x2d')]);_0x4e8efd[_0xa757('0x30')]=_[_0xa757('0x31')](_0x2b4bdd[_0xa757('0x2f')],qs[_0xa757('0x32')](_0x9e59c3['query'][_0xa757('0x32')]));_0x4e8efd[_0xa757('0x30')]=_0x4e8efd['attributes'][_0xa757('0x33')]?_0x4e8efd[_0xa757('0x30')]:_0x2b4bdd[_0xa757('0x2f')];if(!_0x9e59c3['query'][_0xa757('0x34')](_0xa757('0x35'))){_0x4e8efd[_0xa757('0x36')]=qs[_0xa757('0x36')](_0x9e59c3['query'][_0xa757('0x36')]);_0x4e8efd[_0xa757('0x1a')]=qs['offset'](_0x9e59c3[_0xa757('0x2d')]['offset']);}_0x4e8efd[_0xa757('0x37')]=qs[_0xa757('0x38')](_0x9e59c3['query']['sort']);_0x4e8efd[_0xa757('0x39')]=qs[_0xa757('0x2e')](_[_0xa757('0x3a')](_0x9e59c3[_0xa757('0x2d')],_0x2b4bdd['filters']),_0x123106);if(_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3b')]){_0x4e8efd[_0xa757('0x39')]=_[_0xa757('0x3c')](_0x4e8efd[_0xa757('0x39')],{'$or':_['map'](_0x4e8efd[_0xa757('0x30')],function(_0x5db16b){var _0x528412={};_0x528412[_0x5db16b]={'$like':'%'+_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3b')]+'%'};return _0x528412;})});}_0x4e8efd=_['merge']({},_0x4e8efd,_0x9e59c3[_0xa757('0x3d')]);var _0x19bd0b={'where':_0x4e8efd[_0xa757('0x39')]};return db[_0xa757('0x2a')][_0xa757('0x1b')](_0x19bd0b)[_0xa757('0x21')](function(_0x244f62){_0x23eba7[_0xa757('0x1b')]=_0x244f62;if(_0x9e59c3[_0xa757('0x2d')][_0xa757('0x3e')]){_0x4e8efd[_0xa757('0x3f')]=[{'all':!![]}];}return db[_0xa757('0x2a')][_0xa757('0x40')](_0x4e8efd);})[_0xa757('0x21')](function(_0x14658d){_0x23eba7['rows']=_0x14658d;return _0x23eba7;})[_0xa757('0x21')](respondWithFilteredResult(_0x5e0d25,_0x4e8efd))[_0xa757('0x41')](handleError(_0x5e0d25,null));})[_0xa757('0x41')](handleError(_0x5e0d25,null));};exports[_0xa757('0x42')]=function(_0x4c58f6,_0x9f4656){var _0x4d7b43={'raw':![],'where':{'id':_0x4c58f6['params']['id']}},_0x1f539c={};_0x1f539c[_0xa757('0x2f')]=_[_0xa757('0x2c')](db[_0xa757('0x2a')][_0xa757('0x43')]);_0x1f539c[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x4c58f6[_0xa757('0x2d')]);_0x1f539c[_0xa757('0x2e')]=_[_0xa757('0x31')](_0x1f539c[_0xa757('0x2f')],_0x1f539c[_0xa757('0x2d')]);_0x4d7b43[_0xa757('0x30')]=_[_0xa757('0x31')](_0x1f539c['model'],qs[_0xa757('0x32')](_0x4c58f6[_0xa757('0x2d')][_0xa757('0x32')]));_0x4d7b43['attributes']=_0x4d7b43['attributes'][_0xa757('0x33')]?_0x4d7b43[_0xa757('0x30')]:_0x1f539c['model'];if(_0x4c58f6[_0xa757('0x2d')]['includeAll']){_0x4d7b43['include']=[{'all':!![]}];}_0x4d7b43=_[_0xa757('0x3c')]({},_0x4d7b43,_0x4c58f6[_0xa757('0x3d')]);return db[_0xa757('0x2a')][_0xa757('0x44')](_0x4d7b43)[_0xa757('0x21')](handleEntityNotFound(_0x9f4656,null))[_0xa757('0x21')](respondWithResult(_0x9f4656,null))['catch'](handleError(_0x9f4656,null));};exports[_0xa757('0x45')]=function(_0x3a78f6,_0x422bd7){return db[_0xa757('0x2a')]['create'](_0x3a78f6[_0xa757('0x46')],{})[_0xa757('0x21')](function(_0x26d91f){var _0x12debd=_0x3a78f6[_0xa757('0x47')]['get']({'plain':!![]});if(!_0x12debd)throw new Error(_0xa757('0x48'));if(_0x12debd[_0xa757('0x49')]===_0xa757('0x47')){var _0x5e459f=_0x26d91f['get']({'plain':!![]});var _0x2a34c8=_0xa757('0x23');return db[_0xa757('0x4a')][_0xa757('0x44')]({'where':{'name':_0x2a34c8,'userProfileId':_0x12debd['userProfileId']},'raw':!![]})['then'](function(_0x22d329){if(_0x22d329&&_0x22d329[_0xa757('0x4b')]===0x0){return db[_0xa757('0x24')][_0xa757('0x45')]({'name':_0x5e459f[_0xa757('0x27')],'resourceId':_0x5e459f['id'],'type':_0x22d329[_0xa757('0x27')],'sectionId':_0x22d329['id']},{})['then'](function(){return _0x26d91f;});}else{return _0x26d91f;}})['catch'](function(_0x29810b){logger[_0xa757('0x4c')](_0xa757('0x4d'),_0x29810b);throw _0x29810b;});}return _0x26d91f;})[_0xa757('0x21')](respondWithResult(_0x422bd7,0xc9))['catch'](handleError(_0x422bd7,null));};exports[_0xa757('0x20')]=function(_0x12bd5d,_0xc4dad7){if(_0x12bd5d['body']['id']){delete _0x12bd5d[_0xa757('0x46')]['id'];}return db[_0xa757('0x2a')][_0xa757('0x44')]({'where':{'id':_0x12bd5d[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0xc4dad7,null))[_0xa757('0x21')](saveUpdates(_0x12bd5d[_0xa757('0x46')],null))[_0xa757('0x21')](respondWithResult(_0xc4dad7,null))[_0xa757('0x41')](handleError(_0xc4dad7,null));};exports[_0xa757('0x4f')]=function(_0x3becf1,_0x11f018){return db[_0xa757('0x2a')]['find']({'where':{'id':_0x3becf1[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x11f018,null))[_0xa757('0x21')](removeEntity(_0x11f018,null))[_0xa757('0x41')](handleError(_0x11f018,null));};exports[_0xa757('0x2b')]=function(_0x571c98,_0xf8b4c5){return db[_0xa757('0x2a')][_0xa757('0x2b')]()[_0xa757('0x21')](respondWithResult(_0xf8b4c5,null))['catch'](handleError(_0xf8b4c5,null));};exports[_0xa757('0x50')]=function(_0x35adbb,_0x3ea293,_0x10066c){return db['CmContact'][_0xa757('0x44')]({'where':{'id':_0x35adbb[_0xa757('0x4e')]['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x3ea293,null))['then'](function(_0x48a5f7){if(_0x48a5f7){return _0x48a5f7['addContacts'](_0x35adbb[_0xa757('0x46')][_0xa757('0x51')],_[_0xa757('0x52')](_0x35adbb['body'],[_0xa757('0x51'),'id'])||{});}})[_0xa757('0x21')](respondWithResult(_0x3ea293,null))['catch'](handleError(_0x3ea293,null));};exports['getContacts']=function(_0x107c94,_0x3a2bdf,_0x2e7274){var _0x11db47={};var _0x4bdef6={};var _0x57ca93;var _0x29dddb;return db[_0xa757('0x2a')]['findOne']({'where':{'id':_0x107c94['params']['id']}})[_0xa757('0x21')](handleEntityNotFound(_0x3a2bdf,null))['then'](function(_0x502dfb){if(_0x502dfb){_0x57ca93=_0x502dfb;_0x4bdef6[_0xa757('0x2f')]=_[_0xa757('0x2c')](db[_0xa757('0x53')][_0xa757('0x43')]);_0x4bdef6[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x107c94['query']);_0x4bdef6[_0xa757('0x2e')]=_[_0xa757('0x31')](_0x4bdef6['model'],_0x4bdef6[_0xa757('0x2d')]);_0x11db47[_0xa757('0x30')]=_['intersection'](_0x4bdef6[_0xa757('0x2f')],qs[_0xa757('0x32')](_0x107c94[_0xa757('0x2d')]['fields']));_0x11db47['attributes']=_0x11db47[_0xa757('0x30')][_0xa757('0x33')]?_0x11db47[_0xa757('0x30')]:_0x4bdef6[_0xa757('0x2f')];_0x11db47[_0xa757('0x37')]=qs[_0xa757('0x38')](_0x107c94[_0xa757('0x2d')][_0xa757('0x38')]);_0x11db47[_0xa757('0x39')]=qs['filters'](_[_0xa757('0x3a')](_0x107c94[_0xa757('0x2d')],_0x4bdef6[_0xa757('0x2e')]));if(_0x107c94[_0xa757('0x2d')][_0xa757('0x3b')]){_0x11db47[_0xa757('0x39')]=_[_0xa757('0x3c')](_0x11db47[_0xa757('0x39')],{'$or':_[_0xa757('0x54')](_0x11db47[_0xa757('0x30')],function(_0x35cb0d){var _0x12723f={};_0x12723f[_0x35cb0d]={'$like':'%'+_0x107c94[_0xa757('0x2d')][_0xa757('0x3b')]+'%'};return _0x12723f;})});}_0x11db47=_['merge']({},_0x11db47,_0x107c94[_0xa757('0x3d')]);return _0x57ca93[_0xa757('0x55')](_0x11db47);}})[_0xa757('0x21')](function(_0x3a4d91){if(_0x3a4d91){_0x29dddb=_0x3a4d91[_0xa757('0x33')];if(!_0x107c94[_0xa757('0x2d')][_0xa757('0x34')](_0xa757('0x35'))){_0x11db47[_0xa757('0x36')]=qs['limit'](_0x107c94['query']['limit']);_0x11db47[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x107c94[_0xa757('0x2d')]['offset']);}return _0x57ca93[_0xa757('0x55')](_0x11db47);}})[_0xa757('0x21')](function(_0x4c8eac){if(_0x4c8eac){return _0x4c8eac?{'count':_0x29dddb,'rows':_0x4c8eac}:null;}})[_0xa757('0x21')](respondWithResult(_0x3a2bdf,null))[_0xa757('0x41')](handleError(_0x3a2bdf,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 590c98b..f7dd02e 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 _0x0f85=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5bcb6c,_0x4d9061){var _0x35f0da=function(_0x301ff6){while(--_0x301ff6){_0x5bcb6c['push'](_0x5bcb6c['shift']());}};_0x35f0da(++_0x4d9061);}(_0x0f85,0xa4));var _0x50f8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0f85[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x50f8('0x0'));var util=require(_0x50f8('0x1'));var logger=require(_0x50f8('0x2'))('api');var moment=require(_0x50f8('0x3'));var BPromise=require(_0x50f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x50f8('0x5'));var rimraf=require(_0x50f8('0x6'));var config=require(_0x50f8('0x7'));var attributes=require(_0x50f8('0x8'));module[_0x50f8('0x9')]=function(_0x3366bc,_0x463b7b){return _0x3366bc[_0x50f8('0xa')](_0x50f8('0xb'),attributes,{'tableName':_0x50f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2c3=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird'];(function(_0x5ab42d,_0x8964fa){var _0x5258b3=function(_0x3f13ca){while(--_0x3f13ca){_0x5ab42d['push'](_0x5ab42d['shift']());}};_0x5258b3(++_0x8964fa);}(_0xf2c3,0x80));var _0x3f2c=function(_0x39725a,_0x35f499){_0x39725a=_0x39725a-0x0;var _0x52ca80=_0xf2c3[_0x39725a];return _0x52ca80;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f2c('0x0'))(_0x3f2c('0x1'));var moment=require(_0x3f2c('0x2'));var BPromise=require(_0x3f2c('0x3'));var rp=require(_0x3f2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f2c('0x5'));var config=require(_0x3f2c('0x6'));var attributes=require('./cmCompany.attributes');module[_0x3f2c('0x7')]=function(_0x473432,_0x1ba14c){return _0x473432[_0x3f2c('0x8')](_0x3f2c('0x9'),attributes,{'tableName':_0x3f2c('0xa'),'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 0fde81e..bf3c71f 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 _0xe8d6=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x39f060,_0xe1b897){var _0x3593e5=function(_0xaa7d0d){while(--_0xaa7d0d){_0x39f060['push'](_0x39f060['shift']());}};_0x3593e5(++_0xe1b897);}(_0xe8d6,0x13b));var _0x6e8d=function(_0xcae260,_0x3bca42){_0xcae260=_0xcae260-0x0;var _0xbb65b8=_0xe8d6[_0xcae260];return _0xbb65b8;};'use strict';var _=require(_0x6e8d('0x0'));var util=require(_0x6e8d('0x1'));var moment=require(_0x6e8d('0x2'));var BPromise=require(_0x6e8d('0x3'));var rs=require(_0x6e8d('0x4'));var fs=require('fs');var Redis=require(_0x6e8d('0x5'));var db=require(_0x6e8d('0x6'))['db'];var utils=require(_0x6e8d('0x7'));var logger=require('../../config/logger')(_0x6e8d('0x8'));var config=require(_0x6e8d('0x9'));var jayson=require(_0x6e8d('0xa'));var client=jayson[_0x6e8d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5884e3,_0x3c09a9,_0x52b406){return new BPromise(function(_0x40fba6,_0x244ae2){return client[_0x6e8d('0xc')](_0x5884e3,_0x52b406)['then'](function(_0x4521a0){logger[_0x6e8d('0xd')](_0x6e8d('0xe'),_0x3c09a9,_0x6e8d('0xf'));logger[_0x6e8d('0x10')](_0x6e8d('0x11'),_0x3c09a9,'request\x20sent',JSON[_0x6e8d('0x12')](_0x4521a0));if(_0x4521a0[_0x6e8d('0x13')]){if(_0x4521a0[_0x6e8d('0x13')][_0x6e8d('0x14')]===0x1f4){logger[_0x6e8d('0x13')]('CmCompany,\x20%s,\x20%s',_0x3c09a9,_0x4521a0['error'][_0x6e8d('0x15')]);return _0x244ae2(_0x4521a0['error'][_0x6e8d('0x15')]);}logger['error'](_0x6e8d('0xe'),_0x3c09a9,_0x4521a0[_0x6e8d('0x13')]['message']);return _0x40fba6(_0x4521a0[_0x6e8d('0x13')]['message']);}else{logger[_0x6e8d('0xd')](_0x6e8d('0xe'),_0x3c09a9,_0x6e8d('0xf'));_0x40fba6(_0x4521a0[_0x6e8d('0x16')][_0x6e8d('0x15')]);}})['catch'](function(_0x395085){logger['error'](_0x6e8d('0xe'),_0x3c09a9,_0x395085);_0x244ae2(_0x395085);});});}
\ No newline at end of file
+var _0x10cc=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x10cc,0xe6));var _0xc10c=function(_0x2057be,_0x12efe3){_0x2057be=_0x2057be-0x0;var _0x22c52f=_0x10cc[_0x2057be];return _0x22c52f;};'use strict';var _=require(_0xc10c('0x0'));var util=require('util');var moment=require(_0xc10c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc10c('0x2'));var db=require(_0xc10c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc10c('0x4'))(_0xc10c('0x5'));var config=require(_0xc10c('0x6'));var jayson=require(_0xc10c('0x7'));var client=jayson[_0xc10c('0x8')][_0xc10c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3af985,_0x4fe553,_0x5449e6){return new BPromise(function(_0x4fbb1d,_0x4e009e){return client[_0xc10c('0xa')](_0x3af985,_0x5449e6)[_0xc10c('0xb')](function(_0x3e08e6){logger[_0xc10c('0xc')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0xc10c('0xd'));logger[_0xc10c('0xe')](_0xc10c('0xf'),_0x4fe553,'request\x20sent',JSON[_0xc10c('0x10')](_0x3e08e6));if(_0x3e08e6['error']){if(_0x3e08e6['error'][_0xc10c('0x11')]===0x1f4){logger[_0xc10c('0x12')](_0xc10c('0x13'),_0x4fe553,_0x3e08e6['error'][_0xc10c('0x14')]);return _0x4e009e(_0x3e08e6[_0xc10c('0x12')][_0xc10c('0x14')]);}logger[_0xc10c('0x12')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0x3e08e6['error']['message']);return _0x4fbb1d(_0x3e08e6[_0xc10c('0x12')][_0xc10c('0x14')]);}else{logger[_0xc10c('0xc')]('CmCompany,\x20%s,\x20%s',_0x4fe553,_0xc10c('0xd'));_0x4fbb1d(_0x3e08e6[_0xc10c('0x15')]['message']);}})[_0xc10c('0x16')](function(_0x2bb4b3){logger['error'](_0xc10c('0x13'),_0x4fe553,_0x2bb4b3);_0x4e009e(_0x2bb4b3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 97e5433..a358c1d 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 _0xefce=['addContacts','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','getContacts','create'];(function(_0xb47828,_0x8665e4){var _0x1f3315=function(_0x42f77a){while(--_0x42f77a){_0xb47828['push'](_0xb47828['shift']());}};_0x1f3315(++_0x8665e4);}(_0xefce,0x1e8));var _0xeefc=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xefce[_0x3522c8];return _0x22f498;};'use strict';var multer=require('multer');var util=require(_0xeefc('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeefc('0x1'));var router=express[_0xeefc('0x2')]();var fs_extra=require(_0xeefc('0x3'));var auth=require(_0xeefc('0x4'));var interaction=require(_0xeefc('0x5'));var config=require(_0xeefc('0x6'));var controller=require(_0xeefc('0x7'));router[_0xeefc('0x8')]('/',auth[_0xeefc('0x9')](),controller[_0xeefc('0xa')]);router['get']('/describe',auth[_0xeefc('0x9')](),controller[_0xeefc('0xb')]);router[_0xeefc('0x8')](_0xeefc('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xeefc('0x8')](_0xeefc('0xd'),auth['isAuthenticated'](),controller[_0xeefc('0xe')]);router['post']('/',auth[_0xeefc('0x9')](),controller[_0xeefc('0xf')]);router['post'](_0xeefc('0xd'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x10')]);router['put'](_0xeefc('0xc'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x11')]);router[_0xeefc('0x12')](_0xeefc('0xc'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x13')]);module[_0xeefc('0x14')]=router;
\ No newline at end of file
+var _0x4855=['create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x4855,0xce));var _0x5485=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x4855[_0x9a7ea6];return _0x1c2040;};'use strict';var multer=require(_0x5485('0x0'));var util=require(_0x5485('0x1'));var path=require(_0x5485('0x2'));var timeout=require(_0x5485('0x3'));var express=require('express');var router=express[_0x5485('0x4')]();var fs_extra=require(_0x5485('0x5'));var auth=require(_0x5485('0x6'));var interaction=require(_0x5485('0x7'));var config=require(_0x5485('0x8'));var controller=require(_0x5485('0x9'));router[_0x5485('0xa')]('/',auth[_0x5485('0xb')](),controller[_0x5485('0xc')]);router[_0x5485('0xa')](_0x5485('0xd'),auth[_0x5485('0xb')](),controller[_0x5485('0xe')]);router[_0x5485('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5485('0xf')]);router[_0x5485('0xa')](_0x5485('0x10'),auth[_0x5485('0xb')](),controller[_0x5485('0x11')]);router[_0x5485('0x12')]('/',auth[_0x5485('0xb')](),controller[_0x5485('0x13')]);router['post'](_0x5485('0x10'),auth[_0x5485('0xb')](),controller['addContacts']);router[_0x5485('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5485('0x15')](_0x5485('0x16'),auth[_0x5485('0xb')](),controller[_0x5485('0x17')]);module[_0x5485('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 9dfa8eb..a1fc913 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 _0x2159=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x2159,0x1e0));var _0x9215=function(_0x4d5cac,_0x5bf7bd){_0x4d5cac=_0x4d5cac-0x0;var _0x513307=_0x2159[_0x4d5cac];return _0x513307;};'use strict';var _=require(_0x9215('0x0'));var Sequelize=require(_0x9215('0x1'));module[_0x9215('0x2')]={'firstName':{'type':Sequelize[_0x9215('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9215('0x3')]},'postalCode':{'type':Sequelize[_0x9215('0x3')]},'city':{'type':Sequelize[_0x9215('0x3')]},'country':{'type':Sequelize[_0x9215('0x3')]},'dateOfBirth':{'type':Sequelize[_0x9215('0x3')]},'description':{'type':Sequelize[_0x9215('0x4')]},'phone':{'type':Sequelize[_0x9215('0x3')]},'mobile':{'type':Sequelize[_0x9215('0x3')]},'fax':{'type':Sequelize[_0x9215('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9215('0x3')]},'facebook':{'type':Sequelize[_0x9215('0x3')]},'fb_data':{'type':Sequelize[_0x9215('0x3')]},'twitter':{'type':Sequelize[_0x9215('0x3')]},'skype':{'type':Sequelize[_0x9215('0x3')]},'teams':{'type':Sequelize[_0x9215('0x3')]},'viber':{'type':Sequelize[_0x9215('0x3')]},'line':{'type':Sequelize[_0x9215('0x3')]},'wechat':{'type':Sequelize[_0x9215('0x3')]},'telegram':{'type':Sequelize[_0x9215('0x3')]},'UserId':{'type':Sequelize[_0x9215('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x9215('0x3')]},'priority':{'type':Sequelize[_0x9215('0x5')](0x2)[_0x9215('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9215('0x7')],'defaultValue':Sequelize[_0x9215('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4cd2=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x4b48a8,_0x391aed){var _0x4d5ad2=function(_0xa8302b){while(--_0xa8302b){_0x4b48a8['push'](_0x4b48a8['shift']());}};_0x4d5ad2(++_0x391aed);}(_0x4cd2,0x75));var _0x24cd=function(_0x643559,_0x4862f7){_0x643559=_0x643559-0x0;var _0x4d1f21=_0x4cd2[_0x643559];return _0x4d1f21;};'use strict';var _=require(_0x24cd('0x0'));var Sequelize=require(_0x24cd('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x24cd('0x2')]},'street':{'type':Sequelize[_0x24cd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x24cd('0x2')]},'country':{'type':Sequelize[_0x24cd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x24cd('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x24cd('0x2')]},'mobile':{'type':Sequelize[_0x24cd('0x2')]},'fax':{'type':Sequelize[_0x24cd('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x24cd('0x2')]},'facebook':{'type':Sequelize[_0x24cd('0x2')]},'fb_data':{'type':Sequelize[_0x24cd('0x2')]},'twitter':{'type':Sequelize[_0x24cd('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x24cd('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x24cd('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x24cd('0x2')]},'UserId':{'type':Sequelize[_0x24cd('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x24cd('0x2')]},'priority':{'type':Sequelize[_0x24cd('0x3')](0x2)[_0x24cd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x24cd('0x5')],'defaultValue':Sequelize[_0x24cd('0x6')]},'dialTimezone':{'type':Sequelize[_0x24cd('0x2')]},'utcOffset':{'type':Sequelize[_0x24cd('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 93a457a..be39423 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 _0x88cc=['Tag','Tags','color','tag','CmContactHasItem','ItemType','sequelize','literal','$and','CmCustomField','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','filters','attributes','model','fields','order','sort','pick','filter','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','intersection','ContactId','options','includeAll','rows','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','upload','parse','import','agent','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','pid','importUpdates','User','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','UserId','fullname','DESC','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','customerIp','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','Interaction','findAndCountAll','flatten','sortBy','reverse','value','slice','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','describe','getOptions','query','catch','find','params','CmContact','keys','length','startsWith','cf_','columnName','displayName','analytics','findAll','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','spread','push','contact','all','show'];(function(_0x1b2c0e,_0x1fd9fa){var _0x480de=function(_0x47e816){while(--_0x47e816){_0x1b2c0e['push'](_0x1b2c0e['shift']());}};_0x480de(++_0x1fd9fa);}(_0x88cc,0x9b));var _0xc88c=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0x88cc[_0x11de83];return _0x45bdb0;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xc88c('0x0'));var fs=require('fs');var _=require(_0xc88c('0x1'));var squel=require('squel');var Papa=require(_0xc88c('0x2'));var Redis=require(_0xc88c('0x3'));var contacts=require(_0xc88c('0x4'));var qs=require(_0xc88c('0x5'));var logger=require(_0xc88c('0x6'))(_0xc88c('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0xc88c('0x8')]=_[_0xc88c('0x9')](config[_0xc88c('0x8')],{'host':_0xc88c('0xa'),'port':0x18eb});var socket=require(_0xc88c('0xb'))(new Redis(config[_0xc88c('0x8')]));require(_0xc88c('0xc'))[_0xc88c('0xd')](socket);function respondWithResult(_0x247bc1,_0x50aec4){_0x50aec4=_0x50aec4||0xc8;return function(_0x35074b){if(_0x35074b){return _0x247bc1[_0xc88c('0xe')](_0x50aec4)[_0xc88c('0xf')](_0x35074b);}};}function respondWithFilteredResult(_0x43fc5e,_0x19082f){return function(_0x2011fb){if(_0x2011fb){var _0x12217f=typeof _0x19082f[_0xc88c('0x10')]===_0xc88c('0x11')&&typeof _0x19082f[_0xc88c('0x12')]==='undefined';var _0x4a39fe=_0x2011fb['count'];var _0x28b20d=_0x12217f?0x0:_0x19082f[_0xc88c('0x10')];var _0x155ba3=_0x12217f?_0x2011fb[_0xc88c('0x13')]:_0x19082f[_0xc88c('0x10')]+_0x19082f[_0xc88c('0x12')];var _0x269392;if(_0x155ba3>=_0x4a39fe){_0x155ba3=_0x4a39fe;_0x269392=0xc8;}else{_0x269392=0xce;}_0x43fc5e['status'](_0x269392);return _0x43fc5e[_0xc88c('0x14')](_0xc88c('0x15'),_0x28b20d+'-'+_0x155ba3+'/'+_0x4a39fe)[_0xc88c('0xf')](_0x2011fb);}return null;};}function saveUpdates(_0x10180a){return function(_0xc2ecc2){if(_0xc2ecc2){return _0xc2ecc2[_0xc88c('0x16')](_0x10180a)[_0xc88c('0x17')](function(_0x186da9){return _0x186da9;});}return null;};}function removeEntity(_0x155205){return function(_0x259d49){if(_0x259d49){return _0x259d49[_0xc88c('0x18')]()[_0xc88c('0x17')](function(){_0x155205['status'](0xcc)[_0xc88c('0x19')]();});}};}function handleEntityNotFound(_0x49dcd1){return function(_0x5af4ef){if(!_0x5af4ef){_0x49dcd1['sendStatus'](0x194);}return _0x5af4ef;};}function handleError(_0x52c99a,_0xd13209){_0xd13209=_0xd13209||0x1f4;return function(_0xcfa1ca){logger[_0xc88c('0x1a')](_0xcfa1ca[_0xc88c('0x1b')]);if(_0xcfa1ca[_0xc88c('0x1c')]){delete _0xcfa1ca[_0xc88c('0x1c')];}_0x52c99a[_0xc88c('0xe')](_0xd13209)[_0xc88c('0x1d')](_0xcfa1ca);};}exports[_0xc88c('0x1e')]=function(_0x873b5f,_0x3f544b){var _0x260487={};return contacts[_0xc88c('0x1f')]()[_0xc88c('0x17')](function(_0x3007d6){_0x260487=qs[_0xc88c('0x20')](_0x3007d6,_0x873b5f);return contacts['findAll'](_0x873b5f[_0xc88c('0x21')],_0x873b5f['user'],_0x260487,_0x3007d6);})[_0xc88c('0x17')](respondWithFilteredResult(_0x3f544b,_0x260487))[_0xc88c('0x22')](handleError(_0x3f544b,null));};exports[_0xc88c('0x18')]=function(_0x298b50,_0x20673b){return db['CmContact'][_0xc88c('0x23')]({'where':{'id':_0x298b50[_0xc88c('0x24')]['id']}})['then'](handleEntityNotFound(_0x20673b,null))[_0xc88c('0x17')](removeEntity(_0x20673b,null))[_0xc88c('0x22')](handleError(_0x20673b,null));};exports[_0xc88c('0x1f')]=function(_0x21cee4,_0xefe0ca){return db[_0xc88c('0x25')][_0xc88c('0x1f')]()['then'](function(_0x12623c){delete _0x12623c['tags'];for(var _0x9b5579=0x0;_0x9b5579
','Attachments','Title','generateXOAuth2Token','user=','utf-8','toString','lodash','randomstring','path','node-tnef','email'];(function(_0x362777,_0xb94156){var _0xe4a158=function(_0x4b6285){while(--_0x4b6285){_0x362777['push'](_0x362777['shift']());}};_0xe4a158(++_0xb94156);}(_0x7911,0x1e5));var _0x1791=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x7911[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x1791('0x0'));var moment=require('moment');var random=require(_0x1791('0x1'));var fs=require('fs');var path=require(_0x1791('0x2'));var util=require('util');var tnef=require(_0x1791('0x3'));var logger=require('../../../config/logger')(_0x1791('0x4'));var config=require(_0x1791('0x5'));function getAddress(_0x5022bb){var _0x2616a2=_[_0x1791('0x6')](_0x5022bb[_0x1791('0x7')]);return _0x2616a2&&_0x2616a2['address']?_0x2616a2[_0x1791('0x8')]:_0x1791('0x9')+random[_0x1791('0xa')](0x6)+'@xcally.com';}function getFirstName(_0xc5f7db){var _0x926359=_[_0x1791('0x6')](_0xc5f7db[_0x1791('0x7')]);if(_0x926359&&_0x926359['name']){if(_0x926359[_0x1791('0xb')]==_0x926359[_0x1791('0x8')]){return _0x926359[_0x1791('0xb')][_0x1791('0xc')](0x0,_0x926359[_0x1791('0xb')][_0x1791('0xd')]('@'));}var _0x2f27e5=_0x926359['name']['split'](/\s+/);return _0x2f27e5['length']>0x1?_0x2f27e5[_0x1791('0xe')](0x0,-0x1)[_0x1791('0xf')]('\x20'):_0x926359[_0x1791('0xb')];}return _0x1791('0x10');}function getLastName(_0x376897){var _0x1def7b=_[_0x1791('0x6')](_0x376897[_0x1791('0x7')]);if(_0x1def7b&&_0x1def7b['name']){var _0x2f994e=_0x1def7b['name'][_0x1791('0x11')](/\s+/);return _0x2f994e[_0x1791('0x12')]>0x1?_0x2f994e[_0x1791('0x13')]():'';}return'';}function getMails(_0x453483,_0x4650e3){var _0x426a68='';for(var _0x4c2b7e=0x0;_0x4c2b7e<_0x4650e3['value'][_0x1791('0x12')];_0x4c2b7e+=0x1){if(_0x4650e3[_0x1791('0x7')][_0x4c2b7e]['address']!==_0x453483){if(!_[_0x1791('0x14')](_0x426a68)){_0x426a68+=',';}_0x426a68+=_0x4650e3['value'][_0x4c2b7e]['name']||_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]||'';_0x426a68+='\x20<';_0x426a68+=_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]?_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]:_0x1791('0x9')+random['generate'](0x6)+_0x1791('0x15');_0x426a68+='>';}}return _0x426a68;}function parseEmail(_0x4dad02,_0x2fbaad,_0x444210){if(_0x2fbaad[_0x1791('0x16')]){var _0x1c4442=/