From: support
Date: Mon, 11 Apr 2022 12:51:58 +0000 (+0000)
Subject: Built motion from commit faf3c706.|2.6.8
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%90%C2%9D%C3%90%C2%BE%C3%90%C2%B2%C3%91%C2%8B%C3%90%C2%B5?a=commitdiff_plain;h=1454112389c145f7745352eb06ea018f1a49d661;p=motion2.git
Built motion from commit faf3c706.|2.6.8
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8fd175c..a2df435 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-04-11T08:01:41.115Z",
+ "time": "2022-04-11T12:44:26.952Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0bd6e6d..fa055b4 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-11T08:01:41.115Z",
+ "time": "2022-04-11T12:44:26.952Z",
"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 43e9ce6..62487db 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 _0xcd88=['motionbar','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]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x15579d,_0x15f60b){var _0x17f3ae=function(_0x3360d8){while(--_0x3360d8){_0x15579d['push'](_0x15579d['shift']());}};_0x17f3ae(++_0x15f60b);}(_0xcd88,0xb6));var _0x8cd8=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xcd88[_0x2e41e2];return _0x2844d6;};'use strict';var Sequelize=require(_0x8cd8('0x0'));module[_0x8cd8('0x1')]={'name':{'type':Sequelize[_0x8cd8('0x2')],'get':function(_0x56268b){return this[_0x8cd8('0x3')](_0x8cd8('0x4'));}},'action':{'type':Sequelize[_0x8cd8('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8cd8('0x6'),_0x8cd8('0x7'),_0x8cd8('0x8'),'jscripty',_0x8cd8('0x9'),'browser',_0x8cd8('0xa'),_0x8cd8('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x8cd8('0xc')},'data1':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comment':_0x8cd8('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8cd8('0xe')},'data3':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comment':_0x8cd8('0xf')},'data4':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comments':_0x8cd8('0x10')},'data5':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x8cd8('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8cd8('0x11')],'comments':_0x8cd8('0x12')}};
\ No newline at end of file
+var _0x7ece=['motionbar','browser','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x345571,_0x3e5f77){var _0xfd5a25=function(_0x2ebc68){while(--_0x2ebc68){_0x345571['push'](_0x345571['shift']());}};_0xfd5a25(++_0x3e5f77);}(_0x7ece,0xc9));var _0xe7ec=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7ece[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0xe7ec('0x0')]={'name':{'type':Sequelize[_0xe7ec('0x1')],'get':function(_0x47b71f){return this[_0xe7ec('0x2')](_0xe7ec('0x3'));}},'action':{'type':Sequelize[_0xe7ec('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe7ec('0x5'),_0xe7ec('0x6'),_0xe7ec('0x7'),'jscripty','urlForward',_0xe7ec('0x8'),'bot',_0xe7ec('0x9')]],'msg':_0xe7ec('0xa')}},'comment':_0xe7ec('0xa')},'data1':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':_0xe7ec('0xb')},'data2':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comments':_0xe7ec('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe7ec('0xd')},'data6':{'type':Sequelize[_0xe7ec('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe7ec('0xe')],'comments':_0xe7ec('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3495334..4327031 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 _0x8540=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','update','body','params','catch','Action','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x51feac,_0x34a74f){var _0x52f5b2=function(_0x28e60f){while(--_0x28e60f){_0x51feac['push'](_0x51feac['shift']());}};_0x52f5b2(++_0x34a74f);}(_0x8540,0xba));var _0x0854=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x8540[_0xca1f0e];return _0x35e4ef;};'use strict';var emlformat=require(_0x0854('0x0'));var rimraf=require(_0x0854('0x1'));var zipdir=require(_0x0854('0x2'));var jsonpatch=require(_0x0854('0x3'));var rp=require(_0x0854('0x4'));var moment=require(_0x0854('0x5'));var BPromise=require(_0x0854('0x6'));var Mustache=require(_0x0854('0x7'));var util=require(_0x0854('0x8'));var path=require(_0x0854('0x9'));var sox=require('sox');var csv=require(_0x0854('0xa'));var ejs=require(_0x0854('0xb'));var fs=require('fs');var fs_extra=require(_0x0854('0xc'));var _=require('lodash');var squel=require(_0x0854('0xd'));var crypto=require('crypto');var jsforce=require(_0x0854('0xe'));var deskjs=require(_0x0854('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0854('0x10'));var Papa=require(_0x0854('0x11'));var Redis=require('ioredis');var authService=require(_0x0854('0x12'));var qs=require(_0x0854('0x13'));var as=require(_0x0854('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0854('0x15'))(_0x0854('0x16'));var utils=require(_0x0854('0x17'));var config=require(_0x0854('0x18'));var licenseUtil=require(_0x0854('0x19'));var db=require(_0x0854('0x1a'))['db'];function respondWithStatusCode(_0xcae5f,_0x3f2717){_0x3f2717=_0x3f2717||0xcc;return function(_0x4861ca){if(_0x4861ca){return _0xcae5f[_0x0854('0x1b')](_0x3f2717);}return _0xcae5f['status'](_0x3f2717)[_0x0854('0x1c')]();};}function respondWithResult(_0xf64fe0,_0x39618c){_0x39618c=_0x39618c||0xc8;return function(_0x11cf68){if(_0x11cf68){return _0xf64fe0[_0x0854('0x1d')](_0x39618c)[_0x0854('0x1e')](_0x11cf68);}};}function respondWithFilteredResult(_0x2d5935,_0x3d1942){return function(_0x597fe3){if(_0x597fe3){var _0x6f6557=typeof _0x3d1942[_0x0854('0x1f')]===_0x0854('0x20')&&typeof _0x3d1942[_0x0854('0x21')]===_0x0854('0x20');var _0x1f08ff=_0x597fe3[_0x0854('0x22')];var _0x3fbfba=_0x6f6557?0x0:_0x3d1942[_0x0854('0x1f')];var _0x53e8c2=_0x6f6557?_0x597fe3['count']:_0x3d1942[_0x0854('0x1f')]+_0x3d1942['limit'];var _0x5b3968;if(_0x53e8c2>=_0x1f08ff){_0x53e8c2=_0x1f08ff;_0x5b3968=0xc8;}else{_0x5b3968=0xce;}_0x2d5935[_0x0854('0x1d')](_0x5b3968);return _0x2d5935[_0x0854('0x23')](_0x0854('0x24'),_0x3fbfba+'-'+_0x53e8c2+'/'+_0x1f08ff)[_0x0854('0x1e')](_0x597fe3);}return null;};}function patchUpdates(_0x7a95f7){return function(_0x44d314){try{jsonpatch[_0x0854('0x25')](_0x44d314,_0x7a95f7,!![]);}catch(_0x3bf9a0){return BPromise['reject'](_0x3bf9a0);}return _0x44d314['save']();};}function saveUpdates(_0xe58a99,_0x6e9226){return function(_0x28b959){if(_0x28b959){return _0x28b959['update'](_0xe58a99)[_0x0854('0x26')](function(_0x30a0e0){return _0x30a0e0;});}return null;};}function removeEntity(_0x16792e,_0x61b3f2){return function(_0x1d3897){if(_0x1d3897){return _0x1d3897[_0x0854('0x27')]()['then'](function(){_0x16792e[_0x0854('0x1d')](0xcc)[_0x0854('0x1c')]();});}};}function handleEntityNotFound(_0x22709c,_0x43fc04){return function(_0x213075){if(!_0x213075){_0x22709c['sendStatus'](0x194);}return _0x213075;};}function handleError(_0x4c457e,_0x27302b){_0x27302b=_0x27302b||0x1f4;return function(_0x37dd46){logger['error'](_0x37dd46[_0x0854('0x28')]);if(_0x37dd46[_0x0854('0x29')]){delete _0x37dd46[_0x0854('0x29')];}_0x4c457e[_0x0854('0x1d')](_0x27302b)[_0x0854('0x2a')](_0x37dd46);};}exports[_0x0854('0x2b')]=function(_0x30640d,_0x6d97e6){if(_0x30640d[_0x0854('0x2c')]['id']){delete _0x30640d[_0x0854('0x2c')]['id'];}return db['Action']['find']({'where':{'id':_0x30640d[_0x0854('0x2d')]['id']}})['then'](handleEntityNotFound(_0x6d97e6,null))[_0x0854('0x26')](saveUpdates(_0x30640d[_0x0854('0x2c')],null))[_0x0854('0x26')](respondWithResult(_0x6d97e6,null))[_0x0854('0x2e')](handleError(_0x6d97e6,null));};exports[_0x0854('0x27')]=function(_0xd5b8c,_0x50d981){return db[_0x0854('0x2f')][_0x0854('0x30')]({'where':{'id':_0xd5b8c['params']['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x50d981,null))[_0x0854('0x26')](removeEntity(_0x50d981,null))[_0x0854('0x2e')](handleError(_0x50d981,null));};
\ No newline at end of file
+var _0x0654=['undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0xa201ee,_0x37da32){var _0x3e104d=function(_0x4cd637){while(--_0x4cd637){_0xa201ee['push'](_0xa201ee['shift']());}};_0x3e104d(++_0x37da32);}(_0x0654,0xa2));var _0x4065=function(_0xc7f8f6,_0x533440){_0xc7f8f6=_0xc7f8f6-0x0;var _0x1f98da=_0x0654[_0xc7f8f6];return _0x1f98da;};'use strict';var emlformat=require(_0x4065('0x0'));var rimraf=require(_0x4065('0x1'));var zipdir=require(_0x4065('0x2'));var jsonpatch=require(_0x4065('0x3'));var rp=require(_0x4065('0x4'));var moment=require('moment');var BPromise=require(_0x4065('0x5'));var Mustache=require('mustache');var util=require(_0x4065('0x6'));var path=require(_0x4065('0x7'));var sox=require(_0x4065('0x8'));var csv=require('to-csv');var ejs=require(_0x4065('0x9'));var fs=require('fs');var fs_extra=require(_0x4065('0xa'));var _=require(_0x4065('0xb'));var squel=require('squel');var crypto=require(_0x4065('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4065('0xd'));var toCsv=require(_0x4065('0xe'));var querystring=require('querystring');var Papa=require(_0x4065('0xf'));var Redis=require(_0x4065('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4065('0x11'));var as=require(_0x4065('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4065('0x13'))(_0x4065('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4065('0x15'));var db=require(_0x4065('0x16'))['db'];function respondWithStatusCode(_0xdd9097,_0x537a87){_0x537a87=_0x537a87||0xcc;return function(_0x4fc507){if(_0x4fc507){return _0xdd9097[_0x4065('0x17')](_0x537a87);}return _0xdd9097[_0x4065('0x18')](_0x537a87)[_0x4065('0x19')]();};}function respondWithResult(_0x514739,_0x57a813){_0x57a813=_0x57a813||0xc8;return function(_0x574483){if(_0x574483){return _0x514739[_0x4065('0x18')](_0x57a813)['json'](_0x574483);}};}function respondWithFilteredResult(_0x36e91c,_0x5a1f27){return function(_0x14cc53){if(_0x14cc53){var _0x48e9fd=typeof _0x5a1f27['offset']===_0x4065('0x1a')&&typeof _0x5a1f27[_0x4065('0x1b')]===_0x4065('0x1a');var _0x52f517=_0x14cc53[_0x4065('0x1c')];var _0x177a5b=_0x48e9fd?0x0:_0x5a1f27[_0x4065('0x1d')];var _0x901b30=_0x48e9fd?_0x14cc53['count']:_0x5a1f27[_0x4065('0x1d')]+_0x5a1f27[_0x4065('0x1b')];var _0x1ae04c;if(_0x901b30>=_0x52f517){_0x901b30=_0x52f517;_0x1ae04c=0xc8;}else{_0x1ae04c=0xce;}_0x36e91c[_0x4065('0x18')](_0x1ae04c);return _0x36e91c[_0x4065('0x1e')](_0x4065('0x1f'),_0x177a5b+'-'+_0x901b30+'/'+_0x52f517)[_0x4065('0x20')](_0x14cc53);}return null;};}function patchUpdates(_0x9b2664){return function(_0x772be4){try{jsonpatch['apply'](_0x772be4,_0x9b2664,!![]);}catch(_0x4ae5d8){return BPromise[_0x4065('0x21')](_0x4ae5d8);}return _0x772be4[_0x4065('0x22')]();};}function saveUpdates(_0x4dee0f,_0x4a36d7){return function(_0x3f31ee){if(_0x3f31ee){return _0x3f31ee[_0x4065('0x23')](_0x4dee0f)['then'](function(_0x1be742){return _0x1be742;});}return null;};}function removeEntity(_0x1c7ec0,_0x359278){return function(_0x80bd4c){if(_0x80bd4c){return _0x80bd4c[_0x4065('0x24')]()[_0x4065('0x25')](function(){_0x1c7ec0['status'](0xcc)[_0x4065('0x19')]();});}};}function handleEntityNotFound(_0x4a5def,_0x45030b){return function(_0x279cd8){if(!_0x279cd8){_0x4a5def[_0x4065('0x17')](0x194);}return _0x279cd8;};}function handleError(_0x37816f,_0x4e0ce3){_0x4e0ce3=_0x4e0ce3||0x1f4;return function(_0x46ad1f){logger[_0x4065('0x26')](_0x46ad1f[_0x4065('0x27')]);if(_0x46ad1f[_0x4065('0x28')]){delete _0x46ad1f[_0x4065('0x28')];}_0x37816f[_0x4065('0x18')](_0x4e0ce3)[_0x4065('0x29')](_0x46ad1f);};}exports[_0x4065('0x23')]=function(_0x3e6081,_0x51a0dc){if(_0x3e6081[_0x4065('0x2a')]['id']){delete _0x3e6081[_0x4065('0x2a')]['id'];}return db[_0x4065('0x2b')][_0x4065('0x2c')]({'where':{'id':_0x3e6081[_0x4065('0x2d')]['id']}})[_0x4065('0x25')](handleEntityNotFound(_0x51a0dc,null))['then'](saveUpdates(_0x3e6081['body'],null))[_0x4065('0x25')](respondWithResult(_0x51a0dc,null))[_0x4065('0x2e')](handleError(_0x51a0dc,null));};exports['destroy']=function(_0x5a590a,_0x5696ac){return db[_0x4065('0x2b')]['find']({'where':{'id':_0x5a590a[_0x4065('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5696ac,null))[_0x4065('0x25')](removeEntity(_0x5696ac,null))[_0x4065('0x2e')](handleError(_0x5696ac,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d8b3569..16959f1 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 _0x5989=['request-promise','path','rimraf','exports','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbab2fe,_0x4a1066){var _0x2b4aee=function(_0x31c17a){while(--_0x31c17a){_0xbab2fe['push'](_0xbab2fe['shift']());}};_0x2b4aee(++_0x4a1066);}(_0x5989,0xd6));var _0x9598=function(_0x614dc5,_0x3dd98e){_0x614dc5=_0x614dc5-0x0;var _0x571e07=_0x5989[_0x614dc5];return _0x571e07;};'use strict';var _=require(_0x9598('0x0'));var util=require(_0x9598('0x1'));var logger=require(_0x9598('0x2'))(_0x9598('0x3'));var moment=require(_0x9598('0x4'));var BPromise=require(_0x9598('0x5'));var rp=require(_0x9598('0x6'));var fs=require('fs');var path=require(_0x9598('0x7'));var rimraf=require(_0x9598('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x9598('0x9')]=function(_0x45cd37,_0x1fe04a){return _0x45cd37['define']('Action',attributes,{'tableName':_0x9598('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x129d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4cbb3b,_0x13b6a9){var _0x48f15c=function(_0x311792){while(--_0x311792){_0x4cbb3b['push'](_0x4cbb3b['shift']());}};_0x48f15c(++_0x13b6a9);}(_0x129d,0x15f));var _0xd129=function(_0x1335e9,_0x3dcc22){_0x1335e9=_0x1335e9-0x0;var _0x55144f=_0x129d[_0x1335e9];return _0x55144f;};'use strict';var _=require('lodash');var util=require(_0xd129('0x0'));var logger=require(_0xd129('0x1'))('api');var moment=require(_0xd129('0x2'));var BPromise=require(_0xd129('0x3'));var rp=require(_0xd129('0x4'));var fs=require('fs');var path=require(_0xd129('0x5'));var rimraf=require(_0xd129('0x6'));var config=require(_0xd129('0x7'));var attributes=require(_0xd129('0x8'));module[_0xd129('0x9')]=function(_0x260a6e,_0x2762be){return _0x260a6e[_0xd129('0xa')](_0xd129('0xb'),attributes,{'tableName':_0xd129('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 7591e09..6e3c1b8 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x118cdb,_0x4db43f){var _0x1b312e=function(_0x45a678){while(--_0x45a678){_0x118cdb['push'](_0x118cdb['shift']());}};_0x1b312e(++_0x4db43f);}(_0x326f,0xd1));var _0xf326=function(_0x4aaca5,_0x1430b5){_0x4aaca5=_0x4aaca5-0x0;var _0x3b180d=_0x326f[_0x4aaca5];return _0x3b180d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1d08c6,_0x1447e5){var _0x474b22=function(_0x3282e9){while(--_0x3282e9){_0x1d08c6['push'](_0x1d08c6['shift']());}};_0x474b22(++_0x1447e5);}(_0xabce,0x103));var _0xeabc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xabce[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 6ba6bac..c70c899 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 _0x8a34=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','multer'];(function(_0x3480cd,_0x4be7bc){var _0xa7a30e=function(_0x53a971){while(--_0x53a971){_0x3480cd['push'](_0x3480cd['shift']());}};_0xa7a30e(++_0x4be7bc);}(_0x8a34,0xff));var _0x48a3=function(_0x2350dd,_0x53e293){_0x2350dd=_0x2350dd-0x0;var _0x5ca2db=_0x8a34[_0x2350dd];return _0x5ca2db;};'use strict';var multer=require(_0x48a3('0x0'));var util=require(_0x48a3('0x1'));var path=require(_0x48a3('0x2'));var timeout=require(_0x48a3('0x3'));var express=require(_0x48a3('0x4'));var router=express[_0x48a3('0x5')]();var fs_extra=require(_0x48a3('0x6'));var auth=require(_0x48a3('0x7'));var interaction=require(_0x48a3('0x8'));var config=require(_0x48a3('0x9'));var controller=require('./action.controller');router[_0x48a3('0xa')](_0x48a3('0xb'),auth['isAuthenticated'](),controller[_0x48a3('0xc')]);router[_0x48a3('0xd')]('/:id',auth[_0x48a3('0xe')](),controller[_0x48a3('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x04af=['Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2e4dc9,_0x4a3666){var _0x3c047a=function(_0xf10516){while(--_0xf10516){_0x2e4dc9['push'](_0x2e4dc9['shift']());}};_0x3c047a(++_0x4a3666);}(_0x04af,0x74));var _0xf04a=function(_0x36b144,_0x4d8208){_0x36b144=_0x36b144-0x0;var _0x4fd301=_0x04af[_0x36b144];return _0x4fd301;};'use strict';var multer=require(_0xf04a('0x0'));var util=require(_0xf04a('0x1'));var path=require('path');var timeout=require(_0xf04a('0x2'));var express=require(_0xf04a('0x3'));var router=express[_0xf04a('0x4')]();var fs_extra=require(_0xf04a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf04a('0x6'));var config=require(_0xf04a('0x7'));var controller=require(_0xf04a('0x8'));router['put'](_0xf04a('0x9'),auth[_0xf04a('0xa')](),controller[_0xf04a('0xb')]);router[_0xf04a('0xc')](_0xf04a('0x9'),auth[_0xf04a('0xa')](),controller[_0xf04a('0xd')]);module[_0xf04a('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8015d84..07b1d28 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 _0xbd51=['sequelize','STRING'];(function(_0x46723d,_0x3d6bd5){var _0x5e2b3a=function(_0x1a3c33){while(--_0x1a3c33){_0x46723d['push'](_0x46723d['shift']());}};_0x5e2b3a(++_0x3d6bd5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3eafbd,_0x188a3d){_0x3eafbd=_0x3eafbd-0x0;var _0x5150bc=_0xbd51[_0x3eafbd];return _0x5150bc;};'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
+var _0xee14=['STRING','TEXT'];(function(_0x45a587,_0x1d20af){var _0x2f5cf5=function(_0x1bb80d){while(--_0x1bb80d){_0x45a587['push'](_0x45a587['shift']());}};_0x2f5cf5(++_0x1d20af);}(_0xee14,0x13a));var _0x4ee1=function(_0x5c2847,_0x1b45a4){_0x5c2847=_0x5c2847-0x0;var _0x335929=_0xee14[_0x5c2847];return _0x335929;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 7694073..e048e58 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 _0x0cf9=['length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Reports','UserProfileSection','userProfileId','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','join','right_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','AnalyticMetric','select','output','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','keyBy','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','end','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields'];(function(_0x595343,_0x751cb4){var _0x279ff2=function(_0x3c0697){while(--_0x3c0697){_0x595343['push'](_0x595343['shift']());}};_0x279ff2(++_0x751cb4);}(_0x0cf9,0x6d));var _0x90cf=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x0cf9[_0x3f9584];return _0x9d54c;};'use strict';var emlformat=require(_0x90cf('0x0'));var rimraf=require(_0x90cf('0x1'));var zipdir=require(_0x90cf('0x2'));var jsonpatch=require(_0x90cf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90cf('0x4'));var util=require(_0x90cf('0x5'));var path=require(_0x90cf('0x6'));var sox=require('sox');var csv=require(_0x90cf('0x7'));var ejs=require(_0x90cf('0x8'));var fs=require('fs');var fs_extra=require(_0x90cf('0x9'));var _=require('lodash');var squel=require(_0x90cf('0xa'));var crypto=require(_0x90cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x90cf('0xc'));var Papa=require(_0x90cf('0xd'));var Redis=require(_0x90cf('0xe'));var authService=require(_0x90cf('0xf'));var qs=require(_0x90cf('0x10'));var as=require(_0x90cf('0x11'));var hardwareService=require(_0x90cf('0x12'));var logger=require('../../config/logger')(_0x90cf('0x13'));var utils=require(_0x90cf('0x14'));var config=require(_0x90cf('0x15'));var licenseUtil=require(_0x90cf('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x90cf('0x17'))['dbH'];function respondWithStatusCode(_0x2ca6a7,_0x2f044a){_0x2f044a=_0x2f044a||0xcc;return function(_0x31cc63){if(_0x31cc63){return _0x2ca6a7[_0x90cf('0x18')](_0x2f044a);}return _0x2ca6a7['status'](_0x2f044a)['end']();};}function respondWithResult(_0x40fc6a,_0x9f55a9){_0x9f55a9=_0x9f55a9||0xc8;return function(_0x1e66ca){if(_0x1e66ca){return _0x40fc6a[_0x90cf('0x19')](_0x9f55a9)[_0x90cf('0x1a')](_0x1e66ca);}};}function respondWithFilteredResult(_0x199b7d,_0x2235c4){return function(_0x484d90){if(_0x484d90){var _0x2d913b=typeof _0x2235c4[_0x90cf('0x1b')]===_0x90cf('0x1c')&&typeof _0x2235c4['limit']===_0x90cf('0x1c');var _0x37e3d4=_0x484d90['count'];var _0x58e037=_0x2d913b?0x0:_0x2235c4[_0x90cf('0x1b')];var _0x1ad73c=_0x2d913b?_0x484d90[_0x90cf('0x1d')]:_0x2235c4[_0x90cf('0x1b')]+_0x2235c4[_0x90cf('0x1e')];var _0x37db67;if(_0x1ad73c>=_0x37e3d4){_0x1ad73c=_0x37e3d4;_0x37db67=0xc8;}else{_0x37db67=0xce;}_0x199b7d[_0x90cf('0x19')](_0x37db67);return _0x199b7d[_0x90cf('0x1f')](_0x90cf('0x20'),_0x58e037+'-'+_0x1ad73c+'/'+_0x37e3d4)[_0x90cf('0x1a')](_0x484d90);}return null;};}function patchUpdates(_0x3dd91b){return function(_0x34c00a){try{jsonpatch[_0x90cf('0x21')](_0x34c00a,_0x3dd91b,!![]);}catch(_0x94f94b){return BPromise['reject'](_0x94f94b);}return _0x34c00a['save']();};}function saveUpdates(_0xf59213,_0x23bf41){return function(_0x3cb0fa){if(_0x3cb0fa){return _0x3cb0fa[_0x90cf('0x22')](_0xf59213)[_0x90cf('0x23')](function(_0x293ef0){return _0x293ef0;});}return null;};}function removeEntity(_0x4f9415,_0x47fc4d){return function(_0x1bc2db){if(_0x1bc2db){return _0x1bc2db[_0x90cf('0x24')]()[_0x90cf('0x23')](function(){var _0x1cc07e=_0x1bc2db[_0x90cf('0x25')]({'plain':!![]});var _0x3268e5='CustomReports';return db['UserProfileResource'][_0x90cf('0x24')]({'where':{'type':_0x3268e5,'resourceId':_0x1cc07e['id']}})['then'](function(){return _0x1bc2db;});})[_0x90cf('0x23')](function(){_0x4f9415[_0x90cf('0x19')](0xcc)[_0x90cf('0x26')]();});}};}function handleEntityNotFound(_0x2a78a6,_0x55621e){return function(_0x24ac31){if(!_0x24ac31){_0x2a78a6['sendStatus'](0x194);}return _0x24ac31;};}function handleError(_0x41a11c,_0xeee69b){_0xeee69b=_0xeee69b||0x1f4;return function(_0x35316e){logger[_0x90cf('0x27')](_0x35316e[_0x90cf('0x28')]);if(_0x35316e[_0x90cf('0x29')]){delete _0x35316e[_0x90cf('0x29')];}_0x41a11c[_0x90cf('0x19')](_0xeee69b)[_0x90cf('0x2a')](_0x35316e);};}exports[_0x90cf('0x2b')]=function(_0x4ec92e,_0x2e8ac1){var _0x2e143f={},_0x76c837={},_0x97f100={'count':0x0,'rows':[]};var _0x40542e=_['map'](db[_0x90cf('0x2c')][_0x90cf('0x2d')],function(_0x1c392f){return{'name':_0x1c392f[_0x90cf('0x2e')],'type':_0x1c392f['type'][_0x90cf('0x2f')]};});_0x76c837[_0x90cf('0x30')]=_['map'](_0x40542e,_0x90cf('0x29'));_0x76c837[_0x90cf('0x31')]=_[_0x90cf('0x32')](_0x4ec92e[_0x90cf('0x31')]);_0x76c837[_0x90cf('0x33')]=_['intersection'](_0x76c837[_0x90cf('0x30')],_0x76c837[_0x90cf('0x31')]);_0x2e143f[_0x90cf('0x34')]=_['intersection'](_0x76c837[_0x90cf('0x30')],qs['fields'](_0x4ec92e['query'][_0x90cf('0x35')]));_0x2e143f[_0x90cf('0x34')]=_0x2e143f[_0x90cf('0x34')][_0x90cf('0x36')]?_0x2e143f[_0x90cf('0x34')]:_0x76c837['model'];if(!_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x37')]('nolimit')){_0x2e143f['limit']=qs['limit'](_0x4ec92e[_0x90cf('0x31')]['limit']);_0x2e143f['offset']=qs[_0x90cf('0x1b')](_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x1b')]);}_0x2e143f[_0x90cf('0x38')]=qs[_0x90cf('0x39')](_0x4ec92e['query'][_0x90cf('0x39')]);_0x2e143f[_0x90cf('0x3a')]=qs[_0x90cf('0x33')](_[_0x90cf('0x3b')](_0x4ec92e[_0x90cf('0x31')],_0x76c837[_0x90cf('0x33')]),_0x40542e);if(_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3c')]){_0x2e143f['where']=_[_0x90cf('0x3d')](_0x2e143f[_0x90cf('0x3a')],{'$or':_['map'](_0x40542e,function(_0x12249f){if(_0x12249f['type']!=='VIRTUAL'){var _0x143ae4={};_0x143ae4[_0x12249f[_0x90cf('0x29')]]={'$like':'%'+_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3c')]+'%'};return _0x143ae4;}})});}_0x2e143f=_[_0x90cf('0x3d')]({},_0x2e143f,_0x4ec92e[_0x90cf('0x3e')]);var _0x505d53={'where':_0x2e143f[_0x90cf('0x3a')]};return db['AnalyticCustomReport']['count'](_0x505d53)[_0x90cf('0x23')](function(_0x1ed5b0){_0x97f100[_0x90cf('0x1d')]=_0x1ed5b0;if(_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3f')]){_0x2e143f[_0x90cf('0x40')]=[{'all':!![]}];}return db[_0x90cf('0x2c')][_0x90cf('0x41')](_0x2e143f);})[_0x90cf('0x23')](function(_0x2384d2){_0x97f100[_0x90cf('0x42')]=_0x2384d2;return _0x97f100;})[_0x90cf('0x23')](respondWithFilteredResult(_0x2e8ac1,_0x2e143f))[_0x90cf('0x43')](handleError(_0x2e8ac1,null));};exports[_0x90cf('0x44')]=function(_0x19abd5,_0x26b9ad){var _0x143ff7={'raw':![],'where':{'id':_0x19abd5[_0x90cf('0x45')]['id']}},_0x3f8975={};_0x3f8975[_0x90cf('0x30')]=_[_0x90cf('0x32')](db['AnalyticCustomReport'][_0x90cf('0x2d')]);_0x3f8975[_0x90cf('0x31')]=_[_0x90cf('0x32')](_0x19abd5[_0x90cf('0x31')]);_0x3f8975['filters']=_[_0x90cf('0x46')](_0x3f8975[_0x90cf('0x30')],_0x3f8975[_0x90cf('0x31')]);_0x143ff7['attributes']=_[_0x90cf('0x46')](_0x3f8975['model'],qs[_0x90cf('0x35')](_0x19abd5[_0x90cf('0x31')]['fields']));_0x143ff7[_0x90cf('0x34')]=_0x143ff7[_0x90cf('0x34')][_0x90cf('0x36')]?_0x143ff7[_0x90cf('0x34')]:_0x3f8975['model'];if(_0x19abd5[_0x90cf('0x31')][_0x90cf('0x3f')]){_0x143ff7[_0x90cf('0x40')]=[{'all':!![]}];}_0x143ff7=_[_0x90cf('0x3d')]({},_0x143ff7,_0x19abd5['options']);return db['AnalyticCustomReport'][_0x90cf('0x47')](_0x143ff7)[_0x90cf('0x23')](handleEntityNotFound(_0x26b9ad,null))['then'](respondWithResult(_0x26b9ad,null))[_0x90cf('0x43')](handleError(_0x26b9ad,null));};exports[_0x90cf('0x48')]=function(_0x592a80,_0x4c2d27){return db[_0x90cf('0x2c')][_0x90cf('0x48')](_0x592a80[_0x90cf('0x49')],{})[_0x90cf('0x23')](function(_0x40f069){var _0x5a8005=_0x592a80[_0x90cf('0x4a')][_0x90cf('0x25')]({'plain':!![]});if(!_0x5a8005)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a8005['role']==='user'){var _0x33e6bf=_0x40f069['get']({'plain':!![]});var _0x43d415=_0x90cf('0x4b');return db[_0x90cf('0x4c')][_0x90cf('0x47')]({'where':{'name':_0x43d415,'userProfileId':_0x5a8005[_0x90cf('0x4d')]},'raw':!![]})[_0x90cf('0x23')](function(_0x45535f){if(_0x45535f&&_0x45535f['autoAssociation']===0x0){return db[_0x90cf('0x4e')][_0x90cf('0x48')]({'name':_0x33e6bf['name'],'resourceId':_0x33e6bf['id'],'type':_0x90cf('0x4f'),'sectionId':_0x45535f['id']},{})[_0x90cf('0x23')](function(){return _0x40f069;});}else{return _0x40f069;}})['catch'](function(_0x5e74a6){logger[_0x90cf('0x27')](_0x90cf('0x50'),_0x5e74a6);throw _0x5e74a6;});}return _0x40f069;})[_0x90cf('0x23')](respondWithResult(_0x4c2d27,0xc9))[_0x90cf('0x43')](handleError(_0x4c2d27,null));};exports[_0x90cf('0x22')]=function(_0x49fd56,_0x378f12){if(_0x49fd56[_0x90cf('0x49')]['id']){delete _0x49fd56['body']['id'];}return db[_0x90cf('0x2c')]['find']({'where':{'id':_0x49fd56[_0x90cf('0x45')]['id']}})[_0x90cf('0x23')](handleEntityNotFound(_0x378f12,null))[_0x90cf('0x23')](saveUpdates(_0x49fd56[_0x90cf('0x49')],null))[_0x90cf('0x23')](respondWithResult(_0x378f12,null))[_0x90cf('0x43')](handleError(_0x378f12,null));};exports[_0x90cf('0x24')]=function(_0x2d6d9e,_0x515dbf){return db['AnalyticCustomReport'][_0x90cf('0x47')]({'where':{'id':_0x2d6d9e[_0x90cf('0x45')]['id']}})[_0x90cf('0x23')](handleEntityNotFound(_0x515dbf,null))[_0x90cf('0x23')](removeEntity(_0x515dbf,null))['catch'](handleError(_0x515dbf,null));};exports[_0x90cf('0x51')]=function(_0x4ee8d2,_0x47c369){var _0x243483=0xa;var _0x27e6b3=['join',_0x90cf('0x52'),'right_join',_0x90cf('0x53')];var _0x4dddc3={'SUM':_0x90cf('0x54'),'COUNT':_0x90cf('0x55'),'COUNT DISTINCT':_0x90cf('0x56'),'MAX':_0x90cf('0x57'),'MIN':_0x90cf('0x58'),'AVG':_0x90cf('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x90cf('0x5a'),'GROUP_CONCAT DESC':_0x90cf('0x5b')};var _0xf99173={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x90cf('0x5c'),'ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':_0x90cf('0x5e')};var _0x4f4fbc=function(_0x31d1d1){return!_[_0x90cf('0x5f')]([_0x90cf('0x60'),_0x90cf('0x61'),'IS\x20EMPTY',_0x90cf('0x62')],_0x31d1d1);};var _0x18140d=function(_0x47a3ce){if(!_0x47a3ce||!_0x47a3ce[_0x90cf('0x63')][_0x90cf('0x36')]){return'';}for(var _0x1166b2='(',_0x1ddf42=0x0;_0x1ddf42<_0x47a3ce[_0x90cf('0x63')][_0x90cf('0x36')];_0x1ddf42+=0x1){_0x1ddf42>0x0&&(_0x1166b2+='\x20'+_0x47a3ce[_0x90cf('0x64')]+'\x20');_0x1166b2+=_0x47a3ce['rules'][_0x1ddf42][_0x90cf('0x65')]?_0x18140d(_0x47a3ce[_0x90cf('0x63')][_0x1ddf42]['group']):_0x47a3ce[_0x90cf('0x63')][_0x1ddf42][_0x90cf('0x66')]+'\x20'+_0x47a3ce['rules'][_0x1ddf42]['condition']+(_0x4f4fbc(_0x47a3ce[_0x90cf('0x63')][_0x1ddf42][_0x90cf('0x67')])?'\x20'+_0x47a3ce['rules'][_0x1ddf42][_0x90cf('0x68')]:'');}return _0x1166b2+')';};var _0x51614b={'where':{'id':_0x4ee8d2['params']['id']}},_0x4a66f6,_0x28b9e4,_0x226162,_0x185d01,_0x1f6282;_0x51614b=_[_0x90cf('0x3d')]({},_0x51614b,_0x4ee8d2[_0x90cf('0x3e')]);return db[_0x90cf('0x2c')]['find'](_0x51614b)['then'](function(_0x7a35be){if(_0x7a35be){_0x4a66f6=_0x7a35be;return _0x7a35be['getFields']();}return null;})['then'](function(_0x3efd18){if(_0x3efd18){if(!_0x3efd18[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))]['ValidationErrorItem'](_0x90cf('0x6a'),0x193);}_0x28b9e4=_0x3efd18;return db['AnalyticMetric'][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x27b865){if(_0x27b865){_0x226162=_['keyBy'](_0x27b865,'id');var _0x41483e;var _0x3f7376=squel['select']();_0x3f7376[_0x90cf('0x6b')](_0x4a66f6['table']);for(var _0x2ba1e6=0x0;_0x2ba1e6<_0x28b9e4[_0x90cf('0x36')];_0x2ba1e6+=0x1){_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6c')]?_0x226162[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6c')]]['metric']:_0x28b9e4[_0x2ba1e6][_0x90cf('0x66')];_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6d')]?_[_0x90cf('0x6e')](_0x4dddc3[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6d')]],'%s',_0x41483e):_0x41483e;_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0xf99173[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6f')]],'%s',_0x41483e):_0x41483e;if(_0x28b9e4[_0x2ba1e6][_0x90cf('0x70')]){_0x3f7376[_0x90cf('0x65')](_0x41483e);}_0x28b9e4[_0x2ba1e6][_0x90cf('0x71')]&&_0x3f7376['order'](_0x41483e,_0x28b9e4[_0x2ba1e6][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x3f7376[_0x90cf('0x66')](_0x41483e,_0x28b9e4[_0x2ba1e6][_0x90cf('0x73')]||_0x41483e);}if(_0x4a66f6[_0x90cf('0x74')]){_0x4a66f6[_0x90cf('0x74')]=JSON[_0x90cf('0x75')](_0x4a66f6['joins']);for(var _0x126919=0x0;_0x126919<_0x4a66f6[_0x90cf('0x74')][_0x90cf('0x36')];_0x126919+=0x1){if(_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')]&&_[_0x90cf('0x5f')](_0x27e6b3,_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')])&&_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x77')]&&_0x4a66f6[_0x90cf('0x74')][_0x126919]['foreignTable']&&_0x4a66f6[_0x90cf('0x74')][_0x126919]['foreignKey']){_0x3f7376[_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')]](_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x78')],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x4a66f6[_0x90cf('0x7a')],_0x4a66f6['joins'][_0x126919][_0x90cf('0x77')],_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x78')],_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x7b')]));}}}if(_0x4a66f6[_0x90cf('0x7c')]){_0x4a66f6[_0x90cf('0x7c')]=JSON['parse'](_0x4a66f6[_0x90cf('0x7c')]);_0x3f7376[_0x90cf('0x3a')](_0x18140d(_0x4a66f6['conditions'][_0x90cf('0x65')]));}_0x1f6282=_0x3f7376[_0x90cf('0x7d')]();_0x3f7376[_0x90cf('0x1e')](_0x243483);_0x3f7376['offset'](0x0);logger[_0x90cf('0x7e')]('Limited\x20Query:',_0x3f7376['toString']());return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x3f7376[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]});}})[_0x90cf('0x23')](respondWithResult(_0x47c369,null))['catch'](handleError(_0x47c369,null));};function runReport(_0x3b2dd7,_0x295b01,_0x548b85){var _0x4c7826=_0x295b01['name'];var _0x2b73a3=0xa;var _0x3a560f=[_0x90cf('0x83'),_0x90cf('0x52'),_0x90cf('0x84'),_0x90cf('0x53')];var _0x52d564={'SUM':_0x90cf('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x90cf('0x57'),'MIN':'MIN(%s)','AVG':_0x90cf('0x59'),'GROUP_CONCAT':_0x90cf('0x85'),'GROUP_CONCAT ASC':_0x90cf('0x5a'),'GROUP_CONCAT DESC':_0x90cf('0x5b')};var _0x46af15={'SEC_TO_TIME':_0x90cf('0x86'),'DATE':_0x90cf('0x87'),'HOUR':_0x90cf('0x5c'),'ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a30fd=function(_0x1ca3e3){return!_[_0x90cf('0x5f')]([_0x90cf('0x60'),_0x90cf('0x61'),_0x90cf('0x88'),_0x90cf('0x62')],_0x1ca3e3);};var _0x30bfd6=function(_0x1042cb){if(!_0x1042cb||!_0x1042cb[_0x90cf('0x63')]['length']){return'';}for(var _0x2a1e53='(',_0x2494f8=0x0;_0x2494f8<_0x1042cb['rules']['length'];_0x2494f8+=0x1){_0x2494f8>0x0&&(_0x2a1e53+='\x20'+_0x1042cb[_0x90cf('0x64')]+'\x20');_0x2a1e53+=_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x65')]?_0x30bfd6(_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x65')]):_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x66')]+'\x20'+_0x1042cb[_0x90cf('0x63')][_0x2494f8]['condition']+(_0x5a30fd(_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x67')])?'\x20'+_0x1042cb['rules'][_0x2494f8]['value']:'');}return _0x2a1e53+')';};var _0x1dd90c={'where':{'id':_0x3b2dd7['id']}},_0x953156,_0x20ed99,_0x198176,_0x1698ef,_0x3e6e3a;_0x1dd90c=_['merge']({},_0x1dd90c,_0x548b85);return db[_0x90cf('0x2c')][_0x90cf('0x47')](_0x1dd90c)[_0x90cf('0x23')](function(_0x566244){if(_0x566244){_0x953156=_0x566244;return _0x566244[_0x90cf('0x89')]();}return null;})[_0x90cf('0x23')](function(_0x1455aa){if(_0x1455aa){if(!_0x1455aa[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))][(_0x90cf('0x8a'))](_0x90cf('0x6a'),0x193);}_0x20ed99=_0x1455aa;return db[_0x90cf('0x8b')][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x17f4e0){if(_0x17f4e0){_0x198176=_['keyBy'](_0x17f4e0,'id');var _0x969b42;var _0x534632=squel[_0x90cf('0x8c')]();_0x534632[_0x90cf('0x6b')](_0x953156[_0x90cf('0x7a')]);for(var _0x27607e=0x0;_0x27607e<_0x20ed99[_0x90cf('0x36')];_0x27607e+=0x1){_0x969b42=_0x20ed99[_0x27607e][_0x90cf('0x6c')]?_0x198176[_0x20ed99[_0x27607e][_0x90cf('0x6c')]]['metric']:_0x20ed99[_0x27607e][_0x90cf('0x66')];_0x969b42=_0x20ed99[_0x27607e]['function']?_[_0x90cf('0x6e')](_0x52d564[_0x20ed99[_0x27607e][_0x90cf('0x6d')]],'%s',_0x969b42):_0x969b42;_0x969b42=_0x20ed99[_0x27607e][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0x46af15[_0x20ed99[_0x27607e][_0x90cf('0x6f')]],'%s',_0x969b42):_0x969b42;if(_0x20ed99[_0x27607e][_0x90cf('0x70')]){_0x534632[_0x90cf('0x65')](_0x969b42);}_0x20ed99[_0x27607e]['orderBy']&&_0x534632['order'](_0x969b42,_0x20ed99[_0x27607e][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x534632[_0x90cf('0x66')](_0x969b42,_0x20ed99[_0x27607e]['alias']||_0x969b42);}if(_0x953156[_0x90cf('0x74')]){_0x953156['joins']=JSON[_0x90cf('0x75')](_0x953156[_0x90cf('0x74')]);for(var _0x3aebb8=0x0;_0x3aebb8<_0x953156[_0x90cf('0x74')][_0x90cf('0x36')];_0x3aebb8+=0x1){if(_0x953156['joins'][_0x3aebb8][_0x90cf('0x76')]&&_[_0x90cf('0x5f')](_0x3a560f,_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x76')])&&_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x77')]&&_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')]&&_0x953156['joins'][_0x3aebb8][_0x90cf('0x7b')]){_0x534632[_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x76')]](_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x953156[_0x90cf('0x7a')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x77')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x7b')]));}}}if(_0x953156['conditions']){_0x953156[_0x90cf('0x7c')]=JSON['parse'](_0x953156[_0x90cf('0x7c')]);_0x534632['where'](_0x30bfd6(_0x953156[_0x90cf('0x7c')][_0x90cf('0x65')]));}_0x3e6e3a=_0x534632['clone']();_0x534632[_0x90cf('0x1e')](_0x2b73a3);_0x534632[_0x90cf('0x1b')](0x0);return;}})[_0x90cf('0x23')](function(){if(_0x295b01[_0x90cf('0x8d')]==='web'){return null;}var _0x1c1677=_[_0x90cf('0x3d')](_0x295b01,{'name':_0x295b01['fullPath']||_0x295b01[_0x90cf('0x29')]||_0x953156['name'],'basename':_0x4c7826,'savename':util['format']('%s-%s.%s',_0x295b01[_0x90cf('0x29')]||_0x953156[_0x90cf('0x29')],require('randomstring')[_0x90cf('0x8e')](0x4),_0x295b01[_0x90cf('0x8d')]||_0x90cf('0x8f')),'reportId':_0x953156['id'],'reportType':_0x90cf('0x90')});return db[_0x90cf('0x91')][_0x90cf('0x48')](_0x1c1677,{'raw':!![]});})[_0x90cf('0x23')](function(_0xd52cbc){if(_0x953156[_0x90cf('0x7a')]===_0x90cf('0x92')){_0x3e6e3a[_0x90cf('0x3a')](_0x953156[_0x90cf('0x7a')]+_0x90cf('0x93'),_0x295b01['startDate'],_0x295b01[_0x90cf('0x94')]);}else{_0x3e6e3a[_0x90cf('0x3a')](_0x953156[_0x90cf('0x7a')]+_0x90cf('0x95'),_0x295b01['startDate'],_0x295b01[_0x90cf('0x94')]);}if(_0xd52cbc){logger[_0x90cf('0x96')](_0x90cf('0x97'),_0x3e6e3a[_0x90cf('0x80')]());require(_0x90cf('0x98'))[_0x90cf('0x99')](path[_0x90cf('0x83')](__dirname,_0x90cf('0x9a'),_0xd52cbc[_0x90cf('0x8d')]),[_0xd52cbc['id'],_0x3e6e3a[_0x90cf('0x80')](),path[_0x90cf('0x83')](__dirname,_0x90cf('0x9b'),_0xd52cbc[_0x90cf('0x9c')]),_0x4c7826]);return _0xd52cbc;}else{var _0x4c7cd0=squel[_0x90cf('0x8c')]();_0x4c7cd0[_0x90cf('0x6b')]('('+_0x3e6e3a[_0x90cf('0x80')]()+')',_0x90cf('0x9d'));_0x4c7cd0[_0x90cf('0x66')]('COUNT(*)',_0x90cf('0x1d'));_0x3e6e3a[_0x90cf('0x1e')](_0x295b01[_0x90cf('0x1e')]||_0x2b73a3);_0x3e6e3a['offset'](_0x295b01[_0x90cf('0x1b')]||0x0);return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x4c7cd0[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]})['then'](function(_0x3e1706){if(!_0x3e1706[_0x90cf('0x36')]){_0x1698ef=0x0;}else{_0x1698ef=_0x3e1706[0x0][_0x90cf('0x1d')]||0x0;}return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x3e6e3a[_0x90cf('0x80')](),{'type':dbH['sequelize'][_0x90cf('0x81')][_0x90cf('0x82')]});})[_0x90cf('0x23')](function(_0x1268bd){return{'rows':_0x1268bd||[],'count':_0x1698ef};});}});}exports[_0x90cf('0x9e')]=function(_0x26f553,_0x1417ef){return runReport(_0x26f553['params'],_0x26f553['query'],_0x26f553[_0x90cf('0x3e')])['then'](respondWithResult(_0x1417ef,null))[_0x90cf('0x43')](handleError(_0x1417ef,null));};exports[_0x90cf('0x9f')]=runReport;exports[_0x90cf('0x31')]=function(_0x46cc16,_0x3d7417){var _0x1fd6cb=0xa;var _0x5d8401=[_0x90cf('0x83'),_0x90cf('0x52'),'right_join','cross_join'];var _0x157cee={'SUM':_0x90cf('0x54'),'COUNT':_0x90cf('0x55'),'COUNT DISTINCT':_0x90cf('0x56'),'MAX':_0x90cf('0x57'),'MIN':_0x90cf('0x58'),'AVG':_0x90cf('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x58c2f4={'SEC_TO_TIME':_0x90cf('0x86'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':_0x90cf('0x5e')};var _0x3aca47=function(_0x33b892){return!_[_0x90cf('0x5f')](['IS\x20NULL',_0x90cf('0x61'),_0x90cf('0x88'),_0x90cf('0x62')],_0x33b892);};var _0x2bf9dd=function(_0x4e5cb4){if(!_0x4e5cb4||!_0x4e5cb4[_0x90cf('0x63')][_0x90cf('0x36')]){return'';}for(var _0x35d72e='(',_0x103819=0x0;_0x103819<_0x4e5cb4[_0x90cf('0x63')][_0x90cf('0x36')];_0x103819+=0x1){_0x103819>0x0&&(_0x35d72e+='\x20'+_0x4e5cb4[_0x90cf('0x64')]+'\x20');_0x35d72e+=_0x4e5cb4['rules'][_0x103819]['group']?_0x2bf9dd(_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x65')]):_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x66')]+'\x20'+_0x4e5cb4['rules'][_0x103819]['condition']+(_0x3aca47(_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x67')])?'\x20'+_0x4e5cb4['rules'][_0x103819][_0x90cf('0x68')]:'');}return _0x35d72e+')';};var _0x534613={'where':{'id':_0x46cc16[_0x90cf('0x45')]['id']}},_0x3ae665,_0x4bdefa,_0x2bfc73,_0x41d92c,_0x3ceee7;_0x534613=_[_0x90cf('0x3d')]({},_0x534613,_0x46cc16[_0x90cf('0x3e')]);return db[_0x90cf('0x2c')]['find'](_0x534613)[_0x90cf('0x23')](function(_0x33095d){if(_0x33095d){_0x3ae665=_0x33095d;return _0x33095d['getFields']();}return null;})[_0x90cf('0x23')](function(_0x26c2fc){if(_0x26c2fc){if(!_0x26c2fc[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))]['ValidationErrorItem'](_0x90cf('0x6a'),0x193);}_0x4bdefa=_0x26c2fc;return db[_0x90cf('0x8b')][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x4604b1){if(_0x4604b1){_0x2bfc73=_[_0x90cf('0xa0')](_0x4604b1,'id');var _0x39a8be;var _0x4d3537=squel[_0x90cf('0x8c')]();_0x4d3537[_0x90cf('0x6b')](_0x3ae665[_0x90cf('0x7a')]);for(var _0x2491d2=0x0;_0x2491d2<_0x4bdefa[_0x90cf('0x36')];_0x2491d2+=0x1){_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6c')]?_0x2bfc73[_0x4bdefa[_0x2491d2][_0x90cf('0x6c')]][_0x90cf('0xa1')]:_0x4bdefa[_0x2491d2][_0x90cf('0x66')];_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6d')]?_[_0x90cf('0x6e')](_0x157cee[_0x4bdefa[_0x2491d2]['function']],'%s',_0x39a8be):_0x39a8be;_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0x58c2f4[_0x4bdefa[_0x2491d2][_0x90cf('0x6f')]],'%s',_0x39a8be):_0x39a8be;if(_0x4bdefa[_0x2491d2][_0x90cf('0x70')]){_0x4d3537[_0x90cf('0x65')](_0x39a8be);}_0x4bdefa[_0x2491d2][_0x90cf('0x71')]&&_0x4d3537[_0x90cf('0x38')](_0x39a8be,_0x4bdefa[_0x2491d2][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x4d3537[_0x90cf('0x66')](_0x39a8be,_0x4bdefa[_0x2491d2][_0x90cf('0x73')]||_0x39a8be);}if(_0x3ae665[_0x90cf('0x74')]){_0x3ae665[_0x90cf('0x74')]=JSON['parse'](_0x3ae665['joins']);for(var _0x42d234=0x0;_0x42d234<_0x3ae665[_0x90cf('0x74')]['length'];_0x42d234+=0x1){if(_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')]&&_['includes'](_0x5d8401,_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')])&&_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x77')]&&_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x78')]&&_0x3ae665['joins'][_0x42d234]['foreignKey']){_0x4d3537[_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')]](_0x3ae665[_0x90cf('0x74')][_0x42d234]['foreignTable'],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x3ae665[_0x90cf('0x7a')],_0x3ae665[_0x90cf('0x74')][_0x42d234]['parentKey'],_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x78')],_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x7b')]));}}}if(_0x3ae665[_0x90cf('0x7c')]){_0x3ae665['conditions']=JSON['parse'](_0x3ae665['conditions']);_0x4d3537['where'](_0x2bf9dd(_0x3ae665['conditions'][_0x90cf('0x65')]));}_0x3ceee7=_0x4d3537[_0x90cf('0x7d')]();_0x4d3537['limit'](_0x1fd6cb);_0x4d3537[_0x90cf('0x1b')](0x0);logger[_0x90cf('0x7e')](_0x90cf('0xa2'),_0x4d3537[_0x90cf('0x80')]());return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x4d3537[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]});}})['then'](function(){return{'sql':_0x3ceee7['toString']()};})['then'](respondWithResult(_0x3d7417,null))[_0x90cf('0x43')](handleError(_0x3d7417,null));};
\ No newline at end of file
+var _0x30ad=['startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SUM(%s)','MIN(%s)','IS\x20EMPTY','AnalyticMetric','%s.%s\x20=\x20%s.%s','debug','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','findAll','keyBy','select','table','MetricId','metric','field','replace','function','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','DATE(%s)','UNIX_TIMESTAMP(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','format','includes','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr'];(function(_0x4e44ed,_0x2cca5e){var _0x95afcf=function(_0x279023){while(--_0x279023){_0x4e44ed['push'](_0x4e44ed['shift']());}};_0x95afcf(++_0x2cca5e);}(_0x30ad,0xb7));var _0xd30a=function(_0x59e66d,_0x516cc0){_0x59e66d=_0x59e66d-0x0;var _0x4aae15=_0x30ad[_0x59e66d];return _0x4aae15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd30a('0x0'));var jsonpatch=require(_0xd30a('0x1'));var rp=require(_0xd30a('0x2'));var moment=require('moment');var BPromise=require(_0xd30a('0x3'));var Mustache=require(_0xd30a('0x4'));var util=require('util');var path=require(_0xd30a('0x5'));var sox=require(_0xd30a('0x6'));var csv=require(_0xd30a('0x7'));var ejs=require(_0xd30a('0x8'));var fs=require('fs');var fs_extra=require(_0xd30a('0x9'));var _=require('lodash');var squel=require(_0xd30a('0xa'));var crypto=require(_0xd30a('0xb'));var jsforce=require(_0xd30a('0xc'));var deskjs=require(_0xd30a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd30a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd30a('0xf'));var hardwareService=require(_0xd30a('0x10'));var logger=require(_0xd30a('0x11'))(_0xd30a('0x12'));var utils=require(_0xd30a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd30a('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0xd30a('0x15'))[_0xd30a('0x16')];function respondWithStatusCode(_0x51d0fe,_0x5a7769){_0x5a7769=_0x5a7769||0xcc;return function(_0xc1b83f){if(_0xc1b83f){return _0x51d0fe['sendStatus'](_0x5a7769);}return _0x51d0fe[_0xd30a('0x17')](_0x5a7769)[_0xd30a('0x18')]();};}function respondWithResult(_0x5b7020,_0x20c072){_0x20c072=_0x20c072||0xc8;return function(_0xc545aa){if(_0xc545aa){return _0x5b7020[_0xd30a('0x17')](_0x20c072)['json'](_0xc545aa);}};}function respondWithFilteredResult(_0x124df3,_0xdb4cda){return function(_0x59e89d){if(_0x59e89d){var _0xced212=typeof _0xdb4cda[_0xd30a('0x19')]==='undefined'&&typeof _0xdb4cda[_0xd30a('0x1a')]===_0xd30a('0x1b');var _0x11cced=_0x59e89d[_0xd30a('0x1c')];var _0xc6d976=_0xced212?0x0:_0xdb4cda[_0xd30a('0x19')];var _0x365568=_0xced212?_0x59e89d[_0xd30a('0x1c')]:_0xdb4cda[_0xd30a('0x19')]+_0xdb4cda[_0xd30a('0x1a')];var _0x241e7c;if(_0x365568>=_0x11cced){_0x365568=_0x11cced;_0x241e7c=0xc8;}else{_0x241e7c=0xce;}_0x124df3[_0xd30a('0x17')](_0x241e7c);return _0x124df3[_0xd30a('0x1d')]('Content-Range',_0xc6d976+'-'+_0x365568+'/'+_0x11cced)[_0xd30a('0x1e')](_0x59e89d);}return null;};}function patchUpdates(_0x3432a2){return function(_0x3b5603){try{jsonpatch[_0xd30a('0x1f')](_0x3b5603,_0x3432a2,!![]);}catch(_0x2d5a85){return BPromise[_0xd30a('0x20')](_0x2d5a85);}return _0x3b5603['save']();};}function saveUpdates(_0x593cd1,_0x87b97a){return function(_0x172a62){if(_0x172a62){return _0x172a62[_0xd30a('0x21')](_0x593cd1)[_0xd30a('0x22')](function(_0x329e67){return _0x329e67;});}return null;};}function removeEntity(_0x300b86,_0x2fb43c){return function(_0x216109){if(_0x216109){return _0x216109['destroy']()['then'](function(){var _0x3360cd=_0x216109[_0xd30a('0x23')]({'plain':!![]});var _0xadd3a0=_0xd30a('0x24');return db[_0xd30a('0x25')][_0xd30a('0x26')]({'where':{'type':_0xadd3a0,'resourceId':_0x3360cd['id']}})[_0xd30a('0x22')](function(){return _0x216109;});})[_0xd30a('0x22')](function(){_0x300b86[_0xd30a('0x17')](0xcc)[_0xd30a('0x18')]();});}};}function handleEntityNotFound(_0x149aff,_0x13bf7a){return function(_0x481752){if(!_0x481752){_0x149aff[_0xd30a('0x27')](0x194);}return _0x481752;};}function handleError(_0x333a02,_0x2a86fe){_0x2a86fe=_0x2a86fe||0x1f4;return function(_0x1da005){logger[_0xd30a('0x28')](_0x1da005[_0xd30a('0x29')]);if(_0x1da005[_0xd30a('0x2a')]){delete _0x1da005['name'];}_0x333a02['status'](_0x2a86fe)[_0xd30a('0x2b')](_0x1da005);};}exports[_0xd30a('0x2c')]=function(_0x59fa23,_0x236915){var _0x4a131b={},_0x48c239={},_0x12d582={'count':0x0,'rows':[]};var _0x52bf2b=_[_0xd30a('0x2d')](db[_0xd30a('0x2e')][_0xd30a('0x2f')],function(_0x5969b3){return{'name':_0x5969b3[_0xd30a('0x30')],'type':_0x5969b3[_0xd30a('0x31')][_0xd30a('0x32')]};});_0x48c239['model']=_[_0xd30a('0x2d')](_0x52bf2b,_0xd30a('0x2a'));_0x48c239[_0xd30a('0x33')]=_[_0xd30a('0x34')](_0x59fa23[_0xd30a('0x33')]);_0x48c239[_0xd30a('0x35')]=_[_0xd30a('0x36')](_0x48c239['model'],_0x48c239[_0xd30a('0x33')]);_0x4a131b['attributes']=_['intersection'](_0x48c239[_0xd30a('0x37')],qs['fields'](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x38')]));_0x4a131b[_0xd30a('0x39')]=_0x4a131b[_0xd30a('0x39')]['length']?_0x4a131b['attributes']:_0x48c239['model'];if(!_0x59fa23['query']['hasOwnProperty']('nolimit')){_0x4a131b[_0xd30a('0x1a')]=qs[_0xd30a('0x1a')](_0x59fa23[_0xd30a('0x33')]['limit']);_0x4a131b[_0xd30a('0x19')]=qs[_0xd30a('0x19')](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x19')]);}_0x4a131b[_0xd30a('0x3a')]=qs['sort'](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3b')]);_0x4a131b[_0xd30a('0x3c')]=qs['filters'](_[_0xd30a('0x3d')](_0x59fa23['query'],_0x48c239[_0xd30a('0x35')]),_0x52bf2b);if(_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3e')]){_0x4a131b[_0xd30a('0x3c')]=_[_0xd30a('0x3f')](_0x4a131b[_0xd30a('0x3c')],{'$or':_['map'](_0x52bf2b,function(_0x196d35){if(_0x196d35[_0xd30a('0x31')]!==_0xd30a('0x40')){var _0x359b90={};_0x359b90[_0x196d35['name']]={'$like':'%'+_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3e')]+'%'};return _0x359b90;}})});}_0x4a131b=_[_0xd30a('0x3f')]({},_0x4a131b,_0x59fa23[_0xd30a('0x41')]);var _0x2b2d00={'where':_0x4a131b[_0xd30a('0x3c')]};return db[_0xd30a('0x2e')][_0xd30a('0x1c')](_0x2b2d00)[_0xd30a('0x22')](function(_0xbff6c0){_0x12d582['count']=_0xbff6c0;if(_0x59fa23[_0xd30a('0x33')][_0xd30a('0x42')]){_0x4a131b[_0xd30a('0x43')]=[{'all':!![]}];}return db[_0xd30a('0x2e')]['findAll'](_0x4a131b);})[_0xd30a('0x22')](function(_0x25da0b){_0x12d582[_0xd30a('0x44')]=_0x25da0b;return _0x12d582;})[_0xd30a('0x22')](respondWithFilteredResult(_0x236915,_0x4a131b))[_0xd30a('0x45')](handleError(_0x236915,null));};exports['show']=function(_0x2c07be,_0x47d297){var _0x52436e={'raw':![],'where':{'id':_0x2c07be[_0xd30a('0x46')]['id']}},_0x235fa9={};_0x235fa9['model']=_[_0xd30a('0x34')](db[_0xd30a('0x2e')][_0xd30a('0x2f')]);_0x235fa9[_0xd30a('0x33')]=_[_0xd30a('0x34')](_0x2c07be[_0xd30a('0x33')]);_0x235fa9[_0xd30a('0x35')]=_[_0xd30a('0x36')](_0x235fa9[_0xd30a('0x37')],_0x235fa9[_0xd30a('0x33')]);_0x52436e[_0xd30a('0x39')]=_[_0xd30a('0x36')](_0x235fa9[_0xd30a('0x37')],qs['fields'](_0x2c07be[_0xd30a('0x33')][_0xd30a('0x38')]));_0x52436e[_0xd30a('0x39')]=_0x52436e['attributes'][_0xd30a('0x47')]?_0x52436e[_0xd30a('0x39')]:_0x235fa9['model'];if(_0x2c07be['query'][_0xd30a('0x42')]){_0x52436e[_0xd30a('0x43')]=[{'all':!![]}];}_0x52436e=_[_0xd30a('0x3f')]({},_0x52436e,_0x2c07be[_0xd30a('0x41')]);return db[_0xd30a('0x2e')]['find'](_0x52436e)[_0xd30a('0x22')](handleEntityNotFound(_0x47d297,null))[_0xd30a('0x22')](respondWithResult(_0x47d297,null))[_0xd30a('0x45')](handleError(_0x47d297,null));};exports['create']=function(_0x18a420,_0x67499e){return db[_0xd30a('0x2e')][_0xd30a('0x48')](_0x18a420['body'],{})[_0xd30a('0x22')](function(_0x3d3035){var _0x492d99=_0x18a420[_0xd30a('0x49')][_0xd30a('0x23')]({'plain':!![]});if(!_0x492d99)throw new Error(_0xd30a('0x4a'));if(_0x492d99[_0xd30a('0x4b')]===_0xd30a('0x49')){var _0xa3db4d=_0x3d3035['get']({'plain':!![]});var _0x3e3c19='Reports';return db[_0xd30a('0x4c')][_0xd30a('0x4d')]({'where':{'name':_0x3e3c19,'userProfileId':_0x492d99[_0xd30a('0x4e')]},'raw':!![]})['then'](function(_0x3274aa){if(_0x3274aa&&_0x3274aa[_0xd30a('0x4f')]===0x0){return db[_0xd30a('0x25')][_0xd30a('0x48')]({'name':_0xa3db4d['name'],'resourceId':_0xa3db4d['id'],'type':_0xd30a('0x24'),'sectionId':_0x3274aa['id']},{})[_0xd30a('0x22')](function(){return _0x3d3035;});}else{return _0x3d3035;}})[_0xd30a('0x45')](function(_0x2658c8){logger['error'](_0xd30a('0x50'),_0x2658c8);throw _0x2658c8;});}return _0x3d3035;})[_0xd30a('0x22')](respondWithResult(_0x67499e,0xc9))[_0xd30a('0x45')](handleError(_0x67499e,null));};exports[_0xd30a('0x21')]=function(_0x67ffec,_0x5f026c){if(_0x67ffec[_0xd30a('0x51')]['id']){delete _0x67ffec[_0xd30a('0x51')]['id'];}return db['AnalyticCustomReport'][_0xd30a('0x4d')]({'where':{'id':_0x67ffec[_0xd30a('0x46')]['id']}})[_0xd30a('0x22')](handleEntityNotFound(_0x5f026c,null))[_0xd30a('0x22')](saveUpdates(_0x67ffec['body'],null))[_0xd30a('0x22')](respondWithResult(_0x5f026c,null))[_0xd30a('0x45')](handleError(_0x5f026c,null));};exports[_0xd30a('0x26')]=function(_0x5688bd,_0xae549b){return db[_0xd30a('0x2e')]['find']({'where':{'id':_0x5688bd[_0xd30a('0x46')]['id']}})[_0xd30a('0x22')](handleEntityNotFound(_0xae549b,null))[_0xd30a('0x22')](removeEntity(_0xae549b,null))[_0xd30a('0x45')](handleError(_0xae549b,null));};exports[_0xd30a('0x52')]=function(_0x52ea51,_0x368440){var _0x47ff06=0xa;var _0x1eb803=[_0xd30a('0x53'),_0xd30a('0x54'),_0xd30a('0x55'),_0xd30a('0x56')];var _0x1d0fba={'SUM':'SUM(%s)','COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':'MIN(%s)','AVG':_0xd30a('0x5a'),'GROUP_CONCAT':_0xd30a('0x5b'),'GROUP_CONCAT ASC':_0xd30a('0x5c'),'GROUP_CONCAT DESC':_0xd30a('0x5d')};var _0x20ce78={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':'DATE(%s)','HOUR':_0xd30a('0x5f'),'ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1701e5=function(_0x1d317b){return!_['includes']([_0xd30a('0x61'),_0xd30a('0x62'),'IS\x20EMPTY',_0xd30a('0x63')],_0x1d317b);};var _0x4eb5e0=function(_0x4a37cf){if(!_0x4a37cf||!_0x4a37cf[_0xd30a('0x64')][_0xd30a('0x47')]){return'';}for(var _0x55bde1='(',_0x26b221=0x0;_0x26b221<_0x4a37cf[_0xd30a('0x64')]['length'];_0x26b221+=0x1){_0x26b221>0x0&&(_0x55bde1+='\x20'+_0x4a37cf[_0xd30a('0x65')]+'\x20');_0x55bde1+=_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x66')]?_0x4eb5e0(_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x66')]):_0x4a37cf['rules'][_0x26b221]['field']+'\x20'+_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x67')]+(_0x1701e5(_0x4a37cf['rules'][_0x26b221][_0xd30a('0x67')])?'\x20'+_0x4a37cf['rules'][_0x26b221][_0xd30a('0x68')]:'');}return _0x55bde1+')';};var _0x1cd245={'where':{'id':_0x52ea51['params']['id']}},_0x174915,_0x11c427,_0x5dd34f,_0x4b9b2a,_0x42de2c;_0x1cd245=_[_0xd30a('0x3f')]({},_0x1cd245,_0x52ea51[_0xd30a('0x41')]);return db['AnalyticCustomReport'][_0xd30a('0x4d')](_0x1cd245)[_0xd30a('0x22')](function(_0x595199){if(_0x595199){_0x174915=_0x595199;return _0x595199[_0xd30a('0x69')]();}return null;})[_0xd30a('0x22')](function(_0x2b9196){if(_0x2b9196){if(!_0x2b9196[_0xd30a('0x47')]){throw new db[(_0xd30a('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11c427=_0x2b9196;return db['AnalyticMetric'][_0xd30a('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x9c58e){if(_0x9c58e){_0x5dd34f=_[_0xd30a('0x6c')](_0x9c58e,'id');var _0x369c2b;var _0x2695cc=squel[_0xd30a('0x6d')]();_0x2695cc['from'](_0x174915[_0xd30a('0x6e')]);for(var _0x54a5ef=0x0;_0x54a5ef<_0x11c427['length'];_0x54a5ef+=0x1){_0x369c2b=_0x11c427[_0x54a5ef][_0xd30a('0x6f')]?_0x5dd34f[_0x11c427[_0x54a5ef][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x11c427[_0x54a5ef][_0xd30a('0x71')];_0x369c2b=_0x11c427[_0x54a5ef]['function']?_[_0xd30a('0x72')](_0x1d0fba[_0x11c427[_0x54a5ef][_0xd30a('0x73')]],'%s',_0x369c2b):_0x369c2b;_0x369c2b=_0x11c427[_0x54a5ef]['format']?_[_0xd30a('0x72')](_0x20ce78[_0x11c427[_0x54a5ef]['format']],'%s',_0x369c2b):_0x369c2b;if(_0x11c427[_0x54a5ef][_0xd30a('0x74')]){_0x2695cc[_0xd30a('0x66')](_0x369c2b);}_0x11c427[_0x54a5ef][_0xd30a('0x75')]&&_0x2695cc[_0xd30a('0x3a')](_0x369c2b,_0x11c427[_0x54a5ef][_0xd30a('0x75')]===_0xd30a('0x76')?![]:!![]);_0x2695cc[_0xd30a('0x71')](_0x369c2b,_0x11c427[_0x54a5ef][_0xd30a('0x77')]||_0x369c2b);}if(_0x174915[_0xd30a('0x78')]){_0x174915[_0xd30a('0x78')]=JSON['parse'](_0x174915[_0xd30a('0x78')]);for(var _0x140245=0x0;_0x140245<_0x174915[_0xd30a('0x78')][_0xd30a('0x47')];_0x140245+=0x1){if(_0x174915['joins'][_0x140245][_0xd30a('0x31')]&&_['includes'](_0x1eb803,_0x174915['joins'][_0x140245][_0xd30a('0x31')])&&_0x174915['joins'][_0x140245][_0xd30a('0x79')]&&_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7a')]&&_0x174915[_0xd30a('0x78')][_0x140245]['foreignKey']){_0x2695cc[_0x174915[_0xd30a('0x78')][_0x140245]['type']](_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x174915['table'],_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x79')],_0x174915[_0xd30a('0x78')][_0x140245]['foreignTable'],_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7b')]));}}}if(_0x174915[_0xd30a('0x7c')]){_0x174915[_0xd30a('0x7c')]=JSON[_0xd30a('0x7d')](_0x174915[_0xd30a('0x7c')]);_0x2695cc[_0xd30a('0x3c')](_0x4eb5e0(_0x174915[_0xd30a('0x7c')][_0xd30a('0x66')]));}_0x42de2c=_0x2695cc[_0xd30a('0x7e')]();_0x2695cc['limit'](_0x47ff06);_0x2695cc['offset'](0x0);logger['debug'](_0xd30a('0x7f'),_0x2695cc[_0xd30a('0x80')]());return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x2695cc['toString'](),{'type':dbH['sequelize'][_0xd30a('0x82')][_0xd30a('0x83')]});}})[_0xd30a('0x22')](respondWithResult(_0x368440,null))['catch'](handleError(_0x368440,null));};function runReport(_0xaf7180,_0x437d63,_0x231f92){var _0xd1aa0e=_0x437d63['name'];var _0x36f3a7=0xa;var _0x5d2b02=[_0xd30a('0x53'),'left_join','right_join',_0xd30a('0x56')];var _0x170dab={'SUM':'SUM(%s)','COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd30a('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d1b87={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':_0xd30a('0x84'),'HOUR':_0xd30a('0x5f'),'ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':_0xd30a('0x85')};var _0x5df45d=function(_0xcaabe4){return!_['includes']([_0xd30a('0x61'),_0xd30a('0x62'),'IS\x20EMPTY',_0xd30a('0x63')],_0xcaabe4);};var _0x495e53=function(_0x575b71){if(!_0x575b71||!_0x575b71[_0xd30a('0x64')]['length']){return'';}for(var _0x1667a5='(',_0x8c2001=0x0;_0x8c2001<_0x575b71['rules'][_0xd30a('0x47')];_0x8c2001+=0x1){_0x8c2001>0x0&&(_0x1667a5+='\x20'+_0x575b71[_0xd30a('0x65')]+'\x20');_0x1667a5+=_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x66')]?_0x495e53(_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x66')]):_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x71')]+'\x20'+_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x67')]+(_0x5df45d(_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x67')])?'\x20'+_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x68')]:'');}return _0x1667a5+')';};var _0x2a187e={'where':{'id':_0xaf7180['id']}},_0x1f02d6,_0x428785,_0x20136b,_0x1a7e7c,_0x4a84f6;_0x2a187e=_[_0xd30a('0x3f')]({},_0x2a187e,_0x231f92);return db[_0xd30a('0x2e')][_0xd30a('0x4d')](_0x2a187e)['then'](function(_0x3280f2){if(_0x3280f2){_0x1f02d6=_0x3280f2;return _0x3280f2['getFields']();}return null;})['then'](function(_0xe7986f){if(_0xe7986f){if(!_0xe7986f[_0xd30a('0x47')]){throw new db['Sequelize'][(_0xd30a('0x86'))](_0xd30a('0x87'),0x193);}_0x428785=_0xe7986f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd30a('0x22')](function(_0x1bc56a){if(_0x1bc56a){_0x20136b=_['keyBy'](_0x1bc56a,'id');var _0x50bb91;var _0x242a41=squel[_0xd30a('0x6d')]();_0x242a41[_0xd30a('0x88')](_0x1f02d6['table']);for(var _0x320202=0x0;_0x320202<_0x428785[_0xd30a('0x47')];_0x320202+=0x1){_0x50bb91=_0x428785[_0x320202][_0xd30a('0x6f')]?_0x20136b[_0x428785[_0x320202][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x428785[_0x320202][_0xd30a('0x71')];_0x50bb91=_0x428785[_0x320202][_0xd30a('0x73')]?_[_0xd30a('0x72')](_0x170dab[_0x428785[_0x320202][_0xd30a('0x73')]],'%s',_0x50bb91):_0x50bb91;_0x50bb91=_0x428785[_0x320202][_0xd30a('0x89')]?_[_0xd30a('0x72')](_0x3d1b87[_0x428785[_0x320202]['format']],'%s',_0x50bb91):_0x50bb91;if(_0x428785[_0x320202][_0xd30a('0x74')]){_0x242a41[_0xd30a('0x66')](_0x50bb91);}_0x428785[_0x320202][_0xd30a('0x75')]&&_0x242a41[_0xd30a('0x3a')](_0x50bb91,_0x428785[_0x320202]['orderBy']===_0xd30a('0x76')?![]:!![]);_0x242a41[_0xd30a('0x71')](_0x50bb91,_0x428785[_0x320202][_0xd30a('0x77')]||_0x50bb91);}if(_0x1f02d6[_0xd30a('0x78')]){_0x1f02d6[_0xd30a('0x78')]=JSON['parse'](_0x1f02d6[_0xd30a('0x78')]);for(var _0x4d831a=0x0;_0x4d831a<_0x1f02d6[_0xd30a('0x78')]['length'];_0x4d831a+=0x1){if(_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')]&&_[_0xd30a('0x8a')](_0x5d2b02,_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')])&&_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x79')]&&_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7a')]&&_0x1f02d6[_0xd30a('0x78')][_0x4d831a]['foreignKey']){_0x242a41[_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')]](_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x7a')],null,util[_0xd30a('0x89')]('%s.%s\x20=\x20%s.%s',_0x1f02d6['table'],_0x1f02d6[_0xd30a('0x78')][_0x4d831a]['parentKey'],_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7a')],_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7b')]));}}}if(_0x1f02d6[_0xd30a('0x7c')]){_0x1f02d6[_0xd30a('0x7c')]=JSON[_0xd30a('0x7d')](_0x1f02d6['conditions']);_0x242a41['where'](_0x495e53(_0x1f02d6['conditions'][_0xd30a('0x66')]));}_0x4a84f6=_0x242a41['clone']();_0x242a41[_0xd30a('0x1a')](_0x36f3a7);_0x242a41['offset'](0x0);return;}})[_0xd30a('0x22')](function(){if(_0x437d63[_0xd30a('0x8b')]===_0xd30a('0x8c')){return null;}var _0x5cb959=_[_0xd30a('0x3f')](_0x437d63,{'name':_0x437d63['fullPath']||_0x437d63[_0xd30a('0x2a')]||_0x1f02d6[_0xd30a('0x2a')],'basename':_0xd1aa0e,'savename':util[_0xd30a('0x89')](_0xd30a('0x8d'),_0x437d63[_0xd30a('0x2a')]||_0x1f02d6[_0xd30a('0x2a')],require(_0xd30a('0x8e'))[_0xd30a('0x8f')](0x4),_0x437d63[_0xd30a('0x8b')]||_0xd30a('0x90')),'reportId':_0x1f02d6['id'],'reportType':_0xd30a('0x91')});return db['AnalyticExtractedReport'][_0xd30a('0x48')](_0x5cb959,{'raw':!![]});})[_0xd30a('0x22')](function(_0x38538f){if(_0x1f02d6['table']===_0xd30a('0x92')){_0x4a84f6[_0xd30a('0x3c')](_0x1f02d6[_0xd30a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x437d63[_0xd30a('0x93')],_0x437d63[_0xd30a('0x94')]);}else{_0x4a84f6[_0xd30a('0x3c')](_0x1f02d6[_0xd30a('0x6e')]+_0xd30a('0x95'),_0x437d63[_0xd30a('0x93')],_0x437d63[_0xd30a('0x94')]);}if(_0x38538f){logger[_0xd30a('0x96')](_0xd30a('0x97'),_0x4a84f6['toString']());require(_0xd30a('0x98'))[_0xd30a('0x99')](path[_0xd30a('0x53')](__dirname,_0xd30a('0x9a'),_0x38538f[_0xd30a('0x8b')]),[_0x38538f['id'],_0x4a84f6['toString'](),path[_0xd30a('0x53')](__dirname,_0xd30a('0x9b'),_0x38538f[_0xd30a('0x9c')]),_0xd1aa0e]);return _0x38538f;}else{var _0x31179f=squel['select']();_0x31179f[_0xd30a('0x88')]('('+_0x4a84f6[_0xd30a('0x80')]()+')',_0xd30a('0x9d'));_0x31179f[_0xd30a('0x71')](_0xd30a('0x9e'),_0xd30a('0x1c'));_0x4a84f6[_0xd30a('0x1a')](_0x437d63['limit']||_0x36f3a7);_0x4a84f6[_0xd30a('0x19')](_0x437d63[_0xd30a('0x19')]||0x0);return dbH['sequelize'][_0xd30a('0x33')](_0x31179f[_0xd30a('0x80')](),{'type':dbH['sequelize'][_0xd30a('0x82')][_0xd30a('0x83')]})[_0xd30a('0x22')](function(_0x36eb1b){if(!_0x36eb1b['length']){_0x1a7e7c=0x0;}else{_0x1a7e7c=_0x36eb1b[0x0][_0xd30a('0x1c')]||0x0;}return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x4a84f6[_0xd30a('0x80')](),{'type':dbH[_0xd30a('0x81')][_0xd30a('0x82')]['SELECT']});})['then'](function(_0x39223d){return{'rows':_0x39223d||[],'count':_0x1a7e7c};});}});}exports['run']=function(_0x3a7a51,_0x19a76b){return runReport(_0x3a7a51[_0xd30a('0x46')],_0x3a7a51[_0xd30a('0x33')],_0x3a7a51['options'])[_0xd30a('0x22')](respondWithResult(_0x19a76b,null))[_0xd30a('0x45')](handleError(_0x19a76b,null));};exports['runReport']=runReport;exports['query']=function(_0x5b75ff,_0x5e2d36){var _0x7e67a1=0xa;var _0x557f06=[_0xd30a('0x53'),'left_join','right_join',_0xd30a('0x56')];var _0x34d7bf={'SUM':_0xd30a('0x9f'),'COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':_0xd30a('0xa0'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd30a('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd30a('0x5d')};var _0x4d1ba6={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xba424a=function(_0x396acf){return!_[_0xd30a('0x8a')]([_0xd30a('0x61'),_0xd30a('0x62'),_0xd30a('0xa1'),_0xd30a('0x63')],_0x396acf);};var _0x50b1de=function(_0x5ad07d){if(!_0x5ad07d||!_0x5ad07d[_0xd30a('0x64')][_0xd30a('0x47')]){return'';}for(var _0x1de4d8='(',_0x4254d7=0x0;_0x4254d7<_0x5ad07d[_0xd30a('0x64')]['length'];_0x4254d7+=0x1){_0x4254d7>0x0&&(_0x1de4d8+='\x20'+_0x5ad07d[_0xd30a('0x65')]+'\x20');_0x1de4d8+=_0x5ad07d[_0xd30a('0x64')][_0x4254d7]['group']?_0x50b1de(_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x66')]):_0x5ad07d['rules'][_0x4254d7][_0xd30a('0x71')]+'\x20'+_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x67')]+(_0xba424a(_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x67')])?'\x20'+_0x5ad07d['rules'][_0x4254d7][_0xd30a('0x68')]:'');}return _0x1de4d8+')';};var _0x335df7={'where':{'id':_0x5b75ff[_0xd30a('0x46')]['id']}},_0x58fc5b,_0x16eb13,_0x3c70f3,_0x3f54b1,_0x36d144;_0x335df7=_['merge']({},_0x335df7,_0x5b75ff[_0xd30a('0x41')]);return db[_0xd30a('0x2e')][_0xd30a('0x4d')](_0x335df7)[_0xd30a('0x22')](function(_0x5c2844){if(_0x5c2844){_0x58fc5b=_0x5c2844;return _0x5c2844[_0xd30a('0x69')]();}return null;})[_0xd30a('0x22')](function(_0x153c94){if(_0x153c94){if(!_0x153c94[_0xd30a('0x47')]){throw new db[(_0xd30a('0x6a'))][(_0xd30a('0x86'))](_0xd30a('0x87'),0x193);}_0x16eb13=_0x153c94;return db[_0xd30a('0xa2')][_0xd30a('0x6b')]({'raw':!![]});}return null;})['then'](function(_0xef892b){if(_0xef892b){_0x3c70f3=_[_0xd30a('0x6c')](_0xef892b,'id');var _0x577671;var _0x589920=squel[_0xd30a('0x6d')]();_0x589920[_0xd30a('0x88')](_0x58fc5b[_0xd30a('0x6e')]);for(var _0x2d5c42=0x0;_0x2d5c42<_0x16eb13[_0xd30a('0x47')];_0x2d5c42+=0x1){_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x6f')]?_0x3c70f3[_0x16eb13[_0x2d5c42][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x16eb13[_0x2d5c42][_0xd30a('0x71')];_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x73')]?_[_0xd30a('0x72')](_0x34d7bf[_0x16eb13[_0x2d5c42][_0xd30a('0x73')]],'%s',_0x577671):_0x577671;_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x89')]?_[_0xd30a('0x72')](_0x4d1ba6[_0x16eb13[_0x2d5c42][_0xd30a('0x89')]],'%s',_0x577671):_0x577671;if(_0x16eb13[_0x2d5c42]['groupBy']){_0x589920[_0xd30a('0x66')](_0x577671);}_0x16eb13[_0x2d5c42][_0xd30a('0x75')]&&_0x589920[_0xd30a('0x3a')](_0x577671,_0x16eb13[_0x2d5c42]['orderBy']===_0xd30a('0x76')?![]:!![]);_0x589920[_0xd30a('0x71')](_0x577671,_0x16eb13[_0x2d5c42][_0xd30a('0x77')]||_0x577671);}if(_0x58fc5b[_0xd30a('0x78')]){_0x58fc5b[_0xd30a('0x78')]=JSON[_0xd30a('0x7d')](_0x58fc5b['joins']);for(var _0x232cf5=0x0;_0x232cf5<_0x58fc5b['joins'][_0xd30a('0x47')];_0x232cf5+=0x1){if(_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x31')]&&_[_0xd30a('0x8a')](_0x557f06,_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['type'])&&_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x79')]&&_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x7a')]&&_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7b')]){_0x589920[_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x31')]](_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['foreignTable'],null,util[_0xd30a('0x89')](_0xd30a('0xa3'),_0x58fc5b[_0xd30a('0x6e')],_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['parentKey'],_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7a')],_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7b')]));}}}if(_0x58fc5b[_0xd30a('0x7c')]){_0x58fc5b['conditions']=JSON[_0xd30a('0x7d')](_0x58fc5b['conditions']);_0x589920[_0xd30a('0x3c')](_0x50b1de(_0x58fc5b[_0xd30a('0x7c')][_0xd30a('0x66')]));}_0x36d144=_0x589920[_0xd30a('0x7e')]();_0x589920[_0xd30a('0x1a')](_0x7e67a1);_0x589920[_0xd30a('0x19')](0x0);logger[_0xd30a('0xa4')](_0xd30a('0x7f'),_0x589920[_0xd30a('0x80')]());return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x589920[_0xd30a('0x80')](),{'type':dbH[_0xd30a('0x81')][_0xd30a('0x82')]['SELECT']});}})[_0xd30a('0x22')](function(){return{'sql':_0x36d144[_0xd30a('0x80')]()};})[_0xd30a('0x22')](respondWithResult(_0x5e2d36,null))[_0xd30a('0x45')](handleError(_0x5e2d36,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index b7a2150..3e05ea4 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 _0x1869=['analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport'];(function(_0x4785f4,_0xa0c5a9){var _0x15872c=function(_0x3bb39d){while(--_0x3bb39d){_0x4785f4['push'](_0x4785f4['shift']());}};_0x15872c(++_0xa0c5a9);}(_0x1869,0x9d));var _0x9186=function(_0x1e188c,_0x5d81aa){_0x1e188c=_0x1e188c-0x0;var _0x37b334=_0x1869[_0x1e188c];return _0x37b334;};'use strict';var _=require(_0x9186('0x0'));var util=require('util');var logger=require(_0x9186('0x1'))(_0x9186('0x2'));var moment=require(_0x9186('0x3'));var BPromise=require(_0x9186('0x4'));var rp=require(_0x9186('0x5'));var fs=require('fs');var path=require(_0x9186('0x6'));var rimraf=require('rimraf');var config=require(_0x9186('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x9186('0x8')]=function(_0x276863,_0x48a65b){return _0x276863[_0x9186('0x9')](_0x9186('0xa'),attributes,{'tableName':_0x9186('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee25=['analytics_custom_reports','lodash','util','api','moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xee25,0x1b1));var _0x5ee2=function(_0x3026ed,_0x1baae0){_0x3026ed=_0x3026ed-0x0;var _0x7c98a8=_0xee25[_0x3026ed];return _0x7c98a8;};'use strict';var _=require(_0x5ee2('0x0'));var util=require(_0x5ee2('0x1'));var logger=require('../../config/logger')(_0x5ee2('0x2'));var moment=require(_0x5ee2('0x3'));var BPromise=require(_0x5ee2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ee2('0x5'));var rimraf=require(_0x5ee2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5ee2('0x7'));module[_0x5ee2('0x8')]=function(_0x97060a,_0x1c148c){return _0x97060a[_0x5ee2('0x9')](_0x5ee2('0xa'),attributes,{'tableName':_0x5ee2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 2071d72..4a0faab 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 _0x3601=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x5490f8,_0x3e2a7b){var _0x269782=function(_0x5ddb27){while(--_0x5ddb27){_0x5490f8['push'](_0x5490f8['shift']());}};_0x269782(++_0x3e2a7b);}(_0x3601,0x10d));var _0x1360=function(_0x52376f,_0x229438){_0x52376f=_0x52376f-0x0;var _0x343fa5=_0x3601[_0x52376f];return _0x343fa5;};'use strict';var _=require(_0x1360('0x0'));var util=require('util');var moment=require(_0x1360('0x1'));var BPromise=require('bluebird');var rs=require(_0x1360('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1360('0x3'))['db'];var utils=require(_0x1360('0x4'));var logger=require(_0x1360('0x5'))(_0x1360('0x6'));var config=require(_0x1360('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1360('0x8')][_0x1360('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19724f,_0x2ee164,_0x51d0f1){return new BPromise(function(_0x19cea2,_0x1705de){return client['request'](_0x19724f,_0x51d0f1)[_0x1360('0xa')](function(_0x1de9bd){logger[_0x1360('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2ee164,_0x1360('0xc'));logger[_0x1360('0xd')](_0x1360('0xe'),_0x2ee164,'request\x20sent',JSON[_0x1360('0xf')](_0x1de9bd));if(_0x1de9bd[_0x1360('0x10')]){if(_0x1de9bd['error']['code']===0x1f4){logger['error'](_0x1360('0x11'),_0x2ee164,_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);return _0x1705de(_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);}logger['error'](_0x1360('0x11'),_0x2ee164,_0x1de9bd['error']['message']);return _0x19cea2(_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);}else{logger[_0x1360('0xb')](_0x1360('0x11'),_0x2ee164,'request\x20sent');_0x19cea2(_0x1de9bd[_0x1360('0x13')][_0x1360('0x12')]);}})[_0x1360('0x14')](function(_0x193f23){logger[_0x1360('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2ee164,_0x193f23);_0x1705de(_0x193f23);});});}
\ No newline at end of file
+var _0xdc18=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdc18,0xd0));var _0x8dc1=function(_0x37f036,_0x55a7bf){_0x37f036=_0x37f036-0x0;var _0x4bfd21=_0xdc18[_0x37f036];return _0x4bfd21;};'use strict';var _=require(_0x8dc1('0x0'));var util=require('util');var moment=require(_0x8dc1('0x1'));var BPromise=require(_0x8dc1('0x2'));var rs=require(_0x8dc1('0x3'));var fs=require('fs');var Redis=require(_0x8dc1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8dc1('0x5'))(_0x8dc1('0x6'));var config=require(_0x8dc1('0x7'));var jayson=require(_0x8dc1('0x8'));var client=jayson[_0x8dc1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4763d3,_0x2eef60,_0xa3cc0d){return new BPromise(function(_0x274ca0,_0x133ce6){return client[_0x8dc1('0xa')](_0x4763d3,_0xa3cc0d)[_0x8dc1('0xb')](function(_0x8567e7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x8dc1('0xc'));logger[_0x8dc1('0xd')](_0x8dc1('0xe'),_0x2eef60,'request\x20sent',JSON[_0x8dc1('0xf')](_0x8567e7));if(_0x8567e7[_0x8dc1('0x10')]){if(_0x8567e7[_0x8dc1('0x10')]['code']===0x1f4){logger['error'](_0x8dc1('0x11'),_0x2eef60,_0x8567e7[_0x8dc1('0x10')]['message']);return _0x133ce6(_0x8567e7[_0x8dc1('0x10')][_0x8dc1('0x12')]);}logger[_0x8dc1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x8567e7[_0x8dc1('0x10')][_0x8dc1('0x12')]);return _0x274ca0(_0x8567e7[_0x8dc1('0x10')]['message']);}else{logger['info'](_0x8dc1('0x11'),_0x2eef60,_0x8dc1('0xc'));_0x274ca0(_0x8567e7[_0x8dc1('0x13')][_0x8dc1('0x12')]);}})[_0x8dc1('0x14')](function(_0x2c8513){logger[_0x8dc1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x2c8513);_0x133ce6(_0x2c8513);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 3a3805e..9c483b8 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 _0xee47=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','create','put','update','delete','destroy','util','express','Router'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xee47,0x1dd));var _0x7ee4=function(_0x4ae461,_0x32f69f){_0x4ae461=_0x4ae461-0x0;var _0x5c86c3=_0xee47[_0x4ae461];return _0x5c86c3;};'use strict';var multer=require('multer');var util=require(_0x7ee4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7ee4('0x1'));var router=express[_0x7ee4('0x2')]();var fs_extra=require(_0x7ee4('0x3'));var auth=require(_0x7ee4('0x4'));var interaction=require(_0x7ee4('0x5'));var config=require(_0x7ee4('0x6'));var controller=require(_0x7ee4('0x7'));router[_0x7ee4('0x8')]('/',auth[_0x7ee4('0x9')](),controller['index']);router['get'](_0x7ee4('0xa'),auth['isAuthenticated'](),controller[_0x7ee4('0xb')]);router[_0x7ee4('0x8')](_0x7ee4('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0x7ee4('0x8')](_0x7ee4('0xd'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0xe')]);router[_0x7ee4('0x8')]('/:id/query',auth[_0x7ee4('0x9')](),controller['query']);router['post']('/',auth[_0x7ee4('0x9')](),controller[_0x7ee4('0xf')]);router[_0x7ee4('0x10')](_0x7ee4('0xa'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0x11')]);router[_0x7ee4('0x12')](_0x7ee4('0xa'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7258=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7258,0x17a));var _0x8725=function(_0x16f248,_0x4ec807){_0x16f248=_0x16f248-0x0;var _0x537197=_0x7258[_0x16f248];return _0x537197;};'use strict';var multer=require(_0x8725('0x0'));var util=require(_0x8725('0x1'));var path=require(_0x8725('0x2'));var timeout=require(_0x8725('0x3'));var express=require(_0x8725('0x4'));var router=express['Router']();var fs_extra=require(_0x8725('0x5'));var auth=require(_0x8725('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8725('0x7'));var controller=require(_0x8725('0x8'));router[_0x8725('0x9')]('/',auth[_0x8725('0xa')](),controller['index']);router[_0x8725('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8725('0xb')]);router[_0x8725('0x9')](_0x8725('0xc'),auth[_0x8725('0xa')](),controller[_0x8725('0xd')]);router[_0x8725('0x9')](_0x8725('0xe'),auth[_0x8725('0xa')](),controller[_0x8725('0xf')]);router[_0x8725('0x9')](_0x8725('0x10'),auth[_0x8725('0xa')](),controller[_0x8725('0x11')]);router[_0x8725('0x12')]('/',auth[_0x8725('0xa')](),controller['create']);router[_0x8725('0x13')](_0x8725('0x14'),auth['isAuthenticated'](),controller[_0x8725('0x15')]);router[_0x8725('0x16')]('/:id',auth[_0x8725('0xa')](),controller[_0x8725('0x17')]);module[_0x8725('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 1d87a19..3f56e2c 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 _0x8958=['TEXT','exports'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x8958,0x93));var _0x8895=function(_0x3a9f80,_0x51a873){_0x3a9f80=_0x3a9f80-0x0;var _0x5a68ab=_0x8958[_0x3a9f80];return _0x5a68ab;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x40c49c,_0x2c97c6){var _0x8f4fb4=function(_0xd6cf3b){while(--_0xd6cf3b){_0x40c49c['push'](_0x40c49c['shift']());}};_0x8f4fb4(++_0x2c97c6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x5fc3[_0x5a26f5];return _0x2e9ef7;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index af6de47..a96d3b7 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x243d9e,_0x2a7490){var _0x329a57=function(_0x16788f){while(--_0x16788f){_0x243d9e['push'](_0x243d9e['shift']());}};_0x329a57(++_0x2a7490);}(_0x4975,0x86));var _0x5497=function(_0x2b1745,_0x536156){_0x2b1745=_0x2b1745-0x0;var _0x5169c9=_0x4975[_0x2b1745];return _0x5169c9;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x561fc8,_0x37336a){var _0x9a413e=function(_0x5b395a){while(--_0x5b395a){_0x561fc8['push'](_0x561fc8['shift']());}};_0x9a413e(++_0x37336a);}(_0x0295,0x1f0));var _0x5029=function(_0xa62a6b,_0x50f390){_0xa62a6b=_0xa62a6b-0x0;var _0x57380b=_0x0295[_0xa62a6b];return _0x57380b;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 56b6c99..4998cdc 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 _0x2c1d=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','util'];(function(_0x338367,_0xc2ed00){var _0x5ee2b4=function(_0x34968f){while(--_0x34968f){_0x338367['push'](_0x338367['shift']());}};_0x5ee2b4(++_0xc2ed00);}(_0x2c1d,0x6a));var _0xd2c1=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x2c1d[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xd2c1('0x0'));var util=require(_0xd2c1('0x1'));var logger=require('../../config/logger')(_0xd2c1('0x2'));var moment=require('moment');var BPromise=require(_0xd2c1('0x3'));var rp=require(_0xd2c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2c1('0x5'));var config=require(_0xd2c1('0x6'));var attributes=require(_0xd2c1('0x7'));module[_0xd2c1('0x8')]=function(_0x3adf48,_0x5997e3){return _0x3adf48['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ea4=['AnalyticDefaultReport','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x4ea4,0x16c));var _0x44ea=function(_0xf466fc,_0xe6b550){_0xf466fc=_0xf466fc-0x0;var _0x1e6330=_0x4ea4[_0xf466fc];return _0x1e6330;};'use strict';var _=require(_0x44ea('0x0'));var util=require('util');var logger=require(_0x44ea('0x1'))('api');var moment=require(_0x44ea('0x2'));var BPromise=require(_0x44ea('0x3'));var rp=require(_0x44ea('0x4'));var fs=require('fs');var path=require(_0x44ea('0x5'));var rimraf=require(_0x44ea('0x6'));var config=require('../../config/environment');var attributes=require(_0x44ea('0x7'));module[_0x44ea('0x8')]=function(_0x20d8f4,_0x9380d9){return _0x20d8f4[_0x44ea('0x9')](_0x44ea('0xa'),attributes,{'tableName':'analytics_default_reports','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 6d5a670..b83ffee 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 _0xd600=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x474fc5,_0x341734){var _0x629fcd=function(_0x1addb6){while(--_0x1addb6){_0x474fc5['push'](_0x474fc5['shift']());}};_0x629fcd(++_0x341734);}(_0xd600,0x14f));var _0x0d60=function(_0x27e5f2,_0x1461bc){_0x27e5f2=_0x27e5f2-0x0;var _0x4369f4=_0xd600[_0x27e5f2];return _0x4369f4;};'use strict';var _=require(_0x0d60('0x0'));var util=require(_0x0d60('0x1'));var moment=require('moment');var BPromise=require(_0x0d60('0x2'));var rs=require(_0x0d60('0x3'));var fs=require('fs');var Redis=require(_0x0d60('0x4'));var db=require(_0x0d60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d60('0x6'))(_0x0d60('0x7'));var config=require(_0x0d60('0x8'));var jayson=require(_0x0d60('0x9'));var client=jayson[_0x0d60('0xa')][_0x0d60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166373,_0xebc01,_0x456229){return new BPromise(function(_0xffcba8,_0x5e6be4){return client['request'](_0x166373,_0x456229)[_0x0d60('0xc')](function(_0x580f09){logger[_0x0d60('0xd')](_0x0d60('0xe'),_0xebc01,_0x0d60('0xf'));logger['debug'](_0x0d60('0x10'),_0xebc01,_0x0d60('0xf'),JSON[_0x0d60('0x11')](_0x580f09));if(_0x580f09[_0x0d60('0x12')]){if(_0x580f09[_0x0d60('0x12')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xebc01,_0x580f09['error'][_0x0d60('0x13')]);return _0x5e6be4(_0x580f09['error']['message']);}logger[_0x0d60('0x12')](_0x0d60('0xe'),_0xebc01,_0x580f09['error']['message']);return _0xffcba8(_0x580f09[_0x0d60('0x12')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0xebc01,'request\x20sent');_0xffcba8(_0x580f09[_0x0d60('0x14')][_0x0d60('0x13')]);}})[_0x0d60('0x15')](function(_0x189540){logger['error'](_0x0d60('0xe'),_0xebc01,_0x189540);_0x5e6be4(_0x189540);});});}
\ No newline at end of file
+var _0xf9db=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9db,0x16c));var _0xbf9d=function(_0x429821,_0x16d603){_0x429821=_0x429821-0x0;var _0x36e9b6=_0xf9db[_0x429821];return _0x36e9b6;};'use strict';var _=require(_0xbf9d('0x0'));var util=require(_0xbf9d('0x1'));var moment=require('moment');var BPromise=require(_0xbf9d('0x2'));var rs=require(_0xbf9d('0x3'));var fs=require('fs');var Redis=require(_0xbf9d('0x4'));var db=require(_0xbf9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf9d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf9d('0x7')][_0xbf9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f741d,_0x1ee0a1,_0x28bc66){return new BPromise(function(_0x5a80db,_0x3af10a){return client[_0xbf9d('0x9')](_0x2f741d,_0x28bc66)[_0xbf9d('0xa')](function(_0x35e380){logger[_0xbf9d('0xb')](_0xbf9d('0xc'),_0x1ee0a1,_0xbf9d('0xd'));logger[_0xbf9d('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1ee0a1,_0xbf9d('0xd'),JSON['stringify'](_0x35e380));if(_0x35e380[_0xbf9d('0xf')]){if(_0x35e380['error'][_0xbf9d('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ee0a1,_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);return _0x3af10a(_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);}logger[_0xbf9d('0xf')](_0xbf9d('0xc'),_0x1ee0a1,_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);return _0x5a80db(_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);}else{logger[_0xbf9d('0xb')](_0xbf9d('0xc'),_0x1ee0a1,_0xbf9d('0xd'));_0x5a80db(_0x35e380[_0xbf9d('0x12')]['message']);}})[_0xbf9d('0x13')](function(_0x1a0b2f){logger['error'](_0xbf9d('0xc'),_0x1ee0a1,_0x1a0b2f);_0x3af10a(_0x1a0b2f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0a73afe..fddc8fc 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 _0x3a9b=['create','put','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query'];(function(_0x3f0b26,_0x90a328){var _0x230931=function(_0x3f8d23){while(--_0x3f8d23){_0x3f0b26['push'](_0x3f0b26['shift']());}};_0x230931(++_0x90a328);}(_0x3a9b,0x10d));var _0xb3a9=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x3a9b[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0xb3a9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb3a9('0x1'));var express=require(_0xb3a9('0x2'));var router=express[_0xb3a9('0x3')]();var fs_extra=require(_0xb3a9('0x4'));var auth=require(_0xb3a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3a9('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xb3a9('0x7')]('/',auth[_0xb3a9('0x8')](),controller[_0xb3a9('0x9')]);router['get'](_0xb3a9('0xa'),auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xb')]);router['get']('/:id/preview',auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xc')]);router[_0xb3a9('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0xb3a9('0xd')]);router[_0xb3a9('0x7')](_0xb3a9('0xe'),auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3a9('0x10')]);router[_0xb3a9('0x11')](_0xb3a9('0xa'),auth[_0xb3a9('0x8')](),controller['update']);router['delete'](_0xb3a9('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb3a9('0x12')]=router;
\ No newline at end of file
+var _0xaefd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','multer','util'];(function(_0x373925,_0x57badd){var _0x305525=function(_0x3249f1){while(--_0x3249f1){_0x373925['push'](_0x373925['shift']());}};_0x305525(++_0x57badd);}(_0xaefd,0x1c6));var _0xdaef=function(_0x462fc9,_0x355e35){_0x462fc9=_0x462fc9-0x0;var _0x240ef1=_0xaefd[_0x462fc9];return _0x240ef1;};'use strict';var multer=require(_0xdaef('0x0'));var util=require(_0xdaef('0x1'));var path=require(_0xdaef('0x2'));var timeout=require(_0xdaef('0x3'));var express=require(_0xdaef('0x4'));var router=express[_0xdaef('0x5')]();var fs_extra=require(_0xdaef('0x6'));var auth=require(_0xdaef('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdaef('0x8'));var controller=require(_0xdaef('0x9'));router[_0xdaef('0xa')]('/',auth[_0xdaef('0xb')](),controller['index']);router[_0xdaef('0xa')](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller[_0xdaef('0xd')]);router[_0xdaef('0xa')](_0xdaef('0xe'),auth['isAuthenticated'](),controller[_0xdaef('0xf')]);router[_0xdaef('0xa')](_0xdaef('0x10'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x11')]);router['get'](_0xdaef('0x12'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x13')]);router[_0xdaef('0x14')]('/',auth[_0xdaef('0xb')](),controller[_0xdaef('0x15')]);router[_0xdaef('0x16')](_0xdaef('0xc'),auth['isAuthenticated'](),controller[_0xdaef('0x17')]);router['delete'](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller['destroy']);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 bdb0ccf..74b0b2e 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 _0x2120=['xlsx','csv','DATE','Loading','scheduled','manual','INTEGER','sequelize','moment','STRING','ENUM','pdf'];(function(_0x23c0f1,_0x1d6ce8){var _0x3c735d=function(_0x182530){while(--_0x182530){_0x23c0f1['push'](_0x23c0f1['shift']());}};_0x3c735d(++_0x1d6ce8);}(_0x2120,0x67));var _0x0212=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x2120[_0x1d5400];return _0x21d9fe;};'use strict';var Sequelize=require(_0x0212('0x0'));var moment=require(_0x0212('0x1'));module['exports']={'name':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0212('0x3')]('csv',_0x0212('0x4'),_0x0212('0x5')),'allowNull':![],'defaultValue':_0x0212('0x6')},'savename':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0212('0x7')]},'endDate':{'type':Sequelize[_0x0212('0x7')]},'status':{'type':Sequelize[_0x0212('0x2')],'defaultValue':_0x0212('0x8')},'type':{'type':Sequelize[_0x0212('0x3')]('manual',_0x0212('0x9')),'allowNull':![],'defaultValue':_0x0212('0xa')},'reportId':{'type':Sequelize[_0x0212('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0212('0x2')]}};
\ No newline at end of file
+var _0xb9ff=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x170adf,_0x377b82){var _0x4944d9=function(_0x19e95c){while(--_0x19e95c){_0x170adf['push'](_0x170adf['shift']());}};_0x4944d9(++_0x377b82);}(_0xb9ff,0xc9));var _0xfb9f=function(_0x2cc79d,_0x3e8cec){_0x2cc79d=_0x2cc79d-0x0;var _0x2fbf42=_0xb9ff[_0x2cc79d];return _0x2fbf42;};'use strict';var Sequelize=require(_0xfb9f('0x0'));var moment=require(_0xfb9f('0x1'));module[_0xfb9f('0x2')]={'name':{'type':Sequelize[_0xfb9f('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0x5'),_0xfb9f('0x6'),_0xfb9f('0x7')),'allowNull':![],'defaultValue':_0xfb9f('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xfb9f('0x8')]},'status':{'type':Sequelize[_0xfb9f('0x3')],'defaultValue':_0xfb9f('0x9')},'type':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0xa'),_0xfb9f('0xb')),'allowNull':![],'defaultValue':_0xfb9f('0xa')},'reportId':{'type':Sequelize[_0xfb9f('0xc')](0xb)[_0xfb9f('0xd')]},'reportType':{'type':Sequelize[_0xfb9f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 61aff2a..3b7d643 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 _0xc4c7=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','intersection','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x282e7a,_0x36d4ed){var _0x1395cc=function(_0x237653){while(--_0x237653){_0x282e7a['push'](_0x282e7a['shift']());}};_0x1395cc(++_0x36d4ed);}(_0xc4c7,0x10a));var _0x7c4c=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xc4c7[_0x1f7996];return _0x584609;};'use strict';var emlformat=require(_0x7c4c('0x0'));var rimraf=require(_0x7c4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c4c('0x2'));var rp=require(_0x7c4c('0x3'));var moment=require('moment');var BPromise=require(_0x7c4c('0x4'));var Mustache=require(_0x7c4c('0x5'));var util=require(_0x7c4c('0x6'));var path=require('path');var sox=require(_0x7c4c('0x7'));var csv=require('to-csv');var ejs=require(_0x7c4c('0x8'));var fs=require('fs');var fs_extra=require(_0x7c4c('0x9'));var _=require(_0x7c4c('0xa'));var squel=require(_0x7c4c('0xb'));var crypto=require(_0x7c4c('0xc'));var jsforce=require(_0x7c4c('0xd'));var deskjs=require(_0x7c4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7c4c('0xf'));var Papa=require(_0x7c4c('0x10'));var Redis=require(_0x7c4c('0x11'));var authService=require(_0x7c4c('0x12'));var qs=require(_0x7c4c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c4c('0x14'));var logger=require(_0x7c4c('0x15'))(_0x7c4c('0x16'));var utils=require(_0x7c4c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7c4c('0x18'))['db'];function respondWithStatusCode(_0x31cb3b,_0x201692){_0x201692=_0x201692||0xcc;return function(_0x8499e9){if(_0x8499e9){return _0x31cb3b[_0x7c4c('0x19')](_0x201692);}return _0x31cb3b['status'](_0x201692)[_0x7c4c('0x1a')]();};}function respondWithResult(_0x37e59e,_0x17d1bf){_0x17d1bf=_0x17d1bf||0xc8;return function(_0x481418){if(_0x481418){return _0x37e59e[_0x7c4c('0x1b')](_0x17d1bf)[_0x7c4c('0x1c')](_0x481418);}};}function respondWithFilteredResult(_0x1c55f6,_0xb76f69){return function(_0x1680ef){if(_0x1680ef){var _0x2621b6=typeof _0xb76f69[_0x7c4c('0x1d')]===_0x7c4c('0x1e')&&typeof _0xb76f69[_0x7c4c('0x1f')]==='undefined';var _0x7ce384=_0x1680ef[_0x7c4c('0x20')];var _0x3d24c2=_0x2621b6?0x0:_0xb76f69['offset'];var _0x32e4d8=_0x2621b6?_0x1680ef[_0x7c4c('0x20')]:_0xb76f69[_0x7c4c('0x1d')]+_0xb76f69[_0x7c4c('0x1f')];var _0x2afb27;if(_0x32e4d8>=_0x7ce384){_0x32e4d8=_0x7ce384;_0x2afb27=0xc8;}else{_0x2afb27=0xce;}_0x1c55f6[_0x7c4c('0x1b')](_0x2afb27);return _0x1c55f6[_0x7c4c('0x21')](_0x7c4c('0x22'),_0x3d24c2+'-'+_0x32e4d8+'/'+_0x7ce384)[_0x7c4c('0x1c')](_0x1680ef);}return null;};}function patchUpdates(_0x2a7352){return function(_0x1adda2){try{jsonpatch['apply'](_0x1adda2,_0x2a7352,!![]);}catch(_0x1d6039){return BPromise[_0x7c4c('0x23')](_0x1d6039);}return _0x1adda2[_0x7c4c('0x24')]();};}function saveUpdates(_0x1cd863,_0x3935e5){return function(_0x1637eb){if(_0x1637eb){return _0x1637eb[_0x7c4c('0x25')](_0x1cd863)['then'](function(_0x100233){return _0x100233;});}return null;};}function removeEntity(_0x4fd0ea,_0x412783){return function(_0xff5941){if(_0xff5941){return _0xff5941[_0x7c4c('0x26')]()[_0x7c4c('0x27')](function(){var _0x260b64=_0xff5941[_0x7c4c('0x28')]({'plain':!![]});var _0x51a624=_0x7c4c('0x29');return db[_0x7c4c('0x2a')]['destroy']({'where':{'type':_0x51a624,'resourceId':_0x260b64['id']}})[_0x7c4c('0x27')](function(){return _0xff5941;});})[_0x7c4c('0x27')](function(){_0x4fd0ea[_0x7c4c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ba37,_0x589e86){return function(_0x272dff){if(!_0x272dff){_0x47ba37['sendStatus'](0x194);}return _0x272dff;};}function handleError(_0x1d05cf,_0x4c52b7){_0x4c52b7=_0x4c52b7||0x1f4;return function(_0x1ddf7e){logger['error'](_0x1ddf7e[_0x7c4c('0x2b')]);if(_0x1ddf7e['name']){delete _0x1ddf7e[_0x7c4c('0x2c')];}_0x1d05cf[_0x7c4c('0x1b')](_0x4c52b7)[_0x7c4c('0x2d')](_0x1ddf7e);};}exports[_0x7c4c('0x2e')]=function(_0x50d6c5,_0x5c5cee){var _0x53af88={},_0xc332cd={},_0x3c72b9={'count':0x0,'rows':[]};var _0x495b00=_[_0x7c4c('0x2f')](db[_0x7c4c('0x30')]['rawAttributes'],function(_0x52d93a){return{'name':_0x52d93a[_0x7c4c('0x31')],'type':_0x52d93a['type'][_0x7c4c('0x32')]};});_0xc332cd[_0x7c4c('0x33')]=_[_0x7c4c('0x2f')](_0x495b00,'name');_0xc332cd[_0x7c4c('0x34')]=_['keys'](_0x50d6c5[_0x7c4c('0x34')]);_0xc332cd[_0x7c4c('0x35')]=_['intersection'](_0xc332cd['model'],_0xc332cd[_0x7c4c('0x34')]);_0x53af88['attributes']=_['intersection'](_0xc332cd[_0x7c4c('0x33')],qs['fields'](_0x50d6c5['query'][_0x7c4c('0x36')]));_0x53af88[_0x7c4c('0x37')]=_0x53af88[_0x7c4c('0x37')][_0x7c4c('0x38')]?_0x53af88[_0x7c4c('0x37')]:_0xc332cd[_0x7c4c('0x33')];if(!_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x39')](_0x7c4c('0x3a'))){_0x53af88['limit']=qs[_0x7c4c('0x1f')](_0x50d6c5['query'][_0x7c4c('0x1f')]);_0x53af88['offset']=qs['offset'](_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x1d')]);}_0x53af88[_0x7c4c('0x3b')]=qs['sort'](_0x50d6c5['query']['sort']);_0x53af88[_0x7c4c('0x3c')]=qs[_0x7c4c('0x35')](_['pick'](_0x50d6c5[_0x7c4c('0x34')],_0xc332cd['filters']),_0x495b00);if(_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x3d')]){_0x53af88['where']=_['merge'](_0x53af88[_0x7c4c('0x3c')],{'$or':_[_0x7c4c('0x2f')](_0x495b00,function(_0x580f5f){if(_0x580f5f[_0x7c4c('0x3e')]!==_0x7c4c('0x3f')){var _0x1ca99c={};_0x1ca99c[_0x580f5f[_0x7c4c('0x2c')]]={'$like':'%'+_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x3d')]+'%'};return _0x1ca99c;}})});}_0x53af88=_['merge']({},_0x53af88,_0x50d6c5[_0x7c4c('0x40')]);var _0x1b6cad={'where':_0x53af88[_0x7c4c('0x3c')]};return db['AnalyticExtractedReport'][_0x7c4c('0x20')](_0x1b6cad)['then'](function(_0xc3ef1b){_0x3c72b9[_0x7c4c('0x20')]=_0xc3ef1b;if(_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x41')]){_0x53af88[_0x7c4c('0x42')]=[{'all':!![]}];}return db[_0x7c4c('0x30')][_0x7c4c('0x43')](_0x53af88);})['then'](function(_0x13b198){_0x3c72b9[_0x7c4c('0x44')]=_0x13b198;return _0x3c72b9;})[_0x7c4c('0x27')](respondWithFilteredResult(_0x5c5cee,_0x53af88))['catch'](handleError(_0x5c5cee,null));};exports['show']=function(_0x54abe7,_0x221638){var _0xbcd13b={'raw':!![],'where':{'id':_0x54abe7[_0x7c4c('0x45')]['id']}},_0x1bd9dd={};_0x1bd9dd[_0x7c4c('0x33')]=_[_0x7c4c('0x46')](db[_0x7c4c('0x30')][_0x7c4c('0x47')]);_0x1bd9dd[_0x7c4c('0x34')]=_[_0x7c4c('0x46')](_0x54abe7[_0x7c4c('0x34')]);_0x1bd9dd[_0x7c4c('0x35')]=_[_0x7c4c('0x48')](_0x1bd9dd[_0x7c4c('0x33')],_0x1bd9dd['query']);_0xbcd13b[_0x7c4c('0x37')]=_[_0x7c4c('0x48')](_0x1bd9dd[_0x7c4c('0x33')],qs[_0x7c4c('0x36')](_0x54abe7[_0x7c4c('0x34')][_0x7c4c('0x36')]));_0xbcd13b[_0x7c4c('0x37')]=_0xbcd13b[_0x7c4c('0x37')][_0x7c4c('0x38')]?_0xbcd13b[_0x7c4c('0x37')]:_0x1bd9dd['model'];if(_0x54abe7[_0x7c4c('0x34')][_0x7c4c('0x41')]){_0xbcd13b[_0x7c4c('0x42')]=[{'all':!![]}];}_0xbcd13b=_['merge']({},_0xbcd13b,_0x54abe7[_0x7c4c('0x40')]);return db['AnalyticExtractedReport'][_0x7c4c('0x49')](_0xbcd13b)['then'](handleEntityNotFound(_0x221638,null))[_0x7c4c('0x27')](respondWithResult(_0x221638,null))[_0x7c4c('0x4a')](handleError(_0x221638,null));};exports['create']=function(_0x156be7,_0x26fc0f){return db[_0x7c4c('0x30')][_0x7c4c('0x4b')](_0x156be7['body'],{})[_0x7c4c('0x27')](function(_0x4f9630){var _0x36e9c7=_0x156be7[_0x7c4c('0x4c')]['get']({'plain':!![]});if(!_0x36e9c7)throw new Error(_0x7c4c('0x4d'));if(_0x36e9c7[_0x7c4c('0x4e')]===_0x7c4c('0x4c')){var _0x4f3eea=_0x4f9630['get']({'plain':!![]});var _0x5e8f55='ExtractedReports';return db[_0x7c4c('0x4f')]['find']({'where':{'name':_0x5e8f55,'userProfileId':_0x36e9c7[_0x7c4c('0x50')]},'raw':!![]})[_0x7c4c('0x27')](function(_0x4f3fb6){if(_0x4f3fb6&&_0x4f3fb6['autoAssociation']===0x0){return db[_0x7c4c('0x2a')]['create']({'name':_0x4f3eea[_0x7c4c('0x2c')],'resourceId':_0x4f3eea['id'],'type':_0x4f3fb6[_0x7c4c('0x2c')],'sectionId':_0x4f3fb6['id']},{})[_0x7c4c('0x27')](function(){return _0x4f9630;});}else{return _0x4f9630;}})[_0x7c4c('0x4a')](function(_0x410b92){logger[_0x7c4c('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x410b92);throw _0x410b92;});}return _0x4f9630;})[_0x7c4c('0x27')](respondWithResult(_0x26fc0f,0xc9))[_0x7c4c('0x4a')](handleError(_0x26fc0f,null));};exports[_0x7c4c('0x25')]=function(_0x342015,_0x29e2e6){if(_0x342015[_0x7c4c('0x52')]['id']){delete _0x342015[_0x7c4c('0x52')]['id'];}return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x342015[_0x7c4c('0x45')]['id']}})['then'](handleEntityNotFound(_0x29e2e6,null))[_0x7c4c('0x27')](saveUpdates(_0x342015[_0x7c4c('0x52')],null))[_0x7c4c('0x27')](respondWithResult(_0x29e2e6,null))['catch'](handleError(_0x29e2e6,null));};exports[_0x7c4c('0x26')]=function(_0x44b15b,_0x5b8afd){return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x44b15b['params']['id']}})[_0x7c4c('0x27')](handleEntityNotFound(_0x5b8afd,null))['then'](removeEntity(_0x5b8afd,null))[_0x7c4c('0x4a')](handleError(_0x5b8afd,null));};exports['download']=function(_0x2184eb,_0x191930,_0x117b47){return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x2184eb[_0x7c4c('0x45')]['id']},'attributes':[_0x7c4c('0x2c'),_0x7c4c('0x53'),_0x7c4c('0x54'),_0x7c4c('0x55')],'raw':!![]})[_0x7c4c('0x27')](handleEntityNotFound(_0x191930,null))[_0x7c4c('0x27')](function(_0x33bc93){if(_0x33bc93){if(!fs[_0x7c4c('0x56')](path[_0x7c4c('0x57')](config[_0x7c4c('0x58')],_0x7c4c('0x59'),_0x33bc93[_0x7c4c('0x54')]))){throw new db[(_0x7c4c('0x5a'))][(_0x7c4c('0x5b'))](_0x7c4c('0x5c'));}if(_0x2184eb[_0x7c4c('0x34')]['exists']){return _0x191930[_0x7c4c('0x19')](0xc8);}return _0x191930[_0x7c4c('0x5d')](path[_0x7c4c('0x57')](config[_0x7c4c('0x58')],_0x7c4c('0x59'),_0x33bc93['savename']),util[_0x7c4c('0x5e')]('%s.%s',_0x33bc93[_0x7c4c('0x53')]||_0x33bc93[_0x7c4c('0x2c')],_0x33bc93[_0x7c4c('0x55')]['toLowerCase']()));}})[_0x7c4c('0x4a')](handleError(_0x191930,null));};
\ No newline at end of file
+var _0xce3b=['AnalyticExtractedReport','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','send','index','map'];(function(_0x23c550,_0x7e41c4){var _0x5635b1=function(_0x68f9ce){while(--_0x68f9ce){_0x23c550['push'](_0x23c550['shift']());}};_0x5635b1(++_0x7e41c4);}(_0xce3b,0xfd));var _0xbce3=function(_0x3edee7,_0x7f56de){_0x3edee7=_0x3edee7-0x0;var _0x58d09b=_0xce3b[_0x3edee7];return _0x58d09b;};'use strict';var emlformat=require(_0xbce3('0x0'));var rimraf=require(_0xbce3('0x1'));var zipdir=require(_0xbce3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbce3('0x3'));var Mustache=require(_0xbce3('0x4'));var util=require('util');var path=require(_0xbce3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbce3('0x6'));var fs=require('fs');var fs_extra=require(_0xbce3('0x7'));var _=require(_0xbce3('0x8'));var squel=require(_0xbce3('0x9'));var crypto=require(_0xbce3('0xa'));var jsforce=require(_0xbce3('0xb'));var deskjs=require(_0xbce3('0xc'));var toCsv=require(_0xbce3('0xd'));var querystring=require(_0xbce3('0xe'));var Papa=require(_0xbce3('0xf'));var Redis=require(_0xbce3('0x10'));var authService=require(_0xbce3('0x11'));var qs=require(_0xbce3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbce3('0x13'));var logger=require('../../config/logger')(_0xbce3('0x14'));var utils=require(_0xbce3('0x15'));var config=require(_0xbce3('0x16'));var licenseUtil=require(_0xbce3('0x17'));var db=require(_0xbce3('0x18'))['db'];function respondWithStatusCode(_0x22c033,_0x1003cd){_0x1003cd=_0x1003cd||0xcc;return function(_0x263ddb){if(_0x263ddb){return _0x22c033['sendStatus'](_0x1003cd);}return _0x22c033[_0xbce3('0x19')](_0x1003cd)[_0xbce3('0x1a')]();};}function respondWithResult(_0x55d3fa,_0x42f00f){_0x42f00f=_0x42f00f||0xc8;return function(_0x2d0cd5){if(_0x2d0cd5){return _0x55d3fa[_0xbce3('0x19')](_0x42f00f)[_0xbce3('0x1b')](_0x2d0cd5);}};}function respondWithFilteredResult(_0x3fe8bb,_0x1951a3){return function(_0x233d11){if(_0x233d11){var _0x37cfd0=typeof _0x1951a3[_0xbce3('0x1c')]===_0xbce3('0x1d')&&typeof _0x1951a3[_0xbce3('0x1e')]===_0xbce3('0x1d');var _0xf565be=_0x233d11['count'];var _0x5d0af2=_0x37cfd0?0x0:_0x1951a3['offset'];var _0x3e3bea=_0x37cfd0?_0x233d11[_0xbce3('0x1f')]:_0x1951a3[_0xbce3('0x1c')]+_0x1951a3[_0xbce3('0x1e')];var _0xfe905d;if(_0x3e3bea>=_0xf565be){_0x3e3bea=_0xf565be;_0xfe905d=0xc8;}else{_0xfe905d=0xce;}_0x3fe8bb[_0xbce3('0x19')](_0xfe905d);return _0x3fe8bb[_0xbce3('0x20')](_0xbce3('0x21'),_0x5d0af2+'-'+_0x3e3bea+'/'+_0xf565be)[_0xbce3('0x1b')](_0x233d11);}return null;};}function patchUpdates(_0x48c923){return function(_0xecee1c){try{jsonpatch[_0xbce3('0x22')](_0xecee1c,_0x48c923,!![]);}catch(_0x544a73){return BPromise[_0xbce3('0x23')](_0x544a73);}return _0xecee1c[_0xbce3('0x24')]();};}function saveUpdates(_0x5d00f4,_0x158a07){return function(_0x3d006a){if(_0x3d006a){return _0x3d006a[_0xbce3('0x25')](_0x5d00f4)[_0xbce3('0x26')](function(_0x234a52){return _0x234a52;});}return null;};}function removeEntity(_0xcebcb9,_0x4ab3ce){return function(_0x1045fe){if(_0x1045fe){return _0x1045fe[_0xbce3('0x27')]()[_0xbce3('0x26')](function(){var _0x463abb=_0x1045fe['get']({'plain':!![]});var _0x2c91c9=_0xbce3('0x28');return db[_0xbce3('0x29')][_0xbce3('0x27')]({'where':{'type':_0x2c91c9,'resourceId':_0x463abb['id']}})['then'](function(){return _0x1045fe;});})[_0xbce3('0x26')](function(){_0xcebcb9[_0xbce3('0x19')](0xcc)[_0xbce3('0x1a')]();});}};}function handleEntityNotFound(_0xfb3e37,_0x73f2ad){return function(_0x9f621b){if(!_0x9f621b){_0xfb3e37['sendStatus'](0x194);}return _0x9f621b;};}function handleError(_0x37e302,_0x54d1cd){_0x54d1cd=_0x54d1cd||0x1f4;return function(_0x48e3a7){logger[_0xbce3('0x2a')](_0x48e3a7[_0xbce3('0x2b')]);if(_0x48e3a7['name']){delete _0x48e3a7['name'];}_0x37e302[_0xbce3('0x19')](_0x54d1cd)[_0xbce3('0x2c')](_0x48e3a7);};}exports[_0xbce3('0x2d')]=function(_0x5c2115,_0x4ca805){var _0x5dabc5={},_0x7b9d63={},_0x5eccfa={'count':0x0,'rows':[]};var _0x58f2b5=_[_0xbce3('0x2e')](db[_0xbce3('0x2f')]['rawAttributes'],function(_0x23350a){return{'name':_0x23350a[_0xbce3('0x30')],'type':_0x23350a[_0xbce3('0x31')][_0xbce3('0x32')]};});_0x7b9d63[_0xbce3('0x33')]=_[_0xbce3('0x2e')](_0x58f2b5,_0xbce3('0x34'));_0x7b9d63[_0xbce3('0x35')]=_[_0xbce3('0x36')](_0x5c2115[_0xbce3('0x35')]);_0x7b9d63[_0xbce3('0x37')]=_['intersection'](_0x7b9d63[_0xbce3('0x33')],_0x7b9d63[_0xbce3('0x35')]);_0x5dabc5[_0xbce3('0x38')]=_[_0xbce3('0x39')](_0x7b9d63[_0xbce3('0x33')],qs[_0xbce3('0x3a')](_0x5c2115['query'][_0xbce3('0x3a')]));_0x5dabc5[_0xbce3('0x38')]=_0x5dabc5['attributes']['length']?_0x5dabc5[_0xbce3('0x38')]:_0x7b9d63['model'];if(!_0x5c2115['query'][_0xbce3('0x3b')](_0xbce3('0x3c'))){_0x5dabc5['limit']=qs[_0xbce3('0x1e')](_0x5c2115[_0xbce3('0x35')][_0xbce3('0x1e')]);_0x5dabc5[_0xbce3('0x1c')]=qs['offset'](_0x5c2115[_0xbce3('0x35')][_0xbce3('0x1c')]);}_0x5dabc5[_0xbce3('0x3d')]=qs['sort'](_0x5c2115[_0xbce3('0x35')]['sort']);_0x5dabc5[_0xbce3('0x3e')]=qs[_0xbce3('0x37')](_[_0xbce3('0x3f')](_0x5c2115[_0xbce3('0x35')],_0x7b9d63[_0xbce3('0x37')]),_0x58f2b5);if(_0x5c2115[_0xbce3('0x35')][_0xbce3('0x40')]){_0x5dabc5[_0xbce3('0x3e')]=_['merge'](_0x5dabc5[_0xbce3('0x3e')],{'$or':_[_0xbce3('0x2e')](_0x58f2b5,function(_0x435b9f){if(_0x435b9f['type']!==_0xbce3('0x41')){var _0xe11b38={};_0xe11b38[_0x435b9f[_0xbce3('0x34')]]={'$like':'%'+_0x5c2115[_0xbce3('0x35')][_0xbce3('0x40')]+'%'};return _0xe11b38;}})});}_0x5dabc5=_['merge']({},_0x5dabc5,_0x5c2115[_0xbce3('0x42')]);var _0x56a15c={'where':_0x5dabc5[_0xbce3('0x3e')]};return db[_0xbce3('0x2f')]['count'](_0x56a15c)['then'](function(_0x47be37){_0x5eccfa[_0xbce3('0x1f')]=_0x47be37;if(_0x5c2115[_0xbce3('0x35')][_0xbce3('0x43')]){_0x5dabc5[_0xbce3('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbce3('0x45')](_0x5dabc5);})[_0xbce3('0x26')](function(_0x2c4657){_0x5eccfa['rows']=_0x2c4657;return _0x5eccfa;})[_0xbce3('0x26')](respondWithFilteredResult(_0x4ca805,_0x5dabc5))[_0xbce3('0x46')](handleError(_0x4ca805,null));};exports[_0xbce3('0x47')]=function(_0x25dd31,_0x4fc0d4){var _0x13d4d3={'raw':!![],'where':{'id':_0x25dd31['params']['id']}},_0x1d5c10={};_0x1d5c10['model']=_[_0xbce3('0x36')](db['AnalyticExtractedReport'][_0xbce3('0x48')]);_0x1d5c10[_0xbce3('0x35')]=_['keys'](_0x25dd31[_0xbce3('0x35')]);_0x1d5c10['filters']=_[_0xbce3('0x39')](_0x1d5c10[_0xbce3('0x33')],_0x1d5c10['query']);_0x13d4d3[_0xbce3('0x38')]=_[_0xbce3('0x39')](_0x1d5c10['model'],qs['fields'](_0x25dd31[_0xbce3('0x35')][_0xbce3('0x3a')]));_0x13d4d3['attributes']=_0x13d4d3[_0xbce3('0x38')][_0xbce3('0x49')]?_0x13d4d3[_0xbce3('0x38')]:_0x1d5c10['model'];if(_0x25dd31[_0xbce3('0x35')]['includeAll']){_0x13d4d3[_0xbce3('0x44')]=[{'all':!![]}];}_0x13d4d3=_[_0xbce3('0x4a')]({},_0x13d4d3,_0x25dd31['options']);return db[_0xbce3('0x2f')][_0xbce3('0x4b')](_0x13d4d3)[_0xbce3('0x26')](handleEntityNotFound(_0x4fc0d4,null))[_0xbce3('0x26')](respondWithResult(_0x4fc0d4,null))[_0xbce3('0x46')](handleError(_0x4fc0d4,null));};exports[_0xbce3('0x4c')]=function(_0x35a9e0,_0x239030){return db[_0xbce3('0x2f')][_0xbce3('0x4c')](_0x35a9e0[_0xbce3('0x4d')],{})[_0xbce3('0x26')](function(_0x274f73){var _0x9b67bc=_0x35a9e0[_0xbce3('0x4e')][_0xbce3('0x4f')]({'plain':!![]});if(!_0x9b67bc)throw new Error(_0xbce3('0x50'));if(_0x9b67bc['role']===_0xbce3('0x4e')){var _0x31aaa4=_0x274f73[_0xbce3('0x4f')]({'plain':!![]});var _0x5e3177=_0xbce3('0x28');return db[_0xbce3('0x51')]['find']({'where':{'name':_0x5e3177,'userProfileId':_0x9b67bc[_0xbce3('0x52')]},'raw':!![]})['then'](function(_0x51f909){if(_0x51f909&&_0x51f909['autoAssociation']===0x0){return db[_0xbce3('0x29')][_0xbce3('0x4c')]({'name':_0x31aaa4[_0xbce3('0x34')],'resourceId':_0x31aaa4['id'],'type':_0x51f909[_0xbce3('0x34')],'sectionId':_0x51f909['id']},{})[_0xbce3('0x26')](function(){return _0x274f73;});}else{return _0x274f73;}})[_0xbce3('0x46')](function(_0x1a211d){logger[_0xbce3('0x2a')](_0xbce3('0x53'),_0x1a211d);throw _0x1a211d;});}return _0x274f73;})['then'](respondWithResult(_0x239030,0xc9))[_0xbce3('0x46')](handleError(_0x239030,null));};exports[_0xbce3('0x25')]=function(_0x557fd2,_0x167f56){if(_0x557fd2[_0xbce3('0x4d')]['id']){delete _0x557fd2[_0xbce3('0x4d')]['id'];}return db[_0xbce3('0x2f')]['find']({'where':{'id':_0x557fd2['params']['id']}})[_0xbce3('0x26')](handleEntityNotFound(_0x167f56,null))[_0xbce3('0x26')](saveUpdates(_0x557fd2[_0xbce3('0x4d')],null))[_0xbce3('0x26')](respondWithResult(_0x167f56,null))[_0xbce3('0x46')](handleError(_0x167f56,null));};exports[_0xbce3('0x27')]=function(_0x55c338,_0x36d250){return db[_0xbce3('0x2f')]['find']({'where':{'id':_0x55c338['params']['id']}})[_0xbce3('0x26')](handleEntityNotFound(_0x36d250,null))['then'](removeEntity(_0x36d250,null))[_0xbce3('0x46')](handleError(_0x36d250,null));};exports[_0xbce3('0x54')]=function(_0xdc119c,_0x919877,_0x1766a6){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xdc119c[_0xbce3('0x55')]['id']},'attributes':[_0xbce3('0x34'),_0xbce3('0x56'),_0xbce3('0x57'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x919877,null))['then'](function(_0x40e8bc){if(_0x40e8bc){if(!fs[_0xbce3('0x58')](path[_0xbce3('0x59')](config[_0xbce3('0x5a')],_0xbce3('0x5b'),_0x40e8bc[_0xbce3('0x57')]))){throw new db[(_0xbce3('0x5c'))][(_0xbce3('0x5d'))](_0xbce3('0x5e'));}if(_0xdc119c[_0xbce3('0x35')][_0xbce3('0x5f')]){return _0x919877[_0xbce3('0x60')](0xc8);}return _0x919877['download'](path['join'](config[_0xbce3('0x5a')],'server/files/reports',_0x40e8bc['savename']),util[_0xbce3('0x61')](_0xbce3('0x62'),_0x40e8bc[_0xbce3('0x56')]||_0x40e8bc[_0xbce3('0x34')],_0x40e8bc['output'][_0xbce3('0x63')]()));}})[_0xbce3('0x46')](handleError(_0x919877,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index d7c1a4b..ca0d3c7 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 _0x29ec=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x5de121,_0x263670){var _0x37042e=function(_0xbd1385){while(--_0xbd1385){_0x5de121['push'](_0x5de121['shift']());}};_0x37042e(++_0x263670);}(_0x29ec,0x1dd));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc29e('0x0'));var util=require(_0xc29e('0x1'));var logger=require('../../config/logger')(_0xc29e('0x2'));var moment=require(_0xc29e('0x3'));var BPromise=require(_0xc29e('0x4'));var rp=require(_0xc29e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc29e('0x6'));var attributes=require(_0xc29e('0x7'));module[_0xc29e('0x8')]=function(_0x1ca3b9,_0x3cf169){return _0x1ca3b9[_0xc29e('0x9')](_0xc29e('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9a5=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash'];(function(_0x2578fc,_0x33c460){var _0x2a25c6=function(_0x354945){while(--_0x354945){_0x2578fc['push'](_0x2578fc['shift']());}};_0x2a25c6(++_0x33c460);}(_0xe9a5,0x1cd));var _0x5e9a=function(_0x2c7c59,_0x53aece){_0x2c7c59=_0x2c7c59-0x0;var _0x57eae2=_0xe9a5[_0x2c7c59];return _0x57eae2;};'use strict';var _=require(_0x5e9a('0x0'));var util=require('util');var logger=require(_0x5e9a('0x1'))(_0x5e9a('0x2'));var moment=require(_0x5e9a('0x3'));var BPromise=require(_0x5e9a('0x4'));var rp=require(_0x5e9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e9a('0x6'));var attributes=require(_0x5e9a('0x7'));module[_0x5e9a('0x8')]=function(_0x25cc67,_0xba0362){return _0x25cc67[_0x5e9a('0x9')](_0x5e9a('0xa'),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 82657b5..149fb2c 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 _0xaea2=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x479b99,_0x1e5bec){var _0x1e7eb7=function(_0x52ac6c){while(--_0x52ac6c){_0x479b99['push'](_0x479b99['shift']());}};_0x1e7eb7(++_0x1e5bec);}(_0xaea2,0x9d));var _0x2aea=function(_0x20bedd,_0x39694b){_0x20bedd=_0x20bedd-0x0;var _0x3041f3=_0xaea2[_0x20bedd];return _0x3041f3;};'use strict';var _=require(_0x2aea('0x0'));var util=require('util');var moment=require(_0x2aea('0x1'));var BPromise=require(_0x2aea('0x2'));var rs=require(_0x2aea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2aea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aea('0x5'))(_0x2aea('0x6'));var config=require(_0x2aea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2aea('0x8')][_0x2aea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f8f58,_0x74a170,_0x4d99f3){return new BPromise(function(_0x5d5f17,_0x83f295){return client['request'](_0x2f8f58,_0x4d99f3)[_0x2aea('0xa')](function(_0x2eac57){logger[_0x2aea('0xb')](_0x2aea('0xc'),_0x74a170,_0x2aea('0xd'));logger[_0x2aea('0xe')](_0x2aea('0xf'),_0x74a170,_0x2aea('0xd'),JSON[_0x2aea('0x10')](_0x2eac57));if(_0x2eac57[_0x2aea('0x11')]){if(_0x2eac57[_0x2aea('0x11')][_0x2aea('0x12')]===0x1f4){logger[_0x2aea('0x11')](_0x2aea('0xc'),_0x74a170,_0x2eac57[_0x2aea('0x11')]['message']);return _0x83f295(_0x2eac57['error'][_0x2aea('0x13')]);}logger[_0x2aea('0x11')](_0x2aea('0xc'),_0x74a170,_0x2eac57[_0x2aea('0x11')][_0x2aea('0x13')]);return _0x5d5f17(_0x2eac57['error']['message']);}else{logger[_0x2aea('0xb')](_0x2aea('0xc'),_0x74a170,_0x2aea('0xd'));_0x5d5f17(_0x2eac57['result'][_0x2aea('0x13')]);}})[_0x2aea('0x14')](function(_0x27c7ee){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x74a170,_0x27c7ee);_0x83f295(_0x27c7ee);});});}
\ No newline at end of file
+var _0xbfba=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug'];(function(_0x175186,_0x2549a4){var _0xe02d75=function(_0x452e53){while(--_0x452e53){_0x175186['push'](_0x175186['shift']());}};_0xe02d75(++_0x2549a4);}(_0xbfba,0x1ac));var _0xabfb=function(_0x2f37e0,_0x35590f){_0x2f37e0=_0x2f37e0-0x0;var _0x549acb=_0xbfba[_0x2f37e0];return _0x549acb;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var moment=require(_0xabfb('0x2'));var BPromise=require(_0xabfb('0x3'));var rs=require(_0xabfb('0x4'));var fs=require('fs');var Redis=require(_0xabfb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabfb('0x6'));var logger=require('../../config/logger')(_0xabfb('0x7'));var config=require(_0xabfb('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aed1e,_0x1f992a,_0x3af781){return new BPromise(function(_0x1d5320,_0x3e2904){return client[_0xabfb('0x9')](_0x5aed1e,_0x3af781)['then'](function(_0x42d549){logger[_0xabfb('0xa')](_0xabfb('0xb'),_0x1f992a,'request\x20sent');logger[_0xabfb('0xc')](_0xabfb('0xd'),_0x1f992a,_0xabfb('0xe'),JSON[_0xabfb('0xf')](_0x42d549));if(_0x42d549['error']){if(_0x42d549[_0xabfb('0x10')][_0xabfb('0x11')]===0x1f4){logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);return _0x3e2904(_0x42d549[_0xabfb('0x10')]['message']);}logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549['error'][_0xabfb('0x12')]);return _0x1d5320(_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);}else{logger['info'](_0xabfb('0xb'),_0x1f992a,_0xabfb('0xe'));_0x1d5320(_0x42d549[_0xabfb('0x13')][_0xabfb('0x12')]);}})[_0xabfb('0x14')](function(_0x327708){logger[_0xabfb('0x10')](_0xabfb('0xb'),_0x1f992a,_0x327708);_0x3e2904(_0x327708);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 61cc93c..58d9c53 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 _0x98bf=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','post','create','put','update','delete','destroy','multer'];(function(_0x5758e5,_0x545eb3){var _0x3ab924=function(_0x53f19f){while(--_0x53f19f){_0x5758e5['push'](_0x5758e5['shift']());}};_0x3ab924(++_0x545eb3);}(_0x98bf,0x1da));var _0xf98b=function(_0x27975e,_0x4856c2){_0x27975e=_0x27975e-0x0;var _0x383887=_0x98bf[_0x27975e];return _0x383887;};'use strict';var multer=require(_0xf98b('0x0'));var util=require(_0xf98b('0x1'));var path=require(_0xf98b('0x2'));var timeout=require(_0xf98b('0x3'));var express=require(_0xf98b('0x4'));var router=express['Router']();var fs_extra=require(_0xf98b('0x5'));var auth=require(_0xf98b('0x6'));var interaction=require(_0xf98b('0x7'));var config=require('../../config/environment');var controller=require(_0xf98b('0x8'));router['get']('/',auth[_0xf98b('0x9')](),controller['index']);router[_0xf98b('0xa')](_0xf98b('0xb'),auth[_0xf98b('0x9')](),controller['show']);router[_0xf98b('0xa')](_0xf98b('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xf98b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf98b('0xe')]);router[_0xf98b('0xf')]('/:id',auth[_0xf98b('0x9')](),controller[_0xf98b('0x10')]);router[_0xf98b('0x11')](_0xf98b('0xb'),auth[_0xf98b('0x9')](),controller[_0xf98b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x649f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','put','update','destroy','exports'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x649f,0x168));var _0xf649=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x649f[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var path=require(_0xf649('0x2'));var timeout=require(_0xf649('0x3'));var express=require(_0xf649('0x4'));var router=express[_0xf649('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf649('0x6'));var interaction=require(_0xf649('0x7'));var config=require('../../config/environment');var controller=require(_0xf649('0x8'));router['get']('/',auth[_0xf649('0x9')](),controller['index']);router[_0xf649('0xa')](_0xf649('0xb'),auth[_0xf649('0x9')](),controller[_0xf649('0xc')]);router[_0xf649('0xa')](_0xf649('0xd'),auth[_0xf649('0x9')](),controller[_0xf649('0xe')]);router[_0xf649('0xf')]('/',auth[_0xf649('0x9')](),controller['create']);router[_0xf649('0x10')]('/:id',auth[_0xf649('0x9')](),controller[_0xf649('0x11')]);router['delete'](_0xf649('0xb'),auth[_0xf649('0x9')](),controller[_0xf649('0x12')]);module[_0xf649('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 2a74fa0..c4c6500 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 _0x7238=['BOOLEAN','exports','TEXT','STRING'];(function(_0x3efa96,_0x29d114){var _0x127486=function(_0x54e1a3){while(--_0x54e1a3){_0x3efa96['push'](_0x3efa96['shift']());}};_0x127486(++_0x29d114);}(_0x7238,0x165));var _0x8723=function(_0x2fd910,_0x1b3b3e){_0x2fd910=_0x2fd910-0x0;var _0x1d7d9c=_0x7238[_0x2fd910];return _0x1d7d9c;};'use strict';var Sequelize=require('sequelize');module[_0x8723('0x0')]={'field':{'type':Sequelize[_0x8723('0x1')]},'alias':{'type':Sequelize[_0x8723('0x2')]},'function':{'type':Sequelize[_0x8723('0x2')]},'format':{'type':Sequelize[_0x8723('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8723('0x2')]},'custom':{'type':Sequelize[_0x8723('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc23d=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1001d4,_0x2dc30c){var _0x53b9f2=function(_0x29524d){while(--_0x29524d){_0x1001d4['push'](_0x1001d4['shift']());}};_0x53b9f2(++_0x2dc30c);}(_0xc23d,0x9d));var _0xdc23=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0xc23d[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0xdc23('0x0'));module[_0xdc23('0x1')]={'field':{'type':Sequelize[_0xdc23('0x2')]},'alias':{'type':Sequelize[_0xdc23('0x3')]},'function':{'type':Sequelize[_0xdc23('0x3')]},'format':{'type':Sequelize[_0xdc23('0x3')]},'groupBy':{'type':Sequelize[_0xdc23('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdc23('0x3')]},'custom':{'type':Sequelize[_0xdc23('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 6585685..6d5fb57 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 _0xe2f0=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','AnalyticFieldReport','rawAttributes','type','key','map'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xe2f0,0x11d));var _0x0e2f=function(_0x36153d,_0x4fed67){_0x36153d=_0x36153d-0x0;var _0xfdacff=_0xe2f0[_0x36153d];return _0xfdacff;};'use strict';var emlformat=require(_0x0e2f('0x0'));var rimraf=require(_0x0e2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e2f('0x2'));var rp=require(_0x0e2f('0x3'));var moment=require(_0x0e2f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e2f('0x5'));var util=require('util');var path=require(_0x0e2f('0x6'));var sox=require(_0x0e2f('0x7'));var csv=require(_0x0e2f('0x8'));var ejs=require(_0x0e2f('0x9'));var fs=require('fs');var fs_extra=require(_0x0e2f('0xa'));var _=require(_0x0e2f('0xb'));var squel=require('squel');var crypto=require(_0x0e2f('0xc'));var jsforce=require(_0x0e2f('0xd'));var deskjs=require(_0x0e2f('0xe'));var toCsv=require(_0x0e2f('0x8'));var querystring=require(_0x0e2f('0xf'));var Papa=require(_0x0e2f('0x10'));var Redis=require('ioredis');var authService=require(_0x0e2f('0x11'));var qs=require(_0x0e2f('0x12'));var as=require(_0x0e2f('0x13'));var hardwareService=require(_0x0e2f('0x14'));var logger=require(_0x0e2f('0x15'))(_0x0e2f('0x16'));var utils=require(_0x0e2f('0x17'));var config=require(_0x0e2f('0x18'));var licenseUtil=require(_0x0e2f('0x19'));var db=require(_0x0e2f('0x1a'))['db'];function respondWithStatusCode(_0x1a1c0c,_0x3fe931){_0x3fe931=_0x3fe931||0xcc;return function(_0x58de95){if(_0x58de95){return _0x1a1c0c['sendStatus'](_0x3fe931);}return _0x1a1c0c[_0x0e2f('0x1b')](_0x3fe931)[_0x0e2f('0x1c')]();};}function respondWithResult(_0x447746,_0x4885e0){_0x4885e0=_0x4885e0||0xc8;return function(_0x19a521){if(_0x19a521){return _0x447746[_0x0e2f('0x1b')](_0x4885e0)[_0x0e2f('0x1d')](_0x19a521);}};}function respondWithFilteredResult(_0x5d3895,_0x23a2d7){return function(_0x4e3c5f){if(_0x4e3c5f){var _0x107cb2=typeof _0x23a2d7[_0x0e2f('0x1e')]==='undefined'&&typeof _0x23a2d7[_0x0e2f('0x1f')]==='undefined';var _0xeaa009=_0x4e3c5f[_0x0e2f('0x20')];var _0x5b4dd5=_0x107cb2?0x0:_0x23a2d7[_0x0e2f('0x1e')];var _0x39b0ee=_0x107cb2?_0x4e3c5f['count']:_0x23a2d7[_0x0e2f('0x1e')]+_0x23a2d7[_0x0e2f('0x1f')];var _0x2148c7;if(_0x39b0ee>=_0xeaa009){_0x39b0ee=_0xeaa009;_0x2148c7=0xc8;}else{_0x2148c7=0xce;}_0x5d3895[_0x0e2f('0x1b')](_0x2148c7);return _0x5d3895[_0x0e2f('0x21')](_0x0e2f('0x22'),_0x5b4dd5+'-'+_0x39b0ee+'/'+_0xeaa009)[_0x0e2f('0x1d')](_0x4e3c5f);}return null;};}function patchUpdates(_0x36d535){return function(_0x4f1584){try{jsonpatch[_0x0e2f('0x23')](_0x4f1584,_0x36d535,!![]);}catch(_0x4337a2){return BPromise[_0x0e2f('0x24')](_0x4337a2);}return _0x4f1584[_0x0e2f('0x25')]();};}function saveUpdates(_0x222b2f,_0x156d8b){return function(_0x5b7191){if(_0x5b7191){return _0x5b7191[_0x0e2f('0x26')](_0x222b2f)['then'](function(_0x1e4457){return _0x1e4457;});}return null;};}function removeEntity(_0x36d70e,_0x335419){return function(_0x3d04d8){if(_0x3d04d8){return _0x3d04d8[_0x0e2f('0x27')]()[_0x0e2f('0x28')](function(){_0x36d70e[_0x0e2f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47dcaa,_0x322e72){return function(_0x2f38c4){if(!_0x2f38c4){_0x47dcaa[_0x0e2f('0x29')](0x194);}return _0x2f38c4;};}function handleError(_0x53b6bb,_0x25a41c){_0x25a41c=_0x25a41c||0x1f4;return function(_0x3d934c){logger[_0x0e2f('0x2a')](_0x3d934c[_0x0e2f('0x2b')]);if(_0x3d934c[_0x0e2f('0x2c')]){delete _0x3d934c[_0x0e2f('0x2c')];}_0x53b6bb['status'](_0x25a41c)[_0x0e2f('0x2d')](_0x3d934c);};}exports['index']=function(_0x16f4f2,_0x3a179c){var _0x59ace3={},_0x5b963b={},_0x21aae8={'count':0x0,'rows':[]};var _0x3bb3b4=_['map'](db[_0x0e2f('0x2e')][_0x0e2f('0x2f')],function(_0x152762){return{'name':_0x152762['fieldName'],'type':_0x152762[_0x0e2f('0x30')][_0x0e2f('0x31')]};});_0x5b963b['model']=_[_0x0e2f('0x32')](_0x3bb3b4,_0x0e2f('0x2c'));_0x5b963b[_0x0e2f('0x33')]=_['keys'](_0x16f4f2[_0x0e2f('0x33')]);_0x5b963b[_0x0e2f('0x34')]=_[_0x0e2f('0x35')](_0x5b963b[_0x0e2f('0x36')],_0x5b963b[_0x0e2f('0x33')]);_0x59ace3[_0x0e2f('0x37')]=_['intersection'](_0x5b963b['model'],qs[_0x0e2f('0x38')](_0x16f4f2[_0x0e2f('0x33')]['fields']));_0x59ace3[_0x0e2f('0x37')]=_0x59ace3['attributes'][_0x0e2f('0x39')]?_0x59ace3[_0x0e2f('0x37')]:_0x5b963b[_0x0e2f('0x36')];if(!_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3a')](_0x0e2f('0x3b'))){_0x59ace3[_0x0e2f('0x1f')]=qs[_0x0e2f('0x1f')](_0x16f4f2['query'][_0x0e2f('0x1f')]);_0x59ace3[_0x0e2f('0x1e')]=qs[_0x0e2f('0x1e')](_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x1e')]);}_0x59ace3['order']=qs[_0x0e2f('0x3c')](_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3c')]);_0x59ace3[_0x0e2f('0x3d')]=qs[_0x0e2f('0x34')](_[_0x0e2f('0x3e')](_0x16f4f2['query'],_0x5b963b[_0x0e2f('0x34')]),_0x3bb3b4);if(_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3f')]){_0x59ace3[_0x0e2f('0x3d')]=_[_0x0e2f('0x40')](_0x59ace3[_0x0e2f('0x3d')],{'$or':_[_0x0e2f('0x32')](_0x3bb3b4,function(_0x3c766a){if(_0x3c766a['type']!==_0x0e2f('0x41')){var _0x39ee03={};_0x39ee03[_0x3c766a[_0x0e2f('0x2c')]]={'$like':'%'+_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3f')]+'%'};return _0x39ee03;}})});}_0x59ace3=_[_0x0e2f('0x40')]({},_0x59ace3,_0x16f4f2[_0x0e2f('0x42')]);var _0x2f69d2={'where':_0x59ace3[_0x0e2f('0x3d')]};return db[_0x0e2f('0x2e')][_0x0e2f('0x20')](_0x2f69d2)[_0x0e2f('0x28')](function(_0x564f0a){_0x21aae8['count']=_0x564f0a;if(_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x43')]){_0x59ace3[_0x0e2f('0x44')]=[{'all':!![]}];}return db[_0x0e2f('0x2e')]['findAll'](_0x59ace3);})[_0x0e2f('0x28')](function(_0x410fb2){_0x21aae8[_0x0e2f('0x45')]=_0x410fb2;return _0x21aae8;})[_0x0e2f('0x28')](respondWithFilteredResult(_0x3a179c,_0x59ace3))['catch'](handleError(_0x3a179c,null));};exports[_0x0e2f('0x46')]=function(_0x54596b,_0x5b6365){var _0x442e66={'raw':![],'where':{'id':_0x54596b[_0x0e2f('0x47')]['id']}},_0x3769fd={};_0x3769fd['model']=_['keys'](db[_0x0e2f('0x2e')][_0x0e2f('0x2f')]);_0x3769fd['query']=_[_0x0e2f('0x48')](_0x54596b[_0x0e2f('0x33')]);_0x3769fd[_0x0e2f('0x34')]=_[_0x0e2f('0x35')](_0x3769fd[_0x0e2f('0x36')],_0x3769fd[_0x0e2f('0x33')]);_0x442e66[_0x0e2f('0x37')]=_['intersection'](_0x3769fd[_0x0e2f('0x36')],qs[_0x0e2f('0x38')](_0x54596b[_0x0e2f('0x33')]['fields']));_0x442e66['attributes']=_0x442e66[_0x0e2f('0x37')][_0x0e2f('0x39')]?_0x442e66[_0x0e2f('0x37')]:_0x3769fd['model'];if(_0x54596b[_0x0e2f('0x33')][_0x0e2f('0x43')]){_0x442e66[_0x0e2f('0x44')]=[{'all':!![]}];}_0x442e66=_[_0x0e2f('0x40')]({},_0x442e66,_0x54596b[_0x0e2f('0x42')]);return db[_0x0e2f('0x2e')][_0x0e2f('0x49')](_0x442e66)['then'](handleEntityNotFound(_0x5b6365,null))[_0x0e2f('0x28')](respondWithResult(_0x5b6365,null))[_0x0e2f('0x4a')](handleError(_0x5b6365,null));};exports[_0x0e2f('0x4b')]=function(_0x5ef757,_0x3d37b3){return db[_0x0e2f('0x2e')][_0x0e2f('0x4b')](_0x5ef757['body'],{})[_0x0e2f('0x28')](respondWithResult(_0x3d37b3,0xc9))[_0x0e2f('0x4a')](handleError(_0x3d37b3,null));};exports['bulkCreate']=function(_0x107d08,_0x4ca6bc){return db['AnalyticFieldReport']['bulkCreate'](_0x107d08[_0x0e2f('0x4c')],{'raw':![],'individualHooks':!![]})[_0x0e2f('0x28')](respondWithResult(_0x4ca6bc,0xc9))[_0x0e2f('0x4a')](handleError(_0x4ca6bc,null));};exports[_0x0e2f('0x26')]=function(_0x2654ff,_0x549989){if(_0x2654ff[_0x0e2f('0x4c')]['id']){delete _0x2654ff['body']['id'];}return db[_0x0e2f('0x2e')][_0x0e2f('0x49')]({'where':{'id':_0x2654ff[_0x0e2f('0x47')]['id']}})[_0x0e2f('0x28')](handleEntityNotFound(_0x549989,null))[_0x0e2f('0x28')](saveUpdates(_0x2654ff[_0x0e2f('0x4c')],null))['then'](respondWithResult(_0x549989,null))[_0x0e2f('0x4a')](handleError(_0x549989,null));};exports[_0x0e2f('0x27')]=function(_0x164fb6,_0x169922){return db[_0x0e2f('0x2e')][_0x0e2f('0x49')]({'where':{'id':_0x164fb6[_0x0e2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x169922,null))['then'](removeEntity(_0x169922,null))[_0x0e2f('0x4a')](handleError(_0x169922,null));};exports[_0x0e2f('0x4d')]=function(_0x1fa804,_0x1553cc){return db[_0x0e2f('0x2e')][_0x0e2f('0x27')]({'where':{'id':_0x1fa804[_0x0e2f('0x33')][_0x0e2f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x0e2f('0x28')](respondWithResult(_0x1553cc,0xcc))[_0x0e2f('0x4a')](handleError(_0x1553cc,null));};exports[_0x0e2f('0x4f')]=function(_0x5334ad,_0x5700f7,_0x20c55a){return db[_0x0e2f('0x50')][_0x0e2f('0x51')]({'where':{'id':_0x5334ad['params']['id']}})['then'](handleEntityNotFound(_0x5700f7,null))[_0x0e2f('0x28')](function(_0x5dfda8){if(_0x5dfda8){return db[_0x0e2f('0x52')]['transaction'](function(_0x3c0a4c){return db[_0x0e2f('0x2e')][_0x0e2f('0x27')]({'where':{'CustomReportId':_0x5334ad[_0x0e2f('0x47')]['id']},'transaction':_0x3c0a4c})[_0x0e2f('0x28')](function(_0x40074d){var _0x3c9584=_[_0x0e2f('0x32')](_0x5334ad[_0x0e2f('0x4c')],function(_0x571fd9){delete _0x571fd9['id'];_0x571fd9['CustomReportId']=_0x5334ad[_0x0e2f('0x47')]['id'];return _0x571fd9;});return db[_0x0e2f('0x2e')][_0x0e2f('0x53')](_0x3c9584,{'transaction':_0x3c0a4c});});})['then'](function(){return db[_0x0e2f('0x2e')]['findAll']({'where':{'CustomReportId':_0x5334ad[_0x0e2f('0x47')]['id']}});});}})['then'](respondWithResult(_0x5700f7,null))[_0x0e2f('0x4a')](handleError(_0x5700f7,null));};
\ No newline at end of file
+var _0x5c83=['rawAttributes','length','includeAll','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','options','include','rows','show','params'];(function(_0x1d79ba,_0x2a2106){var _0x161296=function(_0x5166ea){while(--_0x5166ea){_0x1d79ba['push'](_0x1d79ba['shift']());}};_0x161296(++_0x2a2106);}(_0x5c83,0xb2));var _0x35c8=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x5c83[_0x1cc961];return _0x471d86;};'use strict';var emlformat=require(_0x35c8('0x0'));var rimraf=require(_0x35c8('0x1'));var zipdir=require(_0x35c8('0x2'));var jsonpatch=require(_0x35c8('0x3'));var rp=require(_0x35c8('0x4'));var moment=require(_0x35c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c8('0x6'));var util=require(_0x35c8('0x7'));var path=require('path');var sox=require(_0x35c8('0x8'));var csv=require('to-csv');var ejs=require(_0x35c8('0x9'));var fs=require('fs');var fs_extra=require(_0x35c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35c8('0xd'));var Papa=require(_0x35c8('0xe'));var Redis=require(_0x35c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x35c8('0x10'));var as=require(_0x35c8('0x11'));var hardwareService=require(_0x35c8('0x12'));var logger=require(_0x35c8('0x13'))(_0x35c8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35c8('0x15'));var db=require(_0x35c8('0x16'))['db'];function respondWithStatusCode(_0x3b3c91,_0x4c597e){_0x4c597e=_0x4c597e||0xcc;return function(_0x1802b2){if(_0x1802b2){return _0x3b3c91[_0x35c8('0x17')](_0x4c597e);}return _0x3b3c91[_0x35c8('0x18')](_0x4c597e)[_0x35c8('0x19')]();};}function respondWithResult(_0x52bbd7,_0x17ab37){_0x17ab37=_0x17ab37||0xc8;return function(_0x39390c){if(_0x39390c){return _0x52bbd7[_0x35c8('0x18')](_0x17ab37)[_0x35c8('0x1a')](_0x39390c);}};}function respondWithFilteredResult(_0x1da72f,_0x3f1a1e){return function(_0x71a68f){if(_0x71a68f){var _0x2eee79=typeof _0x3f1a1e[_0x35c8('0x1b')]==='undefined'&&typeof _0x3f1a1e[_0x35c8('0x1c')]===_0x35c8('0x1d');var _0x203277=_0x71a68f[_0x35c8('0x1e')];var _0x3b54d0=_0x2eee79?0x0:_0x3f1a1e['offset'];var _0x23f337=_0x2eee79?_0x71a68f[_0x35c8('0x1e')]:_0x3f1a1e['offset']+_0x3f1a1e[_0x35c8('0x1c')];var _0xd76bba;if(_0x23f337>=_0x203277){_0x23f337=_0x203277;_0xd76bba=0xc8;}else{_0xd76bba=0xce;}_0x1da72f['status'](_0xd76bba);return _0x1da72f['set'](_0x35c8('0x1f'),_0x3b54d0+'-'+_0x23f337+'/'+_0x203277)[_0x35c8('0x1a')](_0x71a68f);}return null;};}function patchUpdates(_0x22273b){return function(_0x13873c){try{jsonpatch[_0x35c8('0x20')](_0x13873c,_0x22273b,!![]);}catch(_0x33bc60){return BPromise[_0x35c8('0x21')](_0x33bc60);}return _0x13873c[_0x35c8('0x22')]();};}function saveUpdates(_0x80d4a7,_0x1801c7){return function(_0x4f895d){if(_0x4f895d){return _0x4f895d['update'](_0x80d4a7)[_0x35c8('0x23')](function(_0x488472){return _0x488472;});}return null;};}function removeEntity(_0x4867ec,_0x4afec9){return function(_0xc6b330){if(_0xc6b330){return _0xc6b330[_0x35c8('0x24')]()[_0x35c8('0x23')](function(){_0x4867ec[_0x35c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1869fc,_0x20569c){return function(_0x1bbe32){if(!_0x1bbe32){_0x1869fc[_0x35c8('0x17')](0x194);}return _0x1bbe32;};}function handleError(_0x33d28f,_0x48ab3c){_0x48ab3c=_0x48ab3c||0x1f4;return function(_0x38821f){logger[_0x35c8('0x25')](_0x38821f['stack']);if(_0x38821f[_0x35c8('0x26')]){delete _0x38821f['name'];}_0x33d28f[_0x35c8('0x18')](_0x48ab3c)[_0x35c8('0x27')](_0x38821f);};}exports['index']=function(_0x5397e4,_0x5e10c8){var _0x2314b6={},_0x2b4787={},_0x32998a={'count':0x0,'rows':[]};var _0x2e8d37=_[_0x35c8('0x28')](db[_0x35c8('0x29')]['rawAttributes'],function(_0x250c02){return{'name':_0x250c02[_0x35c8('0x2a')],'type':_0x250c02[_0x35c8('0x2b')]['key']};});_0x2b4787[_0x35c8('0x2c')]=_[_0x35c8('0x28')](_0x2e8d37,'name');_0x2b4787[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x5397e4[_0x35c8('0x2d')]);_0x2b4787['filters']=_['intersection'](_0x2b4787[_0x35c8('0x2c')],_0x2b4787[_0x35c8('0x2d')]);_0x2314b6[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x2b4787[_0x35c8('0x2c')],qs[_0x35c8('0x31')](_0x5397e4[_0x35c8('0x2d')]['fields']));_0x2314b6[_0x35c8('0x2f')]=_0x2314b6['attributes']['length']?_0x2314b6[_0x35c8('0x2f')]:_0x2b4787[_0x35c8('0x2c')];if(!_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x32')](_0x35c8('0x33'))){_0x2314b6[_0x35c8('0x1c')]=qs[_0x35c8('0x1c')](_0x5397e4[_0x35c8('0x2d')]['limit']);_0x2314b6[_0x35c8('0x1b')]=qs['offset'](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x1b')]);}_0x2314b6['order']=qs[_0x35c8('0x34')](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x34')]);_0x2314b6['where']=qs[_0x35c8('0x35')](_[_0x35c8('0x36')](_0x5397e4[_0x35c8('0x2d')],_0x2b4787['filters']),_0x2e8d37);if(_0x5397e4[_0x35c8('0x2d')]['filter']){_0x2314b6[_0x35c8('0x37')]=_[_0x35c8('0x38')](_0x2314b6['where'],{'$or':_[_0x35c8('0x28')](_0x2e8d37,function(_0x241e06){if(_0x241e06[_0x35c8('0x2b')]!=='VIRTUAL'){var _0x4210a2={};_0x4210a2[_0x241e06[_0x35c8('0x26')]]={'$like':'%'+_0x5397e4[_0x35c8('0x2d')]['filter']+'%'};return _0x4210a2;}})});}_0x2314b6=_[_0x35c8('0x38')]({},_0x2314b6,_0x5397e4[_0x35c8('0x39')]);var _0x45b470={'where':_0x2314b6[_0x35c8('0x37')]};return db[_0x35c8('0x29')][_0x35c8('0x1e')](_0x45b470)['then'](function(_0x441383){_0x32998a[_0x35c8('0x1e')]=_0x441383;if(_0x5397e4[_0x35c8('0x2d')]['includeAll']){_0x2314b6[_0x35c8('0x3a')]=[{'all':!![]}];}return db[_0x35c8('0x29')]['findAll'](_0x2314b6);})[_0x35c8('0x23')](function(_0x1ce112){_0x32998a[_0x35c8('0x3b')]=_0x1ce112;return _0x32998a;})[_0x35c8('0x23')](respondWithFilteredResult(_0x5e10c8,_0x2314b6))['catch'](handleError(_0x5e10c8,null));};exports[_0x35c8('0x3c')]=function(_0x4f22c0,_0x500bed){var _0x95f09e={'raw':![],'where':{'id':_0x4f22c0[_0x35c8('0x3d')]['id']}},_0x568f77={};_0x568f77[_0x35c8('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x35c8('0x3e')]);_0x568f77[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x4f22c0[_0x35c8('0x2d')]);_0x568f77[_0x35c8('0x35')]=_[_0x35c8('0x30')](_0x568f77[_0x35c8('0x2c')],_0x568f77[_0x35c8('0x2d')]);_0x95f09e[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x568f77['model'],qs[_0x35c8('0x31')](_0x4f22c0[_0x35c8('0x2d')][_0x35c8('0x31')]));_0x95f09e[_0x35c8('0x2f')]=_0x95f09e[_0x35c8('0x2f')][_0x35c8('0x3f')]?_0x95f09e[_0x35c8('0x2f')]:_0x568f77[_0x35c8('0x2c')];if(_0x4f22c0['query'][_0x35c8('0x40')]){_0x95f09e['include']=[{'all':!![]}];}_0x95f09e=_[_0x35c8('0x38')]({},_0x95f09e,_0x4f22c0[_0x35c8('0x39')]);return db[_0x35c8('0x29')][_0x35c8('0x41')](_0x95f09e)['then'](handleEntityNotFound(_0x500bed,null))[_0x35c8('0x23')](respondWithResult(_0x500bed,null))[_0x35c8('0x42')](handleError(_0x500bed,null));};exports[_0x35c8('0x43')]=function(_0x44a9a4,_0x148f16){return db[_0x35c8('0x29')][_0x35c8('0x43')](_0x44a9a4[_0x35c8('0x44')],{})[_0x35c8('0x23')](respondWithResult(_0x148f16,0xc9))[_0x35c8('0x42')](handleError(_0x148f16,null));};exports[_0x35c8('0x45')]=function(_0x8cd018,_0x38ef88){return db[_0x35c8('0x29')][_0x35c8('0x45')](_0x8cd018[_0x35c8('0x44')],{'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x38ef88,0xc9))[_0x35c8('0x42')](handleError(_0x38ef88,null));};exports[_0x35c8('0x46')]=function(_0x32a7e3,_0x434904){if(_0x32a7e3[_0x35c8('0x44')]['id']){delete _0x32a7e3['body']['id'];}return db[_0x35c8('0x29')]['find']({'where':{'id':_0x32a7e3[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x434904,null))['then'](saveUpdates(_0x32a7e3[_0x35c8('0x44')],null))[_0x35c8('0x23')](respondWithResult(_0x434904,null))['catch'](handleError(_0x434904,null));};exports[_0x35c8('0x24')]=function(_0x3d8f2f,_0x520d39){return db[_0x35c8('0x29')]['find']({'where':{'id':_0x3d8f2f[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x520d39,null))['then'](removeEntity(_0x520d39,null))[_0x35c8('0x42')](handleError(_0x520d39,null));};exports[_0x35c8('0x47')]=function(_0x12f7e7,_0x2d1c7f){return db[_0x35c8('0x29')][_0x35c8('0x24')]({'where':{'id':_0x12f7e7[_0x35c8('0x2d')][_0x35c8('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x2d1c7f,0xcc))[_0x35c8('0x42')](handleError(_0x2d1c7f,null));};exports[_0x35c8('0x49')]=function(_0xc52713,_0x1c913a,_0x691b3c){return db[_0x35c8('0x4a')][_0x35c8('0x4b')]({'where':{'id':_0xc52713[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x1c913a,null))[_0x35c8('0x23')](function(_0x4d74c0){if(_0x4d74c0){return db[_0x35c8('0x4c')][_0x35c8('0x4d')](function(_0x27b62c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']},'transaction':_0x27b62c})[_0x35c8('0x23')](function(_0x417f3c){var _0x1a843b=_['map'](_0xc52713[_0x35c8('0x44')],function(_0x51b850){delete _0x51b850['id'];_0x51b850[_0x35c8('0x4e')]=_0xc52713[_0x35c8('0x3d')]['id'];return _0x51b850;});return db['AnalyticFieldReport'][_0x35c8('0x45')](_0x1a843b,{'transaction':_0x27b62c});});})['then'](function(){return db[_0x35c8('0x29')][_0x35c8('0x4f')]({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']}});});}})[_0x35c8('0x23')](respondWithResult(_0x1c913a,null))[_0x35c8('0x42')](handleError(_0x1c913a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1a98cbd..bb0121f 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 _0xe6cd=['path','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x21ba12,_0x2d96b2){var _0x49981d=function(_0x435ed7){while(--_0x435ed7){_0x21ba12['push'](_0x21ba12['shift']());}};_0x49981d(++_0x2d96b2);}(_0xe6cd,0x1b6));var _0xde6c=function(_0x519d64,_0x15828c){_0x519d64=_0x519d64-0x0;var _0x58700e=_0xe6cd[_0x519d64];return _0x58700e;};'use strict';var _=require(_0xde6c('0x0'));var util=require(_0xde6c('0x1'));var logger=require(_0xde6c('0x2'))(_0xde6c('0x3'));var moment=require('moment');var BPromise=require(_0xde6c('0x4'));var rp=require(_0xde6c('0x5'));var fs=require('fs');var path=require(_0xde6c('0x6'));var rimraf=require(_0xde6c('0x7'));var config=require('../../config/environment');var attributes=require(_0xde6c('0x8'));module[_0xde6c('0x9')]=function(_0xf5ffc4,_0x44ff10){return _0xf5ffc4['define'](_0xde6c('0xa'),attributes,{'tableName':_0xde6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cab=['AnalyticFieldReport','analytics_report_fields','util','api','moment','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x3ae7b7,_0x469102){var _0x550b35=function(_0x5dd4ea){while(--_0x5dd4ea){_0x3ae7b7['push'](_0x3ae7b7['shift']());}};_0x550b35(++_0x469102);}(_0x8cab,0x70));var _0xb8ca=function(_0x2cc846,_0x162211){_0x2cc846=_0x2cc846-0x0;var _0x119261=_0x8cab[_0x2cc846];return _0x119261;};'use strict';var _=require('lodash');var util=require(_0xb8ca('0x0'));var logger=require('../../config/logger')(_0xb8ca('0x1'));var moment=require(_0xb8ca('0x2'));var BPromise=require(_0xb8ca('0x3'));var rp=require(_0xb8ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb8ca('0x5'));var attributes=require(_0xb8ca('0x6'));module['exports']=function(_0xedfec6,_0x104775){return _0xedfec6[_0xb8ca('0x7')](_0xb8ca('0x8'),attributes,{'tableName':_0xb8ca('0x9'),'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 09850f9..0d1d763 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 _0x8510=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2b31ad,_0x4f9f32){var _0x2ea20c=function(_0x3acae7){while(--_0x3acae7){_0x2b31ad['push'](_0x2b31ad['shift']());}};_0x2ea20c(++_0x4f9f32);}(_0x8510,0x171));var _0x0851=function(_0x4bcf14,_0x1e1a26){_0x4bcf14=_0x4bcf14-0x0;var _0x9acc80=_0x8510[_0x4bcf14];return _0x9acc80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0851('0x0'));var BPromise=require(_0x0851('0x1'));var rs=require(_0x0851('0x2'));var fs=require('fs');var Redis=require(_0x0851('0x3'));var db=require(_0x0851('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0851('0x5'))(_0x0851('0x6'));var config=require(_0x0851('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0851('0x8')][_0x0851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c156c,_0x10a25b,_0x1aabf9){return new BPromise(function(_0x2f6ed2,_0x2436c9){return client[_0x0851('0xa')](_0x2c156c,_0x1aabf9)[_0x0851('0xb')](function(_0x1e7727){logger[_0x0851('0xc')](_0x0851('0xd'),_0x10a25b,_0x0851('0xe'));logger[_0x0851('0xf')](_0x0851('0x10'),_0x10a25b,_0x0851('0xe'),JSON[_0x0851('0x11')](_0x1e7727));if(_0x1e7727['error']){if(_0x1e7727[_0x0851('0x12')]['code']===0x1f4){logger[_0x0851('0x12')](_0x0851('0xd'),_0x10a25b,_0x1e7727[_0x0851('0x12')][_0x0851('0x13')]);return _0x2436c9(_0x1e7727['error'][_0x0851('0x13')]);}logger[_0x0851('0x12')](_0x0851('0xd'),_0x10a25b,_0x1e7727[_0x0851('0x12')][_0x0851('0x13')]);return _0x2f6ed2(_0x1e7727[_0x0851('0x12')]['message']);}else{logger[_0x0851('0xc')](_0x0851('0xd'),_0x10a25b,'request\x20sent');_0x2f6ed2(_0x1e7727[_0x0851('0x14')][_0x0851('0x13')]);}})['catch'](function(_0x32955c){logger['error'](_0x0851('0xd'),_0x10a25b,_0x32955c);_0x2436c9(_0x32955c);});});}
\ No newline at end of file
+var _0xf479=['client','http','request','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','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1cd784,_0x5d4804){var _0x25c73a=function(_0x3c0ca9){while(--_0x3c0ca9){_0x1cd784['push'](_0x1cd784['shift']());}};_0x25c73a(++_0x5d4804);}(_0xf479,0x142));var _0x9f47=function(_0x5e3bda,_0x108667){_0x5e3bda=_0x5e3bda-0x0;var _0x3f02cf=_0xf479[_0x5e3bda];return _0x3f02cf;};'use strict';var _=require(_0x9f47('0x0'));var util=require('util');var moment=require(_0x9f47('0x1'));var BPromise=require(_0x9f47('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f47('0x3'))['db'];var utils=require(_0x9f47('0x4'));var logger=require(_0x9f47('0x5'))('rpc');var config=require(_0x9f47('0x6'));var jayson=require(_0x9f47('0x7'));var client=jayson[_0x9f47('0x8')][_0x9f47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453c74,_0x3fd73b,_0x3c435d){return new BPromise(function(_0x488d28,_0x39ae27){return client[_0x9f47('0xa')](_0x453c74,_0x3c435d)['then'](function(_0x57a99e){logger[_0x9f47('0xb')](_0x9f47('0xc'),_0x3fd73b,_0x9f47('0xd'));logger[_0x9f47('0xe')](_0x9f47('0xf'),_0x3fd73b,_0x9f47('0xd'),JSON[_0x9f47('0x10')](_0x57a99e));if(_0x57a99e[_0x9f47('0x11')]){if(_0x57a99e[_0x9f47('0x11')][_0x9f47('0x12')]===0x1f4){logger['error'](_0x9f47('0xc'),_0x3fd73b,_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);return _0x39ae27(_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);}logger[_0x9f47('0x11')](_0x9f47('0xc'),_0x3fd73b,_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);return _0x488d28(_0x57a99e['error'][_0x9f47('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3fd73b,'request\x20sent');_0x488d28(_0x57a99e[_0x9f47('0x14')][_0x9f47('0x13')]);}})[_0x9f47('0x15')](function(_0x424a1d){logger[_0x9f47('0x11')](_0x9f47('0xc'),_0x3fd73b,_0x424a1d);_0x39ae27(_0x424a1d);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4b1c838..e4a1029 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(_0x5afcb0,_0x2e7b25){var _0x2f55b2=function(_0x135b1a){while(--_0x135b1a){_0x5afcb0['push'](_0x5afcb0['shift']());}};_0x2f55b2(++_0x2e7b25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x202e3c,_0x532538){var _0x2743d7=function(_0x4a18d9){while(--_0x4a18d9){_0x202e3c['push'](_0x202e3c['shift']());}};_0x2743d7(++_0x532538);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 e2a48c8..aeb4902 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 _0xb688=['STRING','name','TEXT','exports'];(function(_0xf00cf4,_0xfb1b71){var _0x51914c=function(_0x164acb){while(--_0x164acb){_0xf00cf4['push'](_0xf00cf4['shift']());}};_0x51914c(++_0xfb1b71);}(_0xb688,0xcf));var _0x8b68=function(_0xef1737,_0x4d0aa6){_0xef1737=_0xef1737-0x0;var _0x4068e4=_0xb688[_0xef1737];return _0x4068e4;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![],'unique':_0x8b68('0x2')},'table':{'type':Sequelize[_0x8b68('0x1')]},'metric':{'type':Sequelize[_0x8b68('0x3')]},'description':{'type':Sequelize[_0x8b68('0x1')]}};
\ No newline at end of file
+var _0x95c5=['exports','name','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x153));var _0x595c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x95c5[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x595c('0x2')},'table':{'type':Sequelize[_0x595c('0x3')]},'metric':{'type':Sequelize[_0x595c('0x4')]},'description':{'type':Sequelize[_0x595c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index eec26f1..3b285ec 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3ed69b,_0x53c5ab){var _0x4b0cfd=function(_0x9ee065){while(--_0x9ee065){_0x3ed69b['push'](_0x3ed69b['shift']());}};_0x4b0cfd(++_0x53c5ab);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0x7fbe[_0x2f1908];return _0x357795;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','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','apply','reject','save','update','destroy'];(function(_0xee0152,_0xfe1ea7){var _0x1a69d1=function(_0x51e881){while(--_0x51e881){_0xee0152['push'](_0xee0152['shift']());}};_0x1a69d1(++_0xfe1ea7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x552af4,_0x37915b){_0x552af4=_0x552af4-0x0;var _0x10dc30=_0x8d0e[_0x552af4];return _0x10dc30;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 52ca6dd..e05e309 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 _0xff22=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment'];(function(_0x245bea,_0x17c058){var _0x40ccb4=function(_0x931843){while(--_0x931843){_0x245bea['push'](_0x245bea['shift']());}};_0x40ccb4(++_0x17c058);}(_0xff22,0x1a0));var _0x2ff2=function(_0x19223d,_0x53120f){_0x19223d=_0x19223d-0x0;var _0x1331c9=_0xff22[_0x19223d];return _0x1331c9;};'use strict';var _=require(_0x2ff2('0x0'));var util=require(_0x2ff2('0x1'));var logger=require('../../config/logger')(_0x2ff2('0x2'));var moment=require(_0x2ff2('0x3'));var BPromise=require(_0x2ff2('0x4'));var rp=require(_0x2ff2('0x5'));var fs=require('fs');var path=require(_0x2ff2('0x6'));var rimraf=require(_0x2ff2('0x7'));var config=require(_0x2ff2('0x8'));var attributes=require(_0x2ff2('0x9'));module[_0x2ff2('0xa')]=function(_0x47906b,_0x21f303){return _0x47906b[_0x2ff2('0xb')](_0x2ff2('0xc'),attributes,{'tableName':_0x2ff2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5031=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x7bb949,_0xafa335){var _0x500e31=function(_0x2b5769){while(--_0x2b5769){_0x7bb949['push'](_0x7bb949['shift']());}};_0x500e31(++_0xafa335);}(_0x5031,0x144));var _0x1503=function(_0x5cd939,_0xac0983){_0x5cd939=_0x5cd939-0x0;var _0x6c5526=_0x5031[_0x5cd939];return _0x6c5526;};'use strict';var _=require(_0x1503('0x0'));var util=require(_0x1503('0x1'));var logger=require(_0x1503('0x2'))(_0x1503('0x3'));var moment=require(_0x1503('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1503('0x5'));var rimraf=require(_0x1503('0x6'));var config=require(_0x1503('0x7'));var attributes=require(_0x1503('0x8'));module[_0x1503('0x9')]=function(_0x3b44d1,_0xaeae3){return _0x3b44d1[_0x1503('0xa')](_0x1503('0xb'),attributes,{'tableName':'analytics_metrics','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 d71eb99..f626189 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 _0x76b6=['request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x22f54b,_0x4f2265){var _0xa7b5a4=function(_0x4333a2){while(--_0x4333a2){_0x22f54b['push'](_0x22f54b['shift']());}};_0xa7b5a4(++_0x4f2265);}(_0x76b6,0x172));var _0x676b=function(_0x562813,_0x24da27){_0x562813=_0x562813-0x0;var _0xe3d11c=_0x76b6[_0x562813];return _0xe3d11c;};'use strict';var _=require(_0x676b('0x0'));var util=require(_0x676b('0x1'));var moment=require(_0x676b('0x2'));var BPromise=require(_0x676b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x676b('0x4'));var db=require(_0x676b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x676b('0x6'))(_0x676b('0x7'));var config=require(_0x676b('0x8'));var jayson=require(_0x676b('0x9'));var client=jayson[_0x676b('0xa')][_0x676b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf2c6b7,_0x6ad979,_0x2c4db2){return new BPromise(function(_0x545aa2,_0x177636){return client[_0x676b('0xc')](_0xf2c6b7,_0x2c4db2)[_0x676b('0xd')](function(_0xd7ebff){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x6ad979,_0x676b('0xe'));logger[_0x676b('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x6ad979,_0x676b('0xe'),JSON[_0x676b('0x10')](_0xd7ebff));if(_0xd7ebff[_0x676b('0x11')]){if(_0xd7ebff['error'][_0x676b('0x12')]===0x1f4){logger['error'](_0x676b('0x13'),_0x6ad979,_0xd7ebff[_0x676b('0x11')]['message']);return _0x177636(_0xd7ebff[_0x676b('0x11')][_0x676b('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x6ad979,_0xd7ebff[_0x676b('0x11')][_0x676b('0x14')]);return _0x545aa2(_0xd7ebff['error'][_0x676b('0x14')]);}else{logger[_0x676b('0x15')](_0x676b('0x13'),_0x6ad979,_0x676b('0xe'));_0x545aa2(_0xd7ebff[_0x676b('0x16')]['message']);}})[_0x676b('0x17')](function(_0x26442c){logger[_0x676b('0x11')](_0x676b('0x13'),_0x6ad979,_0x26442c);_0x177636(_0x26442c);});});}
\ No newline at end of file
+var _0xf2ef=['http','request','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x32b301,_0x380389){var _0xd0c417=function(_0xd9cde3){while(--_0xd9cde3){_0x32b301['push'](_0x32b301['shift']());}};_0xd0c417(++_0x380389);}(_0xf2ef,0x182));var _0xff2e=function(_0xa279ef,_0x472af6){_0xa279ef=_0xa279ef-0x0;var _0x383bf1=_0xf2ef[_0xa279ef];return _0x383bf1;};'use strict';var _=require(_0xff2e('0x0'));var util=require(_0xff2e('0x1'));var moment=require(_0xff2e('0x2'));var BPromise=require(_0xff2e('0x3'));var rs=require(_0xff2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff2e('0x5'))['db'];var utils=require(_0xff2e('0x6'));var logger=require(_0xff2e('0x7'))(_0xff2e('0x8'));var config=require('../../config/environment');var jayson=require(_0xff2e('0x9'));var client=jayson['client'][_0xff2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8bec70,_0x5c0cf0,_0x159585){return new BPromise(function(_0x25fbd8,_0x1689ca){return client[_0xff2e('0xb')](_0x8bec70,_0x159585)['then'](function(_0x4ea0f7){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,'request\x20sent');logger[_0xff2e('0xc')](_0xff2e('0xd'),_0x5c0cf0,_0xff2e('0xe'),JSON[_0xff2e('0xf')](_0x4ea0f7));if(_0x4ea0f7[_0xff2e('0x10')]){if(_0x4ea0f7[_0xff2e('0x10')]['code']===0x1f4){logger[_0xff2e('0x10')](_0xff2e('0x11'),_0x5c0cf0,_0x4ea0f7[_0xff2e('0x10')][_0xff2e('0x12')]);return _0x1689ca(_0x4ea0f7[_0xff2e('0x10')][_0xff2e('0x12')]);}logger[_0xff2e('0x10')](_0xff2e('0x11'),_0x5c0cf0,_0x4ea0f7['error'][_0xff2e('0x12')]);return _0x25fbd8(_0x4ea0f7[_0xff2e('0x10')]['message']);}else{logger[_0xff2e('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,'request\x20sent');_0x25fbd8(_0x4ea0f7[_0xff2e('0x14')][_0xff2e('0x12')]);}})[_0xff2e('0x15')](function(_0x314064){logger[_0xff2e('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,_0x314064);_0x1689ca(_0x314064);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 10bbdea..420db19 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 _0xa992=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa992,0x18c));var _0x2a99=function(_0x596b0f,_0x4cb5a3){_0x596b0f=_0x596b0f-0x0;var _0x4ea3c2=_0xa992[_0x596b0f];return _0x4ea3c2;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var fs_extra=require(_0x2a99('0x5'));var auth=require(_0x2a99('0x6'));var interaction=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var controller=require(_0x2a99('0x9'));router[_0x2a99('0xa')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xc')]);router[_0x2a99('0xa')]('/:id',auth[_0x2a99('0xb')](),controller[_0x2a99('0xd')]);router[_0x2a99('0xe')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x10')](_0x2a99('0x11'),auth[_0x2a99('0xb')](),controller[_0x2a99('0x12')]);router[_0x2a99('0x13')](_0x2a99('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a99('0x14')]=router;
\ No newline at end of file
+var _0xc73a=['./analyticMetric.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4cd7f8,_0x1b9f91){var _0x179122=function(_0x1b2145){while(--_0x1b2145){_0x4cd7f8['push'](_0x4cd7f8['shift']());}};_0x179122(++_0x1b9f91);}(_0xc73a,0x72));var _0xac73=function(_0x8566eb,_0x2e8dc6){_0x8566eb=_0x8566eb-0x0;var _0x4fd545=_0xc73a[_0x8566eb];return _0x4fd545;};'use strict';var multer=require('multer');var util=require(_0xac73('0x0'));var path=require(_0xac73('0x1'));var timeout=require(_0xac73('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac73('0x3'));var auth=require(_0xac73('0x4'));var interaction=require(_0xac73('0x5'));var config=require('../../config/environment');var controller=require(_0xac73('0x6'));router[_0xac73('0x7')]('/',auth[_0xac73('0x8')](),controller['index']);router[_0xac73('0x7')](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xa')]);router['post']('/',auth[_0xac73('0x8')](),controller['create']);router['put'](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xb')]);router[_0xac73('0xc')](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xd')]);module[_0xac73('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 6b551da..524cdc6 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 _0x4148=['TEXT'];(function(_0x578862,_0x51e17f){var _0x19c7e9=function(_0xdd1ed6){while(--_0xdd1ed6){_0x578862['push'](_0x578862['shift']());}};_0x19c7e9(++_0x51e17f);}(_0x4148,0xb8));var _0x8414=function(_0x6f5598,_0xabeb74){_0x6f5598=_0x6f5598-0x0;var _0x1e1325=_0x4148[_0x6f5598];return _0x1e1325;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x8414('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xbaef=['TEXT','sequelize','exports'];(function(_0xc66e23,_0x3e0786){var _0x4c46fd=function(_0x4e4caf){while(--_0x4e4caf){_0xc66e23['push'](_0xc66e23['shift']());}};_0x4c46fd(++_0x3e0786);}(_0xbaef,0x1db));var _0xfbae=function(_0x32de41,_0x191241){_0x32de41=_0x32de41-0x0;var _0x5b33ec=_0xbaef[_0x32de41];return _0x5b33ec;};'use strict';var Sequelize=require(_0xfbae('0x0'));module[_0xfbae('0x1')]={'tree':{'type':Sequelize[_0xfbae('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 270e49a..9826900 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 _0xbd30=['count','set','apply','update','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3ad12c,_0x2527c0){var _0x4dda5c=function(_0x1a1a94){while(--_0x1a1a94){_0x3ad12c['push'](_0x3ad12c['shift']());}};_0x4dda5c(++_0x2527c0);}(_0xbd30,0xc5));var _0x0bd3=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xbd30[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bd3('0x0'));var zipdir=require(_0x0bd3('0x1'));var jsonpatch=require(_0x0bd3('0x2'));var rp=require('request-promise');var moment=require(_0x0bd3('0x3'));var BPromise=require(_0x0bd3('0x4'));var Mustache=require(_0x0bd3('0x5'));var util=require(_0x0bd3('0x6'));var path=require(_0x0bd3('0x7'));var sox=require(_0x0bd3('0x8'));var csv=require(_0x0bd3('0x9'));var ejs=require(_0x0bd3('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd3('0xb'));var _=require(_0x0bd3('0xc'));var squel=require(_0x0bd3('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bd3('0xe'));var deskjs=require(_0x0bd3('0xf'));var toCsv=require(_0x0bd3('0x9'));var querystring=require(_0x0bd3('0x10'));var Papa=require(_0x0bd3('0x11'));var Redis=require(_0x0bd3('0x12'));var authService=require(_0x0bd3('0x13'));var qs=require(_0x0bd3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd3('0x15'));var logger=require(_0x0bd3('0x16'))(_0x0bd3('0x17'));var utils=require(_0x0bd3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0bd3('0x19'));var db=require(_0x0bd3('0x1a'))['db'];function respondWithStatusCode(_0x1c5194,_0x22736d){_0x22736d=_0x22736d||0xcc;return function(_0x4ade39){if(_0x4ade39){return _0x1c5194[_0x0bd3('0x1b')](_0x22736d);}return _0x1c5194[_0x0bd3('0x1c')](_0x22736d)[_0x0bd3('0x1d')]();};}function respondWithResult(_0x10aaee,_0x1d3ea1){_0x1d3ea1=_0x1d3ea1||0xc8;return function(_0x225e87){if(_0x225e87){return _0x10aaee[_0x0bd3('0x1c')](_0x1d3ea1)[_0x0bd3('0x1e')](_0x225e87);}};}function respondWithFilteredResult(_0x3ede23,_0x14796a){return function(_0x5b207b){if(_0x5b207b){var _0x55e83f=typeof _0x14796a[_0x0bd3('0x1f')]===_0x0bd3('0x20')&&typeof _0x14796a[_0x0bd3('0x21')]===_0x0bd3('0x20');var _0x21400b=_0x5b207b[_0x0bd3('0x22')];var _0x2a5699=_0x55e83f?0x0:_0x14796a[_0x0bd3('0x1f')];var _0x38e269=_0x55e83f?_0x5b207b[_0x0bd3('0x22')]:_0x14796a[_0x0bd3('0x1f')]+_0x14796a[_0x0bd3('0x21')];var _0xd2f5fe;if(_0x38e269>=_0x21400b){_0x38e269=_0x21400b;_0xd2f5fe=0xc8;}else{_0xd2f5fe=0xce;}_0x3ede23[_0x0bd3('0x1c')](_0xd2f5fe);return _0x3ede23[_0x0bd3('0x23')]('Content-Range',_0x2a5699+'-'+_0x38e269+'/'+_0x21400b)[_0x0bd3('0x1e')](_0x5b207b);}return null;};}function patchUpdates(_0xb91ea1){return function(_0x46a846){try{jsonpatch[_0x0bd3('0x24')](_0x46a846,_0xb91ea1,!![]);}catch(_0x256b83){return BPromise['reject'](_0x256b83);}return _0x46a846['save']();};}function saveUpdates(_0x15fde3,_0xab7c45){return function(_0x2868c0){if(_0x2868c0){return _0x2868c0[_0x0bd3('0x25')](_0x15fde3)['then'](function(_0x121e10){return _0x121e10;});}return null;};}function removeEntity(_0x54ce57,_0x580a11){return function(_0x2fef65){if(_0x2fef65){return _0x2fef65[_0x0bd3('0x26')]()['then'](function(){_0x54ce57[_0x0bd3('0x1c')](0xcc)[_0x0bd3('0x1d')]();});}};}function handleEntityNotFound(_0x49940a,_0x4ca4c8){return function(_0x572334){if(!_0x572334){_0x49940a[_0x0bd3('0x1b')](0x194);}return _0x572334;};}function handleError(_0x53faf9,_0x288f35){_0x288f35=_0x288f35||0x1f4;return function(_0x39c308){logger[_0x0bd3('0x27')](_0x39c308['stack']);if(_0x39c308[_0x0bd3('0x28')]){delete _0x39c308[_0x0bd3('0x28')];}_0x53faf9['status'](_0x288f35)[_0x0bd3('0x29')](_0x39c308);};}exports[_0x0bd3('0x2a')]=function(_0xbec01b,_0x21ea6e){var _0x32ee16={},_0xbaf9ce={},_0x6bc2e5={'count':0x0,'rows':[]};var _0x26345f=_[_0x0bd3('0x2b')](db[_0x0bd3('0x2c')][_0x0bd3('0x2d')],function(_0x59ea57){return{'name':_0x59ea57[_0x0bd3('0x2e')],'type':_0x59ea57[_0x0bd3('0x2f')][_0x0bd3('0x30')]};});_0xbaf9ce[_0x0bd3('0x31')]=_['map'](_0x26345f,_0x0bd3('0x28'));_0xbaf9ce[_0x0bd3('0x32')]=_['keys'](_0xbec01b['query']);_0xbaf9ce[_0x0bd3('0x33')]=_[_0x0bd3('0x34')](_0xbaf9ce[_0x0bd3('0x31')],_0xbaf9ce[_0x0bd3('0x32')]);_0x32ee16[_0x0bd3('0x35')]=_[_0x0bd3('0x34')](_0xbaf9ce[_0x0bd3('0x31')],qs['fields'](_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x36')]));_0x32ee16[_0x0bd3('0x35')]=_0x32ee16[_0x0bd3('0x35')][_0x0bd3('0x37')]?_0x32ee16[_0x0bd3('0x35')]:_0xbaf9ce[_0x0bd3('0x31')];if(!_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x38')](_0x0bd3('0x39'))){_0x32ee16[_0x0bd3('0x21')]=qs[_0x0bd3('0x21')](_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x21')]);_0x32ee16[_0x0bd3('0x1f')]=qs['offset'](_0xbec01b['query']['offset']);}_0x32ee16[_0x0bd3('0x3a')]=qs[_0x0bd3('0x3b')](_0xbec01b['query'][_0x0bd3('0x3b')]);_0x32ee16[_0x0bd3('0x3c')]=qs['filters'](_[_0x0bd3('0x3d')](_0xbec01b[_0x0bd3('0x32')],_0xbaf9ce[_0x0bd3('0x33')]),_0x26345f);if(_0xbec01b['query'][_0x0bd3('0x3e')]){_0x32ee16[_0x0bd3('0x3c')]=_[_0x0bd3('0x3f')](_0x32ee16['where'],{'$or':_[_0x0bd3('0x2b')](_0x26345f,function(_0x5200eb){if(_0x5200eb[_0x0bd3('0x2f')]!=='VIRTUAL'){var _0x39be57={};_0x39be57[_0x5200eb[_0x0bd3('0x28')]]={'$like':'%'+_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x3e')]+'%'};return _0x39be57;}})});}_0x32ee16=_['merge']({},_0x32ee16,_0xbec01b[_0x0bd3('0x40')]);var _0x3a471b={'where':_0x32ee16[_0x0bd3('0x3c')]};return db['AnalyticTreeReport']['count'](_0x3a471b)[_0x0bd3('0x41')](function(_0x2157ce){_0x6bc2e5[_0x0bd3('0x22')]=_0x2157ce;if(_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x42')]){_0x32ee16[_0x0bd3('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0bd3('0x44')](_0x32ee16);})[_0x0bd3('0x41')](function(_0x595bfc){_0x6bc2e5[_0x0bd3('0x45')]=_0x595bfc;return _0x6bc2e5;})[_0x0bd3('0x41')](respondWithFilteredResult(_0x21ea6e,_0x32ee16))['catch'](handleError(_0x21ea6e,null));};exports[_0x0bd3('0x46')]=function(_0x4a7c0c,_0x5965e3){var _0x298250={'raw':!![],'where':{'id':_0x4a7c0c[_0x0bd3('0x47')]['id']}},_0x95b67d={};_0x95b67d['model']=_[_0x0bd3('0x48')](db['AnalyticTreeReport'][_0x0bd3('0x2d')]);_0x95b67d[_0x0bd3('0x32')]=_[_0x0bd3('0x48')](_0x4a7c0c[_0x0bd3('0x32')]);_0x95b67d[_0x0bd3('0x33')]=_['intersection'](_0x95b67d['model'],_0x95b67d['query']);_0x298250[_0x0bd3('0x35')]=_[_0x0bd3('0x34')](_0x95b67d[_0x0bd3('0x31')],qs[_0x0bd3('0x36')](_0x4a7c0c[_0x0bd3('0x32')]['fields']));_0x298250[_0x0bd3('0x35')]=_0x298250['attributes']['length']?_0x298250[_0x0bd3('0x35')]:_0x95b67d[_0x0bd3('0x31')];if(_0x4a7c0c[_0x0bd3('0x32')][_0x0bd3('0x42')]){_0x298250['include']=[{'all':!![]}];}_0x298250=_[_0x0bd3('0x3f')]({},_0x298250,_0x4a7c0c[_0x0bd3('0x40')]);return db[_0x0bd3('0x2c')][_0x0bd3('0x49')](_0x298250)[_0x0bd3('0x41')](handleEntityNotFound(_0x5965e3,null))['then'](respondWithResult(_0x5965e3,null))[_0x0bd3('0x4a')](handleError(_0x5965e3,null));};exports['create']=function(_0x57d096,_0x25cd86){return db[_0x0bd3('0x2c')][_0x0bd3('0x4b')](_0x57d096[_0x0bd3('0x4c')],{})[_0x0bd3('0x41')](respondWithResult(_0x25cd86,0xc9))[_0x0bd3('0x4a')](handleError(_0x25cd86,null));};exports[_0x0bd3('0x25')]=function(_0x5527ec,_0x2917c7){if(_0x5527ec['body']['id']){delete _0x5527ec[_0x0bd3('0x4c')]['id'];}return db[_0x0bd3('0x2c')][_0x0bd3('0x49')]({'where':{'id':_0x5527ec[_0x0bd3('0x47')]['id']}})[_0x0bd3('0x41')](handleEntityNotFound(_0x2917c7,null))['then'](saveUpdates(_0x5527ec['body'],null))[_0x0bd3('0x41')](respondWithResult(_0x2917c7,null))[_0x0bd3('0x4a')](handleError(_0x2917c7,null));};exports['destroy']=function(_0xf3672e,_0x3a37c9){return db[_0x0bd3('0x2c')][_0x0bd3('0x49')]({'where':{'id':_0xf3672e[_0x0bd3('0x47')]['id']}})[_0x0bd3('0x41')](handleEntityNotFound(_0x3a37c9,null))['then'](removeEntity(_0x3a37c9,null))[_0x0bd3('0x4a')](handleError(_0x3a37c9,null));};
\ No newline at end of file
+var _0xf213=['querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf213,0x86));var _0x3f21=function(_0x3a8747,_0x2be23d){_0x3a8747=_0x3a8747-0x0;var _0x3e80f5=_0xf213[_0x3a8747];return _0x3e80f5;};'use strict';var emlformat=require(_0x3f21('0x0'));var rimraf=require(_0x3f21('0x1'));var zipdir=require(_0x3f21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f21('0x3'));var moment=require(_0x3f21('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f21('0x5'));var path=require(_0x3f21('0x6'));var sox=require(_0x3f21('0x7'));var csv=require(_0x3f21('0x8'));var ejs=require(_0x3f21('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f21('0xa'));var squel=require(_0x3f21('0xb'));var crypto=require(_0x3f21('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f21('0xd'));var toCsv=require(_0x3f21('0x8'));var querystring=require(_0x3f21('0xe'));var Papa=require(_0x3f21('0xf'));var Redis=require(_0x3f21('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f21('0x11'));var logger=require(_0x3f21('0x12'))('api');var utils=require(_0x3f21('0x13'));var config=require(_0x3f21('0x14'));var licenseUtil=require(_0x3f21('0x15'));var db=require(_0x3f21('0x16'))['db'];function respondWithStatusCode(_0x4920f4,_0x2a6b63){_0x2a6b63=_0x2a6b63||0xcc;return function(_0x29c4c8){if(_0x29c4c8){return _0x4920f4[_0x3f21('0x17')](_0x2a6b63);}return _0x4920f4[_0x3f21('0x18')](_0x2a6b63)[_0x3f21('0x19')]();};}function respondWithResult(_0x43a22d,_0x4236c3){_0x4236c3=_0x4236c3||0xc8;return function(_0x3b67ae){if(_0x3b67ae){return _0x43a22d[_0x3f21('0x18')](_0x4236c3)[_0x3f21('0x1a')](_0x3b67ae);}};}function respondWithFilteredResult(_0x72f347,_0x5c3fdb){return function(_0x459ac3){if(_0x459ac3){var _0x1fb411=typeof _0x5c3fdb['offset']===_0x3f21('0x1b')&&typeof _0x5c3fdb[_0x3f21('0x1c')]==='undefined';var _0x31cafd=_0x459ac3['count'];var _0x4e060c=_0x1fb411?0x0:_0x5c3fdb[_0x3f21('0x1d')];var _0x17e394=_0x1fb411?_0x459ac3[_0x3f21('0x1e')]:_0x5c3fdb[_0x3f21('0x1d')]+_0x5c3fdb[_0x3f21('0x1c')];var _0x360b40;if(_0x17e394>=_0x31cafd){_0x17e394=_0x31cafd;_0x360b40=0xc8;}else{_0x360b40=0xce;}_0x72f347[_0x3f21('0x18')](_0x360b40);return _0x72f347[_0x3f21('0x1f')]('Content-Range',_0x4e060c+'-'+_0x17e394+'/'+_0x31cafd)[_0x3f21('0x1a')](_0x459ac3);}return null;};}function patchUpdates(_0x54bd62){return function(_0x103fa3){try{jsonpatch[_0x3f21('0x20')](_0x103fa3,_0x54bd62,!![]);}catch(_0x5dc58f){return BPromise[_0x3f21('0x21')](_0x5dc58f);}return _0x103fa3[_0x3f21('0x22')]();};}function saveUpdates(_0x3b43bd,_0x102b80){return function(_0x12e0f1){if(_0x12e0f1){return _0x12e0f1[_0x3f21('0x23')](_0x3b43bd)[_0x3f21('0x24')](function(_0x221943){return _0x221943;});}return null;};}function removeEntity(_0x4a01d9,_0x129b6f){return function(_0x4d3f18){if(_0x4d3f18){return _0x4d3f18[_0x3f21('0x25')]()[_0x3f21('0x24')](function(){_0x4a01d9[_0x3f21('0x18')](0xcc)[_0x3f21('0x19')]();});}};}function handleEntityNotFound(_0x4c48ec,_0x4dc0e3){return function(_0x24686c){if(!_0x24686c){_0x4c48ec[_0x3f21('0x17')](0x194);}return _0x24686c;};}function handleError(_0x443f42,_0x24b218){_0x24b218=_0x24b218||0x1f4;return function(_0x1480b8){logger[_0x3f21('0x26')](_0x1480b8[_0x3f21('0x27')]);if(_0x1480b8['name']){delete _0x1480b8[_0x3f21('0x28')];}_0x443f42[_0x3f21('0x18')](_0x24b218)[_0x3f21('0x29')](_0x1480b8);};}exports[_0x3f21('0x2a')]=function(_0x43fb8f,_0x1a96ee){var _0x4b28d5={},_0x115e5f={},_0x5802cc={'count':0x0,'rows':[]};var _0x8fe49c=_[_0x3f21('0x2b')](db[_0x3f21('0x2c')][_0x3f21('0x2d')],function(_0x177a0e){return{'name':_0x177a0e[_0x3f21('0x2e')],'type':_0x177a0e[_0x3f21('0x2f')]['key']};});_0x115e5f[_0x3f21('0x30')]=_[_0x3f21('0x2b')](_0x8fe49c,_0x3f21('0x28'));_0x115e5f[_0x3f21('0x31')]=_[_0x3f21('0x32')](_0x43fb8f[_0x3f21('0x31')]);_0x115e5f[_0x3f21('0x33')]=_[_0x3f21('0x34')](_0x115e5f[_0x3f21('0x30')],_0x115e5f[_0x3f21('0x31')]);_0x4b28d5[_0x3f21('0x35')]=_[_0x3f21('0x34')](_0x115e5f[_0x3f21('0x30')],qs[_0x3f21('0x36')](_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x36')]));_0x4b28d5[_0x3f21('0x35')]=_0x4b28d5['attributes'][_0x3f21('0x37')]?_0x4b28d5['attributes']:_0x115e5f[_0x3f21('0x30')];if(!_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x38')]('nolimit')){_0x4b28d5[_0x3f21('0x1c')]=qs['limit'](_0x43fb8f['query'][_0x3f21('0x1c')]);_0x4b28d5[_0x3f21('0x1d')]=qs[_0x3f21('0x1d')](_0x43fb8f['query'][_0x3f21('0x1d')]);}_0x4b28d5[_0x3f21('0x39')]=qs[_0x3f21('0x3a')](_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x3a')]);_0x4b28d5[_0x3f21('0x3b')]=qs[_0x3f21('0x33')](_[_0x3f21('0x3c')](_0x43fb8f[_0x3f21('0x31')],_0x115e5f[_0x3f21('0x33')]),_0x8fe49c);if(_0x43fb8f[_0x3f21('0x31')]['filter']){_0x4b28d5['where']=_[_0x3f21('0x3d')](_0x4b28d5[_0x3f21('0x3b')],{'$or':_['map'](_0x8fe49c,function(_0x2b288a){if(_0x2b288a[_0x3f21('0x2f')]!==_0x3f21('0x3e')){var _0x2698b8={};_0x2698b8[_0x2b288a[_0x3f21('0x28')]]={'$like':'%'+_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x3f')]+'%'};return _0x2698b8;}})});}_0x4b28d5=_['merge']({},_0x4b28d5,_0x43fb8f[_0x3f21('0x40')]);var _0x5623dd={'where':_0x4b28d5[_0x3f21('0x3b')]};return db['AnalyticTreeReport'][_0x3f21('0x1e')](_0x5623dd)[_0x3f21('0x24')](function(_0x21ca4b){_0x5802cc[_0x3f21('0x1e')]=_0x21ca4b;if(_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x41')]){_0x4b28d5[_0x3f21('0x42')]=[{'all':!![]}];}return db[_0x3f21('0x2c')][_0x3f21('0x43')](_0x4b28d5);})[_0x3f21('0x24')](function(_0x43cfb7){_0x5802cc[_0x3f21('0x44')]=_0x43cfb7;return _0x5802cc;})[_0x3f21('0x24')](respondWithFilteredResult(_0x1a96ee,_0x4b28d5))['catch'](handleError(_0x1a96ee,null));};exports['show']=function(_0x328cf8,_0x8b7f8b){var _0xa2f477={'raw':!![],'where':{'id':_0x328cf8[_0x3f21('0x45')]['id']}},_0x1dc75f={};_0x1dc75f[_0x3f21('0x30')]=_[_0x3f21('0x32')](db[_0x3f21('0x2c')]['rawAttributes']);_0x1dc75f['query']=_[_0x3f21('0x32')](_0x328cf8[_0x3f21('0x31')]);_0x1dc75f['filters']=_['intersection'](_0x1dc75f[_0x3f21('0x30')],_0x1dc75f[_0x3f21('0x31')]);_0xa2f477[_0x3f21('0x35')]=_[_0x3f21('0x34')](_0x1dc75f['model'],qs[_0x3f21('0x36')](_0x328cf8[_0x3f21('0x31')]['fields']));_0xa2f477[_0x3f21('0x35')]=_0xa2f477['attributes'][_0x3f21('0x37')]?_0xa2f477[_0x3f21('0x35')]:_0x1dc75f[_0x3f21('0x30')];if(_0x328cf8[_0x3f21('0x31')][_0x3f21('0x41')]){_0xa2f477[_0x3f21('0x42')]=[{'all':!![]}];}_0xa2f477=_['merge']({},_0xa2f477,_0x328cf8[_0x3f21('0x40')]);return db[_0x3f21('0x2c')]['find'](_0xa2f477)['then'](handleEntityNotFound(_0x8b7f8b,null))['then'](respondWithResult(_0x8b7f8b,null))[_0x3f21('0x46')](handleError(_0x8b7f8b,null));};exports[_0x3f21('0x47')]=function(_0x34069a,_0x255c94){return db[_0x3f21('0x2c')]['create'](_0x34069a[_0x3f21('0x48')],{})['then'](respondWithResult(_0x255c94,0xc9))[_0x3f21('0x46')](handleError(_0x255c94,null));};exports[_0x3f21('0x23')]=function(_0x1cbdf6,_0x4be1ba){if(_0x1cbdf6['body']['id']){delete _0x1cbdf6['body']['id'];}return db[_0x3f21('0x2c')][_0x3f21('0x49')]({'where':{'id':_0x1cbdf6[_0x3f21('0x45')]['id']}})[_0x3f21('0x24')](handleEntityNotFound(_0x4be1ba,null))['then'](saveUpdates(_0x1cbdf6['body'],null))['then'](respondWithResult(_0x4be1ba,null))['catch'](handleError(_0x4be1ba,null));};exports[_0x3f21('0x25')]=function(_0x3e95c0,_0x119439){return db['AnalyticTreeReport'][_0x3f21('0x49')]({'where':{'id':_0x3e95c0['params']['id']}})[_0x3f21('0x24')](handleEntityNotFound(_0x119439,null))[_0x3f21('0x24')](removeEntity(_0x119439,null))['catch'](handleError(_0x119439,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8b71ca9..e4e10fd 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 _0x5ff4=['api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger'];(function(_0x363ed1,_0x18d67){var _0x1b6df0=function(_0x1ca7c9){while(--_0x1ca7c9){_0x363ed1['push'](_0x363ed1['shift']());}};_0x1b6df0(++_0x18d67);}(_0x5ff4,0x1de));var _0x45ff=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5ff4[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x45ff('0x0'));var logger=require(_0x45ff('0x1'))(_0x45ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x45ff('0x3'));var fs=require('fs');var path=require(_0x45ff('0x4'));var rimraf=require(_0x45ff('0x5'));var config=require(_0x45ff('0x6'));var attributes=require(_0x45ff('0x7'));module['exports']=function(_0x1f482f,_0x5493c0){return _0x1f482f[_0x45ff('0x8')](_0x45ff('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39ed=['exports','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x39ed,0x1c4));var _0xd39e=function(_0x5a2019,_0x22a3aa){_0x5a2019=_0x5a2019-0x0;var _0x537ef3=_0x39ed[_0x5a2019];return _0x537ef3;};'use strict';var _=require('lodash');var util=require(_0xd39e('0x0'));var logger=require(_0xd39e('0x1'))(_0xd39e('0x2'));var moment=require(_0xd39e('0x3'));var BPromise=require(_0xd39e('0x4'));var rp=require(_0xd39e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd39e('0x6'));var config=require(_0xd39e('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xd39e('0x8')]=function(_0x3e59c3,_0x4efd25){return _0x3e59c3['define'](_0xd39e('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 109f66f..47e4e26 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4f21cd,_0x30f06f){var _0x1af331=function(_0x51145e){while(--_0x51145e){_0x4f21cd['push'](_0x4f21cd['shift']());}};_0x1af331(++_0x30f06f);}(_0xadb5,0xad));var _0x5adb=function(_0x563658,_0x5512dc){_0x563658=_0x563658-0x0;var _0x384716=_0xadb5[_0x563658];return _0x384716;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2244f5,_0xf5a038){var _0x3ee41c=function(_0xaecef4){while(--_0xaecef4){_0x2244f5['push'](_0x2244f5['shift']());}};_0x3ee41c(++_0xf5a038);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c2afefb..2415734 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 _0x0679=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','create','put','update','delete','exports','multer','util','path'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0679,0x1c5));var _0x9067=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0679[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var path=require(_0x9067('0x2'));var timeout=require(_0x9067('0x3'));var express=require('express');var router=express[_0x9067('0x4')]();var fs_extra=require(_0x9067('0x5'));var auth=require(_0x9067('0x6'));var interaction=require(_0x9067('0x7'));var config=require(_0x9067('0x8'));var controller=require(_0x9067('0x9'));router['get']('/',auth[_0x9067('0xa')](),controller['index']);router[_0x9067('0xb')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller[_0x9067('0xd')]);router['post']('/',auth[_0x9067('0xa')](),controller[_0x9067('0xe')]);router[_0x9067('0xf')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller[_0x9067('0x10')]);router[_0x9067('0x11')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller['destroy']);module[_0x9067('0x12')]=router;
\ No newline at end of file
+var _0xcbc0=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','post','create','put','isAuthenticated','delete','destroy','multer'];(function(_0x53abde,_0x4892be){var _0x4234a7=function(_0x4b4b8f){while(--_0x4b4b8f){_0x53abde['push'](_0x53abde['shift']());}};_0x4234a7(++_0x4892be);}(_0xcbc0,0x186));var _0x0cbc=function(_0x196910,_0x1a2f0d){_0x196910=_0x196910-0x0;var _0x2706f6=_0xcbc0[_0x196910];return _0x2706f6;};'use strict';var multer=require(_0x0cbc('0x0'));var util=require(_0x0cbc('0x1'));var path=require(_0x0cbc('0x2'));var timeout=require(_0x0cbc('0x3'));var express=require(_0x0cbc('0x4'));var router=express[_0x0cbc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0cbc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0cbc('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x0cbc('0x8')]('/',auth['isAuthenticated'](),controller[_0x0cbc('0x9')]);router[_0x0cbc('0x8')](_0x0cbc('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0cbc('0xb')]('/',auth['isAuthenticated'](),controller[_0x0cbc('0xc')]);router[_0x0cbc('0xd')](_0x0cbc('0xa'),auth[_0x0cbc('0xe')](),controller['update']);router[_0x0cbc('0xf')](_0x0cbc('0xa'),auth[_0x0cbc('0xe')](),controller[_0x0cbc('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 9092db4..f5a1713 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 _0x0834=['STRING'];(function(_0x54ad80,_0x5192e1){var _0x2a1c47=function(_0x359bba){while(--_0x359bba){_0x54ad80['push'](_0x54ad80['shift']());}};_0x2a1c47(++_0x5192e1);}(_0x0834,0x18e));var _0x4083=function(_0x37bf46,_0xef491d){_0x37bf46=_0x37bf46-0x0;var _0x256dff=_0x0834[_0x37bf46];return _0x256dff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4083('0x0')]},'basename':{'type':Sequelize[_0x4083('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd4b6=['STRING','sequelize','exports'];(function(_0x3c0ef6,_0x450944){var _0x5b363c=function(_0xa07dbc){while(--_0xa07dbc){_0x3c0ef6['push'](_0x3c0ef6['shift']());}};_0x5b363c(++_0x450944);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x49f73d,_0x5cb41e){_0x49f73d=_0x49f73d-0x0;var _0x372d74=_0xd4b6[_0x49f73d];return _0x372d74;};'use strict';var Sequelize=require(_0x6d4b('0x0'));module[_0x6d4b('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x6d4b('0x2')]},'type':{'type':Sequelize[_0x6d4b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 649df41..881981f 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 _0x5242=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','clone','params','get','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1465e3,_0x536a46){var _0x3c136f=function(_0x2a36c8){while(--_0x2a36c8){_0x1465e3['push'](_0x1465e3['shift']());}};_0x3c136f(++_0x536a46);}(_0x5242,0xa4));var _0x2524=function(_0x57acea,_0x559f88){_0x57acea=_0x57acea-0x0;var _0x39a157=_0x5242[_0x57acea];return _0x39a157;};'use strict';var emlformat=require(_0x2524('0x0'));var rimraf=require(_0x2524('0x1'));var zipdir=require(_0x2524('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2524('0x3'));var moment=require('moment');var BPromise=require(_0x2524('0x4'));var Mustache=require(_0x2524('0x5'));var util=require('util');var path=require(_0x2524('0x6'));var sox=require(_0x2524('0x7'));var csv=require(_0x2524('0x8'));var ejs=require(_0x2524('0x9'));var fs=require('fs');var fs_extra=require(_0x2524('0xa'));var _=require(_0x2524('0xb'));var squel=require(_0x2524('0xc'));var crypto=require(_0x2524('0xd'));var jsforce=require(_0x2524('0xe'));var deskjs=require(_0x2524('0xf'));var toCsv=require(_0x2524('0x8'));var querystring=require(_0x2524('0x10'));var Papa=require(_0x2524('0x11'));var Redis=require('ioredis');var authService=require(_0x2524('0x12'));var qs=require(_0x2524('0x13'));var as=require(_0x2524('0x14'));var hardwareService=require(_0x2524('0x15'));var logger=require(_0x2524('0x16'))('api');var utils=require(_0x2524('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2524('0x18'));var db=require(_0x2524('0x19'))['db'];function respondWithStatusCode(_0x217c2f,_0x525bfd){_0x525bfd=_0x525bfd||0xcc;return function(_0x55ae0a){if(_0x55ae0a){return _0x217c2f['sendStatus'](_0x525bfd);}return _0x217c2f[_0x2524('0x1a')](_0x525bfd)[_0x2524('0x1b')]();};}function respondWithResult(_0x4ec996,_0x4dfdd2){_0x4dfdd2=_0x4dfdd2||0xc8;return function(_0x413a48){if(_0x413a48){return _0x4ec996['status'](_0x4dfdd2)[_0x2524('0x1c')](_0x413a48);}};}function respondWithFilteredResult(_0x4862fc,_0x5d5eb2){return function(_0x43fe24){if(_0x43fe24){var _0x3beb02=typeof _0x5d5eb2[_0x2524('0x1d')]===_0x2524('0x1e')&&typeof _0x5d5eb2[_0x2524('0x1f')]==='undefined';var _0xc365bb=_0x43fe24['count'];var _0x4a32be=_0x3beb02?0x0:_0x5d5eb2[_0x2524('0x1d')];var _0x1e46f6=_0x3beb02?_0x43fe24[_0x2524('0x20')]:_0x5d5eb2[_0x2524('0x1d')]+_0x5d5eb2[_0x2524('0x1f')];var _0x2b889c;if(_0x1e46f6>=_0xc365bb){_0x1e46f6=_0xc365bb;_0x2b889c=0xc8;}else{_0x2b889c=0xce;}_0x4862fc[_0x2524('0x1a')](_0x2b889c);return _0x4862fc[_0x2524('0x21')](_0x2524('0x22'),_0x4a32be+'-'+_0x1e46f6+'/'+_0xc365bb)[_0x2524('0x1c')](_0x43fe24);}return null;};}function patchUpdates(_0x30eb66){return function(_0x5cb952){try{jsonpatch[_0x2524('0x23')](_0x5cb952,_0x30eb66,!![]);}catch(_0x2d7c6e){return BPromise[_0x2524('0x24')](_0x2d7c6e);}return _0x5cb952[_0x2524('0x25')]();};}function saveUpdates(_0x50b051,_0x2cbcf6){return function(_0x6d7f9f){if(_0x6d7f9f){return _0x6d7f9f[_0x2524('0x26')](_0x50b051)[_0x2524('0x27')](function(_0x28ffe9){return _0x28ffe9;});}return null;};}function removeEntity(_0x35cb36,_0x2b6425){return function(_0x3f64b4){if(_0x3f64b4){return _0x3f64b4[_0x2524('0x28')]()[_0x2524('0x27')](function(){_0x35cb36[_0x2524('0x1a')](0xcc)[_0x2524('0x1b')]();});}};}function handleEntityNotFound(_0xfea3e0,_0x438c70){return function(_0x47fac3){if(!_0x47fac3){_0xfea3e0[_0x2524('0x29')](0x194);}return _0x47fac3;};}function handleError(_0x26286a,_0x4767bf){_0x4767bf=_0x4767bf||0x1f4;return function(_0x4d0443){logger['error'](_0x4d0443[_0x2524('0x2a')]);if(_0x4d0443[_0x2524('0x2b')]){delete _0x4d0443['name'];}_0x26286a[_0x2524('0x1a')](_0x4767bf)[_0x2524('0x2c')](_0x4d0443);};}exports[_0x2524('0x2d')]=function(_0x5ae69c,_0x10b73d){var _0x33b10d={},_0x297d7c={},_0x1bfb7a={'count':0x0,'rows':[]};var _0x397d87=_[_0x2524('0x2e')](db[_0x2524('0x2f')]['rawAttributes'],function(_0x1d9a39){return{'name':_0x1d9a39[_0x2524('0x30')],'type':_0x1d9a39[_0x2524('0x31')][_0x2524('0x32')]};});_0x297d7c[_0x2524('0x33')]=_[_0x2524('0x2e')](_0x397d87,_0x2524('0x2b'));_0x297d7c[_0x2524('0x34')]=_['keys'](_0x5ae69c[_0x2524('0x34')]);_0x297d7c[_0x2524('0x35')]=_[_0x2524('0x36')](_0x297d7c[_0x2524('0x33')],_0x297d7c[_0x2524('0x34')]);_0x33b10d[_0x2524('0x37')]=_['intersection'](_0x297d7c[_0x2524('0x33')],qs[_0x2524('0x38')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x38')]));_0x33b10d[_0x2524('0x37')]=_0x33b10d['attributes'][_0x2524('0x39')]?_0x33b10d[_0x2524('0x37')]:_0x297d7c[_0x2524('0x33')];if(!_0x5ae69c[_0x2524('0x34')][_0x2524('0x3a')](_0x2524('0x3b'))){_0x33b10d[_0x2524('0x1f')]=qs[_0x2524('0x1f')](_0x5ae69c[_0x2524('0x34')]['limit']);_0x33b10d[_0x2524('0x1d')]=qs[_0x2524('0x1d')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x1d')]);}_0x33b10d['order']=qs[_0x2524('0x3c')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x3c')]);_0x33b10d[_0x2524('0x3d')]=qs['filters'](_[_0x2524('0x3e')](_0x5ae69c[_0x2524('0x34')],_0x297d7c[_0x2524('0x35')]),_0x397d87);if(_0x5ae69c['query'][_0x2524('0x3f')]){_0x33b10d[_0x2524('0x3d')]=_[_0x2524('0x40')](_0x33b10d[_0x2524('0x3d')],{'$or':_[_0x2524('0x2e')](_0x397d87,function(_0x5d14e1){if(_0x5d14e1[_0x2524('0x31')]!=='VIRTUAL'){var _0x3cccc1={};_0x3cccc1[_0x5d14e1[_0x2524('0x2b')]]={'$like':'%'+_0x5ae69c[_0x2524('0x34')][_0x2524('0x3f')]+'%'};return _0x3cccc1;}})});}_0x33b10d=_[_0x2524('0x40')]({},_0x33b10d,_0x5ae69c[_0x2524('0x41')]);var _0x1187ba={'where':_0x33b10d['where']};return db['Attachment'][_0x2524('0x20')](_0x1187ba)[_0x2524('0x27')](function(_0x5f0726){_0x1bfb7a[_0x2524('0x20')]=_0x5f0726;if(_0x5ae69c[_0x2524('0x34')][_0x2524('0x42')]){_0x33b10d[_0x2524('0x43')]=[{'all':!![]}];}return db[_0x2524('0x2f')][_0x2524('0x44')](_0x33b10d);})[_0x2524('0x27')](function(_0x2fd18f){_0x1bfb7a[_0x2524('0x45')]=_0x2fd18f;return _0x1bfb7a;})[_0x2524('0x27')](respondWithFilteredResult(_0x10b73d,_0x33b10d))[_0x2524('0x46')](handleError(_0x10b73d,null));};exports[_0x2524('0x47')]=function(_0x4bfb51,_0x16aeaf){var _0x2cc090={'raw':!![],'where':{'id':_0x4bfb51['params']['id']}},_0x1772a8={};_0x1772a8[_0x2524('0x33')]=_[_0x2524('0x48')](db[_0x2524('0x2f')][_0x2524('0x49')]);_0x1772a8['query']=_[_0x2524('0x48')](_0x4bfb51['query']);_0x1772a8[_0x2524('0x35')]=_['intersection'](_0x1772a8['model'],_0x1772a8['query']);_0x2cc090[_0x2524('0x37')]=_[_0x2524('0x36')](_0x1772a8[_0x2524('0x33')],qs['fields'](_0x4bfb51[_0x2524('0x34')][_0x2524('0x38')]));_0x2cc090[_0x2524('0x37')]=_0x2cc090[_0x2524('0x37')][_0x2524('0x39')]?_0x2cc090[_0x2524('0x37')]:_0x1772a8[_0x2524('0x33')];if(_0x4bfb51[_0x2524('0x34')]['includeAll']){_0x2cc090[_0x2524('0x43')]=[{'all':!![]}];}_0x2cc090=_[_0x2524('0x40')]({},_0x2cc090,_0x4bfb51[_0x2524('0x41')]);return db[_0x2524('0x2f')][_0x2524('0x4a')](_0x2cc090)[_0x2524('0x27')](handleEntityNotFound(_0x16aeaf,null))[_0x2524('0x27')](respondWithResult(_0x16aeaf,null))[_0x2524('0x46')](handleError(_0x16aeaf,null));};exports[_0x2524('0x4b')]=function(_0x5ee82b,_0x438d25){var _0x2d7abb={'where':{'id':_0x5ee82b[_0x2524('0x4c')]['id']}},_0x125004={};_0x125004[_0x2524('0x33')]=_[_0x2524('0x48')](db[_0x2524('0x2f')]['rawAttributes']);_0x2d7abb[_0x2524('0x37')]=_[_0x2524('0x36')](_0x125004[_0x2524('0x33')],qs[_0x2524('0x38')](_0x5ee82b[_0x2524('0x34')][_0x2524('0x38')]));_0x2d7abb[_0x2524('0x37')]=_0x2d7abb[_0x2524('0x37')][_0x2524('0x39')]?_0x2d7abb[_0x2524('0x37')]:_0x125004['model'];if(_0x5ee82b['query']['includeAll']){_0x2d7abb[_0x2524('0x43')]=[{'all':!![]}];}_0x2d7abb=_[_0x2524('0x40')]({},_0x2d7abb,_0x5ee82b[_0x2524('0x41')]);return db[_0x2524('0x2f')][_0x2524('0x4a')](_0x2d7abb)[_0x2524('0x27')](handleEntityNotFound(_0x438d25,null))[_0x2524('0x27')](function(_0xc17a8){if(_0xc17a8){var _0x482599=_0xc17a8[_0x2524('0x4d')]({'plain':!![]});_0x482599=qs[_0x2524('0x4e')](_0x482599,['id','createdAt',_0x2524('0x4f')]);_0x5ee82b[_0x2524('0x50')]=_[_0x2524('0x4e')](_0x5ee82b['body'],['id',_0x2524('0x51'),_0x2524('0x4f')]);return db[_0x2524('0x2f')][_0x2524('0x52')](_[_0x2524('0x40')](_0x482599,_0x5ee82b['body']),{'include':_0x5ee82b[_0x2524('0x34')][_0x2524('0x42')]?[{'all':!![]}]:undefined});}})[_0x2524('0x27')](respondWithResult(_0x438d25,0xc9))[_0x2524('0x46')](handleError(_0x438d25,null));};exports['update']=function(_0x54135c,_0x58d016){if(_0x54135c[_0x2524('0x50')]['id']){delete _0x54135c[_0x2524('0x50')]['id'];}return db[_0x2524('0x2f')]['find']({'where':{'id':_0x54135c[_0x2524('0x4c')]['id']}})[_0x2524('0x27')](handleEntityNotFound(_0x58d016,null))['then'](saveUpdates(_0x54135c[_0x2524('0x50')],null))[_0x2524('0x27')](respondWithResult(_0x58d016,null))[_0x2524('0x46')](handleError(_0x58d016,null));};exports[_0x2524('0x28')]=function(_0x1640d8,_0x2d2459){return db['Attachment'][_0x2524('0x4a')]({'where':{'id':_0x1640d8['params']['id']}})[_0x2524('0x27')](handleEntityNotFound(_0x2d2459,null))['then'](removeEntity(_0x2d2459,null))[_0x2524('0x46')](handleError(_0x2d2459,null));};exports[_0x2524('0x52')]=function(_0x66c076,_0x4b9743,_0xae325f){_0x66c076[_0x2524('0x50')][_0x2524('0x2b')]=_0x66c076[_0x2524('0x53')][_0x2524('0x54')];_0x66c076[_0x2524('0x50')]['basename']=_0x66c076[_0x2524('0x53')][_0x2524('0x55')];_0x66c076['body']['type']=_0x66c076[_0x2524('0x53')][_0x2524('0x56')];return db['Attachment'][_0x2524('0x52')](_0x66c076[_0x2524('0x50')])[_0x2524('0x27')](respondWithResult(_0x4b9743,0xc9))[_0x2524('0x46')](handleError(_0x4b9743,null));};exports[_0x2524('0x57')]=function(_0x1fc4e6,_0x5d7e6c,_0x4b8c57){return db[_0x2524('0x2f')][_0x2524('0x58')]({'where':{'id':_0x1fc4e6[_0x2524('0x4c')]['id']},'raw':!![]})[_0x2524('0x27')](handleEntityNotFound(_0x5d7e6c,null))[_0x2524('0x27')](function(_0x411136){if(_0x411136){var _0x2aa7cb=_0x411136[_0x2524('0x59')]!==null;var _0x4ec036=path[_0x2524('0x5a')](config[_0x2524('0x5b')],_0x2524('0x5c'));if(_0x2aa7cb){_0x4ec036=path['join'](_0x4ec036,_0x2524('0x5d'));}var _0x4446fa=path['join'](_0x4ec036,_0x411136[_0x2524('0x5e')]);return _0x5d7e6c[_0x2524('0x57')](_0x4446fa);}})[_0x2524('0x46')](handleError(_0x5d7e6c,null));};
\ No newline at end of file
+var _0xecae=['../../config/environment','../../config/license/util','../../mysqldb','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','Attachment','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','map','options','includeAll','catch','show','params','rawAttributes','include','clone','length','find','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x32432f,_0x4413c3){var _0x2ddffd=function(_0x46eabe){while(--_0x46eabe){_0x32432f['push'](_0x32432f['shift']());}};_0x2ddffd(++_0x4413c3);}(_0xecae,0xf0));var _0xeeca=function(_0x217e80,_0x1919e8){_0x217e80=_0x217e80-0x0;var _0x6af0c9=_0xecae[_0x217e80];return _0x6af0c9;};'use strict';var emlformat=require(_0xeeca('0x0'));var rimraf=require(_0xeeca('0x1'));var zipdir=require(_0xeeca('0x2'));var jsonpatch=require(_0xeeca('0x3'));var rp=require(_0xeeca('0x4'));var moment=require(_0xeeca('0x5'));var BPromise=require(_0xeeca('0x6'));var Mustache=require('mustache');var util=require(_0xeeca('0x7'));var path=require('path');var sox=require(_0xeeca('0x8'));var csv=require(_0xeeca('0x9'));var ejs=require(_0xeeca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeeca('0xb'));var squel=require(_0xeeca('0xc'));var crypto=require(_0xeeca('0xd'));var jsforce=require(_0xeeca('0xe'));var deskjs=require(_0xeeca('0xf'));var toCsv=require(_0xeeca('0x9'));var querystring=require('querystring');var Papa=require(_0xeeca('0x10'));var Redis=require(_0xeeca('0x11'));var authService=require(_0xeeca('0x12'));var qs=require(_0xeeca('0x13'));var as=require(_0xeeca('0x14'));var hardwareService=require(_0xeeca('0x15'));var logger=require(_0xeeca('0x16'))(_0xeeca('0x17'));var utils=require('../../config/utils');var config=require(_0xeeca('0x18'));var licenseUtil=require(_0xeeca('0x19'));var db=require(_0xeeca('0x1a'))['db'];function respondWithStatusCode(_0x5be891,_0x3388f0){_0x3388f0=_0x3388f0||0xcc;return function(_0x968d55){if(_0x968d55){return _0x5be891['sendStatus'](_0x3388f0);}return _0x5be891['status'](_0x3388f0)['end']();};}function respondWithResult(_0x326430,_0xa9c800){_0xa9c800=_0xa9c800||0xc8;return function(_0x4b0be7){if(_0x4b0be7){return _0x326430['status'](_0xa9c800)[_0xeeca('0x1b')](_0x4b0be7);}};}function respondWithFilteredResult(_0x474bca,_0x3e289b){return function(_0x58d272){if(_0x58d272){var _0x2ac57c=typeof _0x3e289b['offset']===_0xeeca('0x1c')&&typeof _0x3e289b[_0xeeca('0x1d')]==='undefined';var _0x3d33c2=_0x58d272[_0xeeca('0x1e')];var _0x3a2f06=_0x2ac57c?0x0:_0x3e289b[_0xeeca('0x1f')];var _0x5710a7=_0x2ac57c?_0x58d272[_0xeeca('0x1e')]:_0x3e289b[_0xeeca('0x1f')]+_0x3e289b['limit'];var _0x565d09;if(_0x5710a7>=_0x3d33c2){_0x5710a7=_0x3d33c2;_0x565d09=0xc8;}else{_0x565d09=0xce;}_0x474bca[_0xeeca('0x20')](_0x565d09);return _0x474bca[_0xeeca('0x21')](_0xeeca('0x22'),_0x3a2f06+'-'+_0x5710a7+'/'+_0x3d33c2)[_0xeeca('0x1b')](_0x58d272);}return null;};}function patchUpdates(_0x2aea61){return function(_0x5983fa){try{jsonpatch[_0xeeca('0x23')](_0x5983fa,_0x2aea61,!![]);}catch(_0x148ff1){return BPromise[_0xeeca('0x24')](_0x148ff1);}return _0x5983fa[_0xeeca('0x25')]();};}function saveUpdates(_0x51b873,_0x4e248d){return function(_0x2e1e4a){if(_0x2e1e4a){return _0x2e1e4a[_0xeeca('0x26')](_0x51b873)[_0xeeca('0x27')](function(_0x1b05e7){return _0x1b05e7;});}return null;};}function removeEntity(_0xb62c43,_0x756c0){return function(_0x531dfa){if(_0x531dfa){return _0x531dfa[_0xeeca('0x28')]()[_0xeeca('0x27')](function(){_0xb62c43[_0xeeca('0x20')](0xcc)[_0xeeca('0x29')]();});}};}function handleEntityNotFound(_0x43da57,_0x593547){return function(_0x5a1b04){if(!_0x5a1b04){_0x43da57['sendStatus'](0x194);}return _0x5a1b04;};}function handleError(_0x3f7918,_0xf86b0b){_0xf86b0b=_0xf86b0b||0x1f4;return function(_0x3428e9){logger[_0xeeca('0x2a')](_0x3428e9['stack']);if(_0x3428e9['name']){delete _0x3428e9[_0xeeca('0x2b')];}_0x3f7918[_0xeeca('0x20')](_0xf86b0b)[_0xeeca('0x2c')](_0x3428e9);};}exports[_0xeeca('0x2d')]=function(_0x14980c,_0x529923){var _0x2afc79={},_0x3fcf3c={},_0x4149c5={'count':0x0,'rows':[]};var _0x192920=_['map'](db[_0xeeca('0x2e')]['rawAttributes'],function(_0x68fc35){return{'name':_0x68fc35[_0xeeca('0x2f')],'type':_0x68fc35[_0xeeca('0x30')][_0xeeca('0x31')]};});_0x3fcf3c[_0xeeca('0x32')]=_['map'](_0x192920,_0xeeca('0x2b'));_0x3fcf3c[_0xeeca('0x33')]=_[_0xeeca('0x34')](_0x14980c[_0xeeca('0x33')]);_0x3fcf3c[_0xeeca('0x35')]=_['intersection'](_0x3fcf3c[_0xeeca('0x32')],_0x3fcf3c[_0xeeca('0x33')]);_0x2afc79[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x3fcf3c[_0xeeca('0x32')],qs[_0xeeca('0x38')](_0x14980c[_0xeeca('0x33')]['fields']));_0x2afc79[_0xeeca('0x36')]=_0x2afc79[_0xeeca('0x36')]['length']?_0x2afc79['attributes']:_0x3fcf3c[_0xeeca('0x32')];if(!_0x14980c[_0xeeca('0x33')][_0xeeca('0x39')]('nolimit')){_0x2afc79[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x14980c[_0xeeca('0x33')][_0xeeca('0x1d')]);_0x2afc79[_0xeeca('0x1f')]=qs[_0xeeca('0x1f')](_0x14980c['query'][_0xeeca('0x1f')]);}_0x2afc79['order']=qs[_0xeeca('0x3a')](_0x14980c['query'][_0xeeca('0x3a')]);_0x2afc79[_0xeeca('0x3b')]=qs[_0xeeca('0x35')](_[_0xeeca('0x3c')](_0x14980c[_0xeeca('0x33')],_0x3fcf3c['filters']),_0x192920);if(_0x14980c[_0xeeca('0x33')][_0xeeca('0x3d')]){_0x2afc79[_0xeeca('0x3b')]=_[_0xeeca('0x3e')](_0x2afc79['where'],{'$or':_[_0xeeca('0x3f')](_0x192920,function(_0x233a32){if(_0x233a32['type']!=='VIRTUAL'){var _0x462580={};_0x462580[_0x233a32[_0xeeca('0x2b')]]={'$like':'%'+_0x14980c[_0xeeca('0x33')][_0xeeca('0x3d')]+'%'};return _0x462580;}})});}_0x2afc79=_['merge']({},_0x2afc79,_0x14980c[_0xeeca('0x40')]);var _0x545af3={'where':_0x2afc79[_0xeeca('0x3b')]};return db[_0xeeca('0x2e')][_0xeeca('0x1e')](_0x545af3)[_0xeeca('0x27')](function(_0x3247aa){_0x4149c5[_0xeeca('0x1e')]=_0x3247aa;if(_0x14980c['query'][_0xeeca('0x41')]){_0x2afc79['include']=[{'all':!![]}];}return db[_0xeeca('0x2e')]['findAll'](_0x2afc79);})[_0xeeca('0x27')](function(_0x2f9e02){_0x4149c5['rows']=_0x2f9e02;return _0x4149c5;})[_0xeeca('0x27')](respondWithFilteredResult(_0x529923,_0x2afc79))[_0xeeca('0x42')](handleError(_0x529923,null));};exports[_0xeeca('0x43')]=function(_0x3d59d9,_0x294210){var _0x8616b4={'raw':!![],'where':{'id':_0x3d59d9[_0xeeca('0x44')]['id']}},_0x4481ce={};_0x4481ce[_0xeeca('0x32')]=_[_0xeeca('0x34')](db[_0xeeca('0x2e')][_0xeeca('0x45')]);_0x4481ce['query']=_[_0xeeca('0x34')](_0x3d59d9[_0xeeca('0x33')]);_0x4481ce[_0xeeca('0x35')]=_['intersection'](_0x4481ce[_0xeeca('0x32')],_0x4481ce['query']);_0x8616b4[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x4481ce['model'],qs[_0xeeca('0x38')](_0x3d59d9[_0xeeca('0x33')][_0xeeca('0x38')]));_0x8616b4[_0xeeca('0x36')]=_0x8616b4['attributes']['length']?_0x8616b4[_0xeeca('0x36')]:_0x4481ce[_0xeeca('0x32')];if(_0x3d59d9[_0xeeca('0x33')][_0xeeca('0x41')]){_0x8616b4[_0xeeca('0x46')]=[{'all':!![]}];}_0x8616b4=_[_0xeeca('0x3e')]({},_0x8616b4,_0x3d59d9['options']);return db['Attachment']['find'](_0x8616b4)[_0xeeca('0x27')](handleEntityNotFound(_0x294210,null))['then'](respondWithResult(_0x294210,null))[_0xeeca('0x42')](handleError(_0x294210,null));};exports[_0xeeca('0x47')]=function(_0x42f985,_0x6ff743){var _0x52c956={'where':{'id':_0x42f985['params']['id']}},_0x479b37={};_0x479b37['model']=_['keys'](db[_0xeeca('0x2e')]['rawAttributes']);_0x52c956['attributes']=_[_0xeeca('0x37')](_0x479b37['model'],qs[_0xeeca('0x38')](_0x42f985[_0xeeca('0x33')][_0xeeca('0x38')]));_0x52c956['attributes']=_0x52c956[_0xeeca('0x36')][_0xeeca('0x48')]?_0x52c956[_0xeeca('0x36')]:_0x479b37[_0xeeca('0x32')];if(_0x42f985[_0xeeca('0x33')][_0xeeca('0x41')]){_0x52c956[_0xeeca('0x46')]=[{'all':!![]}];}_0x52c956=_['merge']({},_0x52c956,_0x42f985['options']);return db[_0xeeca('0x2e')][_0xeeca('0x49')](_0x52c956)[_0xeeca('0x27')](handleEntityNotFound(_0x6ff743,null))[_0xeeca('0x27')](function(_0x51594c){if(_0x51594c){var _0xfcedd1=_0x51594c['get']({'plain':!![]});_0xfcedd1=qs[_0xeeca('0x4a')](_0xfcedd1,['id',_0xeeca('0x4b'),_0xeeca('0x4c')]);_0x42f985[_0xeeca('0x4d')]=_[_0xeeca('0x4a')](_0x42f985[_0xeeca('0x4d')],['id',_0xeeca('0x4b'),_0xeeca('0x4c')]);return db[_0xeeca('0x2e')][_0xeeca('0x4e')](_[_0xeeca('0x3e')](_0xfcedd1,_0x42f985['body']),{'include':_0x42f985[_0xeeca('0x33')][_0xeeca('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x6ff743,0xc9))[_0xeeca('0x42')](handleError(_0x6ff743,null));};exports['update']=function(_0x1e728c,_0x1c8652){if(_0x1e728c[_0xeeca('0x4d')]['id']){delete _0x1e728c[_0xeeca('0x4d')]['id'];}return db[_0xeeca('0x2e')][_0xeeca('0x49')]({'where':{'id':_0x1e728c['params']['id']}})[_0xeeca('0x27')](handleEntityNotFound(_0x1c8652,null))[_0xeeca('0x27')](saveUpdates(_0x1e728c[_0xeeca('0x4d')],null))[_0xeeca('0x27')](respondWithResult(_0x1c8652,null))[_0xeeca('0x42')](handleError(_0x1c8652,null));};exports[_0xeeca('0x28')]=function(_0x228147,_0x464c16){return db[_0xeeca('0x2e')]['find']({'where':{'id':_0x228147['params']['id']}})[_0xeeca('0x27')](handleEntityNotFound(_0x464c16,null))[_0xeeca('0x27')](removeEntity(_0x464c16,null))[_0xeeca('0x42')](handleError(_0x464c16,null));};exports[_0xeeca('0x4e')]=function(_0x13d7a9,_0x42c802,_0x402860){_0x13d7a9[_0xeeca('0x4d')][_0xeeca('0x2b')]=_0x13d7a9[_0xeeca('0x4f')][_0xeeca('0x50')];_0x13d7a9[_0xeeca('0x4d')][_0xeeca('0x51')]=_0x13d7a9[_0xeeca('0x4f')]['filename'];_0x13d7a9['body'][_0xeeca('0x30')]=_0x13d7a9[_0xeeca('0x4f')][_0xeeca('0x52')];return db[_0xeeca('0x2e')]['create'](_0x13d7a9[_0xeeca('0x4d')])['then'](respondWithResult(_0x42c802,0xc9))[_0xeeca('0x42')](handleError(_0x42c802,null));};exports[_0xeeca('0x53')]=function(_0x452ca2,_0x592376,_0x2a46bc){return db[_0xeeca('0x2e')]['findOne']({'where':{'id':_0x452ca2[_0xeeca('0x44')]['id']},'raw':!![]})[_0xeeca('0x27')](handleEntityNotFound(_0x592376,null))[_0xeeca('0x27')](function(_0x430513){if(_0x430513){var _0x42b2d3=_0x430513[_0xeeca('0x54')]!==null;var _0x838d15=path['join'](config[_0xeeca('0x55')],_0xeeca('0x56'));if(_0x42b2d3){_0x838d15=path['join'](_0x838d15,'offline-chat/');}var _0xac84a9=path[_0xeeca('0x57')](_0x838d15,_0x430513['basename']);return _0x592376[_0xeeca('0x53')](_0xac84a9);}})[_0xeeca('0x42')](handleError(_0x592376,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 516c862..c0e1f8f 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 _0x8048=['Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x33c1cb,_0x165064){var _0x28fe90=function(_0x2d2442){while(--_0x2d2442){_0x33c1cb['push'](_0x33c1cb['shift']());}};_0x28fe90(++_0x165064);}(_0x8048,0x183));var _0x8804=function(_0x113bee,_0x1ded16){_0x113bee=_0x113bee-0x0;var _0x19875f=_0x8048[_0x113bee];return _0x19875f;};'use strict';var _=require('lodash');var util=require(_0x8804('0x0'));var logger=require(_0x8804('0x1'))('api');var moment=require(_0x8804('0x2'));var BPromise=require(_0x8804('0x3'));var rp=require(_0x8804('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8804('0x5'));var config=require(_0x8804('0x6'));var attributes=require(_0x8804('0x7'));module['exports']=function(_0x570780,_0x35825e){return _0x570780[_0x8804('0x8')](_0x8804('0x9'),attributes,{'tableName':_0x8804('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa39a=['exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x1a7099,_0x58bb8d){var _0x7187fe=function(_0x20d33e){while(--_0x20d33e){_0x1a7099['push'](_0x1a7099['shift']());}};_0x7187fe(++_0x58bb8d);}(_0xa39a,0x108));var _0xaa39=function(_0x2b6e77,_0x569fe8){_0x2b6e77=_0x2b6e77-0x0;var _0x492041=_0xa39a[_0x2b6e77];return _0x492041;};'use strict';var _=require(_0xaa39('0x0'));var util=require('util');var logger=require(_0xaa39('0x1'))(_0xaa39('0x2'));var moment=require(_0xaa39('0x3'));var BPromise=require(_0xaa39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa39('0x5'));var rimraf=require(_0xaa39('0x6'));var config=require(_0xaa39('0x7'));var attributes=require(_0xaa39('0x8'));module[_0xaa39('0x9')]=function(_0x2ab01b,_0x912512){return _0x2ab01b[_0xaa39('0xa')](_0xaa39('0xb'),attributes,{'tableName':_0xaa39('0xc'),'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 24b6fe2..2e38187 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 _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0xa720e9,_0xf162db){_0xa720e9=_0xa720e9-0x0;var _0x902310=_0x21a3[_0xa720e9];return _0x902310;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});};
\ No newline at end of file
+var _0xa5ca=['rpc','../../config/environment','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x61ce2f,_0x569707){var _0x482d56=function(_0x348ca3){while(--_0x348ca3){_0x61ce2f['push'](_0x61ce2f['shift']());}};_0x482d56(++_0x569707);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xa5ca[_0x154192];return _0x3c2792;};'use strict';var _=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var moment=require(_0xaa5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa5c('0x3'));var db=require(_0xaa5c('0x4'))['db'];var utils=require(_0xaa5c('0x5'));var logger=require(_0xaa5c('0x6'))(_0xaa5c('0x7'));var config=require(_0xaa5c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41b86b,_0x10bee5,_0x283bc5){return new BPromise(function(_0x5b39a7,_0x496243){return client[_0xaa5c('0x9')](_0x41b86b,_0x283bc5)[_0xaa5c('0xa')](function(_0x170d3b){logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));logger[_0xaa5c('0xd')](_0xaa5c('0xe'),_0x10bee5,_0xaa5c('0xc'),JSON[_0xaa5c('0xf')](_0x170d3b));if(_0x170d3b[_0xaa5c('0x10')]){if(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x11')]===0x1f4){logger[_0xaa5c('0x10')](_0xaa5c('0xb'),_0x10bee5,_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);return _0x496243(_0x170d3b['error'][_0xaa5c('0x12')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x170d3b['error'][_0xaa5c('0x12')]);return _0x5b39a7(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);}else{logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));_0x5b39a7(_0x170d3b[_0xaa5c('0x13')][_0xaa5c('0x12')]);}})[_0xaa5c('0x14')](function(_0x272d06){logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x272d06);_0x496243(_0x272d06);});});}exports[_0xaa5c('0x15')]=function(_0x5ebbf0){var _0x43990d=this;return new Promise(function(_0xa016ba,_0x4f5038){return db['Attachment']['create'](_0x5ebbf0['body'],{'raw':_0x5ebbf0[_0xaa5c('0x16')]?_0x5ebbf0[_0xaa5c('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xaa5c('0xa')](function(_0x114363){logger['info']('CreateAttachment',_0x5ebbf0);logger[_0xaa5c('0xd')](_0xaa5c('0x15'),_0x5ebbf0,JSON[_0xaa5c('0xf')](_0x114363));_0xa016ba(_0x114363);})[_0xaa5c('0x14')](function(_0xa280bc){logger[_0xaa5c('0x10')]('CreateAttachment',_0xa280bc[_0xaa5c('0x12')],_0x5ebbf0);_0x4f5038(_0x43990d[_0xaa5c('0x10')](0x1f4,_0xa280bc['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index e5f174d..cf60ac7 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x4fc71e,_0x270fb3){_0x4fc71e=_0x4fc71e-0x0;var _0x30fa94=_0xdb28[_0x4fc71e];return _0x30fa94;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=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(_0x44c8fa,_0x30a53d){var _0x2a60e4=function(_0x5424c6){while(--_0x5424c6){_0x44c8fa['push'](_0x44c8fa['shift']());}};_0x2a60e4(++_0x30a53d);}(_0xadb5,0xad));var _0x5adb=function(_0x13eaef,_0x42cc2d){_0x13eaef=_0x13eaef-0x0;var _0x2adf9b=_0xadb5[_0x13eaef];return _0x2adf9b;};'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 4e73a10..34468f9 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 _0x66c4=['../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt','online','admin','agent','then','blockDuration','add','minutes','getLicense','catch','send','message','login','ad-login','role','signToken','json','User','passport','passport-local','Strategy','bluebird','util'];(function(_0x5c2929,_0x1b8216){var _0x4c6dd8=function(_0x491589){while(--_0x491589){_0x5c2929['push'](_0x5c2929['shift']());}};_0x4c6dd8(++_0x1b8216);}(_0x66c4,0x1bd));var _0x466c=function(_0x3056d0,_0x3ce8a0){_0x3056d0=_0x3056d0-0x0;var _0x3e29d8=_0x66c4[_0x3056d0];return _0x3e29d8;};'use strict';var passport=require(_0x466c('0x0'));var LocalStrategy=require(_0x466c('0x1'))[_0x466c('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x466c('0x3'));var util=require(_0x466c('0x4'));var db=require(_0x466c('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x466c('0x6'));var config=require(_0x466c('0x7'));var logger=require(_0x466c('0x8'))(_0x466c('0x9'));function isActiveDirectoryConfigured(_0x4e585d){var _0x120d03=![];if(typeof _0x4e585d['activedirectory']!=='undefined'){_0x120d03=_0x4e585d[_0x466c('0xa')][_0x466c('0xb')]&&_0x4e585d[_0x466c('0xa')][_0x466c('0xc')]&&_0x4e585d[_0x466c('0xa')][_0x466c('0xd')];}return _0x120d03;}function adAuthenticate(_0x5c7d46,_0x49f105,_0x21bae2){return new BPromise(function(_0x5e4cce,_0x46c906){try{var _0x15ccda=new ActiveDirectory(_0x5c7d46);_0x15ccda[_0x466c('0xe')](_0x49f105,_0x21bae2,function(_0x174b1d,_0x2cf159){if(_0x174b1d){logger[_0x466c('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x49f105,util['inspect'](_0x174b1d,{'showHidden':![],'depth':null}));_0x46c906('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2cf159){logger[_0x466c('0xf')](_0x466c('0x10'),_0x49f105);_0x46c906(_0x466c('0x11'));}else{_0x5e4cce(_0x2cf159);}});}catch(_0x4b5e12){_0x46c906(_0x4b5e12);}});}function ActiveDirectoryAuthenticate(_0x141d25,_0x274887,_0x402505,_0x56beb4){var _0x5718cd,_0x6dd2f6;if(!isActiveDirectoryConfigured(config)){logger[_0x466c('0xf')](_0x466c('0x12'),_0x274887);return _0x56beb4(null,![],{'message':_0x466c('0x11')});}return db[_0x466c('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x466c('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x1dffc0){_0x5718cd=_0x1dffc0;if(!_0x5718cd[_0x466c('0x14')]){logger['error'](_0x466c('0x15'),_0x274887);throw new Error(_0x466c('0x11'));}return _0x141d25['findOne']({'attributes':['id',_0x466c('0x16'),_0x466c('0x17'),_0x466c('0x18'),'role',_0x466c('0x19'),_0x466c('0x1a'),_0x466c('0x1b'),_0x466c('0x1c')],'where':{'name':_0x274887,'role':{'$or':[_0x466c('0x1d'),'user',_0x466c('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x1b0124){if(!_0x1b0124||_0x1b0124&&_0x1b0124[_0x466c('0x16')]!==_0x274887){throw new Error(_0x466c('0x11'));}_0x6dd2f6=_0x1b0124;var _0x1feb33=_0x6dd2f6[_0x466c('0x16')]+'@'+config[_0x466c('0xa')][_0x466c('0xd')];return adAuthenticate(config['activedirectory'],_0x1feb33,_0x402505);})[_0x466c('0x1f')](function(_0x2aadf5){if(_0x6dd2f6[_0x466c('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x5718cd[_0x466c('0x20')]>0x0){if(_0x6dd2f6[_0x466c('0x1a')]){if(moment(_0x6dd2f6[_0x466c('0x1b')])[_0x466c('0x21')](_0x5718cd[_0x466c('0x20')],_0x466c('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x6dd2f6,0x0,![],null)[_0x466c('0x1f')](function(){return utils[_0x466c('0x23')](_0x6dd2f6);})['then'](function(){return _0x56beb4(null,_0x6dd2f6);});}else{return utils[_0x466c('0x23')](_0x6dd2f6)['then'](function(){return _0x56beb4(null,_0x6dd2f6);});}}else{return utils['getLicense'](_0x6dd2f6)[_0x466c('0x1f')](function(){return _0x56beb4(null,_0x6dd2f6);});}})[_0x466c('0x24')](function(_0x552331){return _0x56beb4(null,![],_0x552331);});}function handleError(_0x552aa8,_0x11b4b1,_0x2b787a){return _0x552aa8['status'](_0x11b4b1||0x1f4)[_0x466c('0x25')]({'message':_0x2b787a?_0x2b787a[_0x466c('0x26')]||_0x2b787a:''});}exports[_0x466c('0x27')]=function(_0x5c28eb,_0x624516,_0x549ed4){passport[_0x466c('0xe')](_0x466c('0x28'),function(_0x1ad0eb,_0x4d360b,_0x2bbab7){var _0x224ec2=_0x1ad0eb||_0x2bbab7;if(_0x224ec2){return handleError(_0x624516,0x191,_0x224ec2);}if(!_0x4d360b){return handleError(_0x624516,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x589506={'payload':{'id':_0x4d360b['id'],'role':_0x4d360b[_0x466c('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x466c('0x2a')](_0x589506)['then'](function(_0x4b08ef){_0x624516[_0x466c('0x2b')]({'id':_0x4d360b['id'],'token':_0x4b08ef,'statusCall':'','isAlreadyLogged':_0x4d360b[_0x466c('0x1c')]});});}})(_0x5c28eb,_0x624516,_0x549ed4);};passport['use'](_0x466c('0x28'),new LocalStrategy({'usernameField':_0x466c('0x16'),'passwordField':_0x466c('0x17')},function(_0x277c1c,_0x5939f8,_0x5d68fa){return ActiveDirectoryAuthenticate(db[_0x466c('0x2c')],_0x277c1c,_0x5939f8,_0x5d68fa);}));
\ No newline at end of file
+var _0x6893=['adSsoEnabled','blockDuration','name','password','salt','role','blocked','online','admin','user','agent','disabled','blockedAt','add','clearBlockUser','then','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne'];(function(_0x1e20ef,_0x145409){var _0x100270=function(_0x2dc2a4){while(--_0x2dc2a4){_0x1e20ef['push'](_0x1e20ef['shift']());}};_0x100270(++_0x145409);}(_0x6893,0x16a));var _0x3689=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x6893[_0x296e0e];return _0x101c03;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x3689('0x0'))['Strategy'];var moment=require(_0x3689('0x1'));var ActiveDirectory=require(_0x3689('0x2'));var BPromise=require(_0x3689('0x3'));var util=require(_0x3689('0x4'));var db=require(_0x3689('0x5'))['db'];var authService=require(_0x3689('0x6'));var utils=require(_0x3689('0x7'));var config=require(_0x3689('0x8'));var logger=require(_0x3689('0x9'))(_0x3689('0xa'));function isActiveDirectoryConfigured(_0x14f5c1){var _0x5dda6a=![];if(typeof _0x14f5c1[_0x3689('0xb')]!==_0x3689('0xc')){_0x5dda6a=_0x14f5c1[_0x3689('0xb')]['baseDN']&&_0x14f5c1[_0x3689('0xb')][_0x3689('0xd')]&&_0x14f5c1[_0x3689('0xb')][_0x3689('0xe')];}return _0x5dda6a;}function adAuthenticate(_0x18d237,_0x2fcdbc,_0xc663ab){return new BPromise(function(_0x2c03e5,_0xf3c620){try{var _0x390abc=new ActiveDirectory(_0x18d237);_0x390abc[_0x3689('0xf')](_0x2fcdbc,_0xc663ab,function(_0x2508c5,_0x1476ec){if(_0x2508c5){logger[_0x3689('0x10')](_0x3689('0x11'),_0x2fcdbc,util['inspect'](_0x2508c5,{'showHidden':![],'depth':null}));_0xf3c620('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1476ec){logger[_0x3689('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2fcdbc);_0xf3c620('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2c03e5(_0x1476ec);}});}catch(_0x1f0ab4){_0xf3c620(_0x1f0ab4);}});}function ActiveDirectoryAuthenticate(_0x31b215,_0x18e5dc,_0x5557cf,_0x249b28){var _0x448778,_0x50c70a;if(!isActiveDirectoryConfigured(config)){logger[_0x3689('0x10')](_0x3689('0x12'),_0x18e5dc);return _0x249b28(null,![],{'message':_0x3689('0x13')});}return db[_0x3689('0x14')][_0x3689('0x15')]({'where':{'id':0x1},'attributes':[_0x3689('0x16'),_0x3689('0x17')],'raw':!![]})['then'](function(_0x4d2f32){_0x448778=_0x4d2f32;if(!_0x448778[_0x3689('0x16')]){logger[_0x3689('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x18e5dc);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x31b215[_0x3689('0x15')]({'attributes':['id',_0x3689('0x18'),_0x3689('0x19'),_0x3689('0x1a'),_0x3689('0x1b'),'disabled',_0x3689('0x1c'),'blockedAt',_0x3689('0x1d')],'where':{'name':_0x18e5dc,'role':{'$or':[_0x3689('0x1e'),_0x3689('0x1f'),_0x3689('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x118fe5){if(!_0x118fe5||_0x118fe5&&_0x118fe5[_0x3689('0x18')]!==_0x18e5dc){throw new Error(_0x3689('0x13'));}_0x50c70a=_0x118fe5;var _0x1da3d7=_0x50c70a[_0x3689('0x18')]+'@'+config[_0x3689('0xb')][_0x3689('0xe')];return adAuthenticate(config['activedirectory'],_0x1da3d7,_0x5557cf);})['then'](function(_0x3a4ee6){if(_0x50c70a[_0x3689('0x21')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x448778[_0x3689('0x17')]>0x0){if(_0x50c70a[_0x3689('0x1c')]){if(moment(_0x50c70a[_0x3689('0x22')])[_0x3689('0x23')](_0x448778[_0x3689('0x17')],'minutes')>moment()){throw new Error(_0x3689('0x13'));}return utils[_0x3689('0x24')](_0x50c70a,0x0,![],null)[_0x3689('0x25')](function(){return utils[_0x3689('0x26')](_0x50c70a);})[_0x3689('0x25')](function(){return _0x249b28(null,_0x50c70a);});}else{return utils[_0x3689('0x26')](_0x50c70a)[_0x3689('0x25')](function(){return _0x249b28(null,_0x50c70a);});}}else{return utils['getLicense'](_0x50c70a)['then'](function(){return _0x249b28(null,_0x50c70a);});}})['catch'](function(_0x15ab58){return _0x249b28(null,![],_0x15ab58);});}function handleError(_0x429f1b,_0x863f0b,_0x3b8e9d){return _0x429f1b[_0x3689('0x27')](_0x863f0b||0x1f4)[_0x3689('0x28')]({'message':_0x3b8e9d?_0x3b8e9d['message']||_0x3b8e9d:''});}exports[_0x3689('0x29')]=function(_0x3b7c91,_0x11e6bc,_0x3cb987){passport[_0x3689('0xf')](_0x3689('0x2a'),function(_0x88282a,_0x192059,_0x24ed93){var _0x24dd33=_0x88282a||_0x24ed93;if(_0x24dd33){return handleError(_0x11e6bc,0x191,_0x24dd33);}if(!_0x192059){return handleError(_0x11e6bc,0x194,{'message':_0x3689('0x2b')});}else{var _0x1cac23={'payload':{'id':_0x192059['id'],'role':_0x192059[_0x3689('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x3689('0x2c')](_0x1cac23)[_0x3689('0x25')](function(_0x245cc5){_0x11e6bc[_0x3689('0x2d')]({'id':_0x192059['id'],'token':_0x245cc5,'statusCall':'','isAlreadyLogged':_0x192059['online']});});}})(_0x3b7c91,_0x11e6bc,_0x3cb987);};passport[_0x3689('0x2e')](_0x3689('0x2a'),new LocalStrategy({'usernameField':_0x3689('0x18'),'passwordField':_0x3689('0x19')},function(_0x4a20ed,_0xe7f87f,_0x4b02c4){return ActiveDirectoryAuthenticate(db[_0x3689('0x2f')],_0x4a20ed,_0xe7f87f,_0x4b02c4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0a8cf08..f5febdf 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 _0xe42a=['express','Router','./authActiveDirectory.controller','post','login'];(function(_0x3573fb,_0x158452){var _0x1eafb6=function(_0x2f75a8){while(--_0x2f75a8){_0x3573fb['push'](_0x3573fb['shift']());}};_0x1eafb6(++_0x158452);}(_0xe42a,0x91));var _0xae42=function(_0x3a1e8a,_0x5e08aa){_0x3a1e8a=_0x3a1e8a-0x0;var _0x56337e=_0xe42a[_0x3a1e8a];return _0x56337e;};'use strict';var express=require(_0xae42('0x0'));var router=express[_0xae42('0x1')]();var controller=require(_0xae42('0x2'));router[_0xae42('0x3')]('/',controller[_0xae42('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x51e5=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x569b58,_0xc01048){var _0x40efd2=function(_0x2bf657){while(--_0x2bf657){_0x569b58['push'](_0x569b58['shift']());}};_0x40efd2(++_0xc01048);}(_0x51e5,0x1b7));var _0x551e=function(_0x2519c3,_0x533fe8){_0x2519c3=_0x2519c3-0x0;var _0x4eb73d=_0x51e5[_0x2519c3];return _0x4eb73d;};'use strict';var express=require(_0x551e('0x0'));var router=express[_0x551e('0x1')]();var controller=require(_0x551e('0x2'));router[_0x551e('0x3')]('/',controller[_0x551e('0x4')]);module[_0x551e('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 1a4f25f..a8ca4a1 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x237d0d,_0x412e3d){_0x237d0d=_0x237d0d-0x0;var _0x10d0e1=_0x7a54[_0x237d0d];return _0x10d0e1;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xc0acde,_0x4df117){var _0x2d9a9d=function(_0xc8e4a7){while(--_0xc8e4a7){_0xc0acde['push'](_0xc0acde['shift']());}};_0x2d9a9d(++_0x4df117);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 9a23f00..6931c44 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 _0x6959=['login','setTokenCookie','passport','Router','./authGoogle.controller','../../components/auth/service','get','isMiddleware'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6959,0x9a));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var passport=require(_0x9695('0x0'));var router=express[_0x9695('0x1')]();var controller=require(_0x9695('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x9695('0x3'));router[_0x9695('0x4')]('/',controller['login']);router[_0x9695('0x4')]('/callback',controller['callback'],authService[_0x9695('0x5')],userController[_0x9695('0x6')],authService[_0x9695('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x580f=['login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x55c3fe,_0x58175c){var _0x26201d=function(_0x4d3e1a){while(--_0x4d3e1a){_0x55c3fe['push'](_0x55c3fe['shift']());}};_0x26201d(++_0x58175c);}(_0x580f,0x8c));var _0xf580=function(_0x353ca5,_0x13431f){_0x353ca5=_0x353ca5-0x0;var _0x1107a0=_0x580f[_0x353ca5];return _0x1107a0;};'use strict';var express=require('express');var passport=require(_0xf580('0x0'));var router=express[_0xf580('0x1')]();var controller=require(_0xf580('0x2'));var userController=require(_0xf580('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0xf580('0x4')]);router['get']('/callback',controller[_0xf580('0x5')],authService[_0xf580('0x6')],userController[_0xf580('0x4')],authService[_0xf580('0x7')]);module[_0xf580('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index f67840d..0b7e856 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 _0xd3b4=['passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','allowedLoginAttempts','then','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','request','SendMail','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','find','params','token','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','util'];(function(_0x21786f,_0x5db1a2){var _0x1fc90a=function(_0x40197d){while(--_0x40197d){_0x21786f['push'](_0x21786f['shift']());}};_0x1fc90a(++_0x5db1a2);}(_0xd3b4,0x194));var _0x4d3b=function(_0x46f1c7,_0xf533eb){_0x46f1c7=_0x46f1c7-0x0;var _0x25edd9=_0xd3b4[_0x46f1c7];return _0x25edd9;};'use strict';var util=require(_0x4d3b('0x0'));var passport=require(_0x4d3b('0x1'));var LocalStrategy=require(_0x4d3b('0x2'))[_0x4d3b('0x3')];var jayson=require(_0x4d3b('0x4'));var _=require(_0x4d3b('0x5'));var rs=require(_0x4d3b('0x6'));var moment=require(_0x4d3b('0x7'));var db=require(_0x4d3b('0x8'))['db'];var authService=require(_0x4d3b('0x9'));var utils=require(_0x4d3b('0xa'));var client=jayson[_0x4d3b('0xb')]['http']({'port':0x232b});function localAuthenticate(_0x31cd0a,_0x5d5f02,_0x312424,_0x16ffb2){var _0x493be3,_0x2cc046;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4d3b('0xc'),'blockDuration'],'raw':!![]})[_0x4d3b('0xd')](function(_0x5c1f92){_0x493be3=_0x5c1f92;return _0x31cd0a[_0x4d3b('0xe')]({'attributes':['id','name',_0x4d3b('0xf'),_0x4d3b('0x10'),_0x4d3b('0x11'),_0x4d3b('0x12'),_0x4d3b('0x13'),_0x4d3b('0x14'),_0x4d3b('0x15')],'where':{'name':_0x5d5f02,'role':{'$or':[_0x4d3b('0x16'),'user','agent']}}});})['then'](function(_0x407e4a){if(!_0x407e4a||_0x407e4a&&_0x407e4a['name']!==_0x5d5f02){throw new Error(_0x4d3b('0x17'));}else{_0x2cc046=_0x407e4a;return _0x2cc046;}})['then'](function(){_0x2cc046[_0x4d3b('0x18')](_0x312424,function(_0x1721ef,_0x1b7f1d){var _0x365813=_0x2cc046[_0x4d3b('0x15')]+0x1;if(_0x1721ef){return _0x16ffb2(_0x1721ef);}else if(!_0x1b7f1d){if(_0x2cc046[_0x4d3b('0x12')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else if(_0x493be3['allowedLoginAttempts']>0x0){if(_0x2cc046[_0x4d3b('0x13')]){if(_0x493be3[_0x4d3b('0x19')]>0x0){if(moment(_0x2cc046['blockedAt'])[_0x4d3b('0x1a')](_0x493be3['blockDuration'],'minutes')>moment()){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1b')](_0x2cc046,_0x365813,![],null)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});});}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{if(_0x365813>=_0x493be3[_0x4d3b('0xc')]){return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,!![],moment())[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2cc046,_0x365813,![],null)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});});}}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{if(_0x2cc046[_0x4d3b('0x12')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else if(_0x493be3[_0x4d3b('0xc')]>0x0){if(_0x2cc046[_0x4d3b('0x13')]){if(_0x493be3['blockDuration']>0x0){if(moment(_0x2cc046[_0x4d3b('0x14')])['add'](_0x493be3[_0x4d3b('0x19')],'minutes')>moment()){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,![],null)[_0x4d3b('0xd')](function(){return utils['getLicense'](_0x2cc046);})[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);});}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,![],null)[_0x4d3b('0xd')](function(){return utils[_0x4d3b('0x1c')](_0x2cc046);})[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);})['catch'](function(_0x4c4a4f){return _0x16ffb2(null,![],_0x4c4a4f);});}}else{if(_0x2cc046[_0x4d3b('0x13')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1c')](_0x2cc046)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);});}}}});})[_0x4d3b('0x1d')](function(_0x1d65c3){return _0x16ffb2(null,![],_0x1d65c3);});}function sendServiceMail(_0x412816){return db[_0x4d3b('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x4d3b('0x1f'),_0x4d3b('0x20')],'include':[{'model':db[_0x4d3b('0x21')],'as':_0x4d3b('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x4d3b('0x23')}]}]})[_0x4d3b('0xd')](function(_0x526f7a){if(!_0x526f7a){throw new Error(_0x4d3b('0x24'));}var _0x577138=_0x526f7a['getSmtpOptions']();var _0x4b5972={'account':_0x577138,'message':_[_0x4d3b('0x25')]({'from':util[_0x4d3b('0x26')]('\x22%s\x22\x20<%s>',_0x526f7a[_0x4d3b('0x1f')],_0x526f7a[_0x4d3b('0x20')]||_0x526f7a['Smtp']['user'])},_0x412816)};return client[_0x4d3b('0x27')](_0x4d3b('0x28'),_0x4b5972);})[_0x4d3b('0xd')](function(_0x4eb2a0){if(_0x4eb2a0['error']){throw new Error(util[_0x4d3b('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4eb2a0[_0x4d3b('0x29')]['message']||JSON[_0x4d3b('0x2a')](_0x4eb2a0[_0x4d3b('0x29')])));}return!![];});}function handleError(_0x3cc884,_0xec7862,_0x30166b){return _0x3cc884[_0x4d3b('0x2b')](_0xec7862||0x1f4)[_0x4d3b('0x2c')]({'message':_0x30166b?_0x30166b[_0x4d3b('0x2d')]||_0x30166b:''});}exports[_0x4d3b('0x2e')]=function(_0x186891,_0x4ef04f,_0x5b0fec){passport[_0x4d3b('0x18')](_0x4d3b('0x2f'),function(_0x266a1f,_0x1aa0f4,_0x5565b4){var _0x58a26b=_0x266a1f||_0x5565b4;if(_0x58a26b){return handleError(_0x4ef04f,0x191,_0x58a26b);}if(!_0x1aa0f4){return handleError(_0x4ef04f,0x194,{'message':_0x4d3b('0x30')});}else{var _0x114abd={'payload':{'id':_0x1aa0f4['id'],'role':_0x1aa0f4[_0x4d3b('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x4d3b('0x31')](_0x114abd)[_0x4d3b('0xd')](function(_0x3f4426){_0x4ef04f[_0x4d3b('0x32')]({'id':_0x1aa0f4['id'],'token':_0x3f4426,'statusCall':'','isAlreadyLogged':_0x1aa0f4['online']});});}})(_0x186891,_0x4ef04f,_0x5b0fec);};exports[_0x4d3b('0x33')]=function(_0x25bccf,_0x376521){if(!_0x25bccf['body'][_0x4d3b('0x20')]){return handleError(_0x376521,0x1f4,{'message':_0x4d3b('0x34')});}var _0x15014a=rs[_0x4d3b('0x35')]();_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')]=_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')][_0x4d3b('0x37')]()[_0x4d3b('0x38')]();var _0xe5c965;return db[_0x4d3b('0x39')][_0x4d3b('0xe')]({'where':{'id':0x1},'attributes':[_0x4d3b('0xc'),_0x4d3b('0x19')],'raw':!![]})[_0x4d3b('0xd')](function(_0x35af38){_0xe5c965=_0x35af38;return db[_0x4d3b('0x3a')]['find']({'where':{'email':_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')]}});})[_0x4d3b('0xd')](function(_0x157d15){if(!_0x157d15){throw new Error(_0x4d3b('0x3b'));}if(_0x157d15['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x157d15[_0x4d3b('0x13')]){if(moment(_0x157d15[_0x4d3b('0x14')])[_0x4d3b('0x1a')](_0xe5c965[_0x4d3b('0x19')],_0x4d3b('0x3c'))>moment()){throw new Error(_0x4d3b('0x3d'));}else{_0x157d15[_0x4d3b('0x13')]=![];_0x157d15[_0x4d3b('0x14')]=null;}}_0x157d15[_0x4d3b('0x3e')]=_0x15014a;_0x157d15['resetPasswordExpires']=Date[_0x4d3b('0x3f')]()+0x36ee80;return _0x157d15['save']();})[_0x4d3b('0xd')](function(){return sendServiceMail({'to':_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')],'subject':_0x4d3b('0x40'),'text':'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'+_0x4d3b('0x41')+_0x25bccf[_0x4d3b('0x42')][_0x4d3b('0x43')]+_0x4d3b('0x44')+_0x15014a+'\x0a\x0a'+_0x4d3b('0x45')});})[_0x4d3b('0xd')](function(){_0x376521[_0x4d3b('0x2b')](0xc8)[_0x4d3b('0x2c')]({'message':_0x4d3b('0x46')});})[_0x4d3b('0x1d')](function(_0x2dd06e){return handleError(_0x376521,0x1f4,_0x2dd06e);});};exports['reset']=function(_0x29d285,_0x23c7b2){return db[_0x4d3b('0x3a')][_0x4d3b('0x47')]({'where':{'resetPasswordToken':_0x29d285[_0x4d3b('0x48')][_0x4d3b('0x49')],'resetPasswordExpires':{'$gt':Date[_0x4d3b('0x3f')]()}}})[_0x4d3b('0xd')](function(_0x5174f8){if(!_0x5174f8){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4d3b('0x39')][_0x4d3b('0xe')]({'attributes':['id',_0x4d3b('0x4a'),_0x4d3b('0x4b'),'passwordHistoryLimit']})['then'](function(_0x2d9ee4){if(_0x2d9ee4[_0x4d3b('0x4a')])authService['validatePasswordPattern'](_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')]);if(!_0x2d9ee4[_0x4d3b('0x4b')]||!_0x5174f8[_0x4d3b('0x4c')])return _0x5174f8;authService[_0x4d3b('0x4d')](_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')],_0x5174f8['previousPasswords'],_0x2d9ee4[_0x4d3b('0x4e')]);return _0x5174f8;})[_0x4d3b('0xd')](function(){_0x5174f8[_0x4d3b('0xf')]=_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')];_0x5174f8['resetPasswordToken']=null;_0x5174f8['resetPasswordExpires']=null;return _0x5174f8[_0x4d3b('0x4f')]();});})[_0x4d3b('0xd')](function(){_0x23c7b2['status'](0xc8)['send']({'message':_0x4d3b('0x50')});})[_0x4d3b('0x1d')](function(_0x1e2c6e){return handleError(_0x23c7b2,0x1f4,_0x1e2c6e);});};passport['use'](_0x4d3b('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x4d3b('0xf')},function(_0xa4bdcf,_0x514995,_0x2649de){return localAuthenticate(db[_0x4d3b('0x3a')],_0xa4bdcf,_0x514995,_0x2649de);}));
\ No newline at end of file
+var _0xf16f=['headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','signToken','forgot','body','generate','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x8c89bd,_0x4d9989){var _0x2d0a25=function(_0x332d6c){while(--_0x332d6c){_0x8c89bd['push'](_0x8c89bd['shift']());}};_0x2d0a25(++_0x4d9989);}(_0xf16f,0x1ab));var _0xff16=function(_0x86c056,_0x3ed77c){_0x86c056=_0x86c056-0x0;var _0xd6192e=_0xf16f[_0x86c056];return _0xd6192e;};'use strict';var util=require(_0xff16('0x0'));var passport=require(_0xff16('0x1'));var LocalStrategy=require(_0xff16('0x2'))[_0xff16('0x3')];var jayson=require(_0xff16('0x4'));var _=require(_0xff16('0x5'));var rs=require('randomstring');var moment=require(_0xff16('0x6'));var db=require(_0xff16('0x7'))['db'];var authService=require(_0xff16('0x8'));var utils=require(_0xff16('0x9'));var client=jayson['client'][_0xff16('0xa')]({'port':0x232b});function localAuthenticate(_0x4d9d43,_0x1c7e57,_0x34e42a,_0x3f8f47){var _0x3d04ef,_0x12c197;return db['Setting'][_0xff16('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xff16('0xc')],'raw':!![]})[_0xff16('0xd')](function(_0x110794){_0x3d04ef=_0x110794;return _0x4d9d43[_0xff16('0xb')]({'attributes':['id',_0xff16('0xe'),_0xff16('0xf'),'salt',_0xff16('0x10'),_0xff16('0x11'),_0xff16('0x12'),_0xff16('0x13'),_0xff16('0x14')],'where':{'name':_0x1c7e57,'role':{'$or':[_0xff16('0x15'),_0xff16('0x16'),_0xff16('0x17')]}}});})[_0xff16('0xd')](function(_0x1d2f53){if(!_0x1d2f53||_0x1d2f53&&_0x1d2f53['name']!==_0x1c7e57){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x12c197=_0x1d2f53;return _0x12c197;}})[_0xff16('0xd')](function(){_0x12c197['authenticate'](_0x34e42a,function(_0x2228fe,_0x257fd3){var _0x1acf9a=_0x12c197[_0xff16('0x14')]+0x1;if(_0x2228fe){return _0x3f8f47(_0x2228fe);}else if(!_0x257fd3){if(_0x12c197[_0xff16('0x11')]){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else if(_0x3d04ef[_0xff16('0x19')]>0x0){if(_0x12c197['blocked']){if(_0x3d04ef[_0xff16('0xc')]>0x0){if(moment(_0x12c197['blockedAt'])[_0xff16('0x1a')](_0x3d04ef[_0xff16('0xc')],'minutes')>moment()){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils['clearBlockUser'](_0x12c197,_0x1acf9a,![],null)['then'](function(){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});});}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{if(_0x1acf9a>=_0x3d04ef['allowedLoginAttempts']){return utils[_0xff16('0x1b')](_0x12c197,0x0,!![],moment())[_0xff16('0xd')](function(){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});});}else{return utils[_0xff16('0x1b')](_0x12c197,_0x1acf9a,![],null)[_0xff16('0xd')](function(){return _0x3f8f47(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{if(_0x12c197['disabled']){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else if(_0x3d04ef[_0xff16('0x19')]>0x0){if(_0x12c197[_0xff16('0x12')]){if(_0x3d04ef[_0xff16('0xc')]>0x0){if(moment(_0x12c197[_0xff16('0x13')])[_0xff16('0x1a')](_0x3d04ef[_0xff16('0xc')],_0xff16('0x1c'))>moment()){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils[_0xff16('0x1b')](_0x12c197,0x0,![],null)[_0xff16('0xd')](function(){return utils[_0xff16('0x1d')](_0x12c197);})[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);});}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{return utils[_0xff16('0x1b')](_0x12c197,0x0,![],null)[_0xff16('0xd')](function(){return utils[_0xff16('0x1d')](_0x12c197);})[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);})[_0xff16('0x1e')](function(_0x8d644f){return _0x3f8f47(null,![],_0x8d644f);});}}else{if(_0x12c197[_0xff16('0x12')]){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils[_0xff16('0x1d')](_0x12c197)[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);});}}}});})['catch'](function(_0x59d096){return _0x3f8f47(null,![],_0x59d096);});}function sendServiceMail(_0x59b4ab){return db[_0xff16('0x1f')][_0xff16('0x20')]({'where':{'service':!![]},'attributes':['id',_0xff16('0xe'),'email'],'include':[{'model':db[_0xff16('0x21')],'as':_0xff16('0x22'),'include':[{'model':db[_0xff16('0x23')],'as':_0xff16('0x23')}]}]})[_0xff16('0xd')](function(_0x47391b){if(!_0x47391b){throw new Error(_0xff16('0x24'));}var _0x1ad28b=_0x47391b['getSmtpOptions']();var _0x9df679={'account':_0x1ad28b,'message':_['merge']({'from':util[_0xff16('0x25')](_0xff16('0x26'),_0x47391b[_0xff16('0xe')],_0x47391b[_0xff16('0x27')]||_0x47391b[_0xff16('0x22')]['user'])},_0x59b4ab)};return client['request'](_0xff16('0x28'),_0x9df679);})['then'](function(_0x43b659){if(_0x43b659[_0xff16('0x29')]){throw new Error(util[_0xff16('0x25')](_0xff16('0x2a'),_0x43b659[_0xff16('0x29')][_0xff16('0x2b')]||JSON[_0xff16('0x2c')](_0x43b659[_0xff16('0x29')])));}return!![];});}function handleError(_0x433130,_0x4c1da4,_0x26ef3d){return _0x433130[_0xff16('0x2d')](_0x4c1da4||0x1f4)[_0xff16('0x2e')]({'message':_0x26ef3d?_0x26ef3d[_0xff16('0x2b')]||_0x26ef3d:''});}exports[_0xff16('0x2f')]=function(_0x13e3b3,_0x129891,_0x504637){passport[_0xff16('0x30')](_0xff16('0x31'),function(_0x38f71e,_0x4ac619,_0x5717c2){var _0x148d0f=_0x38f71e||_0x5717c2;if(_0x148d0f){return handleError(_0x129891,0x191,_0x148d0f);}if(!_0x4ac619){return handleError(_0x129891,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xc85a2e={'payload':{'id':_0x4ac619['id'],'role':_0x4ac619['role']},'options':{'expiresIn':0x15180}};return authService[_0xff16('0x32')](_0xc85a2e)['then'](function(_0x110cb9){_0x129891['json']({'id':_0x4ac619['id'],'token':_0x110cb9,'statusCall':'','isAlreadyLogged':_0x4ac619['online']});});}})(_0x13e3b3,_0x129891,_0x504637);};exports[_0xff16('0x33')]=function(_0x1e1682,_0x2f986b){if(!_0x1e1682[_0xff16('0x34')]['email']){return handleError(_0x2f986b,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xd3c362=rs[_0xff16('0x35')]();_0x1e1682[_0xff16('0x34')]['email']=_0x1e1682[_0xff16('0x34')][_0xff16('0x27')][_0xff16('0x36')]()[_0xff16('0x37')]();var _0x447db3;return db[_0xff16('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xff16('0xc')],'raw':!![]})[_0xff16('0xd')](function(_0x54d4c1){_0x447db3=_0x54d4c1;return db[_0xff16('0x39')][_0xff16('0x20')]({'where':{'email':_0x1e1682[_0xff16('0x34')][_0xff16('0x27')]}});})[_0xff16('0xd')](function(_0x4ea0e7){if(!_0x4ea0e7){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4ea0e7['disabled']){throw new Error(_0xff16('0x3a'));}if(_0x4ea0e7[_0xff16('0x12')]){if(moment(_0x4ea0e7[_0xff16('0x13')])[_0xff16('0x1a')](_0x447db3['blockDuration'],_0xff16('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4ea0e7[_0xff16('0x12')]=![];_0x4ea0e7[_0xff16('0x13')]=null;}}_0x4ea0e7[_0xff16('0x3b')]=_0xd3c362;_0x4ea0e7[_0xff16('0x3c')]=Date['now']()+0x36ee80;return _0x4ea0e7['save']();})['then'](function(){return sendServiceMail({'to':_0x1e1682[_0xff16('0x34')][_0xff16('0x27')],'subject':_0xff16('0x3d'),'text':_0xff16('0x3e')+_0xff16('0x3f')+_0xff16('0x40')+_0x1e1682[_0xff16('0x41')][_0xff16('0x42')]+_0xff16('0x43')+_0xd3c362+'\x0a\x0a'+_0xff16('0x44')});})[_0xff16('0xd')](function(){_0x2f986b[_0xff16('0x2d')](0xc8)[_0xff16('0x2e')]({'message':_0xff16('0x45')});})[_0xff16('0x1e')](function(_0x445532){return handleError(_0x2f986b,0x1f4,_0x445532);});};exports[_0xff16('0x46')]=function(_0x236ad3,_0x4094d3){return db[_0xff16('0x39')]['find']({'where':{'resetPasswordToken':_0x236ad3[_0xff16('0x47')][_0xff16('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xff16('0xd')](function(_0x138927){if(!_0x138927){throw new Error(_0xff16('0x49'));}return db[_0xff16('0x38')]['findOne']({'attributes':['id',_0xff16('0x4a'),'enforcePasswordHistory',_0xff16('0x4b')]})[_0xff16('0xd')](function(_0x58d7b2){if(_0x58d7b2[_0xff16('0x4a')])authService[_0xff16('0x4c')](_0x236ad3[_0xff16('0x34')][_0xff16('0xf')]);if(!_0x58d7b2[_0xff16('0x4d')]||!_0x138927[_0xff16('0x4e')])return _0x138927;authService[_0xff16('0x4f')](_0x236ad3[_0xff16('0x34')][_0xff16('0xf')],_0x138927[_0xff16('0x4e')],_0x58d7b2[_0xff16('0x4b')]);return _0x138927;})['then'](function(){_0x138927['password']=_0x236ad3[_0xff16('0x34')][_0xff16('0xf')];_0x138927[_0xff16('0x3b')]=null;_0x138927[_0xff16('0x3c')]=null;return _0x138927['save']();});})['then'](function(){_0x4094d3['status'](0xc8)[_0xff16('0x2e')]({'message':_0xff16('0x50')});})['catch'](function(_0x3dc293){return handleError(_0x4094d3,0x1f4,_0x3dc293);});};passport[_0xff16('0x51')](_0xff16('0x31'),new LocalStrategy({'usernameField':_0xff16('0xe'),'passwordField':_0xff16('0xf')},function(_0x3f43d4,_0x3ab1a6,_0x2eeed7){return localAuthenticate(db['User'],_0x3f43d4,_0x3ab1a6,_0x2eeed7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9a4d9c5..0fa1703 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 _0xbde7=['login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4e2883,_0x2a8bb7){var _0x35ab6b=function(_0x208e8f){while(--_0x208e8f){_0x4e2883['push'](_0x4e2883['shift']());}};_0x35ab6b(++_0x2a8bb7);}(_0xbde7,0xa7));var _0x7bde=function(_0x53cfae,_0x44a7c5){_0x53cfae=_0x53cfae-0x0;var _0xc056ac=_0xbde7[_0x53cfae];return _0xc056ac;};'use strict';var express=require(_0x7bde('0x0'));var router=express[_0x7bde('0x1')]();var controller=require(_0x7bde('0x2'));router[_0x7bde('0x3')]('/',controller[_0x7bde('0x4')]);router[_0x7bde('0x3')](_0x7bde('0x5'),controller['forgot']);router['post'](_0x7bde('0x6'),controller[_0x7bde('0x7')]);module[_0x7bde('0x8')]=router;
\ No newline at end of file
+var _0x3822=['/reset/:token','reset','exports','express','./authLocal.controller','login','/forgot','post'];(function(_0x11223f,_0x17b8a1){var _0x567018=function(_0x36bd2c){while(--_0x36bd2c){_0x11223f['push'](_0x11223f['shift']());}};_0x567018(++_0x17b8a1);}(_0x3822,0x1bb));var _0x2382=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3822[_0x2641f9];return _0x585741;};'use strict';var express=require(_0x2382('0x0'));var router=express['Router']();var controller=require(_0x2382('0x1'));router['post']('/',controller[_0x2382('0x2')]);router['post'](_0x2382('0x3'),controller['forgot']);router[_0x2382('0x4')](_0x2382('0x5'),controller[_0x2382('0x6')]);module[_0x2382('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 92248aa..000dce2 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 _0xedd5=['BOOLEAN','INTEGER','STRING'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xedd5,0x1eb));var _0x5edd=function(_0x4d32e9,_0x390d44){_0x4d32e9=_0x4d32e9-0x0;var _0x2d9ece=_0xedd5[_0x4d32e9];return _0x2d9ece;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5edd('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x5edd('0x0')]},'description':{'type':Sequelize[_0x5edd('0x0')]},'status':{'type':Sequelize[_0x5edd('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5edd('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa449=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0xa449,0x19a));var _0x9a44=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa449[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module[_0x9a44('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9a44('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9a44('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9a44('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 884c8d3..2a9d3b5 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 _0xdf6a=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','Automation','findAll','catch','params','include','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdf6a,0xde));var _0xadf6=function(_0xbca777,_0x242a64){_0xbca777=_0xbca777-0x0;var _0x20c416=_0xdf6a[_0xbca777];return _0x20c416;};'use strict';var emlformat=require(_0xadf6('0x0'));var rimraf=require(_0xadf6('0x1'));var zipdir=require(_0xadf6('0x2'));var jsonpatch=require(_0xadf6('0x3'));var rp=require(_0xadf6('0x4'));var moment=require(_0xadf6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xadf6('0x6'));var sox=require(_0xadf6('0x7'));var csv=require(_0xadf6('0x8'));var ejs=require(_0xadf6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadf6('0xa'));var squel=require(_0xadf6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadf6('0xc'));var toCsv=require(_0xadf6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xadf6('0xd'));var authService=require(_0xadf6('0xe'));var qs=require(_0xadf6('0xf'));var as=require(_0xadf6('0x10'));var hardwareService=require(_0xadf6('0x11'));var logger=require(_0xadf6('0x12'))('api');var utils=require(_0xadf6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xadf6('0x14'));var db=require(_0xadf6('0x15'))['db'];function respondWithStatusCode(_0x1b94a0,_0x2685ec){_0x2685ec=_0x2685ec||0xcc;return function(_0x6229fa){if(_0x6229fa){return _0x1b94a0[_0xadf6('0x16')](_0x2685ec);}return _0x1b94a0['status'](_0x2685ec)[_0xadf6('0x17')]();};}function respondWithResult(_0x43456c,_0x31ab99){_0x31ab99=_0x31ab99||0xc8;return function(_0x52b851){if(_0x52b851){return _0x43456c[_0xadf6('0x18')](_0x31ab99)['json'](_0x52b851);}};}function respondWithFilteredResult(_0x544f25,_0x30aa3d){return function(_0x4be42c){if(_0x4be42c){var _0x1f5bed=typeof _0x30aa3d[_0xadf6('0x19')]===_0xadf6('0x1a')&&typeof _0x30aa3d[_0xadf6('0x1b')]==='undefined';var _0x8c1353=_0x4be42c[_0xadf6('0x1c')];var _0x57f76b=_0x1f5bed?0x0:_0x30aa3d[_0xadf6('0x19')];var _0x4e8b77=_0x1f5bed?_0x4be42c[_0xadf6('0x1c')]:_0x30aa3d[_0xadf6('0x19')]+_0x30aa3d[_0xadf6('0x1b')];var _0x22faab;if(_0x4e8b77>=_0x8c1353){_0x4e8b77=_0x8c1353;_0x22faab=0xc8;}else{_0x22faab=0xce;}_0x544f25[_0xadf6('0x18')](_0x22faab);return _0x544f25['set']('Content-Range',_0x57f76b+'-'+_0x4e8b77+'/'+_0x8c1353)['json'](_0x4be42c);}return null;};}function patchUpdates(_0x42825b){return function(_0x186802){try{jsonpatch[_0xadf6('0x1d')](_0x186802,_0x42825b,!![]);}catch(_0x159a9f){return BPromise[_0xadf6('0x1e')](_0x159a9f);}return _0x186802[_0xadf6('0x1f')]();};}function saveUpdates(_0x770836,_0x24cac4){return function(_0x302f81){if(_0x302f81){return _0x302f81[_0xadf6('0x20')](_0x770836)[_0xadf6('0x21')](function(_0x202c76){return _0x202c76;});}return null;};}function removeEntity(_0xcaedca,_0x154597){return function(_0x1c90bd){if(_0x1c90bd){return _0x1c90bd['destroy']()[_0xadf6('0x21')](function(){_0xcaedca[_0xadf6('0x18')](0xcc)[_0xadf6('0x17')]();});}};}function handleEntityNotFound(_0x127eee,_0x5826e5){return function(_0xc0d593){if(!_0xc0d593){_0x127eee[_0xadf6('0x16')](0x194);}return _0xc0d593;};}function handleError(_0xf8bb1a,_0x27ed6b){_0x27ed6b=_0x27ed6b||0x1f4;return function(_0x58295b){logger[_0xadf6('0x22')](_0x58295b['stack']);if(_0x58295b[_0xadf6('0x23')]){delete _0x58295b[_0xadf6('0x23')];}_0xf8bb1a[_0xadf6('0x18')](_0x27ed6b)[_0xadf6('0x24')](_0x58295b);};}exports[_0xadf6('0x25')]=function(_0x4cf86e,_0x5492b9){var _0x414472={},_0x4373ed={},_0x32bc0f={'count':0x0,'rows':[]};var _0x22ed45=_[_0xadf6('0x26')](db['Automation'][_0xadf6('0x27')],function(_0x1b7522){return{'name':_0x1b7522['fieldName'],'type':_0x1b7522[_0xadf6('0x28')]['key']};});_0x4373ed[_0xadf6('0x29')]=_['map'](_0x22ed45,_0xadf6('0x23'));_0x4373ed[_0xadf6('0x2a')]=_[_0xadf6('0x2b')](_0x4cf86e[_0xadf6('0x2a')]);_0x4373ed['filters']=_[_0xadf6('0x2c')](_0x4373ed[_0xadf6('0x29')],_0x4373ed[_0xadf6('0x2a')]);_0x414472[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x4373ed['model'],qs[_0xadf6('0x2e')](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x2e')]));_0x414472[_0xadf6('0x2d')]=_0x414472[_0xadf6('0x2d')][_0xadf6('0x2f')]?_0x414472[_0xadf6('0x2d')]:_0x4373ed[_0xadf6('0x29')];if(!_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x414472[_0xadf6('0x1b')]=qs[_0xadf6('0x1b')](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x1b')]);_0x414472['offset']=qs['offset'](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x19')]);}_0x414472[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x4cf86e[_0xadf6('0x2a')]['sort']);_0x414472[_0xadf6('0x34')]=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x4cf86e[_0xadf6('0x2a')],_0x4373ed['filters']),_0x22ed45);if(_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x37')]){_0x414472[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x414472[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x22ed45,function(_0x287255){if(_0x287255[_0xadf6('0x28')]!==_0xadf6('0x39')){var _0x238a17={};_0x238a17[_0x287255[_0xadf6('0x23')]]={'$like':'%'+_0x4cf86e['query'][_0xadf6('0x37')]+'%'};return _0x238a17;}})});}_0x414472=_[_0xadf6('0x38')]({},_0x414472,_0x4cf86e[_0xadf6('0x3a')]);var _0x406f5f={'where':_0x414472[_0xadf6('0x34')]};return db['Automation']['count'](_0x406f5f)[_0xadf6('0x21')](function(_0x20d335){_0x32bc0f[_0xadf6('0x1c')]=_0x20d335;if(_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x3b')]){_0x414472['include']=[{'all':!![]}];}return db[_0xadf6('0x3c')][_0xadf6('0x3d')](_0x414472);})[_0xadf6('0x21')](function(_0x1a18db){_0x32bc0f['rows']=_0x1a18db;return _0x32bc0f;})[_0xadf6('0x21')](respondWithFilteredResult(_0x5492b9,_0x414472))[_0xadf6('0x3e')](handleError(_0x5492b9,null));};exports['show']=function(_0x30ac0b,_0x491c1c){var _0x5f304d={'raw':![],'where':{'id':_0x30ac0b[_0xadf6('0x3f')]['id']}},_0x35f262={};_0x35f262['model']=_['keys'](db[_0xadf6('0x3c')][_0xadf6('0x27')]);_0x35f262['query']=_[_0xadf6('0x2b')](_0x30ac0b['query']);_0x35f262['filters']=_[_0xadf6('0x2c')](_0x35f262['model'],_0x35f262[_0xadf6('0x2a')]);_0x5f304d[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x35f262[_0xadf6('0x29')],qs['fields'](_0x30ac0b[_0xadf6('0x2a')]['fields']));_0x5f304d[_0xadf6('0x2d')]=_0x5f304d[_0xadf6('0x2d')]['length']?_0x5f304d[_0xadf6('0x2d')]:_0x35f262[_0xadf6('0x29')];if(_0x30ac0b[_0xadf6('0x2a')][_0xadf6('0x3b')]){_0x5f304d[_0xadf6('0x40')]=[{'all':!![]}];}_0x5f304d=_['merge']({},_0x5f304d,_0x30ac0b[_0xadf6('0x3a')]);return db['Automation'][_0xadf6('0x41')](_0x5f304d)[_0xadf6('0x21')](handleEntityNotFound(_0x491c1c,null))[_0xadf6('0x21')](respondWithResult(_0x491c1c,null))[_0xadf6('0x3e')](handleError(_0x491c1c,null));};exports[_0xadf6('0x42')]=function(_0x11148,_0x40dbc9){return db[_0xadf6('0x3c')][_0xadf6('0x42')](_0x11148[_0xadf6('0x43')],{})['then'](respondWithResult(_0x40dbc9,0xc9))[_0xadf6('0x3e')](handleError(_0x40dbc9,null));};exports[_0xadf6('0x20')]=function(_0x5588f5,_0xf7768a){if(_0x5588f5[_0xadf6('0x43')]['id']){delete _0x5588f5[_0xadf6('0x43')]['id'];}return db[_0xadf6('0x3c')][_0xadf6('0x41')]({'where':{'id':_0x5588f5['params']['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0xf7768a,null))[_0xadf6('0x21')](saveUpdates(_0x5588f5[_0xadf6('0x43')],null))['then'](respondWithResult(_0xf7768a,null))[_0xadf6('0x3e')](handleError(_0xf7768a,null));};exports[_0xadf6('0x44')]=function(_0x53ecf8,_0x7f58d8){return db[_0xadf6('0x3c')][_0xadf6('0x41')]({'where':{'id':_0x53ecf8[_0xadf6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7f58d8,null))[_0xadf6('0x21')](removeEntity(_0x7f58d8,null))[_0xadf6('0x3e')](handleError(_0x7f58d8,null));};exports[_0xadf6('0x45')]=function(_0x43d23b,_0x664856,_0x148c10){return db['Condition'][_0xadf6('0x41')]({'where':{'id':_0x43d23b[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x664856,null))[_0xadf6('0x21')](function(_0x1ca532){if(_0x1ca532){return _0x1ca532['addConditions'](_0x43d23b[_0xadf6('0x43')][_0xadf6('0x46')],_[_0xadf6('0x47')](_0x43d23b['body'],[_0xadf6('0x46'),'id'])||{});}})['then'](respondWithResult(_0x664856,null))[_0xadf6('0x3e')](handleError(_0x664856,null));};exports[_0xadf6('0x48')]=function(_0x382dac,_0xe26e6a,_0x3ba91d){var _0x1d80c7={};var _0x228a24={};var _0x47f8d8;var _0x2272c3;return db[_0xadf6('0x3c')][_0xadf6('0x49')]({'where':{'id':_0x382dac['params']['id']}})['then'](handleEntityNotFound(_0xe26e6a,null))[_0xadf6('0x21')](function(_0x16d0eb){if(_0x16d0eb){_0x47f8d8=_0x16d0eb;_0x228a24[_0xadf6('0x29')]=_[_0xadf6('0x2b')](db[_0xadf6('0x4a')][_0xadf6('0x27')]);_0x228a24[_0xadf6('0x2a')]=_[_0xadf6('0x2b')](_0x382dac[_0xadf6('0x2a')]);_0x228a24[_0xadf6('0x35')]=_[_0xadf6('0x2c')](_0x228a24[_0xadf6('0x29')],_0x228a24['query']);_0x1d80c7['attributes']=_[_0xadf6('0x2c')](_0x228a24[_0xadf6('0x29')],qs[_0xadf6('0x2e')](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x2e')]));_0x1d80c7['attributes']=_0x1d80c7[_0xadf6('0x2d')]['length']?_0x1d80c7[_0xadf6('0x2d')]:_0x228a24['model'];_0x1d80c7[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x382dac['query'][_0xadf6('0x33')]);_0x1d80c7[_0xadf6('0x34')]=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x382dac[_0xadf6('0x2a')],_0x228a24['filters']));if(_0x382dac['query'][_0xadf6('0x37')]){_0x1d80c7[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x1d80c7[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x1d80c7[_0xadf6('0x2d')],function(_0x24ffcf){var _0x263e1f={};_0x263e1f[_0x24ffcf]={'$like':'%'+_0x382dac[_0xadf6('0x2a')][_0xadf6('0x37')]+'%'};return _0x263e1f;})});}_0x1d80c7=_['merge']({},_0x1d80c7,_0x382dac[_0xadf6('0x3a')]);return _0x47f8d8[_0xadf6('0x48')](_0x1d80c7);}})['then'](function(_0x3fa5ca){if(_0x3fa5ca){_0x2272c3=_0x3fa5ca[_0xadf6('0x2f')];if(!_0x382dac[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x1d80c7['limit']=qs[_0xadf6('0x1b')](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x1b')]);_0x1d80c7[_0xadf6('0x19')]=qs['offset'](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x19')]);}return _0x47f8d8['getConditions'](_0x1d80c7);}})[_0xadf6('0x21')](function(_0x268d04){if(_0x268d04){return _0x268d04?{'count':_0x2272c3,'rows':_0x268d04}:null;}})[_0xadf6('0x21')](respondWithResult(_0xe26e6a,null))[_0xadf6('0x3e')](handleError(_0xe26e6a,null));};exports[_0xadf6('0x4b')]=function(_0x2419ee,_0x41653b,_0xdbb4dc){return db[_0xadf6('0x4c')]['find']({'where':{'id':_0x2419ee[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x41653b,null))[_0xadf6('0x21')](function(_0x231340){if(_0x231340){return _0x231340['addActions'](_0x2419ee[_0xadf6('0x43')][_0xadf6('0x46')],_['omit'](_0x2419ee[_0xadf6('0x43')],['ids','id'])||{});}})[_0xadf6('0x21')](respondWithResult(_0x41653b,null))['catch'](handleError(_0x41653b,null));};exports[_0xadf6('0x4d')]=function(_0x16d243,_0x56e404,_0x2fb0f9){var _0x3e035f={};var _0x26337c={};var _0x146167;var _0x1cc15a;return db[_0xadf6('0x3c')][_0xadf6('0x49')]({'where':{'id':_0x16d243[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x56e404,null))['then'](function(_0x7236ed){if(_0x7236ed){_0x146167=_0x7236ed;_0x26337c['model']=_['keys'](db[_0xadf6('0x4c')][_0xadf6('0x27')]);_0x26337c['query']=_[_0xadf6('0x2b')](_0x16d243[_0xadf6('0x2a')]);_0x26337c['filters']=_['intersection'](_0x26337c[_0xadf6('0x29')],_0x26337c['query']);_0x3e035f[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x26337c['model'],qs[_0xadf6('0x2e')](_0x16d243['query'][_0xadf6('0x2e')]));_0x3e035f[_0xadf6('0x2d')]=_0x3e035f[_0xadf6('0x2d')][_0xadf6('0x2f')]?_0x3e035f[_0xadf6('0x2d')]:_0x26337c[_0xadf6('0x29')];_0x3e035f[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x16d243[_0xadf6('0x2a')]['sort']);_0x3e035f['where']=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x16d243[_0xadf6('0x2a')],_0x26337c[_0xadf6('0x35')]));if(_0x16d243[_0xadf6('0x2a')]['filter']){_0x3e035f[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x3e035f[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x3e035f[_0xadf6('0x2d')],function(_0x294787){var _0x252d5d={};_0x252d5d[_0x294787]={'$like':'%'+_0x16d243[_0xadf6('0x2a')][_0xadf6('0x37')]+'%'};return _0x252d5d;})});}_0x3e035f=_[_0xadf6('0x38')]({},_0x3e035f,_0x16d243[_0xadf6('0x3a')]);return _0x146167[_0xadf6('0x4d')](_0x3e035f);}})['then'](function(_0x354650){if(_0x354650){_0x1cc15a=_0x354650[_0xadf6('0x2f')];if(!_0x16d243[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x3e035f[_0xadf6('0x1b')]=qs[_0xadf6('0x1b')](_0x16d243['query'][_0xadf6('0x1b')]);_0x3e035f[_0xadf6('0x19')]=qs['offset'](_0x16d243[_0xadf6('0x2a')][_0xadf6('0x19')]);}return _0x146167['getActions'](_0x3e035f);}})['then'](function(_0x181829){if(_0x181829){return _0x181829?{'count':_0x1cc15a,'rows':_0x181829}:null;}})[_0xadf6('0x21')](respondWithResult(_0x56e404,null))['catch'](handleError(_0x56e404,null));};
\ No newline at end of file
+var _0x7e34=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','Automation','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','rows','catch','params','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','pick','options','addActions','Action','getActions','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x28f1db,_0x487815){var _0x4ffcab=function(_0x4af3f0){while(--_0x4af3f0){_0x28f1db['push'](_0x28f1db['shift']());}};_0x4ffcab(++_0x487815);}(_0x7e34,0xe8));var _0x47e3=function(_0x3c4321,_0x471f6e){_0x3c4321=_0x3c4321-0x0;var _0x3eff75=_0x7e34[_0x3c4321];return _0x3eff75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x47e3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47e3('0x1'));var moment=require(_0x47e3('0x2'));var BPromise=require(_0x47e3('0x3'));var Mustache=require(_0x47e3('0x4'));var util=require(_0x47e3('0x5'));var path=require(_0x47e3('0x6'));var sox=require('sox');var csv=require(_0x47e3('0x7'));var ejs=require(_0x47e3('0x8'));var fs=require('fs');var fs_extra=require(_0x47e3('0x9'));var _=require(_0x47e3('0xa'));var squel=require(_0x47e3('0xb'));var crypto=require('crypto');var jsforce=require(_0x47e3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x47e3('0xd'));var Papa=require(_0x47e3('0xe'));var Redis=require(_0x47e3('0xf'));var authService=require(_0x47e3('0x10'));var qs=require(_0x47e3('0x11'));var as=require(_0x47e3('0x12'));var hardwareService=require(_0x47e3('0x13'));var logger=require(_0x47e3('0x14'))(_0x47e3('0x15'));var utils=require(_0x47e3('0x16'));var config=require(_0x47e3('0x17'));var licenseUtil=require(_0x47e3('0x18'));var db=require(_0x47e3('0x19'))['db'];function respondWithStatusCode(_0xff1e55,_0x4b98d1){_0x4b98d1=_0x4b98d1||0xcc;return function(_0xb18a96){if(_0xb18a96){return _0xff1e55[_0x47e3('0x1a')](_0x4b98d1);}return _0xff1e55['status'](_0x4b98d1)[_0x47e3('0x1b')]();};}function respondWithResult(_0x4cbf7c,_0x451e3){_0x451e3=_0x451e3||0xc8;return function(_0x4d70ca){if(_0x4d70ca){return _0x4cbf7c[_0x47e3('0x1c')](_0x451e3)[_0x47e3('0x1d')](_0x4d70ca);}};}function respondWithFilteredResult(_0x1e8f37,_0xd3831f){return function(_0x3a42da){if(_0x3a42da){var _0x459dc9=typeof _0xd3831f['offset']==='undefined'&&typeof _0xd3831f[_0x47e3('0x1e')]==='undefined';var _0x3b9d20=_0x3a42da[_0x47e3('0x1f')];var _0x356628=_0x459dc9?0x0:_0xd3831f[_0x47e3('0x20')];var _0x16a1c7=_0x459dc9?_0x3a42da[_0x47e3('0x1f')]:_0xd3831f['offset']+_0xd3831f['limit'];var _0x234eb9;if(_0x16a1c7>=_0x3b9d20){_0x16a1c7=_0x3b9d20;_0x234eb9=0xc8;}else{_0x234eb9=0xce;}_0x1e8f37['status'](_0x234eb9);return _0x1e8f37[_0x47e3('0x21')](_0x47e3('0x22'),_0x356628+'-'+_0x16a1c7+'/'+_0x3b9d20)[_0x47e3('0x1d')](_0x3a42da);}return null;};}function patchUpdates(_0x3898db){return function(_0x2e8b3b){try{jsonpatch['apply'](_0x2e8b3b,_0x3898db,!![]);}catch(_0x19bd83){return BPromise[_0x47e3('0x23')](_0x19bd83);}return _0x2e8b3b[_0x47e3('0x24')]();};}function saveUpdates(_0x2bf075,_0x48d69f){return function(_0x4816ae){if(_0x4816ae){return _0x4816ae[_0x47e3('0x25')](_0x2bf075)['then'](function(_0x3c28b8){return _0x3c28b8;});}return null;};}function removeEntity(_0x4d7b15,_0x13a05c){return function(_0x545ebe){if(_0x545ebe){return _0x545ebe['destroy']()[_0x47e3('0x26')](function(){_0x4d7b15[_0x47e3('0x1c')](0xcc)[_0x47e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fa343,_0x1588f3){return function(_0x510148){if(!_0x510148){_0x2fa343[_0x47e3('0x1a')](0x194);}return _0x510148;};}function handleError(_0x214510,_0x1b6e6e){_0x1b6e6e=_0x1b6e6e||0x1f4;return function(_0x4075cb){logger[_0x47e3('0x27')](_0x4075cb['stack']);if(_0x4075cb[_0x47e3('0x28')]){delete _0x4075cb[_0x47e3('0x28')];}_0x214510[_0x47e3('0x1c')](_0x1b6e6e)[_0x47e3('0x29')](_0x4075cb);};}exports['index']=function(_0x2a28ee,_0x561fe9){var _0x379c13={},_0x1c05fa={},_0x50768e={'count':0x0,'rows':[]};var _0x1afcd5=_['map'](db[_0x47e3('0x2a')][_0x47e3('0x2b')],function(_0x2ba406){return{'name':_0x2ba406[_0x47e3('0x2c')],'type':_0x2ba406['type'][_0x47e3('0x2d')]};});_0x1c05fa['model']=_[_0x47e3('0x2e')](_0x1afcd5,_0x47e3('0x28'));_0x1c05fa[_0x47e3('0x2f')]=_[_0x47e3('0x30')](_0x2a28ee[_0x47e3('0x2f')]);_0x1c05fa['filters']=_[_0x47e3('0x31')](_0x1c05fa[_0x47e3('0x32')],_0x1c05fa[_0x47e3('0x2f')]);_0x379c13[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x1c05fa[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x2a28ee['query'][_0x47e3('0x34')]));_0x379c13[_0x47e3('0x33')]=_0x379c13[_0x47e3('0x33')][_0x47e3('0x35')]?_0x379c13[_0x47e3('0x33')]:_0x1c05fa[_0x47e3('0x32')];if(!_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x36')](_0x47e3('0x37'))){_0x379c13[_0x47e3('0x1e')]=qs[_0x47e3('0x1e')](_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x1e')]);_0x379c13[_0x47e3('0x20')]=qs['offset'](_0x2a28ee[_0x47e3('0x2f')]['offset']);}_0x379c13[_0x47e3('0x38')]=qs['sort'](_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x39')]);_0x379c13[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_['pick'](_0x2a28ee[_0x47e3('0x2f')],_0x1c05fa['filters']),_0x1afcd5);if(_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x379c13[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x379c13['where'],{'$or':_[_0x47e3('0x2e')](_0x1afcd5,function(_0x255863){if(_0x255863['type']!=='VIRTUAL'){var _0x4cba57={};_0x4cba57[_0x255863['name']]={'$like':'%'+_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3c')]+'%'};return _0x4cba57;}})});}_0x379c13=_['merge']({},_0x379c13,_0x2a28ee['options']);var _0x164ad3={'where':_0x379c13[_0x47e3('0x3a')]};return db['Automation'][_0x47e3('0x1f')](_0x164ad3)[_0x47e3('0x26')](function(_0x52d788){_0x50768e[_0x47e3('0x1f')]=_0x52d788;if(_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3e')]){_0x379c13[_0x47e3('0x3f')]=[{'all':!![]}];}return db[_0x47e3('0x2a')]['findAll'](_0x379c13);})[_0x47e3('0x26')](function(_0x557b30){_0x50768e[_0x47e3('0x40')]=_0x557b30;return _0x50768e;})['then'](respondWithFilteredResult(_0x561fe9,_0x379c13))[_0x47e3('0x41')](handleError(_0x561fe9,null));};exports['show']=function(_0x5666aa,_0x39ff9d){var _0x2a9f5a={'raw':![],'where':{'id':_0x5666aa[_0x47e3('0x42')]['id']}},_0x414fa2={};_0x414fa2[_0x47e3('0x32')]=_[_0x47e3('0x30')](db['Automation'][_0x47e3('0x2b')]);_0x414fa2['query']=_[_0x47e3('0x30')](_0x5666aa[_0x47e3('0x2f')]);_0x414fa2['filters']=_[_0x47e3('0x31')](_0x414fa2[_0x47e3('0x32')],_0x414fa2[_0x47e3('0x2f')]);_0x2a9f5a[_0x47e3('0x33')]=_['intersection'](_0x414fa2[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x5666aa[_0x47e3('0x2f')][_0x47e3('0x34')]));_0x2a9f5a[_0x47e3('0x33')]=_0x2a9f5a['attributes'][_0x47e3('0x35')]?_0x2a9f5a[_0x47e3('0x33')]:_0x414fa2[_0x47e3('0x32')];if(_0x5666aa[_0x47e3('0x2f')][_0x47e3('0x3e')]){_0x2a9f5a[_0x47e3('0x3f')]=[{'all':!![]}];}_0x2a9f5a=_[_0x47e3('0x3d')]({},_0x2a9f5a,_0x5666aa['options']);return db['Automation'][_0x47e3('0x43')](_0x2a9f5a)['then'](handleEntityNotFound(_0x39ff9d,null))[_0x47e3('0x26')](respondWithResult(_0x39ff9d,null))[_0x47e3('0x41')](handleError(_0x39ff9d,null));};exports[_0x47e3('0x44')]=function(_0x1f0ee9,_0x17f2b7){return db[_0x47e3('0x2a')][_0x47e3('0x44')](_0x1f0ee9[_0x47e3('0x45')],{})[_0x47e3('0x26')](respondWithResult(_0x17f2b7,0xc9))[_0x47e3('0x41')](handleError(_0x17f2b7,null));};exports[_0x47e3('0x25')]=function(_0x3b5b58,_0x290404){if(_0x3b5b58['body']['id']){delete _0x3b5b58[_0x47e3('0x45')]['id'];}return db[_0x47e3('0x2a')][_0x47e3('0x43')]({'where':{'id':_0x3b5b58[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x290404,null))[_0x47e3('0x26')](saveUpdates(_0x3b5b58[_0x47e3('0x45')],null))[_0x47e3('0x26')](respondWithResult(_0x290404,null))['catch'](handleError(_0x290404,null));};exports[_0x47e3('0x46')]=function(_0x232dda,_0x444a2a){return db[_0x47e3('0x2a')][_0x47e3('0x43')]({'where':{'id':_0x232dda[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x444a2a,null))['then'](removeEntity(_0x444a2a,null))['catch'](handleError(_0x444a2a,null));};exports[_0x47e3('0x47')]=function(_0x3d6499,_0x31f2db,_0x4b9b71){return db[_0x47e3('0x48')]['find']({'where':{'id':_0x3d6499[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x31f2db,null))['then'](function(_0x1c7b94){if(_0x1c7b94){return _0x1c7b94[_0x47e3('0x47')](_0x3d6499[_0x47e3('0x45')][_0x47e3('0x49')],_[_0x47e3('0x4a')](_0x3d6499[_0x47e3('0x45')],[_0x47e3('0x49'),'id'])||{});}})[_0x47e3('0x26')](respondWithResult(_0x31f2db,null))[_0x47e3('0x41')](handleError(_0x31f2db,null));};exports[_0x47e3('0x4b')]=function(_0x245b7d,_0x31292b,_0x1b6a9e){var _0x342238={};var _0x3ee3de={};var _0x585fad;var _0x539ea0;return db[_0x47e3('0x2a')][_0x47e3('0x4c')]({'where':{'id':_0x245b7d[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x31292b,null))[_0x47e3('0x26')](function(_0x56274a){if(_0x56274a){_0x585fad=_0x56274a;_0x3ee3de[_0x47e3('0x32')]=_[_0x47e3('0x30')](db[_0x47e3('0x48')]['rawAttributes']);_0x3ee3de[_0x47e3('0x2f')]=_[_0x47e3('0x30')](_0x245b7d[_0x47e3('0x2f')]);_0x3ee3de['filters']=_[_0x47e3('0x31')](_0x3ee3de[_0x47e3('0x32')],_0x3ee3de[_0x47e3('0x2f')]);_0x342238[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x3ee3de[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x245b7d[_0x47e3('0x2f')]['fields']));_0x342238[_0x47e3('0x33')]=_0x342238[_0x47e3('0x33')][_0x47e3('0x35')]?_0x342238[_0x47e3('0x33')]:_0x3ee3de['model'];_0x342238[_0x47e3('0x38')]=qs[_0x47e3('0x39')](_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x39')]);_0x342238[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_[_0x47e3('0x4d')](_0x245b7d[_0x47e3('0x2f')],_0x3ee3de[_0x47e3('0x3b')]));if(_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x342238[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x342238[_0x47e3('0x3a')],{'$or':_[_0x47e3('0x2e')](_0x342238[_0x47e3('0x33')],function(_0x4ec926){var _0x5223b3={};_0x5223b3[_0x4ec926]={'$like':'%'+_0x245b7d['query'][_0x47e3('0x3c')]+'%'};return _0x5223b3;})});}_0x342238=_[_0x47e3('0x3d')]({},_0x342238,_0x245b7d[_0x47e3('0x4e')]);return _0x585fad[_0x47e3('0x4b')](_0x342238);}})[_0x47e3('0x26')](function(_0x185f52){if(_0x185f52){_0x539ea0=_0x185f52[_0x47e3('0x35')];if(!_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x36')]('nolimit')){_0x342238['limit']=qs['limit'](_0x245b7d['query'][_0x47e3('0x1e')]);_0x342238[_0x47e3('0x20')]=qs[_0x47e3('0x20')](_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x20')]);}return _0x585fad[_0x47e3('0x4b')](_0x342238);}})[_0x47e3('0x26')](function(_0x52dbf0){if(_0x52dbf0){return _0x52dbf0?{'count':_0x539ea0,'rows':_0x52dbf0}:null;}})[_0x47e3('0x26')](respondWithResult(_0x31292b,null))[_0x47e3('0x41')](handleError(_0x31292b,null));};exports[_0x47e3('0x4f')]=function(_0x58b0b2,_0xe53d68,_0x4692db){return db[_0x47e3('0x50')][_0x47e3('0x43')]({'where':{'id':_0x58b0b2[_0x47e3('0x42')]['id']}})['then'](handleEntityNotFound(_0xe53d68,null))[_0x47e3('0x26')](function(_0x5ef865){if(_0x5ef865){return _0x5ef865[_0x47e3('0x4f')](_0x58b0b2['body'][_0x47e3('0x49')],_[_0x47e3('0x4a')](_0x58b0b2[_0x47e3('0x45')],[_0x47e3('0x49'),'id'])||{});}})[_0x47e3('0x26')](respondWithResult(_0xe53d68,null))[_0x47e3('0x41')](handleError(_0xe53d68,null));};exports['getActions']=function(_0x58c0f0,_0x3f11cb,_0x49d811){var _0x492a27={};var _0x1b07e1={};var _0x568fdf;var _0x329192;return db[_0x47e3('0x2a')][_0x47e3('0x4c')]({'where':{'id':_0x58c0f0['params']['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x3f11cb,null))[_0x47e3('0x26')](function(_0x30f804){if(_0x30f804){_0x568fdf=_0x30f804;_0x1b07e1[_0x47e3('0x32')]=_[_0x47e3('0x30')](db['Action'][_0x47e3('0x2b')]);_0x1b07e1[_0x47e3('0x2f')]=_['keys'](_0x58c0f0['query']);_0x1b07e1['filters']=_[_0x47e3('0x31')](_0x1b07e1[_0x47e3('0x32')],_0x1b07e1[_0x47e3('0x2f')]);_0x492a27[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x1b07e1['model'],qs[_0x47e3('0x34')](_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x34')]));_0x492a27[_0x47e3('0x33')]=_0x492a27[_0x47e3('0x33')][_0x47e3('0x35')]?_0x492a27[_0x47e3('0x33')]:_0x1b07e1['model'];_0x492a27['order']=qs['sort'](_0x58c0f0[_0x47e3('0x2f')]['sort']);_0x492a27[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_[_0x47e3('0x4d')](_0x58c0f0[_0x47e3('0x2f')],_0x1b07e1[_0x47e3('0x3b')]));if(_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x492a27[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x492a27[_0x47e3('0x3a')],{'$or':_['map'](_0x492a27['attributes'],function(_0x1ed220){var _0x4b64f6={};_0x4b64f6[_0x1ed220]={'$like':'%'+_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x3c')]+'%'};return _0x4b64f6;})});}_0x492a27=_[_0x47e3('0x3d')]({},_0x492a27,_0x58c0f0[_0x47e3('0x4e')]);return _0x568fdf[_0x47e3('0x51')](_0x492a27);}})[_0x47e3('0x26')](function(_0x19436f){if(_0x19436f){_0x329192=_0x19436f[_0x47e3('0x35')];if(!_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x36')](_0x47e3('0x37'))){_0x492a27[_0x47e3('0x1e')]=qs['limit'](_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x1e')]);_0x492a27['offset']=qs[_0x47e3('0x20')](_0x58c0f0[_0x47e3('0x2f')]['offset']);}return _0x568fdf[_0x47e3('0x51')](_0x492a27);}})[_0x47e3('0x26')](function(_0x1c8ea3){if(_0x1c8ea3){return _0x1c8ea3?{'count':_0x329192,'rows':_0x1c8ea3}:null;}})['then'](respondWithResult(_0x3f11cb,null))[_0x47e3('0x41')](handleError(_0x3f11cb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 1700e9e..a32f8f6 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 _0x3dcf=['rimraf','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x13a92a,_0x7a2223){var _0x36cca4=function(_0x1fc0c4){while(--_0x1fc0c4){_0x13a92a['push'](_0x13a92a['shift']());}};_0x36cca4(++_0x7a2223);}(_0x3dcf,0xca));var _0xf3dc=function(_0x1d908f,_0xc9d055){_0x1d908f=_0x1d908f-0x0;var _0x3cea2e=_0x3dcf[_0x1d908f];return _0x3cea2e;};'use strict';var _=require(_0xf3dc('0x0'));var util=require(_0xf3dc('0x1'));var logger=require(_0xf3dc('0x2'))(_0xf3dc('0x3'));var moment=require(_0xf3dc('0x4'));var BPromise=require(_0xf3dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3dc('0x6'));var rimraf=require(_0xf3dc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3dc('0x8'));module['exports']=function(_0x13f3d4,_0x38550b){return _0x13f3d4['define'](_0xf3dc('0x9'),attributes,{'tableName':_0xf3dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9781=['api','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x9781,0x129));var _0x1978=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x9781[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x1978('0x0'));var util=require(_0x1978('0x1'));var logger=require(_0x1978('0x2'))(_0x1978('0x3'));var moment=require('moment');var BPromise=require(_0x1978('0x4'));var rp=require(_0x1978('0x5'));var fs=require('fs');var path=require(_0x1978('0x6'));var rimraf=require(_0x1978('0x7'));var config=require('../../config/environment');var attributes=require(_0x1978('0x8'));module[_0x1978('0x9')]=function(_0xfff9d9,_0x6288cc){return _0xfff9d9[_0x1978('0xa')]('Automation',attributes,{'tableName':_0x1978('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index c2fc687..61d72ff 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 _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x116867,_0x1011a8){var _0x585ba0=function(_0x2738ff){while(--_0x2738ff){_0x116867['push'](_0x116867['shift']());}};_0x585ba0(++_0x1011a8);}(_0x958a,0x128));var _0xa958=function(_0x5a2886,_0x161de5){_0x5a2886=_0x5a2886-0x0;var _0x41635d=_0x958a[_0x5a2886];return _0x41635d;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}
\ No newline at end of file
+var _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x1228b2,_0x1445c1){var _0x2fc1ed=function(_0x125122){while(--_0x125122){_0x1228b2['push'](_0x1228b2['shift']());}};_0x2fc1ed(++_0x1445c1);}(_0x96f2,0xb0));var _0x296f=function(_0x3b684e,_0x357ce4){_0x3b684e=_0x3b684e-0x0;var _0x21a5cb=_0x96f2[_0x3b684e];return _0x21a5cb;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('Automation,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2d4aa3c..af28334 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 _0x20a2=['../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4906f0,_0x44ffc9){var _0x414b60=function(_0x3848a9){while(--_0x3848a9){_0x4906f0['push'](_0x4906f0['shift']());}};_0x414b60(++_0x44ffc9);}(_0x20a2,0x102));var _0x220a=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x20a2[_0x36bc58];return _0x4a547e;};'use strict';var multer=require(_0x220a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x220a('0x1'));var express=require(_0x220a('0x2'));var router=express[_0x220a('0x3')]();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require('../../config/environment');var controller=require(_0x220a('0x7'));router[_0x220a('0x8')]('/',auth[_0x220a('0x9')](),controller[_0x220a('0xa')]);router[_0x220a('0x8')](_0x220a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x220a('0x8')](_0x220a('0xc'),auth[_0x220a('0x9')](),controller[_0x220a('0xd')]);router[_0x220a('0x8')](_0x220a('0xe'),auth[_0x220a('0x9')](),controller[_0x220a('0xf')]);router['post']('/',auth[_0x220a('0x9')](),controller['create']);router[_0x220a('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x220a('0x11')]);router[_0x220a('0x10')]('/:id/actions',auth[_0x220a('0x9')](),controller['addActions']);router[_0x220a('0x12')](_0x220a('0xb'),auth[_0x220a('0x9')](),controller[_0x220a('0x13')]);router[_0x220a('0x14')](_0x220a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x220a('0x15')]=router;
\ No newline at end of file
+var _0x9879=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','delete'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x9879,0x98));var _0x9987=function(_0x4e7089,_0x2eab9e){_0x4e7089=_0x4e7089-0x0;var _0xd6b060=_0x9879[_0x4e7089];return _0xd6b060;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0x9')](_0x9987('0xc'),auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0x9')](_0x9987('0xe'),auth[_0x9987('0xa')](),controller[_0x9987('0xf')]);router[_0x9987('0x10')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0x11')]);router[_0x9987('0x10')](_0x9987('0xc'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);router[_0x9987('0x10')]('/:id/actions',auth[_0x9987('0xa')](),controller[_0x9987('0x13')]);router[_0x9987('0x14')](_0x9987('0x15'),auth[_0x9987('0xa')](),controller['update']);router[_0x9987('0x16')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0x17')]);module[_0x9987('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 739337f..4930703 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 _0x80fa=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD'];(function(_0x48e538,_0x4199b9){var _0xfbe826=function(_0x37adf4){while(--_0x37adf4){_0x48e538['push'](_0x48e538['shift']());}};_0xfbe826(++_0x4199b9);}(_0x80fa,0xd9));var _0xa80f=function(_0x5fa506,_0x5bc55f){_0x5fa506=_0x5fa506-0x0;var _0x1ae1bf=_0x80fa[_0x5fa506];return _0x1ae1bf;};'use strict';var Sequelize=require(_0xa80f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa80f('0x1')],'unique':_0xa80f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa80f('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xa80f('0x4')},'description':{'type':Sequelize[_0xa80f('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa80f('0x5')},'limitCalls':{'type':Sequelize[_0xa80f('0x6')](0x4)[_0xa80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa80f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'comment':_0xa80f('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa80f('0xf')},'dialTimezone':{'type':Sequelize[_0xa80f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa80f('0x1')],'defaultValue':_0xa80f('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xa80f('0x3')]('always',_0xa80f('0x11'),_0xa80f('0x12')),'defaultValue':_0xa80f('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa80f('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa80f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa80f('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa80f('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa80f('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa80f('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa80f('0x3')](_0xa80f('0x19'),'ASC'),'defaultValue':_0xa80f('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa80f('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x21')}};
\ No newline at end of file
+var _0xdd72=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x20d5ea,_0x293bec){var _0x58d095=function(_0x1828ea){while(--_0x1828ea){_0x20d5ea['push'](_0x20d5ea['shift']());}};_0x58d095(++_0x293bec);}(_0xdd72,0xb4));var _0x2dd7=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xdd72[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x2dd7('0x0'));module[_0x2dd7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2dd7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2dd7('0x3')](_0x2dd7('0x4')),'allowNull':![],'defaultValue':_0x2dd7('0x4')},'description':{'type':Sequelize[_0x2dd7('0x5')]},'active':{'type':Sequelize[_0x2dd7('0x6')],'defaultValue':0x0,'comment':_0x2dd7('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2dd7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2dd7('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2dd7('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'comment':_0x2dd7('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2dd7('0x10')},'dialTimezone':{'type':Sequelize[_0x2dd7('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2dd7('0x5')],'defaultValue':_0x2dd7('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x2dd7('0x3')](_0x2dd7('0x12'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2dd7('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2dd7('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2dd7('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2dd7('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2dd7('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2dd7('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2dd7('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2dd7('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2dd7('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2dd7('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2dd7('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2dd7('0x3')]('DESC','ASC'),'defaultValue':_0x2dd7('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2dd7('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index c0142c6..152ede9 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 _0x1724=['createdAt','body','updatedAt','user','role','UserProfileSection','userProfileId','getHoppers','CmHopper','CampaignId','findOne','CmHopperHistory','nolimit','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','select','NOW()','field','ContactId','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','OrderBy','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','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','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone'];(function(_0x49dfe3,_0x5fb8f){var _0xb2a3ec=function(_0x3af028){while(--_0x3af028){_0x49dfe3['push'](_0x49dfe3['shift']());}};_0xb2a3ec(++_0x5fb8f);}(_0x1724,0xca));var _0x4172=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1724[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x4172('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4172('0x1'));var jsonpatch=require(_0x4172('0x2'));var rp=require(_0x4172('0x3'));var moment=require('moment');var BPromise=require(_0x4172('0x4'));var Mustache=require('mustache');var util=require(_0x4172('0x5'));var path=require(_0x4172('0x6'));var sox=require(_0x4172('0x7'));var csv=require(_0x4172('0x8'));var ejs=require(_0x4172('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4172('0xa'));var squel=require(_0x4172('0xb'));var crypto=require('crypto');var jsforce=require(_0x4172('0xc'));var deskjs=require(_0x4172('0xd'));var toCsv=require(_0x4172('0x8'));var querystring=require(_0x4172('0xe'));var Papa=require(_0x4172('0xf'));var Redis=require(_0x4172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4172('0x11'));var as=require(_0x4172('0x12'));var hardwareService=require(_0x4172('0x13'));var logger=require(_0x4172('0x14'))(_0x4172('0x15'));var utils=require(_0x4172('0x16'));var config=require(_0x4172('0x17'));var licenseUtil=require(_0x4172('0x18'));var db=require(_0x4172('0x19'))['db'];function respondWithStatusCode(_0x2d5e1b,_0x403c17){_0x403c17=_0x403c17||0xcc;return function(_0xdac044){if(_0xdac044){return _0x2d5e1b[_0x4172('0x1a')](_0x403c17);}return _0x2d5e1b['status'](_0x403c17)['end']();};}function respondWithResult(_0x1d41e3,_0x3b5ccd){_0x3b5ccd=_0x3b5ccd||0xc8;return function(_0x5c83de){if(_0x5c83de){return _0x1d41e3[_0x4172('0x1b')](_0x3b5ccd)[_0x4172('0x1c')](_0x5c83de);}};}function respondWithFilteredResult(_0x34a3f3,_0x21e990){return function(_0xf7f7df){if(_0xf7f7df){var _0x4a0b4e=typeof _0x21e990[_0x4172('0x1d')]===_0x4172('0x1e')&&typeof _0x21e990['limit']===_0x4172('0x1e');var _0x3a505d=_0xf7f7df[_0x4172('0x1f')];var _0x594a77=_0x4a0b4e?0x0:_0x21e990['offset'];var _0x3840c3=_0x4a0b4e?_0xf7f7df['count']:_0x21e990[_0x4172('0x1d')]+_0x21e990[_0x4172('0x20')];var _0x16cb53;if(_0x3840c3>=_0x3a505d){_0x3840c3=_0x3a505d;_0x16cb53=0xc8;}else{_0x16cb53=0xce;}_0x34a3f3[_0x4172('0x1b')](_0x16cb53);return _0x34a3f3[_0x4172('0x21')](_0x4172('0x22'),_0x594a77+'-'+_0x3840c3+'/'+_0x3a505d)['json'](_0xf7f7df);}return null;};}function patchUpdates(_0x560c32){return function(_0x4dd773){try{jsonpatch[_0x4172('0x23')](_0x4dd773,_0x560c32,!![]);}catch(_0xb6f7f2){return BPromise['reject'](_0xb6f7f2);}return _0x4dd773['save']();};}function saveUpdates(_0xfa0157,_0x29b01a){return function(_0x1a5667){if(_0x1a5667){return _0x1a5667[_0x4172('0x24')](_0xfa0157)[_0x4172('0x25')](function(_0x2924de){return _0x2924de;});}return null;};}function removeEntity(_0x38a941,_0x2c393f){return function(_0x5e90a4){if(_0x5e90a4){return _0x5e90a4[_0x4172('0x26')]()[_0x4172('0x25')](function(){var _0xe276e=_0x5e90a4['get']({'plain':!![]});var _0x33b36b=_0x4172('0x27');return db[_0x4172('0x28')][_0x4172('0x26')]({'where':{'type':_0x33b36b,'resourceId':_0xe276e['id']}})[_0x4172('0x25')](function(){return _0x5e90a4;});})[_0x4172('0x25')](function(){_0x38a941[_0x4172('0x1b')](0xcc)[_0x4172('0x29')]();});}};}function handleEntityNotFound(_0xc758a2,_0x469893){return function(_0x21b175){if(!_0x21b175){_0xc758a2[_0x4172('0x1a')](0x194);}return _0x21b175;};}function handleError(_0x455ec6,_0x29b59d){_0x29b59d=_0x29b59d||0x1f4;return function(_0x5f090d){logger[_0x4172('0x2a')](_0x5f090d[_0x4172('0x2b')]);if(_0x5f090d[_0x4172('0x2c')]){delete _0x5f090d[_0x4172('0x2c')];}_0x455ec6[_0x4172('0x1b')](_0x29b59d)[_0x4172('0x2d')](_0x5f090d);};}exports[_0x4172('0x2e')]=function(_0x5c7877,_0x30ed4e){var _0x2f6ece={},_0x43c40b={},_0x32929a={'count':0x0,'rows':[]};var _0x5cbd60=_[_0x4172('0x2f')](db[_0x4172('0x30')][_0x4172('0x31')],function(_0x4a40c6){return{'name':_0x4a40c6['fieldName'],'type':_0x4a40c6[_0x4172('0x32')]['key']};});_0x43c40b[_0x4172('0x33')]=_['map'](_0x5cbd60,_0x4172('0x2c'));_0x43c40b[_0x4172('0x34')]=_[_0x4172('0x35')](_0x5c7877[_0x4172('0x34')]);_0x43c40b[_0x4172('0x36')]=_[_0x4172('0x37')](_0x43c40b[_0x4172('0x33')],_0x43c40b['query']);_0x2f6ece['attributes']=_[_0x4172('0x37')](_0x43c40b[_0x4172('0x33')],qs[_0x4172('0x38')](_0x5c7877[_0x4172('0x34')]['fields']));_0x2f6ece[_0x4172('0x39')]=_0x2f6ece['attributes'][_0x4172('0x3a')]?_0x2f6ece[_0x4172('0x39')]:_0x43c40b[_0x4172('0x33')];if(!_0x5c7877[_0x4172('0x34')][_0x4172('0x3b')]('nolimit')){_0x2f6ece[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x5c7877[_0x4172('0x34')]['limit']);_0x2f6ece['offset']=qs[_0x4172('0x1d')](_0x5c7877[_0x4172('0x34')]['offset']);}_0x2f6ece[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x5c7877[_0x4172('0x34')]['sort']);_0x2f6ece[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x5c7877['query'],_0x43c40b[_0x4172('0x36')]),_0x5cbd60);if(_0x5c7877[_0x4172('0x34')][_0x4172('0x40')]){_0x2f6ece[_0x4172('0x3e')]=_['merge'](_0x2f6ece['where'],{'$or':_[_0x4172('0x2f')](_0x5cbd60,function(_0x382363){if(_0x382363[_0x4172('0x32')]!=='VIRTUAL'){var _0x24f1fa={};_0x24f1fa[_0x382363[_0x4172('0x2c')]]={'$like':'%'+_0x5c7877[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x24f1fa;}})});}_0x2f6ece=_[_0x4172('0x41')]({},_0x2f6ece,_0x5c7877[_0x4172('0x42')]);var _0xc1b7dc={'where':_0x2f6ece[_0x4172('0x3e')]};return db[_0x4172('0x30')][_0x4172('0x1f')](_0xc1b7dc)[_0x4172('0x25')](function(_0x26741b){_0x32929a[_0x4172('0x1f')]=_0x26741b;if(_0x5c7877[_0x4172('0x34')][_0x4172('0x43')]){_0x2f6ece[_0x4172('0x44')]=[{'all':!![]}];}return db[_0x4172('0x30')][_0x4172('0x45')](_0x2f6ece);})['then'](function(_0x21b37a){_0x32929a[_0x4172('0x46')]=_0x21b37a;return _0x32929a;})[_0x4172('0x25')](respondWithFilteredResult(_0x30ed4e,_0x2f6ece))['catch'](handleError(_0x30ed4e,null));};exports['show']=function(_0x4bb948,_0x53dc70){var _0x2290b5={'raw':![],'where':{'id':_0x4bb948[_0x4172('0x47')]['id']}},_0x17f62e={};_0x17f62e['model']=_[_0x4172('0x35')](db[_0x4172('0x30')][_0x4172('0x31')]);_0x17f62e[_0x4172('0x34')]=_[_0x4172('0x35')](_0x4bb948[_0x4172('0x34')]);_0x17f62e[_0x4172('0x36')]=_['intersection'](_0x17f62e['model'],_0x17f62e[_0x4172('0x34')]);_0x2290b5['attributes']=_[_0x4172('0x37')](_0x17f62e[_0x4172('0x33')],qs['fields'](_0x4bb948[_0x4172('0x34')][_0x4172('0x38')]));_0x2290b5['attributes']=_0x2290b5[_0x4172('0x39')][_0x4172('0x3a')]?_0x2290b5[_0x4172('0x39')]:_0x17f62e[_0x4172('0x33')];if(_0x4bb948[_0x4172('0x34')]['includeAll']){_0x2290b5[_0x4172('0x44')]=[{'all':!![]}];}_0x2290b5=_[_0x4172('0x41')]({},_0x2290b5,_0x4bb948[_0x4172('0x42')]);return db[_0x4172('0x30')][_0x4172('0x48')](_0x2290b5)[_0x4172('0x25')](handleEntityNotFound(_0x53dc70,null))['then'](respondWithResult(_0x53dc70,null))['catch'](handleError(_0x53dc70,null));};exports['create']=function(_0x11ec87,_0xcf6937){return db[_0x4172('0x30')]['create'](_0x11ec87['body'],{})['then'](function(_0x3d9043){var _0x4904eb=_0x11ec87['user'][_0x4172('0x49')]({'plain':!![]});if(!_0x4904eb)throw new Error(_0x4172('0x4a'));if(_0x4904eb['role']==='user'){var _0x5e3e78=_0x3d9043['get']({'plain':!![]});var _0x25aece=_0x4172('0x27');return db['UserProfileSection'][_0x4172('0x48')]({'where':{'name':_0x25aece,'userProfileId':_0x4904eb['userProfileId']},'raw':!![]})[_0x4172('0x25')](function(_0x3c4db8){if(_0x3c4db8&&_0x3c4db8[_0x4172('0x4b')]===0x0){return db['UserProfileResource'][_0x4172('0x4c')]({'name':_0x5e3e78[_0x4172('0x2c')],'resourceId':_0x5e3e78['id'],'type':_0x3c4db8[_0x4172('0x2c')],'sectionId':_0x3c4db8['id']},{})['then'](function(){return _0x3d9043;});}else{return _0x3d9043;}})['catch'](function(_0x44bee6){logger[_0x4172('0x2a')](_0x4172('0x4d'),_0x44bee6);throw _0x44bee6;});}return _0x3d9043;})[_0x4172('0x25')](respondWithResult(_0xcf6937,0xc9))[_0x4172('0x4e')](handleError(_0xcf6937,null));};exports[_0x4172('0x4f')]=function(_0x5c80c0,_0x356ec4){var _0xd7568={'where':{'id':_0x5c80c0[_0x4172('0x47')]['id']}},_0xf25cd4={};_0xf25cd4['model']=_[_0x4172('0x35')](db['Campaign'][_0x4172('0x31')]);_0xd7568[_0x4172('0x39')]=_[_0x4172('0x37')](_0xf25cd4[_0x4172('0x33')],qs[_0x4172('0x38')](_0x5c80c0[_0x4172('0x34')][_0x4172('0x38')]));_0xd7568[_0x4172('0x39')]=_0xd7568[_0x4172('0x39')][_0x4172('0x3a')]?_0xd7568[_0x4172('0x39')]:_0xf25cd4[_0x4172('0x33')];if(_0x5c80c0[_0x4172('0x34')][_0x4172('0x43')]){_0xd7568[_0x4172('0x44')]=[{'all':!![]}];}_0xd7568=_[_0x4172('0x41')]({},_0xd7568,_0x5c80c0[_0x4172('0x42')]);return db[_0x4172('0x30')][_0x4172('0x48')](_0xd7568)[_0x4172('0x25')](handleEntityNotFound(_0x356ec4,null))[_0x4172('0x25')](function(_0x4903b3){if(_0x4903b3){var _0x161312=_0x4903b3['get']({'plain':!![]});_0x161312=qs['omit'](_0x161312,['id',_0x4172('0x50'),'updatedAt']);_0x5c80c0['body']=_['omit'](_0x5c80c0[_0x4172('0x51')],['id','createdAt',_0x4172('0x52')]);return db[_0x4172('0x30')][_0x4172('0x4c')](_['merge'](_0x161312,_0x5c80c0['body']),{'include':_0x5c80c0[_0x4172('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x4172('0x25')](function(_0x1c615b){var _0x5d085c=_0x5c80c0[_0x4172('0x53')][_0x4172('0x49')]({'plain':!![]});if(!_0x5d085c)throw new Error(_0x4172('0x4a'));if(_0x5d085c[_0x4172('0x54')]===_0x4172('0x53')){var _0xda1680=_0x1c615b[_0x4172('0x49')]({'plain':!![]});var _0x2a9a9c=_0x4172('0x27');return db[_0x4172('0x55')][_0x4172('0x48')]({'where':{'name':_0x2a9a9c,'userProfileId':_0x5d085c[_0x4172('0x56')]},'raw':!![]})[_0x4172('0x25')](function(_0x4e97c8){if(_0x4e97c8&&_0x4e97c8[_0x4172('0x4b')]===0x0){return db['UserProfileResource'][_0x4172('0x4c')]({'name':_0xda1680['name'],'resourceId':_0xda1680['id'],'type':_0x4e97c8[_0x4172('0x2c')],'sectionId':_0x4e97c8['id']},{})[_0x4172('0x25')](function(){return _0x1c615b;});}else{return _0x1c615b;}})[_0x4172('0x4e')](function(_0x2d82e8){logger[_0x4172('0x2a')](_0x4172('0x4d'),_0x2d82e8);throw _0x2d82e8;});}return _0x1c615b;});}})[_0x4172('0x25')](respondWithResult(_0x356ec4,0xc9))['catch'](handleError(_0x356ec4,null));};exports[_0x4172('0x24')]=function(_0x2f055f,_0xbe4ae4){if(_0x2f055f['body']['id']){delete _0x2f055f[_0x4172('0x51')]['id'];}return db['Campaign'][_0x4172('0x48')]({'where':{'id':_0x2f055f['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xbe4ae4,null))[_0x4172('0x25')](saveUpdates(_0x2f055f[_0x4172('0x51')],null))[_0x4172('0x25')](respondWithResult(_0xbe4ae4,null))[_0x4172('0x4e')](handleError(_0xbe4ae4,null));};exports[_0x4172('0x26')]=function(_0x56461b,_0x291c7f){return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x56461b['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x291c7f,null))['then'](removeEntity(_0x291c7f,null))[_0x4172('0x4e')](handleError(_0x291c7f,null));};exports[_0x4172('0x57')]=function(_0x3b8303,_0xf4ed1b,_0x2a2faf){var _0x5a459e={'raw':!![],'where':{}};var _0x11fa24={};var _0x514f64={'count':0x0,'rows':[]};return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x3b8303['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xf4ed1b,null))[_0x4172('0x25')](function(_0x2ef626){if(_0x2ef626){_0x11fa24['model']=_[_0x4172('0x35')](db[_0x4172('0x58')][_0x4172('0x31')]);_0x11fa24['query']=_[_0x4172('0x35')](_0x3b8303[_0x4172('0x34')]);_0x11fa24[_0x4172('0x36')]=_[_0x4172('0x37')](_0x11fa24[_0x4172('0x33')],_0x11fa24[_0x4172('0x34')]);_0x5a459e['attributes']=_[_0x4172('0x37')](_0x11fa24[_0x4172('0x33')],qs['fields'](_0x3b8303[_0x4172('0x34')]['fields']));_0x5a459e['attributes']=_0x5a459e[_0x4172('0x39')][_0x4172('0x3a')]?_0x5a459e[_0x4172('0x39')]:_0x11fa24['model'];if(!_0x3b8303['query'][_0x4172('0x3b')]('nolimit')){_0x5a459e['limit']=qs[_0x4172('0x20')](_0x3b8303[_0x4172('0x34')][_0x4172('0x20')]);_0x5a459e[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0x3b8303['query'][_0x4172('0x1d')]);}_0x5a459e[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x3b8303[_0x4172('0x34')]['sort']);_0x5a459e[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x3b8303[_0x4172('0x34')],_0x11fa24[_0x4172('0x36')]));_0x5a459e[_0x4172('0x3e')][_0x4172('0x59')]=_0x2ef626['id'];if(_0x3b8303[_0x4172('0x34')]['filter']){_0x5a459e[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x5a459e['where'],{'$or':_[_0x4172('0x2f')](_0x5a459e[_0x4172('0x39')],function(_0x10d0a1){var _0x597db7={};_0x597db7[_0x10d0a1]={'$like':'%'+_0x3b8303[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x597db7;})});}_0x5a459e=_[_0x4172('0x41')]({},_0x5a459e,_0x3b8303[_0x4172('0x42')]);return db['CmHopper'][_0x4172('0x1f')]({'where':_0x5a459e[_0x4172('0x3e')]})['then'](function(_0x4d54e0){_0x514f64[_0x4172('0x1f')]=_0x4d54e0;if(_0x3b8303[_0x4172('0x34')][_0x4172('0x43')]){_0x5a459e[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x4172('0x45')](_0x5a459e);})[_0x4172('0x25')](function(_0x5ca8b5){_0x514f64['rows']=_0x5ca8b5;return _0x514f64;});}})['then'](respondWithFilteredResult(_0xf4ed1b,_0x5a459e))[_0x4172('0x4e')](handleError(_0xf4ed1b,null));};exports['getHopperHistories']=function(_0xd3010b,_0x283194,_0x45204f){var _0x368ce8={'raw':!![],'where':{}};var _0xf6f3c9={};var _0x1b8355={'count':0x0,'rows':[]};return db['Campaign'][_0x4172('0x5a')]({'where':{'id':_0xd3010b[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x283194,null))[_0x4172('0x25')](function(_0xf7d2c7){if(_0xf7d2c7){_0xf6f3c9[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5b')][_0x4172('0x31')]);_0xf6f3c9[_0x4172('0x34')]=_[_0x4172('0x35')](_0xd3010b[_0x4172('0x34')]);_0xf6f3c9['filters']=_[_0x4172('0x37')](_0xf6f3c9[_0x4172('0x33')],_0xf6f3c9['query']);_0x368ce8[_0x4172('0x39')]=_['intersection'](_0xf6f3c9[_0x4172('0x33')],qs[_0x4172('0x38')](_0xd3010b[_0x4172('0x34')][_0x4172('0x38')]));_0x368ce8[_0x4172('0x39')]=_0x368ce8['attributes'][_0x4172('0x3a')]?_0x368ce8['attributes']:_0xf6f3c9[_0x4172('0x33')];if(!_0xd3010b[_0x4172('0x34')][_0x4172('0x3b')](_0x4172('0x5c'))){_0x368ce8[_0x4172('0x20')]=qs[_0x4172('0x20')](_0xd3010b[_0x4172('0x34')][_0x4172('0x20')]);_0x368ce8[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0xd3010b[_0x4172('0x34')][_0x4172('0x1d')]);}_0x368ce8[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0xd3010b[_0x4172('0x34')][_0x4172('0x3d')]);_0x368ce8['where']=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0xd3010b[_0x4172('0x34')],_0xf6f3c9[_0x4172('0x36')]));_0x368ce8['where']['CampaignId']=_0xf7d2c7['id'];if(_0xd3010b['query'][_0x4172('0x40')]){_0x368ce8[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x368ce8['where'],{'$or':_[_0x4172('0x2f')](_0x368ce8[_0x4172('0x39')],function(_0x49b5e9){var _0x3f18ba={};_0x3f18ba[_0x49b5e9]={'$like':'%'+_0xd3010b['query'][_0x4172('0x40')]+'%'};return _0x3f18ba;})});}_0x368ce8=_[_0x4172('0x41')]({},_0x368ce8,_0xd3010b[_0x4172('0x42')]);return db['CmHopperHistory'][_0x4172('0x1f')]({'where':_0x368ce8[_0x4172('0x3e')]})[_0x4172('0x25')](function(_0x47b6df){_0x1b8355[_0x4172('0x1f')]=_0x47b6df;if(_0xd3010b['query'][_0x4172('0x43')]){_0x368ce8[_0x4172('0x44')]=[{'all':!![]}];}return db[_0x4172('0x5b')][_0x4172('0x45')](_0x368ce8);})[_0x4172('0x25')](function(_0x36d994){_0x1b8355['rows']=_0x36d994;return _0x1b8355;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x283194,_0x368ce8))['catch'](handleError(_0x283194,null));};exports['getHopperFinals']=function(_0x5039c1,_0x386003,_0x41d473){var _0x384ccd={'raw':!![],'where':{}};var _0x52b15c={};var _0x24ee32={'count':0x0,'rows':[]};return db[_0x4172('0x30')][_0x4172('0x5a')]({'where':{'id':_0x5039c1[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x386003,null))[_0x4172('0x25')](function(_0x41c25d){if(_0x41c25d){_0x52b15c[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5d')][_0x4172('0x31')]);_0x52b15c[_0x4172('0x34')]=_[_0x4172('0x35')](_0x5039c1[_0x4172('0x34')]);_0x52b15c[_0x4172('0x36')]=_['intersection'](_0x52b15c[_0x4172('0x33')],_0x52b15c[_0x4172('0x34')]);_0x384ccd[_0x4172('0x39')]=_[_0x4172('0x37')](_0x52b15c['model'],qs[_0x4172('0x38')](_0x5039c1[_0x4172('0x34')][_0x4172('0x38')]));_0x384ccd['attributes']=_0x384ccd[_0x4172('0x39')][_0x4172('0x3a')]?_0x384ccd[_0x4172('0x39')]:_0x52b15c[_0x4172('0x33')];if(!_0x5039c1['query'][_0x4172('0x3b')](_0x4172('0x5c'))){_0x384ccd['limit']=qs[_0x4172('0x20')](_0x5039c1['query'][_0x4172('0x20')]);_0x384ccd['offset']=qs['offset'](_0x5039c1['query'][_0x4172('0x1d')]);}_0x384ccd['order']=qs[_0x4172('0x3d')](_0x5039c1['query']['sort']);_0x384ccd['where']=qs['filters'](_[_0x4172('0x3f')](_0x5039c1[_0x4172('0x34')],_0x52b15c[_0x4172('0x36')]));_0x384ccd[_0x4172('0x3e')][_0x4172('0x59')]=_0x41c25d['id'];if(_0x5039c1[_0x4172('0x34')][_0x4172('0x40')]){_0x384ccd[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x384ccd[_0x4172('0x3e')],{'$or':_[_0x4172('0x2f')](_0x384ccd['attributes'],function(_0x3b7770){var _0x230335={};_0x230335[_0x3b7770]={'$like':'%'+_0x5039c1['query'][_0x4172('0x40')]+'%'};return _0x230335;})});}_0x384ccd=_[_0x4172('0x41')]({},_0x384ccd,_0x5039c1[_0x4172('0x42')]);return db[_0x4172('0x5d')][_0x4172('0x1f')]({'where':_0x384ccd[_0x4172('0x3e')]})['then'](function(_0x36cd5f){_0x24ee32[_0x4172('0x1f')]=_0x36cd5f;if(_0x5039c1[_0x4172('0x34')]['includeAll']){_0x384ccd[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4172('0x45')](_0x384ccd);})['then'](function(_0x4989d6){_0x24ee32[_0x4172('0x46')]=_0x4989d6;return _0x24ee32;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x386003,_0x384ccd))[_0x4172('0x4e')](handleError(_0x386003,null));};exports['getHopperBlacks']=function(_0x399886,_0x5be83a,_0x559016){var _0x513b42={'raw':!![],'where':{}};var _0x9ca7d8={};var _0x3bcebc={'count':0x0,'rows':[]};return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x399886['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x5be83a,null))[_0x4172('0x25')](function(_0x2f6173){if(_0x2f6173){_0x9ca7d8[_0x4172('0x33')]=_[_0x4172('0x35')](db['CmHopperBlack']['rawAttributes']);_0x9ca7d8[_0x4172('0x34')]=_[_0x4172('0x35')](_0x399886[_0x4172('0x34')]);_0x9ca7d8[_0x4172('0x36')]=_[_0x4172('0x37')](_0x9ca7d8[_0x4172('0x33')],_0x9ca7d8[_0x4172('0x34')]);_0x513b42['attributes']=_[_0x4172('0x37')](_0x9ca7d8[_0x4172('0x33')],qs[_0x4172('0x38')](_0x399886[_0x4172('0x34')][_0x4172('0x38')]));_0x513b42[_0x4172('0x39')]=_0x513b42[_0x4172('0x39')][_0x4172('0x3a')]?_0x513b42['attributes']:_0x9ca7d8[_0x4172('0x33')];if(!_0x399886[_0x4172('0x34')][_0x4172('0x3b')](_0x4172('0x5c'))){_0x513b42[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x399886[_0x4172('0x34')][_0x4172('0x20')]);_0x513b42['offset']=qs['offset'](_0x399886[_0x4172('0x34')][_0x4172('0x1d')]);}_0x513b42[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x399886[_0x4172('0x34')][_0x4172('0x3d')]);_0x513b42['where']=qs['filters'](_[_0x4172('0x3f')](_0x399886[_0x4172('0x34')],_0x9ca7d8[_0x4172('0x36')]));_0x513b42[_0x4172('0x3e')][_0x4172('0x59')]=_0x2f6173['id'];if(_0x399886[_0x4172('0x34')][_0x4172('0x40')]){_0x513b42[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x513b42[_0x4172('0x3e')],{'$or':_['map'](_0x513b42['attributes'],function(_0x1a64e9){var _0x3ee540={};_0x3ee540[_0x1a64e9]={'$like':'%'+_0x399886['query'][_0x4172('0x40')]+'%'};return _0x3ee540;})});}_0x513b42=_[_0x4172('0x41')]({},_0x513b42,_0x399886['options']);return db[_0x4172('0x5e')][_0x4172('0x1f')]({'where':_0x513b42[_0x4172('0x3e')]})['then'](function(_0x219d72){_0x3bcebc[_0x4172('0x1f')]=_0x219d72;if(_0x399886[_0x4172('0x34')][_0x4172('0x43')]){_0x513b42[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x513b42);})[_0x4172('0x25')](function(_0x11d362){_0x3bcebc[_0x4172('0x46')]=_0x11d362;return _0x3bcebc;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x5be83a,_0x513b42))[_0x4172('0x4e')](handleError(_0x5be83a,null));};exports['getLists']=function(_0x2aa463,_0x4f286a,_0x2a8900){var _0xed3181={};var _0xd800b9={};var _0x5268ee;var _0x3c9bc6;return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x2aa463[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f286a,null))[_0x4172('0x25')](function(_0xc4abb6){if(_0xc4abb6){_0x5268ee=_0xc4abb6;_0xd800b9[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5f')][_0x4172('0x31')]);_0xd800b9[_0x4172('0x34')]=_[_0x4172('0x35')](_0x2aa463[_0x4172('0x34')]);_0xd800b9[_0x4172('0x36')]=_[_0x4172('0x37')](_0xd800b9[_0x4172('0x33')],_0xd800b9['query']);_0xed3181[_0x4172('0x39')]=_[_0x4172('0x37')](_0xd800b9[_0x4172('0x33')],qs[_0x4172('0x38')](_0x2aa463[_0x4172('0x34')][_0x4172('0x38')]));_0xed3181[_0x4172('0x39')]=_0xed3181[_0x4172('0x39')]['length']?_0xed3181[_0x4172('0x39')]:_0xd800b9[_0x4172('0x33')];_0xed3181[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x2aa463[_0x4172('0x34')][_0x4172('0x3d')]);_0xed3181[_0x4172('0x3e')]=qs[_0x4172('0x36')](_['pick'](_0x2aa463[_0x4172('0x34')],_0xd800b9['filters']));if(_0x2aa463['query'][_0x4172('0x40')]){_0xed3181[_0x4172('0x3e')]=_[_0x4172('0x41')](_0xed3181[_0x4172('0x3e')],{'$or':_[_0x4172('0x2f')](_0xed3181[_0x4172('0x39')],function(_0x1faf8f){var _0x7f0e75={};_0x7f0e75[_0x1faf8f]={'$like':'%'+_0x2aa463['query']['filter']+'%'};return _0x7f0e75;})});}_0xed3181=_[_0x4172('0x41')]({},_0xed3181,_0x2aa463[_0x4172('0x42')]);return _0x5268ee[_0x4172('0x60')](_0xed3181);}})[_0x4172('0x25')](function(_0x542f52){if(_0x542f52){_0x3c9bc6=_0x542f52['length'];if(!_0x2aa463['query'][_0x4172('0x3b')](_0x4172('0x5c'))){_0xed3181[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x2aa463[_0x4172('0x34')]['limit']);_0xed3181['offset']=qs[_0x4172('0x1d')](_0x2aa463[_0x4172('0x34')][_0x4172('0x1d')]);}return _0x5268ee[_0x4172('0x60')](_0xed3181);}})[_0x4172('0x25')](function(_0x33efe2){if(_0x33efe2){return _0x33efe2?{'count':_0x3c9bc6,'rows':_0x33efe2}:null;}})[_0x4172('0x25')](respondWithResult(_0x4f286a,null))[_0x4172('0x4e')](handleError(_0x4f286a,null));};exports[_0x4172('0x61')]=function(_0x4aa228,_0xcaa109,_0x15eab4){var _0x53fae5,_0x5a403d;var _0x28bba3=[];var _0x5401a1=moment()['format'](_0x4172('0x62'));return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x4aa228['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xcaa109,null))[_0x4172('0x25')](function(_0x16e953){if(_0x16e953){_0x5a403d=_0x16e953;return _0x16e953[_0x4172('0x61')](_0x4aa228[_0x4172('0x51')][_0x4172('0x63')],_[_0x4172('0x64')](_0x4aa228[_0x4172('0x51')],['ids','id'])||{});}return null;})[_0x4172('0x65')](function(_0x18a354){var _0xc43191;var _0x1d7a76;_0x53fae5=_0x18a354||[];var _0x571455=[];if(_0x18a354){for(var _0x5b2030=0x0;_0x5b2030<_0x18a354[_0x4172('0x3a')];_0x5b2030+=0x1){var _0x43c6e3=_0x18a354[_0x5b2030][_0x4172('0x49')]({'plain':!![]});_0x5a403d[_0x4172('0x66')]=_0x4aa228['body'][_0x4172('0x66')]?_0x4aa228[_0x4172('0x51')][_0x4172('0x66')]:_0x5a403d[_0x4172('0x66')];switch(_0x5a403d[_0x4172('0x66')]){case _0x4172('0x67'):_0xc43191=squel[_0x4172('0x68')]()['into'](_0x4172('0x69'))['fromQuery']([_0x4172('0x6a'),_0x4172('0x6b'),'ContactId','ListId','CampaignId','createdAt',_0x4172('0x52')],squel[_0x4172('0x6c')]()['field']('phone',_0x4172('0x6a'))['field'](_0x4172('0x6d'),_0x4172('0x6b'))[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3[_0x4172('0x70')][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228['params']['id'][_0x4172('0x71')](),'CampaignId')['field']('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')](_0x4172('0x74'))[_0x4172('0x3e')](_0x4172('0x75'))[_0x4172('0x3e')](_0x4172('0x76'),_0x43c6e3['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x77'))[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()[_0x4172('0x6e')](_0x4172('0x79'))['from'](_0x4172('0x7a'))['where'](_0x4172('0x7b'),_0x4aa228['params']['id'][_0x4172('0x71')]()))[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()['field']('COALESCE(phone,\x27\x27)')[_0x4172('0x73')](_0x4172('0x69'))[_0x4172('0x3e')]('CampaignId\x20=\x20?',_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')]())))[_0x4172('0x71')]();break;case _0x4172('0x7c'):_0xc43191=squel['insert']()[_0x4172('0x7d')](_0x4172('0x69'))[_0x4172('0x7e')]([_0x4172('0x6a'),'scheduledAt',_0x4172('0x6f'),'ListId',_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel[_0x4172('0x6c')]()[_0x4172('0x6e')](_0x4172('0x6a'),_0x4172('0x6a'))['field'](_0x4172('0x6d'),_0x4172('0x6b'))[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3['CmListId'][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228['params']['id'][_0x4172('0x71')](),_0x4172('0x59'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27','createdAt')[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))['from'](_0x4172('0x74'))[_0x4172('0x3e')](_0x4172('0x75'))['where']('ListId\x20=\x20?',_0x43c6e3[_0x4172('0x70')]['toString']())[_0x4172('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x4172('0x7b'),_0x4aa228[_0x4172('0x47')]['id']['toString']())))[_0x4172('0x71')]();break;default:_0xc43191=squel[_0x4172('0x68')]()[_0x4172('0x7d')]('cm_hopper')[_0x4172('0x7e')]([_0x4172('0x6a'),_0x4172('0x6b'),_0x4172('0x6f'),'ListId',_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel['select']()[_0x4172('0x6e')](_0x4172('0x6a'),_0x4172('0x6a'))[_0x4172('0x6e')](_0x4172('0x6d'),'scheduledAt')[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3[_0x4172('0x70')][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')](),_0x4172('0x59'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x4172('0x3e')](_0x4172('0x76'),_0x43c6e3['CmListId'][_0x4172('0x71')]())[_0x4172('0x3e')](_0x4172('0x77')))['toString']();}_0x1d7a76=squel['insert']()[_0x4172('0x7d')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId','scheduledAt',_0x4172('0x6a'),_0x4172('0x7f'),'createdAt',_0x4172('0x52')],squel[_0x4172('0x6c')]()['field']('h.id','id')[_0x4172('0x6e')](_0x4172('0x6d'),'scheduledAt')[_0x4172('0x6e')]('ci.item','phone')['field'](_0x4172('0x80'),'OrderBy')['field']('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x4172('0x81'))[_0x4172('0x3e')](_0x4172('0x82'),_0x43c6e3['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x83'),_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')]())[_0x4172('0x3e')](_0x4172('0x84'),_0x5401a1))[_0x4172('0x71')]();_0x571455[_0x4172('0x85')](db['sequelize']['query'](_0xc43191));_0x28bba3['push'](db['sequelize'][_0x4172('0x34')](_0x1d7a76));}return BPromise['all'](_0x571455);}})[_0x4172('0x25')](function(){return BPromise['all'](_0x28bba3);})[_0x4172('0x25')](function(){return _0x53fae5;})['then'](respondWithResult(_0xcaa109,null))[_0x4172('0x4e')](handleError(_0xcaa109,null));};exports[_0x4172('0x86')]=function(_0x3bee17,_0x57a2fa,_0x20ca89){return db[_0x4172('0x30')]['find']({'where':{'id':_0x3bee17[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x57a2fa,null))[_0x4172('0x25')](function(_0x444b2a){if(_0x444b2a){return _0x444b2a[_0x4172('0x86')](_0x3bee17[_0x4172('0x34')][_0x4172('0x63')]);}})['then'](function(_0x3f1cd1){if(_0x3f1cd1){return db[_0x4172('0x58')][_0x4172('0x26')]({'where':{'ListId':_0x3bee17[_0x4172('0x34')]['ids'],'CampaignId':_0x3bee17['params']['id']}})[_0x4172('0x25')](function(){return _0x3f1cd1;});}})[_0x4172('0x25')](respondWithStatusCode(_0x57a2fa,null))[_0x4172('0x4e')](handleError(_0x57a2fa,null));};exports[_0x4172('0x87')]=function(_0x455e2e,_0xd6aeb3,_0x45433b){var _0x412f17={};var _0x1e92ba={};var _0x5a1750;var _0x110ff2;return db['Campaign'][_0x4172('0x5a')]({'where':{'id':_0x455e2e[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xd6aeb3,null))[_0x4172('0x25')](function(_0x451021){if(_0x451021){_0x5a1750=_0x451021;_0x1e92ba[_0x4172('0x33')]=_['keys'](db[_0x4172('0x5f')][_0x4172('0x31')]);_0x1e92ba[_0x4172('0x34')]=_[_0x4172('0x35')](_0x455e2e[_0x4172('0x34')]);_0x1e92ba['filters']=_[_0x4172('0x37')](_0x1e92ba[_0x4172('0x33')],_0x1e92ba[_0x4172('0x34')]);_0x412f17[_0x4172('0x39')]=_[_0x4172('0x37')](_0x1e92ba[_0x4172('0x33')],qs[_0x4172('0x38')](_0x455e2e[_0x4172('0x34')][_0x4172('0x38')]));_0x412f17['attributes']=_0x412f17[_0x4172('0x39')][_0x4172('0x3a')]?_0x412f17[_0x4172('0x39')]:_0x1e92ba[_0x4172('0x33')];_0x412f17[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x455e2e[_0x4172('0x34')][_0x4172('0x3d')]);_0x412f17[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x455e2e['query'],_0x1e92ba[_0x4172('0x36')]));if(_0x455e2e[_0x4172('0x34')][_0x4172('0x40')]){_0x412f17[_0x4172('0x3e')]=_['merge'](_0x412f17[_0x4172('0x3e')],{'$or':_['map'](_0x412f17[_0x4172('0x39')],function(_0x1e0490){var _0x409fe1={};_0x409fe1[_0x1e0490]={'$like':'%'+_0x455e2e[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x409fe1;})});}_0x412f17=_[_0x4172('0x41')]({},_0x412f17,_0x455e2e[_0x4172('0x42')]);return _0x5a1750[_0x4172('0x87')](_0x412f17);}})[_0x4172('0x25')](function(_0x2722f6){if(_0x2722f6){_0x110ff2=_0x2722f6[_0x4172('0x3a')];if(!_0x455e2e['query']['hasOwnProperty'](_0x4172('0x5c'))){_0x412f17[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x455e2e['query'][_0x4172('0x20')]);_0x412f17[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0x455e2e[_0x4172('0x34')][_0x4172('0x1d')]);}return _0x5a1750[_0x4172('0x87')](_0x412f17);}})['then'](function(_0x5b14b7){if(_0x5b14b7){return _0x5b14b7?{'count':_0x110ff2,'rows':_0x5b14b7}:null;}})[_0x4172('0x25')](respondWithResult(_0xd6aeb3,null))[_0x4172('0x4e')](handleError(_0xd6aeb3,null));};exports['addBlackLists']=function(_0x22f1d3,_0x48101a,_0x3ef8c8){var _0x723ab7,_0x2dc7db;var _0x4c0d76=[];var _0x156a10=moment()['format'](_0x4172('0x62'));return db['Campaign'][_0x4172('0x48')]({'where':{'id':_0x22f1d3[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x48101a,null))['then'](function(_0x2342e7){if(_0x2342e7){_0x2dc7db=_0x2342e7;return _0x2342e7[_0x4172('0x88')](_0x22f1d3[_0x4172('0x51')][_0x4172('0x63')],_['omit'](_0x22f1d3[_0x4172('0x51')],['ids','id'])||{});}return null;})[_0x4172('0x65')](function(_0x308d0d){var _0x32a8f1;var _0x55f493;_0x723ab7=_0x308d0d||[];var _0x469ef6=[];if(_0x308d0d){for(var _0x3ba3f6=0x0;_0x3ba3f6<_0x308d0d['length'];_0x3ba3f6+=0x1){var _0x3770c2=_0x308d0d[_0x3ba3f6]['get']({'plain':!![]});_0x32a8f1=squel['insert']()[_0x4172('0x7d')](_0x4172('0x89'))['fromQuery']([_0x4172('0x6a'),'ContactId',_0x4172('0x72'),_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel[_0x4172('0x6c')]()['field'](_0x4172('0x6a'),_0x4172('0x6a'))[_0x4172('0x6e')]('id','ContactId')['field'](_0x3770c2['CmListId'][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x22f1d3[_0x4172('0x47')]['id']['toString'](),'CampaignId')['field']('NOW()',_0x4172('0x50'))[_0x4172('0x6e')](_0x4172('0x6d'),'updatedAt')[_0x4172('0x73')]('cm_contacts')[_0x4172('0x3e')](_0x4172('0x75'))[_0x4172('0x3e')](_0x4172('0x76'),_0x3770c2['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x77')))['toString']();_0x469ef6[_0x4172('0x85')](db[_0x4172('0x8a')][_0x4172('0x34')](_0x32a8f1));}return BPromise[_0x4172('0x8b')](_0x469ef6);}})[_0x4172('0x25')](function(){return _0x723ab7;})[_0x4172('0x25')](respondWithResult(_0x48101a,null))[_0x4172('0x4e')](handleError(_0x48101a,null));};exports[_0x4172('0x8c')]=function(_0x42ceba,_0x73accd,_0x3e024b){return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x42ceba[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x73accd,null))[_0x4172('0x25')](function(_0x14df57){if(_0x14df57){return _0x14df57[_0x4172('0x8c')](_0x42ceba[_0x4172('0x34')][_0x4172('0x63')]);}})[_0x4172('0x25')](function(_0x3c57c6){if(_0x3c57c6){return db[_0x4172('0x5e')]['destroy']({'where':{'ListId':_0x42ceba[_0x4172('0x34')]['ids'],'CampaignId':_0x42ceba[_0x4172('0x47')]['id']}})[_0x4172('0x25')](function(){return _0x3c57c6;});}})[_0x4172('0x25')](respondWithStatusCode(_0x73accd,null))[_0x4172('0x4e')](handleError(_0x73accd,null));};
\ No newline at end of file
+var _0x7b08=['findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','phone','field','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','select','NOW()','cm_contacts','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','addBlackLists','format','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','filter','options','findAll','rows','catch','show','params','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','getHoppers'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7b08,0x163));var _0x87b0=function(_0x1e0104,_0x5f3de8){_0x1e0104=_0x1e0104-0x0;var _0x4309aa=_0x7b08[_0x1e0104];return _0x4309aa;};'use strict';var emlformat=require(_0x87b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87b0('0x1'));var jsonpatch=require(_0x87b0('0x2'));var rp=require(_0x87b0('0x3'));var moment=require('moment');var BPromise=require(_0x87b0('0x4'));var Mustache=require(_0x87b0('0x5'));var util=require(_0x87b0('0x6'));var path=require(_0x87b0('0x7'));var sox=require('sox');var csv=require(_0x87b0('0x8'));var ejs=require(_0x87b0('0x9'));var fs=require('fs');var fs_extra=require(_0x87b0('0xa'));var _=require(_0x87b0('0xb'));var squel=require(_0x87b0('0xc'));var crypto=require(_0x87b0('0xd'));var jsforce=require(_0x87b0('0xe'));var deskjs=require(_0x87b0('0xf'));var toCsv=require(_0x87b0('0x8'));var querystring=require(_0x87b0('0x10'));var Papa=require('papaparse');var Redis=require(_0x87b0('0x11'));var authService=require(_0x87b0('0x12'));var qs=require(_0x87b0('0x13'));var as=require(_0x87b0('0x14'));var hardwareService=require(_0x87b0('0x15'));var logger=require(_0x87b0('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x87b0('0x17'));var licenseUtil=require(_0x87b0('0x18'));var db=require(_0x87b0('0x19'))['db'];function respondWithStatusCode(_0x4ab82c,_0x11cc41){_0x11cc41=_0x11cc41||0xcc;return function(_0x417b8e){if(_0x417b8e){return _0x4ab82c['sendStatus'](_0x11cc41);}return _0x4ab82c[_0x87b0('0x1a')](_0x11cc41)[_0x87b0('0x1b')]();};}function respondWithResult(_0x567f17,_0x525195){_0x525195=_0x525195||0xc8;return function(_0x1f44b6){if(_0x1f44b6){return _0x567f17['status'](_0x525195)['json'](_0x1f44b6);}};}function respondWithFilteredResult(_0x5880a4,_0xb802c6){return function(_0x32b53b){if(_0x32b53b){var _0x47b023=typeof _0xb802c6[_0x87b0('0x1c')]===_0x87b0('0x1d')&&typeof _0xb802c6[_0x87b0('0x1e')]===_0x87b0('0x1d');var _0x2960ec=_0x32b53b[_0x87b0('0x1f')];var _0x27bf79=_0x47b023?0x0:_0xb802c6[_0x87b0('0x1c')];var _0xb9fca8=_0x47b023?_0x32b53b[_0x87b0('0x1f')]:_0xb802c6['offset']+_0xb802c6[_0x87b0('0x1e')];var _0x45c423;if(_0xb9fca8>=_0x2960ec){_0xb9fca8=_0x2960ec;_0x45c423=0xc8;}else{_0x45c423=0xce;}_0x5880a4['status'](_0x45c423);return _0x5880a4[_0x87b0('0x20')](_0x87b0('0x21'),_0x27bf79+'-'+_0xb9fca8+'/'+_0x2960ec)[_0x87b0('0x22')](_0x32b53b);}return null;};}function patchUpdates(_0x5c29e6){return function(_0x1fcaeb){try{jsonpatch[_0x87b0('0x23')](_0x1fcaeb,_0x5c29e6,!![]);}catch(_0x21924d){return BPromise[_0x87b0('0x24')](_0x21924d);}return _0x1fcaeb['save']();};}function saveUpdates(_0x2d1eba,_0xc1ec21){return function(_0x305b9d){if(_0x305b9d){return _0x305b9d[_0x87b0('0x25')](_0x2d1eba)[_0x87b0('0x26')](function(_0x37076f){return _0x37076f;});}return null;};}function removeEntity(_0xe1c9ff,_0x17a2d0){return function(_0x203e44){if(_0x203e44){return _0x203e44['destroy']()[_0x87b0('0x26')](function(){var _0x4a3bd5=_0x203e44[_0x87b0('0x27')]({'plain':!![]});var _0x464296='IvrCampaigns';return db[_0x87b0('0x28')][_0x87b0('0x29')]({'where':{'type':_0x464296,'resourceId':_0x4a3bd5['id']}})['then'](function(){return _0x203e44;});})['then'](function(){_0xe1c9ff[_0x87b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb783,_0x3eb83e){return function(_0xf440b9){if(!_0xf440b9){_0x1cb783[_0x87b0('0x2a')](0x194);}return _0xf440b9;};}function handleError(_0x550e2a,_0x30fe04){_0x30fe04=_0x30fe04||0x1f4;return function(_0x31bd55){logger[_0x87b0('0x2b')](_0x31bd55[_0x87b0('0x2c')]);if(_0x31bd55[_0x87b0('0x2d')]){delete _0x31bd55[_0x87b0('0x2d')];}_0x550e2a[_0x87b0('0x1a')](_0x30fe04)[_0x87b0('0x2e')](_0x31bd55);};}exports['index']=function(_0x3d285b,_0x382f7d){var _0x4e159b={},_0x42e85c={},_0x226fdd={'count':0x0,'rows':[]};var _0x3298d8=_[_0x87b0('0x2f')](db[_0x87b0('0x30')][_0x87b0('0x31')],function(_0x3e17e1){return{'name':_0x3e17e1[_0x87b0('0x32')],'type':_0x3e17e1[_0x87b0('0x33')][_0x87b0('0x34')]};});_0x42e85c['model']=_[_0x87b0('0x2f')](_0x3298d8,_0x87b0('0x2d'));_0x42e85c[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x3d285b[_0x87b0('0x35')]);_0x42e85c['filters']=_['intersection'](_0x42e85c['model'],_0x42e85c['query']);_0x4e159b['attributes']=_[_0x87b0('0x37')](_0x42e85c[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x3d285b[_0x87b0('0x35')][_0x87b0('0x39')]));_0x4e159b['attributes']=_0x4e159b[_0x87b0('0x3a')]['length']?_0x4e159b[_0x87b0('0x3a')]:_0x42e85c['model'];if(!_0x3d285b[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x4e159b[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x3d285b[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4e159b[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0x3d285b[_0x87b0('0x35')]['offset']);}_0x4e159b[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x3d285b[_0x87b0('0x35')]['sort']);_0x4e159b[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x3d285b[_0x87b0('0x35')],_0x42e85c[_0x87b0('0x3f')]),_0x3298d8);if(_0x3d285b[_0x87b0('0x35')][_0x87b0('0x41')]){_0x4e159b[_0x87b0('0x3e')]=_['merge'](_0x4e159b[_0x87b0('0x3e')],{'$or':_['map'](_0x3298d8,function(_0x2fab47){if(_0x2fab47['type']!=='VIRTUAL'){var _0x51c53a={};_0x51c53a[_0x2fab47[_0x87b0('0x2d')]]={'$like':'%'+_0x3d285b[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x51c53a;}})});}_0x4e159b=_['merge']({},_0x4e159b,_0x3d285b[_0x87b0('0x42')]);var _0x3ce2a0={'where':_0x4e159b['where']};return db['Campaign'][_0x87b0('0x1f')](_0x3ce2a0)[_0x87b0('0x26')](function(_0x14b908){_0x226fdd[_0x87b0('0x1f')]=_0x14b908;if(_0x3d285b[_0x87b0('0x35')]['includeAll']){_0x4e159b['include']=[{'all':!![]}];}return db[_0x87b0('0x30')][_0x87b0('0x43')](_0x4e159b);})['then'](function(_0x220a02){_0x226fdd[_0x87b0('0x44')]=_0x220a02;return _0x226fdd;})[_0x87b0('0x26')](respondWithFilteredResult(_0x382f7d,_0x4e159b))[_0x87b0('0x45')](handleError(_0x382f7d,null));};exports[_0x87b0('0x46')]=function(_0x5415a4,_0x43cd60){var _0x351605={'raw':![],'where':{'id':_0x5415a4[_0x87b0('0x47')]['id']}},_0x389792={};_0x389792[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x30')][_0x87b0('0x31')]);_0x389792['query']=_[_0x87b0('0x36')](_0x5415a4[_0x87b0('0x35')]);_0x389792[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x389792[_0x87b0('0x38')],_0x389792[_0x87b0('0x35')]);_0x351605[_0x87b0('0x3a')]=_['intersection'](_0x389792[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x5415a4['query'][_0x87b0('0x39')]));_0x351605['attributes']=_0x351605['attributes']['length']?_0x351605[_0x87b0('0x3a')]:_0x389792[_0x87b0('0x38')];if(_0x5415a4['query'][_0x87b0('0x48')]){_0x351605[_0x87b0('0x49')]=[{'all':!![]}];}_0x351605=_[_0x87b0('0x4a')]({},_0x351605,_0x5415a4[_0x87b0('0x42')]);return db['Campaign'][_0x87b0('0x4b')](_0x351605)['then'](handleEntityNotFound(_0x43cd60,null))[_0x87b0('0x26')](respondWithResult(_0x43cd60,null))[_0x87b0('0x45')](handleError(_0x43cd60,null));};exports[_0x87b0('0x4c')]=function(_0x20a1ff,_0x110335){return db[_0x87b0('0x30')][_0x87b0('0x4c')](_0x20a1ff[_0x87b0('0x4d')],{})[_0x87b0('0x26')](function(_0x36b608){var _0x17f10e=_0x20a1ff[_0x87b0('0x4e')]['get']({'plain':!![]});if(!_0x17f10e)throw new Error(_0x87b0('0x4f'));if(_0x17f10e[_0x87b0('0x50')]===_0x87b0('0x4e')){var _0x32c1bd=_0x36b608[_0x87b0('0x27')]({'plain':!![]});var _0x472917=_0x87b0('0x51');return db[_0x87b0('0x52')][_0x87b0('0x4b')]({'where':{'name':_0x472917,'userProfileId':_0x17f10e[_0x87b0('0x53')]},'raw':!![]})[_0x87b0('0x26')](function(_0x13fed3){if(_0x13fed3&&_0x13fed3[_0x87b0('0x54')]===0x0){return db['UserProfileResource'][_0x87b0('0x4c')]({'name':_0x32c1bd[_0x87b0('0x2d')],'resourceId':_0x32c1bd['id'],'type':_0x13fed3[_0x87b0('0x2d')],'sectionId':_0x13fed3['id']},{})[_0x87b0('0x26')](function(){return _0x36b608;});}else{return _0x36b608;}})['catch'](function(_0x22d97c){logger[_0x87b0('0x2b')](_0x87b0('0x55'),_0x22d97c);throw _0x22d97c;});}return _0x36b608;})['then'](respondWithResult(_0x110335,0xc9))[_0x87b0('0x45')](handleError(_0x110335,null));};exports[_0x87b0('0x56')]=function(_0x85bdbe,_0x8a04e2){var _0x107397={'where':{'id':_0x85bdbe['params']['id']}},_0x5b645e={};_0x5b645e[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x30')][_0x87b0('0x31')]);_0x107397[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x5b645e[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x85bdbe['query'][_0x87b0('0x39')]));_0x107397[_0x87b0('0x3a')]=_0x107397[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x107397[_0x87b0('0x3a')]:_0x5b645e[_0x87b0('0x38')];if(_0x85bdbe[_0x87b0('0x35')][_0x87b0('0x48')]){_0x107397['include']=[{'all':!![]}];}_0x107397=_[_0x87b0('0x4a')]({},_0x107397,_0x85bdbe[_0x87b0('0x42')]);return db[_0x87b0('0x30')][_0x87b0('0x4b')](_0x107397)[_0x87b0('0x26')](handleEntityNotFound(_0x8a04e2,null))[_0x87b0('0x26')](function(_0x337844){if(_0x337844){var _0x152f72=_0x337844[_0x87b0('0x27')]({'plain':!![]});_0x152f72=qs[_0x87b0('0x58')](_0x152f72,['id',_0x87b0('0x59'),'updatedAt']);_0x85bdbe[_0x87b0('0x4d')]=_[_0x87b0('0x58')](_0x85bdbe['body'],['id',_0x87b0('0x59'),_0x87b0('0x5a')]);return db[_0x87b0('0x30')]['create'](_[_0x87b0('0x4a')](_0x152f72,_0x85bdbe[_0x87b0('0x4d')]),{'include':_0x85bdbe[_0x87b0('0x35')][_0x87b0('0x48')]?[{'all':!![]}]:undefined})[_0x87b0('0x26')](function(_0x451cb1){var _0x30f8ca=_0x85bdbe[_0x87b0('0x4e')][_0x87b0('0x27')]({'plain':!![]});if(!_0x30f8ca)throw new Error(_0x87b0('0x4f'));if(_0x30f8ca[_0x87b0('0x50')]===_0x87b0('0x4e')){var _0x5dfcc8=_0x451cb1[_0x87b0('0x27')]({'plain':!![]});var _0x55813c=_0x87b0('0x51');return db[_0x87b0('0x52')][_0x87b0('0x4b')]({'where':{'name':_0x55813c,'userProfileId':_0x30f8ca[_0x87b0('0x53')]},'raw':!![]})['then'](function(_0x4c6462){if(_0x4c6462&&_0x4c6462['autoAssociation']===0x0){return db['UserProfileResource'][_0x87b0('0x4c')]({'name':_0x5dfcc8[_0x87b0('0x2d')],'resourceId':_0x5dfcc8['id'],'type':_0x4c6462[_0x87b0('0x2d')],'sectionId':_0x4c6462['id']},{})['then'](function(){return _0x451cb1;});}else{return _0x451cb1;}})[_0x87b0('0x45')](function(_0x2edec2){logger['error'](_0x87b0('0x55'),_0x2edec2);throw _0x2edec2;});}return _0x451cb1;});}})[_0x87b0('0x26')](respondWithResult(_0x8a04e2,0xc9))[_0x87b0('0x45')](handleError(_0x8a04e2,null));};exports[_0x87b0('0x25')]=function(_0x337e75,_0x2d5615){if(_0x337e75['body']['id']){delete _0x337e75[_0x87b0('0x4d')]['id'];}return db[_0x87b0('0x30')]['find']({'where':{'id':_0x337e75[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x2d5615,null))[_0x87b0('0x26')](saveUpdates(_0x337e75[_0x87b0('0x4d')],null))[_0x87b0('0x26')](respondWithResult(_0x2d5615,null))[_0x87b0('0x45')](handleError(_0x2d5615,null));};exports[_0x87b0('0x29')]=function(_0x354692,_0x3645f3){return db[_0x87b0('0x30')]['find']({'where':{'id':_0x354692[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x3645f3,null))[_0x87b0('0x26')](removeEntity(_0x3645f3,null))[_0x87b0('0x45')](handleError(_0x3645f3,null));};exports[_0x87b0('0x5b')]=function(_0x2b7241,_0x46ad4b,_0x1db7a8){var _0x58ad46={'raw':!![],'where':{}};var _0x54d908={};var _0x541a43={'count':0x0,'rows':[]};return db['Campaign'][_0x87b0('0x5c')]({'where':{'id':_0x2b7241[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x46ad4b,null))[_0x87b0('0x26')](function(_0x3bd8a5){if(_0x3bd8a5){_0x54d908[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x5d')][_0x87b0('0x31')]);_0x54d908[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x2b7241[_0x87b0('0x35')]);_0x54d908[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x54d908[_0x87b0('0x38')],_0x54d908[_0x87b0('0x35')]);_0x58ad46[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x54d908[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x2b7241['query'][_0x87b0('0x39')]));_0x58ad46[_0x87b0('0x3a')]=_0x58ad46[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x58ad46[_0x87b0('0x3a')]:_0x54d908[_0x87b0('0x38')];if(!_0x2b7241[_0x87b0('0x35')][_0x87b0('0x5e')](_0x87b0('0x3b'))){_0x58ad46[_0x87b0('0x1e')]=qs['limit'](_0x2b7241['query'][_0x87b0('0x1e')]);_0x58ad46[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0x2b7241[_0x87b0('0x35')][_0x87b0('0x1c')]);}_0x58ad46[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x2b7241[_0x87b0('0x35')]['sort']);_0x58ad46['where']=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x2b7241[_0x87b0('0x35')],_0x54d908[_0x87b0('0x3f')]));_0x58ad46[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x3bd8a5['id'];if(_0x2b7241[_0x87b0('0x35')][_0x87b0('0x41')]){_0x58ad46[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x58ad46[_0x87b0('0x3e')],{'$or':_['map'](_0x58ad46[_0x87b0('0x3a')],function(_0x5846cc){var _0x5cc167={};_0x5cc167[_0x5846cc]={'$like':'%'+_0x2b7241['query']['filter']+'%'};return _0x5cc167;})});}_0x58ad46=_[_0x87b0('0x4a')]({},_0x58ad46,_0x2b7241[_0x87b0('0x42')]);return db[_0x87b0('0x5d')][_0x87b0('0x1f')]({'where':_0x58ad46[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x1d4ba2){_0x541a43['count']=_0x1d4ba2;if(_0x2b7241[_0x87b0('0x35')]['includeAll']){_0x58ad46[_0x87b0('0x49')]=[{'all':!![]}];}return db[_0x87b0('0x5d')][_0x87b0('0x43')](_0x58ad46);})[_0x87b0('0x26')](function(_0x546fb9){_0x541a43[_0x87b0('0x44')]=_0x546fb9;return _0x541a43;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x46ad4b,_0x58ad46))[_0x87b0('0x45')](handleError(_0x46ad4b,null));};exports[_0x87b0('0x60')]=function(_0x2548f7,_0x39b0b7,_0x379af5){var _0x4abd18={'raw':!![],'where':{}};var _0x394a54={};var _0x2407e7={'count':0x0,'rows':[]};return db[_0x87b0('0x30')][_0x87b0('0x5c')]({'where':{'id':_0x2548f7[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x39b0b7,null))[_0x87b0('0x26')](function(_0x1fab01){if(_0x1fab01){_0x394a54[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x61')][_0x87b0('0x31')]);_0x394a54['query']=_[_0x87b0('0x36')](_0x2548f7['query']);_0x394a54[_0x87b0('0x3f')]=_['intersection'](_0x394a54['model'],_0x394a54[_0x87b0('0x35')]);_0x4abd18[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x394a54[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x2548f7['query'][_0x87b0('0x39')]));_0x4abd18[_0x87b0('0x3a')]=_0x4abd18[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x4abd18[_0x87b0('0x3a')]:_0x394a54[_0x87b0('0x38')];if(!_0x2548f7[_0x87b0('0x35')][_0x87b0('0x5e')]('nolimit')){_0x4abd18[_0x87b0('0x1e')]=qs['limit'](_0x2548f7[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4abd18[_0x87b0('0x1c')]=qs['offset'](_0x2548f7[_0x87b0('0x35')][_0x87b0('0x1c')]);}_0x4abd18['order']=qs[_0x87b0('0x3d')](_0x2548f7['query'][_0x87b0('0x3d')]);_0x4abd18[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_['pick'](_0x2548f7['query'],_0x394a54[_0x87b0('0x3f')]));_0x4abd18[_0x87b0('0x3e')]['CampaignId']=_0x1fab01['id'];if(_0x2548f7['query'][_0x87b0('0x41')]){_0x4abd18[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x4abd18[_0x87b0('0x3e')],{'$or':_[_0x87b0('0x2f')](_0x4abd18[_0x87b0('0x3a')],function(_0x2b834e){var _0x4ef4da={};_0x4ef4da[_0x2b834e]={'$like':'%'+_0x2548f7[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x4ef4da;})});}_0x4abd18=_['merge']({},_0x4abd18,_0x2548f7[_0x87b0('0x42')]);return db[_0x87b0('0x61')][_0x87b0('0x1f')]({'where':_0x4abd18[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x577fe8){_0x2407e7[_0x87b0('0x1f')]=_0x577fe8;if(_0x2548f7['query'][_0x87b0('0x48')]){_0x4abd18[_0x87b0('0x49')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x87b0('0x43')](_0x4abd18);})[_0x87b0('0x26')](function(_0x2f7d82){_0x2407e7[_0x87b0('0x44')]=_0x2f7d82;return _0x2407e7;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x39b0b7,_0x4abd18))[_0x87b0('0x45')](handleError(_0x39b0b7,null));};exports['getHopperFinals']=function(_0xc86d31,_0x4b5c77,_0x458fdf){var _0x425326={'raw':!![],'where':{}};var _0x480cf0={};var _0x154ca8={'count':0x0,'rows':[]};return db[_0x87b0('0x30')]['findOne']({'where':{'id':_0xc86d31[_0x87b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b5c77,null))[_0x87b0('0x26')](function(_0x124b4b){if(_0x124b4b){_0x480cf0[_0x87b0('0x38')]=_[_0x87b0('0x36')](db['CmHopperFinal'][_0x87b0('0x31')]);_0x480cf0[_0x87b0('0x35')]=_['keys'](_0xc86d31['query']);_0x480cf0[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x480cf0[_0x87b0('0x38')],_0x480cf0['query']);_0x425326[_0x87b0('0x3a')]=_['intersection'](_0x480cf0[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x39')]));_0x425326[_0x87b0('0x3a')]=_0x425326[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x425326[_0x87b0('0x3a')]:_0x480cf0[_0x87b0('0x38')];if(!_0xc86d31['query'][_0x87b0('0x5e')](_0x87b0('0x3b'))){_0x425326['limit']=qs['limit'](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x425326[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0xc86d31['query'][_0x87b0('0x1c')]);}_0x425326[_0x87b0('0x3c')]=qs['sort'](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x3d')]);_0x425326[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0xc86d31[_0x87b0('0x35')],_0x480cf0[_0x87b0('0x3f')]));_0x425326[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x124b4b['id'];if(_0xc86d31[_0x87b0('0x35')][_0x87b0('0x41')]){_0x425326['where']=_[_0x87b0('0x4a')](_0x425326['where'],{'$or':_[_0x87b0('0x2f')](_0x425326[_0x87b0('0x3a')],function(_0x3ec4df){var _0x1aa505={};_0x1aa505[_0x3ec4df]={'$like':'%'+_0xc86d31[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x1aa505;})});}_0x425326=_[_0x87b0('0x4a')]({},_0x425326,_0xc86d31[_0x87b0('0x42')]);return db[_0x87b0('0x62')][_0x87b0('0x1f')]({'where':_0x425326['where']})[_0x87b0('0x26')](function(_0x2ff2a0){_0x154ca8[_0x87b0('0x1f')]=_0x2ff2a0;if(_0xc86d31[_0x87b0('0x35')]['includeAll']){_0x425326['include']=[{'all':!![]}];}return db[_0x87b0('0x62')][_0x87b0('0x43')](_0x425326);})[_0x87b0('0x26')](function(_0xcc1acb){_0x154ca8['rows']=_0xcc1acb;return _0x154ca8;});}})['then'](respondWithFilteredResult(_0x4b5c77,_0x425326))[_0x87b0('0x45')](handleError(_0x4b5c77,null));};exports['getHopperBlacks']=function(_0x514cb9,_0x2e677d,_0x38d90e){var _0x6a6ab5={'raw':!![],'where':{}};var _0x46a73c={};var _0x51b804={'count':0x0,'rows':[]};return db['Campaign'][_0x87b0('0x5c')]({'where':{'id':_0x514cb9['params']['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x2e677d,null))[_0x87b0('0x26')](function(_0x1c04c8){if(_0x1c04c8){_0x46a73c[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x63')][_0x87b0('0x31')]);_0x46a73c[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x514cb9[_0x87b0('0x35')]);_0x46a73c[_0x87b0('0x3f')]=_['intersection'](_0x46a73c[_0x87b0('0x38')],_0x46a73c[_0x87b0('0x35')]);_0x6a6ab5[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x46a73c['model'],qs[_0x87b0('0x39')](_0x514cb9[_0x87b0('0x35')][_0x87b0('0x39')]));_0x6a6ab5[_0x87b0('0x3a')]=_0x6a6ab5[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x6a6ab5[_0x87b0('0x3a')]:_0x46a73c[_0x87b0('0x38')];if(!_0x514cb9[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x6a6ab5[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x514cb9[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x6a6ab5[_0x87b0('0x1c')]=qs['offset'](_0x514cb9[_0x87b0('0x35')]['offset']);}_0x6a6ab5[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x514cb9[_0x87b0('0x35')]['sort']);_0x6a6ab5['where']=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x514cb9[_0x87b0('0x35')],_0x46a73c[_0x87b0('0x3f')]));_0x6a6ab5[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x1c04c8['id'];if(_0x514cb9[_0x87b0('0x35')][_0x87b0('0x41')]){_0x6a6ab5[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x6a6ab5['where'],{'$or':_['map'](_0x6a6ab5[_0x87b0('0x3a')],function(_0x2066ea){var _0x6bb3bd={};_0x6bb3bd[_0x2066ea]={'$like':'%'+_0x514cb9['query'][_0x87b0('0x41')]+'%'};return _0x6bb3bd;})});}_0x6a6ab5=_['merge']({},_0x6a6ab5,_0x514cb9[_0x87b0('0x42')]);return db[_0x87b0('0x63')][_0x87b0('0x1f')]({'where':_0x6a6ab5[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x962c38){_0x51b804[_0x87b0('0x1f')]=_0x962c38;if(_0x514cb9[_0x87b0('0x35')][_0x87b0('0x48')]){_0x6a6ab5[_0x87b0('0x49')]=[{'all':!![]}];}return db[_0x87b0('0x63')][_0x87b0('0x43')](_0x6a6ab5);})[_0x87b0('0x26')](function(_0x3dbb54){_0x51b804[_0x87b0('0x44')]=_0x3dbb54;return _0x51b804;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x2e677d,_0x6a6ab5))['catch'](handleError(_0x2e677d,null));};exports['getLists']=function(_0xa24580,_0x1096a3,_0x384213){var _0x4290a6={};var _0x3fe457={};var _0x48b8b5;var _0x5be076;return db[_0x87b0('0x30')][_0x87b0('0x5c')]({'where':{'id':_0xa24580[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x1096a3,null))[_0x87b0('0x26')](function(_0x49ebb4){if(_0x49ebb4){_0x48b8b5=_0x49ebb4;_0x3fe457['model']=_['keys'](db[_0x87b0('0x64')][_0x87b0('0x31')]);_0x3fe457[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0xa24580[_0x87b0('0x35')]);_0x3fe457[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x3fe457[_0x87b0('0x38')],_0x3fe457[_0x87b0('0x35')]);_0x4290a6['attributes']=_[_0x87b0('0x37')](_0x3fe457[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0xa24580[_0x87b0('0x35')]['fields']));_0x4290a6[_0x87b0('0x3a')]=_0x4290a6[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x4290a6['attributes']:_0x3fe457['model'];_0x4290a6[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0xa24580[_0x87b0('0x35')]['sort']);_0x4290a6[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0xa24580[_0x87b0('0x35')],_0x3fe457[_0x87b0('0x3f')]));if(_0xa24580[_0x87b0('0x35')][_0x87b0('0x41')]){_0x4290a6['where']=_[_0x87b0('0x4a')](_0x4290a6[_0x87b0('0x3e')],{'$or':_[_0x87b0('0x2f')](_0x4290a6[_0x87b0('0x3a')],function(_0x21414b){var _0x1123f4={};_0x1123f4[_0x21414b]={'$like':'%'+_0xa24580[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x1123f4;})});}_0x4290a6=_[_0x87b0('0x4a')]({},_0x4290a6,_0xa24580[_0x87b0('0x42')]);return _0x48b8b5[_0x87b0('0x65')](_0x4290a6);}})[_0x87b0('0x26')](function(_0x2e38d4){if(_0x2e38d4){_0x5be076=_0x2e38d4[_0x87b0('0x57')];if(!_0xa24580[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x4290a6[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0xa24580[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4290a6[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0xa24580[_0x87b0('0x35')][_0x87b0('0x1c')]);}return _0x48b8b5[_0x87b0('0x65')](_0x4290a6);}})[_0x87b0('0x26')](function(_0x39a34a){if(_0x39a34a){return _0x39a34a?{'count':_0x5be076,'rows':_0x39a34a}:null;}})[_0x87b0('0x26')](respondWithResult(_0x1096a3,null))[_0x87b0('0x45')](handleError(_0x1096a3,null));};exports['addLists']=function(_0x2a33aa,_0x81e936,_0x54f4d4){var _0x38bbba,_0x5a6df2;var _0xd855b4=[];var _0x59ddf8=moment()['format'](_0x87b0('0x66'));return db['Campaign'][_0x87b0('0x4b')]({'where':{'id':_0x2a33aa['params']['id']}})['then'](handleEntityNotFound(_0x81e936,null))[_0x87b0('0x26')](function(_0x378d63){if(_0x378d63){_0x5a6df2=_0x378d63;return _0x378d63[_0x87b0('0x67')](_0x2a33aa['body'][_0x87b0('0x68')],_[_0x87b0('0x58')](_0x2a33aa['body'],[_0x87b0('0x68'),'id'])||{});}return null;})[_0x87b0('0x69')](function(_0x227eef){var _0x1ec998;var _0x49094c;_0x38bbba=_0x227eef||[];var _0xbf5960=[];if(_0x227eef){for(var _0xe81ff3=0x0;_0xe81ff3<_0x227eef[_0x87b0('0x57')];_0xe81ff3+=0x1){var _0x365a1f=_0x227eef[_0xe81ff3]['get']({'plain':!![]});_0x5a6df2['dialCheckDuplicateType']=_0x2a33aa[_0x87b0('0x4d')]['dialCheckDuplicateType']?_0x2a33aa[_0x87b0('0x4d')][_0x87b0('0x6a')]:_0x5a6df2[_0x87b0('0x6a')];switch(_0x5a6df2[_0x87b0('0x6a')]){case _0x87b0('0x6b'):_0x1ec998=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x6e'))[_0x87b0('0x6f')](['phone','scheduledAt',_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel['select']()['field'](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')]('NOW()',_0x87b0('0x74'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),'ListId')[_0x87b0('0x73')](_0x2a33aa[_0x87b0('0x47')]['id']['toString'](),_0x87b0('0x5f'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27','createdAt')[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))[_0x87b0('0x77')]('cm_contacts')['where'](_0x87b0('0x78'))[_0x87b0('0x3e')](_0x87b0('0x79'),_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a'))[_0x87b0('0x3e')](_0x87b0('0x7b'),squel['select']()[_0x87b0('0x73')](_0x87b0('0x7c'))[_0x87b0('0x77')]('cm_hopper_final')[_0x87b0('0x3e')](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]()))['where'](_0x87b0('0x7b'),squel[_0x87b0('0x7e')]()[_0x87b0('0x73')]('COALESCE(phone,\x27\x27)')[_0x87b0('0x77')](_0x87b0('0x6e'))[_0x87b0('0x3e')](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())))[_0x87b0('0x76')]();break;case'onlyIfOpen':_0x1ec998=squel['insert']()[_0x87b0('0x6d')](_0x87b0('0x6e'))[_0x87b0('0x6f')]([_0x87b0('0x72'),_0x87b0('0x74'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')](_0x87b0('0x7f'),_0x87b0('0x74'))['field']('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),_0x87b0('0x71'))['field'](_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),_0x87b0('0x5f'))['field']('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))['from'](_0x87b0('0x80'))[_0x87b0('0x3e')](_0x87b0('0x78'))[_0x87b0('0x3e')](_0x87b0('0x79'),_0x365a1f[_0x87b0('0x75')]['toString']())[_0x87b0('0x3e')](_0x87b0('0x7a'))[_0x87b0('0x3e')](_0x87b0('0x7b'),squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x81'))[_0x87b0('0x77')](_0x87b0('0x6e'))['where'](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())))[_0x87b0('0x76')]();break;default:_0x1ec998=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x6e'))['fromQuery']([_0x87b0('0x72'),_0x87b0('0x74'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()['field'](_0x87b0('0x72'),'phone')['field'](_0x87b0('0x7f'),_0x87b0('0x74'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),_0x87b0('0x71'))[_0x87b0('0x73')](_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),_0x87b0('0x5f'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))[_0x87b0('0x77')](_0x87b0('0x80'))[_0x87b0('0x3e')]('deletedAt\x20IS\x20NULL')[_0x87b0('0x3e')]('ListId\x20=\x20?',_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a')))[_0x87b0('0x76')]();}_0x49094c=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x82'))[_0x87b0('0x6f')]([_0x87b0('0x83'),_0x87b0('0x74'),'phone','OrderBy',_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()['field'](_0x87b0('0x84'),'id')[_0x87b0('0x73')](_0x87b0('0x7f'),'scheduledAt')[_0x87b0('0x73')](_0x87b0('0x85'),_0x87b0('0x72'))['field'](_0x87b0('0x86'),_0x87b0('0x87'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27','updatedAt')['from'](_0x87b0('0x88'),'ci')[_0x87b0('0x89')]('cm_hopper','h',_0x87b0('0x8a'))[_0x87b0('0x3e')](_0x87b0('0x8b'),_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x8c'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())['where'](_0x87b0('0x8d'),_0x59ddf8))[_0x87b0('0x76')]();_0xbf5960['push'](db[_0x87b0('0x8e')]['query'](_0x1ec998));_0xd855b4[_0x87b0('0x8f')](db[_0x87b0('0x8e')][_0x87b0('0x35')](_0x49094c));}return BPromise['all'](_0xbf5960);}})[_0x87b0('0x26')](function(){return BPromise[_0x87b0('0x90')](_0xd855b4);})['then'](function(){return _0x38bbba;})[_0x87b0('0x26')](respondWithResult(_0x81e936,null))[_0x87b0('0x45')](handleError(_0x81e936,null));};exports[_0x87b0('0x91')]=function(_0x3e4ce1,_0xe8b643,_0x463296){return db['Campaign']['find']({'where':{'id':_0x3e4ce1[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0xe8b643,null))[_0x87b0('0x26')](function(_0x42c898){if(_0x42c898){return _0x42c898[_0x87b0('0x91')](_0x3e4ce1[_0x87b0('0x35')][_0x87b0('0x68')]);}})['then'](function(_0xc68fac){if(_0xc68fac){return db[_0x87b0('0x5d')][_0x87b0('0x29')]({'where':{'ListId':_0x3e4ce1[_0x87b0('0x35')]['ids'],'CampaignId':_0x3e4ce1[_0x87b0('0x47')]['id']}})['then'](function(){return _0xc68fac;});}})[_0x87b0('0x26')](respondWithStatusCode(_0xe8b643,null))[_0x87b0('0x45')](handleError(_0xe8b643,null));};exports['getBlackLists']=function(_0x102c76,_0x7af439,_0xd2aea6){var _0x38576e={};var _0xad2ccb={};var _0x246a7f;var _0x2c6091;return db[_0x87b0('0x30')]['findOne']({'where':{'id':_0x102c76[_0x87b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x7af439,null))[_0x87b0('0x26')](function(_0xdb8b7b){if(_0xdb8b7b){_0x246a7f=_0xdb8b7b;_0xad2ccb[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x64')][_0x87b0('0x31')]);_0xad2ccb[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x102c76['query']);_0xad2ccb['filters']=_[_0x87b0('0x37')](_0xad2ccb[_0x87b0('0x38')],_0xad2ccb[_0x87b0('0x35')]);_0x38576e['attributes']=_[_0x87b0('0x37')](_0xad2ccb['model'],qs[_0x87b0('0x39')](_0x102c76[_0x87b0('0x35')]['fields']));_0x38576e[_0x87b0('0x3a')]=_0x38576e[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x38576e['attributes']:_0xad2ccb[_0x87b0('0x38')];_0x38576e[_0x87b0('0x3c')]=qs['sort'](_0x102c76[_0x87b0('0x35')][_0x87b0('0x3d')]);_0x38576e[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x102c76['query'],_0xad2ccb[_0x87b0('0x3f')]));if(_0x102c76[_0x87b0('0x35')][_0x87b0('0x41')]){_0x38576e['where']=_[_0x87b0('0x4a')](_0x38576e['where'],{'$or':_[_0x87b0('0x2f')](_0x38576e['attributes'],function(_0x2097d2){var _0x527d5c={};_0x527d5c[_0x2097d2]={'$like':'%'+_0x102c76[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x527d5c;})});}_0x38576e=_[_0x87b0('0x4a')]({},_0x38576e,_0x102c76[_0x87b0('0x42')]);return _0x246a7f['getBlackLists'](_0x38576e);}})['then'](function(_0x282282){if(_0x282282){_0x2c6091=_0x282282[_0x87b0('0x57')];if(!_0x102c76[_0x87b0('0x35')]['hasOwnProperty']('nolimit')){_0x38576e[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x102c76[_0x87b0('0x35')]['limit']);_0x38576e['offset']=qs['offset'](_0x102c76[_0x87b0('0x35')][_0x87b0('0x1c')]);}return _0x246a7f['getBlackLists'](_0x38576e);}})[_0x87b0('0x26')](function(_0x544ae2){if(_0x544ae2){return _0x544ae2?{'count':_0x2c6091,'rows':_0x544ae2}:null;}})[_0x87b0('0x26')](respondWithResult(_0x7af439,null))[_0x87b0('0x45')](handleError(_0x7af439,null));};exports[_0x87b0('0x92')]=function(_0x740036,_0x5696b0,_0x220624){var _0x306a30,_0x55e2f5;var _0xc7b6f7=[];var _0x48efeb=moment()[_0x87b0('0x93')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x87b0('0x30')][_0x87b0('0x4b')]({'where':{'id':_0x740036[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x5696b0,null))['then'](function(_0x5397b3){if(_0x5397b3){_0x55e2f5=_0x5397b3;return _0x5397b3['addBlackLists'](_0x740036['body'][_0x87b0('0x68')],_[_0x87b0('0x58')](_0x740036[_0x87b0('0x4d')],[_0x87b0('0x68'),'id'])||{});}return null;})[_0x87b0('0x69')](function(_0x5bcd31){var _0x5a9f64;var _0x3b4a3b;_0x306a30=_0x5bcd31||[];var _0x3cecb8=[];if(_0x5bcd31){for(var _0x254583=0x0;_0x254583<_0x5bcd31['length'];_0x254583+=0x1){var _0x3791a4=_0x5bcd31[_0x254583][_0x87b0('0x27')]({'plain':!![]});_0x5a9f64=squel[_0x87b0('0x6c')]()['into']('cm_hopper_black')['fromQuery']([_0x87b0('0x72'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),'createdAt','updatedAt'],squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x3791a4[_0x87b0('0x75')]['toString'](),_0x87b0('0x71'))[_0x87b0('0x73')](_0x740036[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),'CampaignId')[_0x87b0('0x73')]('NOW()',_0x87b0('0x59'))['field']('NOW()',_0x87b0('0x5a'))['from'](_0x87b0('0x80'))[_0x87b0('0x3e')](_0x87b0('0x78'))[_0x87b0('0x3e')]('ListId\x20=\x20?',_0x3791a4[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a')))[_0x87b0('0x76')]();_0x3cecb8[_0x87b0('0x8f')](db[_0x87b0('0x8e')][_0x87b0('0x35')](_0x5a9f64));}return BPromise[_0x87b0('0x90')](_0x3cecb8);}})['then'](function(){return _0x306a30;})['then'](respondWithResult(_0x5696b0,null))[_0x87b0('0x45')](handleError(_0x5696b0,null));};exports['removeBlackLists']=function(_0x2261c2,_0x3f8108,_0x15e56c){return db[_0x87b0('0x30')][_0x87b0('0x4b')]({'where':{'id':_0x2261c2[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x3f8108,null))[_0x87b0('0x26')](function(_0x19357b){if(_0x19357b){return _0x19357b[_0x87b0('0x94')](_0x2261c2[_0x87b0('0x35')]['ids']);}})['then'](function(_0x4e8c43){if(_0x4e8c43){return db[_0x87b0('0x63')]['destroy']({'where':{'ListId':_0x2261c2[_0x87b0('0x35')][_0x87b0('0x68')],'CampaignId':_0x2261c2[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](function(){return _0x4e8c43;});}})[_0x87b0('0x26')](respondWithStatusCode(_0x3f8108,null))[_0x87b0('0x45')](handleError(_0x3f8108,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index d7761bb..6f178fe 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 6b70c39..45a3c36 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 _0x8696=['jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','options','raw','where','attributes','limit','include','map','model','info','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8696,0x143));var _0x6869=function(_0x1079fb,_0x2ae37b){_0x1079fb=_0x1079fb-0x0;var _0x53a190=_0x8696[_0x1079fb];return _0x53a190;};'use strict';var _=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var moment=require('moment');var BPromise=require(_0x6869('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6869('0x3'));var db=require(_0x6869('0x4'))['db'];var utils=require(_0x6869('0x5'));var logger=require('../../config/logger')(_0x6869('0x6'));var config=require('../../config/environment');var jayson=require(_0x6869('0x7'));var client=jayson[_0x6869('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8ad5,_0xa00fe5,_0x1e667d){return new BPromise(function(_0xa343ab,_0x3fff8a){return client[_0x6869('0x9')](_0x4c8ad5,_0x1e667d)[_0x6869('0xa')](function(_0x3c8486){logger['info'](_0x6869('0xb'),_0xa00fe5,_0x6869('0xc'));logger[_0x6869('0xd')](_0x6869('0xe'),_0xa00fe5,'request\x20sent',JSON['stringify'](_0x3c8486));if(_0x3c8486['error']){if(_0x3c8486[_0x6869('0xf')][_0x6869('0x10')]===0x1f4){logger[_0x6869('0xf')](_0x6869('0xb'),_0xa00fe5,_0x3c8486[_0x6869('0xf')]['message']);return _0x3fff8a(_0x3c8486[_0x6869('0xf')][_0x6869('0x11')]);}logger['error'](_0x6869('0xb'),_0xa00fe5,_0x3c8486[_0x6869('0xf')][_0x6869('0x11')]);return _0xa343ab(_0x3c8486['error'][_0x6869('0x11')]);}else{logger['info'](_0x6869('0xb'),_0xa00fe5,'request\x20sent');_0xa343ab(_0x3c8486[_0x6869('0x12')][_0x6869('0x11')]);}})[_0x6869('0x13')](function(_0x199a26){logger['error'](_0x6869('0xb'),_0xa00fe5,_0x199a26);_0x3fff8a(_0x199a26);});});}exports[_0x6869('0x14')]=function(_0x36da1f){var _0x4e2905=this;return new Promise(function(_0x327094,_0xdb1f89){return db['Campaign']['findAll']({'raw':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x16')]===undefined?!![]:![]:!![],'where':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x17')]||null:null,'attributes':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x18')]||null:null,'limit':_0x36da1f[_0x6869('0x15')]?_0x36da1f[_0x6869('0x15')][_0x6869('0x19')]||null:null,'include':_0x36da1f[_0x6869('0x15')]?_0x36da1f[_0x6869('0x15')]['include']?_['map'](_0x36da1f[_0x6869('0x15')][_0x6869('0x1a')],function(_0x35f962){return{'model':db[_0x35f962['model']],'as':_0x35f962['as'],'attributes':_0x35f962['attributes'],'include':_0x35f962[_0x6869('0x1a')]?_[_0x6869('0x1b')](_0x35f962['include'],function(_0x44e798){return{'model':db[_0x44e798[_0x6869('0x1c')]],'as':_0x44e798['as'],'attributes':_0x44e798[_0x6869('0x18')],'include':_0x44e798['include']?_['map'](_0x44e798[_0x6869('0x1a')],function(_0xceb447){return{'model':db[_0xceb447['model']],'as':_0xceb447['as'],'attributes':_0xceb447[_0x6869('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6869('0xa')](function(_0x35d9c4){logger[_0x6869('0x1d')](_0x6869('0x14'),_0x36da1f);logger[_0x6869('0xd')]('GetCampaign',_0x36da1f,JSON['stringify'](_0x35d9c4));_0x327094(_0x35d9c4);})[_0x6869('0x13')](function(_0x1bfba2){logger[_0x6869('0xf')](_0x6869('0x14'),_0x1bfba2[_0x6869('0x11')],_0x36da1f);_0xdb1f89(_0x4e2905[_0x6869('0xf')](0x1f4,_0x1bfba2[_0x6869('0x11')]));});});};
\ No newline at end of file
+var _0x5640=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5640,0x111));var _0x0564=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5640[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0564('0x0'));var util=require('util');var moment=require(_0x0564('0x1'));var BPromise=require(_0x0564('0x2'));var rs=require(_0x0564('0x3'));var fs=require('fs');var Redis=require(_0x0564('0x4'));var db=require(_0x0564('0x5'))['db'];var utils=require(_0x0564('0x6'));var logger=require(_0x0564('0x7'))(_0x0564('0x8'));var config=require(_0x0564('0x9'));var jayson=require(_0x0564('0xa'));var client=jayson[_0x0564('0xb')][_0x0564('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3deac1,_0x545a39,_0x52b032){return new BPromise(function(_0x9e3a60,_0x37a190){return client[_0x0564('0xd')](_0x3deac1,_0x52b032)[_0x0564('0xe')](function(_0x4f5a64){logger[_0x0564('0xf')](_0x0564('0x10'),_0x545a39,'request\x20sent');logger[_0x0564('0x11')](_0x0564('0x12'),_0x545a39,'request\x20sent',JSON[_0x0564('0x13')](_0x4f5a64));if(_0x4f5a64[_0x0564('0x14')]){if(_0x4f5a64[_0x0564('0x14')]['code']===0x1f4){logger['error'](_0x0564('0x10'),_0x545a39,_0x4f5a64['error'][_0x0564('0x15')]);return _0x37a190(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}logger[_0x0564('0x14')](_0x0564('0x10'),_0x545a39,_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);return _0x9e3a60(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}else{logger['info'](_0x0564('0x10'),_0x545a39,_0x0564('0x16'));_0x9e3a60(_0x4f5a64[_0x0564('0x17')][_0x0564('0x15')]);}})[_0x0564('0x18')](function(_0x49173f){logger['error'](_0x0564('0x10'),_0x545a39,_0x49173f);_0x37a190(_0x49173f);});});}exports[_0x0564('0x19')]=function(_0x28c807){var _0x35ebe3=this;return new Promise(function(_0x31b612,_0x471645){return db[_0x0564('0x1a')]['findAll']({'raw':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1c')]===undefined?!![]:![]:!![],'where':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1d')]||null:null,'attributes':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1e')]||null:null,'limit':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x1f')]||null:null,'include':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x20')]?_[_0x0564('0x21')](_0x28c807[_0x0564('0x1b')]['include'],function(_0x542b1d){return{'model':db[_0x542b1d[_0x0564('0x22')]],'as':_0x542b1d['as'],'attributes':_0x542b1d[_0x0564('0x1e')],'include':_0x542b1d['include']?_[_0x0564('0x21')](_0x542b1d['include'],function(_0x4ed225){return{'model':db[_0x4ed225[_0x0564('0x22')]],'as':_0x4ed225['as'],'attributes':_0x4ed225['attributes'],'include':_0x4ed225['include']?_[_0x0564('0x21')](_0x4ed225[_0x0564('0x20')],function(_0x23d59d){return{'model':db[_0x23d59d[_0x0564('0x22')]],'as':_0x23d59d['as'],'attributes':_0x23d59d[_0x0564('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0564('0xe')](function(_0x2da082){logger[_0x0564('0xf')](_0x0564('0x19'),_0x28c807);logger[_0x0564('0x11')](_0x0564('0x19'),_0x28c807,JSON['stringify'](_0x2da082));_0x31b612(_0x2da082);})[_0x0564('0x18')](function(_0x2bd9c7){logger['error']('GetCampaign',_0x2bd9c7[_0x0564('0x15')],_0x28c807);_0x471645(_0x35ebe3['error'](0x1f4,_0x2bd9c7[_0x0564('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e81e5e0..4729a40 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 _0xd139=['index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5643ae,_0x58470a){var _0x33cfec=function(_0x41c421){while(--_0x41c421){_0x5643ae['push'](_0x5643ae['shift']());}};_0x33cfec(++_0x58470a);}(_0xd139,0x177));var _0x9d13=function(_0x497ded,_0x3bb53c){_0x497ded=_0x497ded-0x0;var _0x21f720=_0xd139[_0x497ded];return _0x21f720;};'use strict';var multer=require(_0x9d13('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9d13('0x1'));var express=require(_0x9d13('0x2'));var router=express[_0x9d13('0x3')]();var fs_extra=require(_0x9d13('0x4'));var auth=require(_0x9d13('0x5'));var interaction=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var controller=require('./campaign.controller');router[_0x9d13('0x8')]('/',auth[_0x9d13('0x9')](),controller[_0x9d13('0xa')]);router[_0x9d13('0x8')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0xc')]);router[_0x9d13('0x8')]('/:id/hoppers',auth[_0x9d13('0x9')](),controller[_0x9d13('0xd')]);router[_0x9d13('0x8')](_0x9d13('0xe'),auth[_0x9d13('0x9')](),controller['getHopperHistories']);router[_0x9d13('0x8')](_0x9d13('0xf'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x10')]);router[_0x9d13('0x8')]('/:id/hopper_black',auth[_0x9d13('0x9')](),controller[_0x9d13('0x11')]);router[_0x9d13('0x8')]('/:id/lists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x12')]);router[_0x9d13('0x8')](_0x9d13('0x13'),auth['isAuthenticated'](),controller[_0x9d13('0x14')]);router['post']('/',auth[_0x9d13('0x9')](),controller[_0x9d13('0x15')]);router[_0x9d13('0x16')](_0x9d13('0x17'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x18')]);router[_0x9d13('0x16')](_0x9d13('0x19'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1a')]);router[_0x9d13('0x16')]('/:id/blacklists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x1b')]);router[_0x9d13('0x1c')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1d')]);router[_0x9d13('0x1e')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1f')]);router[_0x9d13('0x1e')]('/:id/lists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x20')]);router[_0x9d13('0x1e')](_0x9d13('0x13'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x21')]);module[_0x9d13('0x22')]=router;
\ No newline at end of file
+var _0xac2c=['removeBlackLists','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','/:id','update','delete','/:id/lists','removeLists'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac2c,0x195));var _0xcac2=function(_0x1e1858,_0x2bc0ec){_0x1e1858=_0x1e1858-0x0;var _0x4d8d7a=_0xac2c[_0x1e1858];return _0x4d8d7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcac2('0x0'));var timeout=require(_0xcac2('0x1'));var express=require(_0xcac2('0x2'));var router=express['Router']();var fs_extra=require(_0xcac2('0x3'));var auth=require(_0xcac2('0x4'));var interaction=require(_0xcac2('0x5'));var config=require('../../config/environment');var controller=require(_0xcac2('0x6'));router[_0xcac2('0x7')]('/',auth[_0xcac2('0x8')](),controller[_0xcac2('0x9')]);router['get']('/:id',auth[_0xcac2('0x8')](),controller[_0xcac2('0xa')]);router[_0xcac2('0x7')]('/:id/hoppers',auth[_0xcac2('0x8')](),controller[_0xcac2('0xb')]);router[_0xcac2('0x7')](_0xcac2('0xc'),auth[_0xcac2('0x8')](),controller[_0xcac2('0xd')]);router[_0xcac2('0x7')](_0xcac2('0xe'),auth['isAuthenticated'](),controller[_0xcac2('0xf')]);router['get']('/:id/hopper_black',auth[_0xcac2('0x8')](),controller[_0xcac2('0x10')]);router[_0xcac2('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xcac2('0x11')]);router['get'](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller['getBlackLists']);router[_0xcac2('0x13')]('/',auth['isAuthenticated'](),controller[_0xcac2('0x14')]);router[_0xcac2('0x13')](_0xcac2('0x15'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x16')]);router[_0xcac2('0x13')]('/:id/lists',auth[_0xcac2('0x8')](),controller[_0xcac2('0x17')]);router[_0xcac2('0x13')](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller['addBlackLists']);router['put'](_0xcac2('0x18'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x19')]);router['delete'](_0xcac2('0x18'),auth[_0xcac2('0x8')](),controller['destroy']);router[_0xcac2('0x1a')](_0xcac2('0x1b'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x1c')]);router[_0xcac2('0x1a')](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x1d')]);module[_0xcac2('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index d630b3e..bff7e66 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 _0xdf08=['getDataValue','key','sequelize','exports','TEXT'];(function(_0x5ac7b3,_0x5246a6){var _0x2d878a=function(_0x1a38cc){while(--_0x1a38cc){_0x5ac7b3['push'](_0x5ac7b3['shift']());}};_0x2d878a(++_0x5246a6);}(_0xdf08,0xe3));var _0x8df0=function(_0x7e6223,_0x1f78ac){_0x7e6223=_0x7e6223-0x0;var _0x1cf5a1=_0xdf08[_0x7e6223];return _0x1cf5a1;};'use strict';var Sequelize=require(_0x8df0('0x0'));module[_0x8df0('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8df0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8df0('0x3')](_0x8df0('0x4'));}}};
\ No newline at end of file
+var _0x74f2=['sequelize','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0x74f2,0xc0));var _0x274f=function(_0x3ae25d,_0x17ec14){_0x3ae25d=_0x3ae25d-0x0;var _0x11522b=_0x74f2[_0x3ae25d];return _0x11522b;};'use strict';var Sequelize=require(_0x274f('0x0'));module['exports']={'key':{'type':Sequelize[_0x274f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x274f('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x274f('0x3')],'get':function(){return this[_0x274f('0x4')](_0x274f('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 67c8906..dfd3280 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 _0x8877=['count','set','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','send','index','map','CannedAnswer','fieldName','key','name','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','filter','options','include','findAll','rows','params','includeAll','merge','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit'];(function(_0x199b67,_0x50c0ab){var _0x5a72e7=function(_0x35784d){while(--_0x35784d){_0x199b67['push'](_0x199b67['shift']());}};_0x5a72e7(++_0x50c0ab);}(_0x8877,0x18c));var _0x7887=function(_0x4db9ef,_0x4ea5bf){_0x4db9ef=_0x4db9ef-0x0;var _0x407a4f=_0x8877[_0x4db9ef];return _0x407a4f;};'use strict';var emlformat=require(_0x7887('0x0'));var rimraf=require(_0x7887('0x1'));var zipdir=require(_0x7887('0x2'));var jsonpatch=require(_0x7887('0x3'));var rp=require('request-promise');var moment=require(_0x7887('0x4'));var BPromise=require(_0x7887('0x5'));var Mustache=require('mustache');var util=require(_0x7887('0x6'));var path=require(_0x7887('0x7'));var sox=require(_0x7887('0x8'));var csv=require(_0x7887('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7887('0xa'));var _=require(_0x7887('0xb'));var squel=require(_0x7887('0xc'));var crypto=require(_0x7887('0xd'));var jsforce=require(_0x7887('0xe'));var deskjs=require(_0x7887('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7887('0x10'));var Papa=require(_0x7887('0x11'));var Redis=require(_0x7887('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7887('0x13'));var as=require(_0x7887('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7887('0x15'))('api');var utils=require(_0x7887('0x16'));var config=require(_0x7887('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7887('0x18'))['db'];function respondWithStatusCode(_0x20c707,_0x28e44d){_0x28e44d=_0x28e44d||0xcc;return function(_0x1002c3){if(_0x1002c3){return _0x20c707['sendStatus'](_0x28e44d);}return _0x20c707[_0x7887('0x19')](_0x28e44d)['end']();};}function respondWithResult(_0x446f38,_0x5459c4){_0x5459c4=_0x5459c4||0xc8;return function(_0x40c7e6){if(_0x40c7e6){return _0x446f38['status'](_0x5459c4)[_0x7887('0x1a')](_0x40c7e6);}};}function respondWithFilteredResult(_0x50fde8,_0x20cd0b){return function(_0x572b93){if(_0x572b93){var _0x24d503=typeof _0x20cd0b[_0x7887('0x1b')]==='undefined'&&typeof _0x20cd0b[_0x7887('0x1c')]==='undefined';var _0x150c27=_0x572b93[_0x7887('0x1d')];var _0x1a536b=_0x24d503?0x0:_0x20cd0b['offset'];var _0x27d3b6=_0x24d503?_0x572b93['count']:_0x20cd0b['offset']+_0x20cd0b[_0x7887('0x1c')];var _0x4c59d1;if(_0x27d3b6>=_0x150c27){_0x27d3b6=_0x150c27;_0x4c59d1=0xc8;}else{_0x4c59d1=0xce;}_0x50fde8[_0x7887('0x19')](_0x4c59d1);return _0x50fde8[_0x7887('0x1e')](_0x7887('0x1f'),_0x1a536b+'-'+_0x27d3b6+'/'+_0x150c27)['json'](_0x572b93);}return null;};}function patchUpdates(_0x4cc2f8){return function(_0x22a52a){try{jsonpatch[_0x7887('0x20')](_0x22a52a,_0x4cc2f8,!![]);}catch(_0x7368f9){return BPromise[_0x7887('0x21')](_0x7368f9);}return _0x22a52a[_0x7887('0x22')]();};}function saveUpdates(_0x598e0d,_0x4d4ca7){return function(_0x39bb8d){if(_0x39bb8d){return _0x39bb8d[_0x7887('0x23')](_0x598e0d)['then'](function(_0x2533ab){return _0x2533ab;});}return null;};}function removeEntity(_0x42ad95,_0x14718b){return function(_0x159cbb){if(_0x159cbb){return _0x159cbb[_0x7887('0x24')]()[_0x7887('0x25')](function(){var _0x42634e=_0x159cbb[_0x7887('0x26')]({'plain':!![]});var _0x5c4bd6=_0x7887('0x27');return db[_0x7887('0x28')][_0x7887('0x24')]({'where':{'type':_0x5c4bd6,'resourceId':_0x42634e['id']}})[_0x7887('0x25')](function(){return _0x159cbb;});})[_0x7887('0x25')](function(){_0x42ad95[_0x7887('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0272,_0x14e14b){return function(_0xdd42e7){if(!_0xdd42e7){_0x1c0272[_0x7887('0x29')](0x194);}return _0xdd42e7;};}function handleError(_0x4d5dfa,_0x173eee){_0x173eee=_0x173eee||0x1f4;return function(_0x5960ef){logger['error'](_0x5960ef[_0x7887('0x2a')]);if(_0x5960ef['name']){delete _0x5960ef['name'];}_0x4d5dfa[_0x7887('0x19')](_0x173eee)[_0x7887('0x2b')](_0x5960ef);};}exports[_0x7887('0x2c')]=function(_0x3b69c7,_0x45a3b6){var _0x37d9f5={},_0x60cc26={},_0x9cd458={'count':0x0,'rows':[]};var _0x1db1af=_[_0x7887('0x2d')](db[_0x7887('0x2e')]['rawAttributes'],function(_0x11e268){return{'name':_0x11e268[_0x7887('0x2f')],'type':_0x11e268['type'][_0x7887('0x30')]};});_0x60cc26['model']=_[_0x7887('0x2d')](_0x1db1af,_0x7887('0x31'));_0x60cc26[_0x7887('0x32')]=_[_0x7887('0x33')](_0x3b69c7[_0x7887('0x32')]);_0x60cc26[_0x7887('0x34')]=_[_0x7887('0x35')](_0x60cc26['model'],_0x60cc26[_0x7887('0x32')]);_0x37d9f5[_0x7887('0x36')]=_[_0x7887('0x35')](_0x60cc26[_0x7887('0x37')],qs[_0x7887('0x38')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x38')]));_0x37d9f5[_0x7887('0x36')]=_0x37d9f5[_0x7887('0x36')][_0x7887('0x39')]?_0x37d9f5['attributes']:_0x60cc26[_0x7887('0x37')];if(!_0x3b69c7[_0x7887('0x32')]['hasOwnProperty']('nolimit')){_0x37d9f5[_0x7887('0x1c')]=qs['limit'](_0x3b69c7[_0x7887('0x32')][_0x7887('0x1c')]);_0x37d9f5[_0x7887('0x1b')]=qs[_0x7887('0x1b')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x1b')]);}_0x37d9f5[_0x7887('0x3a')]=qs[_0x7887('0x3b')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x3b')]);_0x37d9f5['where']=qs['filters'](_['pick'](_0x3b69c7[_0x7887('0x32')],_0x60cc26[_0x7887('0x34')]),_0x1db1af);if(_0x3b69c7['query']['filter']){_0x37d9f5['where']=_['merge'](_0x37d9f5[_0x7887('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3b69c7[_0x7887('0x32')][_0x7887('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3b69c7[_0x7887('0x32')][_0x7887('0x3d')]+'%'}}]});}_0x37d9f5=_['merge']({},_0x37d9f5,_0x3b69c7[_0x7887('0x3e')]);var _0x36b491={'where':_0x37d9f5[_0x7887('0x3c')]};return db[_0x7887('0x2e')][_0x7887('0x1d')](_0x36b491)['then'](function(_0x1d2f3d){_0x9cd458['count']=_0x1d2f3d;if(_0x3b69c7[_0x7887('0x32')]['includeAll']){_0x37d9f5[_0x7887('0x3f')]=[{'all':!![]}];}return db[_0x7887('0x2e')][_0x7887('0x40')](_0x37d9f5);})[_0x7887('0x25')](function(_0x45c5c9){_0x9cd458[_0x7887('0x41')]=_0x45c5c9;return _0x9cd458;})[_0x7887('0x25')](respondWithFilteredResult(_0x45a3b6,_0x37d9f5))['catch'](handleError(_0x45a3b6,null));};exports['show']=function(_0x36c51d,_0x3885f3){var _0x402eb5={'raw':!![],'where':{'id':_0x36c51d[_0x7887('0x42')]['id']}},_0x357881={};_0x357881[_0x7887('0x37')]=_['keys'](db[_0x7887('0x2e')]['rawAttributes']);_0x357881[_0x7887('0x32')]=_[_0x7887('0x33')](_0x36c51d['query']);_0x357881[_0x7887('0x34')]=_[_0x7887('0x35')](_0x357881[_0x7887('0x37')],_0x357881['query']);_0x402eb5[_0x7887('0x36')]=_[_0x7887('0x35')](_0x357881['model'],qs[_0x7887('0x38')](_0x36c51d[_0x7887('0x32')][_0x7887('0x38')]));_0x402eb5[_0x7887('0x36')]=_0x402eb5[_0x7887('0x36')][_0x7887('0x39')]?_0x402eb5['attributes']:_0x357881['model'];if(_0x36c51d[_0x7887('0x32')][_0x7887('0x43')]){_0x402eb5[_0x7887('0x3f')]=[{'all':!![]}];}_0x402eb5=_[_0x7887('0x44')]({},_0x402eb5,_0x36c51d[_0x7887('0x3e')]);return db[_0x7887('0x2e')][_0x7887('0x45')](_0x402eb5)['then'](handleEntityNotFound(_0x3885f3,null))['then'](respondWithResult(_0x3885f3,null))[_0x7887('0x46')](handleError(_0x3885f3,null));};exports[_0x7887('0x23')]=function(_0xa67377,_0x305e67){if(_0xa67377['body']['id']){delete _0xa67377['body']['id'];}return db[_0x7887('0x2e')][_0x7887('0x45')]({'where':{'id':_0xa67377['params']['id']}})[_0x7887('0x25')](handleEntityNotFound(_0x305e67,null))['then'](saveUpdates(_0xa67377[_0x7887('0x47')],null))['then'](respondWithResult(_0x305e67,null))['catch'](handleError(_0x305e67,null));};exports['destroy']=function(_0x25cd60,_0x5e11dd){return db[_0x7887('0x2e')]['find']({'where':{'id':_0x25cd60[_0x7887('0x42')]['id']}})[_0x7887('0x25')](handleEntityNotFound(_0x5e11dd,null))[_0x7887('0x25')](removeEntity(_0x5e11dd,null))[_0x7887('0x46')](handleError(_0x5e11dd,null));};exports[_0x7887('0x48')]=function(_0x277d96,_0x2b3811){var _0x27d9bd={'key':_0x277d96[_0x7887('0x47')][_0x7887('0x30')]};if(_0x277d96[_0x7887('0x47')][_0x7887('0x49')]){_0x27d9bd[_0x7887('0x49')]=_0x277d96[_0x7887('0x47')][_0x7887('0x49')];}else if(_0x277d96[_0x7887('0x47')]['SmsAccountId']){_0x27d9bd[_0x7887('0x4a')]=_0x277d96[_0x7887('0x47')]['SmsAccountId'];}else if(_0x277d96['body'][_0x7887('0x4b')]){_0x27d9bd[_0x7887('0x4b')]=_0x277d96[_0x7887('0x47')][_0x7887('0x4b')];}else if(_0x277d96[_0x7887('0x47')][_0x7887('0x4c')]){_0x27d9bd[_0x7887('0x4c')]=_0x277d96[_0x7887('0x47')][_0x7887('0x4c')];}return db[_0x7887('0x2e')][_0x7887('0x45')]({'where':_0x27d9bd})[_0x7887('0x25')](function(_0x231e58){if(_0x231e58){throw new db[(_0x7887('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7887('0x2e')][_0x7887('0x48')](_0x277d96[_0x7887('0x47')]);})['then'](function(_0x50dd30){var _0x37652d=_0x277d96[_0x7887('0x4e')][_0x7887('0x26')]({'plain':!![]});if(!_0x37652d)throw new Error(_0x7887('0x4f'));if(_0x37652d['role']===_0x7887('0x4e')){var _0x25fe3d=_0x50dd30['get']({'plain':!![]});return db[_0x7887('0x50')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x37652d[_0x7887('0x51')]},'raw':!![]})[_0x7887('0x25')](function(_0xc3c585){if(_0xc3c585&&_0xc3c585[_0x7887('0x52')]===0x0){return db[_0x7887('0x28')][_0x7887('0x48')]({'name':_0x25fe3d[_0x7887('0x31')],'resourceId':_0x25fe3d['id'],'type':_0xc3c585[_0x7887('0x31')],'sectionId':_0xc3c585['id']},{})['then'](function(){return _0x50dd30;});}else{return _0x50dd30;}})['catch'](function(_0x9f1391){logger[_0x7887('0x53')](_0x7887('0x54'),_0x9f1391);throw _0x9f1391;});}return _0x50dd30;})[_0x7887('0x25')](respondWithResult(_0x2b3811,0xc9))['catch'](handleError(_0x2b3811,null));};
\ No newline at end of file
+var _0xfd5e=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfd5e,0x1ac));var _0xefd5=function(_0x754f7f,_0x5a0753){_0x754f7f=_0x754f7f-0x0;var _0x20d21b=_0xfd5e[_0x754f7f];return _0x20d21b;};'use strict';var emlformat=require(_0xefd5('0x0'));var rimraf=require(_0xefd5('0x1'));var zipdir=require(_0xefd5('0x2'));var jsonpatch=require(_0xefd5('0x3'));var rp=require(_0xefd5('0x4'));var moment=require(_0xefd5('0x5'));var BPromise=require(_0xefd5('0x6'));var Mustache=require('mustache');var util=require(_0xefd5('0x7'));var path=require(_0xefd5('0x8'));var sox=require('sox');var csv=require(_0xefd5('0x9'));var ejs=require(_0xefd5('0xa'));var fs=require('fs');var fs_extra=require(_0xefd5('0xb'));var _=require(_0xefd5('0xc'));var squel=require(_0xefd5('0xd'));var crypto=require(_0xefd5('0xe'));var jsforce=require(_0xefd5('0xf'));var deskjs=require(_0xefd5('0x10'));var toCsv=require(_0xefd5('0x9'));var querystring=require(_0xefd5('0x11'));var Papa=require(_0xefd5('0x12'));var Redis=require('ioredis');var authService=require(_0xefd5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xefd5('0x14'));var hardwareService=require(_0xefd5('0x15'));var logger=require(_0xefd5('0x16'))(_0xefd5('0x17'));var utils=require('../../config/utils');var config=require(_0xefd5('0x18'));var licenseUtil=require(_0xefd5('0x19'));var db=require(_0xefd5('0x1a'))['db'];function respondWithStatusCode(_0x40b17c,_0x379109){_0x379109=_0x379109||0xcc;return function(_0x43bae6){if(_0x43bae6){return _0x40b17c[_0xefd5('0x1b')](_0x379109);}return _0x40b17c['status'](_0x379109)[_0xefd5('0x1c')]();};}function respondWithResult(_0x5af415,_0x534a06){_0x534a06=_0x534a06||0xc8;return function(_0x3d4313){if(_0x3d4313){return _0x5af415[_0xefd5('0x1d')](_0x534a06)[_0xefd5('0x1e')](_0x3d4313);}};}function respondWithFilteredResult(_0x2c08ad,_0x213b9f){return function(_0x50525c){if(_0x50525c){var _0x51b86b=typeof _0x213b9f[_0xefd5('0x1f')]===_0xefd5('0x20')&&typeof _0x213b9f[_0xefd5('0x21')]===_0xefd5('0x20');var _0x185ed0=_0x50525c['count'];var _0x2f93ad=_0x51b86b?0x0:_0x213b9f[_0xefd5('0x1f')];var _0x3ad200=_0x51b86b?_0x50525c['count']:_0x213b9f[_0xefd5('0x1f')]+_0x213b9f[_0xefd5('0x21')];var _0x5d36d6;if(_0x3ad200>=_0x185ed0){_0x3ad200=_0x185ed0;_0x5d36d6=0xc8;}else{_0x5d36d6=0xce;}_0x2c08ad[_0xefd5('0x1d')](_0x5d36d6);return _0x2c08ad['set'](_0xefd5('0x22'),_0x2f93ad+'-'+_0x3ad200+'/'+_0x185ed0)[_0xefd5('0x1e')](_0x50525c);}return null;};}function patchUpdates(_0x45dc07){return function(_0x363e9b){try{jsonpatch[_0xefd5('0x23')](_0x363e9b,_0x45dc07,!![]);}catch(_0x26bd1d){return BPromise[_0xefd5('0x24')](_0x26bd1d);}return _0x363e9b[_0xefd5('0x25')]();};}function saveUpdates(_0x42ed06,_0x330611){return function(_0x5413a0){if(_0x5413a0){return _0x5413a0[_0xefd5('0x26')](_0x42ed06)[_0xefd5('0x27')](function(_0xedd858){return _0xedd858;});}return null;};}function removeEntity(_0x50dca7,_0x29e895){return function(_0xc945f9){if(_0xc945f9){return _0xc945f9[_0xefd5('0x28')]()[_0xefd5('0x27')](function(){var _0x237d16=_0xc945f9[_0xefd5('0x29')]({'plain':!![]});var _0x19185b=_0xefd5('0x2a');return db[_0xefd5('0x2b')]['destroy']({'where':{'type':_0x19185b,'resourceId':_0x237d16['id']}})['then'](function(){return _0xc945f9;});})[_0xefd5('0x27')](function(){_0x50dca7[_0xefd5('0x1d')](0xcc)[_0xefd5('0x1c')]();});}};}function handleEntityNotFound(_0x670250,_0x480b79){return function(_0x29f4ec){if(!_0x29f4ec){_0x670250[_0xefd5('0x1b')](0x194);}return _0x29f4ec;};}function handleError(_0x29d567,_0x2ab172){_0x2ab172=_0x2ab172||0x1f4;return function(_0x3db66f){logger['error'](_0x3db66f[_0xefd5('0x2c')]);if(_0x3db66f[_0xefd5('0x2d')]){delete _0x3db66f[_0xefd5('0x2d')];}_0x29d567[_0xefd5('0x1d')](_0x2ab172)[_0xefd5('0x2e')](_0x3db66f);};}exports[_0xefd5('0x2f')]=function(_0x248873,_0x14da83){var _0x532035={},_0x570b87={},_0x214f00={'count':0x0,'rows':[]};var _0x3b9253=_[_0xefd5('0x30')](db[_0xefd5('0x31')][_0xefd5('0x32')],function(_0x1f282e){return{'name':_0x1f282e[_0xefd5('0x33')],'type':_0x1f282e[_0xefd5('0x34')][_0xefd5('0x35')]};});_0x570b87['model']=_[_0xefd5('0x30')](_0x3b9253,'name');_0x570b87[_0xefd5('0x36')]=_[_0xefd5('0x37')](_0x248873[_0xefd5('0x36')]);_0x570b87[_0xefd5('0x38')]=_[_0xefd5('0x39')](_0x570b87[_0xefd5('0x3a')],_0x570b87[_0xefd5('0x36')]);_0x532035[_0xefd5('0x3b')]=_['intersection'](_0x570b87['model'],qs[_0xefd5('0x3c')](_0x248873[_0xefd5('0x36')][_0xefd5('0x3c')]));_0x532035[_0xefd5('0x3b')]=_0x532035['attributes'][_0xefd5('0x3d')]?_0x532035[_0xefd5('0x3b')]:_0x570b87[_0xefd5('0x3a')];if(!_0x248873['query']['hasOwnProperty'](_0xefd5('0x3e'))){_0x532035['limit']=qs['limit'](_0x248873[_0xefd5('0x36')]['limit']);_0x532035[_0xefd5('0x1f')]=qs[_0xefd5('0x1f')](_0x248873['query'][_0xefd5('0x1f')]);}_0x532035[_0xefd5('0x3f')]=qs[_0xefd5('0x40')](_0x248873[_0xefd5('0x36')][_0xefd5('0x40')]);_0x532035[_0xefd5('0x41')]=qs['filters'](_[_0xefd5('0x42')](_0x248873['query'],_0x570b87[_0xefd5('0x38')]),_0x3b9253);if(_0x248873[_0xefd5('0x36')][_0xefd5('0x43')]){_0x532035[_0xefd5('0x41')]=_[_0xefd5('0x44')](_0x532035[_0xefd5('0x41')],{'$or':[{'key':{'$like':'%'+_0x248873['query']['filter']+'%'}},{'value':{'$like':'%'+_0x248873[_0xefd5('0x36')][_0xefd5('0x43')]+'%'}}]});}_0x532035=_[_0xefd5('0x44')]({},_0x532035,_0x248873[_0xefd5('0x45')]);var _0x5efffe={'where':_0x532035[_0xefd5('0x41')]};return db[_0xefd5('0x31')][_0xefd5('0x46')](_0x5efffe)['then'](function(_0xdeadf3){_0x214f00[_0xefd5('0x46')]=_0xdeadf3;if(_0x248873[_0xefd5('0x36')][_0xefd5('0x47')]){_0x532035[_0xefd5('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0xefd5('0x49')](_0x532035);})['then'](function(_0x496a75){_0x214f00[_0xefd5('0x4a')]=_0x496a75;return _0x214f00;})['then'](respondWithFilteredResult(_0x14da83,_0x532035))[_0xefd5('0x4b')](handleError(_0x14da83,null));};exports['show']=function(_0x476c3a,_0xe3344c){var _0x44f85f={'raw':!![],'where':{'id':_0x476c3a['params']['id']}},_0x298128={};_0x298128['model']=_[_0xefd5('0x37')](db['CannedAnswer']['rawAttributes']);_0x298128[_0xefd5('0x36')]=_[_0xefd5('0x37')](_0x476c3a[_0xefd5('0x36')]);_0x298128[_0xefd5('0x38')]=_[_0xefd5('0x39')](_0x298128[_0xefd5('0x3a')],_0x298128[_0xefd5('0x36')]);_0x44f85f['attributes']=_['intersection'](_0x298128[_0xefd5('0x3a')],qs[_0xefd5('0x3c')](_0x476c3a[_0xefd5('0x36')][_0xefd5('0x3c')]));_0x44f85f['attributes']=_0x44f85f['attributes'][_0xefd5('0x3d')]?_0x44f85f[_0xefd5('0x3b')]:_0x298128[_0xefd5('0x3a')];if(_0x476c3a['query'][_0xefd5('0x47')]){_0x44f85f[_0xefd5('0x48')]=[{'all':!![]}];}_0x44f85f=_[_0xefd5('0x44')]({},_0x44f85f,_0x476c3a[_0xefd5('0x45')]);return db['CannedAnswer']['find'](_0x44f85f)[_0xefd5('0x27')](handleEntityNotFound(_0xe3344c,null))[_0xefd5('0x27')](respondWithResult(_0xe3344c,null))[_0xefd5('0x4b')](handleError(_0xe3344c,null));};exports[_0xefd5('0x26')]=function(_0x11b87e,_0x484cfa){if(_0x11b87e[_0xefd5('0x4c')]['id']){delete _0x11b87e[_0xefd5('0x4c')]['id'];}return db['CannedAnswer'][_0xefd5('0x4d')]({'where':{'id':_0x11b87e['params']['id']}})[_0xefd5('0x27')](handleEntityNotFound(_0x484cfa,null))['then'](saveUpdates(_0x11b87e[_0xefd5('0x4c')],null))[_0xefd5('0x27')](respondWithResult(_0x484cfa,null))[_0xefd5('0x4b')](handleError(_0x484cfa,null));};exports[_0xefd5('0x28')]=function(_0x210762,_0x2291b8){return db[_0xefd5('0x31')]['find']({'where':{'id':_0x210762['params']['id']}})[_0xefd5('0x27')](handleEntityNotFound(_0x2291b8,null))['then'](removeEntity(_0x2291b8,null))[_0xefd5('0x4b')](handleError(_0x2291b8,null));};exports[_0xefd5('0x4e')]=function(_0x219557,_0x2e2d76){var _0x2c688f={'key':_0x219557[_0xefd5('0x4c')][_0xefd5('0x35')]};if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x4f')]){_0x2c688f['MailAccountId']=_0x219557[_0xefd5('0x4c')]['MailAccountId'];}else if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x50')]){_0x2c688f[_0xefd5('0x50')]=_0x219557[_0xefd5('0x4c')][_0xefd5('0x50')];}else if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x51')]){_0x2c688f[_0xefd5('0x51')]=_0x219557[_0xefd5('0x4c')][_0xefd5('0x51')];}else if(_0x219557['body'][_0xefd5('0x52')]){_0x2c688f['ChatWebsiteId']=_0x219557[_0xefd5('0x4c')][_0xefd5('0x52')];}return db[_0xefd5('0x31')]['find']({'where':_0x2c688f})['then'](function(_0x54cd67){if(_0x54cd67){throw new db['Sequelize'][(_0xefd5('0x53'))](_0xefd5('0x54'));}return db[_0xefd5('0x31')][_0xefd5('0x4e')](_0x219557[_0xefd5('0x4c')]);})[_0xefd5('0x27')](function(_0x1e67b0){var _0x168a3b=_0x219557[_0xefd5('0x55')][_0xefd5('0x29')]({'plain':!![]});if(!_0x168a3b)throw new Error(_0xefd5('0x56'));if(_0x168a3b[_0xefd5('0x57')]===_0xefd5('0x55')){var _0x2888c1=_0x1e67b0[_0xefd5('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x168a3b[_0xefd5('0x58')]},'raw':!![]})[_0xefd5('0x27')](function(_0x27279a){if(_0x27279a&&_0x27279a['autoAssociation']===0x0){return db[_0xefd5('0x2b')][_0xefd5('0x4e')]({'name':_0x2888c1[_0xefd5('0x2d')],'resourceId':_0x2888c1['id'],'type':_0x27279a[_0xefd5('0x2d')],'sectionId':_0x27279a['id']},{})[_0xefd5('0x27')](function(){return _0x1e67b0;});}else{return _0x1e67b0;}})[_0xefd5('0x4b')](function(_0x1f9d7a){logger[_0xefd5('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f9d7a);throw _0x1f9d7a;});}return _0x1e67b0;})[_0xefd5('0x27')](respondWithResult(_0x2e2d76,0xc9))[_0xefd5('0x4b')](handleError(_0x2e2d76,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 5cf6bac..9a70578 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 _0x7a28=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a28,0x1cd));var _0x87a2=function(_0x33efba,_0x4ddf7f){_0x33efba=_0x33efba-0x0;var _0x4ac6c3=_0x7a28[_0x33efba];return _0x4ac6c3;};'use strict';var _=require('lodash');var util=require(_0x87a2('0x0'));var logger=require(_0x87a2('0x1'))(_0x87a2('0x2'));var moment=require('moment');var BPromise=require(_0x87a2('0x3'));var rp=require(_0x87a2('0x4'));var fs=require('fs');var path=require(_0x87a2('0x5'));var rimraf=require('rimraf');var config=require(_0x87a2('0x6'));var attributes=require(_0x87a2('0x7'));module[_0x87a2('0x8')]=function(_0x12b55a,_0x4c513b){return _0x12b55a['define'](_0x87a2('0x9'),attributes,{'tableName':_0x87a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87a2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5dbc=['path','rimraf','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x253d9c,_0x4442c5){var _0x4d0a3d=function(_0x97fc0e){while(--_0x97fc0e){_0x253d9c['push'](_0x253d9c['shift']());}};_0x4d0a3d(++_0x4442c5);}(_0x5dbc,0x162));var _0xc5db=function(_0x150da1,_0x249791){_0x150da1=_0x150da1-0x0;var _0x9413be=_0x5dbc[_0x150da1];return _0x9413be;};'use strict';var _=require(_0xc5db('0x0'));var util=require(_0xc5db('0x1'));var logger=require(_0xc5db('0x2'))(_0xc5db('0x3'));var moment=require(_0xc5db('0x4'));var BPromise=require(_0xc5db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5db('0x6'));var rimraf=require(_0xc5db('0x7'));var config=require('../../config/environment');var attributes=require(_0xc5db('0x8'));module['exports']=function(_0x5ad154,_0x4d451d){return _0x5ad154['define'](_0xc5db('0x9'),attributes,{'tableName':_0xc5db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc5db('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index cd311ef..e748190 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(_0x107959,_0x27f36e){var _0x90360d=function(_0x2e8894){while(--_0x2e8894){_0x107959['push'](_0x107959['shift']());}};_0x90360d(++_0x27f36e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x4a5e98,_0x127885){var _0x33f12f=function(_0x36a15f){while(--_0x36a15f){_0x4a5e98['push'](_0x4a5e98['shift']());}};_0x33f12f(++_0x127885);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 c495ff2..48d1062 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 _0x6ba2=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','post','update','destroy','exports','multer','util'];(function(_0x37b209,_0x242888){var _0x5ca54e=function(_0x1e231a){while(--_0x1e231a){_0x37b209['push'](_0x37b209['shift']());}};_0x5ca54e(++_0x242888);}(_0x6ba2,0x1ce));var _0x26ba=function(_0x4a9d87,_0x2cc20f){_0x4a9d87=_0x4a9d87-0x0;var _0x1ad978=_0x6ba2[_0x4a9d87];return _0x1ad978;};'use strict';var multer=require(_0x26ba('0x0'));var util=require(_0x26ba('0x1'));var path=require(_0x26ba('0x2'));var timeout=require(_0x26ba('0x3'));var express=require(_0x26ba('0x4'));var router=express[_0x26ba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x26ba('0x7'));var controller=require(_0x26ba('0x8'));router[_0x26ba('0x9')]('/',auth[_0x26ba('0xa')](),controller['index']);router['get'](_0x26ba('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x26ba('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x26ba('0xb'),auth['isAuthenticated'](),controller[_0x26ba('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x26ba('0xe')]);module[_0x26ba('0xf')]=router;
\ No newline at end of file
+var _0xf7dc=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x91450b,_0x2328e7){var _0x426729=function(_0x1a550e){while(--_0x1a550e){_0x91450b['push'](_0x91450b['shift']());}};_0x426729(++_0x2328e7);}(_0xf7dc,0x1b0));var _0xcf7d=function(_0x33b6f3,_0xc95c82){_0x33b6f3=_0x33b6f3-0x0;var _0x5ae135=_0xf7dc[_0x33b6f3];return _0x5ae135;};'use strict';var multer=require(_0xcf7d('0x0'));var util=require(_0xcf7d('0x1'));var path=require(_0xcf7d('0x2'));var timeout=require(_0xcf7d('0x3'));var express=require(_0xcf7d('0x4'));var router=express[_0xcf7d('0x5')]();var fs_extra=require(_0xcf7d('0x6'));var auth=require(_0xcf7d('0x7'));var interaction=require(_0xcf7d('0x8'));var config=require(_0xcf7d('0x9'));var controller=require(_0xcf7d('0xa'));router[_0xcf7d('0xb')]('/',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0xd')]);router[_0xcf7d('0xb')](_0xcf7d('0xe'),auth[_0xcf7d('0xc')](),controller[_0xcf7d('0xf')]);router['post']('/',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x10')]);router[_0xcf7d('0x11')]('/:id',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x12')]);router[_0xcf7d('0x13')](_0xcf7d('0xe'),auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x14')]);module[_0xcf7d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index de604d5..1dcd1e2 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 _0xb37b=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x3eb2ea,_0x401c21){var _0x516fe4=function(_0x337c89){while(--_0x337c89){_0x3eb2ea['push'](_0x3eb2ea['shift']());}};_0x516fe4(++_0x401c21);}(_0xb37b,0x1de));var _0xbb37=function(_0x143137,_0x36be5b){_0x143137=_0x143137-0x0;var _0x6e60c6=_0xb37b[_0x143137];return _0x6e60c6;};'use strict';var Sequelize=require(_0xbb37('0x0'));module[_0xbb37('0x1')]={'calldate':{'type':Sequelize[_0xbb37('0x2')],'allowNull':![],'defaultValue':_0xbb37('0x3')},'clid':{'type':Sequelize[_0xbb37('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xbb37('0x4')]},'channel':{'type':Sequelize[_0xbb37('0x4')]},'dstchannel':{'type':Sequelize[_0xbb37('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbb37('0x4')]},'duration':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbb37('0x4')]},'amaflags':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbb37('0x4')]},'userfield':{'type':Sequelize[_0xbb37('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xbb37('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xbb37('0x4')]}};
\ No newline at end of file
+var _0x90c7=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x36cfcb,_0x5969fd){var _0x51631b=function(_0x9c096e){while(--_0x9c096e){_0x36cfcb['push'](_0x36cfcb['shift']());}};_0x51631b(++_0x5969fd);}(_0x90c7,0x9c));var _0x790c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x90c7[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x790c('0x0'));module[_0x790c('0x1')]={'calldate':{'type':Sequelize[_0x790c('0x2')],'allowNull':![],'defaultValue':_0x790c('0x3')},'clid':{'type':Sequelize[_0x790c('0x4')]},'src':{'type':Sequelize[_0x790c('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x790c('0x4')]},'channel':{'type':Sequelize[_0x790c('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x790c('0x4')]},'lastdata':{'type':Sequelize[_0x790c('0x4')]},'duration':{'type':Sequelize[_0x790c('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x790c('0x4')]},'amaflags':{'type':Sequelize[_0x790c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x790c('0x4')]},'userfield':{'type':Sequelize[_0x790c('0x4')]},'uniqueid':{'type':Sequelize[_0x790c('0x4')]},'linkedid':{'type':Sequelize[_0x790c('0x4')]},'sequence':{'type':Sequelize[_0x790c('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x790c('0x4')]},'tag':{'type':Sequelize[_0x790c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index f1e5f08..8eb35b4 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa1f6=['error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xa1f6[_0x3b5049];return _0x12454e;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['Cdr'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['Cdr'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));};
\ No newline at end of file
+var _0x44e8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x5bd0fa,_0x5edb23){var _0x293f8f=function(_0x1372dd){while(--_0x1372dd){_0x5bd0fa['push'](_0x5bd0fa['shift']());}};_0x293f8f(++_0x5edb23);}(_0x44e8,0xd7));var _0x844e=function(_0x5c208b,_0x4c4753){_0x5c208b=_0x5c208b-0x0;var _0x1ac24b=_0x44e8[_0x5c208b];return _0x1ac24b;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x1'));var rp=require(_0x844e('0x2'));var moment=require(_0x844e('0x3'));var BPromise=require(_0x844e('0x4'));var Mustache=require('mustache');var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0x9'));var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xe'));var Papa=require(_0x844e('0xf'));var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var licenseUtil=require(_0x844e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d3bea,_0x23df3f){_0x23df3f=_0x23df3f||0xcc;return function(_0x52ac76){if(_0x52ac76){return _0x8d3bea[_0x844e('0x19')](_0x23df3f);}return _0x8d3bea[_0x844e('0x1a')](_0x23df3f)['end']();};}function respondWithResult(_0x1f48e2,_0x6b542d){_0x6b542d=_0x6b542d||0xc8;return function(_0x1c1689){if(_0x1c1689){return _0x1f48e2['status'](_0x6b542d)[_0x844e('0x1b')](_0x1c1689);}};}function respondWithFilteredResult(_0x465e49,_0x380eb4){return function(_0x935134){if(_0x935134){var _0x2588a3=typeof _0x380eb4[_0x844e('0x1c')]===_0x844e('0x1d')&&typeof _0x380eb4[_0x844e('0x1e')]==='undefined';var _0x36286c=_0x935134['count'];var _0x3c307f=_0x2588a3?0x0:_0x380eb4['offset'];var _0x315c50=_0x2588a3?_0x935134['count']:_0x380eb4[_0x844e('0x1c')]+_0x380eb4[_0x844e('0x1e')];var _0x2d6ba8;if(_0x315c50>=_0x36286c){_0x315c50=_0x36286c;_0x2d6ba8=0xc8;}else{_0x2d6ba8=0xce;}_0x465e49[_0x844e('0x1a')](_0x2d6ba8);return _0x465e49[_0x844e('0x1f')](_0x844e('0x20'),_0x3c307f+'-'+_0x315c50+'/'+_0x36286c)[_0x844e('0x1b')](_0x935134);}return null;};}function patchUpdates(_0x243aeb){return function(_0x4ffb86){try{jsonpatch[_0x844e('0x21')](_0x4ffb86,_0x243aeb,!![]);}catch(_0x50aeec){return BPromise['reject'](_0x50aeec);}return _0x4ffb86[_0x844e('0x22')]();};}function saveUpdates(_0x345dcc,_0x439b26){return function(_0x286fdd){if(_0x286fdd){return _0x286fdd['update'](_0x345dcc)[_0x844e('0x23')](function(_0x3dde07){return _0x3dde07;});}return null;};}function removeEntity(_0x571498,_0x2520f8){return function(_0x13489b){if(_0x13489b){return _0x13489b[_0x844e('0x24')]()[_0x844e('0x23')](function(){_0x571498[_0x844e('0x1a')](0xcc)[_0x844e('0x25')]();});}};}function handleEntityNotFound(_0x498ae0,_0x399a81){return function(_0xadf0d8){if(!_0xadf0d8){_0x498ae0[_0x844e('0x19')](0x194);}return _0xadf0d8;};}function handleError(_0x263702,_0x2c915f){_0x2c915f=_0x2c915f||0x1f4;return function(_0x5d6856){logger[_0x844e('0x26')](_0x5d6856['stack']);if(_0x5d6856['name']){delete _0x5d6856[_0x844e('0x27')];}_0x263702[_0x844e('0x1a')](_0x2c915f)[_0x844e('0x28')](_0x5d6856);};}exports['index']=function(_0x489349,_0x2d4acd){var _0xc3ec93={},_0x54fd73={},_0x228cc1={'count':0x0,'rows':[]};var _0x81d4de=_[_0x844e('0x29')](db[_0x844e('0x2a')][_0x844e('0x2b')],function(_0x799cde){return{'name':_0x799cde[_0x844e('0x2c')],'type':_0x799cde[_0x844e('0x2d')][_0x844e('0x2e')]};});_0x54fd73[_0x844e('0x2f')]=_['map'](_0x81d4de,_0x844e('0x27'));_0x54fd73[_0x844e('0x30')]=_[_0x844e('0x31')](_0x489349[_0x844e('0x30')]);_0x54fd73[_0x844e('0x32')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],_0x54fd73['query']);_0xc3ec93[_0x844e('0x34')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],qs['fields'](_0x489349[_0x844e('0x30')][_0x844e('0x35')]));_0xc3ec93['attributes']=_0xc3ec93[_0x844e('0x34')][_0x844e('0x36')]?_0xc3ec93['attributes']:_0x54fd73[_0x844e('0x2f')];if(!_0x489349[_0x844e('0x30')][_0x844e('0x37')](_0x844e('0x38'))){_0xc3ec93[_0x844e('0x1e')]=qs[_0x844e('0x1e')](_0x489349[_0x844e('0x30')]['limit']);_0xc3ec93[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x489349[_0x844e('0x30')][_0x844e('0x1c')]);}_0xc3ec93[_0x844e('0x39')]=qs[_0x844e('0x3a')](_0x489349[_0x844e('0x30')][_0x844e('0x3a')]);_0xc3ec93[_0x844e('0x3b')]=qs[_0x844e('0x32')](_[_0x844e('0x3c')](_0x489349['query'],_0x54fd73['filters']),_0x81d4de);if(_0x489349[_0x844e('0x30')][_0x844e('0x3d')]){_0xc3ec93[_0x844e('0x3b')]=_[_0x844e('0x3e')](_0xc3ec93[_0x844e('0x3b')],{'$or':_[_0x844e('0x29')](_0x81d4de,function(_0x6f902e){if(_0x6f902e[_0x844e('0x2d')]!==_0x844e('0x3f')){var _0x539077={};_0x539077[_0x6f902e[_0x844e('0x27')]]={'$like':'%'+_0x489349['query'][_0x844e('0x3d')]+'%'};return _0x539077;}})});}_0xc3ec93=_['merge']({},_0xc3ec93,_0x489349[_0x844e('0x40')]);var _0x5dc530={'where':_0xc3ec93[_0x844e('0x3b')]};return db[_0x844e('0x2a')][_0x844e('0x41')](_0x5dc530)[_0x844e('0x23')](function(_0x2eb412){_0x228cc1[_0x844e('0x41')]=_0x2eb412;if(_0x489349[_0x844e('0x30')][_0x844e('0x42')]){_0xc3ec93[_0x844e('0x43')]=[{'all':!![]}];}return db[_0x844e('0x2a')][_0x844e('0x44')](_0xc3ec93);})['then'](function(_0x3ecb60){_0x228cc1[_0x844e('0x45')]=_0x3ecb60;return _0x228cc1;})[_0x844e('0x23')](respondWithFilteredResult(_0x2d4acd,_0xc3ec93))['catch'](handleError(_0x2d4acd,null));};exports['show']=function(_0x213a9f,_0x3e24ca){var _0x1a7817={'raw':!![],'where':{'id':_0x213a9f['params']['id']}},_0x5d8cd9={};_0x5d8cd9['model']=_['keys'](db[_0x844e('0x2a')][_0x844e('0x2b')]);_0x5d8cd9[_0x844e('0x30')]=_[_0x844e('0x31')](_0x213a9f[_0x844e('0x30')]);_0x5d8cd9['filters']=_[_0x844e('0x33')](_0x5d8cd9['model'],_0x5d8cd9['query']);_0x1a7817[_0x844e('0x34')]=_[_0x844e('0x33')](_0x5d8cd9[_0x844e('0x2f')],qs[_0x844e('0x35')](_0x213a9f['query'][_0x844e('0x35')]));_0x1a7817[_0x844e('0x34')]=_0x1a7817[_0x844e('0x34')]['length']?_0x1a7817[_0x844e('0x34')]:_0x5d8cd9[_0x844e('0x2f')];if(_0x213a9f['query'][_0x844e('0x42')]){_0x1a7817[_0x844e('0x43')]=[{'all':!![]}];}_0x1a7817=_[_0x844e('0x3e')]({},_0x1a7817,_0x213a9f[_0x844e('0x40')]);return db[_0x844e('0x2a')][_0x844e('0x46')](_0x1a7817)['then'](handleEntityNotFound(_0x3e24ca,null))[_0x844e('0x23')](respondWithResult(_0x3e24ca,null))[_0x844e('0x47')](handleError(_0x3e24ca,null));};exports[_0x844e('0x48')]=function(_0x29dd8b,_0x1dcfcb){return db[_0x844e('0x2a')][_0x844e('0x48')](_0x29dd8b[_0x844e('0x49')],{})[_0x844e('0x23')](respondWithResult(_0x1dcfcb,0xc9))[_0x844e('0x47')](handleError(_0x1dcfcb,null));};exports['update']=function(_0x32e097,_0x694791){if(_0x32e097[_0x844e('0x49')]['id']){delete _0x32e097['body']['id'];}return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x32e097[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x694791,null))[_0x844e('0x23')](saveUpdates(_0x32e097[_0x844e('0x49')],null))[_0x844e('0x23')](respondWithResult(_0x694791,null))['catch'](handleError(_0x694791,null));};exports[_0x844e('0x24')]=function(_0x3c680c,_0x43e1f5){return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x3c680c[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x43e1f5,null))[_0x844e('0x23')](removeEntity(_0x43e1f5,null))[_0x844e('0x47')](handleError(_0x43e1f5,null));};exports[_0x844e('0x4b')]=function(_0x3af2fe,_0x1dda1d){return db[_0x844e('0x2a')]['describe']()[_0x844e('0x23')](respondWithResult(_0x1dda1d,null))[_0x844e('0x47')](handleError(_0x1dda1d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 6861652..1fbdb36 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4d5f29,_0x15dfc6){var _0x15caff=function(_0x5bd352){while(--_0x5bd352){_0x4d5f29['push'](_0x4d5f29['shift']());}};_0x15caff(++_0x15dfc6);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x44b4b7,_0x485b5d){var _0x41d798=function(_0x307b96){while(--_0x307b96){_0x44b4b7['push'](_0x44b4b7['shift']());}};_0x41d798(++_0x485b5d);}(_0x7a54,0x106));var _0x47a5=function(_0x1d864c,_0x1b6310){_0x1d864c=_0x1d864c-0x0;var _0x57cbea=_0x7a54[_0x1d864c];return _0x57cbea;};'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 ce51b63..43d4e77 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 _0x12fc=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x547957,_0x2c61a8){var _0x495282=function(_0x404db1){while(--_0x404db1){_0x547957['push'](_0x547957['shift']());}};_0x495282(++_0x2c61a8);}(_0x12fc,0x6a));var _0xc12f=function(_0x1c5228,_0x2fcf2f){_0x1c5228=_0x1c5228-0x0;var _0x31c046=_0x12fc[_0x1c5228];return _0x31c046;};'use strict';var _=require(_0xc12f('0x0'));var util=require('util');var moment=require(_0xc12f('0x1'));var BPromise=require(_0xc12f('0x2'));var rs=require(_0xc12f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc12f('0x4'))['db'];var utils=require(_0xc12f('0x5'));var logger=require('../../config/logger')(_0xc12f('0x6'));var config=require(_0xc12f('0x7'));var jayson=require(_0xc12f('0x8'));var client=jayson[_0xc12f('0x9')][_0xc12f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42765c,_0x40e1e2,_0xc435c9){return new BPromise(function(_0x227bbb,_0x28b917){return client[_0xc12f('0xb')](_0x42765c,_0xc435c9)['then'](function(_0x2be440){logger['info'](_0xc12f('0xc'),_0x40e1e2,_0xc12f('0xd'));logger[_0xc12f('0xe')](_0xc12f('0xf'),_0x40e1e2,'request\x20sent',JSON[_0xc12f('0x10')](_0x2be440));if(_0x2be440['error']){if(_0x2be440[_0xc12f('0x11')][_0xc12f('0x12')]===0x1f4){logger['error'](_0xc12f('0xc'),_0x40e1e2,_0x2be440['error']['message']);return _0x28b917(_0x2be440[_0xc12f('0x11')][_0xc12f('0x13')]);}logger[_0xc12f('0x11')]('Cdr,\x20%s,\x20%s',_0x40e1e2,_0x2be440[_0xc12f('0x11')][_0xc12f('0x13')]);return _0x227bbb(_0x2be440['error']['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x40e1e2,_0xc12f('0xd'));_0x227bbb(_0x2be440[_0xc12f('0x14')][_0xc12f('0x13')]);}})['catch'](function(_0x53815b){logger[_0xc12f('0x11')](_0xc12f('0xc'),_0x40e1e2,_0x53815b);_0x28b917(_0x53815b);});});}
\ No newline at end of file
+var _0x129f=['code','message','info','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x8e23b8,_0x3c520d){var _0x14bd74=function(_0xa4f16e){while(--_0xa4f16e){_0x8e23b8['push'](_0x8e23b8['shift']());}};_0x14bd74(++_0x3c520d);}(_0x129f,0x6f));var _0xf129=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x129f[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0xf129('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf129('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf129('0x2'));var logger=require(_0xf129('0x3'))(_0xf129('0x4'));var config=require(_0xf129('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf129('0x6')][_0xf129('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x258674,_0x4a93bb,_0x20bc6f){return new BPromise(function(_0xe1b0b,_0x31ed2d){return client[_0xf129('0x8')](_0x258674,_0x20bc6f)[_0xf129('0x9')](function(_0x2b3f4f){logger['info'](_0xf129('0xa'),_0x4a93bb,'request\x20sent');logger['debug'](_0xf129('0xb'),_0x4a93bb,_0xf129('0xc'),JSON[_0xf129('0xd')](_0x2b3f4f));if(_0x2b3f4f[_0xf129('0xe')]){if(_0x2b3f4f['error'][_0xf129('0xf')]===0x1f4){logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);return _0x31ed2d(_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);}logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);return _0xe1b0b(_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);}else{logger[_0xf129('0x11')](_0xf129('0xa'),_0x4a93bb,_0xf129('0xc'));_0xe1b0b(_0x2b3f4f['result']['message']);}})['catch'](function(_0x355bc3){logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x355bc3);_0x31ed2d(_0x355bc3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3606b6d..e371663 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x25831a,_0x3027d1){var _0x141686=function(_0xac7268){while(--_0xac7268){_0x25831a['push'](_0x25831a['shift']());}};_0x141686(++_0x3027d1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index d6c4bd5..90dbdea 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 _0xd53d=['exports','STRING','*,*,*,*'];(function(_0x4387a0,_0x1650ac){var _0x1184af=function(_0x4771a7){while(--_0x4771a7){_0x4387a0['push'](_0x4387a0['shift']());}};_0x1184af(++_0x1650ac);}(_0xd53d,0xb1));var _0xdd53=function(_0x144b64,_0x22055b){_0x144b64=_0x144b64-0x0;var _0x3d5704=_0xd53d[_0x144b64];return _0x3d5704;};'use strict';var Sequelize=require('sequelize');module[_0xdd53('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdd53('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdd53('0x1')]},'interval':{'type':Sequelize[_0xdd53('0x1')],'defaultValue':_0xdd53('0x2')}};
\ No newline at end of file
+var _0xf5d6=['STRING','sequelize','exports','INTEGER','noop'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf5d6,0x79));var _0x6f5d=function(_0x1c5fb8,_0x1e6729){_0x1c5fb8=_0x1c5fb8-0x0;var _0x2c8c70=_0xf5d6[_0x1c5fb8];return _0x2c8c70;};'use strict';var Sequelize=require(_0x6f5d('0x0'));module[_0x6f5d('0x1')]={'priority':{'type':Sequelize[_0x6f5d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f5d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6f5d('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 4497b07..51390ff 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 _0xe148=['bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','params','model','keys','rawAttributes','query','intersection','attributes','fields','merge','options','find','catch','body','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe148,0x9e));var _0x8e14=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xe148[_0x2341c6];return _0x54c34d;};'use strict';var emlformat=require(_0x8e14('0x0'));var rimraf=require(_0x8e14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e14('0x2'));var rp=require(_0x8e14('0x3'));var moment=require('moment');var BPromise=require(_0x8e14('0x4'));var Mustache=require(_0x8e14('0x5'));var util=require(_0x8e14('0x6'));var path=require(_0x8e14('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e14('0x8'));var fs=require('fs');var fs_extra=require(_0x8e14('0x9'));var _=require('lodash');var squel=require(_0x8e14('0xa'));var crypto=require(_0x8e14('0xb'));var jsforce=require(_0x8e14('0xc'));var deskjs=require(_0x8e14('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e14('0xe'));var Papa=require('papaparse');var Redis=require(_0x8e14('0xf'));var authService=require(_0x8e14('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e14('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e14('0x12'));var utils=require(_0x8e14('0x13'));var config=require(_0x8e14('0x14'));var licenseUtil=require(_0x8e14('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243e4f,_0x5712fe){_0x5712fe=_0x5712fe||0xcc;return function(_0x5c49d9){if(_0x5c49d9){return _0x243e4f[_0x8e14('0x16')](_0x5712fe);}return _0x243e4f['status'](_0x5712fe)[_0x8e14('0x17')]();};}function respondWithResult(_0x4e1223,_0x59e069){_0x59e069=_0x59e069||0xc8;return function(_0x4f36a5){if(_0x4f36a5){return _0x4e1223[_0x8e14('0x18')](_0x59e069)[_0x8e14('0x19')](_0x4f36a5);}};}function respondWithFilteredResult(_0x13bdc0,_0x128217){return function(_0x40b964){if(_0x40b964){var _0x50db2e=typeof _0x128217[_0x8e14('0x1a')]===_0x8e14('0x1b')&&typeof _0x128217['limit']===_0x8e14('0x1b');var _0x201f86=_0x40b964[_0x8e14('0x1c')];var _0x169b84=_0x50db2e?0x0:_0x128217[_0x8e14('0x1a')];var _0x2510ce=_0x50db2e?_0x40b964[_0x8e14('0x1c')]:_0x128217[_0x8e14('0x1a')]+_0x128217[_0x8e14('0x1d')];var _0x2d1771;if(_0x2510ce>=_0x201f86){_0x2510ce=_0x201f86;_0x2d1771=0xc8;}else{_0x2d1771=0xce;}_0x13bdc0['status'](_0x2d1771);return _0x13bdc0[_0x8e14('0x1e')](_0x8e14('0x1f'),_0x169b84+'-'+_0x2510ce+'/'+_0x201f86)['json'](_0x40b964);}return null;};}function patchUpdates(_0x13587d){return function(_0x5a7d38){try{jsonpatch[_0x8e14('0x20')](_0x5a7d38,_0x13587d,!![]);}catch(_0x5550cb){return BPromise[_0x8e14('0x21')](_0x5550cb);}return _0x5a7d38[_0x8e14('0x22')]();};}function saveUpdates(_0x16d8e6,_0x4b3de5){return function(_0x23c5eb){if(_0x23c5eb){return _0x23c5eb[_0x8e14('0x23')](_0x16d8e6)['then'](function(_0x184cbd){return _0x184cbd;});}return null;};}function removeEntity(_0x2b7ff5,_0x1244d3){return function(_0x52b041){if(_0x52b041){return _0x52b041[_0x8e14('0x24')]()[_0x8e14('0x25')](function(){_0x2b7ff5[_0x8e14('0x18')](0xcc)[_0x8e14('0x17')]();});}};}function handleEntityNotFound(_0x5a0860,_0x28ee4a){return function(_0x5b4af3){if(!_0x5b4af3){_0x5a0860['sendStatus'](0x194);}return _0x5b4af3;};}function handleError(_0x2ad93d,_0x43b6db){_0x43b6db=_0x43b6db||0x1f4;return function(_0x356200){logger['error'](_0x356200[_0x8e14('0x26')]);if(_0x356200[_0x8e14('0x27')]){delete _0x356200[_0x8e14('0x27')];}_0x2ad93d[_0x8e14('0x18')](_0x43b6db)['send'](_0x356200);};}exports['show']=function(_0x2d88db,_0x46e737){var _0x170e0b={'raw':!![],'where':{'id':_0x2d88db[_0x8e14('0x28')]['id']}},_0x9eb6a7={};_0x9eb6a7[_0x8e14('0x29')]=_[_0x8e14('0x2a')](db['ChatApplication'][_0x8e14('0x2b')]);_0x9eb6a7[_0x8e14('0x2c')]=_[_0x8e14('0x2a')](_0x2d88db[_0x8e14('0x2c')]);_0x9eb6a7['filters']=_[_0x8e14('0x2d')](_0x9eb6a7[_0x8e14('0x29')],_0x9eb6a7[_0x8e14('0x2c')]);_0x170e0b[_0x8e14('0x2e')]=_[_0x8e14('0x2d')](_0x9eb6a7[_0x8e14('0x29')],qs[_0x8e14('0x2f')](_0x2d88db[_0x8e14('0x2c')][_0x8e14('0x2f')]));_0x170e0b[_0x8e14('0x2e')]=_0x170e0b[_0x8e14('0x2e')]['length']?_0x170e0b[_0x8e14('0x2e')]:_0x9eb6a7[_0x8e14('0x29')];if(_0x2d88db[_0x8e14('0x2c')]['includeAll']){_0x170e0b['include']=[{'all':!![]}];}_0x170e0b=_[_0x8e14('0x30')]({},_0x170e0b,_0x2d88db[_0x8e14('0x31')]);return db['ChatApplication'][_0x8e14('0x32')](_0x170e0b)[_0x8e14('0x25')](handleEntityNotFound(_0x46e737,null))['then'](respondWithResult(_0x46e737,null))[_0x8e14('0x33')](handleError(_0x46e737,null));};exports['update']=function(_0x70225c,_0xa71666){if(_0x70225c[_0x8e14('0x34')]['id']){delete _0x70225c[_0x8e14('0x34')]['id'];}return db['ChatApplication'][_0x8e14('0x32')]({'where':{'id':_0x70225c[_0x8e14('0x28')]['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0xa71666,null))['then'](saveUpdates(_0x70225c[_0x8e14('0x34')],null))[_0x8e14('0x25')](respondWithResult(_0xa71666,null))[_0x8e14('0x33')](handleError(_0xa71666,null));};exports['destroy']=function(_0x3d1558,_0x2256c0){return db[_0x8e14('0x35')][_0x8e14('0x32')]({'where':{'id':_0x3d1558['params']['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0x2256c0,null))[_0x8e14('0x25')](removeEntity(_0x2256c0,null))['catch'](handleError(_0x2256c0,null));};
\ No newline at end of file
+var _0xfb3f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','ChatApplication','find','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x15c206,_0x41ee3f){var _0x16ac3b=function(_0x1c16f6){while(--_0x1c16f6){_0x15c206['push'](_0x15c206['shift']());}};_0x16ac3b(++_0x41ee3f);}(_0xfb3f,0xd9));var _0xffb3=function(_0x24023e,_0xc174d5){_0x24023e=_0x24023e-0x0;var _0x513000=_0xfb3f[_0x24023e];return _0x513000;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];function respondWithStatusCode(_0x40c953,_0x55192c){_0x55192c=_0x55192c||0xcc;return function(_0x21924a){if(_0x21924a){return _0x40c953[_0xffb3('0x19')](_0x55192c);}return _0x40c953[_0xffb3('0x1a')](_0x55192c)[_0xffb3('0x1b')]();};}function respondWithResult(_0x65ef59,_0x420156){_0x420156=_0x420156||0xc8;return function(_0x19ce6e){if(_0x19ce6e){return _0x65ef59[_0xffb3('0x1a')](_0x420156)[_0xffb3('0x1c')](_0x19ce6e);}};}function respondWithFilteredResult(_0x3183bd,_0x38daab){return function(_0x2c3ef7){if(_0x2c3ef7){var _0x4d3c48=typeof _0x38daab[_0xffb3('0x1d')]===_0xffb3('0x1e')&&typeof _0x38daab[_0xffb3('0x1f')]==='undefined';var _0x51f3bb=_0x2c3ef7[_0xffb3('0x20')];var _0x167ed7=_0x4d3c48?0x0:_0x38daab['offset'];var _0x3b35de=_0x4d3c48?_0x2c3ef7[_0xffb3('0x20')]:_0x38daab[_0xffb3('0x1d')]+_0x38daab['limit'];var _0x2dfb40;if(_0x3b35de>=_0x51f3bb){_0x3b35de=_0x51f3bb;_0x2dfb40=0xc8;}else{_0x2dfb40=0xce;}_0x3183bd[_0xffb3('0x1a')](_0x2dfb40);return _0x3183bd['set'](_0xffb3('0x21'),_0x167ed7+'-'+_0x3b35de+'/'+_0x51f3bb)[_0xffb3('0x1c')](_0x2c3ef7);}return null;};}function patchUpdates(_0x223ad5){return function(_0x21c9ad){try{jsonpatch[_0xffb3('0x22')](_0x21c9ad,_0x223ad5,!![]);}catch(_0x46858f){return BPromise[_0xffb3('0x23')](_0x46858f);}return _0x21c9ad['save']();};}function saveUpdates(_0x473cff,_0xe4c60e){return function(_0x5e0f48){if(_0x5e0f48){return _0x5e0f48[_0xffb3('0x24')](_0x473cff)['then'](function(_0x5b707a){return _0x5b707a;});}return null;};}function removeEntity(_0x24c502,_0x3d55e6){return function(_0x22bbea){if(_0x22bbea){return _0x22bbea[_0xffb3('0x25')]()[_0xffb3('0x26')](function(){_0x24c502[_0xffb3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x796b8e,_0x588608){return function(_0x1390c6){if(!_0x1390c6){_0x796b8e[_0xffb3('0x19')](0x194);}return _0x1390c6;};}function handleError(_0x5267f7,_0x32e047){_0x32e047=_0x32e047||0x1f4;return function(_0x5e0474){logger[_0xffb3('0x27')](_0x5e0474[_0xffb3('0x28')]);if(_0x5e0474[_0xffb3('0x29')]){delete _0x5e0474[_0xffb3('0x29')];}_0x5267f7['status'](_0x32e047)['send'](_0x5e0474);};}exports['show']=function(_0x52fc8c,_0xe3d338){var _0x5d1630={'raw':!![],'where':{'id':_0x52fc8c[_0xffb3('0x2a')]['id']}},_0x17f601={};_0x17f601[_0xffb3('0x2b')]=_[_0xffb3('0x2c')](db['ChatApplication'][_0xffb3('0x2d')]);_0x17f601[_0xffb3('0x2e')]=_['keys'](_0x52fc8c[_0xffb3('0x2e')]);_0x17f601[_0xffb3('0x2f')]=_[_0xffb3('0x30')](_0x17f601['model'],_0x17f601[_0xffb3('0x2e')]);_0x5d1630[_0xffb3('0x31')]=_[_0xffb3('0x30')](_0x17f601['model'],qs[_0xffb3('0x32')](_0x52fc8c[_0xffb3('0x2e')]['fields']));_0x5d1630[_0xffb3('0x31')]=_0x5d1630[_0xffb3('0x31')][_0xffb3('0x33')]?_0x5d1630[_0xffb3('0x31')]:_0x17f601[_0xffb3('0x2b')];if(_0x52fc8c['query'][_0xffb3('0x34')]){_0x5d1630[_0xffb3('0x35')]=[{'all':!![]}];}_0x5d1630=_[_0xffb3('0x36')]({},_0x5d1630,_0x52fc8c['options']);return db[_0xffb3('0x37')][_0xffb3('0x38')](_0x5d1630)['then'](handleEntityNotFound(_0xe3d338,null))[_0xffb3('0x26')](respondWithResult(_0xe3d338,null))[_0xffb3('0x39')](handleError(_0xe3d338,null));};exports['update']=function(_0x43f16c,_0x27b4f2){if(_0x43f16c['body']['id']){delete _0x43f16c['body']['id'];}return db['ChatApplication'][_0xffb3('0x38')]({'where':{'id':_0x43f16c[_0xffb3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x27b4f2,null))[_0xffb3('0x26')](saveUpdates(_0x43f16c['body'],null))[_0xffb3('0x26')](respondWithResult(_0x27b4f2,null))[_0xffb3('0x39')](handleError(_0x27b4f2,null));};exports['destroy']=function(_0xbe01ca,_0x562740){return db[_0xffb3('0x37')][_0xffb3('0x38')]({'where':{'id':_0xbe01ca['params']['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x562740,null))[_0xffb3('0x26')](removeEntity(_0x562740,null))[_0xffb3('0x39')](handleError(_0x562740,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d322857..a2ce367 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 _0xed3e=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5d0006,_0xe5a19a){var _0x3d5da6=function(_0x3abe5d){while(--_0x3abe5d){_0x5d0006['push'](_0x5d0006['shift']());}};_0x3d5da6(++_0xe5a19a);}(_0xed3e,0x1a0));var _0xeed3=function(_0x3d09b0,_0x75f6c6){_0x3d09b0=_0x3d09b0-0x0;var _0x29e940=_0xed3e[_0x3d09b0];return _0x29e940;};'use strict';var _=require(_0xeed3('0x0'));var util=require(_0xeed3('0x1'));var logger=require(_0xeed3('0x2'))(_0xeed3('0x3'));var moment=require('moment');var BPromise=require(_0xeed3('0x4'));var rp=require(_0xeed3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeed3('0x6'));var config=require(_0xeed3('0x7'));var attributes=require(_0xeed3('0x8'));module['exports']=function(_0x5f06c8,_0x3c8852){return _0x5f06c8['define'](_0xeed3('0x9'),attributes,{'tableName':_0xeed3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeed3('0xb')});};
\ No newline at end of file
+var _0x8a30=['util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4','lodash'];(function(_0x533589,_0x7ea74f){var _0x1370ed=function(_0x1c573c){while(--_0x1c573c){_0x533589['push'](_0x533589['shift']());}};_0x1370ed(++_0x7ea74f);}(_0x8a30,0x1a1));var _0x08a3=function(_0x1f1ab1,_0x3bba8a){_0x1f1ab1=_0x1f1ab1-0x0;var _0x3955b0=_0x8a30[_0x1f1ab1];return _0x3955b0;};'use strict';var _=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var logger=require('../../config/logger')(_0x08a3('0x2'));var moment=require(_0x08a3('0x3'));var BPromise=require(_0x08a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x08a3('0x5'));var config=require(_0x08a3('0x6'));var attributes=require(_0x08a3('0x7'));module['exports']=function(_0xddad70,_0x5d969b){return _0xddad70[_0x08a3('0x8')](_0x08a3('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x08a3('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 49ce122..8b33002 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 _0x662f=['code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45c6a8,_0x354d52){var _0x8efab8=function(_0x324ecb){while(--_0x324ecb){_0x45c6a8['push'](_0x45c6a8['shift']());}};_0x8efab8(++_0x354d52);}(_0x662f,0x70));var _0xf662=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x662f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf662('0x0'));var util=require(_0xf662('0x1'));var moment=require('moment');var BPromise=require(_0xf662('0x2'));var rs=require(_0xf662('0x3'));var fs=require('fs');var Redis=require(_0xf662('0x4'));var db=require(_0xf662('0x5'))['db'];var utils=require(_0xf662('0x6'));var logger=require(_0xf662('0x7'))(_0xf662('0x8'));var config=require(_0xf662('0x9'));var jayson=require(_0xf662('0xa'));var client=jayson[_0xf662('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b7ddd,_0x366bd8,_0x105c4b){return new BPromise(function(_0x1a37e,_0x53fe6b){return client[_0xf662('0xc')](_0x5b7ddd,_0x105c4b)[_0xf662('0xd')](function(_0x180022){logger[_0xf662('0xe')](_0xf662('0xf'),_0x366bd8,_0xf662('0x10'));logger['debug'](_0xf662('0x11'),_0x366bd8,_0xf662('0x10'),JSON[_0xf662('0x12')](_0x180022));if(_0x180022[_0xf662('0x13')]){if(_0x180022[_0xf662('0x13')][_0xf662('0x14')]===0x1f4){logger[_0xf662('0x13')](_0xf662('0xf'),_0x366bd8,_0x180022[_0xf662('0x13')]['message']);return _0x53fe6b(_0x180022[_0xf662('0x13')][_0xf662('0x15')]);}logger['error'](_0xf662('0xf'),_0x366bd8,_0x180022[_0xf662('0x13')][_0xf662('0x15')]);return _0x1a37e(_0x180022[_0xf662('0x13')][_0xf662('0x15')]);}else{logger[_0xf662('0xe')](_0xf662('0xf'),_0x366bd8,_0xf662('0x10'));_0x1a37e(_0x180022['result'][_0xf662('0x15')]);}})['catch'](function(_0x3f8174){logger['error']('ChatApplication,\x20%s,\x20%s',_0x366bd8,_0x3f8174);_0x53fe6b(_0x3f8174);});});}
\ No newline at end of file
+var _0xc6dc=['randomstring','../../config/logger','rpc','../../config/environment','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0xc6dc,0x152));var _0xcc6d=function(_0x2213be,_0x514e4a){_0x2213be=_0x2213be-0x0;var _0x539784=_0xc6dc[_0x2213be];return _0x539784;};'use strict';var _=require(_0xcc6d('0x0'));var util=require(_0xcc6d('0x1'));var moment=require(_0xcc6d('0x2'));var BPromise=require(_0xcc6d('0x3'));var rs=require(_0xcc6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc6d('0x5'))(_0xcc6d('0x6'));var config=require(_0xcc6d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23c442,_0x16da88,_0x11cd2c){return new BPromise(function(_0x1e7dd9,_0x236fe7){return client['request'](_0x23c442,_0x11cd2c)[_0xcc6d('0x8')](function(_0x3b125f){logger['info'](_0xcc6d('0x9'),_0x16da88,'request\x20sent');logger[_0xcc6d('0xa')](_0xcc6d('0xb'),_0x16da88,'request\x20sent',JSON[_0xcc6d('0xc')](_0x3b125f));if(_0x3b125f['error']){if(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xe')]===0x1f4){logger['error'](_0xcc6d('0x9'),_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x236fe7(_0x3b125f['error'][_0xcc6d('0xf')]);}logger[_0xcc6d('0xd')]('ChatApplication,\x20%s,\x20%s',_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x1e7dd9(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);}else{logger[_0xcc6d('0x10')]('ChatApplication,\x20%s,\x20%s',_0x16da88,_0xcc6d('0x11'));_0x1e7dd9(_0x3b125f['result'][_0xcc6d('0xf')]);}})[_0xcc6d('0x12')](function(_0x37a63e){logger[_0xcc6d('0xd')](_0xcc6d('0x9'),_0x16da88,_0x37a63e);_0x236fe7(_0x37a63e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 62c13ea..2f8263d 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 _0x1003=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4a599b,_0x3f4138){var _0x397cb3=function(_0x119ce5){while(--_0x119ce5){_0x4a599b['push'](_0x4a599b['shift']());}};_0x397cb3(++_0x3f4138);}(_0x1003,0x167));var _0x3100=function(_0x38bb06,_0x42ed06){_0x38bb06=_0x38bb06-0x0;var _0x16df36=_0x1003[_0x38bb06];return _0x16df36;};'use strict';var multer=require(_0x3100('0x0'));var util=require(_0x3100('0x1'));var path=require('path');var timeout=require(_0x3100('0x2'));var express=require(_0x3100('0x3'));var router=express[_0x3100('0x4')]();var fs_extra=require(_0x3100('0x5'));var auth=require(_0x3100('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3100('0x7'));var controller=require(_0x3100('0x8'));router[_0x3100('0x9')]('/:id',auth[_0x3100('0xa')](),controller[_0x3100('0xb')]);router[_0x3100('0xc')](_0x3100('0xd'),auth['isAuthenticated'](),controller[_0x3100('0xe')]);router[_0x3100('0xf')](_0x3100('0xd'),auth[_0x3100('0xa')](),controller[_0x3100('0x10')]);module[_0x3100('0x11')]=router;
\ No newline at end of file
+var _0xa68d=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id','delete','destroy','multer'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa68d,0x1ee));var _0xda68=function(_0x451ccc,_0x46b2ad){_0x451ccc=_0x451ccc-0x0;var _0x1b0978=_0xa68d[_0x451ccc];return _0x1b0978;};'use strict';var multer=require(_0xda68('0x0'));var util=require(_0xda68('0x1'));var path=require(_0xda68('0x2'));var timeout=require(_0xda68('0x3'));var express=require('express');var router=express[_0xda68('0x4')]();var fs_extra=require(_0xda68('0x5'));var auth=require(_0xda68('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda68('0x7'));var controller=require(_0xda68('0x8'));router['get']('/:id',auth[_0xda68('0x9')](),controller[_0xda68('0xa')]);router[_0xda68('0xb')](_0xda68('0xc'),auth[_0xda68('0x9')](),controller['update']);router[_0xda68('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xda68('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 20b8b7a..110c204 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 _0x5418=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2fa457,_0x7021df){var _0x4f250a=function(_0xef901e){while(--_0xef901e){_0x2fa457['push'](_0x2fa457['shift']());}};_0x4f250a(++_0x7021df);}(_0x5418,0x7e));var _0x8541=function(_0x25e801,_0x57dcf2){_0x25e801=_0x25e801-0x0;var _0x14f4fd=_0x5418[_0x25e801];return _0x14f4fd;};'use strict';var Sequelize=require(_0x8541('0x0'));module[_0x8541('0x1')]={'name':{'type':Sequelize[_0x8541('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x8541('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xec79=['BOOLEAN','STRING'];(function(_0x567d9c,_0x50405d){var _0x472c9b=function(_0x1e0ba){while(--_0x1e0ba){_0x567d9c['push'](_0x567d9c['shift']());}};_0x472c9b(++_0x50405d);}(_0xec79,0x1b7));var _0x9ec7=function(_0x385f77,_0x27f2a0){_0x385f77=_0x385f77-0x0;var _0x5b21c6=_0xec79[_0x385f77];return _0x5b21c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9ec7('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x9ec7('0x0')]},'write':{'type':Sequelize[_0x9ec7('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 1b5d3c5..c9377b0 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 _0x1a8a=['register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','findAll','catch','show','params','keys','fields','merge','find','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','create','split','format','getMessages','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket'];(function(_0x431deb,_0x598e00){var _0x149073=function(_0x19fb4c){while(--_0x19fb4c){_0x431deb['push'](_0x431deb['shift']());}};_0x149073(++_0x598e00);}(_0x1a8a,0x1cb));var _0xa1a8=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x1a8a[_0x3ec333];return _0x15ccb8;};'use strict';var emlformat=require(_0xa1a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1a8('0x1'));var jsonpatch=require(_0xa1a8('0x2'));var rp=require(_0xa1a8('0x3'));var moment=require(_0xa1a8('0x4'));var BPromise=require(_0xa1a8('0x5'));var Mustache=require('mustache');var util=require(_0xa1a8('0x6'));var path=require(_0xa1a8('0x7'));var sox=require(_0xa1a8('0x8'));var csv=require(_0xa1a8('0x9'));var ejs=require(_0xa1a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa1a8('0xb'));var _=require(_0xa1a8('0xc'));var squel=require(_0xa1a8('0xd'));var crypto=require(_0xa1a8('0xe'));var jsforce=require(_0xa1a8('0xf'));var deskjs=require(_0xa1a8('0x10'));var toCsv=require(_0xa1a8('0x9'));var querystring=require(_0xa1a8('0x11'));var Papa=require(_0xa1a8('0x12'));var Redis=require(_0xa1a8('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1a8('0x14'));var logger=require(_0xa1a8('0x15'))(_0xa1a8('0x16'));var utils=require(_0xa1a8('0x17'));var config=require(_0xa1a8('0x18'));var licenseUtil=require(_0xa1a8('0x19'));var db=require(_0xa1a8('0x1a'))['db'];config[_0xa1a8('0x1b')]=_[_0xa1a8('0x1c')](config[_0xa1a8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1a8('0x1d'))(new Redis(config[_0xa1a8('0x1b')]));require(_0xa1a8('0x1e'))[_0xa1a8('0x1f')](socket);function respondWithStatusCode(_0x3c7786,_0x191452){_0x191452=_0x191452||0xcc;return function(_0x537f5c){if(_0x537f5c){return _0x3c7786[_0xa1a8('0x20')](_0x191452);}return _0x3c7786[_0xa1a8('0x21')](_0x191452)['end']();};}function respondWithResult(_0xc59077,_0x155f2f){_0x155f2f=_0x155f2f||0xc8;return function(_0x3304ed){if(_0x3304ed){return _0xc59077[_0xa1a8('0x21')](_0x155f2f)[_0xa1a8('0x22')](_0x3304ed);}};}function respondWithFilteredResult(_0x3069e8,_0x13bf41){return function(_0x22dc63){if(_0x22dc63){var _0x36b5bc=typeof _0x13bf41[_0xa1a8('0x23')]==='undefined'&&typeof _0x13bf41[_0xa1a8('0x24')]===_0xa1a8('0x25');var _0x52822d=_0x22dc63[_0xa1a8('0x26')];var _0x120aa0=_0x36b5bc?0x0:_0x13bf41[_0xa1a8('0x23')];var _0x167aae=_0x36b5bc?_0x22dc63[_0xa1a8('0x26')]:_0x13bf41[_0xa1a8('0x23')]+_0x13bf41[_0xa1a8('0x24')];var _0x267b1d;if(_0x167aae>=_0x52822d){_0x167aae=_0x52822d;_0x267b1d=0xc8;}else{_0x267b1d=0xce;}_0x3069e8[_0xa1a8('0x21')](_0x267b1d);return _0x3069e8[_0xa1a8('0x27')](_0xa1a8('0x28'),_0x120aa0+'-'+_0x167aae+'/'+_0x52822d)[_0xa1a8('0x22')](_0x22dc63);}return null;};}function patchUpdates(_0x1bd96c){return function(_0x2c0005){try{jsonpatch[_0xa1a8('0x29')](_0x2c0005,_0x1bd96c,!![]);}catch(_0x163a35){return BPromise[_0xa1a8('0x2a')](_0x163a35);}return _0x2c0005[_0xa1a8('0x2b')]();};}function saveUpdates(_0x57447b,_0x532886){return function(_0x1ab3bf){if(_0x1ab3bf){return _0x1ab3bf[_0xa1a8('0x2c')](_0x57447b)['then'](function(_0x235fbb){return _0x235fbb;});}return null;};}function removeEntity(_0x325144,_0x49bdf6){return function(_0x5c0c5c){if(_0x5c0c5c){return _0x5c0c5c[_0xa1a8('0x2d')]()[_0xa1a8('0x2e')](function(){_0x325144[_0xa1a8('0x21')](0xcc)[_0xa1a8('0x2f')]();});}};}function handleEntityNotFound(_0x42c7d2,_0xdf2aee){return function(_0x5333ae){if(!_0x5333ae){_0x42c7d2[_0xa1a8('0x20')](0x194);}return _0x5333ae;};}function handleError(_0x31b419,_0x1648de){_0x1648de=_0x1648de||0x1f4;return function(_0x47a18a){logger[_0xa1a8('0x30')](_0x47a18a['stack']);if(_0x47a18a[_0xa1a8('0x31')]){delete _0x47a18a[_0xa1a8('0x31')];}_0x31b419['status'](_0x1648de)[_0xa1a8('0x32')](_0x47a18a);};}exports[_0xa1a8('0x33')]=function(_0x405afc,_0x46e477){var _0x45ef1c={},_0x396cb6={},_0x16961a={'count':0x0,'rows':[]};var _0x349bdb=_['map'](db[_0xa1a8('0x34')][_0xa1a8('0x35')],function(_0x217d0c){return{'name':_0x217d0c[_0xa1a8('0x36')],'type':_0x217d0c[_0xa1a8('0x37')][_0xa1a8('0x38')]};});_0x396cb6[_0xa1a8('0x39')]=_[_0xa1a8('0x3a')](_0x349bdb,_0xa1a8('0x31'));_0x396cb6[_0xa1a8('0x3b')]=_['keys'](_0x405afc[_0xa1a8('0x3b')]);_0x396cb6[_0xa1a8('0x3c')]=_['intersection'](_0x396cb6[_0xa1a8('0x39')],_0x396cb6['query']);_0x45ef1c[_0xa1a8('0x3d')]=_[_0xa1a8('0x3e')](_0x396cb6[_0xa1a8('0x39')],qs['fields'](_0x405afc[_0xa1a8('0x3b')]['fields']));_0x45ef1c[_0xa1a8('0x3d')]=_0x45ef1c[_0xa1a8('0x3d')][_0xa1a8('0x3f')]?_0x45ef1c[_0xa1a8('0x3d')]:_0x396cb6[_0xa1a8('0x39')];if(!_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x40')]('nolimit')){_0x45ef1c['limit']=qs[_0xa1a8('0x24')](_0x405afc['query']['limit']);_0x45ef1c[_0xa1a8('0x23')]=qs['offset'](_0x405afc['query'][_0xa1a8('0x23')]);}_0x45ef1c[_0xa1a8('0x41')]=qs['sort'](_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x45ef1c[_0xa1a8('0x43')]=qs[_0xa1a8('0x3c')](_[_0xa1a8('0x44')](_0x405afc[_0xa1a8('0x3b')],_0x396cb6[_0xa1a8('0x3c')]),_0x349bdb);if(_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x45ef1c['where']=_['merge'](_0x45ef1c[_0xa1a8('0x43')],{'$or':_[_0xa1a8('0x3a')](_0x349bdb,function(_0x41a66d){if(_0x41a66d[_0xa1a8('0x37')]!=='VIRTUAL'){var _0x42c21a={};_0x42c21a[_0x41a66d[_0xa1a8('0x31')]]={'$like':'%'+_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x45')]+'%'};return _0x42c21a;}})});}_0x45ef1c=_['merge']({},_0x45ef1c,_0x405afc[_0xa1a8('0x46')]);var _0x2833cd={'where':_0x45ef1c[_0xa1a8('0x43')]};return db[_0xa1a8('0x34')][_0xa1a8('0x26')](_0x2833cd)[_0xa1a8('0x2e')](function(_0x277a6b){_0x16961a[_0xa1a8('0x26')]=_0x277a6b;if(_0x405afc['query'][_0xa1a8('0x47')]){_0x45ef1c[_0xa1a8('0x48')]=[{'all':!![]}];}return db[_0xa1a8('0x34')][_0xa1a8('0x49')](_0x45ef1c);})[_0xa1a8('0x2e')](function(_0x16a61e){_0x16961a['rows']=_0x16a61e;return _0x16961a;})[_0xa1a8('0x2e')](respondWithFilteredResult(_0x46e477,_0x45ef1c))[_0xa1a8('0x4a')](handleError(_0x46e477,null));};exports[_0xa1a8('0x4b')]=function(_0x150a57,_0x50ee2b){var _0x23e4d={'raw':!![],'where':{'id':_0x150a57[_0xa1a8('0x4c')]['id']}},_0xc127cf={};_0xc127cf[_0xa1a8('0x39')]=_[_0xa1a8('0x4d')](db[_0xa1a8('0x34')][_0xa1a8('0x35')]);_0xc127cf[_0xa1a8('0x3b')]=_['keys'](_0x150a57[_0xa1a8('0x3b')]);_0xc127cf[_0xa1a8('0x3c')]=_[_0xa1a8('0x3e')](_0xc127cf[_0xa1a8('0x39')],_0xc127cf[_0xa1a8('0x3b')]);_0x23e4d['attributes']=_[_0xa1a8('0x3e')](_0xc127cf[_0xa1a8('0x39')],qs['fields'](_0x150a57[_0xa1a8('0x3b')][_0xa1a8('0x4e')]));_0x23e4d['attributes']=_0x23e4d['attributes'][_0xa1a8('0x3f')]?_0x23e4d[_0xa1a8('0x3d')]:_0xc127cf[_0xa1a8('0x39')];if(_0x150a57['query'][_0xa1a8('0x47')]){_0x23e4d['include']=[{'all':!![]}];}_0x23e4d=_[_0xa1a8('0x4f')]({},_0x23e4d,_0x150a57[_0xa1a8('0x46')]);return db[_0xa1a8('0x34')][_0xa1a8('0x50')](_0x23e4d)[_0xa1a8('0x2e')](handleEntityNotFound(_0x50ee2b,null))[_0xa1a8('0x2e')](respondWithResult(_0x50ee2b,null))['catch'](handleError(_0x50ee2b,null));};exports['create']=function(_0x38cad3,_0x551212){return db[_0xa1a8('0x34')]['create'](_0x38cad3[_0xa1a8('0x51')],{})[_0xa1a8('0x2e')](respondWithResult(_0x551212,0xc9))['catch'](handleError(_0x551212,null));};exports[_0xa1a8('0x2c')]=function(_0x517990,_0x193ae1){if(_0x517990[_0xa1a8('0x51')]['id']){delete _0x517990[_0xa1a8('0x51')]['id'];}return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x517990[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x193ae1,null))[_0xa1a8('0x2e')](saveUpdates(_0x517990[_0xa1a8('0x51')],null))[_0xa1a8('0x2e')](respondWithResult(_0x193ae1,null))[_0xa1a8('0x4a')](handleError(_0x193ae1,null));};exports['destroy']=function(_0x4ca62d,_0x357b8a){return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x4ca62d[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x357b8a,null))['then'](removeEntity(_0x357b8a,null))[_0xa1a8('0x4a')](handleError(_0x357b8a,null));};exports[_0xa1a8('0x52')]=function(_0x42d67e,_0x34d13f){return db[_0xa1a8('0x34')][_0xa1a8('0x52')]()[_0xa1a8('0x2e')](respondWithResult(_0x34d13f,null))[_0xa1a8('0x4a')](handleError(_0x34d13f,null));};exports[_0xa1a8('0x53')]=function(_0x3ee6cd,_0x27bb67,_0xe6a3c7){return db[_0xa1a8('0x54')][_0xa1a8('0x26')]({'where':{'ChatGroupId':_0x3ee6cd[_0xa1a8('0x4c')]['id'],'ToId':_0x3ee6cd['user']['id'],'read':![]}})[_0xa1a8('0x2e')](function(_0x4a3f09){return{'id':_['toInteger'](_0x3ee6cd[_0xa1a8('0x4c')]['id']),'count':_0x4a3f09};})['then'](respondWithResult(_0x27bb67,null))[_0xa1a8('0x4a')](handleError(_0x27bb67,null));};exports[_0xa1a8('0x55')]=function(_0x2ce24f,_0x522c48,_0x46702f){return db['ChatGroup'][_0xa1a8('0x50')]({'where':{'id':_0x2ce24f[_0xa1a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x522c48,null))[_0xa1a8('0x2e')](function(_0x4b842b){if(_0x4b842b){return _0x4b842b[_0xa1a8('0x55')](_0x2ce24f[_0xa1a8('0x51')][_0xa1a8('0x56')],_[_0xa1a8('0x57')](_0x2ce24f[_0xa1a8('0x51')],[_0xa1a8('0x56'),'id'])||{});}})['then'](respondWithResult(_0x522c48,null))['catch'](handleError(_0x522c48,null));};exports['getMembers']=function(_0x2b00a2,_0x32b874,_0xdd8ab6){var _0x290cc3={};var _0xaec39c={};var _0x5616b0;var _0x409e01;return db[_0xa1a8('0x34')][_0xa1a8('0x58')]({'where':{'id':_0x2b00a2['params']['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x32b874,null))[_0xa1a8('0x2e')](function(_0x5272dd){if(_0x5272dd){_0x5616b0=_0x5272dd;_0xaec39c[_0xa1a8('0x39')]=_[_0xa1a8('0x4d')](db[_0xa1a8('0x59')]['rawAttributes']);_0xaec39c['query']=_['keys'](_0x2b00a2['query']);_0xaec39c[_0xa1a8('0x3c')]=_[_0xa1a8('0x3e')](_0xaec39c[_0xa1a8('0x39')],_0xaec39c['query']);_0x290cc3[_0xa1a8('0x3d')]=_[_0xa1a8('0x3e')](_0xaec39c['model'],qs[_0xa1a8('0x4e')](_0x2b00a2[_0xa1a8('0x3b')]['fields']));_0x290cc3[_0xa1a8('0x3d')]=_0x290cc3[_0xa1a8('0x3d')][_0xa1a8('0x3f')]?_0x290cc3[_0xa1a8('0x3d')]:_0xaec39c[_0xa1a8('0x39')];_0x290cc3[_0xa1a8('0x41')]=qs[_0xa1a8('0x42')](_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x290cc3['where']=qs[_0xa1a8('0x3c')](_[_0xa1a8('0x44')](_0x2b00a2[_0xa1a8('0x3b')],_0xaec39c[_0xa1a8('0x3c')]));if(_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x290cc3['where']=_[_0xa1a8('0x4f')](_0x290cc3['where'],{'$or':_[_0xa1a8('0x3a')](_0x290cc3['attributes'],function(_0xa996f2){var _0x17af3a={};_0x17af3a[_0xa996f2]={'$like':'%'+_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x45')]+'%'};return _0x17af3a;})});}_0x290cc3=_['merge']({},_0x290cc3,_0x2b00a2['options']);return _0x5616b0[_0xa1a8('0x5a')](_0x290cc3);}})[_0xa1a8('0x2e')](function(_0x4576c3){if(_0x4576c3){_0x409e01=_0x4576c3[_0xa1a8('0x3f')];if(!_0x2b00a2['query'][_0xa1a8('0x40')]('nolimit')){_0x290cc3[_0xa1a8('0x24')]=qs[_0xa1a8('0x24')](_0x2b00a2['query'][_0xa1a8('0x24')]);_0x290cc3[_0xa1a8('0x23')]=qs[_0xa1a8('0x23')](_0x2b00a2['query']['offset']);}return _0x5616b0['getMembers'](_0x290cc3);}})[_0xa1a8('0x2e')](function(_0x17433b){if(_0x17433b){return _0x17433b?{'count':_0x409e01,'rows':_0x17433b}:null;}})[_0xa1a8('0x2e')](respondWithResult(_0x32b874,null))[_0xa1a8('0x4a')](handleError(_0x32b874,null));};exports[_0xa1a8('0x5b')]=function(_0x5482c6,_0x3ef7a7,_0x488794){return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x5482c6[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x3ef7a7,null))[_0xa1a8('0x2e')](function(_0x16856a){if(_0x16856a){return _0x16856a[_0xa1a8('0x5b')](_0x5482c6[_0xa1a8('0x3b')][_0xa1a8('0x56')]);}})[_0xa1a8('0x2e')](respondWithStatusCode(_0x3ef7a7,null))[_0xa1a8('0x4a')](handleError(_0x3ef7a7,null));};exports['addMessage']=function(_0x36c219,_0x31feaa,_0xa8c914){if(_0x36c219[_0xa1a8('0x51')]['id']){delete _0x36c219['body']['id'];}return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x36c219[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x31feaa,null))[_0xa1a8('0x2e')](function(_0x36b02e){if(_0x36b02e){_0x36c219[_0xa1a8('0x51')][_0xa1a8('0x5c')]=_0x36b02e['id'];return db[_0xa1a8('0x54')][_0xa1a8('0x5d')](_0x36c219[_0xa1a8('0x51')]);}})[_0xa1a8('0x2e')](respondWithResult(_0x31feaa,null))[_0xa1a8('0x4a')](handleError(_0x31feaa,null));};exports['getMessages']=function(_0x445a9d,_0x1e08ca,_0x520071){var _0x44fd01={};var _0x3813de={};var _0x1caaf6;var _0x3dd4ac;return db[_0xa1a8('0x34')]['findOne']({'where':{'id':_0x445a9d[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x1e08ca,null))[_0xa1a8('0x2e')](function(_0x36ad21){if(_0x36ad21){_0x1caaf6=_0x36ad21;_0x3813de['model']=_[_0xa1a8('0x4d')](db['ChatInternalMessage'][_0xa1a8('0x35')]);_0x3813de[_0xa1a8('0x3b')]=_[_0xa1a8('0x4d')](_0x445a9d['query']);_0x3813de['filters']=_['intersection'](_0x3813de[_0xa1a8('0x39')],_0x3813de['query']);_0x44fd01['attributes']=_[_0xa1a8('0x3e')](_0x3813de[_0xa1a8('0x39')],qs[_0xa1a8('0x4e')](_0x445a9d['query'][_0xa1a8('0x4e')]));_0x44fd01['attributes']=_0x44fd01['attributes']['length']?_0x44fd01[_0xa1a8('0x3d')]:_0x3813de[_0xa1a8('0x39')];_0x44fd01['order']=qs['sort'](_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x44fd01[_0xa1a8('0x43')]=qs['filters'](_['pick'](_0x445a9d[_0xa1a8('0x3b')],_0x3813de[_0xa1a8('0x3c')]));if(_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x44fd01[_0xa1a8('0x43')]=_[_0xa1a8('0x4f')](_0x44fd01['where'],{'$or':_[_0xa1a8('0x3a')](_0x44fd01['attributes'],function(_0x5c4ed7){var _0xfb5858={};_0xfb5858[_0x5c4ed7]={'$like':'%'+_0x445a9d[_0xa1a8('0x3b')]['filter']+'%'};return _0xfb5858;})});}if(_0x445a9d[_0xa1a8('0x3b')]['$gte']){var _0x249961=_0x445a9d[_0xa1a8('0x3b')]['$gte'][_0xa1a8('0x5e')](',');var _0x1785a0={};_0x1785a0[_0x249961[0x0]]={'$gte':moment(_0x249961[0x1])[_0xa1a8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44fd01['where']=_['merge'](_0x44fd01['where'],_0x1785a0);}_0x44fd01=_['merge']({},_0x44fd01,_0x445a9d['options']);return _0x1caaf6[_0xa1a8('0x60')](_0x44fd01);}})[_0xa1a8('0x2e')](function(_0x2088e0){if(_0x2088e0){_0x3dd4ac=_0x2088e0['length'];if(!_0x445a9d['query'][_0xa1a8('0x40')](_0xa1a8('0x61'))){_0x44fd01['limit']=qs[_0xa1a8('0x24')](_0x445a9d['query'][_0xa1a8('0x24')]);_0x44fd01[_0xa1a8('0x23')]=qs[_0xa1a8('0x23')](_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x23')]);}return _0x1caaf6[_0xa1a8('0x60')](_0x44fd01);}})[_0xa1a8('0x2e')](function(_0x295039){if(_0x295039){return _0x295039?{'count':_0x3dd4ac,'rows':_0x295039}:null;}})[_0xa1a8('0x2e')](respondWithResult(_0x1e08ca,null))['catch'](handleError(_0x1e08ca,null));};
\ No newline at end of file
+var _0x2a25=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','then','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','rawAttributes','fields','create','body','update','find','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2a25,0x124));var _0x52a2=function(_0x11405c,_0x5ec03b){_0x11405c=_0x11405c-0x0;var _0x31ce9c=_0x2a25[_0x11405c];return _0x31ce9c;};'use strict';var emlformat=require(_0x52a2('0x0'));var rimraf=require(_0x52a2('0x1'));var zipdir=require(_0x52a2('0x2'));var jsonpatch=require(_0x52a2('0x3'));var rp=require(_0x52a2('0x4'));var moment=require(_0x52a2('0x5'));var BPromise=require(_0x52a2('0x6'));var Mustache=require(_0x52a2('0x7'));var util=require(_0x52a2('0x8'));var path=require(_0x52a2('0x9'));var sox=require(_0x52a2('0xa'));var csv=require(_0x52a2('0xb'));var ejs=require(_0x52a2('0xc'));var fs=require('fs');var fs_extra=require(_0x52a2('0xd'));var _=require(_0x52a2('0xe'));var squel=require(_0x52a2('0xf'));var crypto=require('crypto');var jsforce=require(_0x52a2('0x10'));var deskjs=require(_0x52a2('0x11'));var toCsv=require(_0x52a2('0xb'));var querystring=require('querystring');var Papa=require(_0x52a2('0x12'));var Redis=require(_0x52a2('0x13'));var authService=require(_0x52a2('0x14'));var qs=require(_0x52a2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52a2('0x16'));var logger=require('../../config/logger')(_0x52a2('0x17'));var utils=require(_0x52a2('0x18'));var config=require(_0x52a2('0x19'));var licenseUtil=require(_0x52a2('0x1a'));var db=require('../../mysqldb')['db'];config[_0x52a2('0x1b')]=_[_0x52a2('0x1c')](config[_0x52a2('0x1b')],{'host':_0x52a2('0x1d'),'port':0x18eb});var socket=require(_0x52a2('0x1e'))(new Redis(config['redis']));require(_0x52a2('0x1f'))[_0x52a2('0x20')](socket);function respondWithStatusCode(_0x5d46f4,_0x1144e1){_0x1144e1=_0x1144e1||0xcc;return function(_0x20d553){if(_0x20d553){return _0x5d46f4[_0x52a2('0x21')](_0x1144e1);}return _0x5d46f4[_0x52a2('0x22')](_0x1144e1)[_0x52a2('0x23')]();};}function respondWithResult(_0x8867f3,_0x2ba584){_0x2ba584=_0x2ba584||0xc8;return function(_0x2fa715){if(_0x2fa715){return _0x8867f3[_0x52a2('0x22')](_0x2ba584)['json'](_0x2fa715);}};}function respondWithFilteredResult(_0x592370,_0x3b8f84){return function(_0x27c683){if(_0x27c683){var _0x40564c=typeof _0x3b8f84[_0x52a2('0x24')]===_0x52a2('0x25')&&typeof _0x3b8f84[_0x52a2('0x26')]==='undefined';var _0x3e62ba=_0x27c683['count'];var _0x362432=_0x40564c?0x0:_0x3b8f84[_0x52a2('0x24')];var _0x126702=_0x40564c?_0x27c683['count']:_0x3b8f84[_0x52a2('0x24')]+_0x3b8f84[_0x52a2('0x26')];var _0x3097d4;if(_0x126702>=_0x3e62ba){_0x126702=_0x3e62ba;_0x3097d4=0xc8;}else{_0x3097d4=0xce;}_0x592370[_0x52a2('0x22')](_0x3097d4);return _0x592370['set'](_0x52a2('0x27'),_0x362432+'-'+_0x126702+'/'+_0x3e62ba)[_0x52a2('0x28')](_0x27c683);}return null;};}function patchUpdates(_0xd44942){return function(_0x3ec0b4){try{jsonpatch[_0x52a2('0x29')](_0x3ec0b4,_0xd44942,!![]);}catch(_0x30b334){return BPromise[_0x52a2('0x2a')](_0x30b334);}return _0x3ec0b4['save']();};}function saveUpdates(_0x1e4e35,_0x508957){return function(_0x52f96e){if(_0x52f96e){return _0x52f96e['update'](_0x1e4e35)[_0x52a2('0x2b')](function(_0xec4025){return _0xec4025;});}return null;};}function removeEntity(_0x2fdb51,_0x44b10d){return function(_0x923a17){if(_0x923a17){return _0x923a17['destroy']()[_0x52a2('0x2b')](function(){_0x2fdb51['status'](0xcc)[_0x52a2('0x23')]();});}};}function handleEntityNotFound(_0x5b6e78,_0x315864){return function(_0x458e1d){if(!_0x458e1d){_0x5b6e78[_0x52a2('0x21')](0x194);}return _0x458e1d;};}function handleError(_0x51fa0c,_0x32be22){_0x32be22=_0x32be22||0x1f4;return function(_0x5c1f95){logger[_0x52a2('0x2c')](_0x5c1f95[_0x52a2('0x2d')]);if(_0x5c1f95['name']){delete _0x5c1f95[_0x52a2('0x2e')];}_0x51fa0c['status'](_0x32be22)['send'](_0x5c1f95);};}exports[_0x52a2('0x2f')]=function(_0x4eb220,_0x3218e4){var _0x24863b={},_0x53057a={},_0x4db7f3={'count':0x0,'rows':[]};var _0x4d29a7=_[_0x52a2('0x30')](db[_0x52a2('0x31')]['rawAttributes'],function(_0x51b204){return{'name':_0x51b204[_0x52a2('0x32')],'type':_0x51b204[_0x52a2('0x33')][_0x52a2('0x34')]};});_0x53057a[_0x52a2('0x35')]=_[_0x52a2('0x30')](_0x4d29a7,_0x52a2('0x2e'));_0x53057a[_0x52a2('0x36')]=_['keys'](_0x4eb220[_0x52a2('0x36')]);_0x53057a[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x53057a[_0x52a2('0x35')],_0x53057a['query']);_0x24863b[_0x52a2('0x39')]=_['intersection'](_0x53057a['model'],qs['fields'](_0x4eb220[_0x52a2('0x36')]['fields']));_0x24863b[_0x52a2('0x39')]=_0x24863b[_0x52a2('0x39')][_0x52a2('0x3a')]?_0x24863b['attributes']:_0x53057a[_0x52a2('0x35')];if(!_0x4eb220[_0x52a2('0x36')]['hasOwnProperty']('nolimit')){_0x24863b['limit']=qs[_0x52a2('0x26')](_0x4eb220['query']['limit']);_0x24863b[_0x52a2('0x24')]=qs['offset'](_0x4eb220[_0x52a2('0x36')][_0x52a2('0x24')]);}_0x24863b[_0x52a2('0x3b')]=qs[_0x52a2('0x3c')](_0x4eb220[_0x52a2('0x36')]['sort']);_0x24863b['where']=qs[_0x52a2('0x37')](_[_0x52a2('0x3d')](_0x4eb220[_0x52a2('0x36')],_0x53057a[_0x52a2('0x37')]),_0x4d29a7);if(_0x4eb220[_0x52a2('0x36')][_0x52a2('0x3e')]){_0x24863b[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0x24863b['where'],{'$or':_[_0x52a2('0x30')](_0x4d29a7,function(_0x295543){if(_0x295543[_0x52a2('0x33')]!==_0x52a2('0x41')){var _0x510655={};_0x510655[_0x295543[_0x52a2('0x2e')]]={'$like':'%'+_0x4eb220[_0x52a2('0x36')][_0x52a2('0x3e')]+'%'};return _0x510655;}})});}_0x24863b=_[_0x52a2('0x40')]({},_0x24863b,_0x4eb220[_0x52a2('0x42')]);var _0x51d168={'where':_0x24863b[_0x52a2('0x3f')]};return db[_0x52a2('0x31')][_0x52a2('0x43')](_0x51d168)[_0x52a2('0x2b')](function(_0x3619b3){_0x4db7f3[_0x52a2('0x43')]=_0x3619b3;if(_0x4eb220[_0x52a2('0x36')][_0x52a2('0x44')]){_0x24863b[_0x52a2('0x45')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x24863b);})[_0x52a2('0x2b')](function(_0x1b694e){_0x4db7f3[_0x52a2('0x46')]=_0x1b694e;return _0x4db7f3;})[_0x52a2('0x2b')](respondWithFilteredResult(_0x3218e4,_0x24863b))[_0x52a2('0x47')](handleError(_0x3218e4,null));};exports[_0x52a2('0x48')]=function(_0x2608c2,_0x424eef){var _0x566f39={'raw':!![],'where':{'id':_0x2608c2['params']['id']}},_0x1c6d88={};_0x1c6d88[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x31')][_0x52a2('0x4a')]);_0x1c6d88[_0x52a2('0x36')]=_[_0x52a2('0x49')](_0x2608c2['query']);_0x1c6d88[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x1c6d88['model'],_0x1c6d88[_0x52a2('0x36')]);_0x566f39[_0x52a2('0x39')]=_[_0x52a2('0x38')](_0x1c6d88[_0x52a2('0x35')],qs[_0x52a2('0x4b')](_0x2608c2[_0x52a2('0x36')][_0x52a2('0x4b')]));_0x566f39['attributes']=_0x566f39[_0x52a2('0x39')][_0x52a2('0x3a')]?_0x566f39[_0x52a2('0x39')]:_0x1c6d88[_0x52a2('0x35')];if(_0x2608c2['query'][_0x52a2('0x44')]){_0x566f39[_0x52a2('0x45')]=[{'all':!![]}];}_0x566f39=_['merge']({},_0x566f39,_0x2608c2[_0x52a2('0x42')]);return db['ChatGroup']['find'](_0x566f39)[_0x52a2('0x2b')](handleEntityNotFound(_0x424eef,null))['then'](respondWithResult(_0x424eef,null))[_0x52a2('0x47')](handleError(_0x424eef,null));};exports[_0x52a2('0x4c')]=function(_0x31c628,_0x2a807a){return db[_0x52a2('0x31')][_0x52a2('0x4c')](_0x31c628[_0x52a2('0x4d')],{})[_0x52a2('0x2b')](respondWithResult(_0x2a807a,0xc9))[_0x52a2('0x47')](handleError(_0x2a807a,null));};exports[_0x52a2('0x4e')]=function(_0x5b75e4,_0x32f1fc){if(_0x5b75e4[_0x52a2('0x4d')]['id']){delete _0x5b75e4[_0x52a2('0x4d')]['id'];}return db[_0x52a2('0x31')][_0x52a2('0x4f')]({'where':{'id':_0x5b75e4[_0x52a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x32f1fc,null))[_0x52a2('0x2b')](saveUpdates(_0x5b75e4[_0x52a2('0x4d')],null))[_0x52a2('0x2b')](respondWithResult(_0x32f1fc,null))[_0x52a2('0x47')](handleError(_0x32f1fc,null));};exports[_0x52a2('0x51')]=function(_0xf589fd,_0x336447){return db[_0x52a2('0x31')]['find']({'where':{'id':_0xf589fd[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x336447,null))[_0x52a2('0x2b')](removeEntity(_0x336447,null))[_0x52a2('0x47')](handleError(_0x336447,null));};exports[_0x52a2('0x52')]=function(_0x15b25f,_0x2c4434){return db[_0x52a2('0x31')][_0x52a2('0x52')]()['then'](respondWithResult(_0x2c4434,null))[_0x52a2('0x47')](handleError(_0x2c4434,null));};exports[_0x52a2('0x53')]=function(_0x130b8c,_0x3d26eb,_0x14cbf5){return db[_0x52a2('0x54')][_0x52a2('0x43')]({'where':{'ChatGroupId':_0x130b8c[_0x52a2('0x50')]['id'],'ToId':_0x130b8c['user']['id'],'read':![]}})[_0x52a2('0x2b')](function(_0x20d9f2){return{'id':_[_0x52a2('0x55')](_0x130b8c[_0x52a2('0x50')]['id']),'count':_0x20d9f2};})[_0x52a2('0x2b')](respondWithResult(_0x3d26eb,null))['catch'](handleError(_0x3d26eb,null));};exports[_0x52a2('0x56')]=function(_0x6840f4,_0xb40ce5,_0x15fa7d){return db[_0x52a2('0x31')]['find']({'where':{'id':_0x6840f4['params']['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0xb40ce5,null))[_0x52a2('0x2b')](function(_0x5c19a2){if(_0x5c19a2){return _0x5c19a2['addMembers'](_0x6840f4[_0x52a2('0x4d')][_0x52a2('0x57')],_[_0x52a2('0x58')](_0x6840f4[_0x52a2('0x4d')],[_0x52a2('0x57'),'id'])||{});}})[_0x52a2('0x2b')](respondWithResult(_0xb40ce5,null))['catch'](handleError(_0xb40ce5,null));};exports[_0x52a2('0x59')]=function(_0x6616d7,_0x5eb12f,_0x2c6b44){var _0x19fcfa={};var _0x3df534={};var _0x120db4;var _0x4a33e8;return db[_0x52a2('0x31')][_0x52a2('0x5a')]({'where':{'id':_0x6616d7[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x5eb12f,null))[_0x52a2('0x2b')](function(_0x375f1d){if(_0x375f1d){_0x120db4=_0x375f1d;_0x3df534[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x5b')][_0x52a2('0x4a')]);_0x3df534[_0x52a2('0x36')]=_[_0x52a2('0x49')](_0x6616d7[_0x52a2('0x36')]);_0x3df534[_0x52a2('0x37')]=_['intersection'](_0x3df534[_0x52a2('0x35')],_0x3df534[_0x52a2('0x36')]);_0x19fcfa[_0x52a2('0x39')]=_[_0x52a2('0x38')](_0x3df534['model'],qs[_0x52a2('0x4b')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x4b')]));_0x19fcfa[_0x52a2('0x39')]=_0x19fcfa[_0x52a2('0x39')]['length']?_0x19fcfa[_0x52a2('0x39')]:_0x3df534['model'];_0x19fcfa[_0x52a2('0x3b')]=qs['sort'](_0x6616d7[_0x52a2('0x36')]['sort']);_0x19fcfa['where']=qs[_0x52a2('0x37')](_[_0x52a2('0x3d')](_0x6616d7['query'],_0x3df534['filters']));if(_0x6616d7['query'][_0x52a2('0x3e')]){_0x19fcfa[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0x19fcfa['where'],{'$or':_[_0x52a2('0x30')](_0x19fcfa[_0x52a2('0x39')],function(_0x5ca566){var _0x991cfe={};_0x991cfe[_0x5ca566]={'$like':'%'+_0x6616d7['query'][_0x52a2('0x3e')]+'%'};return _0x991cfe;})});}_0x19fcfa=_[_0x52a2('0x40')]({},_0x19fcfa,_0x6616d7[_0x52a2('0x42')]);return _0x120db4['getMembers'](_0x19fcfa);}})[_0x52a2('0x2b')](function(_0x1ccedd){if(_0x1ccedd){_0x4a33e8=_0x1ccedd['length'];if(!_0x6616d7[_0x52a2('0x36')]['hasOwnProperty']('nolimit')){_0x19fcfa[_0x52a2('0x26')]=qs[_0x52a2('0x26')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x26')]);_0x19fcfa[_0x52a2('0x24')]=qs[_0x52a2('0x24')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x24')]);}return _0x120db4[_0x52a2('0x59')](_0x19fcfa);}})[_0x52a2('0x2b')](function(_0x1c92b7){if(_0x1c92b7){return _0x1c92b7?{'count':_0x4a33e8,'rows':_0x1c92b7}:null;}})[_0x52a2('0x2b')](respondWithResult(_0x5eb12f,null))[_0x52a2('0x47')](handleError(_0x5eb12f,null));};exports['removeMembers']=function(_0x2a8b98,_0x3d771b,_0x5f4ffe){return db['ChatGroup'][_0x52a2('0x4f')]({'where':{'id':_0x2a8b98[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x3d771b,null))[_0x52a2('0x2b')](function(_0xcad25d){if(_0xcad25d){return _0xcad25d[_0x52a2('0x5c')](_0x2a8b98[_0x52a2('0x36')][_0x52a2('0x57')]);}})['then'](respondWithStatusCode(_0x3d771b,null))[_0x52a2('0x47')](handleError(_0x3d771b,null));};exports[_0x52a2('0x5d')]=function(_0x15d40b,_0x38c3c9,_0x32fd9e){if(_0x15d40b[_0x52a2('0x4d')]['id']){delete _0x15d40b[_0x52a2('0x4d')]['id'];}return db[_0x52a2('0x31')][_0x52a2('0x4f')]({'where':{'id':_0x15d40b[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x38c3c9,null))[_0x52a2('0x2b')](function(_0x45a2cd){if(_0x45a2cd){_0x15d40b[_0x52a2('0x4d')]['ChatGroupId']=_0x45a2cd['id'];return db['ChatInternalMessage']['create'](_0x15d40b[_0x52a2('0x4d')]);}})[_0x52a2('0x2b')](respondWithResult(_0x38c3c9,null))[_0x52a2('0x47')](handleError(_0x38c3c9,null));};exports[_0x52a2('0x5e')]=function(_0x5870dc,_0x232748,_0x81acb4){var _0xe2fa78={};var _0x3d5df7={};var _0x1c7cbc;var _0x2845af;return db['ChatGroup']['findOne']({'where':{'id':_0x5870dc[_0x52a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x232748,null))[_0x52a2('0x2b')](function(_0x315a82){if(_0x315a82){_0x1c7cbc=_0x315a82;_0x3d5df7[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x54')][_0x52a2('0x4a')]);_0x3d5df7['query']=_[_0x52a2('0x49')](_0x5870dc['query']);_0x3d5df7[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x3d5df7['model'],_0x3d5df7['query']);_0xe2fa78[_0x52a2('0x39')]=_['intersection'](_0x3d5df7['model'],qs[_0x52a2('0x4b')](_0x5870dc['query']['fields']));_0xe2fa78[_0x52a2('0x39')]=_0xe2fa78[_0x52a2('0x39')]['length']?_0xe2fa78[_0x52a2('0x39')]:_0x3d5df7[_0x52a2('0x35')];_0xe2fa78[_0x52a2('0x3b')]=qs[_0x52a2('0x3c')](_0x5870dc[_0x52a2('0x36')][_0x52a2('0x3c')]);_0xe2fa78[_0x52a2('0x3f')]=qs[_0x52a2('0x37')](_['pick'](_0x5870dc[_0x52a2('0x36')],_0x3d5df7[_0x52a2('0x37')]));if(_0x5870dc[_0x52a2('0x36')]['filter']){_0xe2fa78[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0xe2fa78[_0x52a2('0x3f')],{'$or':_['map'](_0xe2fa78[_0x52a2('0x39')],function(_0x4f9b3b){var _0x27cef7={};_0x27cef7[_0x4f9b3b]={'$like':'%'+_0x5870dc[_0x52a2('0x36')][_0x52a2('0x3e')]+'%'};return _0x27cef7;})});}if(_0x5870dc['query'][_0x52a2('0x5f')]){var _0x300ad2=_0x5870dc[_0x52a2('0x36')][_0x52a2('0x5f')][_0x52a2('0x60')](',');var _0x4430df={};_0x4430df[_0x300ad2[0x0]]={'$gte':moment(_0x300ad2[0x1])[_0x52a2('0x61')](_0x52a2('0x62'))};_0xe2fa78[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0xe2fa78[_0x52a2('0x3f')],_0x4430df);}_0xe2fa78=_[_0x52a2('0x40')]({},_0xe2fa78,_0x5870dc['options']);return _0x1c7cbc[_0x52a2('0x5e')](_0xe2fa78);}})['then'](function(_0x4b25b){if(_0x4b25b){_0x2845af=_0x4b25b[_0x52a2('0x3a')];if(!_0x5870dc[_0x52a2('0x36')][_0x52a2('0x63')](_0x52a2('0x64'))){_0xe2fa78['limit']=qs[_0x52a2('0x26')](_0x5870dc['query']['limit']);_0xe2fa78[_0x52a2('0x24')]=qs[_0x52a2('0x24')](_0x5870dc[_0x52a2('0x36')][_0x52a2('0x24')]);}return _0x1c7cbc['getMessages'](_0xe2fa78);}})[_0x52a2('0x2b')](function(_0x26b7b5){if(_0x26b7b5){return _0x26b7b5?{'count':_0x2845af,'rows':_0x26b7b5}:null;}})[_0x52a2('0x2b')](respondWithResult(_0x232748,null))[_0x52a2('0x47')](handleError(_0x232748,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 634029d..f04d6ea 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 _0xd668=['events','../../mysqldb','ChatGroup','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x1be782,_0x11b259){var _0x3f58b6=function(_0x2bd850){while(--_0x2bd850){_0x1be782['push'](_0x1be782['shift']());}};_0x3f58b6(++_0x11b259);}(_0xd668,0x15e));var _0x8d66=function(_0x573e4d,_0x5db9f6){_0x573e4d=_0x573e4d-0x0;var _0xd07395=_0xd668[_0x573e4d];return _0xd07395;};'use strict';var EventEmitter=require(_0x8d66('0x0'));var ChatGroup=require(_0x8d66('0x1'))['db'][_0x8d66('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8d66('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8d66('0x4')};function emitEvent(_0xd441a){return function(_0xcf5b34,_0x130aab,_0xa33fdd){ChatGroupEvents[_0x8d66('0x5')](_0xd441a+':'+_0xcf5b34['id'],_0xcf5b34);ChatGroupEvents[_0x8d66('0x5')](_0xd441a,_0xcf5b34);_0xa33fdd(null);};}for(var e in events){if(events[_0x8d66('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x1c52=['ChatGroup','setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1c52,0x7c));var _0x21c5=function(_0x146b5a,_0x3b6def){_0x146b5a=_0x146b5a-0x0;var _0x1fec16=_0x1c52[_0x146b5a];return _0x1fec16;};'use strict';var EventEmitter=require(_0x21c5('0x0'));var ChatGroup=require(_0x21c5('0x1'))['db'][_0x21c5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x21c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26e3eb){return function(_0x67781f,_0x5374cd,_0x13c1a9){ChatGroupEvents[_0x21c5('0x4')](_0x26e3eb+':'+_0x67781f['id'],_0x67781f);ChatGroupEvents[_0x21c5('0x4')](_0x26e3eb,_0x67781f);_0x13c1a9(null);};}for(var e in events){if(events[_0x21c5('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x21c5('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d686056..0d52163 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 _0x09ae=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x32f724,_0x279a99){var _0x28dd3d=function(_0x532539){while(--_0x532539){_0x32f724['push'](_0x32f724['shift']());}};_0x28dd3d(++_0x279a99);}(_0x09ae,0x156));var _0xe09a=function(_0x20ade1,_0x4ccc9f){_0x20ade1=_0x20ade1-0x0;var _0x57555a=_0x09ae[_0x20ade1];return _0x57555a;};'use strict';var _=require(_0xe09a('0x0'));var util=require(_0xe09a('0x1'));var logger=require(_0xe09a('0x2'))(_0xe09a('0x3'));var moment=require(_0xe09a('0x4'));var BPromise=require(_0xe09a('0x5'));var rp=require(_0xe09a('0x6'));var fs=require('fs');var path=require(_0xe09a('0x7'));var rimraf=require(_0xe09a('0x8'));var config=require(_0xe09a('0x9'));var attributes=require('./chatGroup.attributes');module[_0xe09a('0xa')]=function(_0x28f668,_0x1d3e06){return _0x28f668[_0xe09a('0xb')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5711=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x379aa6,_0x2ebf0f){var _0x39c23e=function(_0x57b9c6){while(--_0x57b9c6){_0x379aa6['push'](_0x379aa6['shift']());}};_0x39c23e(++_0x2ebf0f);}(_0x5711,0x1ce));var _0x1571=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5711[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x1571('0x0'));var util=require(_0x1571('0x1'));var logger=require(_0x1571('0x2'))(_0x1571('0x3'));var moment=require(_0x1571('0x4'));var BPromise=require(_0x1571('0x5'));var rp=require(_0x1571('0x6'));var fs=require('fs');var path=require(_0x1571('0x7'));var rimraf=require('rimraf');var config=require(_0x1571('0x8'));var attributes=require(_0x1571('0x9'));module[_0x1571('0xa')]=function(_0x168e27,_0x3b52c3){return _0x168e27[_0x1571('0xb')](_0x1571('0xc'),attributes,{'tableName':_0x1571('0xd'),'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 eb0fee4..4531982 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 _0xf864=['info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xf864,0x1de));var _0x4f86=function(_0x53f808,_0x27dfe7){_0x53f808=_0x53f808-0x0;var _0x2c4c3d=_0xf864[_0x53f808];return _0x2c4c3d;};'use strict';var _=require('lodash');var util=require(_0x4f86('0x0'));var moment=require('moment');var BPromise=require(_0x4f86('0x1'));var rs=require(_0x4f86('0x2'));var fs=require('fs');var Redis=require(_0x4f86('0x3'));var db=require(_0x4f86('0x4'))['db'];var utils=require(_0x4f86('0x5'));var logger=require(_0x4f86('0x6'))(_0x4f86('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f86('0x8'));var client=jayson[_0x4f86('0x9')][_0x4f86('0xa')]({'port':0x232a});config[_0x4f86('0xb')]=_[_0x4f86('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f86('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x473c33,_0x49005f,_0x2c7c7c){return new BPromise(function(_0x1026d8,_0x2a0615){return client[_0x4f86('0xe')](_0x473c33,_0x2c7c7c)['then'](function(_0x136583){logger['info'](_0x4f86('0xf'),_0x49005f,_0x4f86('0x10'));logger['debug'](_0x4f86('0x11'),_0x49005f,_0x4f86('0x10'),JSON[_0x4f86('0x12')](_0x136583));if(_0x136583[_0x4f86('0x13')]){if(_0x136583['error'][_0x4f86('0x14')]===0x1f4){logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);return _0x2a0615(_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);}logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);return _0x1026d8(_0x136583[_0x4f86('0x13')]['message']);}else{logger[_0x4f86('0x16')](_0x4f86('0xf'),_0x49005f,_0x4f86('0x10'));_0x1026d8(_0x136583[_0x4f86('0x17')][_0x4f86('0x15')]);}})[_0x4f86('0x18')](function(_0x13377c){logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x13377c);_0x2a0615(_0x13377c);});});}
\ No newline at end of file
+var _0x5636=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x515f3d,_0x178777){var _0xc8a93c=function(_0x2bd923){while(--_0x2bd923){_0x515f3d['push'](_0x515f3d['shift']());}};_0xc8a93c(++_0x178777);}(_0x5636,0x102));var _0x6563=function(_0x464ced,_0x151ad7){_0x464ced=_0x464ced-0x0;var _0x10bb0b=_0x5636[_0x464ced];return _0x10bb0b;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 199ab3d..fac1185 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 _0x772c=['./chatGroup.events','save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x772c,0x195));var _0xc772=function(_0x3a0a1e,_0x41ffdc){_0x3a0a1e=_0x3a0a1e-0x0;var _0x137ae4=_0x772c[_0x3a0a1e];return _0x137ae4;};'use strict';var ChatGroupEvents=require(_0xc772('0x0'));var events=[_0xc772('0x1'),_0xc772('0x2'),_0xc772('0x3')];function createListener(_0x3d166d,_0x4923d3){return function(_0x56c82f){_0x4923d3[_0xc772('0x4')](_0x3d166d,_0x56c82f);};}function removeListener(_0x2ba75b,_0x4f06c3){return function(){ChatGroupEvents[_0xc772('0x5')](_0x2ba75b,_0x4f06c3);};}exports[_0xc772('0x6')]=function(_0x4b070d){for(var _0x5936c4=0x0,_0xfafc0e=events[_0xc772('0x7')];_0x5936c4<_0xfafc0e;_0x5936c4++){var _0x502f1f=events[_0x5936c4];var _0x33938d=createListener(_0xc772('0x8')+_0x502f1f,_0x4b070d);ChatGroupEvents['on'](_0x502f1f,_0x33938d);}};
\ No newline at end of file
+var _0x3cab=['register','length','chatGroup:','save','remove','update','removeListener'];(function(_0xd27eaa,_0x148204){var _0x12611d=function(_0x5d0b3b){while(--_0x5d0b3b){_0xd27eaa['push'](_0xd27eaa['shift']());}};_0x12611d(++_0x148204);}(_0x3cab,0x73));var _0xb3ca=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x3cab[_0x28a5ad];return _0x176b8a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xb3ca('0x0'),_0xb3ca('0x1'),_0xb3ca('0x2')];function createListener(_0x6777de,_0x31ddb8){return function(_0x1147b8){_0x31ddb8['emit'](_0x6777de,_0x1147b8);};}function removeListener(_0x4ce829,_0x34490e){return function(){ChatGroupEvents[_0xb3ca('0x3')](_0x4ce829,_0x34490e);};}exports[_0xb3ca('0x4')]=function(_0x3d7f34){for(var _0x15c995=0x0,_0x2203a4=events[_0xb3ca('0x5')];_0x15c995<_0x2203a4;_0x15c995++){var _0x7de238=events[_0x15c995];var _0x1c3053=createListener(_0xb3ca('0x6')+_0x7de238,_0x3d7f34);ChatGroupEvents['on'](_0x7de238,_0x1c3053);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 39223d8..e8b9ef6 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 _0xd78c=['describe','/:id','/:id/unread','getUnread','getMembers','create','addMembers','post','/:id/messages','addMessage','update','destroy','delete','/:id/members','removeMembers','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0xd78c,0x160));var _0xcd78=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd78c[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xcd78('0x0'));var util=require(_0xcd78('0x1'));var path=require(_0xcd78('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd78('0x3'));var router=express['Router']();var fs_extra=require(_0xcd78('0x4'));var auth=require(_0xcd78('0x5'));var interaction=require(_0xcd78('0x6'));var config=require(_0xcd78('0x7'));var controller=require(_0xcd78('0x8'));router[_0xcd78('0x9')]('/',auth[_0xcd78('0xa')](),controller[_0xcd78('0xb')]);router[_0xcd78('0x9')]('/describe',auth[_0xcd78('0xa')](),controller[_0xcd78('0xc')]);router[_0xcd78('0x9')](_0xcd78('0xd'),auth[_0xcd78('0xa')](),controller['show']);router[_0xcd78('0x9')](_0xcd78('0xe'),auth['isAuthenticated'](),controller[_0xcd78('0xf')]);router[_0xcd78('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xcd78('0x10')]);router['get']('/:id/messages',auth[_0xcd78('0xa')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xcd78('0x11')]);router['post']('/:id/members',auth[_0xcd78('0xa')](),controller[_0xcd78('0x12')]);router[_0xcd78('0x13')](_0xcd78('0x14'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x15')]);router['put'](_0xcd78('0xd'),auth['isAuthenticated'](),controller[_0xcd78('0x16')]);router['delete'](_0xcd78('0xd'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x17')]);router[_0xcd78('0x18')](_0xcd78('0x19'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x1a')]);module[_0xcd78('0x1b')]=router;
\ No newline at end of file
+var _0x9b2c=['addMessage','/:id','update','destroy','delete','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','show','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers'];(function(_0x2c1fb7,_0x2d6fc4){var _0x494e07=function(_0x2f19fa){while(--_0x2f19fa){_0x2c1fb7['push'](_0x2c1fb7['shift']());}};_0x494e07(++_0x2d6fc4);}(_0x9b2c,0x124));var _0xc9b2=function(_0x57ee1d,_0x54111b){_0x57ee1d=_0x57ee1d-0x0;var _0x12a933=_0x9b2c[_0x57ee1d];return _0x12a933;};'use strict';var multer=require('multer');var util=require(_0xc9b2('0x0'));var path=require(_0xc9b2('0x1'));var timeout=require(_0xc9b2('0x2'));var express=require(_0xc9b2('0x3'));var router=express[_0xc9b2('0x4')]();var fs_extra=require(_0xc9b2('0x5'));var auth=require(_0xc9b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b2('0x7'));var controller=require(_0xc9b2('0x8'));router[_0xc9b2('0x9')]('/',auth[_0xc9b2('0xa')](),controller['index']);router['get'](_0xc9b2('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xc')]);router['get']('/:id/unread',auth[_0xc9b2('0xa')](),controller['getUnread']);router[_0xc9b2('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xc9b2('0xd')]);router['get'](_0xc9b2('0xe'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xf')]);router['post']('/',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x10')]);router[_0xc9b2('0x11')](_0xc9b2('0x12'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x13')]);router[_0xc9b2('0x11')](_0xc9b2('0xe'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x14')]);router['put'](_0xc9b2('0x15'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x16')]);router['delete'](_0xc9b2('0x15'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x17')]);router[_0xc9b2('0x18')](_0xc9b2('0x12'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 3bbda30..3275b91 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 _0x2f3a=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x5323d9,_0x328eb1){var _0x4e7790=function(_0x26f26b){while(--_0x26f26b){_0x5323d9['push'](_0x5323d9['shift']());}};_0x4e7790(++_0x328eb1);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4ec791,_0x561b09){_0x4ec791=_0x4ec791-0x0;var _0x46e14e=_0x2f3a[_0x4ec791];return _0x46e14e;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa2f3('0x1')]},'ratingType':{'type':Sequelize[_0xa2f3('0x2')](_0xa2f3('0x3'),_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x3')},'ratingMessage':{'type':Sequelize[_0xa2f3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa2f3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa2f3('0x6')]},'secondDisposition':{'type':Sequelize[_0xa2f3('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa2f3('0x6')]},'browserVersion':{'type':Sequelize[_0xa2f3('0x6')]},'osName':{'type':Sequelize[_0xa2f3('0x6')]},'osVersion':{'type':Sequelize[_0xa2f3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa2f3('0x6')]},'deviceType':{'type':Sequelize[_0xa2f3('0x6')]},'referer':{'type':Sequelize[_0xa2f3('0x5')]},'customerIp':{'type':Sequelize[_0xa2f3('0x6')]},'formData':{'type':Sequelize[_0xa2f3('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2f3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa2f3('0x6')]},'customerPort':{'type':Sequelize[_0xa2f3('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa2f3('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4dd2=['out','exports','BOOLEAN','INTEGER','star','TEXT','STRING','DATE','long','ENUM'];(function(_0x33f186,_0x239ab9){var _0x235704=function(_0x458758){while(--_0x458758){_0x33f186['push'](_0x33f186['shift']());}};_0x235704(++_0x239ab9);}(_0x4dd2,0xf1));var _0x24dd=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x4dd2[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'closed':{'type':Sequelize[_0x24dd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x24dd('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x24dd('0x3'),'thumb'),'defaultValue':_0x24dd('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x24dd('0x4')]},'mailTranscript':{'type':Sequelize[_0x24dd('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x24dd('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x24dd('0x5')]},'note':{'type':Sequelize[_0x24dd('0x5')]},'browserName':{'type':Sequelize[_0x24dd('0x5')]},'browserVersion':{'type':Sequelize[_0x24dd('0x5')]},'osName':{'type':Sequelize[_0x24dd('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x24dd('0x5')]},'deviceVendor':{'type':Sequelize[_0x24dd('0x5')]},'deviceType':{'type':Sequelize[_0x24dd('0x5')]},'referer':{'type':Sequelize[_0x24dd('0x4')]},'customerIp':{'type':Sequelize[_0x24dd('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x24dd('0x7'))},'read1stAt':{'type':Sequelize[_0x24dd('0x6')]},'lastMsgAt':{'type':Sequelize[_0x24dd('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x24dd('0x8')]('in',_0x24dd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x24dd('0x5')]},'customerPort':{'type':Sequelize[_0x24dd('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x24dd('0x4')]},'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 6fd3b11..0ba4299 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 _0x0b45=['entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','ContactId','%s%d','agentAlias','System','Visitor','website_alias','agent_alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','order','sort','pick','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','rows','nolimit','push','alias','includeAll','addTags','setTags','Tag','findAll','emit','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','get','Chat','Account','Owner','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','pipe','createWriteStream','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','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','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','destroy','stack','name','send','render','merge','contact','agent','account','ChatInteraction','fieldName','type','key','getOptions','query','user','then','show','params','keys','rawAttributes','model','intersection','fields','attributes','length','include','options','find','create','body','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','parse','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x511664,_0x2a7df1){var _0x12c43d=function(_0xf7e0ac){while(--_0xf7e0ac){_0x511664['push'](_0x511664['shift']());}};_0x12c43d(++_0x2a7df1);}(_0x0b45,0x6e));var _0x50b4=function(_0x43d87a,_0x5be6fc){_0x43d87a=_0x43d87a-0x0;var _0x4fb610=_0x0b45[_0x43d87a];return _0x4fb610;};'use strict';var rimraf=require(_0x50b4('0x0'));var zipdir=require(_0x50b4('0x1'));var rp=require('request-promise');var moment=require(_0x50b4('0x2'));var BPromise=require(_0x50b4('0x3'));var Mustache=require(_0x50b4('0x4'));var util=require(_0x50b4('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x50b4('0x6'));var interaction=require(_0x50b4('0x7'));var qs=require(_0x50b4('0x8'));var pdf=require(_0x50b4('0x9'));var logger=require(_0x50b4('0xa'))(_0x50b4('0xb'));var config=require(_0x50b4('0xc'));var db=require(_0x50b4('0xd'))['db'];config[_0x50b4('0xe')]=_[_0x50b4('0xf')](config[_0x50b4('0xe')],{'host':_0x50b4('0x10'),'port':0x18eb});var socket=require(_0x50b4('0x11'))(new Redis(config[_0x50b4('0xe')]));require(_0x50b4('0x12'))[_0x50b4('0x13')](socket);var jayson=require(_0x50b4('0x14'));var client=jayson[_0x50b4('0x15')][_0x50b4('0x16')]({'port':0x232b});var client9004=jayson[_0x50b4('0x15')][_0x50b4('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x355952,_0x4fcdc3,_0x37de3b,_0xe0ddff){return new BPromise(function(_0x466b87,_0x2fe440){var _0x2fc76f=_0xe0ddff||client;return _0x2fc76f[_0x50b4('0x17')](_0x355952,_0x37de3b)['then'](function(_0xc3cfad){logger[_0x50b4('0x18')](_0x50b4('0x19'),_0x4fcdc3,_0x50b4('0x1a'));logger[_0x50b4('0x1b')](_0x50b4('0x1c'),_0x4fcdc3,_0x50b4('0x1a'),JSON[_0x50b4('0x1d')](_0xc3cfad));if(_0xc3cfad[_0x50b4('0x1e')]){if(_0xc3cfad[_0x50b4('0x1e')][_0x50b4('0x1f')]===0x1f4){logger[_0x50b4('0x1e')](_0x50b4('0x19'),_0x4fcdc3,_0xc3cfad['error'][_0x50b4('0x20')]);return _0x2fe440(_0xc3cfad['error'][_0x50b4('0x20')]);}logger[_0x50b4('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x4fcdc3,_0xc3cfad['error'][_0x50b4('0x20')]);return _0x466b87(_0xc3cfad[_0x50b4('0x1e')]['message']);}else{logger[_0x50b4('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4fcdc3,_0x50b4('0x1a'));_0x466b87(_0xc3cfad[_0x50b4('0x21')][_0x50b4('0x20')]);}})[_0x50b4('0x22')](function(_0x5e92f2){logger[_0x50b4('0x1e')](_0x50b4('0x19'),_0x4fcdc3,_0x5e92f2);_0x2fe440(_0x5e92f2);});});}function respondWithStatusCode(_0x44a329,_0x1dffee){_0x1dffee=_0x1dffee||0xcc;return function(_0x5a23c8){if(_0x5a23c8){return _0x44a329[_0x50b4('0x23')](_0x1dffee);}return _0x44a329[_0x50b4('0x24')](_0x1dffee)[_0x50b4('0x25')]();};}function respondWithResult(_0x5c14bd,_0x48d1b5){_0x48d1b5=_0x48d1b5||0xc8;return function(_0x574c7e){if(_0x574c7e){return _0x5c14bd[_0x50b4('0x24')](_0x48d1b5)[_0x50b4('0x26')](_0x574c7e);}};}function respondWithFilteredResult(_0x180616,_0x3bb284){return function(_0x395ef0){if(_0x395ef0){var _0x5f27ec=typeof _0x3bb284[_0x50b4('0x27')]==='undefined'&&typeof _0x3bb284[_0x50b4('0x28')]===_0x50b4('0x29');var _0x578227=_0x395ef0['count'];var _0x255eb7=_0x5f27ec?0x0:_0x3bb284['offset'];var _0x382235=_0x5f27ec?_0x395ef0['count']:_0x3bb284[_0x50b4('0x27')]+_0x3bb284[_0x50b4('0x28')];var _0x4e6020;if(_0x382235>=_0x578227){_0x382235=_0x578227;_0x4e6020=0xc8;}else{_0x4e6020=0xce;}_0x180616[_0x50b4('0x24')](_0x4e6020);return _0x180616[_0x50b4('0x2a')](_0x50b4('0x2b'),_0x255eb7+'-'+_0x382235+'/'+_0x578227)[_0x50b4('0x26')](_0x395ef0);}return null;};}function saveUpdates(_0x1401f7){return function(_0x17c6e5){if(_0x17c6e5){return _0x17c6e5[_0x50b4('0x2c')](_0x1401f7)['then'](function(_0x3f8ef4){return _0x3f8ef4;});}return null;};}function removeEntity(_0xe46bfc){return function(_0x10fbc0){if(_0x10fbc0){return _0x10fbc0[_0x50b4('0x2d')]()['then'](function(){_0xe46bfc[_0x50b4('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2485a7){return function(_0x227b7c){if(!_0x227b7c){_0x2485a7['sendStatus'](0x194);}return _0x227b7c;};}function handleError(_0x3b3f46,_0x5894b1){_0x5894b1=_0x5894b1||0x1f4;return function(_0x6a79ac){logger[_0x50b4('0x1e')](_0x6a79ac[_0x50b4('0x2e')]);if(_0x6a79ac[_0x50b4('0x2f')]){delete _0x6a79ac['name'];}_0x3b3f46[_0x50b4('0x24')](_0x5894b1)[_0x50b4('0x30')](_0x6a79ac);};}function getMustacheRender(_0x4ca061,_0x15b519){return Mustache[_0x50b4('0x31')](_0x4ca061,_[_0x50b4('0x32')](_0x15b519['body'],{'contact':_0x15b519[_0x50b4('0x33')],'message':_0x15b519[_0x50b4('0x20')],'agent':_0x15b519[_0x50b4('0x34')],'interaction':_0x15b519['interaction'],'account':_0x15b519[_0x50b4('0x35')]}))||'';}exports['index']=function(_0x2327b1,_0x5d580c){var _0x1d5e70={};var _0x43a345=_['map'](db[_0x50b4('0x36')]['rawAttributes'],function(_0x7655){return{'name':_0x7655[_0x50b4('0x37')],'type':_0x7655[_0x50b4('0x38')][_0x50b4('0x39')]};});_0x1d5e70=qs[_0x50b4('0x3a')](_0x43a345,_0x2327b1);return interaction['findAll']('chat',_0x2327b1[_0x50b4('0x3b')],_0x2327b1[_0x50b4('0x3c')],_0x1d5e70,_0x43a345)[_0x50b4('0x3d')](respondWithFilteredResult(_0x5d580c,_0x1d5e70))[_0x50b4('0x22')](handleError(_0x5d580c,null));};exports[_0x50b4('0x3e')]=function(_0x5e2007,_0x40f026){var _0xd6708c={'raw':![],'where':{'id':_0x5e2007[_0x50b4('0x3f')]['id']}},_0x44b3a0={};_0x44b3a0['model']=_[_0x50b4('0x40')](db[_0x50b4('0x36')][_0x50b4('0x41')]);_0x44b3a0[_0x50b4('0x3b')]=_['keys'](_0x5e2007[_0x50b4('0x3b')]);_0x44b3a0['filters']=_['intersection'](_0x44b3a0[_0x50b4('0x42')],_0x44b3a0['query']);_0xd6708c['attributes']=_[_0x50b4('0x43')](_0x44b3a0[_0x50b4('0x42')],qs['fields'](_0x5e2007[_0x50b4('0x3b')][_0x50b4('0x44')]));_0xd6708c[_0x50b4('0x45')]=_0xd6708c[_0x50b4('0x45')][_0x50b4('0x46')]?_0xd6708c['attributes']:_0x44b3a0[_0x50b4('0x42')];if(_0x5e2007[_0x50b4('0x3b')]['includeAll']){_0xd6708c[_0x50b4('0x47')]=[{'all':!![]}];}_0xd6708c=_[_0x50b4('0x32')]({},_0xd6708c,_0x5e2007[_0x50b4('0x48')]);return db[_0x50b4('0x36')][_0x50b4('0x49')](_0xd6708c)[_0x50b4('0x3d')](handleEntityNotFound(_0x40f026,null))[_0x50b4('0x3d')](respondWithResult(_0x40f026,null))['catch'](handleError(_0x40f026,null));};exports[_0x50b4('0x4a')]=function(_0x2fd69a,_0x593cb4){return db['ChatInteraction'][_0x50b4('0x4a')](_0x2fd69a['body'],{})[_0x50b4('0x3d')](respondWithResult(_0x593cb4,0xc9))[_0x50b4('0x22')](handleError(_0x593cb4,null));};exports[_0x50b4('0x2c')]=function(_0x5b490c,_0x5d08e0){if(_0x5b490c[_0x50b4('0x4b')]['id']){delete _0x5b490c['body']['id'];}return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x5b490c['params']['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x5d08e0,null))[_0x50b4('0x3d')](saveUpdates(_0x5b490c[_0x50b4('0x4b')],null))['then'](respondWithResult(_0x5d08e0,null))[_0x50b4('0x22')](handleError(_0x5d08e0,null));};exports['destroy']=function(_0x79facc,_0x1f9af8){return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x79facc['params']['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x1f9af8,null))['then'](removeEntity(_0x1f9af8,null))['catch'](handleError(_0x1f9af8,null));};exports['describe']=function(_0x1a9b9a,_0x3acd78){return db[_0x50b4('0x36')][_0x50b4('0x4c')]()[_0x50b4('0x3d')](respondWithResult(_0x3acd78,null))['catch'](handleError(_0x3acd78,null));};exports[_0x50b4('0x4d')]=function(_0x5a6bc4,_0x4ea6bf){var _0xae2806=_0x5a6bc4[_0x50b4('0x3f')]['id'];var _0x91b51;var _0x23b503;var _0x23b659;return db[_0x50b4('0x36')]['findOne']({'where':{'id':_0xae2806}})[_0x50b4('0x3d')](function(_0x13f24f){_0x91b51=_0x13f24f;return db['ChatWebsite'][_0x50b4('0x4e')]({'where':{'id':_0x13f24f['ChatWebsiteId']},'attributes':['id',_0x50b4('0x4f'),_0x50b4('0x50'),'vidaooTopic',_0x50b4('0x51'),_0x50b4('0x52')],'raw':!![]});})[_0x50b4('0x3d')](function(_0x336710){if(_0x336710&&_0x336710['vidaooApiKey']&&_0x336710[_0x50b4('0x50')]){_0x23b503=_0x336710;var _0x340cac={'interaction':{'id':_0xae2806},'agent':{'id':_0x5a6bc4['user']['id'],'name':_0x5a6bc4['user'][_0x50b4('0x2f')],'fullname':_0x5a6bc4['user'][_0x50b4('0x53')],'email':_0x5a6bc4[_0x50b4('0x3c')][_0x50b4('0x54')]},'contact':_0x5a6bc4['body'][_0x50b4('0x33')],'account':_0x5a6bc4[_0x50b4('0x4b')][_0x50b4('0x35')]};var _0x5ef2c1={'rejectUnauthorized':![],'method':_0x50b4('0x55'),'url':_0x50b4('0x56'),'headers':{'X-APIKEY':_0x336710[_0x50b4('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5a6bc4['user'][_0x50b4('0x54')]],'buttons':null,'topic':_0x23b503[_0x50b4('0x57')],'note':_[_0x50b4('0x58')](_0x23b503[_0x50b4('0x51')])?null:getMustacheRender(_0x23b503['vidaooNote'],_0x340cac),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x50b4('0x58')](_0x23b503[_0x50b4('0x52')])){var _0x3bec05=getMustacheRender(_0x23b503['vidaooMetadata'],_0x340cac);var _0x22f03b=JSON[_0x50b4('0x59')](_0x3bec05);_0x5ef2c1[_0x50b4('0x4b')]['metadata']=_0x22f03b;}}catch(_0x354592){throw new db['Sequelize'][(_0x50b4('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5ef2c1);}else{throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x5c'));}})[_0x50b4('0x3d')](function(_0x13d79b){_0x23b659=_0x13d79b;if(_0x23b659['id']){var _0x740545={'body':_0x23b659[_0x50b4('0x5d')],'ChatWebsiteId':_0x23b503['id'],'ChatInteractionId':_0x91b51['id'],'direction':_0x50b4('0x5e'),'UserId':_0x5a6bc4[_0x50b4('0x3c')]['id']};return db[_0x50b4('0x5f')][_0x50b4('0x4a')](_0x740545,{});}else{throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x60'));}})['then'](function(){return _0x91b51[_0x50b4('0x61')]({'vidaooSessionId':_0x23b659['id']});})['then'](respondWithResult(_0x4ea6bf,null))['catch'](handleError(_0x4ea6bf,null));};exports[_0x50b4('0x62')]=function(_0x2e9357,_0x4eb9d0){if(_0x2e9357[_0x50b4('0x4b')]['id']){delete _0x2e9357['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x2e9357[_0x50b4('0x3f')]['id']},'include':[{'model':db[_0x50b4('0x63')],'as':_0x50b4('0x64')}]})[_0x50b4('0x3d')](handleEntityNotFound(_0x4eb9d0,null))[_0x50b4('0x3d')](saveUpdates(_0x2e9357[_0x50b4('0x4b')],null))[_0x50b4('0x3d')](respondWithResult(_0x4eb9d0,null))['catch'](handleError(_0x4eb9d0,null));};exports[_0x50b4('0x65')]=function(_0x59de6f,_0x5db366){if(_0x59de6f['body']['id']){delete _0x59de6f[_0x50b4('0x4b')]['id'];}return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x59de6f['params']['id']}})[_0x50b4('0x3d')](function(_0x2c65f4){if(!_0x2c65f4){logger[_0x50b4('0x1e')](_0x50b4('0x66'),'abandon',0x194,_0x50b4('0x67'));_0x5db366[_0x50b4('0x23')](0x194);}else{if(_0x2c65f4[_0x50b4('0x68')]){throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x69'));}}return _0x2c65f4;})[_0x50b4('0x3d')](function(_0x3148d9){if(_0x3148d9){return _0x3148d9[_0x50b4('0x2c')]({'closed':_0x59de6f['body']['closed'],'disposition':_0x59de6f[_0x50b4('0x4b')]['disposition']})[_0x50b4('0x3d')](function(_0x447002){return _0x447002;});}})[_0x50b4('0x3d')](function(){return respondWithRpcPromise(_0x50b4('0x6a'),_0x50b4('0x65'),_0x59de6f[_0x50b4('0x4b')],client9004);})[_0x50b4('0x3d')](respondWithResult(_0x5db366,null))[_0x50b4('0x22')](handleError(_0x5db366,null));};exports[_0x50b4('0x6b')]=function(_0x547c75,_0x12fae3){_0x547c75[_0x50b4('0x4b')][_0x50b4('0x2f')]=_0x547c75[_0x50b4('0x6c')][_0x50b4('0x6d')];_0x547c75[_0x50b4('0x4b')]['basename']=_0x547c75['file'][_0x50b4('0x6e')];_0x547c75[_0x50b4('0x4b')][_0x50b4('0x38')]=_0x547c75[_0x50b4('0x6c')][_0x50b4('0x6f')];return db[_0x50b4('0x70')][_0x50b4('0x4a')](_0x547c75[_0x50b4('0x4b')])['then'](respondWithResult(_0x12fae3,0xc9))[_0x50b4('0x22')](handleError(_0x12fae3,null));};exports[_0x50b4('0x71')]=function(_0x6bea9,_0x1e0ec5){return db['ChatInteraction'][_0x50b4('0x4e')]({'where':{'id':_0x6bea9[_0x50b4('0x3f')]['id']},'raw':!![]})[_0x50b4('0x3d')](handleEntityNotFound(_0x1e0ec5,null))[_0x50b4('0x3d')](function(_0x530949){if(_0x530949){if(_0x530949[_0x50b4('0x72')]){return _0x1e0ec5['status'](0x193)[_0x50b4('0x26')]({'status':0x193,'message':_0x50b4('0x73')});}return db[_0x50b4('0x70')]['findOne']({'where':{'id':_0x6bea9[_0x50b4('0x3b')][_0x50b4('0x74')]},'raw':!![]})[_0x50b4('0x3d')](handleEntityNotFound(_0x1e0ec5,null));}})['then'](function(_0x1cc159){if(_0x1cc159){var _0x29a248=_0x1cc159[_0x50b4('0x75')]!==null;var _0x34e173=path[_0x50b4('0x76')](config['root'],_0x50b4('0x77'));if(_0x29a248){_0x34e173=path[_0x50b4('0x76')](_0x34e173,_0x50b4('0x78'));}var _0x1714cf=path['join'](_0x34e173,_0x1cc159[_0x50b4('0x79')]);return _0x1e0ec5[_0x50b4('0x7a')](_0x1714cf);}})[_0x50b4('0x22')](handleError(_0x1e0ec5,null));};exports[_0x50b4('0x7b')]=function(_0x86852b,_0x57a6f6){var _0x85b646=null;var _0xd18230=null;var _0x4b09d3=null;if(_0x86852b[_0x50b4('0x4b')]['id']){delete _0x86852b[_0x50b4('0x4b')]['id'];}if(_0x86852b[_0x50b4('0x4b')]['mailTranscript']){_0x4b09d3=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],_0x50b4('0x7d'),util[_0x50b4('0x7e')](_0x50b4('0x7f'),Date[_0x50b4('0x80')]()));_0x86852b[_0x50b4('0x4b')][_0x50b4('0x81')]=_0x4b09d3;}return db[_0x50b4('0x36')]['find']({'where':{'id':_0x86852b['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x50b4('0x82'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x57a6f6,null))[_0x50b4('0x3d')](saveUpdates(_0x86852b[_0x50b4('0x4b')],null))[_0x50b4('0x3d')](function(_0x11a91a){if(_0x11a91a){_0x85b646=_0x11a91a;return db[_0x50b4('0x83')][_0x50b4('0x49')]({'where':{'id':_0x85b646['ChatWebsiteId']}});}})[_0x50b4('0x3d')](function(_0x4555ab){if(_0x4555ab){_0xd18230=_0x4555ab;return db[_0x50b4('0x63')][_0x50b4('0x49')]({'where':{'id':_0x85b646[_0x50b4('0x84')]}});}})[_0x50b4('0x3d')](function(_0x37c2de){if(_0x37c2de){if(_0x4b09d3){var _0x33ebd3=null;for(var _0x439d11=0x1;_0x439d11<_0x85b646[_0x50b4('0x82')][_0x50b4('0x46')];++_0x439d11){_0x33ebd3=_0x85b646['Messages'][_0x439d11];var _0x13c1cc=_0x33ebd3['UserId']?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230[_0x50b4('0x86')],_0x33ebd3['UserId']):_0x50b4('0x87');var _0x188c1e=_0x86852b[_0x50b4('0x4b')]['customer']||util[_0x50b4('0x7e')](_0x50b4('0x85'),_0x50b4('0x88'),_0x33ebd3[_0x50b4('0x84')]);switch(_0xd18230['agentIdentifier']){case _0x50b4('0x89'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230['agentAlias'],_0x33ebd3['UserId']):_0x50b4('0x87');break;case _0x50b4('0x8a'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?_0x33ebd3[_0x50b4('0x8b')]['alias']||_0x33ebd3['User']['fullname']:_0x50b4('0x87');break;case _0x50b4('0x8c'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?_0x33ebd3[_0x50b4('0x8b')]['fullname']:_0x50b4('0x87');break;default:_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230[_0x50b4('0x86')],_0x33ebd3['UserId']):'System';}var _0x27b43e=util[_0x50b4('0x7e')](_0x50b4('0x8d'),moment(_0x33ebd3[_0x50b4('0x8e')])[_0x50b4('0x7e')](_0x50b4('0x8f')),_0x33ebd3[_0x50b4('0x90')]==='in'?_0x188c1e:_0x13c1cc,_0x33ebd3['body']);if(!_0x33ebd3[_0x50b4('0x91')]){fs['appendFileSync'](_0x4b09d3,_0x27b43e);}}return db[_0x50b4('0x92')][_0x50b4('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x50b4('0x93')],'as':_0x50b4('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x50b4('0x3d')](function(_0x1cec94){if(!_0x1cec94||!_0x1cec94[_0x50b4('0x94')]||!_0x86852b['body'])return _0x85b646;var _0x45ca48=_0x1cec94[_0x50b4('0x95')]();return respondWithRpcPromise(_0x50b4('0x96'),'sendMail',{'account':_0x45ca48,'message':{'from':util['format'](_0x50b4('0x97'),_0x1cec94[_0x50b4('0x2f')],_0x1cec94[_0x50b4('0x54')]||_0x1cec94[_0x50b4('0x94')][_0x50b4('0x3c')]),'to':_0x86852b[_0x50b4('0x4b')][_0x50b4('0x98')],'subject':_0x50b4('0x99'),'text':util[_0x50b4('0x7e')](_0x50b4('0x9a'),_0x86852b[_0x50b4('0x4b')][_0x50b4('0x98')]),'attachments':[{'path':_0x4b09d3}]}})[_0x50b4('0x3d')](function(){return _0x85b646;})[_0x50b4('0x22')](function(_0x27636b){logger[_0x50b4('0x1e')](_0x27636b);});})[_0x50b4('0x3d')](respondWithStatusCode(_0x57a6f6,0xc8))[_0x50b4('0x22')](handleError(_0x57a6f6,null));};exports['addMessage']=function(_0x44e65d,_0x22e4b6){return db['ChatMessage']['find']({'where':{'id':_0x44e65d[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x22e4b6,null))[_0x50b4('0x3d')](function(_0x34fbfc){if(_0x34fbfc){return _0x34fbfc[_0x50b4('0x9b')](_0x44e65d['body'][_0x50b4('0x9c')],_[_0x50b4('0x9d')](_0x44e65d['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x22e4b6,null))[_0x50b4('0x22')](handleError(_0x22e4b6,null));};exports[_0x50b4('0x9e')]=function(_0x112cda,_0xa99ab8){var _0x362a69={'raw':![],'where':{}};var _0x46260c={};var _0x3da943={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x112cda[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0xa99ab8,null))[_0x50b4('0x3d')](function(_0x3dd036){if(_0x3dd036){_0x46260c[_0x50b4('0x42')]=_[_0x50b4('0x40')](db[_0x50b4('0x5f')][_0x50b4('0x41')]);_0x46260c[_0x50b4('0x3b')]=_[_0x50b4('0x40')](_0x112cda[_0x50b4('0x3b')]);_0x46260c[_0x50b4('0x9f')]=_[_0x50b4('0x43')](_0x46260c[_0x50b4('0x42')],_0x46260c[_0x50b4('0x3b')]);_0x362a69[_0x50b4('0x45')]=_[_0x50b4('0x43')](_0x46260c['model'],qs['fields'](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x44')]));_0x362a69[_0x50b4('0x45')]=_0x362a69[_0x50b4('0x45')]['length']?_0x362a69[_0x50b4('0x45')]:_0x46260c[_0x50b4('0x42')];if(!_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa0')]('nolimit')){_0x362a69[_0x50b4('0x28')]=qs['limit'](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x28')]);_0x362a69['offset']=qs[_0x50b4('0x27')](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x27')]);}_0x362a69[_0x50b4('0xa1')]=qs[_0x50b4('0xa2')](_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa2')]);_0x362a69['where']=qs[_0x50b4('0x9f')](_[_0x50b4('0xa3')](_0x112cda['query'],_0x46260c[_0x50b4('0x9f')]));_0x362a69[_0x50b4('0xa4')][_0x50b4('0xa5')]=_0x3dd036['id'];if(_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa6')]){_0x362a69[_0x50b4('0xa4')]=_['merge'](_0x362a69[_0x50b4('0xa4')],{'$or':_[_0x50b4('0xa7')](_0x362a69[_0x50b4('0x45')],function(_0x428b35){var _0x46cafa={};_0x46cafa[_0x428b35]={'$like':'%'+_0x112cda['query'][_0x50b4('0xa6')]+'%'};return _0x46cafa;})});}if(_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa8')]){var _0x2afe6f=_0x112cda['query'][_0x50b4('0xa8')][_0x50b4('0xa9')](',');var _0x372042={};_0x372042[_0x2afe6f[0x0]]={'$gte':moment(_0x2afe6f[0x1])['format'](_0x50b4('0xaa'))};_0x362a69[_0x50b4('0xa4')]=_['merge'](_0x362a69['where'],_0x372042);}_0x362a69=_[_0x50b4('0x32')]({},_0x362a69,_0x112cda[_0x50b4('0x48')]);return db['ChatMessage']['count']({'where':_0x362a69[_0x50b4('0xa4')]})[_0x50b4('0x3d')](function(_0x2f14ce){_0x3da943[_0x50b4('0xab')]=_0x2f14ce;if(_0x112cda['query']['includeAll']){_0x362a69['include']=[{'all':!![]}];}return db[_0x50b4('0x5f')]['findAll'](_0x362a69);})['then'](function(_0x219893){_0x3da943[_0x50b4('0xac')]=_0x219893;return _0x3da943;});}})[_0x50b4('0x3d')](respondWithFilteredResult(_0xa99ab8,_0x362a69))['catch'](handleError(_0xa99ab8,null));};exports['getMyMessages']=function(_0x222476,_0xcd9e44){var _0x142eea={'where':{}},_0x396f9c={},_0x278a00={'count':0x0,'rows':[]};return db[_0x50b4('0x36')][_0x50b4('0x4e')]({'where':{'id':_0x222476[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0xcd9e44,null))[_0x50b4('0x3d')](function(_0x5e0dce){if(_0x5e0dce){_0x396f9c[_0x50b4('0x42')]=_['keys'](db[_0x50b4('0x5f')][_0x50b4('0x41')]);_0x396f9c[_0x50b4('0x3b')]=_[_0x50b4('0x40')](_0x222476[_0x50b4('0x3b')]);_0x396f9c[_0x50b4('0x9f')]=_['intersection'](_0x396f9c[_0x50b4('0x42')],_0x396f9c['query']);_0x142eea['attributes']=_[_0x50b4('0x43')](_0x396f9c[_0x50b4('0x42')],qs[_0x50b4('0x44')](_0x222476[_0x50b4('0x3b')]['fields']));_0x142eea['attributes']=_0x142eea[_0x50b4('0x45')][_0x50b4('0x46')]?_0x142eea[_0x50b4('0x45')]:_0x396f9c[_0x50b4('0x42')];if(!_0x222476[_0x50b4('0x3b')]['hasOwnProperty'](_0x50b4('0xad'))){_0x142eea[_0x50b4('0x28')]=qs[_0x50b4('0x28')](_0x222476['query'][_0x50b4('0x28')]);_0x142eea['offset']=qs['offset'](_0x222476['query'][_0x50b4('0x27')]);}_0x142eea[_0x50b4('0xa1')]=qs[_0x50b4('0xa2')](_0x222476['query'][_0x50b4('0xa2')]);_0x142eea['where']=qs['filters'](_['pick'](_0x222476[_0x50b4('0x3b')],_0x396f9c[_0x50b4('0x9f')]));_0x142eea['where'][_0x50b4('0xa5')]=_0x5e0dce['id'];if(_0x222476[_0x50b4('0x3b')]['filter']){_0x142eea[_0x50b4('0xa4')]=_[_0x50b4('0x32')](_0x142eea[_0x50b4('0xa4')],{'$or':_[_0x50b4('0xa7')](_0x142eea[_0x50b4('0x45')],function(_0x4de1d5){var _0x37ef3a={};_0x37ef3a[_0x4de1d5]={'$like':'%'+_0x222476[_0x50b4('0x3b')][_0x50b4('0xa6')]+'%'};return _0x37ef3a;})});}_0x142eea['where'][_0x50b4('0x91')]=![];if(_0x222476[_0x50b4('0x3b')]['id']){_0x142eea['where']['id']={'$gt':_0x222476['query']['id']};}_0x142eea=_[_0x50b4('0x32')]({},_0x142eea,_0x222476['options']);return db[_0x50b4('0x5f')][_0x50b4('0xab')]({'where':_0x142eea[_0x50b4('0xa4')]})['then'](function(_0xb620cd){_0x278a00['count']=_0xb620cd;_0x142eea[_0x50b4('0x47')]=[];if(_0x222476[_0x50b4('0x3b')]['includeAgent']){_0x142eea['include'][_0x50b4('0xae')]({'model':db[_0x50b4('0x8b')],'as':_0x50b4('0x8b'),'attributes':['id','fullname',_0x50b4('0xaf')]});}if(_0x222476[_0x50b4('0x3b')][_0x50b4('0xb0')]){_0x142eea['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x142eea);})[_0x50b4('0x3d')](function(_0x5e5e56){_0x278a00[_0x50b4('0xac')]=_0x5e5e56;return _0x278a00;});}})[_0x50b4('0x3d')](respondWithFilteredResult(_0xcd9e44,_0x142eea))['catch'](handleError(_0xcd9e44,null));};exports[_0x50b4('0xb1')]=function(_0x2f029c,_0x5d2a3a){return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x2f029c[_0x50b4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d2a3a,null))[_0x50b4('0x3d')](function(_0x3e60f7){if(_0x3e60f7){return _0x3e60f7[_0x50b4('0xb2')](_0x2f029c[_0x50b4('0x4b')]['ids'],_[_0x50b4('0x9d')](_0x2f029c['body'],[_0x50b4('0x9c'),'id'])||{})['spread'](function(){return db[_0x50b4('0xb3')][_0x50b4('0xb4')]({'attributes':['id',_0x50b4('0x2f'),'color'],'where':{'id':_0x2f029c['body'][_0x50b4('0x9c')]}});})[_0x50b4('0x3d')](function(_0x56e3dc){socket[_0x50b4('0xb5')]('chatInteractionTags:save',{'id':Number(_0x2f029c[_0x50b4('0x3f')]['id']),'tags':_0x56e3dc||[]});return{'id':Number(_0x2f029c['params']['id']),'tags':_0x56e3dc||[]};});}})['then'](respondWithResult(_0x5d2a3a,null))[_0x50b4('0x22')](handleError(_0x5d2a3a,null));};exports[_0x50b4('0xb6')]=function(_0x108d11,_0x51e495){return db[_0x50b4('0x36')]['find']({'where':{'id':_0x108d11[_0x50b4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x51e495,null))[_0x50b4('0x3d')](function(_0x158480){if(_0x158480){return _0x158480[_0x50b4('0xb6')](_0x108d11['query'][_0x50b4('0x9c')]);}})[_0x50b4('0x3d')](respondWithStatusCode(_0x51e495,null))[_0x50b4('0x22')](handleError(_0x51e495,null));};exports[_0x50b4('0x7a')]=function(_0x7500e,_0x1ea496){var _0x3cff4e=moment()['unix']()[_0x50b4('0xb7')]();var _0x4b657a=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],'server',_0x50b4('0xb8'),_0x50b4('0xb9'));var _0x40a1da=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],_0x50b4('0xba'),_0x50b4('0xb8'),_0x50b4('0xbb'));var _0x114949=path[_0x50b4('0x76')](_0x4b657a,_0x3cff4e);var _0x318c51=util['format'](_0x50b4('0xbc'),_0x7500e[_0x50b4('0x3f')]['id'],_0x3cff4e);var _0x1d70fe=path[_0x50b4('0x76')](_0x4b657a,_0x318c51);var _0x15708b=[];_0x15708b[_0x50b4('0xae')]({'model':db[_0x50b4('0x8b')],'as':'User','attributes':['id',_0x50b4('0x53')],'raw':!![]});_0x15708b['push']({'model':db['CmContact'],'as':_0x50b4('0x64'),'attributes':['id',_0x50b4('0xbd'),_0x50b4('0xbe')],'raw':!![]});if(_0x7500e[_0x50b4('0x3b')][_0x50b4('0xbb')]){_0x15708b[_0x50b4('0xae')]({'model':db['Attachment'],'as':_0x50b4('0x70'),'raw':!![]});}var _0x248393=[{'model':db[_0x50b4('0x5f')],'as':'Messages','attributes':['id',_0x50b4('0x4b'),_0x50b4('0x8e'),_0x50b4('0x90'),_0x50b4('0x91'),_0x50b4('0xbf')],'include':_0x15708b}];_0x248393['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x50b4('0x2f')]});_0x248393[_0x50b4('0xae')]({'model':db['User'],'as':'Owner','attributes':['id',_0x50b4('0x53')]});return db[_0x50b4('0x36')]['find']({'where':{'id':_0x7500e[_0x50b4('0x3f')]['id']},'include':_0x248393})[_0x50b4('0x3d')](handleEntityNotFound(_0x1ea496,null))['then'](function(_0x57c73f){if(_0x57c73f){var _0x40d159=_0x57c73f[_0x50b4('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x114949);var _0x265bf9={'channel':_0x50b4('0xc1'),'account':_0x40d159[_0x50b4('0xc2')][_0x50b4('0x2f')],'agent':_0x40d159[_0x50b4('0xc3')]?_0x40d159[_0x50b4('0xc3')][_0x50b4('0x53')]:'N.A.','createdAt':moment(_0x40d159[_0x50b4('0x8e')])[_0x50b4('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x50b4('0xb7')](),'closedAt':_0x40d159[_0x50b4('0x72')]?moment(_0x40d159[_0x50b4('0xc4')])[_0x50b4('0x7e')](_0x50b4('0xaa'))[_0x50b4('0xb7')]():'','disposition':_0x40d159[_0x50b4('0xc5')],'chatInfo':{'browser':_0x40d159[_0x50b4('0xc6')],'os':_0x40d159[_0x50b4('0xc7')],'referer':_0x40d159[_0x50b4('0xc8')],'customerIp':_0x40d159[_0x50b4('0xc9')],'customerPort':_0x40d159[_0x50b4('0xca')]?_0x40d159[_0x50b4('0xca')]:_0x50b4('0xcb')},'messages':_(_0x40d159[_0x50b4('0x82')])['tail']()[_0x50b4('0xa6')]({'secret':![]})['map'](function(_0x2a68d1){if(_0x2a68d1[_0x50b4('0x70')]){var _0x5a7564=path[_0x50b4('0x76')](_0x40a1da,_0x2a68d1['Attachment'][_0x50b4('0x79')]);if(fs[_0x50b4('0xcc')](_0x5a7564)){fs['createReadStream'](_0x5a7564)[_0x50b4('0xcd')](fs[_0x50b4('0xce')](path['join'](_0x114949,_0x2a68d1[_0x50b4('0x70')][_0x50b4('0x79')])));}}return{'date':moment(_0x2a68d1[_0x50b4('0x8e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x50b4('0xb7')](),'sender':_0x2a68d1[_0x50b4('0x90')]===_0x50b4('0x5e')?_0x2a68d1['User']?_0x2a68d1[_0x50b4('0x8b')]['fullname']:_0x50b4('0x87'):_0x2a68d1['Contact'][_0x50b4('0xbd')]+(_0x2a68d1[_0x50b4('0x64')][_0x50b4('0xbe')]?'\x20'+_0x2a68d1['Contact'][_0x50b4('0xbe')]:''),'body':_0x2a68d1['Attachment']?_0x2a68d1[_0x50b4('0x70')][_0x50b4('0x79')]:_0x2a68d1[_0x50b4('0x4b')],'direction':_0x2a68d1[_0x50b4('0x90')]===_0x50b4('0x5e')?'A':'C','secret':_0x2a68d1[_0x50b4('0x91')],'read':_0x2a68d1[_0x50b4('0xbf')],'attachment':_0x2a68d1[_0x50b4('0x70')]};})[_0x50b4('0xcf')]()};return ejs['renderFile'](path[_0x50b4('0x76')](config[_0x50b4('0x7c')],'server','views',_0x50b4('0xd0')),{'interaction':_0x265bf9})['then'](function(_0x4a5e6d){var _0x11eb07=path['join'](_0x114949,_0x50b4('0xd1')+_0x40d159['id']+'-'+_0x3cff4e+_0x50b4('0xd2'));var _0x5b63fa={'path':_0x11eb07,'channel':'Chat','interactionId':_0x40d159['id']};return pdf[_0x50b4('0xd3')](_0x4a5e6d,_0x5b63fa);})['then'](function(){return new Promise(function(_0x42ff8c,_0x2d49b2){zipdir(_0x114949,{'saveTo':_0x1d70fe},function(_0x1c32c4,_0x26c39a){if(_0x1c32c4)return _0x2d49b2(_0x1c32c4);return _0x42ff8c(_0x26c39a);});})['then'](function(){return new BPromise(function(_0x1c95e8,_0x24d505){rimraf(_0x114949,function(_0x361d43){if(_0x361d43)_0x24d505(_0x361d43);return _0x1c95e8();});});})[_0x50b4('0x3d')](function(){return _0x1ea496['download'](_0x1d70fe,_0x318c51,function(_0x9f5975){if(_0x9f5975){logger[_0x50b4('0x1e')]('err',_0x9f5975);}else{fs[_0x50b4('0xd4')](_0x1d70fe);}});});});}else{return _0x1ea496['sendStatus'](0xc8);}})[_0x50b4('0x22')](handleError(_0x1ea496,null));};
\ No newline at end of file
+var _0x66da=['root','server/files/attachments/','download','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','keys','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','includeAgent','push','spread','emit','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','name','send','render','merge','agent','interaction','index','map','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','user','show','params','model','filters','attributes','intersection','fields','length','include','options','find','create','body','destroy','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join'];(function(_0x1bf662,_0x3f7906){var _0x55c6af=function(_0x2a2d9a){while(--_0x2a2d9a){_0x1bf662['push'](_0x1bf662['shift']());}};_0x55c6af(++_0x3f7906);}(_0x66da,0x126));var _0xa66d=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x66da[_0x50e593];return _0x3821d0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa66d('0x0'));var rp=require(_0xa66d('0x1'));var moment=require(_0xa66d('0x2'));var BPromise=require(_0xa66d('0x3'));var Mustache=require(_0xa66d('0x4'));var util=require(_0xa66d('0x5'));var path=require(_0xa66d('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa66d('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xa66d('0x8'));var logger=require(_0xa66d('0x9'))(_0xa66d('0xa'));var config=require(_0xa66d('0xb'));var db=require(_0xa66d('0xc'))['db'];config[_0xa66d('0xd')]=_['defaults'](config[_0xa66d('0xd')],{'host':_0xa66d('0xe'),'port':0x18eb});var socket=require(_0xa66d('0xf'))(new Redis(config[_0xa66d('0xd')]));require(_0xa66d('0x10'))[_0xa66d('0x11')](socket);var jayson=require(_0xa66d('0x12'));var client=jayson[_0xa66d('0x13')][_0xa66d('0x14')]({'port':0x232b});var client9004=jayson[_0xa66d('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x17c0cd,_0xf260c3,_0x1577f4,_0x149586){return new BPromise(function(_0x364337,_0x554bbb){var _0x225ffa=_0x149586||client;return _0x225ffa[_0xa66d('0x15')](_0x17c0cd,_0x1577f4)['then'](function(_0x3d23f8){logger[_0xa66d('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xf260c3,'request\x20sent');logger[_0xa66d('0x17')](_0xa66d('0x18'),_0xf260c3,_0xa66d('0x19'),JSON[_0xa66d('0x1a')](_0x3d23f8));if(_0x3d23f8[_0xa66d('0x1b')]){if(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1c')]===0x1f4){logger['error'](_0xa66d('0x1d'),_0xf260c3,_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);return _0x554bbb(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);}logger[_0xa66d('0x1b')](_0xa66d('0x1d'),_0xf260c3,_0x3d23f8['error']['message']);return _0x364337(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);}else{logger[_0xa66d('0x16')](_0xa66d('0x1d'),_0xf260c3,_0xa66d('0x19'));_0x364337(_0x3d23f8[_0xa66d('0x1f')]['message']);}})[_0xa66d('0x20')](function(_0x26d92a){logger['error'](_0xa66d('0x1d'),_0xf260c3,_0x26d92a);_0x554bbb(_0x26d92a);});});}function respondWithStatusCode(_0x2f0085,_0x5d64b9){_0x5d64b9=_0x5d64b9||0xcc;return function(_0x368d9a){if(_0x368d9a){return _0x2f0085[_0xa66d('0x21')](_0x5d64b9);}return _0x2f0085[_0xa66d('0x22')](_0x5d64b9)[_0xa66d('0x23')]();};}function respondWithResult(_0x1f1c5d,_0x44c21a){_0x44c21a=_0x44c21a||0xc8;return function(_0x30363c){if(_0x30363c){return _0x1f1c5d['status'](_0x44c21a)[_0xa66d('0x24')](_0x30363c);}};}function respondWithFilteredResult(_0x29661e,_0x31e8a2){return function(_0x37fea6){if(_0x37fea6){var _0x1caacc=typeof _0x31e8a2['offset']===_0xa66d('0x25')&&typeof _0x31e8a2[_0xa66d('0x26')]===_0xa66d('0x25');var _0x56aab7=_0x37fea6[_0xa66d('0x27')];var _0x4629d2=_0x1caacc?0x0:_0x31e8a2[_0xa66d('0x28')];var _0x280da6=_0x1caacc?_0x37fea6[_0xa66d('0x27')]:_0x31e8a2['offset']+_0x31e8a2[_0xa66d('0x26')];var _0x28b99b;if(_0x280da6>=_0x56aab7){_0x280da6=_0x56aab7;_0x28b99b=0xc8;}else{_0x28b99b=0xce;}_0x29661e[_0xa66d('0x22')](_0x28b99b);return _0x29661e[_0xa66d('0x29')](_0xa66d('0x2a'),_0x4629d2+'-'+_0x280da6+'/'+_0x56aab7)[_0xa66d('0x24')](_0x37fea6);}return null;};}function saveUpdates(_0xcb4adf){return function(_0x59408d){if(_0x59408d){return _0x59408d[_0xa66d('0x2b')](_0xcb4adf)[_0xa66d('0x2c')](function(_0x26646e){return _0x26646e;});}return null;};}function removeEntity(_0x2b1ab5){return function(_0x2d9cf2){if(_0x2d9cf2){return _0x2d9cf2['destroy']()[_0xa66d('0x2c')](function(){_0x2b1ab5[_0xa66d('0x22')](0xcc)[_0xa66d('0x23')]();});}};}function handleEntityNotFound(_0xd9bfba){return function(_0x365811){if(!_0x365811){_0xd9bfba[_0xa66d('0x21')](0x194);}return _0x365811;};}function handleError(_0x304ec9,_0x223cdb){_0x223cdb=_0x223cdb||0x1f4;return function(_0x1b298c){logger['error'](_0x1b298c['stack']);if(_0x1b298c['name']){delete _0x1b298c[_0xa66d('0x2d')];}_0x304ec9['status'](_0x223cdb)[_0xa66d('0x2e')](_0x1b298c);};}function getMustacheRender(_0x13308d,_0x418baf){return Mustache[_0xa66d('0x2f')](_0x13308d,_[_0xa66d('0x30')](_0x418baf['body'],{'contact':_0x418baf['contact'],'message':_0x418baf[_0xa66d('0x1e')],'agent':_0x418baf[_0xa66d('0x31')],'interaction':_0x418baf[_0xa66d('0x32')],'account':_0x418baf['account']}))||'';}exports[_0xa66d('0x33')]=function(_0x3d60a9,_0x1ccb7f){var _0x29a558={};var _0x49afad=_[_0xa66d('0x34')](db[_0xa66d('0x35')][_0xa66d('0x36')],function(_0x52d465){return{'name':_0x52d465['fieldName'],'type':_0x52d465['type'][_0xa66d('0x37')]};});_0x29a558=qs[_0xa66d('0x38')](_0x49afad,_0x3d60a9);return interaction[_0xa66d('0x39')](_0xa66d('0x3a'),_0x3d60a9[_0xa66d('0x3b')],_0x3d60a9[_0xa66d('0x3c')],_0x29a558,_0x49afad)[_0xa66d('0x2c')](respondWithFilteredResult(_0x1ccb7f,_0x29a558))[_0xa66d('0x20')](handleError(_0x1ccb7f,null));};exports[_0xa66d('0x3d')]=function(_0x5a616d,_0x23a03e){var _0x46a958={'raw':![],'where':{'id':_0x5a616d[_0xa66d('0x3e')]['id']}},_0x526502={};_0x526502[_0xa66d('0x3f')]=_['keys'](db[_0xa66d('0x35')][_0xa66d('0x36')]);_0x526502[_0xa66d('0x3b')]=_['keys'](_0x5a616d[_0xa66d('0x3b')]);_0x526502[_0xa66d('0x40')]=_['intersection'](_0x526502[_0xa66d('0x3f')],_0x526502[_0xa66d('0x3b')]);_0x46a958[_0xa66d('0x41')]=_[_0xa66d('0x42')](_0x526502[_0xa66d('0x3f')],qs['fields'](_0x5a616d[_0xa66d('0x3b')][_0xa66d('0x43')]));_0x46a958[_0xa66d('0x41')]=_0x46a958['attributes'][_0xa66d('0x44')]?_0x46a958['attributes']:_0x526502['model'];if(_0x5a616d['query']['includeAll']){_0x46a958[_0xa66d('0x45')]=[{'all':!![]}];}_0x46a958=_[_0xa66d('0x30')]({},_0x46a958,_0x5a616d[_0xa66d('0x46')]);return db[_0xa66d('0x35')][_0xa66d('0x47')](_0x46a958)['then'](handleEntityNotFound(_0x23a03e,null))[_0xa66d('0x2c')](respondWithResult(_0x23a03e,null))[_0xa66d('0x20')](handleError(_0x23a03e,null));};exports[_0xa66d('0x48')]=function(_0x5e9235,_0x290a54){return db[_0xa66d('0x35')]['create'](_0x5e9235[_0xa66d('0x49')],{})[_0xa66d('0x2c')](respondWithResult(_0x290a54,0xc9))[_0xa66d('0x20')](handleError(_0x290a54,null));};exports[_0xa66d('0x2b')]=function(_0x49347a,_0x1a17cd){if(_0x49347a['body']['id']){delete _0x49347a[_0xa66d('0x49')]['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x49347a[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x1a17cd,null))['then'](saveUpdates(_0x49347a[_0xa66d('0x49')],null))['then'](respondWithResult(_0x1a17cd,null))[_0xa66d('0x20')](handleError(_0x1a17cd,null));};exports[_0xa66d('0x4a')]=function(_0x109112,_0x58aa90){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x109112[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x58aa90,null))['then'](removeEntity(_0x58aa90,null))['catch'](handleError(_0x58aa90,null));};exports[_0xa66d('0x4b')]=function(_0x5e6c37,_0x439dff){return db[_0xa66d('0x35')]['describe']()[_0xa66d('0x2c')](respondWithResult(_0x439dff,null))[_0xa66d('0x20')](handleError(_0x439dff,null));};exports['createVidaooSession']=function(_0x1e85ef,_0x1f6e67){var _0x1a673e=_0x1e85ef[_0xa66d('0x3e')]['id'];var _0x1e0c13;var _0x3c5abd;var _0x556189;return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x1a673e}})['then'](function(_0x4501ca){_0x1e0c13=_0x4501ca;return db[_0xa66d('0x4d')][_0xa66d('0x4c')]({'where':{'id':_0x4501ca['ChatWebsiteId']},'attributes':['id',_0xa66d('0x4e'),_0xa66d('0x4f'),'vidaooTopic',_0xa66d('0x50'),'vidaooMetadata'],'raw':!![]});})[_0xa66d('0x2c')](function(_0x11f35c){if(_0x11f35c&&_0x11f35c[_0xa66d('0x4e')]&&_0x11f35c[_0xa66d('0x4f')]){_0x3c5abd=_0x11f35c;var _0x51ddc1={'interaction':{'id':_0x1a673e},'agent':{'id':_0x1e85ef[_0xa66d('0x3c')]['id'],'name':_0x1e85ef[_0xa66d('0x3c')]['name'],'fullname':_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x51')],'email':_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x52')]},'contact':_0x1e85ef[_0xa66d('0x49')][_0xa66d('0x53')],'account':_0x1e85ef[_0xa66d('0x49')]['account']};var _0x2c9334={'rejectUnauthorized':![],'method':_0xa66d('0x54'),'url':_0xa66d('0x55'),'headers':{'X-APIKEY':_0x11f35c[_0xa66d('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x52')]],'buttons':null,'topic':_0x3c5abd[_0xa66d('0x56')],'note':_[_0xa66d('0x57')](_0x3c5abd['vidaooNote'])?null:getMustacheRender(_0x3c5abd[_0xa66d('0x50')],_0x51ddc1),'metadata':null},'redirect':_0xa66d('0x58'),'json':!![]};try{if(!_[_0xa66d('0x57')](_0x3c5abd['vidaooMetadata'])){var _0x9d604b=getMustacheRender(_0x3c5abd[_0xa66d('0x59')],_0x51ddc1);var _0x2e5925=JSON[_0xa66d('0x5a')](_0x9d604b);_0x2c9334[_0xa66d('0x49')]['metadata']=_0x2e5925;}}catch(_0x3dec5e){throw new db[(_0xa66d('0x5b'))][(_0xa66d('0x5c'))](_0xa66d('0x5d'));}return rp(_0x2c9334);}else{throw new db[(_0xa66d('0x5b'))][(_0xa66d('0x5c'))](_0xa66d('0x5e'));}})['then'](function(_0x53406b){_0x556189=_0x53406b;if(_0x556189['id']){var _0x1adb4d={'body':_0x556189[_0xa66d('0x5f')],'ChatWebsiteId':_0x3c5abd['id'],'ChatInteractionId':_0x1e0c13['id'],'direction':'out','UserId':_0x1e85ef['user']['id']};return db[_0xa66d('0x60')]['create'](_0x1adb4d,{});}else{throw new db['Sequelize'][(_0xa66d('0x5c'))](_0xa66d('0x61'));}})['then'](function(){return _0x1e0c13[_0xa66d('0x62')]({'vidaooSessionId':_0x556189['id']});})[_0xa66d('0x2c')](respondWithResult(_0x1f6e67,null))[_0xa66d('0x20')](handleError(_0x1f6e67,null));};exports[_0xa66d('0x63')]=function(_0x97da2f,_0x208b04){if(_0x97da2f[_0xa66d('0x49')]['id']){delete _0x97da2f['body']['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x97da2f[_0xa66d('0x3e')]['id']},'include':[{'model':db[_0xa66d('0x64')],'as':_0xa66d('0x65')}]})[_0xa66d('0x2c')](handleEntityNotFound(_0x208b04,null))[_0xa66d('0x2c')](saveUpdates(_0x97da2f[_0xa66d('0x49')],null))[_0xa66d('0x2c')](respondWithResult(_0x208b04,null))[_0xa66d('0x20')](handleError(_0x208b04,null));};exports[_0xa66d('0x66')]=function(_0x5428a6,_0x587f58){if(_0x5428a6[_0xa66d('0x49')]['id']){delete _0x5428a6['body']['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x5428a6[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](function(_0x43e3ea){if(!_0x43e3ea){logger[_0xa66d('0x1b')](_0xa66d('0x67'),_0xa66d('0x66'),0x194,_0xa66d('0x68'));_0x587f58[_0xa66d('0x21')](0x194);}else{if(_0x43e3ea['UserId']){throw new db['Sequelize'][(_0xa66d('0x5c'))](_0xa66d('0x69'));}}return _0x43e3ea;})['then'](function(_0x50da73){if(_0x50da73){return _0x50da73[_0xa66d('0x2b')]({'closed':_0x5428a6[_0xa66d('0x49')][_0xa66d('0x6a')],'disposition':_0x5428a6[_0xa66d('0x49')][_0xa66d('0x6b')]})[_0xa66d('0x2c')](function(_0x17fe00){return _0x17fe00;});}})['then'](function(){return respondWithRpcPromise(_0xa66d('0x6c'),_0xa66d('0x66'),_0x5428a6[_0xa66d('0x49')],client9004);})[_0xa66d('0x2c')](respondWithResult(_0x587f58,null))['catch'](handleError(_0x587f58,null));};exports[_0xa66d('0x6d')]=function(_0xc9c811,_0x4d0916){_0xc9c811[_0xa66d('0x49')][_0xa66d('0x2d')]=_0xc9c811[_0xa66d('0x6e')][_0xa66d('0x6f')];_0xc9c811[_0xa66d('0x49')][_0xa66d('0x70')]=_0xc9c811['file'][_0xa66d('0x71')];_0xc9c811[_0xa66d('0x49')][_0xa66d('0x72')]=_0xc9c811[_0xa66d('0x6e')][_0xa66d('0x73')];return db[_0xa66d('0x74')]['create'](_0xc9c811[_0xa66d('0x49')])[_0xa66d('0x2c')](respondWithResult(_0x4d0916,0xc9))[_0xa66d('0x20')](handleError(_0x4d0916,null));};exports[_0xa66d('0x75')]=function(_0x22efe4,_0x41a578){return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x22efe4['params']['id']},'raw':!![]})[_0xa66d('0x2c')](handleEntityNotFound(_0x41a578,null))['then'](function(_0x27c8df){if(_0x27c8df){if(_0x27c8df[_0xa66d('0x6a')]){return _0x41a578[_0xa66d('0x22')](0x193)[_0xa66d('0x24')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xa66d('0x4c')]({'where':{'id':_0x22efe4[_0xa66d('0x3b')]['attachId']},'raw':!![]})[_0xa66d('0x2c')](handleEntityNotFound(_0x41a578,null));}})[_0xa66d('0x2c')](function(_0x72ac7b){if(_0x72ac7b){var _0x3ab252=_0x72ac7b[_0xa66d('0x76')]!==null;var _0x6c399f=path[_0xa66d('0x77')](config[_0xa66d('0x78')],_0xa66d('0x79'));if(_0x3ab252){_0x6c399f=path[_0xa66d('0x77')](_0x6c399f,'offline-chat/');}var _0x385c3f=path[_0xa66d('0x77')](_0x6c399f,_0x72ac7b['basename']);return _0x41a578[_0xa66d('0x7a')](_0x385c3f);}})['catch'](handleError(_0x41a578,null));};exports['close']=function(_0x10d4f2,_0x2861a5){var _0x28c875=null;var _0x47aa2d=null;var _0x1c09c9=null;if(_0x10d4f2[_0xa66d('0x49')]['id']){delete _0x10d4f2['body']['id'];}if(_0x10d4f2[_0xa66d('0x49')]['mailTranscript']){_0x1c09c9=path['join'](config['root'],_0xa66d('0x7b'),util[_0xa66d('0x7c')](_0xa66d('0x7d'),Date[_0xa66d('0x7e')]()));_0x10d4f2[_0xa66d('0x49')]['pathTranscript']=_0x1c09c9;}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x10d4f2[_0xa66d('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66d('0x7f'),'include':[{'model':db[_0xa66d('0x80')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2861a5,null))[_0xa66d('0x2c')](saveUpdates(_0x10d4f2[_0xa66d('0x49')],null))[_0xa66d('0x2c')](function(_0x11c730){if(_0x11c730){_0x28c875=_0x11c730;return db[_0xa66d('0x4d')][_0xa66d('0x47')]({'where':{'id':_0x28c875[_0xa66d('0x81')]}});}})[_0xa66d('0x2c')](function(_0x1744a5){if(_0x1744a5){_0x47aa2d=_0x1744a5;return db[_0xa66d('0x64')][_0xa66d('0x47')]({'where':{'id':_0x28c875[_0xa66d('0x82')]}});}})[_0xa66d('0x2c')](function(_0x41cb4e){if(_0x41cb4e){if(_0x1c09c9){var _0x4d956b=null;for(var _0x147604=0x1;_0x147604<_0x28c875[_0xa66d('0x7f')]['length'];++_0x147604){_0x4d956b=_0x28c875[_0xa66d('0x7f')][_0x147604];var _0x292853=_0x4d956b[_0xa66d('0x83')]?util[_0xa66d('0x7c')](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):_0xa66d('0x86');var _0x68b002=_0x10d4f2['body'][_0xa66d('0x87')]||util[_0xa66d('0x7c')](_0xa66d('0x84'),_0xa66d('0x88'),_0x4d956b[_0xa66d('0x82')]);switch(_0x47aa2d[_0xa66d('0x89')]){case _0xa66d('0x8a'):_0x292853=_0x4d956b['UserId']?util['format'](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):'System';break;case _0xa66d('0x8b'):_0x292853=_0x4d956b[_0xa66d('0x83')]?_0x4d956b['User'][_0xa66d('0x8c')]||_0x4d956b[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86');break;case _0xa66d('0x8d'):_0x292853=_0x4d956b[_0xa66d('0x83')]?_0x4d956b[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86');break;default:_0x292853=_0x4d956b[_0xa66d('0x83')]?util[_0xa66d('0x7c')](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):_0xa66d('0x86');}var _0x15ad89=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x4d956b[_0xa66d('0x8e')])['format'](_0xa66d('0x8f')),_0x4d956b[_0xa66d('0x90')]==='in'?_0x68b002:_0x292853,_0x4d956b['body']);if(!_0x4d956b[_0xa66d('0x91')]){fs[_0xa66d('0x92')](_0x1c09c9,_0x15ad89);}}return db['MailAccount'][_0xa66d('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa66d('0x93')],'as':_0xa66d('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa66d('0x95'),'raw':!![]}]}]});}}})[_0xa66d('0x2c')](function(_0x456de1){if(!_0x456de1||!_0x456de1['Smtp']||!_0x10d4f2[_0xa66d('0x49')])return _0x28c875;var _0x3d7126=_0x456de1[_0xa66d('0x96')]();return respondWithRpcPromise(_0xa66d('0x97'),_0xa66d('0x98'),{'account':_0x3d7126,'message':{'from':util[_0xa66d('0x7c')]('\x22%s\x22\x20<%s>',_0x456de1[_0xa66d('0x2d')],_0x456de1[_0xa66d('0x52')]||_0x456de1[_0xa66d('0x94')][_0xa66d('0x3c')]),'to':_0x10d4f2[_0xa66d('0x49')][_0xa66d('0x99')],'subject':'Mail\x20Transcript','text':util['format'](_0xa66d('0x9a'),_0x10d4f2['body'][_0xa66d('0x99')]),'attachments':[{'path':_0x1c09c9}]}})['then'](function(){return _0x28c875;})[_0xa66d('0x20')](function(_0x75b4af){logger[_0xa66d('0x1b')](_0x75b4af);});})[_0xa66d('0x2c')](respondWithStatusCode(_0x2861a5,0xc8))['catch'](handleError(_0x2861a5,null));};exports['addMessage']=function(_0x11dffe,_0xed0aa4){return db[_0xa66d('0x60')][_0xa66d('0x47')]({'where':{'id':_0x11dffe[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0xed0aa4,null))['then'](function(_0x22752f){if(_0x22752f){return _0x22752f['addMessage'](_0x11dffe['body'][_0xa66d('0x9b')],_[_0xa66d('0x9c')](_0x11dffe['body'],[_0xa66d('0x9b'),'id'])||{});}})[_0xa66d('0x2c')](respondWithResult(_0xed0aa4,null))[_0xa66d('0x20')](handleError(_0xed0aa4,null));};exports['getMessages']=function(_0x55f3e3,_0x10bd93){var _0x3c72d6={'raw':![],'where':{}};var _0x3859c2={};var _0x520c54={'count':0x0,'rows':[]};return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x55f3e3[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x10bd93,null))['then'](function(_0x2251fa){if(_0x2251fa){_0x3859c2[_0xa66d('0x3f')]=_[_0xa66d('0x9d')](db['ChatMessage'][_0xa66d('0x36')]);_0x3859c2[_0xa66d('0x3b')]=_[_0xa66d('0x9d')](_0x55f3e3[_0xa66d('0x3b')]);_0x3859c2[_0xa66d('0x40')]=_[_0xa66d('0x42')](_0x3859c2[_0xa66d('0x3f')],_0x3859c2[_0xa66d('0x3b')]);_0x3c72d6[_0xa66d('0x41')]=_[_0xa66d('0x42')](_0x3859c2[_0xa66d('0x3f')],qs[_0xa66d('0x43')](_0x55f3e3[_0xa66d('0x3b')]['fields']));_0x3c72d6[_0xa66d('0x41')]=_0x3c72d6[_0xa66d('0x41')]['length']?_0x3c72d6[_0xa66d('0x41')]:_0x3859c2[_0xa66d('0x3f')];if(!_0x55f3e3['query'][_0xa66d('0x9e')](_0xa66d('0x9f'))){_0x3c72d6[_0xa66d('0x26')]=qs[_0xa66d('0x26')](_0x55f3e3[_0xa66d('0x3b')]['limit']);_0x3c72d6[_0xa66d('0x28')]=qs[_0xa66d('0x28')](_0x55f3e3['query'][_0xa66d('0x28')]);}_0x3c72d6[_0xa66d('0xa0')]=qs[_0xa66d('0xa1')](_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa1')]);_0x3c72d6[_0xa66d('0xa2')]=qs[_0xa66d('0x40')](_[_0xa66d('0xa3')](_0x55f3e3[_0xa66d('0x3b')],_0x3859c2[_0xa66d('0x40')]));_0x3c72d6[_0xa66d('0xa2')][_0xa66d('0xa4')]=_0x2251fa['id'];if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa5')]){_0x3c72d6[_0xa66d('0xa2')]=_[_0xa66d('0x30')](_0x3c72d6[_0xa66d('0xa2')],{'$or':_[_0xa66d('0x34')](_0x3c72d6['attributes'],function(_0x1b69b7){var _0x4b8c2a={};_0x4b8c2a[_0x1b69b7]={'$like':'%'+_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa5')]+'%'};return _0x4b8c2a;})});}if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa6')]){var _0x2873c0=_0x55f3e3[_0xa66d('0x3b')]['$gte'][_0xa66d('0xa7')](',');var _0x4457d9={};_0x4457d9[_0x2873c0[0x0]]={'$gte':moment(_0x2873c0[0x1])['format'](_0xa66d('0xa8'))};_0x3c72d6[_0xa66d('0xa2')]=_['merge'](_0x3c72d6[_0xa66d('0xa2')],_0x4457d9);}_0x3c72d6=_[_0xa66d('0x30')]({},_0x3c72d6,_0x55f3e3['options']);return db['ChatMessage'][_0xa66d('0x27')]({'where':_0x3c72d6['where']})[_0xa66d('0x2c')](function(_0x12ca59){_0x520c54[_0xa66d('0x27')]=_0x12ca59;if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa9')]){_0x3c72d6['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa66d('0x39')](_0x3c72d6);})[_0xa66d('0x2c')](function(_0x346387){_0x520c54[_0xa66d('0xaa')]=_0x346387;return _0x520c54;});}})['then'](respondWithFilteredResult(_0x10bd93,_0x3c72d6))[_0xa66d('0x20')](handleError(_0x10bd93,null));};exports['getMyMessages']=function(_0x17c846,_0x5f072b){var _0x8dd16e={'where':{}},_0x1424f3={},_0x4edf26={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa66d('0x4c')]({'where':{'id':_0x17c846[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x5f072b,null))[_0xa66d('0x2c')](function(_0x52fc7){if(_0x52fc7){_0x1424f3[_0xa66d('0x3f')]=_[_0xa66d('0x9d')](db['ChatMessage'][_0xa66d('0x36')]);_0x1424f3[_0xa66d('0x3b')]=_[_0xa66d('0x9d')](_0x17c846[_0xa66d('0x3b')]);_0x1424f3[_0xa66d('0x40')]=_['intersection'](_0x1424f3[_0xa66d('0x3f')],_0x1424f3[_0xa66d('0x3b')]);_0x8dd16e[_0xa66d('0x41')]=_['intersection'](_0x1424f3[_0xa66d('0x3f')],qs[_0xa66d('0x43')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x43')]));_0x8dd16e['attributes']=_0x8dd16e[_0xa66d('0x41')][_0xa66d('0x44')]?_0x8dd16e['attributes']:_0x1424f3[_0xa66d('0x3f')];if(!_0x17c846[_0xa66d('0x3b')][_0xa66d('0x9e')](_0xa66d('0x9f'))){_0x8dd16e[_0xa66d('0x26')]=qs[_0xa66d('0x26')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x26')]);_0x8dd16e[_0xa66d('0x28')]=qs[_0xa66d('0x28')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x28')]);}_0x8dd16e[_0xa66d('0xa0')]=qs[_0xa66d('0xa1')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa1')]);_0x8dd16e[_0xa66d('0xa2')]=qs[_0xa66d('0x40')](_[_0xa66d('0xa3')](_0x17c846[_0xa66d('0x3b')],_0x1424f3[_0xa66d('0x40')]));_0x8dd16e[_0xa66d('0xa2')][_0xa66d('0xa4')]=_0x52fc7['id'];if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa5')]){_0x8dd16e[_0xa66d('0xa2')]=_[_0xa66d('0x30')](_0x8dd16e[_0xa66d('0xa2')],{'$or':_['map'](_0x8dd16e[_0xa66d('0x41')],function(_0x196119){var _0x11cc00={};_0x11cc00[_0x196119]={'$like':'%'+_0x17c846[_0xa66d('0x3b')]['filter']+'%'};return _0x11cc00;})});}_0x8dd16e['where'][_0xa66d('0x91')]=![];if(_0x17c846[_0xa66d('0x3b')]['id']){_0x8dd16e[_0xa66d('0xa2')]['id']={'$gt':_0x17c846['query']['id']};}_0x8dd16e=_[_0xa66d('0x30')]({},_0x8dd16e,_0x17c846[_0xa66d('0x46')]);return db['ChatMessage'][_0xa66d('0x27')]({'where':_0x8dd16e[_0xa66d('0xa2')]})[_0xa66d('0x2c')](function(_0x4534bb){_0x4edf26[_0xa66d('0x27')]=_0x4534bb;_0x8dd16e[_0xa66d('0x45')]=[];if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xab')]){_0x8dd16e['include'][_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0x80'),'attributes':['id',_0xa66d('0x51'),'alias']});}if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa9')]){_0x8dd16e[_0xa66d('0x45')]=[{'all':!![]}];}return db[_0xa66d('0x60')]['findAll'](_0x8dd16e);})[_0xa66d('0x2c')](function(_0x3445a3){_0x4edf26[_0xa66d('0xaa')]=_0x3445a3;return _0x4edf26;});}})[_0xa66d('0x2c')](respondWithFilteredResult(_0x5f072b,_0x8dd16e))[_0xa66d('0x20')](handleError(_0x5f072b,null));};exports['addTags']=function(_0x1afe5e,_0x1ddf6a){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x1afe5e[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x1ddf6a,null))[_0xa66d('0x2c')](function(_0x3bfd46){if(_0x3bfd46){return _0x3bfd46['setTags'](_0x1afe5e['body']['ids'],_[_0xa66d('0x9c')](_0x1afe5e[_0xa66d('0x49')],['ids','id'])||{})[_0xa66d('0xad')](function(){return db['Tag'][_0xa66d('0x39')]({'attributes':['id',_0xa66d('0x2d'),'color'],'where':{'id':_0x1afe5e[_0xa66d('0x49')][_0xa66d('0x9b')]}});})[_0xa66d('0x2c')](function(_0x24f8e9){socket[_0xa66d('0xae')]('chatInteractionTags:save',{'id':Number(_0x1afe5e['params']['id']),'tags':_0x24f8e9||[]});return{'id':Number(_0x1afe5e[_0xa66d('0x3e')]['id']),'tags':_0x24f8e9||[]};});}})[_0xa66d('0x2c')](respondWithResult(_0x1ddf6a,null))['catch'](handleError(_0x1ddf6a,null));};exports[_0xa66d('0xaf')]=function(_0x4a1b39,_0x42333b){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x4a1b39[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x42333b,null))[_0xa66d('0x2c')](function(_0x40aa9d){if(_0x40aa9d){return _0x40aa9d[_0xa66d('0xaf')](_0x4a1b39['query'][_0xa66d('0x9b')]);}})[_0xa66d('0x2c')](respondWithStatusCode(_0x42333b,null))[_0xa66d('0x20')](handleError(_0x42333b,null));};exports[_0xa66d('0x7a')]=function(_0x3c7271,_0x1c685a){var _0x17b5b8=moment()[_0xa66d('0xb0')]()[_0xa66d('0xb1')]();var _0xef3cdb=path['join'](config[_0xa66d('0x78')],_0xa66d('0xb2'),'files',_0xa66d('0xb3'));var _0x47d241=path[_0xa66d('0x77')](config[_0xa66d('0x78')],_0xa66d('0xb2'),'files',_0xa66d('0xb4'));var _0x346ec2=path[_0xa66d('0x77')](_0xef3cdb,_0x17b5b8);var _0x2fe7d7=util[_0xa66d('0x7c')](_0xa66d('0xb5'),_0x3c7271[_0xa66d('0x3e')]['id'],_0x17b5b8);var _0x26eccf=path[_0xa66d('0x77')](_0xef3cdb,_0x2fe7d7);var _0x5ea9d3=[];_0x5ea9d3[_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0x80'),'attributes':['id',_0xa66d('0x51')],'raw':!![]});_0x5ea9d3['push']({'model':db[_0xa66d('0x64')],'as':_0xa66d('0x65'),'attributes':['id',_0xa66d('0xb6'),_0xa66d('0xb7')],'raw':!![]});if(_0x3c7271[_0xa66d('0x3b')][_0xa66d('0xb4')]){_0x5ea9d3[_0xa66d('0xac')]({'model':db[_0xa66d('0x74')],'as':_0xa66d('0x74'),'raw':!![]});}var _0x2d1372=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xa66d('0x49'),_0xa66d('0x8e'),'direction',_0xa66d('0x91'),_0xa66d('0xb8')],'include':_0x5ea9d3}];_0x2d1372[_0xa66d('0xac')]({'model':db[_0xa66d('0x4d')],'as':_0xa66d('0xb9'),'attributes':['id',_0xa66d('0x2d')]});_0x2d1372[_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0xba'),'attributes':['id',_0xa66d('0x51')]});return db['ChatInteraction'][_0xa66d('0x47')]({'where':{'id':_0x3c7271[_0xa66d('0x3e')]['id']},'include':_0x2d1372})['then'](handleEntityNotFound(_0x1c685a,null))[_0xa66d('0x2c')](function(_0x249fc6){if(_0x249fc6){var _0x5712fd=_0x249fc6[_0xa66d('0xbb')]({'plain':!![]});fs[_0xa66d('0xbc')](_0x346ec2);var _0x1abbfa={'channel':_0xa66d('0xbd'),'account':_0x5712fd['Account'][_0xa66d('0x2d')],'agent':_0x5712fd[_0xa66d('0xba')]?_0x5712fd['Owner']['fullname']:'N.A.','createdAt':moment(_0x5712fd[_0xa66d('0x8e')])[_0xa66d('0x7c')](_0xa66d('0xa8'))[_0xa66d('0xb1')](),'closedAt':_0x5712fd[_0xa66d('0x6a')]?moment(_0x5712fd[_0xa66d('0xbe')])['format'](_0xa66d('0xa8'))[_0xa66d('0xb1')]():'','disposition':_0x5712fd[_0xa66d('0x6b')],'chatInfo':{'browser':_0x5712fd[_0xa66d('0xbf')],'os':_0x5712fd['osName'],'referer':_0x5712fd[_0xa66d('0xc0')],'customerIp':_0x5712fd[_0xa66d('0xc1')],'customerPort':_0x5712fd['customerPort']?_0x5712fd[_0xa66d('0xc2')]:'N.A.'},'messages':_(_0x5712fd[_0xa66d('0x7f')])['tail']()['filter']({'secret':![]})['map'](function(_0x44906f){if(_0x44906f[_0xa66d('0x74')]){var _0x3ca138=path['join'](_0x47d241,_0x44906f[_0xa66d('0x74')][_0xa66d('0x70')]);if(fs[_0xa66d('0xc3')](_0x3ca138)){fs[_0xa66d('0xc4')](_0x3ca138)[_0xa66d('0xc5')](fs[_0xa66d('0xc6')](path[_0xa66d('0x77')](_0x346ec2,_0x44906f[_0xa66d('0x74')][_0xa66d('0x70')])));}}return{'date':moment(_0x44906f[_0xa66d('0x8e')])[_0xa66d('0x7c')](_0xa66d('0xa8'))[_0xa66d('0xb1')](),'sender':_0x44906f[_0xa66d('0x90')]===_0xa66d('0xc7')?_0x44906f[_0xa66d('0x80')]?_0x44906f[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86'):_0x44906f[_0xa66d('0x65')][_0xa66d('0xb6')]+(_0x44906f[_0xa66d('0x65')]['lastName']?'\x20'+_0x44906f[_0xa66d('0x65')][_0xa66d('0xb7')]:''),'body':_0x44906f[_0xa66d('0x74')]?_0x44906f[_0xa66d('0x74')]['basename']:_0x44906f[_0xa66d('0x49')],'direction':_0x44906f[_0xa66d('0x90')]===_0xa66d('0xc7')?'A':'C','secret':_0x44906f[_0xa66d('0x91')],'read':_0x44906f['read'],'attachment':_0x44906f['Attachment']};})[_0xa66d('0xc8')]()};return ejs[_0xa66d('0xc9')](path[_0xa66d('0x77')](config['root'],_0xa66d('0xb2'),_0xa66d('0xca'),_0xa66d('0xcb')),{'interaction':_0x1abbfa})[_0xa66d('0x2c')](function(_0x43d54c){var _0x2463cd=path[_0xa66d('0x77')](_0x346ec2,_0xa66d('0xcc')+_0x5712fd['id']+'-'+_0x17b5b8+'.pdf');var _0x508b64={'path':_0x2463cd,'channel':_0xa66d('0xbd'),'interactionId':_0x5712fd['id']};return pdf[_0xa66d('0xcd')](_0x43d54c,_0x508b64);})['then'](function(){return new Promise(function(_0x474cc4,_0x4033d2){zipdir(_0x346ec2,{'saveTo':_0x26eccf},function(_0x4267f9,_0x54df1e){if(_0x4267f9)return _0x4033d2(_0x4267f9);return _0x474cc4(_0x54df1e);});})[_0xa66d('0x2c')](function(){return new BPromise(function(_0x59c050,_0x209863){rimraf(_0x346ec2,function(_0x419eb){if(_0x419eb)_0x209863(_0x419eb);return _0x59c050();});});})['then'](function(){return _0x1c685a[_0xa66d('0x7a')](_0x26eccf,_0x2fe7d7,function(_0x2014a8){if(_0x2014a8){logger[_0xa66d('0x1b')](_0xa66d('0xce'),_0x2014a8);}else{fs['unlinkSync'](_0x26eccf);}});});});}else{return _0x1c685a[_0xa66d('0x21')](0xc8);}})[_0xa66d('0x20')](handleError(_0x1c685a,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index ef32a9f..194db3a 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 _0xf022=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','Users','map','then'];(function(_0xb4f89c,_0x4b0f0c){var _0x5bfda3=function(_0x6395cc){while(--_0x6395cc){_0xb4f89c['push'](_0xb4f89c['shift']());}};_0x5bfda3(++_0x4b0f0c);}(_0xf022,0xa9));var _0x2f02=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0xf022[_0x50b66d];return _0x41aa8e;};'use strict';var EventEmitter=require(_0x2f02('0x0'));var ChatInteraction=require(_0x2f02('0x1'))['db'][_0x2f02('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x2f02('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2f02('0x4')](0x0);var events={'afterCreate':_0x2f02('0x5'),'afterUpdate':'update','afterDestroy':_0x2f02('0x6')};function emitEvent(_0x19cbad){return function(_0x1f5499,_0x1db134,_0x4340f0){_0x1f5499[_0x2f02('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xdd29b8){_0x1f5499['setDataValue'](_0x2f02('0x8'),_0xdd29b8[_0x2f02('0x9')](function(_0x5404a4){return{'id':_0x5404a4['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1f5499['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2f02('0xa')](function(_0x154d8d){_0x1f5499[_0x2f02('0xb')](_0x2f02('0xc'),_0x154d8d[_0x2f02('0xd')]);ChatInteractionEvents[_0x2f02('0xe')](_0x19cbad+':'+_0x1f5499['id'],_0x1f5499);ChatInteractionEvents[_0x2f02('0xe')](_0x19cbad,_0x1f5499);_0x4340f0(null);})[_0x2f02('0xf')](_0x4340f0(null));};}for(var e in events){if(events[_0x2f02('0x10')](e)){var event=events[e];ChatInteraction[_0x2f02('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x52d9=['update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x52d9,0xa5));var _0x952d=function(_0x4cce8,_0x22d1fe){_0x4cce8=_0x4cce8-0x0;var _0x458440=_0x52d9[_0x4cce8];return _0x458440;};'use strict';var EventEmitter=require(_0x952d('0x0'));var ChatInteraction=require(_0x952d('0x1'))['db'][_0x952d('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x952d('0x3')](0x0);var events={'afterCreate':_0x952d('0x4'),'afterUpdate':_0x952d('0x5'),'afterDestroy':_0x952d('0x6')};function emitEvent(_0x4b3162){return function(_0x25bae7,_0x424244,_0xe5a688){_0x25bae7[_0x952d('0x7')]({'attributes':['id'],'raw':!![]})[_0x952d('0x8')](function(_0x290c5b){_0x25bae7[_0x952d('0x9')](_0x952d('0xa'),_0x290c5b[_0x952d('0xb')](function(_0x245a5d){return{'id':_0x245a5d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x25bae7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x952d('0x8')](function(_0x5f105e){_0x25bae7[_0x952d('0x9')]('unreadMessages',_0x5f105e[_0x952d('0xc')]);ChatInteractionEvents[_0x952d('0xd')](_0x4b3162+':'+_0x25bae7['id'],_0x25bae7);ChatInteractionEvents[_0x952d('0xd')](_0x4b3162,_0x25bae7);_0xe5a688(null);})[_0x952d('0xe')](_0xe5a688(null));};}for(var e in events){if(events[_0x952d('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x952d('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 d09e6a2..0e5aaf7 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 _0x2ae7=['./chatInteraction.attributes','exports','define','ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x2ae7,0x1b2));var _0x72ae=function(_0x49c24a,_0x3a4daf){_0x49c24a=_0x49c24a-0x0;var _0x5184cf=_0x2ae7[_0x49c24a];return _0x5184cf;};'use strict';var _=require('lodash');var util=require(_0x72ae('0x0'));var logger=require(_0x72ae('0x1'))(_0x72ae('0x2'));var moment=require(_0x72ae('0x3'));var BPromise=require(_0x72ae('0x4'));var rp=require(_0x72ae('0x5'));var fs=require('fs');var path=require(_0x72ae('0x6'));var rimraf=require(_0x72ae('0x7'));var config=require('../../config/environment');var attributes=require(_0x72ae('0x8'));module[_0x72ae('0x9')]=function(_0x55b29b,_0xafe7b1){return _0x55b29b[_0x72ae('0xa')](_0x72ae('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f21cb,_0x3f53f6,_0x4ecae2){if(_0x1f21cb['changed'](_0x72ae('0xc'))){_0x1f21cb['closedAt']=moment()[_0x72ae('0xd')](_0x72ae('0xe'));}_0x4ecae2(null,_0x1f21cb);}},'charset':_0x72ae('0xf'),'collate':_0x72ae('0x10')});};
\ No newline at end of file
+var _0x3d30=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x153260,_0x2ece9f){var _0x4ed302=function(_0x3d441a){while(--_0x3d441a){_0x153260['push'](_0x153260['shift']());}};_0x4ed302(++_0x2ece9f);}(_0x3d30,0x1c4));var _0x03d3=function(_0x5b7d11,_0x268642){_0x5b7d11=_0x5b7d11-0x0;var _0x1a1e5e=_0x3d30[_0x5b7d11];return _0x1a1e5e;};'use strict';var _=require('lodash');var util=require(_0x03d3('0x0'));var logger=require(_0x03d3('0x1'))('api');var moment=require(_0x03d3('0x2'));var BPromise=require('bluebird');var rp=require(_0x03d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03d3('0x4'));var config=require(_0x03d3('0x5'));var attributes=require(_0x03d3('0x6'));module['exports']=function(_0x4ffed1,_0x33c55a){return _0x4ffed1[_0x03d3('0x7')](_0x03d3('0x8'),attributes,{'tableName':_0x03d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x251d01,_0x15174a,_0x484e7b){if(_0x251d01[_0x03d3('0xa')](_0x03d3('0xb'))){_0x251d01[_0x03d3('0xc')]=moment()['format'](_0x03d3('0xd'));}_0x484e7b(null,_0x251d01);}},'charset':_0x03d3('0xe'),'collate':_0x03d3('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 557a69c..3c3a013 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 _0xae01=['UpdateChatInteraction','find','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit'];(function(_0x4a25e3,_0xffc2aa){var _0xc2ac02=function(_0x1f0eba){while(--_0x1f0eba){_0x4a25e3['push'](_0x4a25e3['shift']());}};_0xc2ac02(++_0xffc2aa);}(_0xae01,0x81));var _0x1ae0=function(_0x5343ca,_0x93427e){_0x5343ca=_0x5343ca-0x0;var _0x1b84c1=_0xae01[_0x5343ca];return _0x1b84c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ae0('0x0'));var BPromise=require(_0x1ae0('0x1'));var rs=require(_0x1ae0('0x2'));var fs=require('fs');var Redis=require(_0x1ae0('0x3'));var db=require(_0x1ae0('0x4'))['db'];var utils=require(_0x1ae0('0x5'));var logger=require(_0x1ae0('0x6'))('rpc');var config=require(_0x1ae0('0x7'));var jayson=require(_0x1ae0('0x8'));var client=jayson['client'][_0x1ae0('0x9')]({'port':0x232a});config[_0x1ae0('0xa')]=_[_0x1ae0('0xb')](config[_0x1ae0('0xa')],{'host':_0x1ae0('0xc'),'port':0x18eb});var socket=require(_0x1ae0('0xd'))(new Redis(config[_0x1ae0('0xa')]));require(_0x1ae0('0xe'))[_0x1ae0('0xf')](socket);function respondWithRpcPromise(_0x26bf61,_0x39cad0,_0x174697){return new BPromise(function(_0x46e122,_0x372b2f){return client[_0x1ae0('0x10')](_0x26bf61,_0x174697)[_0x1ae0('0x11')](function(_0x2caeaa){logger[_0x1ae0('0x12')](_0x1ae0('0x13'),_0x39cad0,_0x1ae0('0x14'));logger[_0x1ae0('0x15')](_0x1ae0('0x16'),_0x39cad0,_0x1ae0('0x14'),JSON[_0x1ae0('0x17')](_0x2caeaa));if(_0x2caeaa[_0x1ae0('0x18')]){if(_0x2caeaa[_0x1ae0('0x18')]['code']===0x1f4){logger[_0x1ae0('0x18')](_0x1ae0('0x13'),_0x39cad0,_0x2caeaa[_0x1ae0('0x18')]['message']);return _0x372b2f(_0x2caeaa[_0x1ae0('0x18')][_0x1ae0('0x19')]);}logger[_0x1ae0('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x39cad0,_0x2caeaa['error'][_0x1ae0('0x19')]);return _0x46e122(_0x2caeaa[_0x1ae0('0x18')]['message']);}else{logger[_0x1ae0('0x12')](_0x1ae0('0x13'),_0x39cad0,'request\x20sent');_0x46e122(_0x2caeaa[_0x1ae0('0x1a')]['message']);}})[_0x1ae0('0x1b')](function(_0x5e8bde){logger['error'](_0x1ae0('0x13'),_0x39cad0,_0x5e8bde);_0x372b2f(_0x5e8bde);});});}exports['UpdateChatInteraction']=function(_0x4354f8){var _0x41a005=this;return new Promise(function(_0x5eb931,_0x53e9e0){return db['ChatInteraction'][_0x1ae0('0x1c')](_0x4354f8[_0x1ae0('0x1d')],{'raw':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x20')]||null:null,'attributes':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x21')]||null:null,'limit':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8['options'][_0x1ae0('0x22')]||null:null})['then'](function(_0x4ddda2){logger[_0x1ae0('0x12')]('UpdateChatInteraction',_0x4354f8);logger[_0x1ae0('0x15')]('UpdateChatInteraction',_0x4354f8,JSON[_0x1ae0('0x17')](_0x4ddda2));_0x5eb931(_0x4ddda2);})[_0x1ae0('0x1b')](function(_0x24eef0){logger[_0x1ae0('0x18')](_0x1ae0('0x23'),_0x24eef0['message'],_0x4354f8);_0x53e9e0(_0x41a005[_0x1ae0('0x18')](0x1f4,_0x24eef0[_0x1ae0('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x1e57c8){return new Promise(function(_0x4664c4,_0x37862a){return db['ChatInteraction'][_0x1ae0('0x24')]({'where':_0x1e57c8[_0x1ae0('0x1e')]?_0x1e57c8['options'][_0x1ae0('0x20')]||null:null})[_0x1ae0('0x11')](function(_0xfed526){if(_0xfed526){return _0xfed526[_0x1ae0('0x25')](_0x1e57c8[_0x1ae0('0x1d')][_0x1ae0('0x26')],_[_0x1ae0('0x27')](_0x1e57c8[_0x1ae0('0x1d')],['ids','id'])||{});}})['spread'](function(_0x3c4f77){logger['info'](_0x1ae0('0x28'),_0x1e57c8);logger[_0x1ae0('0x15')](_0x1ae0('0x28'),_0x1e57c8,JSON[_0x1ae0('0x17')](_0x3c4f77));_0x4664c4(_0x3c4f77);})['catch'](function(_0x2bf8d3){logger[_0x1ae0('0x18')](_0x1ae0('0x28'),_0x2bf8d3[_0x1ae0('0x19')],_0x1e57c8);_0x37862a(_this[_0x1ae0('0x18')](0x1f4,_0x2bf8d3[_0x1ae0('0x19')]));});});};
\ No newline at end of file
+var _0x28b4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','ChatInteraction','addTags','omit','AddTags','util','moment','bluebird','randomstring'];(function(_0x344f1c,_0x5a0a0e){var _0xe6b281=function(_0x44a686){while(--_0x44a686){_0x344f1c['push'](_0x344f1c['shift']());}};_0xe6b281(++_0x5a0a0e);}(_0x28b4,0x176));var _0x428b=function(_0x201c56,_0x42849f){_0x201c56=_0x201c56-0x0;var _0x2e4bc8=_0x28b4[_0x201c56];return _0x2e4bc8;};'use strict';var _=require('lodash');var util=require(_0x428b('0x0'));var moment=require(_0x428b('0x1'));var BPromise=require(_0x428b('0x2'));var rs=require(_0x428b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x428b('0x4'))['db'];var utils=require(_0x428b('0x5'));var logger=require(_0x428b('0x6'))(_0x428b('0x7'));var config=require(_0x428b('0x8'));var jayson=require(_0x428b('0x9'));var client=jayson['client'][_0x428b('0xa')]({'port':0x232a});config[_0x428b('0xb')]=_[_0x428b('0xc')](config[_0x428b('0xb')],{'host':_0x428b('0xd'),'port':0x18eb});var socket=require(_0x428b('0xe'))(new Redis(config[_0x428b('0xb')]));require('./chatInteraction.socket')[_0x428b('0xf')](socket);function respondWithRpcPromise(_0x50774c,_0x5500b2,_0x2c6949){return new BPromise(function(_0x35f9a3,_0x2d0b1e){return client[_0x428b('0x10')](_0x50774c,_0x2c6949)[_0x428b('0x11')](function(_0xed9a40){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5500b2,_0x428b('0x12'));logger[_0x428b('0x13')](_0x428b('0x14'),_0x5500b2,_0x428b('0x12'),JSON['stringify'](_0xed9a40));if(_0xed9a40[_0x428b('0x15')]){if(_0xed9a40['error'][_0x428b('0x16')]===0x1f4){logger['error'](_0x428b('0x17'),_0x5500b2,_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);return _0x2d0b1e(_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);}logger[_0x428b('0x15')](_0x428b('0x17'),_0x5500b2,_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);return _0x35f9a3(_0xed9a40['error']['message']);}else{logger[_0x428b('0x19')](_0x428b('0x17'),_0x5500b2,_0x428b('0x12'));_0x35f9a3(_0xed9a40[_0x428b('0x1a')][_0x428b('0x18')]);}})[_0x428b('0x1b')](function(_0x37cba4){logger[_0x428b('0x15')](_0x428b('0x17'),_0x5500b2,_0x37cba4);_0x2d0b1e(_0x37cba4);});});}exports['UpdateChatInteraction']=function(_0xcb58d4){var _0x441c71=this;return new Promise(function(_0x4ffc79,_0x3dfda5){return db['ChatInteraction'][_0x428b('0x1c')](_0xcb58d4[_0x428b('0x1d')],{'raw':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4['options'][_0x428b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x20')]||null:null,'attributes':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x21')]||null:null,'limit':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x22')]||null:null})[_0x428b('0x11')](function(_0xf86a8b){logger['info'](_0x428b('0x23'),_0xcb58d4);logger[_0x428b('0x13')](_0x428b('0x23'),_0xcb58d4,JSON[_0x428b('0x24')](_0xf86a8b));_0x4ffc79(_0xf86a8b);})[_0x428b('0x1b')](function(_0x375f34){logger[_0x428b('0x15')](_0x428b('0x23'),_0x375f34['message'],_0xcb58d4);_0x3dfda5(_0x441c71[_0x428b('0x15')](0x1f4,_0x375f34[_0x428b('0x18')]));});});};exports[_0x428b('0x25')]=function(_0x297302){return new Promise(function(_0x55ba3d,_0x339e64){return db[_0x428b('0x26')]['find']({'where':_0x297302[_0x428b('0x1e')]?_0x297302['options']['where']||null:null})[_0x428b('0x11')](function(_0xec0bf4){if(_0xec0bf4){return _0xec0bf4[_0x428b('0x27')](_0x297302[_0x428b('0x1d')]['ids'],_[_0x428b('0x28')](_0x297302['body'],['ids','id'])||{});}})['spread'](function(_0x4b0d5b){logger[_0x428b('0x19')](_0x428b('0x29'),_0x297302);logger['debug']('AddTags',_0x297302,JSON[_0x428b('0x24')](_0x4b0d5b));_0x55ba3d(_0x4b0d5b);})[_0x428b('0x1b')](function(_0x4ad957){logger[_0x428b('0x15')](_0x428b('0x29'),_0x4ad957[_0x428b('0x18')],_0x297302);_0x339e64(_this[_0x428b('0x15')](0x1f4,_0x4ad957[_0x428b('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 304e260..f1499a5 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 _0xea89=['./chatInteraction.events','remove','emit','register','length','chatInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea89,0xf6));var _0x9ea8=function(_0x2267e6,_0x19cd1e){_0x2267e6=_0x2267e6-0x0;var _0xc608a=_0xea89[_0x2267e6];return _0xc608a;};'use strict';var ChatInteractionEvents=require(_0x9ea8('0x0'));var events=['save',_0x9ea8('0x1'),'update'];function createListener(_0x2eef33,_0x395150){return function(_0x2df473){_0x395150[_0x9ea8('0x2')](_0x2eef33,_0x2df473);};}function removeListener(_0x1d06ec,_0x371110){return function(){ChatInteractionEvents['removeListener'](_0x1d06ec,_0x371110);};}exports[_0x9ea8('0x3')]=function(_0x23402d){for(var _0x4a3b29=0x0,_0x18dc01=events[_0x9ea8('0x4')];_0x4a3b29<_0x18dc01;_0x4a3b29++){var _0x56a80c=events[_0x4a3b29];var _0x3e1d9d=createListener(_0x9ea8('0x5')+_0x56a80c,_0x23402d);ChatInteractionEvents['on'](_0x56a80c,_0x3e1d9d);}};
\ No newline at end of file
+var _0x75b4=['update','emit','removeListener','register','chatInteraction:','save','remove'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0x75b4,0xc2));var _0x475b=function(_0x14725b,_0xe66d95){_0x14725b=_0x14725b-0x0;var _0xf95764=_0x75b4[_0x14725b];return _0xf95764;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x475b('0x0'),_0x475b('0x1'),_0x475b('0x2')];function createListener(_0x54859d,_0x5c6649){return function(_0xb93fbb){_0x5c6649[_0x475b('0x3')](_0x54859d,_0xb93fbb);};}function removeListener(_0x2eefae,_0x599c96){return function(){ChatInteractionEvents[_0x475b('0x4')](_0x2eefae,_0x599c96);};}exports[_0x475b('0x5')]=function(_0x54fe3f){for(var _0x5dbb7b=0x0,_0x2fa3ce=events['length'];_0x5dbb7b<_0x2fa3ce;_0x5dbb7b++){var _0x7d7f31=events[_0x5dbb7b];var _0x3cdfcb=createListener(_0x475b('0x6')+_0x7d7f31,_0x54fe3f);ChatInteractionEvents['on'](_0x7d7f31,_0x3cdfcb);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 32774ef..31ed335 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 _0x982f=['put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','isChatInteractionAuthorized','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x2d7fa1,_0x4cca90){var _0x4dc8cc=function(_0x4bd463){while(--_0x4bd463){_0x2d7fa1['push'](_0x2d7fa1['shift']());}};_0x4dc8cc(++_0x4cca90);}(_0x982f,0x1bc));var _0xf982=function(_0x53721f,_0x16d681){_0x53721f=_0x53721f-0x0;var _0x322dea=_0x982f[_0x53721f];return _0x322dea;};'use strict';var multer=require('multer');var util=require(_0xf982('0x0'));var path=require(_0xf982('0x1'));var timeout=require(_0xf982('0x2'));var express=require('express');var router=express[_0xf982('0x3')]();var fs_extra=require(_0xf982('0x4'));var auth=require(_0xf982('0x5'));var interaction=require(_0xf982('0x6'));var config=require(_0xf982('0x7'));var controller=require(_0xf982('0x8'));router[_0xf982('0x9')]('/',auth[_0xf982('0xa')](),controller[_0xf982('0xb')]);router[_0xf982('0x9')](_0xf982('0xc'),auth[_0xf982('0xa')](),controller[_0xf982('0xd')]);router['get'](_0xf982('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0xf')]);router[_0xf982('0x9')](_0xf982('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0xf982('0x11'),auth[_0xf982('0xa')](),controller[_0xf982('0x12')]);router[_0xf982('0x9')](_0xf982('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0x14')]);router['get'](_0xf982('0x15'),auth[_0xf982('0xa')](),controller[_0xf982('0x16')]);router[_0xf982('0x17')]('/',auth[_0xf982('0xa')](),controller[_0xf982('0x18')]);router[_0xf982('0x17')]('/:id/vidaoo',auth[_0xf982('0xa')](),controller[_0xf982('0x19')]);var upload=multer({'storage':multer[_0xf982('0x1a')]({'destination':function(_0x1cd90d,_0x5271d2,_0x4c9e58){_0x4c9e58(null,path[_0xf982('0x1b')](config[_0xf982('0x1c')],_0xf982('0x1d')));},'filename':function(_0x59f229,_0x580ecb,_0xeca8ab){_0xeca8ab(null,util['format'](_0xf982('0x1e'),Date[_0xf982('0x1f')](),_0x580ecb[_0xf982('0x20')][_0xf982('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf982('0x22'),upload['single'](_0xf982('0x23')),controller[_0xf982('0x24')]);router[_0xf982('0x17')](_0xf982('0x11'),auth[_0xf982('0x25')](),controller['addMessage']);router[_0xf982('0x17')]('/:id/tags',auth[_0xf982('0xa')](),interaction[_0xf982('0x26')](_0xf982('0x27'),_0xf982('0x28')),controller[_0xf982('0x29')]);router[_0xf982('0x2a')](_0xf982('0xe'),auth[_0xf982('0xa')](),interaction['tracked'](_0xf982('0x27'),_0xf982('0x2b')),controller[_0xf982('0x2c')]);router[_0xf982('0x2a')]('/:id/custom_update',controller[_0xf982('0x2d')]);router['put'](_0xf982('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0x2f')]);router['put'](_0xf982('0x30'),controller[_0xf982('0x31')]);router[_0xf982('0x32')](_0xf982('0xe'),auth[_0xf982('0xa')](),interaction[_0xf982('0x26')](_0xf982('0x27'),_0xf982('0x33')),controller[_0xf982('0x34')]);router[_0xf982('0x32')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf982('0x35')]);module['exports']=router;
\ No newline at end of file
+var _0x55dd=['delete','removeTags','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy'];(function(_0x1f3d3c,_0x5dcab4){var _0x484443=function(_0xc10a36){while(--_0xc10a36){_0x1f3d3c['push'](_0x1f3d3c['shift']());}};_0x484443(++_0x5dcab4);}(_0x55dd,0x6e));var _0xd55d=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x55dd[_0x3f2228];return _0x285ae4;};'use strict';var multer=require(_0xd55d('0x0'));var util=require(_0xd55d('0x1'));var path=require('path');var timeout=require(_0xd55d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd55d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd55d('0x4'));var config=require(_0xd55d('0x5'));var controller=require(_0xd55d('0x6'));router['get']('/',auth[_0xd55d('0x7')](),controller[_0xd55d('0x8')]);router['get']('/describe',auth[_0xd55d('0x7')](),controller[_0xd55d('0x9')]);router[_0xd55d('0xa')](_0xd55d('0xb'),auth[_0xd55d('0xc')](),controller[_0xd55d('0xd')]);router['get'](_0xd55d('0xe'),auth[_0xd55d('0xc')](),controller[_0xd55d('0xf')]);router[_0xd55d('0xa')](_0xd55d('0x10'),auth[_0xd55d('0x7')](),controller['getMessages']);router[_0xd55d('0xa')](_0xd55d('0x11'),auth[_0xd55d('0xc')](),controller[_0xd55d('0x12')]);router[_0xd55d('0xa')](_0xd55d('0x13'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x14')]);router[_0xd55d('0x15')]('/',auth['isAuthenticated'](),controller[_0xd55d('0x16')]);router[_0xd55d('0x15')](_0xd55d('0x17'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x18')]);var upload=multer({'storage':multer[_0xd55d('0x19')]({'destination':function(_0x3c6631,_0x10f231,_0x3f04f3){_0x3f04f3(null,path[_0xd55d('0x1a')](config['root'],_0xd55d('0x1b')));},'filename':function(_0x5c15b6,_0xe5fb3c,_0x2c84b6){_0x2c84b6(null,util['format'](_0xd55d('0x1c'),Date[_0xd55d('0x1d')](),_0xe5fb3c[_0xd55d('0x1e')][_0xd55d('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd55d('0x20'),upload[_0xd55d('0x21')](_0xd55d('0x22')),controller[_0xd55d('0x23')]);router[_0xd55d('0x15')](_0xd55d('0x10'),auth[_0xd55d('0xc')](),controller[_0xd55d('0x24')]);router[_0xd55d('0x15')](_0xd55d('0x25'),auth[_0xd55d('0x7')](),interaction['tracked']('chat',_0xd55d('0x26')),controller[_0xd55d('0x27')]);router[_0xd55d('0x28')]('/:id',auth[_0xd55d('0x7')](),interaction[_0xd55d('0x29')](_0xd55d('0x2a'),_0xd55d('0x2b')),controller[_0xd55d('0x2c')]);router[_0xd55d('0x28')](_0xd55d('0x2d'),controller[_0xd55d('0x2e')]);router[_0xd55d('0x28')](_0xd55d('0x2f'),auth[_0xd55d('0xc')](),controller['abandon']);router[_0xd55d('0x28')](_0xd55d('0x30'),controller[_0xd55d('0x31')]);router['delete'](_0xd55d('0xb'),auth[_0xd55d('0x7')](),interaction['tracked'](_0xd55d('0x2a'),_0xd55d('0x32')),controller[_0xd55d('0x33')]);router[_0xd55d('0x34')](_0xd55d('0x25'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x35')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 9a49e60..acd00c5 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 _0x7e69=['sequelize','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x4c9574,_0x441b91){var _0x59d1e5=function(_0x46be2b){while(--_0x46be2b){_0x4c9574['push'](_0x4c9574['shift']());}};_0x59d1e5(++_0x441b91);}(_0x7e69,0x1b3));var _0x97e6=function(_0x4e3843,_0x571529){_0x4e3843=_0x4e3843-0x0;var _0x2537db=_0x7e69[_0x4e3843];return _0x2537db;};'use strict';var Sequelize=require(_0x97e6('0x0'));module['exports']={'body':{'type':Sequelize[_0x97e6('0x1')](_0x97e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x97e6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x97e6('0x4')]}};
\ No newline at end of file
+var _0xe1af=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xe1af,0xa8));var _0xfe1a=function(_0x4dbac8,_0x21d060){_0x4dbac8=_0x4dbac8-0x0;var _0x343db9=_0xe1af[_0x4dbac8];return _0x343db9;};'use strict';var Sequelize=require(_0xfe1a('0x0'));module[_0xfe1a('0x1')]={'body':{'type':Sequelize[_0xfe1a('0x2')](_0xfe1a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfe1a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xfe1a('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e945779..5fa9bd4 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 _0xacad=['order','sort','filters','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','fields','length','include','find','catch','create','body','params','destroy','describe','get','messages','format','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','type','role','UserProfileSection','Agents','UserProfileResource','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','end','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','nolimit'];(function(_0x4a323a,_0x440a6a){var _0x3e1083=function(_0x16eefc){while(--_0x16eefc){_0x4a323a['push'](_0x4a323a['shift']());}};_0x3e1083(++_0x440a6a);}(_0xacad,0x172));var _0xdaca=function(_0x42420b,_0x11a2eb){_0x42420b=_0x42420b-0x0;var _0x2d0e82=_0xacad[_0x42420b];return _0x2d0e82;};'use strict';var emlformat=require(_0xdaca('0x0'));var rimraf=require(_0xdaca('0x1'));var zipdir=require(_0xdaca('0x2'));var jsonpatch=require(_0xdaca('0x3'));var rp=require(_0xdaca('0x4'));var moment=require(_0xdaca('0x5'));var BPromise=require(_0xdaca('0x6'));var Mustache=require(_0xdaca('0x7'));var util=require(_0xdaca('0x8'));var path=require(_0xdaca('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdaca('0xa'));var fs=require('fs');var fs_extra=require(_0xdaca('0xb'));var _=require('lodash');var squel=require(_0xdaca('0xc'));var crypto=require(_0xdaca('0xd'));var jsforce=require(_0xdaca('0xe'));var deskjs=require(_0xdaca('0xf'));var toCsv=require(_0xdaca('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdaca('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdaca('0x12'));var as=require(_0xdaca('0x13'));var hardwareService=require(_0xdaca('0x14'));var logger=require('../../config/logger')(_0xdaca('0x15'));var utils=require('../../config/utils');var config=require(_0xdaca('0x16'));var licenseUtil=require(_0xdaca('0x17'));var db=require(_0xdaca('0x18'))['db'];config['redis']=_[_0xdaca('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaca('0x1a'))(new Redis(config[_0xdaca('0x1b')]));require(_0xdaca('0x1c'))[_0xdaca('0x1d')](socket);function respondWithStatusCode(_0x57e520,_0x1f813c){_0x1f813c=_0x1f813c||0xcc;return function(_0x2dbf74){if(_0x2dbf74){return _0x57e520[_0xdaca('0x1e')](_0x1f813c);}return _0x57e520[_0xdaca('0x1f')](_0x1f813c)['end']();};}function respondWithResult(_0x216a26,_0x18f9f8){_0x18f9f8=_0x18f9f8||0xc8;return function(_0x42ba7e){if(_0x42ba7e){return _0x216a26[_0xdaca('0x1f')](_0x18f9f8)[_0xdaca('0x20')](_0x42ba7e);}};}function respondWithFilteredResult(_0x1fd790,_0xebbe4f){return function(_0x12aab0){if(_0x12aab0){var _0x269e8b=typeof _0xebbe4f[_0xdaca('0x21')]==='undefined'&&typeof _0xebbe4f[_0xdaca('0x22')]==='undefined';var _0x5b1e0c=_0x12aab0[_0xdaca('0x23')];var _0x496124=_0x269e8b?0x0:_0xebbe4f[_0xdaca('0x21')];var _0x4f9ba2=_0x269e8b?_0x12aab0[_0xdaca('0x23')]:_0xebbe4f[_0xdaca('0x21')]+_0xebbe4f[_0xdaca('0x22')];var _0x27deff;if(_0x4f9ba2>=_0x5b1e0c){_0x4f9ba2=_0x5b1e0c;_0x27deff=0xc8;}else{_0x27deff=0xce;}_0x1fd790[_0xdaca('0x1f')](_0x27deff);return _0x1fd790[_0xdaca('0x24')]('Content-Range',_0x496124+'-'+_0x4f9ba2+'/'+_0x5b1e0c)[_0xdaca('0x20')](_0x12aab0);}return null;};}function patchUpdates(_0x15200e){return function(_0x1088bd){try{jsonpatch[_0xdaca('0x25')](_0x1088bd,_0x15200e,!![]);}catch(_0x1924cb){return BPromise[_0xdaca('0x26')](_0x1924cb);}return _0x1088bd[_0xdaca('0x27')]();};}function saveUpdates(_0x126e74,_0x4f63f1){return function(_0x112e1d){if(_0x112e1d){return _0x112e1d[_0xdaca('0x28')](_0x126e74)[_0xdaca('0x29')](function(_0x511712){return _0x511712;});}return null;};}function removeEntity(_0x116e6d,_0x46df66){return function(_0x54a417){if(_0x54a417){return _0x54a417['destroy']()[_0xdaca('0x29')](function(){_0x116e6d[_0xdaca('0x1f')](0xcc)[_0xdaca('0x2a')]();});}};}function handleEntityNotFound(_0x126d42,_0x5c1a97){return function(_0x29df68){if(!_0x29df68){_0x126d42[_0xdaca('0x1e')](0x194);}return _0x29df68;};}function handleError(_0x10e5fa,_0x3fde9e){_0x3fde9e=_0x3fde9e||0x1f4;return function(_0x3a3f54){logger[_0xdaca('0x2b')](_0x3a3f54[_0xdaca('0x2c')]);if(_0x3a3f54[_0xdaca('0x2d')]){delete _0x3a3f54[_0xdaca('0x2d')];}_0x10e5fa[_0xdaca('0x1f')](_0x3fde9e)['send'](_0x3a3f54);};}exports[_0xdaca('0x2e')]=function(_0x2a824e,_0x467c1d){var _0x5e5545={},_0x5d0300={},_0x4ef109={'count':0x0,'rows':[]};var _0x311f1b=_['map'](db[_0xdaca('0x2f')][_0xdaca('0x30')],function(_0x51118f){return{'name':_0x51118f[_0xdaca('0x31')],'type':_0x51118f['type'][_0xdaca('0x32')]};});_0x5d0300[_0xdaca('0x33')]=_[_0xdaca('0x34')](_0x311f1b,'name');_0x5d0300[_0xdaca('0x35')]=_[_0xdaca('0x36')](_0x2a824e['query']);_0x5d0300['filters']=_[_0xdaca('0x37')](_0x5d0300['model'],_0x5d0300['query']);_0x5e5545[_0xdaca('0x38')]=_[_0xdaca('0x37')](_0x5d0300[_0xdaca('0x33')],qs['fields'](_0x2a824e[_0xdaca('0x35')]['fields']));_0x5e5545[_0xdaca('0x38')]=_0x5e5545[_0xdaca('0x38')]['length']?_0x5e5545[_0xdaca('0x38')]:_0x5d0300[_0xdaca('0x33')];if(!_0x2a824e[_0xdaca('0x35')]['hasOwnProperty'](_0xdaca('0x39'))){_0x5e5545['limit']=qs['limit'](_0x2a824e['query'][_0xdaca('0x22')]);_0x5e5545[_0xdaca('0x21')]=qs[_0xdaca('0x21')](_0x2a824e[_0xdaca('0x35')][_0xdaca('0x21')]);}_0x5e5545[_0xdaca('0x3a')]=qs[_0xdaca('0x3b')](_0x2a824e[_0xdaca('0x35')][_0xdaca('0x3b')]);_0x5e5545['where']=qs[_0xdaca('0x3c')](_['pick'](_0x2a824e['query'],_0x5d0300[_0xdaca('0x3c')]),_0x311f1b);if(_0x2a824e['query']['filter']){_0x5e5545[_0xdaca('0x3d')]=_['merge'](_0x5e5545[_0xdaca('0x3d')],{'$or':_[_0xdaca('0x34')](_0x311f1b,function(_0x122072){if(_0x122072['type']!==_0xdaca('0x3e')){var _0x422a23={};_0x422a23[_0x122072['name']]={'$like':'%'+_0x2a824e[_0xdaca('0x35')][_0xdaca('0x3f')]+'%'};return _0x422a23;}})});}_0x5e5545=_[_0xdaca('0x40')]({},_0x5e5545,_0x2a824e[_0xdaca('0x41')]);var _0x408fa0={'where':_0x5e5545[_0xdaca('0x3d')]};return db[_0xdaca('0x2f')][_0xdaca('0x23')](_0x408fa0)['then'](function(_0x354d98){_0x4ef109[_0xdaca('0x23')]=_0x354d98;if(_0x2a824e[_0xdaca('0x35')][_0xdaca('0x42')]){_0x5e5545['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xdaca('0x43')](_0x5e5545);})[_0xdaca('0x29')](function(_0xa47f5c){_0x4ef109[_0xdaca('0x44')]=_0xa47f5c;return _0x4ef109;})[_0xdaca('0x29')](respondWithFilteredResult(_0x467c1d,_0x5e5545))['catch'](handleError(_0x467c1d,null));};exports[_0xdaca('0x45')]=function(_0x5e9c1d,_0x17f20d){var _0x2c71b5={'raw':!![],'where':{'id':_0x5e9c1d['params']['id']}},_0x314e50={};_0x314e50['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x314e50[_0xdaca('0x35')]=_[_0xdaca('0x36')](_0x5e9c1d['query']);_0x314e50['filters']=_[_0xdaca('0x37')](_0x314e50[_0xdaca('0x33')],_0x314e50['query']);_0x2c71b5[_0xdaca('0x38')]=_[_0xdaca('0x37')](_0x314e50[_0xdaca('0x33')],qs[_0xdaca('0x46')](_0x5e9c1d[_0xdaca('0x35')]['fields']));_0x2c71b5[_0xdaca('0x38')]=_0x2c71b5[_0xdaca('0x38')][_0xdaca('0x47')]?_0x2c71b5[_0xdaca('0x38')]:_0x314e50[_0xdaca('0x33')];if(_0x5e9c1d[_0xdaca('0x35')][_0xdaca('0x42')]){_0x2c71b5[_0xdaca('0x48')]=[{'all':!![]}];}_0x2c71b5=_[_0xdaca('0x40')]({},_0x2c71b5,_0x5e9c1d[_0xdaca('0x41')]);return db['ChatInternalMessage'][_0xdaca('0x49')](_0x2c71b5)['then'](handleEntityNotFound(_0x17f20d,null))[_0xdaca('0x29')](respondWithResult(_0x17f20d,null))[_0xdaca('0x4a')](handleError(_0x17f20d,null));};exports['create']=function(_0x5f4a2b,_0x5f0527){return db[_0xdaca('0x2f')][_0xdaca('0x4b')](_0x5f4a2b[_0xdaca('0x4c')],{})['then'](respondWithResult(_0x5f0527,0xc9))[_0xdaca('0x4a')](handleError(_0x5f0527,null));};exports[_0xdaca('0x28')]=function(_0x11119f,_0x26f6e5){if(_0x11119f[_0xdaca('0x4c')]['id']){delete _0x11119f[_0xdaca('0x4c')]['id'];}return db[_0xdaca('0x2f')][_0xdaca('0x49')]({'where':{'id':_0x11119f[_0xdaca('0x4d')]['id']}})[_0xdaca('0x29')](handleEntityNotFound(_0x26f6e5,null))[_0xdaca('0x29')](saveUpdates(_0x11119f[_0xdaca('0x4c')],null))[_0xdaca('0x29')](respondWithResult(_0x26f6e5,null))['catch'](handleError(_0x26f6e5,null));};exports[_0xdaca('0x4e')]=function(_0x2a4c54,_0x4437c3){return db['ChatInternalMessage'][_0xdaca('0x49')]({'where':{'id':_0x2a4c54[_0xdaca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4437c3,null))['then'](removeEntity(_0x4437c3,null))[_0xdaca('0x4a')](handleError(_0x4437c3,null));};exports[_0xdaca('0x4f')]=function(_0x170457,_0xac6dd){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0xac6dd,null))[_0xdaca('0x4a')](handleError(_0xac6dd,null));};function wrapUser(_0x4504a2){return function(_0x334875){var _0x4a9d5a=_0x4504a2[_0xdaca('0x50')]({'plain':!![]});_0x4a9d5a[_0xdaca('0x51')]=[];if(_0x334875){_0x4a9d5a['lastMessageAt']=_0x334875['createdAt'];_0x4a9d5a['lastMessage']=_0x334875;}else{_0x4a9d5a['lastMessageAt']=moment(0x0)[_0xdaca('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a9d5a['lastMessage']={};}return _0x4a9d5a;};}exports[_0xdaca('0x53')]=function(_0x40ee3b,_0x58b255,_0x532f5c){var _0x9b7d7=[];return db[_0xdaca('0x54')][_0xdaca('0x43')]({'where':{'role':[_0xdaca('0x55'),'admin',_0xdaca('0x56')]},'attributes':['id',_0xdaca('0x57'),_0xdaca('0x2d'),'role',_0xdaca('0x58'),_0xdaca('0x59'),_0xdaca('0x5a'),_0xdaca('0x5b'),_0xdaca('0x5c'),'showWebBar'],'order':qs[_0xdaca('0x3b')]('-online'),'include':[{'model':db[_0xdaca('0x5d')],'as':'VoiceQueues','attributes':['id',_0xdaca('0x2d'),_0xdaca('0x5e')],'through':{'attributes':[]}}]})[_0xdaca('0x29')](function(_0x2e7345){if(_0x2e7345){var _0x1e50bc=_0x40ee3b['user'][_0xdaca('0x50')]({'plain':!![]});if(!_0x1e50bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e50bc[_0xdaca('0x5f')]==='user'){return db[_0xdaca('0x60')][_0xdaca('0x49')]({'where':{'name':_0xdaca('0x61'),'userProfileId':_0x1e50bc['userProfileId']},'raw':!![]})['then'](function(_0x1a51cb){if(_0x1a51cb){if(_0x1a51cb['autoAssociation']===0x0){return db[_0xdaca('0x62')]['findAll']({'where':{'sectionId':_0x1a51cb['id']},'raw':!![]})[_0xdaca('0x29')](function(_0x702cf5){var _0x1caa59=[];if(_['isEmpty'](_0x702cf5)){_0x1caa59=_[_0xdaca('0x3f')](_0x2e7345,function(_0x1caefc){if(_0x1caefc[_0xdaca('0x5f')]!=='agent'){return _0x1caefc;}});return _0x1caa59;}else{for(var _0x2d3066=0x0;_0x2d3066<_0x2e7345[_0xdaca('0x47')];_0x2d3066++){var _0x556e54=_0x2e7345[_0x2d3066];if(_0x556e54[_0xdaca('0x5f')]==='agent'){var _0x3500d2=_['find'](_0x702cf5,function(_0x22d822){return _0x22d822[_0xdaca('0x63')]===_0x556e54['id'];});if(_0x3500d2)_0x1caa59['push'](_0x556e54);}else{_0x1caa59[_0xdaca('0x64')](_0x556e54);}}return _0x1caa59;}});}else{return _0x2e7345;}}else{var _0x1b77a2=_[_0xdaca('0x3f')](_0x2e7345,function(_0x47d294){if(_0x47d294[_0xdaca('0x5f')]!=='agent'){return _0x47d294;}});return _0x1b77a2;}});}else{return _0x2e7345;}}})[_0xdaca('0x29')](function(_0x373eda){var _0x1a000e=[];if(_0x373eda){_0x9b7d7=_0x373eda;for(var _0x4d1975=0x0;_0x4d1975<_0x373eda[_0xdaca('0x47')];_0x4d1975+=0x1){_0x9b7d7[_0x4d1975][_0xdaca('0x51')]=[];_0x1a000e['push'](db['ChatInternalMessage'][_0xdaca('0x49')]({'where':{'FromId':[_0x40ee3b[_0xdaca('0x56')]['id'],_0x373eda[_0x4d1975]['id']],'ToId':[_0x40ee3b[_0xdaca('0x56')]['id'],_0x373eda[_0x4d1975]['id']],'ChatGroupId':null},'attributes':['id',_0xdaca('0x65'),_0xdaca('0x66'),_0xdaca('0x67'),_0xdaca('0x68'),_0xdaca('0x4c')],'order':qs['sort'](_0xdaca('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdaca('0x29')](wrapUser(_0x373eda[_0x4d1975])));}return BPromise[_0xdaca('0x6a')](_0x1a000e);}return[];})[_0xdaca('0x29')](function(_0x2c523f){return{'rows':_0x2c523f,'count':_0x2c523f[_0xdaca('0x47')]};})[_0xdaca('0x29')](respondWithResult(_0x58b255,null))[_0xdaca('0x4a')](handleError(_0x58b255,null));};
\ No newline at end of file
+var _0x73b0=['socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost'];(function(_0x1847c3,_0x4155c9){var _0x1802af=function(_0x25a210){while(--_0x25a210){_0x1847c3['push'](_0x1847c3['shift']());}};_0x1802af(++_0x4155c9);}(_0x73b0,0x149));var _0x073b=function(_0x48a1ee,_0x4354fe){_0x48a1ee=_0x48a1ee-0x0;var _0x5ce1d3=_0x73b0[_0x48a1ee];return _0x5ce1d3;};'use strict';var emlformat=require(_0x073b('0x0'));var rimraf=require(_0x073b('0x1'));var zipdir=require(_0x073b('0x2'));var jsonpatch=require(_0x073b('0x3'));var rp=require(_0x073b('0x4'));var moment=require(_0x073b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x073b('0x6'));var sox=require(_0x073b('0x7'));var csv=require('to-csv');var ejs=require(_0x073b('0x8'));var fs=require('fs');var fs_extra=require(_0x073b('0x9'));var _=require('lodash');var squel=require(_0x073b('0xa'));var crypto=require(_0x073b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x073b('0xc'));var toCsv=require(_0x073b('0xd'));var querystring=require(_0x073b('0xe'));var Papa=require(_0x073b('0xf'));var Redis=require('ioredis');var authService=require(_0x073b('0x10'));var qs=require(_0x073b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x073b('0x12'));var logger=require(_0x073b('0x13'))(_0x073b('0x14'));var utils=require(_0x073b('0x15'));var config=require(_0x073b('0x16'));var licenseUtil=require(_0x073b('0x17'));var db=require(_0x073b('0x18'))['db'];config['redis']=_[_0x073b('0x19')](config[_0x073b('0x1a')],{'host':_0x073b('0x1b'),'port':0x18eb});var socket=require(_0x073b('0x1c'))(new Redis(config[_0x073b('0x1a')]));require(_0x073b('0x1d'))[_0x073b('0x1e')](socket);function respondWithStatusCode(_0x588681,_0xa144fc){_0xa144fc=_0xa144fc||0xcc;return function(_0x467ebd){if(_0x467ebd){return _0x588681['sendStatus'](_0xa144fc);}return _0x588681[_0x073b('0x1f')](_0xa144fc)[_0x073b('0x20')]();};}function respondWithResult(_0x5e8bb6,_0x1590e9){_0x1590e9=_0x1590e9||0xc8;return function(_0x28abc5){if(_0x28abc5){return _0x5e8bb6[_0x073b('0x1f')](_0x1590e9)[_0x073b('0x21')](_0x28abc5);}};}function respondWithFilteredResult(_0x404f1f,_0x24748a){return function(_0x39a790){if(_0x39a790){var _0x4749a2=typeof _0x24748a['offset']===_0x073b('0x22')&&typeof _0x24748a['limit']===_0x073b('0x22');var _0x5b411f=_0x39a790['count'];var _0x2be0a0=_0x4749a2?0x0:_0x24748a[_0x073b('0x23')];var _0x783e5b=_0x4749a2?_0x39a790[_0x073b('0x24')]:_0x24748a[_0x073b('0x23')]+_0x24748a[_0x073b('0x25')];var _0x2c3d80;if(_0x783e5b>=_0x5b411f){_0x783e5b=_0x5b411f;_0x2c3d80=0xc8;}else{_0x2c3d80=0xce;}_0x404f1f[_0x073b('0x1f')](_0x2c3d80);return _0x404f1f['set'](_0x073b('0x26'),_0x2be0a0+'-'+_0x783e5b+'/'+_0x5b411f)[_0x073b('0x21')](_0x39a790);}return null;};}function patchUpdates(_0x175466){return function(_0x2ee0a6){try{jsonpatch[_0x073b('0x27')](_0x2ee0a6,_0x175466,!![]);}catch(_0x289207){return BPromise[_0x073b('0x28')](_0x289207);}return _0x2ee0a6['save']();};}function saveUpdates(_0x39b3fa,_0x50de29){return function(_0x22be4b){if(_0x22be4b){return _0x22be4b[_0x073b('0x29')](_0x39b3fa)[_0x073b('0x2a')](function(_0x1f4cc5){return _0x1f4cc5;});}return null;};}function removeEntity(_0x292d6a,_0x2426cc){return function(_0x7fb180){if(_0x7fb180){return _0x7fb180[_0x073b('0x2b')]()['then'](function(){_0x292d6a[_0x073b('0x1f')](0xcc)[_0x073b('0x20')]();});}};}function handleEntityNotFound(_0xdd1989,_0x1c44a9){return function(_0x2132b3){if(!_0x2132b3){_0xdd1989[_0x073b('0x2c')](0x194);}return _0x2132b3;};}function handleError(_0xc8c729,_0x4c5dfb){_0x4c5dfb=_0x4c5dfb||0x1f4;return function(_0x4a8175){logger[_0x073b('0x2d')](_0x4a8175[_0x073b('0x2e')]);if(_0x4a8175[_0x073b('0x2f')]){delete _0x4a8175['name'];}_0xc8c729[_0x073b('0x1f')](_0x4c5dfb)[_0x073b('0x30')](_0x4a8175);};}exports[_0x073b('0x31')]=function(_0x2d950b,_0x15d214){var _0x23cc84={},_0x1cf9b2={},_0x426be7={'count':0x0,'rows':[]};var _0x335c71=_['map'](db[_0x073b('0x32')][_0x073b('0x33')],function(_0xec5eef){return{'name':_0xec5eef[_0x073b('0x34')],'type':_0xec5eef[_0x073b('0x35')][_0x073b('0x36')]};});_0x1cf9b2['model']=_[_0x073b('0x37')](_0x335c71,_0x073b('0x2f'));_0x1cf9b2[_0x073b('0x38')]=_['keys'](_0x2d950b[_0x073b('0x38')]);_0x1cf9b2[_0x073b('0x39')]=_[_0x073b('0x3a')](_0x1cf9b2[_0x073b('0x3b')],_0x1cf9b2[_0x073b('0x38')]);_0x23cc84[_0x073b('0x3c')]=_[_0x073b('0x3a')](_0x1cf9b2[_0x073b('0x3b')],qs[_0x073b('0x3d')](_0x2d950b[_0x073b('0x38')][_0x073b('0x3d')]));_0x23cc84[_0x073b('0x3c')]=_0x23cc84[_0x073b('0x3c')][_0x073b('0x3e')]?_0x23cc84[_0x073b('0x3c')]:_0x1cf9b2[_0x073b('0x3b')];if(!_0x2d950b[_0x073b('0x38')][_0x073b('0x3f')](_0x073b('0x40'))){_0x23cc84[_0x073b('0x25')]=qs['limit'](_0x2d950b[_0x073b('0x38')][_0x073b('0x25')]);_0x23cc84[_0x073b('0x23')]=qs[_0x073b('0x23')](_0x2d950b[_0x073b('0x38')]['offset']);}_0x23cc84[_0x073b('0x41')]=qs[_0x073b('0x42')](_0x2d950b[_0x073b('0x38')]['sort']);_0x23cc84[_0x073b('0x43')]=qs[_0x073b('0x39')](_['pick'](_0x2d950b[_0x073b('0x38')],_0x1cf9b2['filters']),_0x335c71);if(_0x2d950b[_0x073b('0x38')][_0x073b('0x44')]){_0x23cc84[_0x073b('0x43')]=_['merge'](_0x23cc84[_0x073b('0x43')],{'$or':_[_0x073b('0x37')](_0x335c71,function(_0x2d1ef0){if(_0x2d1ef0[_0x073b('0x35')]!==_0x073b('0x45')){var _0x17a536={};_0x17a536[_0x2d1ef0[_0x073b('0x2f')]]={'$like':'%'+_0x2d950b[_0x073b('0x38')]['filter']+'%'};return _0x17a536;}})});}_0x23cc84=_[_0x073b('0x46')]({},_0x23cc84,_0x2d950b[_0x073b('0x47')]);var _0x41be60={'where':_0x23cc84[_0x073b('0x43')]};return db[_0x073b('0x32')][_0x073b('0x24')](_0x41be60)[_0x073b('0x2a')](function(_0x5c8ceb){_0x426be7[_0x073b('0x24')]=_0x5c8ceb;if(_0x2d950b[_0x073b('0x38')][_0x073b('0x48')]){_0x23cc84[_0x073b('0x49')]=[{'all':!![]}];}return db[_0x073b('0x32')][_0x073b('0x4a')](_0x23cc84);})[_0x073b('0x2a')](function(_0x4614e1){_0x426be7[_0x073b('0x4b')]=_0x4614e1;return _0x426be7;})[_0x073b('0x2a')](respondWithFilteredResult(_0x15d214,_0x23cc84))[_0x073b('0x4c')](handleError(_0x15d214,null));};exports[_0x073b('0x4d')]=function(_0x4e7bc4,_0x155df0){var _0x531670={'raw':!![],'where':{'id':_0x4e7bc4[_0x073b('0x4e')]['id']}},_0x1231a5={};_0x1231a5[_0x073b('0x3b')]=_[_0x073b('0x4f')](db[_0x073b('0x32')]['rawAttributes']);_0x1231a5['query']=_[_0x073b('0x4f')](_0x4e7bc4[_0x073b('0x38')]);_0x1231a5['filters']=_[_0x073b('0x3a')](_0x1231a5[_0x073b('0x3b')],_0x1231a5[_0x073b('0x38')]);_0x531670[_0x073b('0x3c')]=_[_0x073b('0x3a')](_0x1231a5['model'],qs[_0x073b('0x3d')](_0x4e7bc4['query']['fields']));_0x531670[_0x073b('0x3c')]=_0x531670[_0x073b('0x3c')][_0x073b('0x3e')]?_0x531670[_0x073b('0x3c')]:_0x1231a5[_0x073b('0x3b')];if(_0x4e7bc4[_0x073b('0x38')][_0x073b('0x48')]){_0x531670['include']=[{'all':!![]}];}_0x531670=_[_0x073b('0x46')]({},_0x531670,_0x4e7bc4[_0x073b('0x47')]);return db['ChatInternalMessage']['find'](_0x531670)[_0x073b('0x2a')](handleEntityNotFound(_0x155df0,null))[_0x073b('0x2a')](respondWithResult(_0x155df0,null))[_0x073b('0x4c')](handleError(_0x155df0,null));};exports[_0x073b('0x50')]=function(_0xb26273,_0x4d30c1){return db[_0x073b('0x32')]['create'](_0xb26273[_0x073b('0x51')],{})[_0x073b('0x2a')](respondWithResult(_0x4d30c1,0xc9))[_0x073b('0x4c')](handleError(_0x4d30c1,null));};exports['update']=function(_0x13117e,_0x51aac4){if(_0x13117e[_0x073b('0x51')]['id']){delete _0x13117e['body']['id'];}return db['ChatInternalMessage'][_0x073b('0x52')]({'where':{'id':_0x13117e[_0x073b('0x4e')]['id']}})[_0x073b('0x2a')](handleEntityNotFound(_0x51aac4,null))['then'](saveUpdates(_0x13117e[_0x073b('0x51')],null))[_0x073b('0x2a')](respondWithResult(_0x51aac4,null))[_0x073b('0x4c')](handleError(_0x51aac4,null));};exports[_0x073b('0x2b')]=function(_0x56db47,_0x41cc27){return db[_0x073b('0x32')][_0x073b('0x52')]({'where':{'id':_0x56db47[_0x073b('0x4e')]['id']}})[_0x073b('0x2a')](handleEntityNotFound(_0x41cc27,null))[_0x073b('0x2a')](removeEntity(_0x41cc27,null))[_0x073b('0x4c')](handleError(_0x41cc27,null));};exports[_0x073b('0x53')]=function(_0x36fe81,_0x2240d8){return db[_0x073b('0x32')][_0x073b('0x53')]()['then'](respondWithResult(_0x2240d8,null))[_0x073b('0x4c')](handleError(_0x2240d8,null));};function wrapUser(_0x2eb614){return function(_0x17c993){var _0x147a1c=_0x2eb614[_0x073b('0x54')]({'plain':!![]});_0x147a1c['messages']=[];if(_0x17c993){_0x147a1c[_0x073b('0x55')]=_0x17c993[_0x073b('0x56')];_0x147a1c['lastMessage']=_0x17c993;}else{_0x147a1c[_0x073b('0x55')]=moment(0x0)[_0x073b('0x57')](_0x073b('0x58'));_0x147a1c[_0x073b('0x59')]={};}return _0x147a1c;};}exports[_0x073b('0x5a')]=function(_0x5376ca,_0x2d17e2,_0x2a0e4b){var _0x4219ef=[];return db[_0x073b('0x5b')][_0x073b('0x4a')]({'where':{'role':[_0x073b('0x5c'),_0x073b('0x5d'),_0x073b('0x5e')]},'attributes':['id',_0x073b('0x5f'),_0x073b('0x2f'),_0x073b('0x60'),_0x073b('0x61'),_0x073b('0x62'),_0x073b('0x63'),_0x073b('0x64'),_0x073b('0x65'),_0x073b('0x66')],'order':qs[_0x073b('0x42')]('-online'),'include':[{'model':db[_0x073b('0x67')],'as':_0x073b('0x68'),'attributes':['id',_0x073b('0x2f'),_0x073b('0x35')],'through':{'attributes':[]}}]})[_0x073b('0x2a')](function(_0xe5ee3d){if(_0xe5ee3d){var _0x16d7f5=_0x5376ca['user']['get']({'plain':!![]});if(!_0x16d7f5)throw new Error(_0x073b('0x69'));if(_0x16d7f5[_0x073b('0x60')]===_0x073b('0x5e')){return db[_0x073b('0x6a')][_0x073b('0x52')]({'where':{'name':_0x073b('0x6b'),'userProfileId':_0x16d7f5[_0x073b('0x6c')]},'raw':!![]})[_0x073b('0x2a')](function(_0x24ba39){if(_0x24ba39){if(_0x24ba39[_0x073b('0x6d')]===0x0){return db[_0x073b('0x6e')][_0x073b('0x4a')]({'where':{'sectionId':_0x24ba39['id']},'raw':!![]})['then'](function(_0xc4d8e3){var _0x1b3abe=[];if(_[_0x073b('0x6f')](_0xc4d8e3)){_0x1b3abe=_[_0x073b('0x44')](_0xe5ee3d,function(_0x1be5d1){if(_0x1be5d1[_0x073b('0x60')]!==_0x073b('0x5c')){return _0x1be5d1;}});return _0x1b3abe;}else{for(var _0xf582e2=0x0;_0xf582e2<_0xe5ee3d[_0x073b('0x3e')];_0xf582e2++){var _0x33e867=_0xe5ee3d[_0xf582e2];if(_0x33e867['role']==='agent'){var _0x20efdb=_[_0x073b('0x52')](_0xc4d8e3,function(_0xcf07a8){return _0xcf07a8[_0x073b('0x70')]===_0x33e867['id'];});if(_0x20efdb)_0x1b3abe[_0x073b('0x71')](_0x33e867);}else{_0x1b3abe['push'](_0x33e867);}}return _0x1b3abe;}});}else{return _0xe5ee3d;}}else{var _0x39c80a=_[_0x073b('0x44')](_0xe5ee3d,function(_0x5e9a1c){if(_0x5e9a1c['role']!=='agent'){return _0x5e9a1c;}});return _0x39c80a;}});}else{return _0xe5ee3d;}}})[_0x073b('0x2a')](function(_0x1d2405){var _0x59fc48=[];if(_0x1d2405){_0x4219ef=_0x1d2405;for(var _0x2669a7=0x0;_0x2669a7<_0x1d2405[_0x073b('0x3e')];_0x2669a7+=0x1){_0x4219ef[_0x2669a7][_0x073b('0x72')]=[];_0x59fc48[_0x073b('0x71')](db[_0x073b('0x32')][_0x073b('0x52')]({'where':{'FromId':[_0x5376ca[_0x073b('0x5e')]['id'],_0x1d2405[_0x2669a7]['id']],'ToId':[_0x5376ca[_0x073b('0x5e')]['id'],_0x1d2405[_0x2669a7]['id']],'ChatGroupId':null},'attributes':['id',_0x073b('0x56'),_0x073b('0x73'),_0x073b('0x74'),_0x073b('0x75'),_0x073b('0x51')],'order':qs[_0x073b('0x42')](_0x073b('0x76')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1d2405[_0x2669a7])));}return BPromise['all'](_0x59fc48);}return[];})[_0x073b('0x2a')](function(_0xd93eaf){return{'rows':_0xd93eaf,'count':_0xd93eaf[_0x073b('0x3e')]};})[_0x073b('0x2a')](respondWithResult(_0x2d17e2,null))[_0x073b('0x4c')](handleError(_0x2d17e2,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1278efd..820d6c9 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 _0x5939=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5939,0x1dc));var _0x9593=function(_0x2f6bf5,_0x5e5945){_0x2f6bf5=_0x2f6bf5-0x0;var _0x467833=_0x5939[_0x2f6bf5];return _0x467833;};'use strict';var EventEmitter=require(_0x9593('0x0'));var ChatInternalMessage=require(_0x9593('0x1'))['db'][_0x9593('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9593('0x3')](0x0);var events={'afterCreate':_0x9593('0x4'),'afterUpdate':_0x9593('0x5'),'afterDestroy':_0x9593('0x6')};function emitEvent(_0x455ea7){return function(_0x1c7d72,_0x31f79c,_0x5ba4a7){ChatInternalMessageEvents['emit'](_0x455ea7+':'+_0x1c7d72['id'],_0x1c7d72);ChatInternalMessageEvents[_0x9593('0x7')](_0x455ea7,_0x1c7d72);_0x5ba4a7(null);};}for(var e in events){if(events[_0x9593('0x8')](e)){var event=events[e];ChatInternalMessage[_0x9593('0x9')](e,emitEvent(event));}}module[_0x9593('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x95c8=['hook','exports','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty'];(function(_0x47f2eb,_0x17bb2e){var _0x7dee61=function(_0x366457){while(--_0x366457){_0x47f2eb['push'](_0x47f2eb['shift']());}};_0x7dee61(++_0x17bb2e);}(_0x95c8,0x16a));var _0x895c=function(_0x257aa2,_0x38baa0){_0x257aa2=_0x257aa2-0x0;var _0x293652=_0x95c8[_0x257aa2];return _0x293652;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x895c('0x0'))['db'][_0x895c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x895c('0x2'),'afterUpdate':_0x895c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25a39e){return function(_0x8f63a,_0x3d77b0,_0x38a8e9){ChatInternalMessageEvents[_0x895c('0x4')](_0x25a39e+':'+_0x8f63a['id'],_0x8f63a);ChatInternalMessageEvents[_0x895c('0x4')](_0x25a39e,_0x8f63a);_0x38a8e9(null);};}for(var e in events){if(events[_0x895c('0x5')](e)){var event=events[e];ChatInternalMessage[_0x895c('0x6')](e,emitEvent(event));}}module[_0x895c('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 21bdbfd..7386506 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 _0xe18c=['util','api','moment','bluebird','rimraf','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe18c,0xdb));var _0xce18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe18c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var logger=require('../../config/logger')(_0xce18('0x2'));var moment=require(_0xce18('0x3'));var BPromise=require(_0xce18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce18('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xce18('0x6')]=function(_0x1dc780,_0x4b0899){return _0x1dc780['define'](_0xce18('0x7'),attributes,{'tableName':_0xce18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce18('0x9'),'collate':_0xce18('0xa')});};
\ No newline at end of file
+var _0x18ef=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1206a3,_0xd655f1){var _0x4d2ad5=function(_0x4cc1c6){while(--_0x4cc1c6){_0x1206a3['push'](_0x1206a3['shift']());}};_0x4d2ad5(++_0xd655f1);}(_0x18ef,0x146));var _0xf18e=function(_0x2a3003,_0x12142a){_0x2a3003=_0x2a3003-0x0;var _0xe6ae37=_0x18ef[_0x2a3003];return _0xe6ae37;};'use strict';var _=require(_0xf18e('0x0'));var util=require(_0xf18e('0x1'));var logger=require(_0xf18e('0x2'))(_0xf18e('0x3'));var moment=require(_0xf18e('0x4'));var BPromise=require(_0xf18e('0x5'));var rp=require(_0xf18e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf18e('0x7'));var config=require(_0xf18e('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xf18e('0x9')]=function(_0x449547,_0x3cefcf){return _0x449547[_0xf18e('0xa')](_0xf18e('0xb'),attributes,{'tableName':_0xf18e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf18e('0xd'),'collate':_0xf18e('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index dfb2b60..0cc5ff3 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 _0x5a66=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x5a66,0x169));var _0x65a6=function(_0x1ac9f1,_0x2de131){_0x1ac9f1=_0x1ac9f1-0x0;var _0x2924dc=_0x5a66[_0x1ac9f1];return _0x2924dc;};'use strict';var _=require('lodash');var util=require(_0x65a6('0x0'));var moment=require(_0x65a6('0x1'));var BPromise=require(_0x65a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65a6('0x3'));var db=require(_0x65a6('0x4'))['db'];var utils=require(_0x65a6('0x5'));var logger=require(_0x65a6('0x6'))('rpc');var config=require(_0x65a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65a6('0x8')][_0x65a6('0x9')]({'port':0x232a});config[_0x65a6('0xa')]=_[_0x65a6('0xb')](config[_0x65a6('0xa')],{'host':_0x65a6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65a6('0xa')]));require(_0x65a6('0xd'))[_0x65a6('0xe')](socket);function respondWithRpcPromise(_0x277237,_0x303db0,_0x1de468){return new BPromise(function(_0x17bcd3,_0x43e5fe){return client[_0x65a6('0xf')](_0x277237,_0x1de468)[_0x65a6('0x10')](function(_0x56ad8a){logger[_0x65a6('0x11')](_0x65a6('0x12'),_0x303db0,_0x65a6('0x13'));logger[_0x65a6('0x14')](_0x65a6('0x15'),_0x303db0,_0x65a6('0x13'),JSON[_0x65a6('0x16')](_0x56ad8a));if(_0x56ad8a[_0x65a6('0x17')]){if(_0x56ad8a['error']['code']===0x1f4){logger['error'](_0x65a6('0x12'),_0x303db0,_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);return _0x43e5fe(_0x56ad8a[_0x65a6('0x17')]['message']);}logger['error'](_0x65a6('0x12'),_0x303db0,_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);return _0x17bcd3(_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);}else{logger[_0x65a6('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x303db0,_0x65a6('0x13'));_0x17bcd3(_0x56ad8a[_0x65a6('0x19')][_0x65a6('0x18')]);}})[_0x65a6('0x1a')](function(_0x1a9473){logger[_0x65a6('0x17')](_0x65a6('0x12'),_0x303db0,_0x1a9473);_0x43e5fe(_0x1a9473);});});}
\ No newline at end of file
+var _0x6a8e=['defaults','localhost','./chatInternalMessage.socket','register','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatInternalMessage,\x20%s,\x20%s','message','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x1bcf34,_0xf080e3){_0x1bcf34=_0x1bcf34-0x0;var _0x1691b1=_0x6a8e[_0x1bcf34];return _0x1691b1;};'use strict';var _=require('lodash');var util=require(_0xe6a8('0x0'));var moment=require('moment');var BPromise=require(_0xe6a8('0x1'));var rs=require(_0xe6a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6a8('0x3'))['db'];var utils=require(_0xe6a8('0x4'));var logger=require(_0xe6a8('0x5'))(_0xe6a8('0x6'));var config=require(_0xe6a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe6a8('0x8')][_0xe6a8('0x9')]({'port':0x232a});config[_0xe6a8('0xa')]=_[_0xe6a8('0xb')](config[_0xe6a8('0xa')],{'host':_0xe6a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe6a8('0xd'))[_0xe6a8('0xe')](socket);function respondWithRpcPromise(_0x5819d2,_0x3a2de1,_0x1f4e1f){return new BPromise(function(_0x26f98b,_0x1cbb69){return client['request'](_0x5819d2,_0x1f4e1f)[_0xe6a8('0xf')](function(_0x4ba96c){logger[_0xe6a8('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,'request\x20sent');logger[_0xe6a8('0x11')](_0xe6a8('0x12'),_0x3a2de1,_0xe6a8('0x13'),JSON['stringify'](_0x4ba96c));if(_0x4ba96c[_0xe6a8('0x14')]){if(_0x4ba96c[_0xe6a8('0x14')]['code']===0x1f4){logger[_0xe6a8('0x14')](_0xe6a8('0x15'),_0x3a2de1,_0x4ba96c[_0xe6a8('0x14')]['message']);return _0x1cbb69(_0x4ba96c[_0xe6a8('0x14')]['message']);}logger[_0xe6a8('0x14')](_0xe6a8('0x15'),_0x3a2de1,_0x4ba96c[_0xe6a8('0x14')]['message']);return _0x26f98b(_0x4ba96c[_0xe6a8('0x14')][_0xe6a8('0x16')]);}else{logger[_0xe6a8('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,_0xe6a8('0x13'));_0x26f98b(_0x4ba96c['result'][_0xe6a8('0x16')]);}})['catch'](function(_0x4753ba){logger[_0xe6a8('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,_0x4753ba);_0x1cbb69(_0x4753ba);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 03f0af3..b0d914a 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 _0x12bc=['save','remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x35f193,_0xe0e187){var _0x31127b=function(_0xb99605){while(--_0xb99605){_0x35f193['push'](_0x35f193['shift']());}};_0x31127b(++_0xe0e187);}(_0x12bc,0x8f));var _0xc12b=function(_0x158dd7,_0x1f5f90){_0x158dd7=_0x158dd7-0x0;var _0x1772ba=_0x12bc[_0x158dd7];return _0x1772ba;};'use strict';var ChatInternalMessageEvents=require(_0xc12b('0x0'));var events=[_0xc12b('0x1'),_0xc12b('0x2'),_0xc12b('0x3')];function createListener(_0x185ff1,_0x3a1e49){return function(_0x4b3207){_0x3a1e49[_0xc12b('0x4')](_0x185ff1,_0x4b3207);};}function removeListener(_0x6f667a,_0x4b36e6){return function(){ChatInternalMessageEvents['removeListener'](_0x6f667a,_0x4b36e6);};}exports[_0xc12b('0x5')]=function(_0x1de8af){for(var _0x3ddd3d=0x0,_0x5f066f=events[_0xc12b('0x6')];_0x3ddd3d<_0x5f066f;_0x3ddd3d++){var _0x9b4cc7=events[_0x3ddd3d];var _0x59ad4a=createListener(_0xc12b('0x7')+_0x9b4cc7,_0x1de8af);ChatInternalMessageEvents['on'](_0x9b4cc7,_0x59ad4a);}};
\ No newline at end of file
+var _0xe0df=['removeListener','register','length','./chatInternalMessage.events','save','emit'];(function(_0x1b29b2,_0x3b6b11){var _0x560b68=function(_0x50a4ea){while(--_0x50a4ea){_0x1b29b2['push'](_0x1b29b2['shift']());}};_0x560b68(++_0x3b6b11);}(_0xe0df,0xcf));var _0xfe0d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe0df[_0x618414];return _0x21c19a;};'use strict';var ChatInternalMessageEvents=require(_0xfe0d('0x0'));var events=[_0xfe0d('0x1'),'remove','update'];function createListener(_0x297130,_0x558376){return function(_0x45c74d){_0x558376[_0xfe0d('0x2')](_0x297130,_0x45c74d);};}function removeListener(_0x5de162,_0x535162){return function(){ChatInternalMessageEvents[_0xfe0d('0x3')](_0x5de162,_0x535162);};}exports[_0xfe0d('0x4')]=function(_0x4fdc54){for(var _0x232986=0x0,_0x24fd73=events[_0xfe0d('0x5')];_0x232986<_0x24fd73;_0x232986++){var _0x5f0449=events[_0x232986];var _0x4b23ff=createListener('chatInternalMessage:'+_0x5f0449,_0x4fdc54);ChatInternalMessageEvents['on'](_0x5f0449,_0x4b23ff);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index b739011..6e4b70b 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 _0x76b4=['describe','/users','getUsers','/:id','show','create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x58f29c,_0x551df2){var _0x5266ed=function(_0x421cbc){while(--_0x421cbc){_0x58f29c['push'](_0x58f29c['shift']());}};_0x5266ed(++_0x551df2);}(_0x76b4,0x110));var _0x476b=function(_0x14eb67,_0x3d8244){_0x14eb67=_0x14eb67-0x0;var _0x13d982=_0x76b4[_0x14eb67];return _0x13d982;};'use strict';var multer=require(_0x476b('0x0'));var util=require('util');var path=require(_0x476b('0x1'));var timeout=require(_0x476b('0x2'));var express=require(_0x476b('0x3'));var router=express[_0x476b('0x4')]();var fs_extra=require(_0x476b('0x5'));var auth=require(_0x476b('0x6'));var interaction=require(_0x476b('0x7'));var config=require(_0x476b('0x8'));var controller=require(_0x476b('0x9'));router['get']('/',auth[_0x476b('0xa')](),controller[_0x476b('0xb')]);router[_0x476b('0xc')](_0x476b('0xd'),auth[_0x476b('0xa')](),controller[_0x476b('0xe')]);router[_0x476b('0xc')](_0x476b('0xf'),auth[_0x476b('0xa')](),controller[_0x476b('0x10')]);router[_0x476b('0xc')](_0x476b('0x11'),auth[_0x476b('0xa')](),controller[_0x476b('0x12')]);router['post']('/',auth[_0x476b('0xa')](),controller[_0x476b('0x13')]);router[_0x476b('0x14')]('/:id',controller['update']);router['delete']('/:id',auth[_0x476b('0xa')](),controller[_0x476b('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x07df=['post','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x3f4c86,_0xb0070f){var _0xb18ffa=function(_0x3570cf){while(--_0x3570cf){_0x3f4c86['push'](_0x3f4c86['shift']());}};_0xb18ffa(++_0xb0070f);}(_0x07df,0x123));var _0xf07d=function(_0xafae14,_0x4ffe00){_0xafae14=_0xafae14-0x0;var _0x26024c=_0x07df[_0xafae14];return _0x26024c;};'use strict';var multer=require(_0xf07d('0x0'));var util=require('util');var path=require(_0xf07d('0x1'));var timeout=require(_0xf07d('0x2'));var express=require('express');var router=express[_0xf07d('0x3')]();var fs_extra=require(_0xf07d('0x4'));var auth=require(_0xf07d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf07d('0x6'));var controller=require(_0xf07d('0x7'));router[_0xf07d('0x8')]('/',auth[_0xf07d('0x9')](),controller[_0xf07d('0xa')]);router['get'](_0xf07d('0xb'),auth[_0xf07d('0x9')](),controller[_0xf07d('0xc')]);router['get'](_0xf07d('0xd'),auth[_0xf07d('0x9')](),controller[_0xf07d('0xe')]);router[_0xf07d('0x8')](_0xf07d('0xf'),auth[_0xf07d('0x9')](),controller[_0xf07d('0x10')]);router[_0xf07d('0x11')]('/',auth[_0xf07d('0x9')](),controller[_0xf07d('0x12')]);router['put'](_0xf07d('0xf'),controller[_0xf07d('0x13')]);router['delete'](_0xf07d('0xf'),auth[_0xf07d('0x9')](),controller[_0xf07d('0x14')]);module[_0xf07d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ac39fa5..e5468fc 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 _0xe5fb=['medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe5fb,0xce));var _0xbe5f=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xe5fb[_0x457b64];return _0x437111;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbe5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe5f('0x4')),'defaultValue':_0xbe5f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe5f('0x5')]},'providerName':{'type':Sequelize[_0xbe5f('0x6')]},'providerResponse':{'type':Sequelize[_0xbe5f('0x7')]}};
\ No newline at end of file
+var _0xdef9=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0xdef9,0x1ed));var _0x9def=function(_0x362a9c,_0x434fd5){_0x362a9c=_0x362a9c-0x0;var _0x159079=_0xdef9[_0x362a9c];return _0x159079;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'body':{'type':Sequelize[_0x9def('0x2')](_0x9def('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9def('0x5')]('in',_0x9def('0x6')),'defaultValue':_0x9def('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9def('0x7')]},'providerName':{'type':Sequelize[_0x9def('0x8')]},'providerResponse':{'type':Sequelize[_0x9def('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 1cbb7d1..62c70fd 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 _0xac4a=['message','result','catch','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','name','send','map','ChatMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','create','body','find','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','User','email','parse','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xac4a,0x1f3));var _0xaac4=function(_0x3bccf3,_0x5943e1){_0x3bccf3=_0x3bccf3-0x0;var _0x2dd306=_0xac4a[_0x3bccf3];return _0x2dd306;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaac4('0x2'));var rp=require(_0xaac4('0x3'));var moment=require('moment');var BPromise=require(_0xaac4('0x4'));var Mustache=require(_0xaac4('0x5'));var util=require('util');var path=require(_0xaac4('0x6'));var sox=require('sox');var csv=require(_0xaac4('0x7'));var ejs=require(_0xaac4('0x8'));var fs=require('fs');var fs_extra=require(_0xaac4('0x9'));var _=require(_0xaac4('0xa'));var squel=require(_0xaac4('0xb'));var crypto=require(_0xaac4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaac4('0xd'));var toCsv=require(_0xaac4('0x7'));var querystring=require(_0xaac4('0xe'));var Papa=require(_0xaac4('0xf'));var Redis=require(_0xaac4('0x10'));var authService=require(_0xaac4('0x11'));var qs=require(_0xaac4('0x12'));var as=require(_0xaac4('0x13'));var hardwareService=require(_0xaac4('0x14'));var logger=require(_0xaac4('0x15'))(_0xaac4('0x16'));var utils=require('../../config/utils');var config=require(_0xaac4('0x17'));var licenseUtil=require(_0xaac4('0x18'));var db=require('../../mysqldb')['db'];config[_0xaac4('0x19')]=_['defaults'](config['redis'],{'host':_0xaac4('0x1a'),'port':0x18eb});var socket=require(_0xaac4('0x1b'))(new Redis(config[_0xaac4('0x19')]));require(_0xaac4('0x1c'))[_0xaac4('0x1d')](socket);var jayson=require(_0xaac4('0x1e'));var client=jayson[_0xaac4('0x1f')][_0xaac4('0x20')]({'port':0x232c});var client9002=jayson[_0xaac4('0x1f')][_0xaac4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1b8367,_0x191604,_0x450d47,_0x5704cd){return new BPromise(function(_0x1a1761,_0x11a29e){var _0x15cd5c=_0x5704cd||client;return _0x15cd5c[_0xaac4('0x21')](_0x1b8367,_0x450d47)['then'](function(_0x4a41d2){logger[_0xaac4('0x22')](_0xaac4('0x23'),_0x191604,_0xaac4('0x24'));logger[_0xaac4('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x191604,_0xaac4('0x24'),JSON[_0xaac4('0x26')](_0x4a41d2));if(_0x4a41d2[_0xaac4('0x27')]){if(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x28')]===0x1f4){logger['error'](_0xaac4('0x23'),_0x191604,_0x4a41d2[_0xaac4('0x27')]['message']);return _0x11a29e(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);}logger[_0xaac4('0x27')](_0xaac4('0x23'),_0x191604,_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);return _0x1a1761(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x191604,_0xaac4('0x24'));_0x1a1761(_0x4a41d2[_0xaac4('0x2a')][_0xaac4('0x29')]);}})[_0xaac4('0x2b')](function(_0x767463){logger[_0xaac4('0x27')](_0xaac4('0x23'),_0x191604,_0x767463);_0x11a29e(_0x767463);});});}function respondWithStatusCode(_0x534f32,_0x4fa6c3){_0x4fa6c3=_0x4fa6c3||0xcc;return function(_0x4853de){if(_0x4853de){return _0x534f32['sendStatus'](_0x4fa6c3);}return _0x534f32[_0xaac4('0x2c')](_0x4fa6c3)['end']();};}function respondWithResult(_0xeeb791,_0x312cac){_0x312cac=_0x312cac||0xc8;return function(_0x44fdf7){if(_0x44fdf7){return _0xeeb791[_0xaac4('0x2c')](_0x312cac)[_0xaac4('0x2d')](_0x44fdf7);}};}function respondWithFilteredResult(_0x30b049,_0x51f5f8){return function(_0xe3a4bf){if(_0xe3a4bf){var _0x26bb11=typeof _0x51f5f8[_0xaac4('0x2e')]==='undefined'&&typeof _0x51f5f8[_0xaac4('0x2f')]==='undefined';var _0x2e89d1=_0xe3a4bf['count'];var _0xa44051=_0x26bb11?0x0:_0x51f5f8[_0xaac4('0x2e')];var _0x4e7c33=_0x26bb11?_0xe3a4bf[_0xaac4('0x30')]:_0x51f5f8[_0xaac4('0x2e')]+_0x51f5f8['limit'];var _0x5de0f0;if(_0x4e7c33>=_0x2e89d1){_0x4e7c33=_0x2e89d1;_0x5de0f0=0xc8;}else{_0x5de0f0=0xce;}_0x30b049['status'](_0x5de0f0);return _0x30b049[_0xaac4('0x31')](_0xaac4('0x32'),_0xa44051+'-'+_0x4e7c33+'/'+_0x2e89d1)['json'](_0xe3a4bf);}return null;};}function patchUpdates(_0x54e025){return function(_0x9f3d11){try{jsonpatch[_0xaac4('0x33')](_0x9f3d11,_0x54e025,!![]);}catch(_0x2b713b){return BPromise[_0xaac4('0x34')](_0x2b713b);}return _0x9f3d11[_0xaac4('0x35')]();};}function saveUpdates(_0x4a1d74,_0x355e57){return function(_0x14fcef){if(_0x14fcef){return _0x14fcef[_0xaac4('0x36')](_0x4a1d74)[_0xaac4('0x37')](function(_0x38a437){return _0x38a437;});}return null;};}function removeEntity(_0x3d56b1,_0xf6ba28){return function(_0x2bed81){if(_0x2bed81){return _0x2bed81['destroy']()['then'](function(){_0x3d56b1[_0xaac4('0x2c')](0xcc)[_0xaac4('0x38')]();});}};}function handleEntityNotFound(_0x59f882,_0x396a2c){return function(_0x2d1202){if(!_0x2d1202){_0x59f882[_0xaac4('0x39')](0x194);}return _0x2d1202;};}function handleError(_0x377033,_0xf30d0b){_0xf30d0b=_0xf30d0b||0x1f4;return function(_0x24623b){logger['error'](_0x24623b['stack']);if(_0x24623b[_0xaac4('0x3a')]){delete _0x24623b[_0xaac4('0x3a')];}_0x377033['status'](_0xf30d0b)[_0xaac4('0x3b')](_0x24623b);};}exports['index']=function(_0x4ffbf2,_0x470003){var _0x2054af={},_0x46af8e={},_0x8c9bcf={'count':0x0,'rows':[]};var _0x507cc6=_[_0xaac4('0x3c')](db[_0xaac4('0x3d')]['rawAttributes'],function(_0x210ed8){return{'name':_0x210ed8[_0xaac4('0x3e')],'type':_0x210ed8[_0xaac4('0x3f')][_0xaac4('0x40')]};});_0x46af8e[_0xaac4('0x41')]=_[_0xaac4('0x3c')](_0x507cc6,'name');_0x46af8e[_0xaac4('0x42')]=_['keys'](_0x4ffbf2['query']);_0x46af8e[_0xaac4('0x43')]=_[_0xaac4('0x44')](_0x46af8e['model'],_0x46af8e[_0xaac4('0x42')]);_0x2054af[_0xaac4('0x45')]=_[_0xaac4('0x44')](_0x46af8e[_0xaac4('0x41')],qs[_0xaac4('0x46')](_0x4ffbf2['query'][_0xaac4('0x46')]));_0x2054af[_0xaac4('0x45')]=_0x2054af[_0xaac4('0x45')]['length']?_0x2054af['attributes']:_0x46af8e[_0xaac4('0x41')];if(!_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x47')](_0xaac4('0x48'))){_0x2054af[_0xaac4('0x2f')]=qs[_0xaac4('0x2f')](_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x2f')]);_0x2054af['offset']=qs[_0xaac4('0x2e')](_0x4ffbf2[_0xaac4('0x42')]['offset']);}_0x2054af[_0xaac4('0x49')]=qs['sort'](_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4a')]);_0x2054af[_0xaac4('0x4b')]=qs[_0xaac4('0x43')](_[_0xaac4('0x4c')](_0x4ffbf2[_0xaac4('0x42')],_0x46af8e[_0xaac4('0x43')]),_0x507cc6);if(_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4d')]){_0x2054af['where']=_[_0xaac4('0x4e')](_0x2054af['where'],{'$or':_[_0xaac4('0x3c')](_0x507cc6,function(_0x3d13f7){if(_0x3d13f7[_0xaac4('0x3f')]!==_0xaac4('0x4f')){var _0x158008={};_0x158008[_0x3d13f7[_0xaac4('0x3a')]]={'$like':'%'+_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4d')]+'%'};return _0x158008;}})});}_0x2054af=_['merge']({},_0x2054af,_0x4ffbf2['options']);var _0x57b038={'where':_0x2054af[_0xaac4('0x4b')]};return db[_0xaac4('0x3d')][_0xaac4('0x30')](_0x57b038)[_0xaac4('0x37')](function(_0x59165e){_0x8c9bcf['count']=_0x59165e;if(_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x50')]){_0x2054af[_0xaac4('0x51')]=[{'all':!![]}];}return db[_0xaac4('0x3d')][_0xaac4('0x52')](_0x2054af);})['then'](function(_0xd7d54d){_0x8c9bcf[_0xaac4('0x53')]=_0xd7d54d;return _0x8c9bcf;})[_0xaac4('0x37')](respondWithFilteredResult(_0x470003,_0x2054af))[_0xaac4('0x2b')](handleError(_0x470003,null));};exports['show']=function(_0x4b8fbd,_0x1cf412){var _0x2fbc0a={'raw':!![],'where':{'id':_0x4b8fbd[_0xaac4('0x54')]['id']}},_0x1a3258={};_0x1a3258[_0xaac4('0x41')]=_[_0xaac4('0x55')](db[_0xaac4('0x3d')][_0xaac4('0x56')]);_0x1a3258['query']=_[_0xaac4('0x55')](_0x4b8fbd[_0xaac4('0x42')]);_0x1a3258['filters']=_[_0xaac4('0x44')](_0x1a3258[_0xaac4('0x41')],_0x1a3258[_0xaac4('0x42')]);_0x2fbc0a[_0xaac4('0x45')]=_[_0xaac4('0x44')](_0x1a3258[_0xaac4('0x41')],qs['fields'](_0x4b8fbd[_0xaac4('0x42')][_0xaac4('0x46')]));_0x2fbc0a[_0xaac4('0x45')]=_0x2fbc0a['attributes']['length']?_0x2fbc0a[_0xaac4('0x45')]:_0x1a3258[_0xaac4('0x41')];if(_0x4b8fbd['query']['includeAll']){_0x2fbc0a[_0xaac4('0x51')]=[{'all':!![]}];}_0x2fbc0a=_[_0xaac4('0x4e')]({},_0x2fbc0a,_0x4b8fbd[_0xaac4('0x57')]);return db[_0xaac4('0x3d')]['find'](_0x2fbc0a)['then'](handleEntityNotFound(_0x1cf412,null))[_0xaac4('0x37')](respondWithResult(_0x1cf412,null))[_0xaac4('0x2b')](handleError(_0x1cf412,null));};exports[_0xaac4('0x58')]=function(_0x13c569,_0x743658){return db[_0xaac4('0x3d')]['create'](_0x13c569[_0xaac4('0x59')],{})[_0xaac4('0x37')](respondWithResult(_0x743658,0xc9))[_0xaac4('0x2b')](handleError(_0x743658,null));};exports[_0xaac4('0x36')]=function(_0x2e1c04,_0x4551fe){if(_0x2e1c04[_0xaac4('0x59')]['id']){delete _0x2e1c04['body']['id'];}return db['ChatMessage'][_0xaac4('0x5a')]({'where':{'id':_0x2e1c04[_0xaac4('0x54')]['id']}})[_0xaac4('0x37')](handleEntityNotFound(_0x4551fe,null))[_0xaac4('0x37')](saveUpdates(_0x2e1c04[_0xaac4('0x59')],null))[_0xaac4('0x37')](respondWithResult(_0x4551fe,null))[_0xaac4('0x2b')](handleError(_0x4551fe,null));};exports['destroy']=function(_0x2fddf7,_0x53e6b2){return db[_0xaac4('0x3d')]['find']({'where':{'id':_0x2fddf7[_0xaac4('0x54')]['id']}})[_0xaac4('0x37')](handleEntityNotFound(_0x53e6b2,null))[_0xaac4('0x37')](removeEntity(_0x53e6b2,null))[_0xaac4('0x2b')](handleError(_0x53e6b2,null));};exports['describe']=function(_0x449414,_0x2ef47f){return db['ChatMessage']['describe']()[_0xaac4('0x37')](respondWithResult(_0x2ef47f,null))[_0xaac4('0x2b')](handleError(_0x2ef47f,null));};var interaction_log=require(_0xaac4('0x15'))(_0xaac4('0x5b'));exports[_0xaac4('0x5c')]=function(_0x54f83f,_0x5c7bee,_0x1eb655){var _0x5cfcbc={'agent':{},'channel':_0xaac4('0x5d')};if(_0x54f83f[_0xaac4('0x59')]['id']){delete _0x54f83f[_0xaac4('0x59')]['id'];}_0x54f83f[_0xaac4('0x59')][_0xaac4('0x5e')]=!![];_0x54f83f['body'][_0xaac4('0x5f')]=moment()[_0xaac4('0x60')](_0xaac4('0x61'));_0x54f83f[_0xaac4('0x59')]['UserId']=_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')]||_0x54f83f[_0xaac4('0x63')]['id'];_0x5cfcbc[_0xaac4('0x64')]['id']=_0x54f83f['body'][_0xaac4('0x62')];return db[_0xaac4('0x3d')][_0xaac4('0x5a')]({'where':{'id':_0x54f83f[_0xaac4('0x54')]['id'],'UserId':null}})[_0xaac4('0x37')](handleEntityNotFound(_0x5c7bee,null))[_0xaac4('0x37')](saveUpdates(_0x54f83f[_0xaac4('0x59')],null))[_0xaac4('0x37')](function(_0x558332){if(_0x558332){_0x5cfcbc[_0xaac4('0x29')]=_0x558332[_0xaac4('0x65')]({'plain':!![]});return db[_0xaac4('0x66')]['find']({'where':{'id':_0x558332[_0xaac4('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x5c7bee,null))['then'](function(_0x9c4214){if(_0x9c4214){return _0x9c4214['update']({'UserId':_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')],'read1stAt':_[_0xaac4('0x68')](_0x9c4214[_0xaac4('0x69')])?moment()[_0xaac4('0x60')](_0xaac4('0x61')):undefined});}return null;})[_0xaac4('0x37')](function(_0x2bc772){if(_0x2bc772){_0x5cfcbc[_0xaac4('0x6a')]=_0x2bc772[_0xaac4('0x65')]({'plain':!![]});interaction_log[_0xaac4('0x22')](_0xaac4('0x6b'),_0x54f83f[_0xaac4('0x63')]['id'],_0x54f83f[_0xaac4('0x63')][_0xaac4('0x3a')],_0x54f83f[_0xaac4('0x63')]['role'],_0x5cfcbc['interaction']['id'],_0x54f83f['body']?JSON[_0xaac4('0x26')](_0x54f83f[_0xaac4('0x59')]):_0xaac4('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xaac4('0x6d'),_0x5cfcbc);}return null;})['then'](function(_0x5f38fd){var _0x10fb08='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f38fd['message'][_0xaac4('0x6e')];return db[_0xaac4('0x6f')]['query'](_0x10fb08,{'type':db[_0xaac4('0x70')]['QueryTypes'][_0xaac4('0x71')],'raw':!![]})[_0xaac4('0x37')](function(_0x3df02f){return _0x3df02f;});})[_0xaac4('0x37')](function(_0x5aa938){if(_0x5aa938){_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x72')]=_0x5aa938[0x0];if(!_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')])return;return db['User'][_0xaac4('0x5a')]({'where':{'id':_0x54f83f[_0xaac4('0x59')]['UserId'],'role':_0xaac4('0x64')},'attributes':['id',_0xaac4('0x3a'),_0xaac4('0x73'),'email',_0xaac4('0x74')],'raw':!![]});}return null;})[_0xaac4('0x37')](function(_0x59e62e){if(!_0x59e62e)return null;_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x64')]=_0x59e62e;return _0x5cfcbc;})['then'](function(_0x26c16c){if(_0x26c16c){if(_0x54f83f['body'][_0xaac4('0x75')]){_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x76')]=util[_0xaac4('0x60')](_0xaac4('0x77'),_0x54f83f[_0xaac4('0x63')]['name']);_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x78')]=_0x5cfcbc['channel'];_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x79')]=_0x5cfcbc['channel'];_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x7a')]=_0xaac4('0x5c');return respondWithRpcPromise(_0xaac4('0x7b'),_0xaac4('0x7b'),{'event':_0xaac4('0x7c'),'message':_[_0xaac4('0x4e')](_0x5cfcbc[_0xaac4('0x29')],JSON['parse'](_0x5cfcbc['interaction'][_0xaac4('0x7d')]))},client9002)[_0xaac4('0x37')](function(){return _0x5cfcbc;});}return _0x5cfcbc;}return null;})[_0xaac4('0x37')](respondWithResult(_0x5c7bee,null))[_0xaac4('0x2b')](handleError(_0x5c7bee,null));};var interaction_log=require(_0xaac4('0x15'))(_0xaac4('0x5b'));exports[_0xaac4('0x34')]=function(_0xe24fb4,_0xa5b973,_0x4ac340){var _0x3ed0cd={'agent':{},'channel':_0xaac4('0x5d')};if(_0xe24fb4[_0xaac4('0x59')]['id']){delete _0xe24fb4[_0xaac4('0x59')]['id'];}_0xe24fb4['body'][_0xaac4('0x62')]=_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')]||_0xe24fb4['user']['id'];_0x3ed0cd['agent']['id']=_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')];return db[_0xaac4('0x3d')][_0xaac4('0x5a')]({'where':{'id':_0xe24fb4['params']['id'],'UserId':null}})[_0xaac4('0x37')](handleEntityNotFound(_0xa5b973,null))[_0xaac4('0x37')](function(_0x9364ae){if(_0x9364ae){_0x3ed0cd[_0xaac4('0x29')]=_0x9364ae[_0xaac4('0x65')]({'plain':!![]});return db[_0xaac4('0x66')][_0xaac4('0x5a')]({'where':{'id':_0x9364ae[_0xaac4('0x67')]}});}return null;})[_0xaac4('0x37')](handleEntityNotFound(_0xa5b973,null))[_0xaac4('0x37')](function(_0x386382){if(_0x386382){_0x3ed0cd[_0xaac4('0x6a')]=_0x386382['get']({'plain':!![]});interaction_log[_0xaac4('0x22')](_0xaac4('0x7e'),_0xe24fb4[_0xaac4('0x63')]['id'],_0xe24fb4[_0xaac4('0x63')]['name'],_0xe24fb4[_0xaac4('0x63')][_0xaac4('0x7f')],_0x3ed0cd[_0xaac4('0x6a')]['id'],_0xe24fb4['body']?JSON[_0xaac4('0x26')](_0xe24fb4['body']):_0xaac4('0x6c'));return respondWithRpcPromise(_0xaac4('0x80'),_0xaac4('0x81'),_0x3ed0cd);}return null;})[_0xaac4('0x37')](function(_0x22a9ce){var _0x3c11a3=_0xaac4('0x82')+_0x22a9ce[_0xaac4('0x29')][_0xaac4('0x6e')];return db[_0xaac4('0x6f')][_0xaac4('0x42')](_0x3c11a3,{'type':db[_0xaac4('0x70')][_0xaac4('0x83')]['SELECT'],'raw':!![]})[_0xaac4('0x37')](function(_0x514334){return _0x514334;});})[_0xaac4('0x37')](function(_0x38262f){if(_0x38262f){_0x3ed0cd[_0xaac4('0x29')][_0xaac4('0x72')]=_0x38262f[0x0];if(!_0xe24fb4['body']['UserId'])return;return db[_0xaac4('0x84')][_0xaac4('0x5a')]({'where':{'id':_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')],'role':_0xaac4('0x64')},'attributes':['id',_0xaac4('0x3a'),_0xaac4('0x73'),_0xaac4('0x85'),_0xaac4('0x74')],'raw':!![]});}return null;})['then'](function(_0x3dd417){if(!_0x3dd417)return null;_0x3ed0cd[_0xaac4('0x29')][_0xaac4('0x64')]=_0x3dd417;return _0x3ed0cd;})[_0xaac4('0x37')](function(_0x23f24b){if(_0x23f24b){_0x23f24b[_0xaac4('0x29')][_0xaac4('0x76')]=util['format']('SIP/%s',_0xe24fb4['user'][_0xaac4('0x3a')]);_0x23f24b[_0xaac4('0x29')][_0xaac4('0x78')]=_0x3ed0cd[_0xaac4('0x78')];_0x23f24b['message'][_0xaac4('0x79')]=_0x3ed0cd[_0xaac4('0x78')];_0x23f24b[_0xaac4('0x29')][_0xaac4('0x7a')]=_0xaac4('0x34');respondWithRpcPromise(_0xaac4('0x7b'),_0xaac4('0x7b'),{'event':'rejectmessage','message':_[_0xaac4('0x4e')](_0x3ed0cd[_0xaac4('0x29')],JSON[_0xaac4('0x86')](_0x3ed0cd[_0xaac4('0x6a')][_0xaac4('0x7d')]))},client9002);return _0x3ed0cd;}return null;})['then'](respondWithResult(_0xa5b973,null))[_0xaac4('0x2b')](handleError(_0xa5b973,null));};
\ No newline at end of file
+var _0xdabf=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','format','interaction','get','role','stringify','null','AcceptMessage','acceptMessage','sequelize','SELECT','contact','User','fullname','internal','manual','motionChannel','channel','EventManager','acceptmessage','formData','ChatInteraction','[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','email','interface','SIP/%s','event','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','client','http','then','info'];(function(_0x20478d,_0x52e97f){var _0x2d6038=function(_0xc2f63e){while(--_0xc2f63e){_0x20478d['push'](_0x20478d['shift']());}};_0x2d6038(++_0x52e97f);}(_0xdabf,0x171));var _0xfdab=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdabf[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xfdab('0x0'));var rimraf=require(_0xfdab('0x1'));var zipdir=require(_0xfdab('0x2'));var jsonpatch=require(_0xfdab('0x3'));var rp=require(_0xfdab('0x4'));var moment=require('moment');var BPromise=require(_0xfdab('0x5'));var Mustache=require(_0xfdab('0x6'));var util=require(_0xfdab('0x7'));var path=require(_0xfdab('0x8'));var sox=require(_0xfdab('0x9'));var csv=require(_0xfdab('0xa'));var ejs=require(_0xfdab('0xb'));var fs=require('fs');var fs_extra=require(_0xfdab('0xc'));var _=require(_0xfdab('0xd'));var squel=require('squel');var crypto=require(_0xfdab('0xe'));var jsforce=require(_0xfdab('0xf'));var deskjs=require(_0xfdab('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfdab('0x11'));var Redis=require(_0xfdab('0x12'));var authService=require(_0xfdab('0x13'));var qs=require(_0xfdab('0x14'));var as=require(_0xfdab('0x15'));var hardwareService=require(_0xfdab('0x16'));var logger=require(_0xfdab('0x17'))(_0xfdab('0x18'));var utils=require(_0xfdab('0x19'));var config=require(_0xfdab('0x1a'));var licenseUtil=require(_0xfdab('0x1b'));var db=require(_0xfdab('0x1c'))['db'];config[_0xfdab('0x1d')]=_[_0xfdab('0x1e')](config[_0xfdab('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdab('0x1d')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xfdab('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xfdab('0x20')][_0xfdab('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2d303f,_0x10df02,_0x426dba,_0x43af34){return new BPromise(function(_0x51b5f0,_0x3f79ed){var _0x1492c4=_0x43af34||client;return _0x1492c4['request'](_0x2d303f,_0x426dba)[_0xfdab('0x22')](function(_0x21e3d5){logger[_0xfdab('0x23')](_0xfdab('0x24'),_0x10df02,_0xfdab('0x25'));logger[_0xfdab('0x26')](_0xfdab('0x27'),_0x10df02,_0xfdab('0x25'),JSON['stringify'](_0x21e3d5));if(_0x21e3d5[_0xfdab('0x28')]){if(_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x29')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x10df02,_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x2a')]);return _0x3f79ed(_0x21e3d5['error'][_0xfdab('0x2a')]);}logger[_0xfdab('0x28')](_0xfdab('0x24'),_0x10df02,_0x21e3d5['error']['message']);return _0x51b5f0(_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x2a')]);}else{logger[_0xfdab('0x23')](_0xfdab('0x24'),_0x10df02,_0xfdab('0x25'));_0x51b5f0(_0x21e3d5[_0xfdab('0x2b')][_0xfdab('0x2a')]);}})['catch'](function(_0x422e8c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x10df02,_0x422e8c);_0x3f79ed(_0x422e8c);});});}function respondWithStatusCode(_0x597136,_0xc54d6f){_0xc54d6f=_0xc54d6f||0xcc;return function(_0x3882f6){if(_0x3882f6){return _0x597136['sendStatus'](_0xc54d6f);}return _0x597136[_0xfdab('0x2c')](_0xc54d6f)[_0xfdab('0x2d')]();};}function respondWithResult(_0x1105d9,_0x2430de){_0x2430de=_0x2430de||0xc8;return function(_0x479c88){if(_0x479c88){return _0x1105d9[_0xfdab('0x2c')](_0x2430de)[_0xfdab('0x2e')](_0x479c88);}};}function respondWithFilteredResult(_0x4c97f8,_0x9b60ae){return function(_0x54ef7a){if(_0x54ef7a){var _0x14a9e1=typeof _0x9b60ae['offset']===_0xfdab('0x2f')&&typeof _0x9b60ae['limit']===_0xfdab('0x2f');var _0x4dd9bc=_0x54ef7a[_0xfdab('0x30')];var _0x547a32=_0x14a9e1?0x0:_0x9b60ae[_0xfdab('0x31')];var _0x403650=_0x14a9e1?_0x54ef7a['count']:_0x9b60ae[_0xfdab('0x31')]+_0x9b60ae['limit'];var _0x27d76d;if(_0x403650>=_0x4dd9bc){_0x403650=_0x4dd9bc;_0x27d76d=0xc8;}else{_0x27d76d=0xce;}_0x4c97f8[_0xfdab('0x2c')](_0x27d76d);return _0x4c97f8[_0xfdab('0x32')](_0xfdab('0x33'),_0x547a32+'-'+_0x403650+'/'+_0x4dd9bc)['json'](_0x54ef7a);}return null;};}function patchUpdates(_0x4edfb0){return function(_0x3da194){try{jsonpatch[_0xfdab('0x34')](_0x3da194,_0x4edfb0,!![]);}catch(_0x3cab46){return BPromise['reject'](_0x3cab46);}return _0x3da194[_0xfdab('0x35')]();};}function saveUpdates(_0x1397c,_0x5b0860){return function(_0x153ecd){if(_0x153ecd){return _0x153ecd[_0xfdab('0x36')](_0x1397c)[_0xfdab('0x22')](function(_0x33dcb5){return _0x33dcb5;});}return null;};}function removeEntity(_0x944d18,_0x51c6a9){return function(_0x1bc22b){if(_0x1bc22b){return _0x1bc22b[_0xfdab('0x37')]()[_0xfdab('0x22')](function(){_0x944d18[_0xfdab('0x2c')](0xcc)[_0xfdab('0x2d')]();});}};}function handleEntityNotFound(_0x15c45e,_0x224d31){return function(_0x6c4f90){if(!_0x6c4f90){_0x15c45e['sendStatus'](0x194);}return _0x6c4f90;};}function handleError(_0x1ef02b,_0x504c1f){_0x504c1f=_0x504c1f||0x1f4;return function(_0x514869){logger['error'](_0x514869[_0xfdab('0x38')]);if(_0x514869[_0xfdab('0x39')]){delete _0x514869['name'];}_0x1ef02b['status'](_0x504c1f)[_0xfdab('0x3a')](_0x514869);};}exports[_0xfdab('0x3b')]=function(_0x473de4,_0x3ba5e2){var _0x363f92={},_0x3ce230={},_0x234854={'count':0x0,'rows':[]};var _0x42c384=_[_0xfdab('0x3c')](db[_0xfdab('0x3d')][_0xfdab('0x3e')],function(_0x2073f7){return{'name':_0x2073f7[_0xfdab('0x3f')],'type':_0x2073f7[_0xfdab('0x40')][_0xfdab('0x41')]};});_0x3ce230['model']=_[_0xfdab('0x3c')](_0x42c384,_0xfdab('0x39'));_0x3ce230[_0xfdab('0x42')]=_[_0xfdab('0x43')](_0x473de4[_0xfdab('0x42')]);_0x3ce230[_0xfdab('0x44')]=_[_0xfdab('0x45')](_0x3ce230[_0xfdab('0x46')],_0x3ce230['query']);_0x363f92[_0xfdab('0x47')]=_[_0xfdab('0x45')](_0x3ce230[_0xfdab('0x46')],qs[_0xfdab('0x48')](_0x473de4[_0xfdab('0x42')][_0xfdab('0x48')]));_0x363f92['attributes']=_0x363f92[_0xfdab('0x47')]['length']?_0x363f92[_0xfdab('0x47')]:_0x3ce230[_0xfdab('0x46')];if(!_0x473de4[_0xfdab('0x42')][_0xfdab('0x49')]('nolimit')){_0x363f92['limit']=qs['limit'](_0x473de4[_0xfdab('0x42')]['limit']);_0x363f92[_0xfdab('0x31')]=qs[_0xfdab('0x31')](_0x473de4['query']['offset']);}_0x363f92[_0xfdab('0x4a')]=qs[_0xfdab('0x4b')](_0x473de4[_0xfdab('0x42')][_0xfdab('0x4b')]);_0x363f92['where']=qs[_0xfdab('0x44')](_['pick'](_0x473de4['query'],_0x3ce230['filters']),_0x42c384);if(_0x473de4[_0xfdab('0x42')][_0xfdab('0x4c')]){_0x363f92['where']=_[_0xfdab('0x4d')](_0x363f92[_0xfdab('0x4e')],{'$or':_[_0xfdab('0x3c')](_0x42c384,function(_0x4eb59b){if(_0x4eb59b[_0xfdab('0x40')]!=='VIRTUAL'){var _0xef901d={};_0xef901d[_0x4eb59b[_0xfdab('0x39')]]={'$like':'%'+_0x473de4[_0xfdab('0x42')][_0xfdab('0x4c')]+'%'};return _0xef901d;}})});}_0x363f92=_['merge']({},_0x363f92,_0x473de4[_0xfdab('0x4f')]);var _0x43250b={'where':_0x363f92[_0xfdab('0x4e')]};return db[_0xfdab('0x3d')]['count'](_0x43250b)['then'](function(_0x3ab961){_0x234854[_0xfdab('0x30')]=_0x3ab961;if(_0x473de4['query']['includeAll']){_0x363f92[_0xfdab('0x50')]=[{'all':!![]}];}return db[_0xfdab('0x3d')][_0xfdab('0x51')](_0x363f92);})[_0xfdab('0x22')](function(_0x118a03){_0x234854[_0xfdab('0x52')]=_0x118a03;return _0x234854;})[_0xfdab('0x22')](respondWithFilteredResult(_0x3ba5e2,_0x363f92))[_0xfdab('0x53')](handleError(_0x3ba5e2,null));};exports[_0xfdab('0x54')]=function(_0x4051b3,_0x1e85ab){var _0x386f97={'raw':!![],'where':{'id':_0x4051b3['params']['id']}},_0x2e755d={};_0x2e755d['model']=_[_0xfdab('0x43')](db[_0xfdab('0x3d')][_0xfdab('0x3e')]);_0x2e755d['query']=_['keys'](_0x4051b3[_0xfdab('0x42')]);_0x2e755d['filters']=_['intersection'](_0x2e755d[_0xfdab('0x46')],_0x2e755d[_0xfdab('0x42')]);_0x386f97['attributes']=_['intersection'](_0x2e755d['model'],qs['fields'](_0x4051b3[_0xfdab('0x42')]['fields']));_0x386f97[_0xfdab('0x47')]=_0x386f97['attributes']['length']?_0x386f97[_0xfdab('0x47')]:_0x2e755d['model'];if(_0x4051b3[_0xfdab('0x42')][_0xfdab('0x55')]){_0x386f97[_0xfdab('0x50')]=[{'all':!![]}];}_0x386f97=_['merge']({},_0x386f97,_0x4051b3[_0xfdab('0x4f')]);return db['ChatMessage']['find'](_0x386f97)[_0xfdab('0x22')](handleEntityNotFound(_0x1e85ab,null))['then'](respondWithResult(_0x1e85ab,null))[_0xfdab('0x53')](handleError(_0x1e85ab,null));};exports[_0xfdab('0x56')]=function(_0x12a7e1,_0x50ca41){return db[_0xfdab('0x3d')]['create'](_0x12a7e1[_0xfdab('0x57')],{})[_0xfdab('0x22')](respondWithResult(_0x50ca41,0xc9))[_0xfdab('0x53')](handleError(_0x50ca41,null));};exports[_0xfdab('0x36')]=function(_0x39fb1b,_0x54ae88){if(_0x39fb1b[_0xfdab('0x57')]['id']){delete _0x39fb1b[_0xfdab('0x57')]['id'];}return db[_0xfdab('0x3d')]['find']({'where':{'id':_0x39fb1b[_0xfdab('0x58')]['id']}})[_0xfdab('0x22')](handleEntityNotFound(_0x54ae88,null))[_0xfdab('0x22')](saveUpdates(_0x39fb1b[_0xfdab('0x57')],null))[_0xfdab('0x22')](respondWithResult(_0x54ae88,null))[_0xfdab('0x53')](handleError(_0x54ae88,null));};exports[_0xfdab('0x37')]=function(_0xb51293,_0x2c1915){return db['ChatMessage'][_0xfdab('0x59')]({'where':{'id':_0xb51293[_0xfdab('0x58')]['id']}})[_0xfdab('0x22')](handleEntityNotFound(_0x2c1915,null))[_0xfdab('0x22')](removeEntity(_0x2c1915,null))[_0xfdab('0x53')](handleError(_0x2c1915,null));};exports[_0xfdab('0x5a')]=function(_0x4a4b05,_0x485138){return db['ChatMessage'][_0xfdab('0x5a')]()['then'](respondWithResult(_0x485138,null))['catch'](handleError(_0x485138,null));};var interaction_log=require(_0xfdab('0x17'))(_0xfdab('0x5b'));exports['accept']=function(_0x340b4b,_0x2b22d9,_0x589726){var _0x1652ce={'agent':{},'channel':_0xfdab('0x5c')};if(_0x340b4b[_0xfdab('0x57')]['id']){delete _0x340b4b[_0xfdab('0x57')]['id'];}_0x340b4b[_0xfdab('0x57')][_0xfdab('0x5d')]=!![];_0x340b4b[_0xfdab('0x57')][_0xfdab('0x5e')]=moment()['format'](_0xfdab('0x5f'));_0x340b4b['body'][_0xfdab('0x60')]=_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')]||_0x340b4b[_0xfdab('0x61')]['id'];_0x1652ce[_0xfdab('0x62')]['id']=_0x340b4b['body'][_0xfdab('0x60')];return db['ChatMessage'][_0xfdab('0x59')]({'where':{'id':_0x340b4b[_0xfdab('0x58')]['id'],'UserId':null}})[_0xfdab('0x22')](handleEntityNotFound(_0x2b22d9,null))[_0xfdab('0x22')](saveUpdates(_0x340b4b[_0xfdab('0x57')],null))[_0xfdab('0x22')](function(_0x5dca95){if(_0x5dca95){_0x1652ce[_0xfdab('0x2a')]=_0x5dca95['get']({'plain':!![]});return db['ChatInteraction'][_0xfdab('0x59')]({'where':{'id':_0x5dca95[_0xfdab('0x63')]}});}return null;})[_0xfdab('0x22')](handleEntityNotFound(_0x2b22d9,null))['then'](function(_0x5d8036){if(_0x5d8036){return _0x5d8036[_0xfdab('0x36')]({'UserId':_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')],'read1stAt':_[_0xfdab('0x64')](_0x5d8036[_0xfdab('0x65')])?moment()[_0xfdab('0x66')](_0xfdab('0x5f')):undefined});}return null;})[_0xfdab('0x22')](function(_0x3c1599){if(_0x3c1599){_0x1652ce[_0xfdab('0x67')]=_0x3c1599[_0xfdab('0x68')]({'plain':!![]});interaction_log[_0xfdab('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x340b4b['user']['id'],_0x340b4b[_0xfdab('0x61')][_0xfdab('0x39')],_0x340b4b['user'][_0xfdab('0x69')],_0x1652ce[_0xfdab('0x67')]['id'],_0x340b4b['body']?JSON[_0xfdab('0x6a')](_0x340b4b[_0xfdab('0x57')]):_0xfdab('0x6b'));return respondWithRpcPromise(_0xfdab('0x6c'),_0xfdab('0x6d'),_0x1652ce);}return null;})[_0xfdab('0x22')](function(_0x109ed1){var _0x15f263='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x109ed1[_0xfdab('0x2a')]['ContactId'];return db[_0xfdab('0x6e')][_0xfdab('0x42')](_0x15f263,{'type':db['Sequelize']['QueryTypes'][_0xfdab('0x6f')],'raw':!![]})['then'](function(_0x270fb1){return _0x270fb1;});})['then'](function(_0x1808d7){if(_0x1808d7){_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x70')]=_0x1808d7[0x0];if(!_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')])return;return db[_0xfdab('0x71')][_0xfdab('0x59')]({'where':{'id':_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')],'role':'agent'},'attributes':['id','name',_0xfdab('0x72'),'email',_0xfdab('0x73')],'raw':!![]});}return null;})[_0xfdab('0x22')](function(_0x4c47e9){if(!_0x4c47e9)return null;_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x62')]=_0x4c47e9;return _0x1652ce;})[_0xfdab('0x22')](function(_0x3c9d3a){if(_0x3c9d3a){if(_0x340b4b[_0xfdab('0x57')][_0xfdab('0x74')]){_0x1652ce[_0xfdab('0x2a')]['interface']=util['format']('SIP/%s',_0x340b4b['user'][_0xfdab('0x39')]);_0x1652ce[_0xfdab('0x2a')]['channel']=_0x1652ce['channel'];_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x75')]=_0x1652ce[_0xfdab('0x76')];_0x1652ce[_0xfdab('0x2a')]['event']='accept';return respondWithRpcPromise(_0xfdab('0x77'),'EventManager',{'event':_0xfdab('0x78'),'message':_[_0xfdab('0x4d')](_0x1652ce[_0xfdab('0x2a')],JSON['parse'](_0x1652ce[_0xfdab('0x67')][_0xfdab('0x79')]))},client9002)[_0xfdab('0x22')](function(){return _0x1652ce;});}return _0x1652ce;}return null;})[_0xfdab('0x22')](respondWithResult(_0x2b22d9,null))[_0xfdab('0x53')](handleError(_0x2b22d9,null));};var interaction_log=require(_0xfdab('0x17'))(_0xfdab('0x5b'));exports['reject']=function(_0x59d587,_0x1b8c91,_0x4cde07){var _0x3d3955={'agent':{},'channel':'chat'};if(_0x59d587[_0xfdab('0x57')]['id']){delete _0x59d587[_0xfdab('0x57')]['id'];}_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')]=_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')]||_0x59d587[_0xfdab('0x61')]['id'];_0x3d3955[_0xfdab('0x62')]['id']=_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')];return db[_0xfdab('0x3d')][_0xfdab('0x59')]({'where':{'id':_0x59d587[_0xfdab('0x58')]['id'],'UserId':null}})[_0xfdab('0x22')](handleEntityNotFound(_0x1b8c91,null))['then'](function(_0x46b8bb){if(_0x46b8bb){_0x3d3955[_0xfdab('0x2a')]=_0x46b8bb['get']({'plain':!![]});return db[_0xfdab('0x7a')][_0xfdab('0x59')]({'where':{'id':_0x46b8bb[_0xfdab('0x63')]}});}return null;})[_0xfdab('0x22')](handleEntityNotFound(_0x1b8c91,null))[_0xfdab('0x22')](function(_0x6d2fba){if(_0x6d2fba){_0x3d3955[_0xfdab('0x67')]=_0x6d2fba[_0xfdab('0x68')]({'plain':!![]});interaction_log[_0xfdab('0x23')](_0xfdab('0x7b'),_0x59d587['user']['id'],_0x59d587[_0xfdab('0x61')][_0xfdab('0x39')],_0x59d587[_0xfdab('0x61')]['role'],_0x3d3955[_0xfdab('0x67')]['id'],_0x59d587[_0xfdab('0x57')]?JSON[_0xfdab('0x6a')](_0x59d587[_0xfdab('0x57')]):_0xfdab('0x6b'));return respondWithRpcPromise(_0xfdab('0x7c'),_0xfdab('0x7d'),_0x3d3955);}return null;})[_0xfdab('0x22')](function(_0x10b1fd){var _0x52c538=_0xfdab('0x7e')+_0x10b1fd[_0xfdab('0x2a')][_0xfdab('0x7f')];return db[_0xfdab('0x6e')][_0xfdab('0x42')](_0x52c538,{'type':db[_0xfdab('0x80')]['QueryTypes'][_0xfdab('0x6f')],'raw':!![]})['then'](function(_0x55baf7){return _0x55baf7;});})['then'](function(_0x1e5129){if(_0x1e5129){_0x3d3955[_0xfdab('0x2a')][_0xfdab('0x70')]=_0x1e5129[0x0];if(!_0x59d587['body'][_0xfdab('0x60')])return;return db[_0xfdab('0x71')][_0xfdab('0x59')]({'where':{'id':_0x59d587['body'][_0xfdab('0x60')],'role':_0xfdab('0x62')},'attributes':['id','name',_0xfdab('0x72'),_0xfdab('0x81'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4b1a1f){if(!_0x4b1a1f)return null;_0x3d3955[_0xfdab('0x2a')]['agent']=_0x4b1a1f;return _0x3d3955;})[_0xfdab('0x22')](function(_0x71b6dc){if(_0x71b6dc){_0x71b6dc['message'][_0xfdab('0x82')]=util[_0xfdab('0x66')](_0xfdab('0x83'),_0x59d587[_0xfdab('0x61')][_0xfdab('0x39')]);_0x71b6dc['message']['channel']=_0x3d3955[_0xfdab('0x76')];_0x71b6dc[_0xfdab('0x2a')][_0xfdab('0x75')]=_0x3d3955[_0xfdab('0x76')];_0x71b6dc[_0xfdab('0x2a')][_0xfdab('0x84')]=_0xfdab('0x85');respondWithRpcPromise('EventManager',_0xfdab('0x77'),{'event':_0xfdab('0x86'),'message':_['merge'](_0x3d3955[_0xfdab('0x2a')],JSON['parse'](_0x3d3955[_0xfdab('0x67')]['formData']))},client9002);return _0x3d3955;}return null;})[_0xfdab('0x22')](respondWithResult(_0x1b8c91,null))[_0xfdab('0x53')](handleError(_0x1b8c91,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 89ce6ed..c8a16bd 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 _0x01b2=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','remove'];(function(_0x444d17,_0x25a17c){var _0x16d94b=function(_0x33b969){while(--_0x33b969){_0x444d17['push'](_0x444d17['shift']());}};_0x16d94b(++_0x25a17c);}(_0x01b2,0xd4));var _0x201b=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x01b2[_0x1b25c1];return _0x1e4447;};'use strict';var EventEmitter=require(_0x201b('0x0'));var ChatMessage=require(_0x201b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x201b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x201b('0x3')};function emitEvent(_0x4432ec){return function(_0x2340ab,_0x2b5e51,_0x5d3791){ChatMessageEvents[_0x201b('0x4')](_0x4432ec+':'+_0x2340ab['id'],_0x2340ab);ChatMessageEvents[_0x201b('0x4')](_0x4432ec,_0x2340ab);_0x5d3791(null);};}for(var e in events){if(events[_0x201b('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x968c=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xe0e35f,_0x50fb45){var _0x99dd01=function(_0x138e85){while(--_0x138e85){_0xe0e35f['push'](_0xe0e35f['shift']());}};_0x99dd01(++_0x50fb45);}(_0x968c,0x1d5));var _0xc968=function(_0x100d8a,_0x1959fa){_0x100d8a=_0x100d8a-0x0;var _0x1e0c96=_0x968c[_0x100d8a];return _0x1e0c96;};'use strict';var EventEmitter=require(_0xc968('0x0'));var ChatMessage=require(_0xc968('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc968('0x2')](0x0);var events={'afterCreate':_0xc968('0x3'),'afterUpdate':'update','afterDestroy':_0xc968('0x4')};function emitEvent(_0xc8aa0b){return function(_0x48dae1,_0x5cbee7,_0xc1f5ea){ChatMessageEvents[_0xc968('0x5')](_0xc8aa0b+':'+_0x48dae1['id'],_0x48dae1);ChatMessageEvents[_0xc968('0x5')](_0xc8aa0b,_0x48dae1);_0xc1f5ea(null);};}for(var e in events){if(events[_0xc968('0x6')](e)){var event=events[e];ChatMessage[_0xc968('0x7')](e,emitEvent(event));}}module[_0xc968('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index eca6437..472a2cd 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 _0xaff8=['body','FULLTEXT','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages'];(function(_0x1806cf,_0x4a1f20){var _0x5944a6=function(_0x5de697){while(--_0x5de697){_0x1806cf['push'](_0x1806cf['shift']());}};_0x5944a6(++_0x4a1f20);}(_0xaff8,0x78));var _0x8aff=function(_0x360d26,_0x700e92){_0x360d26=_0x360d26-0x0;var _0x180eef=_0xaff8[_0x360d26];return _0x180eef;};'use strict';var _=require(_0x8aff('0x0'));var util=require('util');var logger=require(_0x8aff('0x1'))(_0x8aff('0x2'));var moment=require(_0x8aff('0x3'));var BPromise=require('bluebird');var rp=require(_0x8aff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8aff('0x5'));var attributes=require(_0x8aff('0x6'));module[_0x8aff('0x7')]=function(_0x22b296,_0x2577a7){return _0x22b296['define'](_0x8aff('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x8aff('0x9'),'fields':[_0x8aff('0xa')],'type':_0x8aff('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b0ff9,_0x3992e4,_0x3b8a8c){var _0x1e6747=_0x22b296['models'];var _0x3ecdc9=_0x2b0ff9['get']({'plain':!![]});if(_0x3ecdc9['direction'][_0x8aff('0xc')]()==='in'||_0x3ecdc9['direction'][_0x8aff('0xc')]()===_0x8aff('0xd')&&!_0x3ecdc9['secret']&&!_['isNil'](_0x3ecdc9[_0x8aff('0xe')])){_0x1e6747[_0x8aff('0xf')][_0x8aff('0x10')]({'where':{'id':_0x3ecdc9[_0x8aff('0x11')]}})[_0x8aff('0x12')](function(_0x1480cc){if(_0x1480cc){_0x1480cc[_0x8aff('0x13')]({'lastMsgAt':_0x3ecdc9[_0x8aff('0x14')],'lastMsgDirection':_0x3ecdc9[_0x8aff('0x15')]['toLowerCase']()});}})[_0x8aff('0x16')](function(_0xd5e118){console[_0x8aff('0x17')](_0xd5e118);});}_0x3b8a8c();}},'charset':_0x8aff('0x18'),'collate':_0x8aff('0x19')});};
\ No newline at end of file
+var _0x5ac8=['out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','models','direction','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ac8,0x14e));var _0x85ac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ac8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x85ac('0x0'));var util=require(_0x85ac('0x1'));var logger=require(_0x85ac('0x2'))(_0x85ac('0x3'));var moment=require('moment');var BPromise=require(_0x85ac('0x4'));var rp=require(_0x85ac('0x5'));var fs=require('fs');var path=require(_0x85ac('0x6'));var rimraf=require(_0x85ac('0x7'));var config=require(_0x85ac('0x8'));var attributes=require(_0x85ac('0x9'));module['exports']=function(_0x426f5d,_0x443fc0){return _0x426f5d[_0x85ac('0xa')](_0x85ac('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x85ac('0xc'),'fields':[_0x85ac('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x174b6f,_0x56b48a,_0x3c7a27){var _0x433628=_0x426f5d[_0x85ac('0xe')];var _0x1de95c=_0x174b6f['get']({'plain':!![]});if(_0x1de95c[_0x85ac('0xf')]['toLowerCase']()==='in'||_0x1de95c['direction'][_0x85ac('0x10')]()===_0x85ac('0x11')&&!_0x1de95c[_0x85ac('0x12')]&&!_[_0x85ac('0x13')](_0x1de95c[_0x85ac('0x14')])){_0x433628[_0x85ac('0x15')][_0x85ac('0x16')]({'where':{'id':_0x1de95c['ChatInteractionId']}})[_0x85ac('0x17')](function(_0x299c0a){if(_0x299c0a){_0x299c0a['update']({'lastMsgAt':_0x1de95c[_0x85ac('0x18')],'lastMsgDirection':_0x1de95c[_0x85ac('0xf')]['toLowerCase']()});}})[_0x85ac('0x19')](function(_0x539d33){console[_0x85ac('0x1a')](_0x539d33);});}_0x3c7a27();}},'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 140140c..0c767a3 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 _0xbaa1=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0xbaa1,0x7d));var _0x1baa=function(_0x4532e3,_0x4919f5){_0x4532e3=_0x4532e3-0x0;var _0x447bc5=_0xbaa1[_0x4532e3];return _0x447bc5;};'use strict';var _=require(_0x1baa('0x0'));var util=require(_0x1baa('0x1'));var moment=require(_0x1baa('0x2'));var BPromise=require(_0x1baa('0x3'));var rs=require(_0x1baa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1baa('0x5'))['db'];var utils=require(_0x1baa('0x6'));var logger=require(_0x1baa('0x7'))(_0x1baa('0x8'));var config=require('../../config/environment');var jayson=require(_0x1baa('0x9'));var client=jayson[_0x1baa('0xa')][_0x1baa('0xb')]({'port':0x232a});config[_0x1baa('0xc')]=_[_0x1baa('0xd')](config['redis'],{'host':_0x1baa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1baa('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3df72f,_0x383d08,_0x11b617){return new BPromise(function(_0xc8bd33,_0x175006){return client[_0x1baa('0xf')](_0x3df72f,_0x11b617)[_0x1baa('0x10')](function(_0x13939b){logger[_0x1baa('0x11')](_0x1baa('0x12'),_0x383d08,_0x1baa('0x13'));logger[_0x1baa('0x14')](_0x1baa('0x15'),_0x383d08,_0x1baa('0x13'),JSON[_0x1baa('0x16')](_0x13939b));if(_0x13939b[_0x1baa('0x17')]){if(_0x13939b['error'][_0x1baa('0x18')]===0x1f4){logger[_0x1baa('0x17')](_0x1baa('0x12'),_0x383d08,_0x13939b[_0x1baa('0x17')][_0x1baa('0x19')]);return _0x175006(_0x13939b[_0x1baa('0x17')][_0x1baa('0x19')]);}logger['error'](_0x1baa('0x12'),_0x383d08,_0x13939b[_0x1baa('0x17')]['message']);return _0xc8bd33(_0x13939b['error'][_0x1baa('0x19')]);}else{logger[_0x1baa('0x11')](_0x1baa('0x12'),_0x383d08,'request\x20sent');_0xc8bd33(_0x13939b['result'][_0x1baa('0x19')]);}})[_0x1baa('0x1a')](function(_0x174b37){logger[_0x1baa('0x17')](_0x1baa('0x12'),_0x383d08,_0x174b37);_0x175006(_0x174b37);});});}exports[_0x1baa('0x1b')]=function(_0x55733c){var _0x2bc23b=this;return new Promise(function(_0x2ead8a,_0xa30e9c){return db[_0x1baa('0x1c')][_0x1baa('0x1d')](_0x55733c[_0x1baa('0x1e')],{'raw':_0x55733c[_0x1baa('0x1f')]?_0x55733c[_0x1baa('0x1f')][_0x1baa('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x181ce7){logger['info']('CreateChatMessage',_0x55733c);logger[_0x1baa('0x14')](_0x1baa('0x1b'),_0x55733c,JSON[_0x1baa('0x16')](_0x181ce7));_0x2ead8a(_0x181ce7);})[_0x1baa('0x1a')](function(_0xf533c9){logger[_0x1baa('0x17')](_0x1baa('0x1b'),_0xf533c9['message'],_0x55733c);_0xa30e9c(_0x2bc23b[_0x1baa('0x17')](0x1f4,_0xf533c9[_0x1baa('0x19')]));});});};
\ No newline at end of file
+var _0x370b=['ChatMessage','create','body','options','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','CreateChatMessage'];(function(_0x499b28,_0x4dda2a){var _0x210233=function(_0xafd0be){while(--_0xafd0be){_0x499b28['push'](_0x499b28['shift']());}};_0x210233(++_0x4dda2a);}(_0x370b,0x1b3));var _0xb370=function(_0x5ba5c7,_0x1caf61){_0x5ba5c7=_0x5ba5c7-0x0;var _0x574a48=_0x370b[_0x5ba5c7];return _0x574a48;};'use strict';var _=require(_0xb370('0x0'));var util=require('util');var moment=require(_0xb370('0x1'));var BPromise=require('bluebird');var rs=require(_0xb370('0x2'));var fs=require('fs');var Redis=require(_0xb370('0x3'));var db=require(_0xb370('0x4'))['db'];var utils=require(_0xb370('0x5'));var logger=require(_0xb370('0x6'))(_0xb370('0x7'));var config=require(_0xb370('0x8'));var jayson=require(_0xb370('0x9'));var client=jayson[_0xb370('0xa')][_0xb370('0xb')]({'port':0x232a});config['redis']=_[_0xb370('0xc')](config['redis'],{'host':_0xb370('0xd'),'port':0x18eb});var socket=require(_0xb370('0xe'))(new Redis(config['redis']));require(_0xb370('0xf'))[_0xb370('0x10')](socket);function respondWithRpcPromise(_0x4031f8,_0x467b92,_0x586481){return new BPromise(function(_0x3d0e60,_0xb91192){return client[_0xb370('0x11')](_0x4031f8,_0x586481)[_0xb370('0x12')](function(_0x37f5a5){logger[_0xb370('0x13')](_0xb370('0x14'),_0x467b92,'request\x20sent');logger[_0xb370('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x467b92,_0xb370('0x16'),JSON['stringify'](_0x37f5a5));if(_0x37f5a5[_0xb370('0x17')]){if(_0x37f5a5[_0xb370('0x17')][_0xb370('0x18')]===0x1f4){logger['error'](_0xb370('0x14'),_0x467b92,_0x37f5a5[_0xb370('0x17')]['message']);return _0xb91192(_0x37f5a5[_0xb370('0x17')]['message']);}logger[_0xb370('0x17')](_0xb370('0x14'),_0x467b92,_0x37f5a5[_0xb370('0x17')][_0xb370('0x19')]);return _0x3d0e60(_0x37f5a5['error']['message']);}else{logger[_0xb370('0x13')](_0xb370('0x14'),_0x467b92,_0xb370('0x16'));_0x3d0e60(_0x37f5a5['result'][_0xb370('0x19')]);}})['catch'](function(_0x2f25ab){logger[_0xb370('0x17')]('ChatMessage,\x20%s,\x20%s',_0x467b92,_0x2f25ab);_0xb91192(_0x2f25ab);});});}exports[_0xb370('0x1a')]=function(_0x547d4e){var _0x1ff008=this;return new Promise(function(_0x4373f0,_0x12ac84){return db[_0xb370('0x1b')][_0xb370('0x1c')](_0x547d4e[_0xb370('0x1d')],{'raw':_0x547d4e[_0xb370('0x1e')]?_0x547d4e['options']['raw']===undefined?!![]:![]:!![]})[_0xb370('0x12')](function(_0x599113){logger[_0xb370('0x13')](_0xb370('0x1a'),_0x547d4e);logger[_0xb370('0x15')](_0xb370('0x1a'),_0x547d4e,JSON[_0xb370('0x1f')](_0x599113));_0x4373f0(_0x599113);})[_0xb370('0x20')](function(_0x299d75){logger['error']('CreateChatMessage',_0x299d75[_0xb370('0x19')],_0x547d4e);_0x12ac84(_0x1ff008[_0xb370('0x17')](0x1f4,_0x299d75[_0xb370('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 84aadda..7a01719 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 _0x294b=['./chatMessage.events','remove','update','emit','removeListener','register'];(function(_0x1d128b,_0x953850){var _0x4bfb1f=function(_0x4f48eb){while(--_0x4f48eb){_0x1d128b['push'](_0x1d128b['shift']());}};_0x4bfb1f(++_0x953850);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){ChatMessageEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('chatMessage:'+_0x39dfbf,_0xaa6a67);ChatMessageEvents['on'](_0x39dfbf,_0x5110aa);}};
\ No newline at end of file
+var _0xea31=['register','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xea31,0x6b));var _0x1ea3=function(_0x38381e,_0x35f46f){_0x38381e=_0x38381e-0x0;var _0x2b0b49=_0xea31[_0x38381e];return _0x2b0b49;};'use strict';var ChatMessageEvents=require(_0x1ea3('0x0'));var events=['save',_0x1ea3('0x1'),_0x1ea3('0x2')];function createListener(_0x3b1d99,_0x153625){return function(_0x2dc24e){_0x153625[_0x1ea3('0x3')](_0x3b1d99,_0x2dc24e);};}function removeListener(_0x1142f1,_0x555620){return function(){ChatMessageEvents[_0x1ea3('0x4')](_0x1142f1,_0x555620);};}exports[_0x1ea3('0x5')]=function(_0x6810da){for(var _0x27c695=0x0,_0x13e6fb=events['length'];_0x27c695<_0x13e6fb;_0x27c695++){var _0x1fa3a8=events[_0x27c695];var _0x1b578e=createListener(_0x1ea3('0x6')+_0x1fa3a8,_0x6810da);ChatMessageEvents['on'](_0x1fa3a8,_0x1b578e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 60153cd..95b02bd 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 _0x3a7d=['update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','create','put'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x3a7d,0x120));var _0xd3a7=function(_0x330129,_0x4fca8b){_0x330129=_0x330129-0x0;var _0x7edb92=_0x3a7d[_0x330129];return _0x7edb92;};'use strict';var multer=require(_0xd3a7('0x0'));var util=require('util');var path=require(_0xd3a7('0x1'));var timeout=require(_0xd3a7('0x2'));var express=require(_0xd3a7('0x3'));var router=express[_0xd3a7('0x4')]();var fs_extra=require(_0xd3a7('0x5'));var auth=require(_0xd3a7('0x6'));var interaction=require(_0xd3a7('0x7'));var config=require(_0xd3a7('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xa')]);router[_0xd3a7('0xb')](_0xd3a7('0xc'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xd')]);router['get'](_0xd3a7('0xe'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xf')]);router[_0xd3a7('0x10')]('/',auth[_0xd3a7('0x9')](),interaction['tracked']('chat',_0xd3a7('0x11')),controller[_0xd3a7('0x12')]);router[_0xd3a7('0x13')](_0xd3a7('0xe'),controller[_0xd3a7('0x14')]);router[_0xd3a7('0x13')](_0xd3a7('0x15'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0x16')]);router[_0xd3a7('0x13')](_0xd3a7('0x17'),auth['isAuthenticated'](),controller[_0xd3a7('0x18')]);router[_0xd3a7('0x19')](_0xd3a7('0xe'),auth['isAuthenticated'](),controller[_0xd3a7('0x1a')]);module[_0xd3a7('0x1b')]=router;
\ No newline at end of file
+var _0xb5fa=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','show','post','tracked','chat','chatmessage:create','put','update'];(function(_0x4a0f82,_0xb53ebc){var _0x4676e7=function(_0x11e290){while(--_0x11e290){_0x4a0f82['push'](_0x4a0f82['shift']());}};_0x4676e7(++_0xb53ebc);}(_0xb5fa,0x133));var _0xab5f=function(_0x228044,_0x53bbd4){_0x228044=_0x228044-0x0;var _0x33a054=_0xb5fa[_0x228044];return _0x33a054;};'use strict';var multer=require(_0xab5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xab5f('0x1'));var express=require(_0xab5f('0x2'));var router=express[_0xab5f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab5f('0x4'));var config=require(_0xab5f('0x5'));var controller=require(_0xab5f('0x6'));router[_0xab5f('0x7')]('/',auth['isAuthenticated'](),controller[_0xab5f('0x8')]);router['get'](_0xab5f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xab5f('0x7')]('/:id',auth[_0xab5f('0xa')](),controller[_0xab5f('0xb')]);router[_0xab5f('0xc')]('/',auth[_0xab5f('0xa')](),interaction[_0xab5f('0xd')](_0xab5f('0xe'),_0xab5f('0xf')),controller['create']);router[_0xab5f('0x10')]('/:id',controller[_0xab5f('0x11')]);router[_0xab5f('0x10')](_0xab5f('0x12'),auth[_0xab5f('0xa')](),controller[_0xab5f('0x13')]);router[_0xab5f('0x10')](_0xab5f('0x14'),auth[_0xab5f('0xa')](),controller[_0xab5f('0x15')]);router[_0xab5f('0x16')]('/:id',auth[_0xab5f('0xa')](),controller[_0xab5f('0x17')]);module[_0xab5f('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 1ec1233..6808fdb 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x85f077,_0x362348){var _0x37f55d=function(_0x2d10f4){while(--_0x2d10f4){_0x85f077['push'](_0x85f077['shift']());}};_0x37f55d(++_0x362348);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56012d,_0x9d9ee5){_0x56012d=_0x56012d-0x0;var _0x133e44=_0x5f2f[_0x56012d];return _0x133e44;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x757a=['exports','TEXT'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x757a,0xde));var _0xa757=function(_0x141d9e,_0x3e5c36){_0x141d9e=_0x141d9e-0x0;var _0x4c23db=_0x757a[_0x141d9e];return _0x4c23db;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 9b34b86..f372a3f 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(_0xd96a1f,_0x4a21f4){var _0x4d8029=function(_0x5a6b36){while(--_0x5a6b36){_0xd96a1f['push'](_0xd96a1f['shift']());}};_0x4d8029(++_0x4a21f4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _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(_0x25fc52,_0x47b064){var _0x425627=function(_0x219dc2){while(--_0x219dc2){_0x25fc52['push'](_0x25fc52['shift']());}};_0x425627(++_0x47b064);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index c5b805b..06d5ab3 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 _0x6f54=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x28e9ff,_0x4ad761){var _0x530fc6=function(_0x5b9f79){while(--_0x5b9f79){_0x28e9ff['push'](_0x28e9ff['shift']());}};_0x530fc6(++_0x4ad761);}(_0x6f54,0xc6));var _0x46f5=function(_0x3be306,_0x2eb550){_0x3be306=_0x3be306-0x0;var _0x183e3c=_0x6f54[_0x3be306];return _0x183e3c;};'use strict';var EventEmitter=require(_0x46f5('0x0'));var ChatOfflineMessage=require(_0x46f5('0x1'))['db'][_0x46f5('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x46f5('0x3')](0x0);var events={'afterCreate':_0x46f5('0x4'),'afterUpdate':_0x46f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a54e8){return function(_0x33567f,_0x496ef4,_0x49a045){ChatOfflineMessageEvents['emit'](_0x1a54e8+':'+_0x33567f['id'],_0x33567f);ChatOfflineMessageEvents[_0x46f5('0x6')](_0x1a54e8,_0x33567f);_0x49a045(null);};}for(var e in events){if(events[_0x46f5('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x46f5('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x93a6=['update','remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x49d65e,_0x1459dd){var _0x36d964=function(_0x184436){while(--_0x184436){_0x49d65e['push'](_0x49d65e['shift']());}};_0x36d964(++_0x1459dd);}(_0x93a6,0x1ac));var _0x693a=function(_0x234459,_0x8da0cc){_0x234459=_0x234459-0x0;var _0x2a73fb=_0x93a6[_0x234459];return _0x2a73fb;};'use strict';var EventEmitter=require(_0x693a('0x0'));var ChatOfflineMessage=require(_0x693a('0x1'))['db'][_0x693a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x693a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x693a('0x4'),'afterDestroy':_0x693a('0x5')};function emitEvent(_0x2b7074){return function(_0x47d558,_0x319a09,_0x170f39){ChatOfflineMessageEvents[_0x693a('0x6')](_0x2b7074+':'+_0x47d558['id'],_0x47d558);ChatOfflineMessageEvents[_0x693a('0x6')](_0x2b7074,_0x47d558);_0x170f39(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x693a('0x7')](e,emitEvent(event));}}module[_0x693a('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7dd6edf..16dba74 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 _0x03f8=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x341aeb,_0x46ff72){var _0x20b8ef=function(_0x571b0d){while(--_0x571b0d){_0x341aeb['push'](_0x341aeb['shift']());}};_0x20b8ef(++_0x46ff72);}(_0x03f8,0x19e));var _0x803f=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x03f8[_0x421263];return _0x34e4b5;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x803f('0x0')]=function(_0x2d7a8a){return _0x2d7a8a[_0x803f('0x1')](_0x803f('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x803f('0x3'),'collate':_0x803f('0x4')});};
\ No newline at end of file
+var _0x778d=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x7be932,_0x25578e){var _0x1d1386=function(_0x32474f){while(--_0x32474f){_0x7be932['push'](_0x7be932['shift']());}};_0x1d1386(++_0x25578e);}(_0x778d,0x163));var _0xd778=function(_0x5e0531,_0x387e57){_0x5e0531=_0x5e0531-0x0;var _0x4c3154=_0x778d[_0x5e0531];return _0x4c3154;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xd778('0x0')]=function(_0x418b1d){return _0x418b1d['define'](_0xd778('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd778('0x2'),'collate':_0xd778('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bd7e2dd..f8051d0 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 _0x34f2=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0x34f2,0x15a));var _0x234f=function(_0x1950c3,_0x388947){_0x1950c3=_0x1950c3-0x0;var _0x4cfd10=_0x34f2[_0x1950c3];return _0x4cfd10;};'use strict';var _=require(_0x234f('0x0'));var util=require(_0x234f('0x1'));var moment=require('moment');var BPromise=require(_0x234f('0x2'));var rs=require(_0x234f('0x3'));var fs=require('fs');var Redis=require(_0x234f('0x4'));var db=require(_0x234f('0x5'))['db'];var utils=require(_0x234f('0x6'));var logger=require(_0x234f('0x7'))(_0x234f('0x8'));var config=require(_0x234f('0x9'));var jayson=require(_0x234f('0xa'));var client=jayson[_0x234f('0xb')][_0x234f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x254f37,_0x3aaf6c,_0x477918){return new BPromise(function(_0x691793,_0x514588){return client[_0x234f('0xd')](_0x254f37,_0x477918)[_0x234f('0xe')](function(_0x5d9661){logger['info'](_0x234f('0xf'),_0x3aaf6c,_0x234f('0x10'));logger[_0x234f('0x11')](_0x234f('0x12'),_0x3aaf6c,_0x234f('0x10'),JSON['stringify'](_0x5d9661));if(_0x5d9661[_0x234f('0x13')]){if(_0x5d9661[_0x234f('0x13')][_0x234f('0x14')]===0x1f4){logger[_0x234f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3aaf6c,_0x5d9661[_0x234f('0x13')]['message']);return _0x514588(_0x5d9661[_0x234f('0x13')][_0x234f('0x15')]);}logger[_0x234f('0x13')](_0x234f('0xf'),_0x3aaf6c,_0x5d9661[_0x234f('0x13')][_0x234f('0x15')]);return _0x691793(_0x5d9661[_0x234f('0x13')]['message']);}else{logger['info'](_0x234f('0xf'),_0x3aaf6c,_0x234f('0x10'));_0x691793(_0x5d9661['result'][_0x234f('0x15')]);}})[_0x234f('0x16')](function(_0x228dcc){logger[_0x234f('0x13')](_0x234f('0xf'),_0x3aaf6c,_0x228dcc);_0x514588(_0x228dcc);});});}
\ No newline at end of file
+var _0x6a2e=['request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x28aa7d,_0x31e5f5){var _0x2e7096=function(_0x560508){while(--_0x560508){_0x28aa7d['push'](_0x28aa7d['shift']());}};_0x2e7096(++_0x31e5f5);}(_0x6a2e,0x14d));var _0xe6a2=function(_0x1ee244,_0x5143fd){_0x1ee244=_0x1ee244-0x0;var _0x3485e1=_0x6a2e[_0x1ee244];return _0x3485e1;};'use strict';var _=require(_0xe6a2('0x0'));var util=require(_0xe6a2('0x1'));var moment=require(_0xe6a2('0x2'));var BPromise=require(_0xe6a2('0x3'));var rs=require(_0xe6a2('0x4'));var fs=require('fs');var Redis=require(_0xe6a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6a2('0x6'));var logger=require(_0xe6a2('0x7'))('rpc');var config=require(_0xe6a2('0x8'));var jayson=require(_0xe6a2('0x9'));var client=jayson[_0xe6a2('0xa')][_0xe6a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d43bd,_0x345f6c,_0x40980f){return new BPromise(function(_0x221378,_0x51b25b){return client[_0xe6a2('0xc')](_0x5d43bd,_0x40980f)[_0xe6a2('0xd')](function(_0x4fe50f){logger[_0xe6a2('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x345f6c,'request\x20sent');logger[_0xe6a2('0xf')](_0xe6a2('0x10'),_0x345f6c,_0xe6a2('0x11'),JSON[_0xe6a2('0x12')](_0x4fe50f));if(_0x4fe50f[_0xe6a2('0x13')]){if(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x14')]===0x1f4){logger[_0xe6a2('0x13')](_0xe6a2('0x15'),_0x345f6c,_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);return _0x51b25b(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);}logger[_0xe6a2('0x13')](_0xe6a2('0x15'),_0x345f6c,_0x4fe50f['error']['message']);return _0x221378(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);}else{logger[_0xe6a2('0xe')](_0xe6a2('0x15'),_0x345f6c,_0xe6a2('0x11'));_0x221378(_0x4fe50f[_0xe6a2('0x17')][_0xe6a2('0x16')]);}})[_0xe6a2('0x18')](function(_0x430c3c){logger['error'](_0xe6a2('0x15'),_0x345f6c,_0x430c3c);_0x51b25b(_0x430c3c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 884372f..bfb5de5 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 _0xc709=['put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','create'];(function(_0x131335,_0x1eaf97){var _0x3090bd=function(_0x135bc0){while(--_0x135bc0){_0x131335['push'](_0x131335['shift']());}};_0x3090bd(++_0x1eaf97);}(_0xc709,0xaf));var _0x9c70=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xc709[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0x9c70('0x0'));var util=require(_0x9c70('0x1'));var path=require(_0x9c70('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c70('0x3'));var router=express[_0x9c70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c70('0x6'));var controller=require(_0x9c70('0x7'));router['get']('/',auth[_0x9c70('0x8')](),controller['index']);router[_0x9c70('0x9')](_0x9c70('0xa'),auth[_0x9c70('0x8')](),controller[_0x9c70('0xb')]);router[_0x9c70('0x9')](_0x9c70('0xc'),auth[_0x9c70('0x8')](),controller[_0x9c70('0xd')]);router['post']('/',auth[_0x9c70('0x8')](),controller[_0x9c70('0xe')]);router[_0x9c70('0xf')](_0x9c70('0xc'),auth['isAuthenticated'](),controller[_0x9c70('0x10')]);router['delete'](_0x9c70('0xc'),auth[_0x9c70('0x8')](),controller[_0x9c70('0x11')]);module[_0x9c70('0x12')]=router;
\ No newline at end of file
+var _0xe429=['../../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','connect-timeout','express','fs-extra'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xe429,0x94));var _0x9e42=function(_0x1a6701,_0x1cdd3c){_0x1a6701=_0x1a6701-0x0;var _0x34a966=_0xe429[_0x1a6701];return _0x34a966;};'use strict';var multer=require(_0x9e42('0x0'));var util=require(_0x9e42('0x1'));var path=require(_0x9e42('0x2'));var timeout=require(_0x9e42('0x3'));var express=require(_0x9e42('0x4'));var router=express['Router']();var fs_extra=require(_0x9e42('0x5'));var auth=require(_0x9e42('0x6'));var interaction=require(_0x9e42('0x7'));var config=require(_0x9e42('0x8'));var controller=require(_0x9e42('0x9'));router[_0x9e42('0xa')]('/',auth[_0x9e42('0xb')](),controller[_0x9e42('0xc')]);router['get'](_0x9e42('0xd'),auth[_0x9e42('0xb')](),controller[_0x9e42('0xe')]);router[_0x9e42('0xa')](_0x9e42('0xf'),auth[_0x9e42('0xb')](),controller[_0x9e42('0x10')]);router[_0x9e42('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e42('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9e42('0x13')]);router['delete'](_0x9e42('0xf'),auth[_0x9e42('0xb')](),controller[_0x9e42('0x14')]);module[_0x9e42('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index ef17d4f..0c9cfa5 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 _0xc606=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x1484ed,_0x16e78e){var _0x1bb1d9=function(_0x67c48b){while(--_0x67c48b){_0x1484ed['push'](_0x1484ed['shift']());}};_0x1bb1d9(++_0x16e78e);}(_0xc606,0xa9));var _0x6c60=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xc606[_0x350182];return _0x4a0892;};'use strict';var Sequelize=require(_0x6c60('0x0'));module[_0x6c60('0x1')]={'name':{'type':Sequelize[_0x6c60('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6c60('0x3'),_0x6c60('0x4')),'defaultValue':_0x6c60('0x3')},'selector':{'type':Sequelize[_0x6c60('0x2')]},'timeout':{'type':Sequelize[_0x6c60('0x5')]}};
\ No newline at end of file
+var _0xd456=['sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xd456,0x19e));var _0x6d45=function(_0x28cf39,_0x1ee9f4){_0x28cf39=_0x28cf39-0x0;var _0x17f8d4=_0xd456[_0x28cf39];return _0x17f8d4;};'use strict';var Sequelize=require(_0x6d45('0x0'));module[_0x6d45('0x1')]={'name':{'type':Sequelize[_0x6d45('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6d45('0x3')]('mouseOver',_0x6d45('0x4')),'defaultValue':_0x6d45('0x5')},'selector':{'type':Sequelize[_0x6d45('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 1d74bfa..5e89d96 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 _0x3de0=['desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','name','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3de0,0x143));var _0x03de=function(_0x645a74,_0x37fcf1){_0x645a74=_0x645a74-0x0;var _0x3a712c=_0x3de0[_0x645a74];return _0x3a712c;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x12'))(_0x03de('0x13'));var utils=require('../../config/utils');var config=require(_0x03de('0x14'));var licenseUtil=require(_0x03de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6629,_0x10ab8b){_0x10ab8b=_0x10ab8b||0xcc;return function(_0x40dd5d){if(_0x40dd5d){return _0x3d6629[_0x03de('0x16')](_0x10ab8b);}return _0x3d6629[_0x03de('0x17')](_0x10ab8b)['end']();};}function respondWithResult(_0xf9553d,_0x1b467e){_0x1b467e=_0x1b467e||0xc8;return function(_0x14d19c){if(_0x14d19c){return _0xf9553d[_0x03de('0x17')](_0x1b467e)['json'](_0x14d19c);}};}function respondWithFilteredResult(_0x453564,_0xedbc6b){return function(_0x1aa88d){if(_0x1aa88d){var _0x45881e=typeof _0xedbc6b[_0x03de('0x18')]===_0x03de('0x19')&&typeof _0xedbc6b[_0x03de('0x1a')]===_0x03de('0x19');var _0x313a71=_0x1aa88d['count'];var _0x4835c0=_0x45881e?0x0:_0xedbc6b[_0x03de('0x18')];var _0x42962e=_0x45881e?_0x1aa88d[_0x03de('0x1b')]:_0xedbc6b['offset']+_0xedbc6b[_0x03de('0x1a')];var _0x5f6058;if(_0x42962e>=_0x313a71){_0x42962e=_0x313a71;_0x5f6058=0xc8;}else{_0x5f6058=0xce;}_0x453564[_0x03de('0x17')](_0x5f6058);return _0x453564[_0x03de('0x1c')](_0x03de('0x1d'),_0x4835c0+'-'+_0x42962e+'/'+_0x313a71)[_0x03de('0x1e')](_0x1aa88d);}return null;};}function patchUpdates(_0x3cb6ff){return function(_0x5cb66b){try{jsonpatch['apply'](_0x5cb66b,_0x3cb6ff,!![]);}catch(_0x528862){return BPromise[_0x03de('0x1f')](_0x528862);}return _0x5cb66b[_0x03de('0x20')]();};}function saveUpdates(_0x512d82,_0x12337f){return function(_0x4447d7){if(_0x4447d7){return _0x4447d7[_0x03de('0x21')](_0x512d82)['then'](function(_0x23e463){return _0x23e463;});}return null;};}function removeEntity(_0x396a57,_0x5f2317){return function(_0x13fb22){if(_0x13fb22){return _0x13fb22[_0x03de('0x22')]()[_0x03de('0x23')](function(){_0x396a57[_0x03de('0x17')](0xcc)[_0x03de('0x24')]();});}};}function handleEntityNotFound(_0x54b4fc,_0xf54687){return function(_0x13ab64){if(!_0x13ab64){_0x54b4fc[_0x03de('0x16')](0x194);}return _0x13ab64;};}function handleError(_0x1ed415,_0x5a9631){_0x5a9631=_0x5a9631||0x1f4;return function(_0x14e785){logger[_0x03de('0x25')](_0x14e785['stack']);if(_0x14e785['name']){delete _0x14e785[_0x03de('0x26')];}_0x1ed415[_0x03de('0x17')](_0x5a9631)['send'](_0x14e785);};}exports['show']=function(_0x261b19,_0x17463b){var _0x514232={'raw':!![],'where':{'id':_0x261b19[_0x03de('0x27')]['id']}},_0x405c25={};_0x405c25[_0x03de('0x28')]=_[_0x03de('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x405c25[_0x03de('0x2a')]=_[_0x03de('0x29')](_0x261b19[_0x03de('0x2a')]);_0x405c25[_0x03de('0x2b')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],_0x405c25['query']);_0x514232[_0x03de('0x2d')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],qs[_0x03de('0x2e')](_0x261b19[_0x03de('0x2a')][_0x03de('0x2e')]));_0x514232['attributes']=_0x514232[_0x03de('0x2d')][_0x03de('0x2f')]?_0x514232['attributes']:_0x405c25[_0x03de('0x28')];if(_0x261b19[_0x03de('0x2a')][_0x03de('0x30')]){_0x514232[_0x03de('0x31')]=[{'all':!![]}];}_0x514232=_['merge']({},_0x514232,_0x261b19[_0x03de('0x32')]);return db[_0x03de('0x33')][_0x03de('0x34')](_0x514232)[_0x03de('0x23')](handleEntityNotFound(_0x17463b,null))['then'](respondWithResult(_0x17463b,null))[_0x03de('0x35')](handleError(_0x17463b,null));};exports[_0x03de('0x36')]=function(_0x1e7dc7,_0x4930a6){return db[_0x03de('0x33')][_0x03de('0x36')](_0x1e7dc7[_0x03de('0x37')],{})[_0x03de('0x23')](respondWithResult(_0x4930a6,0xc9))[_0x03de('0x35')](handleError(_0x4930a6,null));};exports[_0x03de('0x21')]=function(_0xdb21c3,_0x5bc7dd){if(_0xdb21c3[_0x03de('0x37')]['id']){delete _0xdb21c3[_0x03de('0x37')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0xdb21c3[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x5bc7dd,null))[_0x03de('0x23')](saveUpdates(_0xdb21c3[_0x03de('0x37')],null))[_0x03de('0x23')](respondWithResult(_0x5bc7dd,null))[_0x03de('0x35')](handleError(_0x5bc7dd,null));};exports[_0x03de('0x22')]=function(_0x152a59,_0x294c92){return db[_0x03de('0x33')][_0x03de('0x34')]({'where':{'id':_0x152a59[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x294c92,null))[_0x03de('0x23')](removeEntity(_0x294c92,null))[_0x03de('0x35')](handleError(_0x294c92,null));};
\ No newline at end of file
+var _0xdd0c=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','include','merge','find','then','create','body','catch','rimraf','zip-dir','fast-json-patch'];(function(_0x1c0227,_0xce514d){var _0x1e777a=function(_0x4979a6){while(--_0x4979a6){_0x1c0227['push'](_0x1c0227['shift']());}};_0x1e777a(++_0xce514d);}(_0xdd0c,0x165));var _0xcdd0=function(_0x203ed1,_0x6fb319){_0x203ed1=_0x203ed1-0x0;var _0x27a73c=_0xdd0c[_0x203ed1];return _0x27a73c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={'raw':!![],'where':{'id':_0x4074e0[_0xcdd0('0x2a')]['id']}},_0xd6d64f={};_0xd6d64f['model']=_[_0xcdd0('0x2b')](db[_0xcdd0('0x2c')][_0xcdd0('0x2d')]);_0xd6d64f[_0xcdd0('0x2e')]=_[_0xcdd0('0x2b')](_0x4074e0['query']);_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],_0xd6d64f['query']);_0x28084c['attributes']=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],qs[_0xcdd0('0x32')](_0x4074e0['query'][_0xcdd0('0x32')]));_0x28084c[_0xcdd0('0x33')]=_0x28084c['attributes'][_0xcdd0('0x34')]?_0x28084c[_0xcdd0('0x33')]:_0xd6d64f[_0xcdd0('0x31')];if(_0x4074e0[_0xcdd0('0x2e')]['includeAll']){_0x28084c[_0xcdd0('0x35')]=[{'all':!![]}];}_0x28084c=_[_0xcdd0('0x36')]({},_0x28084c,_0x4074e0['options']);return db[_0xcdd0('0x2c')][_0xcdd0('0x37')](_0x28084c)[_0xcdd0('0x38')](handleEntityNotFound(_0x49cfe0,null))[_0xcdd0('0x38')](respondWithResult(_0x49cfe0,null))['catch'](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x39')]=function(_0x358139,_0x95d87f){return db[_0xcdd0('0x2c')][_0xcdd0('0x39')](_0x358139['body'],{})[_0xcdd0('0x38')](respondWithResult(_0x95d87f,0xc9))['catch'](handleError(_0x95d87f,null));};exports['update']=function(_0x4fd705,_0x407725){if(_0x4fd705[_0xcdd0('0x3a')]['id']){delete _0x4fd705[_0xcdd0('0x3a')]['id'];}return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4fd705[_0xcdd0('0x2a')]['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x407725,null))['then'](saveUpdates(_0x4fd705[_0xcdd0('0x3a')],null))[_0xcdd0('0x38')](respondWithResult(_0x407725,null))[_0xcdd0('0x3b')](handleError(_0x407725,null));};exports[_0xcdd0('0x24')]=function(_0x4e6d31,_0x4934a5){return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4e6d31['params']['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x4934a5,null))[_0xcdd0('0x38')](removeEntity(_0x4934a5,null))['catch'](handleError(_0x4934a5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7104c3a..9f65e6f 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 _0x69fc=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x51e5bd,_0x3c2cf1){var _0x250aed=function(_0x17120c){while(--_0x17120c){_0x51e5bd['push'](_0x51e5bd['shift']());}};_0x250aed(++_0x3c2cf1);}(_0x69fc,0xa5));var _0xc69f=function(_0x536f02,_0x17a4f3){_0x536f02=_0x536f02-0x0;var _0x102273=_0x69fc[_0x536f02];return _0x102273;};'use strict';var _=require(_0xc69f('0x0'));var util=require(_0xc69f('0x1'));var logger=require(_0xc69f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc69f('0x3'));var rp=require(_0xc69f('0x4'));var fs=require('fs');var path=require(_0xc69f('0x5'));var rimraf=require('rimraf');var config=require(_0xc69f('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xc69f('0x7')]=function(_0x537023,_0x262f7a){return _0x537023[_0xc69f('0x8')](_0xc69f('0x9'),attributes,{'tableName':_0xc69f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0694=['lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x513b2c,_0x4cf8f7){var _0x5a8e07=function(_0x481f31){while(--_0x481f31){_0x513b2c['push'](_0x513b2c['shift']());}};_0x5a8e07(++_0x4cf8f7);}(_0x0694,0x181));var _0x4069=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x0694[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x4069('0x0'));var util=require(_0x4069('0x1'));var logger=require('../../config/logger')(_0x4069('0x2'));var moment=require(_0x4069('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4069('0x4'));var rimraf=require(_0x4069('0x5'));var config=require(_0x4069('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x4069('0x7')]=function(_0x2f953e,_0x23a011){return _0x2f953e[_0x4069('0x8')](_0x4069('0x9'),attributes,{'tableName':_0x4069('0xa'),'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 1002409..e102abb 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 _0x02fb=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x474f02,_0x44c5af){var _0x47321d=function(_0x40e0de){while(--_0x40e0de){_0x474f02['push'](_0x474f02['shift']());}};_0x47321d(++_0x44c5af);}(_0x02fb,0x1b0));var _0xb02f=function(_0x422a8a,_0x530cca){_0x422a8a=_0x422a8a-0x0;var _0x3d349e=_0x02fb[_0x422a8a];return _0x3d349e;};'use strict';var _=require(_0xb02f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb02f('0x1'));var rs=require(_0xb02f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb02f('0x3'))['db'];var utils=require(_0xb02f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb02f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb02f('0x6')][_0xb02f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55d040,_0x26d7aa,_0x56575d){return new BPromise(function(_0x1c0a53,_0x352a43){return client[_0xb02f('0x8')](_0x55d040,_0x56575d)['then'](function(_0x309459){logger['info'](_0xb02f('0x9'),_0x26d7aa,_0xb02f('0xa'));logger[_0xb02f('0xb')](_0xb02f('0xc'),_0x26d7aa,'request\x20sent',JSON[_0xb02f('0xd')](_0x309459));if(_0x309459[_0xb02f('0xe')]){if(_0x309459[_0xb02f('0xe')]['code']===0x1f4){logger['error'](_0xb02f('0x9'),_0x26d7aa,_0x309459[_0xb02f('0xe')][_0xb02f('0xf')]);return _0x352a43(_0x309459[_0xb02f('0xe')][_0xb02f('0xf')]);}logger[_0xb02f('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x26d7aa,_0x309459[_0xb02f('0xe')]['message']);return _0x1c0a53(_0x309459[_0xb02f('0xe')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x26d7aa,_0xb02f('0xa'));_0x1c0a53(_0x309459[_0xb02f('0x10')]['message']);}})['catch'](function(_0x4b8e62){logger[_0xb02f('0xe')](_0xb02f('0x9'),_0x26d7aa,_0x4b8e62);_0x352a43(_0x4b8e62);});});}
\ No newline at end of file
+var _0x5ef8=['../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','rpc'];(function(_0x12a21c,_0x4660a0){var _0x1d5a61=function(_0x17bbf0){while(--_0x17bbf0){_0x12a21c['push'](_0x12a21c['shift']());}};_0x1d5a61(++_0x4660a0);}(_0x5ef8,0x7f));var _0x85ef=function(_0xb88d2f,_0x93cfe1){_0xb88d2f=_0xb88d2f-0x0;var _0x3d9d4f=_0x5ef8[_0xb88d2f];return _0x3d9d4f;};'use strict';var _=require(_0x85ef('0x0'));var util=require(_0x85ef('0x1'));var moment=require(_0x85ef('0x2'));var BPromise=require(_0x85ef('0x3'));var rs=require(_0x85ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85ef('0x5'));var config=require(_0x85ef('0x6'));var jayson=require(_0x85ef('0x7'));var client=jayson[_0x85ef('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1cf8,_0x4c44f6,_0x43e96d){return new BPromise(function(_0xfa9518,_0xbbe5b2){return client[_0x85ef('0x9')](_0x2e1cf8,_0x43e96d)[_0x85ef('0xa')](function(_0x4e3964){logger[_0x85ef('0xb')](_0x85ef('0xc'),_0x4c44f6,'request\x20sent');logger[_0x85ef('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4c44f6,_0x85ef('0xe'),JSON[_0x85ef('0xf')](_0x4e3964));if(_0x4e3964[_0x85ef('0x10')]){if(_0x4e3964[_0x85ef('0x10')]['code']===0x1f4){logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x4e3964[_0x85ef('0x10')][_0x85ef('0x11')]);return _0xbbe5b2(_0x4e3964[_0x85ef('0x10')][_0x85ef('0x11')]);}logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x4e3964[_0x85ef('0x10')]['message']);return _0xfa9518(_0x4e3964[_0x85ef('0x10')]['message']);}else{logger[_0x85ef('0xb')](_0x85ef('0xc'),_0x4c44f6,_0x85ef('0xe'));_0xfa9518(_0x4e3964[_0x85ef('0x12')]['message']);}})['catch'](function(_0x28ab1c){logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x28ab1c);_0xbbe5b2(_0x28ab1c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 2e9f9f9..df5dd28 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x5cef8d,_0x273c5b){var _0x104599=function(_0x4360bf){while(--_0x4360bf){_0x5cef8d['push'](_0x5cef8d['shift']());}};_0x104599(++_0x273c5b);}(_0xf494,0x1c6));var _0x4f49=function(_0xa73287,_0x36fdda){_0xa73287=_0xa73287-0x0;var _0x93e564=_0xf494[_0xa73287];return _0x93e564;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=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(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0x31f0,0xb7));var _0x031f=function(_0x5b868b,_0x14997e){_0x5b868b=_0x5b868b-0x0;var _0x2adf3f=_0x31f0[_0x5b868b];return _0x2adf3f;};'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 c7704ee..f70be87 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 _0xac09=['rrmemory','beepall','exports','STRING','name'];(function(_0xe836b8,_0xe8b231){var _0xfcf4e0=function(_0x7a2e95){while(--_0x7a2e95){_0xe836b8['push'](_0xe836b8['shift']());}};_0xfcf4e0(++_0xe8b231);}(_0xac09,0x11f));var _0x9ac0=function(_0x2b486d,_0x5825b5){_0x2b486d=_0x2b486d-0x0;var _0x2a7511=_0xac09[_0x2b486d];return _0x2a7511;};'use strict';var Sequelize=require('sequelize');module[_0x9ac0('0x0')]={'name':{'type':Sequelize[_0x9ac0('0x1')],'unique':_0x9ac0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9ac0('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9ac0('0x3'),_0x9ac0('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0xf825=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xf825,0x168));var _0x5f82=function(_0x5ca3fe,_0x2446c3){_0x5ca3fe=_0x5ca3fe-0x0;var _0x341dc4=_0xf825[_0x5ca3fe];return _0x341dc4;};'use strict';var Sequelize=require(_0x5f82('0x0'));module[_0x5f82('0x1')]={'name':{'type':Sequelize[_0x5f82('0x2')],'unique':_0x5f82('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5f82('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5f82('0x5'),_0x5f82('0x6'),_0x5f82('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 502e27d..a8d34fe 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 _0x1795=['removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x1795,0x150));var _0x5179=function(_0x2b72f5,_0x1d1f7b){_0x2b72f5=_0x2b72f5-0x0;var _0x49adb5=_0x1795[_0x2b72f5];return _0x49adb5;};'use strict';var emlformat=require(_0x5179('0x0'));var rimraf=require(_0x5179('0x1'));var zipdir=require(_0x5179('0x2'));var jsonpatch=require(_0x5179('0x3'));var rp=require('request-promise');var moment=require(_0x5179('0x4'));var BPromise=require(_0x5179('0x5'));var Mustache=require('mustache');var util=require(_0x5179('0x6'));var path=require(_0x5179('0x7'));var sox=require('sox');var csv=require(_0x5179('0x8'));var ejs=require(_0x5179('0x9'));var fs=require('fs');var fs_extra=require(_0x5179('0xa'));var _=require('lodash');var squel=require(_0x5179('0xb'));var crypto=require('crypto');var jsforce=require(_0x5179('0xc'));var deskjs=require(_0x5179('0xd'));var toCsv=require(_0x5179('0x8'));var querystring=require('querystring');var Papa=require(_0x5179('0xe'));var Redis=require(_0x5179('0xf'));var authService=require(_0x5179('0x10'));var qs=require(_0x5179('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5179('0x12'));var logger=require(_0x5179('0x13'))(_0x5179('0x14'));var utils=require('../../config/utils');var config=require(_0x5179('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5179('0x16'))['db'];config['redis']=_[_0x5179('0x17')](config[_0x5179('0x18')],{'host':_0x5179('0x19'),'port':0x18eb});var socket=require(_0x5179('0x1a'))(new Redis(config[_0x5179('0x18')]));require('./chatQueue.socket')[_0x5179('0x1b')](socket);var jayson=require(_0x5179('0x1c'));var client=jayson[_0x5179('0x1d')][_0x5179('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1a53a3,_0x320418,_0x2effc,_0x38999b){return new BPromise(function(_0x3df23b,_0xf22974){var _0x4384d3=_0x38999b||client;return _0x4384d3[_0x5179('0x1f')](_0x1a53a3,_0x2effc)['then'](function(_0x44bbbd){logger['info'](_0x5179('0x20'),_0x320418,_0x5179('0x21'));logger[_0x5179('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x320418,'request\x20sent',JSON[_0x5179('0x23')](_0x44bbbd));if(_0x44bbbd[_0x5179('0x24')]){if(_0x44bbbd['error'][_0x5179('0x25')]===0x1f4){logger[_0x5179('0x24')](_0x5179('0x20'),_0x320418,_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);return _0xf22974(_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);}logger[_0x5179('0x24')]('ChatQueue,\x20%s,\x20%s',_0x320418,_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);return _0x3df23b(_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);}else{logger[_0x5179('0x27')](_0x5179('0x20'),_0x320418,_0x5179('0x21'));_0x3df23b(_0x44bbbd[_0x5179('0x28')]['message']);}})[_0x5179('0x29')](function(_0xc57b32){logger['error']('ChatQueue,\x20%s,\x20%s',_0x320418,_0xc57b32);_0xf22974(_0xc57b32);});});}function respondWithStatusCode(_0x2a12af,_0x2fa56c){_0x2fa56c=_0x2fa56c||0xcc;return function(_0x203da8){if(_0x203da8){return _0x2a12af[_0x5179('0x2a')](_0x2fa56c);}return _0x2a12af['status'](_0x2fa56c)[_0x5179('0x2b')]();};}function respondWithResult(_0x3c0bcb,_0x2f96b2){_0x2f96b2=_0x2f96b2||0xc8;return function(_0x57f5bd){if(_0x57f5bd){return _0x3c0bcb[_0x5179('0x2c')](_0x2f96b2)[_0x5179('0x2d')](_0x57f5bd);}};}function respondWithFilteredResult(_0x22b102,_0x182c07){return function(_0xa99936){if(_0xa99936){var _0x272941=typeof _0x182c07['offset']==='undefined'&&typeof _0x182c07[_0x5179('0x2e')]===_0x5179('0x2f');var _0xc0cb28=_0xa99936['count'];var _0x1789f2=_0x272941?0x0:_0x182c07['offset'];var _0x5a3b5f=_0x272941?_0xa99936[_0x5179('0x30')]:_0x182c07[_0x5179('0x31')]+_0x182c07[_0x5179('0x2e')];var _0x2356e4;if(_0x5a3b5f>=_0xc0cb28){_0x5a3b5f=_0xc0cb28;_0x2356e4=0xc8;}else{_0x2356e4=0xce;}_0x22b102['status'](_0x2356e4);return _0x22b102['set']('Content-Range',_0x1789f2+'-'+_0x5a3b5f+'/'+_0xc0cb28)[_0x5179('0x2d')](_0xa99936);}return null;};}function patchUpdates(_0x39bb50){return function(_0x5c0fb1){try{jsonpatch[_0x5179('0x32')](_0x5c0fb1,_0x39bb50,!![]);}catch(_0x10af4f){return BPromise[_0x5179('0x33')](_0x10af4f);}return _0x5c0fb1[_0x5179('0x34')]();};}function saveUpdates(_0x43aa1d,_0x1e6b20){return function(_0x1c6754){if(_0x1c6754){return _0x1c6754[_0x5179('0x35')](_0x43aa1d)[_0x5179('0x36')](function(_0x3ee43){return _0x3ee43;});}return null;};}function removeEntity(_0x37abad,_0x2b4604){return function(_0x3a3493){if(_0x3a3493){return _0x3a3493[_0x5179('0x37')]()[_0x5179('0x36')](function(){var _0x1b056b=_0x3a3493[_0x5179('0x38')]({'plain':!![]});var _0x52ce61='ChatQueues';return db[_0x5179('0x39')][_0x5179('0x37')]({'where':{'type':_0x52ce61,'resourceId':_0x1b056b['id']}})['then'](function(){return _0x3a3493;});})[_0x5179('0x36')](function(){_0x37abad[_0x5179('0x2c')](0xcc)[_0x5179('0x2b')]();});}};}function handleEntityNotFound(_0x3b9be8,_0x30469e){return function(_0x3af034){if(!_0x3af034){_0x3b9be8[_0x5179('0x2a')](0x194);}return _0x3af034;};}function handleError(_0x39f2de,_0x350ed5){_0x350ed5=_0x350ed5||0x1f4;return function(_0x2e7967){logger['error'](_0x2e7967[_0x5179('0x3a')]);if(_0x2e7967['name']){delete _0x2e7967[_0x5179('0x3b')];}_0x39f2de[_0x5179('0x2c')](_0x350ed5)[_0x5179('0x3c')](_0x2e7967);};}exports['index']=function(_0x37d31d,_0x4b9cbb){var _0x215b47={},_0x4f2585={},_0x57f27b={'count':0x0,'rows':[]};var _0x48a11b=_[_0x5179('0x3d')](db[_0x5179('0x3e')][_0x5179('0x3f')],function(_0x26ed94){return{'name':_0x26ed94[_0x5179('0x40')],'type':_0x26ed94[_0x5179('0x41')][_0x5179('0x42')]};});_0x4f2585[_0x5179('0x43')]=_[_0x5179('0x3d')](_0x48a11b,_0x5179('0x3b'));_0x4f2585['query']=_[_0x5179('0x44')](_0x37d31d[_0x5179('0x45')]);_0x4f2585[_0x5179('0x46')]=_[_0x5179('0x47')](_0x4f2585['model'],_0x4f2585[_0x5179('0x45')]);_0x215b47[_0x5179('0x48')]=_['intersection'](_0x4f2585['model'],qs[_0x5179('0x49')](_0x37d31d['query'][_0x5179('0x49')]));_0x215b47[_0x5179('0x48')]=_0x215b47[_0x5179('0x48')][_0x5179('0x4a')]?_0x215b47[_0x5179('0x48')]:_0x4f2585[_0x5179('0x43')];if(!_0x37d31d[_0x5179('0x45')]['hasOwnProperty'](_0x5179('0x4b'))){_0x215b47[_0x5179('0x2e')]=qs['limit'](_0x37d31d['query'][_0x5179('0x2e')]);_0x215b47[_0x5179('0x31')]=qs[_0x5179('0x31')](_0x37d31d[_0x5179('0x45')][_0x5179('0x31')]);}_0x215b47[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x37d31d[_0x5179('0x45')][_0x5179('0x4d')]);_0x215b47['where']=qs['filters'](_[_0x5179('0x4e')](_0x37d31d['query'],_0x4f2585[_0x5179('0x46')]),_0x48a11b);if(_0x37d31d[_0x5179('0x45')][_0x5179('0x4f')]){_0x215b47[_0x5179('0x50')]=_[_0x5179('0x51')](_0x215b47['where'],{'$or':_[_0x5179('0x3d')](_0x48a11b,function(_0x318f1f){if(_0x318f1f[_0x5179('0x41')]!==_0x5179('0x52')){var _0x4c40f7={};_0x4c40f7[_0x318f1f[_0x5179('0x3b')]]={'$like':'%'+_0x37d31d['query'][_0x5179('0x4f')]+'%'};return _0x4c40f7;}})});}_0x215b47=_[_0x5179('0x51')]({},_0x215b47,_0x37d31d[_0x5179('0x53')]);var _0x3786ce={'where':_0x215b47['where']};return db['ChatQueue'][_0x5179('0x30')](_0x3786ce)['then'](function(_0x946802){_0x57f27b['count']=_0x946802;if(_0x37d31d[_0x5179('0x45')][_0x5179('0x54')]){_0x215b47['include']=[{'all':!![]}];}return db[_0x5179('0x3e')][_0x5179('0x55')](_0x215b47);})[_0x5179('0x36')](function(_0x4c32f1){_0x57f27b[_0x5179('0x56')]=_0x4c32f1;return _0x57f27b;})['then'](respondWithFilteredResult(_0x4b9cbb,_0x215b47))[_0x5179('0x29')](handleError(_0x4b9cbb,null));};exports['show']=function(_0x4b2104,_0x1e2d80){var _0x56c57f={'raw':!![],'where':{'id':_0x4b2104[_0x5179('0x57')]['id']}},_0x2e483c={};_0x2e483c['model']=_[_0x5179('0x44')](db[_0x5179('0x3e')]['rawAttributes']);_0x2e483c[_0x5179('0x45')]=_[_0x5179('0x44')](_0x4b2104[_0x5179('0x45')]);_0x2e483c['filters']=_[_0x5179('0x47')](_0x2e483c[_0x5179('0x43')],_0x2e483c[_0x5179('0x45')]);_0x56c57f[_0x5179('0x48')]=_[_0x5179('0x47')](_0x2e483c[_0x5179('0x43')],qs[_0x5179('0x49')](_0x4b2104[_0x5179('0x45')][_0x5179('0x49')]));_0x56c57f['attributes']=_0x56c57f[_0x5179('0x48')][_0x5179('0x4a')]?_0x56c57f[_0x5179('0x48')]:_0x2e483c[_0x5179('0x43')];if(_0x4b2104[_0x5179('0x45')][_0x5179('0x54')]){_0x56c57f[_0x5179('0x58')]=[{'all':!![]}];}_0x56c57f=_['merge']({},_0x56c57f,_0x4b2104[_0x5179('0x53')]);return db['ChatQueue'][_0x5179('0x59')](_0x56c57f)[_0x5179('0x36')](handleEntityNotFound(_0x1e2d80,null))['then'](respondWithResult(_0x1e2d80,null))[_0x5179('0x29')](handleError(_0x1e2d80,null));};exports[_0x5179('0x5a')]=function(_0x3b6b3e,_0x107e57){return db[_0x5179('0x3e')]['create'](_0x3b6b3e[_0x5179('0x5b')],{})[_0x5179('0x36')](function(_0x1dc143){var _0x2f8fe7=_0x3b6b3e[_0x5179('0x5c')][_0x5179('0x38')]({'plain':!![]});if(!_0x2f8fe7)throw new Error(_0x5179('0x5d'));if(_0x2f8fe7[_0x5179('0x5e')]===_0x5179('0x5c')){var _0x228d69=_0x1dc143[_0x5179('0x38')]({'plain':!![]});var _0x186721=_0x5179('0x5f');return db[_0x5179('0x60')]['find']({'where':{'name':_0x186721,'userProfileId':_0x2f8fe7['userProfileId']},'raw':!![]})[_0x5179('0x36')](function(_0x2a635e){if(_0x2a635e&&_0x2a635e['autoAssociation']===0x0){return db[_0x5179('0x39')][_0x5179('0x5a')]({'name':_0x228d69[_0x5179('0x3b')],'resourceId':_0x228d69['id'],'type':_0x2a635e[_0x5179('0x3b')],'sectionId':_0x2a635e['id']},{})['then'](function(){return _0x1dc143;});}else{return _0x1dc143;}})['catch'](function(_0x1a1f6f){logger['error'](_0x5179('0x61'),_0x1a1f6f);throw _0x1a1f6f;});}return _0x1dc143;})[_0x5179('0x36')](respondWithResult(_0x107e57,0xc9))[_0x5179('0x29')](handleError(_0x107e57,null));};exports[_0x5179('0x35')]=function(_0x1a4300,_0x4814e4){if(_0x1a4300[_0x5179('0x5b')]['id']){delete _0x1a4300[_0x5179('0x5b')]['id'];}return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x1a4300[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x4814e4,null))[_0x5179('0x36')](saveUpdates(_0x1a4300['body'],null))[_0x5179('0x36')](respondWithResult(_0x4814e4,null))[_0x5179('0x29')](handleError(_0x4814e4,null));};exports[_0x5179('0x37')]=function(_0x321a3f,_0x5c47ee){return db['ChatQueue'][_0x5179('0x59')]({'where':{'id':_0x321a3f[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x5c47ee,null))[_0x5179('0x36')](removeEntity(_0x5c47ee,null))[_0x5179('0x29')](handleError(_0x5c47ee,null));};exports[_0x5179('0x62')]=function(_0x12fbef,_0x3638fc){return db['ChatQueue'][_0x5179('0x62')]()[_0x5179('0x36')](respondWithResult(_0x3638fc,null))[_0x5179('0x29')](handleError(_0x3638fc,null));};exports[_0x5179('0x63')]=function(_0x5e9cca,_0x30edaa,_0x2103ad){var _0x44de8d={'raw':!![],'where':{}},_0x507716={},_0x1f894b;return db[_0x5179('0x3e')][_0x5179('0x64')]({'where':{'id':_0x5e9cca['params']['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x30edaa,null))[_0x5179('0x36')](function(_0x1d384b){if(_0x1d384b){_0x1f894b=_0x1d384b['get']({'plain':!![]});_0x507716[_0x5179('0x43')]=_['keys'](db[_0x5179('0x65')][_0x5179('0x3f')]);_0x507716[_0x5179('0x45')]=_[_0x5179('0x44')](_0x5e9cca[_0x5179('0x45')]);_0x507716['filters']=_[_0x5179('0x47')](_0x507716[_0x5179('0x43')],_0x507716[_0x5179('0x45')]);_0x44de8d[_0x5179('0x48')]=_[_0x5179('0x47')](_0x507716[_0x5179('0x43')],qs[_0x5179('0x49')](_0x5e9cca[_0x5179('0x45')][_0x5179('0x49')]));_0x44de8d[_0x5179('0x48')]=_0x44de8d[_0x5179('0x48')][_0x5179('0x4a')]?_0x44de8d[_0x5179('0x48')]:_0x507716[_0x5179('0x43')];if(!_0x5e9cca[_0x5179('0x45')][_0x5179('0x66')](_0x5179('0x4b'))){_0x44de8d[_0x5179('0x2e')]=qs['limit'](_0x5e9cca[_0x5179('0x45')][_0x5179('0x2e')]);_0x44de8d['offset']=qs[_0x5179('0x31')](_0x5e9cca[_0x5179('0x45')]['offset']);}_0x44de8d['order']=qs[_0x5179('0x4d')](_0x5e9cca['query'][_0x5179('0x4d')]);_0x44de8d[_0x5179('0x50')]=qs[_0x5179('0x46')](_[_0x5179('0x4e')](_0x5e9cca['query'],_0x507716['filters']));_0x44de8d[_0x5179('0x50')][_0x5179('0x67')]=_0x1d384b['id'];if(_0x5e9cca[_0x5179('0x45')]['filter']){_0x44de8d['where']=_['merge'](_0x44de8d['where'],{'$or':_[_0x5179('0x3d')](_0x44de8d[_0x5179('0x48')],function(_0x2d821c){var _0x1971a4={};_0x1971a4[_0x2d821c]={'$like':'%'+_0x5e9cca[_0x5179('0x45')][_0x5179('0x4f')]+'%'};return _0x1971a4;})});}_0x44de8d=_[_0x5179('0x51')]({},_0x44de8d,_0x5e9cca[_0x5179('0x53')]);return db[_0x5179('0x65')][_0x5179('0x55')](_0x44de8d);}})[_0x5179('0x36')](function(_0xd82940){if(_0xd82940){return db[_0x5179('0x68')][_0x5179('0x69')]({'where':{'id':_['map'](_0xd82940,'UserId'),'role':_0x5179('0x6a')},'attributes':['id',_0x5179('0x3b'),_0x5179('0x6b'),'updatedAt',_0x5179('0x6c')]});}})[_0x5179('0x36')](function(_0x3d16fc){if(_0x3d16fc){return{'count':_0x3d16fc['count'],'rows':_[_0x5179('0x3d')](_0x3d16fc['rows'],function(_0x9cd4a8){return{'membername':_0x9cd4a8['name'],'UserId':_0x9cd4a8['id'],'queue_name':_0x1f894b[_0x5179('0x3b')],'ChatQueueId':_0x1f894b['id'],'interface':util['format'](_0x5179('0x6d'),_0x5179('0x6e'),_0x9cd4a8[_0x5179('0x3b')]),'penalty':0x0,'paused':_0x9cd4a8[_0x5179('0x6b')],'createdAt':_0x9cd4a8[_0x5179('0x6c')],'updatedAt':_0x9cd4a8[_0x5179('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5179('0x36')](respondWithFilteredResult(_0x30edaa,_0x44de8d))['catch'](handleError(_0x30edaa,null));};exports[_0x5179('0x70')]=function(_0x3ea2ea,_0x1644ea,_0x1138a6){var _0x41eb64={};var _0x144d28={};var _0x33ec2e;var _0x52b261;return db[_0x5179('0x3e')]['findOne']({'where':{'id':_0x3ea2ea[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x1644ea,null))[_0x5179('0x36')](function(_0x23b77a){if(_0x23b77a){_0x33ec2e=_0x23b77a;_0x144d28[_0x5179('0x43')]=_[_0x5179('0x44')](db[_0x5179('0x71')][_0x5179('0x3f')]);_0x144d28[_0x5179('0x45')]=_['keys'](_0x3ea2ea[_0x5179('0x45')]);_0x144d28[_0x5179('0x46')]=_[_0x5179('0x47')](_0x144d28[_0x5179('0x43')],_0x144d28['query']);_0x41eb64[_0x5179('0x48')]=_[_0x5179('0x47')](_0x144d28[_0x5179('0x43')],qs['fields'](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x49')]));_0x41eb64[_0x5179('0x48')]=_0x41eb64[_0x5179('0x48')]['length']?_0x41eb64['attributes']:_0x144d28[_0x5179('0x43')];_0x41eb64[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x4d')]);_0x41eb64['where']=qs[_0x5179('0x46')](_[_0x5179('0x4e')](_0x3ea2ea[_0x5179('0x45')],_0x144d28[_0x5179('0x46')]));if(_0x3ea2ea[_0x5179('0x45')]['filter']){_0x41eb64['where']=_[_0x5179('0x51')](_0x41eb64[_0x5179('0x50')],{'$or':_[_0x5179('0x3d')](_0x41eb64['attributes'],function(_0x4fb9bd){var _0xb26d24={};_0xb26d24[_0x4fb9bd]={'$like':'%'+_0x3ea2ea[_0x5179('0x45')]['filter']+'%'};return _0xb26d24;})});}_0x41eb64=_['merge']({},_0x41eb64,_0x3ea2ea[_0x5179('0x53')]);return _0x33ec2e['getTeams'](_0x41eb64);}})[_0x5179('0x36')](function(_0x850a68){if(_0x850a68){_0x52b261=_0x850a68[_0x5179('0x4a')];if(!_0x3ea2ea[_0x5179('0x45')][_0x5179('0x66')]('nolimit')){_0x41eb64[_0x5179('0x2e')]=qs[_0x5179('0x2e')](_0x3ea2ea[_0x5179('0x45')]['limit']);_0x41eb64['offset']=qs['offset'](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x31')]);}return _0x33ec2e[_0x5179('0x70')](_0x41eb64);}})[_0x5179('0x36')](function(_0x83a96c){if(_0x83a96c){return _0x83a96c?{'count':_0x52b261,'rows':_0x83a96c}:null;}})[_0x5179('0x36')](respondWithResult(_0x1644ea,null))['catch'](handleError(_0x1644ea,null));};exports[_0x5179('0x72')]=function(_0x31cc65,_0x107b68,_0x59c04e){var _0x6a6533=_0x31cc65[_0x5179('0x5b')][_0x5179('0x73')];return db['Team'][_0x5179('0x55')]({'where':{'id':_0x6a6533},'attributes':['id'],'include':[{'model':db[_0x5179('0x68')],'as':_0x5179('0x74'),'attributes':['id',_0x5179('0x3b'),_0x5179('0x75'),_0x5179('0x76'),'interface'],'raw':!![]}]})[_0x5179('0x36')](function(_0x25b33f){if(_0x25b33f){var _0x1abb60=_[_0x5179('0x77')](_0x25b33f,function(_0x3f55c5){var _0xcb7ecd=_0x3f55c5['get']({'plain':!![]});return _0xcb7ecd[_0x5179('0x74')];});return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x31cc65[_0x5179('0x57')]['id']}})[_0x5179('0x36')](function(_0x460df2){return db['sequelize'][_0x5179('0x78')](function(_0x558542){return _0x460df2[_0x5179('0x72')](_0x6a6533,{'transaction':_0x558542})[_0x5179('0x36')](function(){return BPromise[_0x5179('0x79')](_0x1abb60,function(_0x3b2fb7){return db['UserChatQueue'][_0x5179('0x7a')]({'where':{'UserId':_0x3b2fb7['id'],'ChatQueueId':_0x31cc65['params']['id']},'transaction':_0x558542});});})[_0x5179('0x36')](function(){_0x1abb60[_0x5179('0x7b')](function(_0x37eeeb){socket[_0x5179('0x7c')](_0x5179('0x7d'),{'UserId':_0x37eeeb['id'],'ChatQueueId':_0x460df2['id']});});});});});}})[_0x5179('0x36')](respondWithStatusCode(_0x107b68,null))[_0x5179('0x29')](handleError(_0x107b68,null));};exports[_0x5179('0x7e')]=function(_0x9f269e,_0x4a0e8f,_0x4c9085){return db[_0x5179('0x71')][_0x5179('0x55')]({'where':{'id':_0x9f269e[_0x5179('0x45')][_0x5179('0x73')]},'attributes':['id'],'include':[{'model':db[_0x5179('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4a0e8f,null))[_0x5179('0x36')](function(_0xe75b5){var _0x4c2af1=_[_0x5179('0x3d')](_0xe75b5,'id');var _0x41b57b=[];var _0x123788=[];var _0x5577fc=squel[_0x5179('0x7f')]();_0x5577fc[_0x5179('0x80')](_0x5179('0x81'))[_0x5179('0x82')](_0x5179('0x83'),'tq')[_0x5179('0x84')]('user_has_teams','ut',_0x5179('0x85'))[_0x5179('0x50')](_0x5179('0x86'),_0x9f269e['params']['id']);for(var _0x201050=0x0;_0x201050<_0xe75b5['length'];_0x201050+=0x1){let _0x29490d=_0xe75b5[_0x201050];for(var _0x4ea70a=0x0;_0x4ea70a<_0x29490d[_0x5179('0x74')][_0x5179('0x4a')];_0x4ea70a+=0x1){let _0x25adb3=_0x29490d[_0x5179('0x74')][_0x4ea70a];var _0x146b18=_0x5577fc[_0x5179('0x87')]();_0x146b18[_0x5179('0x50')](_0x5179('0x88'),_0x25adb3['id']);_0x123788[_0x5179('0x89')](db[_0x5179('0x8a')]['query'](_0x146b18[_0x5179('0x8b')](),{'type':db[_0x5179('0x8a')][_0x5179('0x8c')]['SELECT']})[_0x5179('0x36')](function(_0x410aff){if(_0x410aff[_0x5179('0x4a')]===0x1){return _0x25adb3['id'];}else{var _0x401ebe=_[_0x5179('0x8d')](_[_0x5179('0x3d')](_0x410aff,_0x5179('0x8e')),function(_0xa35f){return _[_0x5179('0x8f')](_0x4c2af1,_0xa35f);});if(_0x401ebe){return _0x25adb3['id'];}}}));}}return BPromise[_0x5179('0x90')](_0x123788)['then'](function(_0x11f737){_0x41b57b=_(_0x41b57b)[_0x5179('0x91')](_0x11f737)[_0x5179('0x92')]()[_0x5179('0x93')]();return db['ChatQueue'][_0x5179('0x59')]({'where':{'id':_0x9f269e[_0x5179('0x57')]['id']}})[_0x5179('0x36')](function(_0x353a4e){return db[_0x5179('0x8a')]['transaction'](function(_0x31ab7d){return _0x353a4e['removeTeams'](_0x9f269e[_0x5179('0x45')][_0x5179('0x73')],{'transaction':_0x31ab7d})[_0x5179('0x36')](function(){if(!_['isEmpty'](_0x41b57b)){return _0x353a4e[_0x5179('0x94')](_0x41b57b,{'transaction':_0x31ab7d});}})['then'](function(){_0x41b57b[_0x5179('0x7b')](function(_0x2ef2e6){socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':_0x2ef2e6,'ChatQueueId':_0x353a4e['id']});});});});});});})[_0x5179('0x36')](respondWithStatusCode(_0x4a0e8f,null))[_0x5179('0x29')](handleError(_0x4a0e8f,null));};exports[_0x5179('0x96')]=function(_0xb05ba5,_0x1e316d,_0x3ace40){return db[_0x5179('0x3e')]['find']({'where':{'id':_0xb05ba5[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x1e316d,null))[_0x5179('0x36')](function(_0x27d6d9){if(_0x27d6d9){return _0x27d6d9[_0x5179('0x96')](_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')],_[_0x5179('0x97')](_0xb05ba5[_0x5179('0x5b')],[_0x5179('0x73'),'id'])||{})[_0x5179('0x98')](function(_0x443b34){for(var _0x381cdb=0x0;_0x381cdb<_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')][_0x5179('0x4a')];_0x381cdb+=0x1){socket[_0x5179('0x7c')](_0x5179('0x7d'),{'UserId':Number(_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')][_0x381cdb]),'ChatQueueId':Number(_0xb05ba5[_0x5179('0x57')]['id'])});}return _0x443b34;});}})[_0x5179('0x36')](respondWithResult(_0x1e316d,null))['catch'](handleError(_0x1e316d,null));};exports['removeAgents']=function(_0x41b5d1,_0x48c061,_0x4ce802){return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x41b5d1[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x48c061,null))[_0x5179('0x36')](function(_0x5e435f){if(_0x5e435f){return _0x5e435f['removeAgents'](_0x41b5d1['query']['ids'])[_0x5179('0x36')](function(){if(_['isArray'](_0x41b5d1['query'][_0x5179('0x73')])){for(var _0x386e42=0x0;_0x386e42<_0x41b5d1['query']['ids'][_0x5179('0x4a')];_0x386e42+=0x1){socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':Number(_0x41b5d1[_0x5179('0x45')][_0x5179('0x73')][_0x386e42]),'ChatQueueId':Number(_0x41b5d1[_0x5179('0x57')]['id'])});}}else{socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':Number(_0x41b5d1['query'][_0x5179('0x73')]),'ChatQueueId':Number(_0x41b5d1[_0x5179('0x57')]['id'])});}});}})[_0x5179('0x36')](respondWithStatusCode(_0x48c061,null))[_0x5179('0x29')](handleError(_0x48c061,null));};exports[_0x5179('0x99')]=function(_0x90bde7,_0x804e84,_0x308e87){var _0x1c2dbb={};var _0x3bfd10={};var _0x1abc43;var _0x211546;return db[_0x5179('0x3e')][_0x5179('0x64')]({'where':{'id':_0x90bde7['params']['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x804e84,null))[_0x5179('0x36')](function(_0x30545a){if(_0x30545a){_0x1abc43=_0x30545a;_0x3bfd10['model']=_['keys'](db[_0x5179('0x68')][_0x5179('0x3f')]);_0x3bfd10['query']=_[_0x5179('0x44')](_0x90bde7[_0x5179('0x45')]);_0x3bfd10[_0x5179('0x46')]=_['intersection'](_0x3bfd10[_0x5179('0x43')],_0x3bfd10[_0x5179('0x45')]);_0x1c2dbb[_0x5179('0x48')]=_['intersection'](_0x3bfd10[_0x5179('0x43')],qs[_0x5179('0x49')](_0x90bde7[_0x5179('0x45')][_0x5179('0x49')]));_0x1c2dbb[_0x5179('0x48')]=_0x1c2dbb[_0x5179('0x48')]['length']?_0x1c2dbb[_0x5179('0x48')]:_0x3bfd10[_0x5179('0x43')];_0x1c2dbb[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x90bde7[_0x5179('0x45')][_0x5179('0x4d')]);_0x1c2dbb[_0x5179('0x50')]=qs['filters'](_[_0x5179('0x4e')](_0x90bde7[_0x5179('0x45')],_0x3bfd10[_0x5179('0x46')]));if(_0x90bde7[_0x5179('0x45')][_0x5179('0x4f')]){_0x1c2dbb[_0x5179('0x50')]=_[_0x5179('0x51')](_0x1c2dbb[_0x5179('0x50')],{'$or':_[_0x5179('0x3d')](_0x1c2dbb[_0x5179('0x48')],function(_0x24ea84){var _0x4d1fa9={};_0x4d1fa9[_0x24ea84]={'$like':'%'+_0x90bde7[_0x5179('0x45')][_0x5179('0x4f')]+'%'};return _0x4d1fa9;})});}_0x1c2dbb=_[_0x5179('0x51')]({},_0x1c2dbb,_0x90bde7[_0x5179('0x53')]);return _0x1abc43[_0x5179('0x99')](_0x1c2dbb);}})['then'](function(_0x224c22){if(_0x224c22){_0x211546=_0x224c22[_0x5179('0x4a')];if(!_0x90bde7[_0x5179('0x45')][_0x5179('0x66')](_0x5179('0x4b'))){_0x1c2dbb['limit']=qs[_0x5179('0x2e')](_0x90bde7[_0x5179('0x45')][_0x5179('0x2e')]);_0x1c2dbb[_0x5179('0x31')]=qs['offset'](_0x90bde7[_0x5179('0x45')][_0x5179('0x31')]);}return _0x1abc43[_0x5179('0x99')](_0x1c2dbb);}})[_0x5179('0x36')](function(_0xe641b1){if(_0xe641b1){return _0xe641b1?{'count':_0x211546,'rows':_0xe641b1}:null;}})[_0x5179('0x36')](respondWithResult(_0x804e84,null))[_0x5179('0x29')](handleError(_0x804e84,null));};
\ No newline at end of file
+var _0xc705=['rawAttributes','includeAll','find','create','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','format','Team','getTeams','nolimit','ids','Agents','voicePause','interface','sequelize','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','get','UserProfileResource','stack','name','send','map','ChatQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xc705,0x1e9));var _0x5c70=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xc705[_0x39780c];return _0x53c19b;};'use strict';var emlformat=require(_0x5c70('0x0'));var rimraf=require(_0x5c70('0x1'));var zipdir=require(_0x5c70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c70('0x3'));var moment=require(_0x5c70('0x4'));var BPromise=require(_0x5c70('0x5'));var Mustache=require(_0x5c70('0x6'));var util=require(_0x5c70('0x7'));var path=require(_0x5c70('0x8'));var sox=require(_0x5c70('0x9'));var csv=require(_0x5c70('0xa'));var ejs=require(_0x5c70('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c70('0xc'));var jsforce=require(_0x5c70('0xd'));var deskjs=require(_0x5c70('0xe'));var toCsv=require(_0x5c70('0xa'));var querystring=require(_0x5c70('0xf'));var Papa=require(_0x5c70('0x10'));var Redis=require(_0x5c70('0x11'));var authService=require(_0x5c70('0x12'));var qs=require(_0x5c70('0x13'));var as=require(_0x5c70('0x14'));var hardwareService=require(_0x5c70('0x15'));var logger=require('../../config/logger')(_0x5c70('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c70('0x17'));var db=require('../../mysqldb')['db'];config[_0x5c70('0x18')]=_[_0x5c70('0x19')](config[_0x5c70('0x18')],{'host':_0x5c70('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c70('0x18')]));require(_0x5c70('0x1b'))[_0x5c70('0x1c')](socket);var jayson=require(_0x5c70('0x1d'));var client=jayson[_0x5c70('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd78192,_0x37a296,_0x4941d0,_0x91471c){return new BPromise(function(_0x262f2e,_0x10ac7c){var _0x1ae873=_0x91471c||client;return _0x1ae873[_0x5c70('0x1f')](_0xd78192,_0x4941d0)[_0x5c70('0x20')](function(_0x4584f7){logger['info'](_0x5c70('0x21'),_0x37a296,'request\x20sent');logger[_0x5c70('0x22')](_0x5c70('0x23'),_0x37a296,_0x5c70('0x24'),JSON[_0x5c70('0x25')](_0x4584f7));if(_0x4584f7[_0x5c70('0x26')]){if(_0x4584f7['error']['code']===0x1f4){logger[_0x5c70('0x26')](_0x5c70('0x21'),_0x37a296,_0x4584f7[_0x5c70('0x26')]['message']);return _0x10ac7c(_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);}logger[_0x5c70('0x26')](_0x5c70('0x21'),_0x37a296,_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);return _0x262f2e(_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);}else{logger[_0x5c70('0x28')](_0x5c70('0x21'),_0x37a296,'request\x20sent');_0x262f2e(_0x4584f7[_0x5c70('0x29')]['message']);}})['catch'](function(_0x14d467){logger[_0x5c70('0x26')]('ChatQueue,\x20%s,\x20%s',_0x37a296,_0x14d467);_0x10ac7c(_0x14d467);});});}function respondWithStatusCode(_0x19d6e3,_0x3f0369){_0x3f0369=_0x3f0369||0xcc;return function(_0xfbc354){if(_0xfbc354){return _0x19d6e3[_0x5c70('0x2a')](_0x3f0369);}return _0x19d6e3[_0x5c70('0x2b')](_0x3f0369)[_0x5c70('0x2c')]();};}function respondWithResult(_0x59814c,_0x2ed737){_0x2ed737=_0x2ed737||0xc8;return function(_0x58c711){if(_0x58c711){return _0x59814c[_0x5c70('0x2b')](_0x2ed737)[_0x5c70('0x2d')](_0x58c711);}};}function respondWithFilteredResult(_0x3dc80b,_0x2f1d2d){return function(_0xebc58f){if(_0xebc58f){var _0x58c242=typeof _0x2f1d2d[_0x5c70('0x2e')]===_0x5c70('0x2f')&&typeof _0x2f1d2d[_0x5c70('0x30')]===_0x5c70('0x2f');var _0xf7f468=_0xebc58f[_0x5c70('0x31')];var _0x86615=_0x58c242?0x0:_0x2f1d2d[_0x5c70('0x2e')];var _0x45a7fb=_0x58c242?_0xebc58f[_0x5c70('0x31')]:_0x2f1d2d[_0x5c70('0x2e')]+_0x2f1d2d['limit'];var _0x59716b;if(_0x45a7fb>=_0xf7f468){_0x45a7fb=_0xf7f468;_0x59716b=0xc8;}else{_0x59716b=0xce;}_0x3dc80b[_0x5c70('0x2b')](_0x59716b);return _0x3dc80b[_0x5c70('0x32')]('Content-Range',_0x86615+'-'+_0x45a7fb+'/'+_0xf7f468)[_0x5c70('0x2d')](_0xebc58f);}return null;};}function patchUpdates(_0x14aeab){return function(_0xdb11a0){try{jsonpatch[_0x5c70('0x33')](_0xdb11a0,_0x14aeab,!![]);}catch(_0x2d1617){return BPromise[_0x5c70('0x34')](_0x2d1617);}return _0xdb11a0[_0x5c70('0x35')]();};}function saveUpdates(_0x479207,_0x5677af){return function(_0x4cff9a){if(_0x4cff9a){return _0x4cff9a[_0x5c70('0x36')](_0x479207)[_0x5c70('0x20')](function(_0x58d9f1){return _0x58d9f1;});}return null;};}function removeEntity(_0x33632b,_0x3bdcb8){return function(_0x7a40ee){if(_0x7a40ee){return _0x7a40ee['destroy']()['then'](function(){var _0x71aec3=_0x7a40ee[_0x5c70('0x37')]({'plain':!![]});var _0x4563aa='ChatQueues';return db[_0x5c70('0x38')]['destroy']({'where':{'type':_0x4563aa,'resourceId':_0x71aec3['id']}})[_0x5c70('0x20')](function(){return _0x7a40ee;});})[_0x5c70('0x20')](function(){_0x33632b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2080dd,_0x3579a8){return function(_0x1e1837){if(!_0x1e1837){_0x2080dd[_0x5c70('0x2a')](0x194);}return _0x1e1837;};}function handleError(_0x513a88,_0x14c058){_0x14c058=_0x14c058||0x1f4;return function(_0x4e58c7){logger['error'](_0x4e58c7[_0x5c70('0x39')]);if(_0x4e58c7[_0x5c70('0x3a')]){delete _0x4e58c7[_0x5c70('0x3a')];}_0x513a88[_0x5c70('0x2b')](_0x14c058)[_0x5c70('0x3b')](_0x4e58c7);};}exports['index']=function(_0x74690,_0x3ab51e){var _0x116efe={},_0x37b415={},_0x38eacb={'count':0x0,'rows':[]};var _0x47e762=_[_0x5c70('0x3c')](db[_0x5c70('0x3d')]['rawAttributes'],function(_0x3e3cfd){return{'name':_0x3e3cfd[_0x5c70('0x3e')],'type':_0x3e3cfd[_0x5c70('0x3f')][_0x5c70('0x40')]};});_0x37b415[_0x5c70('0x41')]=_['map'](_0x47e762,_0x5c70('0x3a'));_0x37b415[_0x5c70('0x42')]=_['keys'](_0x74690[_0x5c70('0x42')]);_0x37b415[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x37b415[_0x5c70('0x41')],_0x37b415[_0x5c70('0x42')]);_0x116efe[_0x5c70('0x45')]=_['intersection'](_0x37b415[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x74690[_0x5c70('0x42')][_0x5c70('0x46')]));_0x116efe['attributes']=_0x116efe['attributes'][_0x5c70('0x47')]?_0x116efe[_0x5c70('0x45')]:_0x37b415[_0x5c70('0x41')];if(!_0x74690[_0x5c70('0x42')][_0x5c70('0x48')]('nolimit')){_0x116efe[_0x5c70('0x30')]=qs[_0x5c70('0x30')](_0x74690[_0x5c70('0x42')][_0x5c70('0x30')]);_0x116efe[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0x74690[_0x5c70('0x42')][_0x5c70('0x2e')]);}_0x116efe[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0x74690[_0x5c70('0x42')][_0x5c70('0x4a')]);_0x116efe[_0x5c70('0x4b')]=qs[_0x5c70('0x43')](_[_0x5c70('0x4c')](_0x74690['query'],_0x37b415['filters']),_0x47e762);if(_0x74690[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x116efe[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x116efe[_0x5c70('0x4b')],{'$or':_['map'](_0x47e762,function(_0x326ac9){if(_0x326ac9['type']!=='VIRTUAL'){var _0x1376de={};_0x1376de[_0x326ac9[_0x5c70('0x3a')]]={'$like':'%'+_0x74690[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x1376de;}})});}_0x116efe=_['merge']({},_0x116efe,_0x74690[_0x5c70('0x4f')]);var _0x4e4b5f={'where':_0x116efe[_0x5c70('0x4b')]};return db[_0x5c70('0x3d')][_0x5c70('0x31')](_0x4e4b5f)[_0x5c70('0x20')](function(_0x384c58){_0x38eacb[_0x5c70('0x31')]=_0x384c58;if(_0x74690[_0x5c70('0x42')]['includeAll']){_0x116efe[_0x5c70('0x50')]=[{'all':!![]}];}return db[_0x5c70('0x3d')][_0x5c70('0x51')](_0x116efe);})[_0x5c70('0x20')](function(_0x2b9964){_0x38eacb[_0x5c70('0x52')]=_0x2b9964;return _0x38eacb;})[_0x5c70('0x20')](respondWithFilteredResult(_0x3ab51e,_0x116efe))[_0x5c70('0x53')](handleError(_0x3ab51e,null));};exports[_0x5c70('0x54')]=function(_0x1b5ef3,_0xc15f87){var _0x2df318={'raw':!![],'where':{'id':_0x1b5ef3[_0x5c70('0x55')]['id']}},_0xc440d={};_0xc440d[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x3d')][_0x5c70('0x57')]);_0xc440d[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x1b5ef3[_0x5c70('0x42')]);_0xc440d['filters']=_[_0x5c70('0x44')](_0xc440d[_0x5c70('0x41')],_0xc440d[_0x5c70('0x42')]);_0x2df318[_0x5c70('0x45')]=_[_0x5c70('0x44')](_0xc440d['model'],qs[_0x5c70('0x46')](_0x1b5ef3[_0x5c70('0x42')][_0x5c70('0x46')]));_0x2df318[_0x5c70('0x45')]=_0x2df318[_0x5c70('0x45')][_0x5c70('0x47')]?_0x2df318[_0x5c70('0x45')]:_0xc440d[_0x5c70('0x41')];if(_0x1b5ef3[_0x5c70('0x42')][_0x5c70('0x58')]){_0x2df318[_0x5c70('0x50')]=[{'all':!![]}];}_0x2df318=_[_0x5c70('0x4e')]({},_0x2df318,_0x1b5ef3[_0x5c70('0x4f')]);return db[_0x5c70('0x3d')][_0x5c70('0x59')](_0x2df318)[_0x5c70('0x20')](handleEntityNotFound(_0xc15f87,null))[_0x5c70('0x20')](respondWithResult(_0xc15f87,null))[_0x5c70('0x53')](handleError(_0xc15f87,null));};exports[_0x5c70('0x5a')]=function(_0x14114b,_0x433ff){return db[_0x5c70('0x3d')][_0x5c70('0x5a')](_0x14114b['body'],{})[_0x5c70('0x20')](function(_0x45eac1){var _0x45a595=_0x14114b[_0x5c70('0x5b')][_0x5c70('0x37')]({'plain':!![]});if(!_0x45a595)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45a595['role']===_0x5c70('0x5b')){var _0x1c809d=_0x45eac1['get']({'plain':!![]});var _0x1aa1a4=_0x5c70('0x5c');return db[_0x5c70('0x5d')][_0x5c70('0x59')]({'where':{'name':_0x1aa1a4,'userProfileId':_0x45a595[_0x5c70('0x5e')]},'raw':!![]})['then'](function(_0x6edaa2){if(_0x6edaa2&&_0x6edaa2[_0x5c70('0x5f')]===0x0){return db[_0x5c70('0x38')][_0x5c70('0x5a')]({'name':_0x1c809d[_0x5c70('0x3a')],'resourceId':_0x1c809d['id'],'type':_0x6edaa2['name'],'sectionId':_0x6edaa2['id']},{})[_0x5c70('0x20')](function(){return _0x45eac1;});}else{return _0x45eac1;}})[_0x5c70('0x53')](function(_0x969120){logger['error'](_0x5c70('0x60'),_0x969120);throw _0x969120;});}return _0x45eac1;})[_0x5c70('0x20')](respondWithResult(_0x433ff,0xc9))[_0x5c70('0x53')](handleError(_0x433ff,null));};exports[_0x5c70('0x36')]=function(_0x2ebfb6,_0xb9c0e9){if(_0x2ebfb6[_0x5c70('0x61')]['id']){delete _0x2ebfb6['body']['id'];}return db['ChatQueue'][_0x5c70('0x59')]({'where':{'id':_0x2ebfb6[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0xb9c0e9,null))[_0x5c70('0x20')](saveUpdates(_0x2ebfb6[_0x5c70('0x61')],null))[_0x5c70('0x20')](respondWithResult(_0xb9c0e9,null))[_0x5c70('0x53')](handleError(_0xb9c0e9,null));};exports[_0x5c70('0x62')]=function(_0x5f3ff6,_0x1499d4){return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x5f3ff6[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0x1499d4,null))[_0x5c70('0x20')](removeEntity(_0x1499d4,null))[_0x5c70('0x53')](handleError(_0x1499d4,null));};exports[_0x5c70('0x63')]=function(_0x42b764,_0x1885c7){return db[_0x5c70('0x3d')][_0x5c70('0x63')]()[_0x5c70('0x20')](respondWithResult(_0x1885c7,null))[_0x5c70('0x53')](handleError(_0x1885c7,null));};exports[_0x5c70('0x64')]=function(_0x151fd8,_0x4a6e32,_0x22bd18){var _0x2de336={'raw':!![],'where':{}},_0x23c038={},_0x2a0c14;return db[_0x5c70('0x3d')][_0x5c70('0x65')]({'where':{'id':_0x151fd8[_0x5c70('0x55')]['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x4a6e32,null))[_0x5c70('0x20')](function(_0x3dca00){if(_0x3dca00){_0x2a0c14=_0x3dca00[_0x5c70('0x37')]({'plain':!![]});_0x23c038[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x66')]['rawAttributes']);_0x23c038[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x151fd8['query']);_0x23c038[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x23c038[_0x5c70('0x41')],_0x23c038['query']);_0x2de336['attributes']=_['intersection'](_0x23c038[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x151fd8[_0x5c70('0x42')][_0x5c70('0x46')]));_0x2de336[_0x5c70('0x45')]=_0x2de336[_0x5c70('0x45')]['length']?_0x2de336['attributes']:_0x23c038[_0x5c70('0x41')];if(!_0x151fd8[_0x5c70('0x42')][_0x5c70('0x48')]('nolimit')){_0x2de336[_0x5c70('0x30')]=qs['limit'](_0x151fd8[_0x5c70('0x42')]['limit']);_0x2de336['offset']=qs[_0x5c70('0x2e')](_0x151fd8['query'][_0x5c70('0x2e')]);}_0x2de336['order']=qs[_0x5c70('0x4a')](_0x151fd8[_0x5c70('0x42')]['sort']);_0x2de336['where']=qs[_0x5c70('0x43')](_[_0x5c70('0x4c')](_0x151fd8[_0x5c70('0x42')],_0x23c038[_0x5c70('0x43')]));_0x2de336[_0x5c70('0x4b')][_0x5c70('0x67')]=_0x3dca00['id'];if(_0x151fd8[_0x5c70('0x42')]['filter']){_0x2de336[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x2de336['where'],{'$or':_[_0x5c70('0x3c')](_0x2de336[_0x5c70('0x45')],function(_0x18d2a1){var _0x42dc97={};_0x42dc97[_0x18d2a1]={'$like':'%'+_0x151fd8[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x42dc97;})});}_0x2de336=_[_0x5c70('0x4e')]({},_0x2de336,_0x151fd8[_0x5c70('0x4f')]);return db[_0x5c70('0x66')]['findAll'](_0x2de336);}})[_0x5c70('0x20')](function(_0x57308c){if(_0x57308c){return db[_0x5c70('0x68')][_0x5c70('0x69')]({'where':{'id':_[_0x5c70('0x3c')](_0x57308c,'UserId'),'role':_0x5c70('0x6a')},'attributes':['id',_0x5c70('0x3a'),_0x5c70('0x6b'),_0x5c70('0x6c'),'createdAt']});}})[_0x5c70('0x20')](function(_0x50ee6d){if(_0x50ee6d){return{'count':_0x50ee6d['count'],'rows':_[_0x5c70('0x3c')](_0x50ee6d['rows'],function(_0xbbda4f){return{'membername':_0xbbda4f[_0x5c70('0x3a')],'UserId':_0xbbda4f['id'],'queue_name':_0x2a0c14['name'],'ChatQueueId':_0x2a0c14['id'],'interface':util[_0x5c70('0x6d')]('%s/%s','SIP',_0xbbda4f['name']),'penalty':0x0,'paused':_0xbbda4f[_0x5c70('0x6b')],'createdAt':_0xbbda4f['createdAt'],'updatedAt':_0xbbda4f[_0x5c70('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c70('0x20')](respondWithFilteredResult(_0x4a6e32,_0x2de336))[_0x5c70('0x53')](handleError(_0x4a6e32,null));};exports['getTeams']=function(_0xbffeec,_0x221a5e,_0x468800){var _0x2b8d8b={};var _0x49e3df={};var _0x2b9525;var _0x4f456d;return db[_0x5c70('0x3d')]['findOne']({'where':{'id':_0xbffeec['params']['id']}})['then'](handleEntityNotFound(_0x221a5e,null))[_0x5c70('0x20')](function(_0x368c4b){if(_0x368c4b){_0x2b9525=_0x368c4b;_0x49e3df[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x6e')][_0x5c70('0x57')]);_0x49e3df[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0xbffeec[_0x5c70('0x42')]);_0x49e3df[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x49e3df[_0x5c70('0x41')],_0x49e3df['query']);_0x2b8d8b['attributes']=_[_0x5c70('0x44')](_0x49e3df['model'],qs[_0x5c70('0x46')](_0xbffeec['query']['fields']));_0x2b8d8b[_0x5c70('0x45')]=_0x2b8d8b[_0x5c70('0x45')][_0x5c70('0x47')]?_0x2b8d8b[_0x5c70('0x45')]:_0x49e3df[_0x5c70('0x41')];_0x2b8d8b[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x4a')]);_0x2b8d8b[_0x5c70('0x4b')]=qs[_0x5c70('0x43')](_['pick'](_0xbffeec['query'],_0x49e3df[_0x5c70('0x43')]));if(_0xbffeec[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x2b8d8b[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x2b8d8b[_0x5c70('0x4b')],{'$or':_[_0x5c70('0x3c')](_0x2b8d8b['attributes'],function(_0x30d879){var _0x19f979={};_0x19f979[_0x30d879]={'$like':'%'+_0xbffeec[_0x5c70('0x42')]['filter']+'%'};return _0x19f979;})});}_0x2b8d8b=_['merge']({},_0x2b8d8b,_0xbffeec[_0x5c70('0x4f')]);return _0x2b9525[_0x5c70('0x6f')](_0x2b8d8b);}})[_0x5c70('0x20')](function(_0x488934){if(_0x488934){_0x4f456d=_0x488934['length'];if(!_0xbffeec[_0x5c70('0x42')]['hasOwnProperty'](_0x5c70('0x70'))){_0x2b8d8b[_0x5c70('0x30')]=qs['limit'](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x30')]);_0x2b8d8b[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x2e')]);}return _0x2b9525[_0x5c70('0x6f')](_0x2b8d8b);}})[_0x5c70('0x20')](function(_0x2cb0f7){if(_0x2cb0f7){return _0x2cb0f7?{'count':_0x4f456d,'rows':_0x2cb0f7}:null;}})[_0x5c70('0x20')](respondWithResult(_0x221a5e,null))[_0x5c70('0x53')](handleError(_0x221a5e,null));};exports['addTeams']=function(_0x19057b,_0x33373c,_0x4477c5){var _0x85a3fe=_0x19057b['body'][_0x5c70('0x71')];return db['Team'][_0x5c70('0x51')]({'where':{'id':_0x85a3fe},'attributes':['id'],'include':[{'model':db[_0x5c70('0x68')],'as':_0x5c70('0x72'),'attributes':['id',_0x5c70('0x3a'),'online',_0x5c70('0x73'),_0x5c70('0x74')],'raw':!![]}]})[_0x5c70('0x20')](function(_0x52f3a8){if(_0x52f3a8){var _0xcf4cfb=_['flatMap'](_0x52f3a8,function(_0xfe895e){var _0x4781dc=_0xfe895e[_0x5c70('0x37')]({'plain':!![]});return _0x4781dc[_0x5c70('0x72')];});return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x19057b['params']['id']}})[_0x5c70('0x20')](function(_0x1b5ec2){return db[_0x5c70('0x75')]['transaction'](function(_0x46dd30){return _0x1b5ec2['addTeams'](_0x85a3fe,{'transaction':_0x46dd30})[_0x5c70('0x20')](function(){return BPromise['each'](_0xcf4cfb,function(_0x1484b1){return db[_0x5c70('0x66')]['findOrCreate']({'where':{'UserId':_0x1484b1['id'],'ChatQueueId':_0x19057b[_0x5c70('0x55')]['id']},'transaction':_0x46dd30});});})['then'](function(){_0xcf4cfb[_0x5c70('0x76')](function(_0x546e2b){socket[_0x5c70('0x77')](_0x5c70('0x78'),{'UserId':_0x546e2b['id'],'ChatQueueId':_0x1b5ec2['id']});});});});});}})[_0x5c70('0x20')](respondWithStatusCode(_0x33373c,null))[_0x5c70('0x53')](handleError(_0x33373c,null));};exports[_0x5c70('0x79')]=function(_0x48fa9b,_0x2d4a61,_0x5d29bf){return db[_0x5c70('0x6e')][_0x5c70('0x51')]({'where':{'id':_0x48fa9b[_0x5c70('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5c70('0x68')],'as':_0x5c70('0x72'),'attributes':['id'],'raw':!![]}]})[_0x5c70('0x20')](handleEntityNotFound(_0x2d4a61,null))[_0x5c70('0x20')](function(_0x4604cf){var _0x108cfb=_[_0x5c70('0x3c')](_0x4604cf,'id');var _0x167265=[];var _0x3423fc=[];var _0x30e520=squel[_0x5c70('0x7a')]();_0x30e520[_0x5c70('0x7b')](_0x5c70('0x7c'))['from'](_0x5c70('0x7d'),'tq')[_0x5c70('0x7e')](_0x5c70('0x7f'),'ut',_0x5c70('0x80'))[_0x5c70('0x4b')](_0x5c70('0x81'),_0x48fa9b[_0x5c70('0x55')]['id']);for(var _0xcc483d=0x0;_0xcc483d<_0x4604cf[_0x5c70('0x47')];_0xcc483d+=0x1){let _0x36d8a8=_0x4604cf[_0xcc483d];for(var _0x2b005f=0x0;_0x2b005f<_0x36d8a8[_0x5c70('0x72')][_0x5c70('0x47')];_0x2b005f+=0x1){let _0x405286=_0x36d8a8['Agents'][_0x2b005f];var _0x32cf29=_0x30e520['clone']();_0x32cf29[_0x5c70('0x4b')]('ut.UserId\x20=\x20?',_0x405286['id']);_0x3423fc[_0x5c70('0x82')](db['sequelize'][_0x5c70('0x42')](_0x32cf29[_0x5c70('0x83')](),{'type':db[_0x5c70('0x75')][_0x5c70('0x84')][_0x5c70('0x85')]})['then'](function(_0x2d5490){if(_0x2d5490[_0x5c70('0x47')]===0x1){return _0x405286['id'];}else{var _0x2a0214=_['every'](_['map'](_0x2d5490,_0x5c70('0x86')),function(_0x302d56){return _[_0x5c70('0x87')](_0x108cfb,_0x302d56);});if(_0x2a0214){return _0x405286['id'];}}}));}}return BPromise['all'](_0x3423fc)['then'](function(_0x56d350){_0x167265=_(_0x167265)[_0x5c70('0x88')](_0x56d350)[_0x5c70('0x89')]()['value']();return db[_0x5c70('0x3d')][_0x5c70('0x59')]({'where':{'id':_0x48fa9b['params']['id']}})[_0x5c70('0x20')](function(_0x2b6e56){return db[_0x5c70('0x75')][_0x5c70('0x8a')](function(_0x39e74c){return _0x2b6e56[_0x5c70('0x79')](_0x48fa9b[_0x5c70('0x42')]['ids'],{'transaction':_0x39e74c})[_0x5c70('0x20')](function(){if(!_['isEmpty'](_0x167265)){return _0x2b6e56[_0x5c70('0x8b')](_0x167265,{'transaction':_0x39e74c});}})[_0x5c70('0x20')](function(){_0x167265[_0x5c70('0x76')](function(_0x2200ef){socket[_0x5c70('0x77')](_0x5c70('0x8c'),{'UserId':_0x2200ef,'ChatQueueId':_0x2b6e56['id']});});});});});});})[_0x5c70('0x20')](respondWithStatusCode(_0x2d4a61,null))[_0x5c70('0x53')](handleError(_0x2d4a61,null));};exports['addAgents']=function(_0xeb055b,_0x576521,_0x47ec4e){return db[_0x5c70('0x3d')][_0x5c70('0x59')]({'where':{'id':_0xeb055b['params']['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x576521,null))['then'](function(_0x472d78){if(_0x472d78){return _0x472d78[_0x5c70('0x8d')](_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')],_['omit'](_0xeb055b[_0x5c70('0x61')],['ids','id'])||{})[_0x5c70('0x8e')](function(_0x3b79a6){for(var _0x3b0bee=0x0;_0x3b0bee<_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')][_0x5c70('0x47')];_0x3b0bee+=0x1){socket[_0x5c70('0x77')](_0x5c70('0x78'),{'UserId':Number(_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')][_0x3b0bee]),'ChatQueueId':Number(_0xeb055b['params']['id'])});}return _0x3b79a6;});}})[_0x5c70('0x20')](respondWithResult(_0x576521,null))[_0x5c70('0x53')](handleError(_0x576521,null));};exports[_0x5c70('0x8b')]=function(_0x10e6d2,_0x59c818,_0x22f42){return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x10e6d2[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0x59c818,null))[_0x5c70('0x20')](function(_0x3968cb){if(_0x3968cb){return _0x3968cb[_0x5c70('0x8b')](_0x10e6d2['query'][_0x5c70('0x71')])[_0x5c70('0x20')](function(){if(_['isArray'](_0x10e6d2[_0x5c70('0x42')][_0x5c70('0x71')])){for(var _0xcf2faa=0x0;_0xcf2faa<_0x10e6d2['query'][_0x5c70('0x71')][_0x5c70('0x47')];_0xcf2faa+=0x1){socket['emit'](_0x5c70('0x8c'),{'UserId':Number(_0x10e6d2['query'][_0x5c70('0x71')][_0xcf2faa]),'ChatQueueId':Number(_0x10e6d2[_0x5c70('0x55')]['id'])});}}else{socket[_0x5c70('0x77')](_0x5c70('0x8c'),{'UserId':Number(_0x10e6d2['query'][_0x5c70('0x71')]),'ChatQueueId':Number(_0x10e6d2[_0x5c70('0x55')]['id'])});}});}})[_0x5c70('0x20')](respondWithStatusCode(_0x59c818,null))['catch'](handleError(_0x59c818,null));};exports[_0x5c70('0x8f')]=function(_0x5be402,_0x340c96,_0x1d5466){var _0x296230={};var _0x540533={};var _0x4df05c;var _0x42da8f;return db[_0x5c70('0x3d')][_0x5c70('0x65')]({'where':{'id':_0x5be402[_0x5c70('0x55')]['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x340c96,null))[_0x5c70('0x20')](function(_0x303fce){if(_0x303fce){_0x4df05c=_0x303fce;_0x540533[_0x5c70('0x41')]=_[_0x5c70('0x56')](db['User']['rawAttributes']);_0x540533[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x5be402['query']);_0x540533[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x540533[_0x5c70('0x41')],_0x540533[_0x5c70('0x42')]);_0x296230['attributes']=_[_0x5c70('0x44')](_0x540533[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x5be402[_0x5c70('0x42')][_0x5c70('0x46')]));_0x296230['attributes']=_0x296230['attributes'][_0x5c70('0x47')]?_0x296230[_0x5c70('0x45')]:_0x540533[_0x5c70('0x41')];_0x296230[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0x5be402['query'][_0x5c70('0x4a')]);_0x296230['where']=qs['filters'](_[_0x5c70('0x4c')](_0x5be402[_0x5c70('0x42')],_0x540533[_0x5c70('0x43')]));if(_0x5be402[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x296230['where']=_[_0x5c70('0x4e')](_0x296230[_0x5c70('0x4b')],{'$or':_[_0x5c70('0x3c')](_0x296230[_0x5c70('0x45')],function(_0x4d7452){var _0x24812d={};_0x24812d[_0x4d7452]={'$like':'%'+_0x5be402[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x24812d;})});}_0x296230=_['merge']({},_0x296230,_0x5be402[_0x5c70('0x4f')]);return _0x4df05c['getAgents'](_0x296230);}})[_0x5c70('0x20')](function(_0x413904){if(_0x413904){_0x42da8f=_0x413904[_0x5c70('0x47')];if(!_0x5be402['query']['hasOwnProperty']('nolimit')){_0x296230[_0x5c70('0x30')]=qs[_0x5c70('0x30')](_0x5be402['query'][_0x5c70('0x30')]);_0x296230[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0x5be402['query'][_0x5c70('0x2e')]);}return _0x4df05c[_0x5c70('0x8f')](_0x296230);}})[_0x5c70('0x20')](function(_0x597688){if(_0x597688){return _0x597688?{'count':_0x42da8f,'rows':_0x597688}:null;}})[_0x5c70('0x20')](respondWithResult(_0x340c96,null))['catch'](handleError(_0x340c96,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 7bb082f..d52ef9f 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 _0x6122=['exports','events','ChatQueue','setMaxListeners','save','update','emit','hook'];(function(_0x21a51d,_0x544088){var _0x145a1b=function(_0x240c51){while(--_0x240c51){_0x21a51d['push'](_0x21a51d['shift']());}};_0x145a1b(++_0x544088);}(_0x6122,0xb9));var _0x2612=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0x6122[_0x482b06];return _0x404a0a;};'use strict';var EventEmitter=require(_0x2612('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x2612('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2612('0x2')](0x0);var events={'afterCreate':_0x2612('0x3'),'afterUpdate':_0x2612('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3275ab){return function(_0x3a1ba1,_0x4b8456,_0x306f01){ChatQueueEvents['emit'](_0x3275ab+':'+_0x3a1ba1['id'],_0x3a1ba1);ChatQueueEvents[_0x2612('0x5')](_0x3275ab,_0x3a1ba1);_0x306f01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x2612('0x6')](e,emitEvent(event));}}module[_0x2612('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0ad2=['setMaxListeners','save','remove','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x48a6b7,_0x4628d5){var _0x374b67=function(_0x112fe7){while(--_0x112fe7){_0x48a6b7['push'](_0x48a6b7['shift']());}};_0x374b67(++_0x4628d5);}(_0x0ad2,0xdd));var _0x20ad=function(_0x38832e,_0x2cc705){_0x38832e=_0x38832e-0x0;var _0x2be939=_0x0ad2[_0x38832e];return _0x2be939;};'use strict';var EventEmitter=require(_0x20ad('0x0'));var ChatQueue=require(_0x20ad('0x1'))['db'][_0x20ad('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x20ad('0x3')](0x0);var events={'afterCreate':_0x20ad('0x4'),'afterUpdate':'update','afterDestroy':_0x20ad('0x5')};function emitEvent(_0x51f5a9){return function(_0x23fb13,_0x1a1439,_0x56b45b){ChatQueueEvents['emit'](_0x51f5a9+':'+_0x23fb13['id'],_0x23fb13);ChatQueueEvents['emit'](_0x51f5a9,_0x23fb13);_0x56b45b(null);};}for(var e in events){if(events[_0x20ad('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x20ad('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 2e48ec1..c1411df 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 _0x8206=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','./chatQueue.attributes','exports'];(function(_0x58af0b,_0x52fbf5){var _0x210c68=function(_0x136bdc){while(--_0x136bdc){_0x58af0b['push'](_0x58af0b['shift']());}};_0x210c68(++_0x52fbf5);}(_0x8206,0x1ce));var _0x6820=function(_0x5d76ad,_0x26158d){_0x5d76ad=_0x5d76ad-0x0;var _0x4f7937=_0x8206[_0x5d76ad];return _0x4f7937;};'use strict';var _=require(_0x6820('0x0'));var util=require(_0x6820('0x1'));var logger=require(_0x6820('0x2'))(_0x6820('0x3'));var moment=require(_0x6820('0x4'));var BPromise=require('bluebird');var rp=require(_0x6820('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6820('0x6'));module[_0x6820('0x7')]=function(_0x6d97d1,_0x4b61a6){return _0x6d97d1['define'](_0x6820('0x8'),attributes,{'tableName':_0x6820('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd23=['../../config/environment','./chatQueue.attributes','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf529ae,_0x5e330f){var _0x147546=function(_0x19a7bc){while(--_0x19a7bc){_0xf529ae['push'](_0xf529ae['shift']());}};_0x147546(++_0x5e330f);}(_0xbd23,0xcb));var _0x3bd2=function(_0x3a2d7d,_0xb04dfc){_0x3a2d7d=_0x3a2d7d-0x0;var _0x2b6e0a=_0xbd23[_0x3a2d7d];return _0x2b6e0a;};'use strict';var _=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var logger=require(_0x3bd2('0x2'))(_0x3bd2('0x3'));var moment=require(_0x3bd2('0x4'));var BPromise=require(_0x3bd2('0x5'));var rp=require(_0x3bd2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3bd2('0x7'));var attributes=require(_0x3bd2('0x8'));module['exports']=function(_0x23a6c5,_0x314194){return _0x23a6c5['define']('ChatQueue',attributes,{'tableName':_0x3bd2('0x9'),'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 30ecb9e..062d41e 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 _0x63ef=['error','code','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','stringify','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63ef,0x11a));var _0xf63e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x63ef[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xf63e('0x0'));var util=require(_0xf63e('0x1'));var moment=require(_0xf63e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf63e('0x3'));var fs=require('fs');var Redis=require(_0xf63e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf63e('0x5'))(_0xf63e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf63e('0x7'));var client=jayson[_0xf63e('0x8')]['http']({'port':0x232a});config[_0xf63e('0x9')]=_[_0xf63e('0xa')](config[_0xf63e('0x9')],{'host':_0xf63e('0xb'),'port':0x18eb});var socket=require(_0xf63e('0xc'))(new Redis(config[_0xf63e('0x9')]));require(_0xf63e('0xd'))[_0xf63e('0xe')](socket);function respondWithRpcPromise(_0x29f321,_0xe8f9f9,_0x237479){return new BPromise(function(_0x450c6c,_0x2dac2d){return client[_0xf63e('0xf')](_0x29f321,_0x237479)[_0xf63e('0x10')](function(_0x485524){logger[_0xf63e('0x11')](_0xf63e('0x12'),_0xe8f9f9,_0xf63e('0x13'));logger[_0xf63e('0x14')](_0xf63e('0x15'),_0xe8f9f9,_0xf63e('0x13'),JSON['stringify'](_0x485524));if(_0x485524[_0xf63e('0x16')]){if(_0x485524[_0xf63e('0x16')][_0xf63e('0x17')]===0x1f4){logger['error'](_0xf63e('0x12'),_0xe8f9f9,_0x485524['error'][_0xf63e('0x18')]);return _0x2dac2d(_0x485524['error'][_0xf63e('0x18')]);}logger[_0xf63e('0x16')](_0xf63e('0x12'),_0xe8f9f9,_0x485524['error'][_0xf63e('0x18')]);return _0x450c6c(_0x485524[_0xf63e('0x16')]['message']);}else{logger[_0xf63e('0x11')](_0xf63e('0x12'),_0xe8f9f9,_0xf63e('0x13'));_0x450c6c(_0x485524['result'][_0xf63e('0x18')]);}})[_0xf63e('0x19')](function(_0x2a1726){logger[_0xf63e('0x16')](_0xf63e('0x12'),_0xe8f9f9,_0x2a1726);_0x2dac2d(_0x2a1726);});});}exports[_0xf63e('0x1a')]=function(_0x71d83e){var _0xdcaaba=this;return new Promise(function(_0x3c2a9a,_0x35b095){return db[_0xf63e('0x1b')]['findAll']({'raw':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e[_0xf63e('0x1c')][_0xf63e('0x1d')]===undefined?!![]:![]:!![],'where':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e['options'][_0xf63e('0x1e')]||null:null,'attributes':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e[_0xf63e('0x1c')][_0xf63e('0x1f')]||null:null,'limit':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e['options'][_0xf63e('0x20')]||null:null,'include':_0x71d83e['options']?_0x71d83e['options'][_0xf63e('0x21')]?_['map'](_0x71d83e['options'][_0xf63e('0x21')],function(_0x55c699){return{'model':db[_0x55c699[_0xf63e('0x22')]],'as':_0x55c699['as'],'attributes':_0x55c699[_0xf63e('0x1f')],'include':_0x55c699['include']?_[_0xf63e('0x23')](_0x55c699[_0xf63e('0x21')],function(_0x17a211){return{'model':db[_0x17a211[_0xf63e('0x22')]],'as':_0x17a211['as'],'attributes':_0x17a211[_0xf63e('0x1f')],'include':_0x17a211[_0xf63e('0x21')]?_[_0xf63e('0x23')](_0x17a211['include'],function(_0x30f5a3){return{'model':db[_0x30f5a3[_0xf63e('0x22')]],'as':_0x30f5a3['as'],'attributes':_0x30f5a3[_0xf63e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf63e('0x10')](function(_0x3ad882){logger['info']('GetChatQueue',_0x71d83e);logger[_0xf63e('0x14')](_0xf63e('0x1a'),_0x71d83e,JSON[_0xf63e('0x24')](_0x3ad882));_0x3c2a9a(_0x3ad882);})[_0xf63e('0x19')](function(_0x30a397){logger['error'](_0xf63e('0x1a'),_0x30a397[_0xf63e('0x18')],_0x71d83e);_0x35b095(_0xdcaaba['error'](0x1f4,_0x30a397[_0xf63e('0x18')]));});});};exports[_0xf63e('0x25')]=function(_0x2b04eb){var _0x201cea=this;return new Promise(function(_0x26ce8f,_0x37c96c){return db['ChatQueue']['find']({'raw':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb[_0xf63e('0x1c')][_0xf63e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb[_0xf63e('0x1c')]['where']||null:null,'attributes':_0x2b04eb['options']?_0x2b04eb[_0xf63e('0x1c')][_0xf63e('0x1f')]||null:null,'include':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb['options']['include']?_[_0xf63e('0x23')](_0x2b04eb['options'][_0xf63e('0x21')],function(_0x427d50){return{'model':db[_0x427d50[_0xf63e('0x22')]],'as':_0x427d50['as'],'attributes':_0x427d50[_0xf63e('0x1f')],'include':_0x427d50['include']?_[_0xf63e('0x23')](_0x427d50['include'],function(_0x279659){return{'model':db[_0x279659[_0xf63e('0x22')]],'as':_0x279659['as'],'attributes':_0x279659[_0xf63e('0x1f')],'include':_0x279659['include']?_[_0xf63e('0x23')](_0x279659[_0xf63e('0x21')],function(_0x34a659){return{'model':db[_0x34a659[_0xf63e('0x22')]],'as':_0x34a659['as'],'attributes':_0x34a659['attributes']};}):[]};}):[]};}):[]:[]})[_0xf63e('0x10')](function(_0x5cdf03){logger['info'](_0xf63e('0x25'),_0x2b04eb);logger['debug'](_0xf63e('0x25'),_0x2b04eb,JSON[_0xf63e('0x24')](_0x5cdf03));_0x26ce8f(_0x5cdf03);})['catch'](function(_0x5cffb4){logger['error'](_0xf63e('0x25'),_0x5cffb4[_0xf63e('0x18')],_0x2b04eb);_0x37c96c(_0x201cea[_0xf63e('0x16')](0x1f4,_0x5cffb4[_0xf63e('0x18')]));});});};
\ No newline at end of file
+var _0xe1e3=['util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','raw','lodash'];(function(_0x16d523,_0x21b346){var _0x511b64=function(_0x47d6f1){while(--_0x47d6f1){_0x16d523['push'](_0x16d523['shift']());}};_0x511b64(++_0x21b346);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5deccc,_0x4f82b0){_0x5deccc=_0x5deccc-0x0;var _0x31d90f=_0xe1e3[_0x5deccc];return _0x31d90f;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});config['redis']=_[_0x3e1e('0xa')](config[_0x3e1e('0xb')],{'host':_0x3e1e('0xc'),'port':0x18eb});var socket=require(_0x3e1e('0xd'))(new Redis(config[_0x3e1e('0xb')]));require(_0x3e1e('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c4c25,_0x5060e8,_0x31d205){return new BPromise(function(_0x5b0df8,_0x349460){return client[_0x3e1e('0xf')](_0x5c4c25,_0x31d205)[_0x3e1e('0x10')](function(_0x594c59){logger[_0x3e1e('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5060e8,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5060e8,'request\x20sent',JSON[_0x3e1e('0x12')](_0x594c59));if(_0x594c59['error']){if(_0x594c59['error'][_0x3e1e('0x13')]===0x1f4){logger[_0x3e1e('0x14')](_0x3e1e('0x15'),_0x5060e8,_0x594c59['error']['message']);return _0x349460(_0x594c59[_0x3e1e('0x14')][_0x3e1e('0x16')]);}logger['error'](_0x3e1e('0x15'),_0x5060e8,_0x594c59[_0x3e1e('0x14')]['message']);return _0x5b0df8(_0x594c59[_0x3e1e('0x14')]['message']);}else{logger[_0x3e1e('0x11')](_0x3e1e('0x15'),_0x5060e8,_0x3e1e('0x17'));_0x5b0df8(_0x594c59[_0x3e1e('0x18')][_0x3e1e('0x16')]);}})[_0x3e1e('0x19')](function(_0x569f49){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5060e8,_0x569f49);_0x349460(_0x569f49);});});}exports[_0x3e1e('0x1a')]=function(_0x30acbf){var _0xa3e99c=this;return new Promise(function(_0x57c660,_0x1c5acd){return db['ChatQueue'][_0x3e1e('0x1b')]({'raw':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x1d')]||null:null,'attributes':_0x30acbf['options']?_0x30acbf['options'][_0x3e1e('0x1e')]||null:null,'limit':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf['options'][_0x3e1e('0x1f')]||null:null,'include':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x20')],function(_0x21c898){return{'model':db[_0x21c898['model']],'as':_0x21c898['as'],'attributes':_0x21c898['attributes'],'include':_0x21c898[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x21c898['include'],function(_0x4be84e){return{'model':db[_0x4be84e['model']],'as':_0x4be84e['as'],'attributes':_0x4be84e[_0x3e1e('0x1e')],'include':_0x4be84e[_0x3e1e('0x20')]?_['map'](_0x4be84e[_0x3e1e('0x20')],function(_0x5ac814){return{'model':db[_0x5ac814[_0x3e1e('0x22')]],'as':_0x5ac814['as'],'attributes':_0x5ac814[_0x3e1e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43e029){logger[_0x3e1e('0x11')](_0x3e1e('0x1a'),_0x30acbf);logger['debug'](_0x3e1e('0x1a'),_0x30acbf,JSON['stringify'](_0x43e029));_0x57c660(_0x43e029);})['catch'](function(_0x494c75){logger[_0x3e1e('0x14')]('GetChatQueue',_0x494c75['message'],_0x30acbf);_0x1c5acd(_0xa3e99c[_0x3e1e('0x14')](0x1f4,_0x494c75[_0x3e1e('0x16')]));});});};exports[_0x3e1e('0x23')]=function(_0x233b18){var _0xc9762c=this;return new Promise(function(_0x54df5a,_0x5522ba){return db['ChatQueue']['find']({'raw':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x24')]===undefined?!![]:![]:!![],'where':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x1d')]||null:null,'attributes':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')]['attributes']||null:null,'include':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')]['include']?_[_0x3e1e('0x21')](_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x20')],function(_0xd6300b){return{'model':db[_0xd6300b['model']],'as':_0xd6300b['as'],'attributes':_0xd6300b['attributes'],'include':_0xd6300b[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0xd6300b['include'],function(_0x266958){return{'model':db[_0x266958[_0x3e1e('0x22')]],'as':_0x266958['as'],'attributes':_0x266958['attributes'],'include':_0x266958[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x266958[_0x3e1e('0x20')],function(_0x3e4eb1){return{'model':db[_0x3e4eb1[_0x3e1e('0x22')]],'as':_0x3e4eb1['as'],'attributes':_0x3e4eb1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e1e('0x10')](function(_0x42556a){logger[_0x3e1e('0x11')](_0x3e1e('0x23'),_0x233b18);logger['debug'](_0x3e1e('0x23'),_0x233b18,JSON[_0x3e1e('0x12')](_0x42556a));_0x54df5a(_0x42556a);})[_0x3e1e('0x19')](function(_0xfc4f2a){logger[_0x3e1e('0x14')](_0x3e1e('0x23'),_0xfc4f2a[_0x3e1e('0x16')],_0x233b18);_0x5522ba(_0xc9762c['error'](0x1f4,_0xfc4f2a[_0x3e1e('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 27bae2c..5960016 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 _0x0a9a=['update','register','chatQueue:','save'];(function(_0x5d33da,_0x277ad4){var _0xfaa7e0=function(_0x465286){while(--_0x465286){_0x5d33da['push'](_0x5d33da['shift']());}};_0xfaa7e0(++_0x277ad4);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3d2df8,_0x4104b0){_0x3d2df8=_0x3d2df8-0x0;var _0x4e3710=_0x0a9a[_0x3d2df8];return _0x4e3710;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xa0a9('0x0'),'remove',_0xa0a9('0x1')];function createListener(_0x3cff22,_0x34801b){return function(_0x49162f){_0x34801b['emit'](_0x3cff22,_0x49162f);};}function removeListener(_0x317a94,_0x360be5){return function(){ChatQueueEvents['removeListener'](_0x317a94,_0x360be5);};}exports[_0xa0a9('0x2')]=function(_0xc65bbb){for(var _0x1aa717=0x0,_0x31d689=events['length'];_0x1aa717<_0x31d689;_0x1aa717++){var _0x2b2eb4=events[_0x1aa717];var _0x520f42=createListener(_0xa0a9('0x3')+_0x2b2eb4,_0xc65bbb);ChatQueueEvents['on'](_0x2b2eb4,_0x520f42);}};
\ No newline at end of file
+var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x1c3fd7,_0x5d6f7a){var _0x1649ca=function(_0x2b3b17){while(--_0x2b3b17){_0x1c3fd7['push'](_0x1c3fd7['shift']());}};_0x1649ca(++_0x5d6f7a);}(_0xb821,0xa7));var _0x1b82=function(_0x4ff716,_0x281c51){_0x4ff716=_0x4ff716-0x0;var _0x1c0f63=_0xb821[_0x4ff716];return _0x1c0f63;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 3e8f715..de751a7 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x5fc3,0xa8));var _0x35fc=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x5fc3[_0x56e0e8];return _0x2dab50;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xd7336e,_0x45026b){var _0x42e343=function(_0x41dfb7){while(--_0x41dfb7){_0xd7336e['push'](_0xd7336e['shift']());}};_0x42e343(++_0x45026b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),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 2d2b27d..3f14bc7 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 _0xdac5=['moment','sequelize','exports','STRING','DATE'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0xdac5,0x159));var _0x5dac=function(_0x4c00f2,_0x4fd977){_0x4c00f2=_0x4c00f2-0x0;var _0x27e99e=_0xdac5[_0x4c00f2];return _0x27e99e;};'use strict';var moment=require(_0x5dac('0x0'));var Sequelize=require(_0x5dac('0x1'));module[_0x5dac('0x2')]={'uniqueid':{'type':Sequelize[_0x5dac('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5dac('0x3')]},'joinAt':{'type':Sequelize[_0x5dac('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5dac('0x3')]}};
\ No newline at end of file
+var _0xca45=['STRING','DATE','sequelize','exports'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0xca45,0x1ae));var _0x5ca4=function(_0x41a085,_0x1a47c8){_0x41a085=_0x41a085-0x0;var _0x50da96=_0xca45[_0x41a085];return _0x50da96;};'use strict';var moment=require('moment');var Sequelize=require(_0x5ca4('0x0'));module[_0x5ca4('0x1')]={'uniqueid':{'type':Sequelize[_0x5ca4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5ca4('0x2')]},'joinAt':{'type':Sequelize[_0x5ca4('0x3')]},'leaveAt':{'type':Sequelize[_0x5ca4('0x3')]},'acceptAt':{'type':Sequelize[_0x5ca4('0x3')]},'exitAt':{'type':Sequelize[_0x5ca4('0x3')]},'reason':{'type':Sequelize[_0x5ca4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f41f946..81aa30a 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 _0x0af5=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatQueueReport','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service'];(function(_0x3b19df,_0x4076ca){var _0x306794=function(_0x227454){while(--_0x227454){_0x3b19df['push'](_0x3b19df['shift']());}};_0x306794(++_0x4076ca);}(_0x0af5,0x158));var _0x50af=function(_0x569063,_0x968430){_0x569063=_0x569063-0x0;var _0x558199=_0x0af5[_0x569063];return _0x558199;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50af('0x0'));var zipdir=require(_0x50af('0x1'));var jsonpatch=require(_0x50af('0x2'));var rp=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var BPromise=require(_0x50af('0x5'));var Mustache=require(_0x50af('0x6'));var util=require(_0x50af('0x7'));var path=require(_0x50af('0x8'));var sox=require(_0x50af('0x9'));var csv=require(_0x50af('0xa'));var ejs=require(_0x50af('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50af('0xc'));var crypto=require(_0x50af('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50af('0xa'));var querystring=require(_0x50af('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x50af('0xf'));var qs=require(_0x50af('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50af('0x11'));var logger=require(_0x50af('0x12'))(_0x50af('0x13'));var utils=require(_0x50af('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x50af('0x15'));var db=require(_0x50af('0x16'))['db'];function respondWithStatusCode(_0x2792bb,_0x3373bf){_0x3373bf=_0x3373bf||0xcc;return function(_0x252a02){if(_0x252a02){return _0x2792bb[_0x50af('0x17')](_0x3373bf);}return _0x2792bb['status'](_0x3373bf)['end']();};}function respondWithResult(_0x569851,_0x620389){_0x620389=_0x620389||0xc8;return function(_0x561cd2){if(_0x561cd2){return _0x569851[_0x50af('0x18')](_0x620389)[_0x50af('0x19')](_0x561cd2);}};}function respondWithFilteredResult(_0x4fba1c,_0x5c3db3){return function(_0x1378fd){if(_0x1378fd){var _0x13cbf4=typeof _0x5c3db3['offset']==='undefined'&&typeof _0x5c3db3[_0x50af('0x1a')]===_0x50af('0x1b');var _0x33869f=_0x1378fd[_0x50af('0x1c')];var _0x1906e6=_0x13cbf4?0x0:_0x5c3db3[_0x50af('0x1d')];var _0x23bad2=_0x13cbf4?_0x1378fd[_0x50af('0x1c')]:_0x5c3db3[_0x50af('0x1d')]+_0x5c3db3[_0x50af('0x1a')];var _0x5c6f8e;if(_0x23bad2>=_0x33869f){_0x23bad2=_0x33869f;_0x5c6f8e=0xc8;}else{_0x5c6f8e=0xce;}_0x4fba1c[_0x50af('0x18')](_0x5c6f8e);return _0x4fba1c[_0x50af('0x1e')](_0x50af('0x1f'),_0x1906e6+'-'+_0x23bad2+'/'+_0x33869f)[_0x50af('0x19')](_0x1378fd);}return null;};}function patchUpdates(_0x4b0164){return function(_0x2a96fb){try{jsonpatch[_0x50af('0x20')](_0x2a96fb,_0x4b0164,!![]);}catch(_0x4b5e21){return BPromise[_0x50af('0x21')](_0x4b5e21);}return _0x2a96fb[_0x50af('0x22')]();};}function saveUpdates(_0x3b6d04,_0x2d093c){return function(_0xb6de0d){if(_0xb6de0d){return _0xb6de0d[_0x50af('0x23')](_0x3b6d04)[_0x50af('0x24')](function(_0x53e362){return _0x53e362;});}return null;};}function removeEntity(_0x76a6b3,_0x156154){return function(_0x3c6388){if(_0x3c6388){return _0x3c6388[_0x50af('0x25')]()[_0x50af('0x24')](function(){_0x76a6b3[_0x50af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3c15a,_0x1550ee){return function(_0x5e096d){if(!_0x5e096d){_0xb3c15a[_0x50af('0x17')](0x194);}return _0x5e096d;};}function handleError(_0x3fa2da,_0x311b08){_0x311b08=_0x311b08||0x1f4;return function(_0x5dc58a){logger['error'](_0x5dc58a[_0x50af('0x26')]);if(_0x5dc58a[_0x50af('0x27')]){delete _0x5dc58a[_0x50af('0x27')];}_0x3fa2da[_0x50af('0x18')](_0x311b08)[_0x50af('0x28')](_0x5dc58a);};}exports[_0x50af('0x29')]=function(_0x520bd6,_0x212fc2){var _0x5122e5={},_0x1a1104={},_0x382c5d={'count':0x0,'rows':[]};var _0x4118af=_['map'](db[_0x50af('0x2a')]['rawAttributes'],function(_0xadca5b){return{'name':_0xadca5b['fieldName'],'type':_0xadca5b['type']['key']};});_0x1a1104[_0x50af('0x2b')]=_[_0x50af('0x2c')](_0x4118af,_0x50af('0x27'));_0x1a1104[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x520bd6[_0x50af('0x2d')]);_0x1a1104[_0x50af('0x2f')]=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],_0x1a1104[_0x50af('0x2d')]);_0x5122e5['attributes']=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x31')]));_0x5122e5['attributes']=_0x5122e5[_0x50af('0x32')]['length']?_0x5122e5['attributes']:_0x1a1104['model'];if(!_0x520bd6[_0x50af('0x2d')][_0x50af('0x33')](_0x50af('0x34'))){_0x5122e5[_0x50af('0x1a')]=qs[_0x50af('0x1a')](_0x520bd6['query']['limit']);_0x5122e5[_0x50af('0x1d')]=qs[_0x50af('0x1d')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x1d')]);}_0x5122e5[_0x50af('0x35')]=qs['sort'](_0x520bd6[_0x50af('0x2d')][_0x50af('0x36')]);_0x5122e5[_0x50af('0x37')]=qs[_0x50af('0x2f')](_['pick'](_0x520bd6[_0x50af('0x2d')],_0x1a1104[_0x50af('0x2f')]),_0x4118af);if(_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]){_0x5122e5[_0x50af('0x37')]=_['merge'](_0x5122e5['where'],{'$or':_['map'](_0x4118af,function(_0x198ec5){if(_0x198ec5[_0x50af('0x39')]!==_0x50af('0x3a')){var _0x194539={};_0x194539[_0x198ec5[_0x50af('0x27')]]={'$like':'%'+_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]+'%'};return _0x194539;}})});}_0x5122e5=_[_0x50af('0x3b')]({},_0x5122e5,_0x520bd6[_0x50af('0x3c')]);var _0x2d2a3f={'where':_0x5122e5[_0x50af('0x37')]};return db[_0x50af('0x2a')][_0x50af('0x1c')](_0x2d2a3f)[_0x50af('0x24')](function(_0xb96d73){_0x382c5d[_0x50af('0x1c')]=_0xb96d73;if(_0x520bd6['query'][_0x50af('0x3d')]){_0x5122e5[_0x50af('0x3e')]=[{'all':!![]}];}return db[_0x50af('0x2a')]['findAll'](_0x5122e5);})['then'](function(_0x208c88){_0x382c5d[_0x50af('0x3f')]=_0x208c88;return _0x382c5d;})[_0x50af('0x24')](respondWithFilteredResult(_0x212fc2,_0x5122e5))[_0x50af('0x40')](handleError(_0x212fc2,null));};exports[_0x50af('0x41')]=function(_0x2917b7,_0x37bdfc){var _0x3f74bb={'raw':!![],'where':{'id':_0x2917b7['params']['id']}},_0x533d35={};_0x533d35[_0x50af('0x2b')]=_[_0x50af('0x2e')](db['ChatQueueReport']['rawAttributes']);_0x533d35[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x2917b7[_0x50af('0x2d')]);_0x533d35['filters']=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],_0x533d35[_0x50af('0x2d')]);_0x3f74bb[_0x50af('0x32')]=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x2917b7[_0x50af('0x2d')][_0x50af('0x31')]));_0x3f74bb['attributes']=_0x3f74bb[_0x50af('0x32')][_0x50af('0x42')]?_0x3f74bb[_0x50af('0x32')]:_0x533d35[_0x50af('0x2b')];if(_0x2917b7['query']['includeAll']){_0x3f74bb['include']=[{'all':!![]}];}_0x3f74bb=_[_0x50af('0x3b')]({},_0x3f74bb,_0x2917b7[_0x50af('0x3c')]);return db['ChatQueueReport'][_0x50af('0x43')](_0x3f74bb)[_0x50af('0x24')](handleEntityNotFound(_0x37bdfc,null))[_0x50af('0x24')](respondWithResult(_0x37bdfc,null))[_0x50af('0x40')](handleError(_0x37bdfc,null));};exports[_0x50af('0x44')]=function(_0xb64bed,_0x59057e){return db['ChatQueueReport'][_0x50af('0x44')](_0xb64bed[_0x50af('0x45')],{})[_0x50af('0x24')](respondWithResult(_0x59057e,0xc9))[_0x50af('0x40')](handleError(_0x59057e,null));};exports[_0x50af('0x23')]=function(_0x97713f,_0x5f0834){if(_0x97713f[_0x50af('0x45')]['id']){delete _0x97713f[_0x50af('0x45')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x97713f[_0x50af('0x46')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x5f0834,null))[_0x50af('0x24')](saveUpdates(_0x97713f[_0x50af('0x45')],null))[_0x50af('0x24')](respondWithResult(_0x5f0834,null))[_0x50af('0x40')](handleError(_0x5f0834,null));};exports[_0x50af('0x25')]=function(_0x1401a3,_0x173a2a){return db[_0x50af('0x2a')]['find']({'where':{'id':_0x1401a3[_0x50af('0x46')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x173a2a,null))[_0x50af('0x24')](removeEntity(_0x173a2a,null))[_0x50af('0x40')](handleError(_0x173a2a,null));};exports[_0x50af('0x47')]=function(_0x5e112a,_0x5ca12d){return db['ChatQueueReport'][_0x50af('0x47')]()['then'](respondWithResult(_0x5ca12d,null))[_0x50af('0x40')](handleError(_0x5ca12d,null));};
\ No newline at end of file
+var _0x46cb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46cb,0x84));var _0xb46c=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x46cb[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x2b')]=function(_0x4220a9,_0x2c8956){var _0x3cd6e0={},_0x3fab04={},_0x56310b={'count':0x0,'rows':[]};var _0x2412a7=_['map'](db[_0xb46c('0x2c')]['rawAttributes'],function(_0x4dd0bd){return{'name':_0x4dd0bd[_0xb46c('0x2d')],'type':_0x4dd0bd[_0xb46c('0x2e')][_0xb46c('0x2f')]};});_0x3fab04[_0xb46c('0x30')]=_['map'](_0x2412a7,_0xb46c('0x29'));_0x3fab04[_0xb46c('0x31')]=_[_0xb46c('0x32')](_0x4220a9['query']);_0x3fab04[_0xb46c('0x33')]=_['intersection'](_0x3fab04[_0xb46c('0x30')],_0x3fab04['query']);_0x3cd6e0[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x3fab04[_0xb46c('0x30')],qs[_0xb46c('0x36')](_0x4220a9[_0xb46c('0x31')][_0xb46c('0x36')]));_0x3cd6e0[_0xb46c('0x34')]=_0x3cd6e0[_0xb46c('0x34')][_0xb46c('0x37')]?_0x3cd6e0[_0xb46c('0x34')]:_0x3fab04[_0xb46c('0x30')];if(!_0x4220a9[_0xb46c('0x31')]['hasOwnProperty'](_0xb46c('0x38'))){_0x3cd6e0[_0xb46c('0x1e')]=qs['limit'](_0x4220a9['query']['limit']);_0x3cd6e0['offset']=qs[_0xb46c('0x1c')](_0x4220a9['query'][_0xb46c('0x1c')]);}_0x3cd6e0[_0xb46c('0x39')]=qs[_0xb46c('0x3a')](_0x4220a9[_0xb46c('0x31')]['sort']);_0x3cd6e0[_0xb46c('0x3b')]=qs[_0xb46c('0x33')](_['pick'](_0x4220a9[_0xb46c('0x31')],_0x3fab04[_0xb46c('0x33')]),_0x2412a7);if(_0x4220a9['query'][_0xb46c('0x3c')]){_0x3cd6e0['where']=_[_0xb46c('0x3d')](_0x3cd6e0[_0xb46c('0x3b')],{'$or':_[_0xb46c('0x3e')](_0x2412a7,function(_0x302580){if(_0x302580['type']!==_0xb46c('0x3f')){var _0x4c9db1={};_0x4c9db1[_0x302580[_0xb46c('0x29')]]={'$like':'%'+_0x4220a9[_0xb46c('0x31')]['filter']+'%'};return _0x4c9db1;}})});}_0x3cd6e0=_[_0xb46c('0x3d')]({},_0x3cd6e0,_0x4220a9[_0xb46c('0x40')]);var _0xfa2a48={'where':_0x3cd6e0['where']};return db['ChatQueueReport'][_0xb46c('0x1f')](_0xfa2a48)[_0xb46c('0x25')](function(_0x4e4169){_0x56310b[_0xb46c('0x1f')]=_0x4e4169;if(_0x4220a9['query'][_0xb46c('0x41')]){_0x3cd6e0[_0xb46c('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3cd6e0);})[_0xb46c('0x25')](function(_0x1c38fe){_0x56310b[_0xb46c('0x43')]=_0x1c38fe;return _0x56310b;})[_0xb46c('0x25')](respondWithFilteredResult(_0x2c8956,_0x3cd6e0))[_0xb46c('0x44')](handleError(_0x2c8956,null));};exports['show']=function(_0x1b9af7,_0x7e15f3){var _0x4fd0d9={'raw':!![],'where':{'id':_0x1b9af7['params']['id']}},_0x20d2e5={};_0x20d2e5[_0xb46c('0x30')]=_[_0xb46c('0x32')](db[_0xb46c('0x2c')]['rawAttributes']);_0x20d2e5[_0xb46c('0x31')]=_['keys'](_0x1b9af7[_0xb46c('0x31')]);_0x20d2e5[_0xb46c('0x33')]=_[_0xb46c('0x35')](_0x20d2e5[_0xb46c('0x30')],_0x20d2e5[_0xb46c('0x31')]);_0x4fd0d9[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x20d2e5['model'],qs[_0xb46c('0x36')](_0x1b9af7['query'][_0xb46c('0x36')]));_0x4fd0d9[_0xb46c('0x34')]=_0x4fd0d9['attributes'][_0xb46c('0x37')]?_0x4fd0d9[_0xb46c('0x34')]:_0x20d2e5[_0xb46c('0x30')];if(_0x1b9af7['query']['includeAll']){_0x4fd0d9['include']=[{'all':!![]}];}_0x4fd0d9=_['merge']({},_0x4fd0d9,_0x1b9af7['options']);return db[_0xb46c('0x2c')][_0xb46c('0x45')](_0x4fd0d9)[_0xb46c('0x25')](handleEntityNotFound(_0x7e15f3,null))[_0xb46c('0x25')](respondWithResult(_0x7e15f3,null))[_0xb46c('0x44')](handleError(_0x7e15f3,null));};exports[_0xb46c('0x46')]=function(_0x40ca97,_0x44b792){return db[_0xb46c('0x2c')][_0xb46c('0x46')](_0x40ca97['body'],{})[_0xb46c('0x25')](respondWithResult(_0x44b792,0xc9))[_0xb46c('0x44')](handleError(_0x44b792,null));};exports['update']=function(_0x4db28a,_0x63d0d6){if(_0x4db28a['body']['id']){delete _0x4db28a[_0xb46c('0x47')]['id'];}return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x4db28a[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x63d0d6,null))[_0xb46c('0x25')](saveUpdates(_0x4db28a[_0xb46c('0x47')],null))[_0xb46c('0x25')](respondWithResult(_0x63d0d6,null))[_0xb46c('0x44')](handleError(_0x63d0d6,null));};exports['destroy']=function(_0x1e0ffe,_0x841649){return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x1e0ffe[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x841649,null))[_0xb46c('0x25')](removeEntity(_0x841649,null))[_0xb46c('0x44')](handleError(_0x841649,null));};exports[_0xb46c('0x49')]=function(_0xa6800d,_0x191054){return db['ChatQueueReport'][_0xb46c('0x49')]()[_0xb46c('0x25')](respondWithResult(_0x191054,null))['catch'](handleError(_0x191054,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 680217d..34c766c 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4ad773,_0x1f53df){var _0x195232=function(_0x193ab5){while(--_0x193ab5){_0x4ad773['push'](_0x4ad773['shift']());}};_0x195232(++_0x1f53df);}(_0x757a,0xde));var _0xa757=function(_0x104d0c,_0x3e9070){_0x104d0c=_0x104d0c-0x0;var _0x26e84d=_0x757a[_0x104d0c];return _0x26e84d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4b9398,_0x548bd0){var _0x4f3032=function(_0xf7bfe0){while(--_0xf7bfe0){_0x4b9398['push'](_0x4b9398['shift']());}};_0x4f3032(++_0x548bd0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index cc9c818..dd608b8 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 _0xb672=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','options','raw','debug','UpdateChatQueueReport','ChatQueueReport','update','body','where','limit','lodash','util'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xb672,0x1a2));var _0x2b67=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb672[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var moment=require(_0x2b67('0x2'));var BPromise=require(_0x2b67('0x3'));var rs=require(_0x2b67('0x4'));var fs=require('fs');var Redis=require(_0x2b67('0x5'));var db=require(_0x2b67('0x6'))['db'];var utils=require(_0x2b67('0x7'));var logger=require(_0x2b67('0x8'))(_0x2b67('0x9'));var config=require('../../config/environment');var jayson=require(_0x2b67('0xa'));var client=jayson[_0x2b67('0xb')][_0x2b67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18d35f,_0x4fe9ec,_0x4dddc5){return new BPromise(function(_0x2ba8c8,_0x4d7aa1){return client[_0x2b67('0xd')](_0x18d35f,_0x4dddc5)[_0x2b67('0xe')](function(_0x3d0a4d){logger[_0x2b67('0xf')](_0x2b67('0x10'),_0x4fe9ec,'request\x20sent');logger['debug'](_0x2b67('0x11'),_0x4fe9ec,_0x2b67('0x12'),JSON[_0x2b67('0x13')](_0x3d0a4d));if(_0x3d0a4d[_0x2b67('0x14')]){if(_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x15')]===0x1f4){logger[_0x2b67('0x14')](_0x2b67('0x10'),_0x4fe9ec,_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x16')]);return _0x4d7aa1(_0x3d0a4d[_0x2b67('0x14')]['message']);}logger['error'](_0x2b67('0x10'),_0x4fe9ec,_0x3d0a4d['error'][_0x2b67('0x16')]);return _0x2ba8c8(_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x16')]);}else{logger[_0x2b67('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x4fe9ec,_0x2b67('0x12'));_0x2ba8c8(_0x3d0a4d[_0x2b67('0x17')]['message']);}})[_0x2b67('0x18')](function(_0x2d6b1a){logger[_0x2b67('0x14')](_0x2b67('0x10'),_0x4fe9ec,_0x2d6b1a);_0x4d7aa1(_0x2d6b1a);});});}exports[_0x2b67('0x19')]=function(_0x4b465d){var _0x52723f=this;return new Promise(function(_0x2d723f,_0x2305b9){return db['ChatQueueReport']['create'](_0x4b465d['body'],{'raw':_0x4b465d[_0x2b67('0x1a')]?_0x4b465d[_0x2b67('0x1a')][_0x2b67('0x1b')]===undefined?!![]:![]:!![]})[_0x2b67('0xe')](function(_0x201d93){logger[_0x2b67('0xf')](_0x2b67('0x19'),_0x4b465d);logger[_0x2b67('0x1c')](_0x2b67('0x19'),_0x4b465d,JSON['stringify'](_0x201d93));_0x2d723f(_0x201d93);})[_0x2b67('0x18')](function(_0x1a1509){logger[_0x2b67('0x14')]('CreateChatQueueReport',_0x1a1509[_0x2b67('0x16')],_0x4b465d);_0x2305b9(_0x52723f[_0x2b67('0x14')](0x1f4,_0x1a1509[_0x2b67('0x16')]));});});};exports[_0x2b67('0x1d')]=function(_0x514a7a){var _0x134f76=this;return new Promise(function(_0xebe949,_0x396823){return db[_0x2b67('0x1e')][_0x2b67('0x1f')](_0x514a7a[_0x2b67('0x20')],{'raw':_0x514a7a[_0x2b67('0x1a')]?_0x514a7a['options'][_0x2b67('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514a7a['options']?_0x514a7a[_0x2b67('0x1a')][_0x2b67('0x21')]||null:null,'attributes':_0x514a7a['options']?_0x514a7a[_0x2b67('0x1a')]['attributes']||null:null,'limit':_0x514a7a[_0x2b67('0x1a')]?_0x514a7a[_0x2b67('0x1a')][_0x2b67('0x22')]||null:null})[_0x2b67('0xe')](function(_0x219246){logger[_0x2b67('0xf')](_0x2b67('0x1d'),_0x514a7a);logger['debug']('UpdateChatQueueReport',_0x514a7a,JSON['stringify'](_0x219246));_0xebe949(_0x219246);})['catch'](function(_0x2eafc9){logger[_0x2b67('0x14')](_0x2b67('0x1d'),_0x2eafc9[_0x2b67('0x16')],_0x514a7a);_0x396823(_0x134f76[_0x2b67('0x14')](0x1f4,_0x2eafc9['message']));});});};
\ No newline at end of file
+var _0x4373=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','where','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b344b,_0x3c4d3a){var _0x100193=function(_0x53852f){while(--_0x53852f){_0x1b344b['push'](_0x1b344b['shift']());}};_0x100193(++_0x3c4d3a);}(_0x4373,0x10d));var _0x3437=function(_0x43405f,_0x1aa86a){_0x43405f=_0x43405f-0x0;var _0x1dba92=_0x4373[_0x43405f];return _0x1dba92;};'use strict';var _=require(_0x3437('0x0'));var util=require('util');var moment=require(_0x3437('0x1'));var BPromise=require(_0x3437('0x2'));var rs=require(_0x3437('0x3'));var fs=require('fs');var Redis=require(_0x3437('0x4'));var db=require(_0x3437('0x5'))['db'];var utils=require(_0x3437('0x6'));var logger=require(_0x3437('0x7'))(_0x3437('0x8'));var config=require(_0x3437('0x9'));var jayson=require(_0x3437('0xa'));var client=jayson[_0x3437('0xb')][_0x3437('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf1508b,_0x126d3d,_0x2749ab){return new BPromise(function(_0x236456,_0x5c9647){return client[_0x3437('0xd')](_0xf1508b,_0x2749ab)[_0x3437('0xe')](function(_0x1c1d16){logger[_0x3437('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x126d3d,_0x3437('0x10'));logger[_0x3437('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x126d3d,_0x3437('0x10'),JSON[_0x3437('0x12')](_0x1c1d16));if(_0x1c1d16['error']){if(_0x1c1d16[_0x3437('0x13')][_0x3437('0x14')]===0x1f4){logger['error'](_0x3437('0x15'),_0x126d3d,_0x1c1d16['error'][_0x3437('0x16')]);return _0x5c9647(_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);}logger[_0x3437('0x13')](_0x3437('0x15'),_0x126d3d,_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);return _0x236456(_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);}else{logger[_0x3437('0xf')](_0x3437('0x15'),_0x126d3d,_0x3437('0x10'));_0x236456(_0x1c1d16[_0x3437('0x17')][_0x3437('0x16')]);}})['catch'](function(_0x4cd1db){logger[_0x3437('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x126d3d,_0x4cd1db);_0x5c9647(_0x4cd1db);});});}exports[_0x3437('0x18')]=function(_0x293e38){var _0x480bbb=this;return new Promise(function(_0x1b3dec,_0x3b99bc){return db[_0x3437('0x19')][_0x3437('0x1a')](_0x293e38['body'],{'raw':_0x293e38['options']?_0x293e38[_0x3437('0x1b')][_0x3437('0x1c')]===undefined?!![]:![]:!![]})[_0x3437('0xe')](function(_0x40c317){logger[_0x3437('0xf')](_0x3437('0x18'),_0x293e38);logger[_0x3437('0x11')](_0x3437('0x18'),_0x293e38,JSON[_0x3437('0x12')](_0x40c317));_0x1b3dec(_0x40c317);})['catch'](function(_0x166473){logger['error']('CreateChatQueueReport',_0x166473[_0x3437('0x16')],_0x293e38);_0x3b99bc(_0x480bbb['error'](0x1f4,_0x166473['message']));});});};exports['UpdateChatQueueReport']=function(_0x5d0323){var _0x163694=this;return new Promise(function(_0x1d7a99,_0x3c215){return db[_0x3437('0x19')][_0x3437('0x1d')](_0x5d0323[_0x3437('0x1e')],{'raw':_0x5d0323['options']?_0x5d0323[_0x3437('0x1b')][_0x3437('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0323[_0x3437('0x1b')]?_0x5d0323[_0x3437('0x1b')][_0x3437('0x1f')]||null:null,'attributes':_0x5d0323[_0x3437('0x1b')]?_0x5d0323[_0x3437('0x1b')][_0x3437('0x20')]||null:null,'limit':_0x5d0323[_0x3437('0x1b')]?_0x5d0323['options'][_0x3437('0x21')]||null:null})[_0x3437('0xe')](function(_0x3f0113){logger['info']('UpdateChatQueueReport',_0x5d0323);logger['debug'](_0x3437('0x22'),_0x5d0323,JSON[_0x3437('0x12')](_0x3f0113));_0x1d7a99(_0x3f0113);})['catch'](function(_0x5a0f7d){logger[_0x3437('0x13')]('UpdateChatQueueReport',_0x5a0f7d[_0x3437('0x16')],_0x5d0323);_0x3c215(_0x163694[_0x3437('0x13')](0x1f4,_0x5a0f7d[_0x3437('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index bdb3af7..aaedd9b 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 _0x8dd9=['post','create','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x8dd9,0x83));var _0x98dd=function(_0x172f70,_0x2cc8ac){_0x172f70=_0x172f70-0x0;var _0x1dec9f=_0x8dd9[_0x172f70];return _0x1dec9f;};'use strict';var multer=require('multer');var util=require(_0x98dd('0x0'));var path=require(_0x98dd('0x1'));var timeout=require(_0x98dd('0x2'));var express=require('express');var router=express[_0x98dd('0x3')]();var fs_extra=require(_0x98dd('0x4'));var auth=require(_0x98dd('0x5'));var interaction=require(_0x98dd('0x6'));var config=require(_0x98dd('0x7'));var controller=require(_0x98dd('0x8'));router[_0x98dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x98dd('0xa')]);router[_0x98dd('0x9')](_0x98dd('0xb'),auth[_0x98dd('0xc')](),controller[_0x98dd('0xd')]);router[_0x98dd('0x9')](_0x98dd('0xe'),auth[_0x98dd('0xc')](),controller[_0x98dd('0xf')]);router[_0x98dd('0x10')]('/',auth[_0x98dd('0xc')](),controller[_0x98dd('0x11')]);router[_0x98dd('0x12')]('/:id',auth[_0x98dd('0xc')](),controller['update']);router['delete'](_0x98dd('0xe'),auth[_0x98dd('0xc')](),controller[_0x98dd('0x13')]);module[_0x98dd('0x14')]=router;
\ No newline at end of file
+var _0xba4a=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x389af9,_0x280f5c){var _0x51f073=function(_0xc60a05){while(--_0xc60a05){_0x389af9['push'](_0x389af9['shift']());}};_0x51f073(++_0x280f5c);}(_0xba4a,0x129));var _0xaba4=function(_0x3c7943,_0x44e2a3){_0x3c7943=_0x3c7943-0x0;var _0x187e42=_0xba4a[_0x3c7943];return _0x187e42;};'use strict';var multer=require(_0xaba4('0x0'));var util=require(_0xaba4('0x1'));var path=require(_0xaba4('0x2'));var timeout=require('connect-timeout');var express=require(_0xaba4('0x3'));var router=express[_0xaba4('0x4')]();var fs_extra=require(_0xaba4('0x5'));var auth=require(_0xaba4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaba4('0x7'));var controller=require('./chatQueueReport.controller');router[_0xaba4('0x8')]('/',auth[_0xaba4('0x9')](),controller[_0xaba4('0xa')]);router[_0xaba4('0x8')]('/describe',auth[_0xaba4('0x9')](),controller[_0xaba4('0xb')]);router[_0xaba4('0x8')](_0xaba4('0xc'),auth[_0xaba4('0x9')](),controller[_0xaba4('0xd')]);router[_0xaba4('0xe')]('/',auth[_0xaba4('0x9')](),controller[_0xaba4('0xf')]);router['put'](_0xaba4('0xc'),auth[_0xaba4('0x9')](),controller[_0xaba4('0x10')]);router['delete'](_0xaba4('0xc'),auth['isAuthenticated'](),controller[_0xaba4('0x11')]);module[_0xaba4('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 824f716..8d85099 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x11ba7f,_0x1a3ca7){var _0x42e32a=function(_0xbf0338){while(--_0xbf0338){_0x11ba7f['push'](_0x11ba7f['shift']());}};_0x42e32a(++_0x1a3ca7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0xf3cd[_0x5b8685];return _0xa3ef57;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x198549,_0x231fd3){var _0x37f621=function(_0x6a543c){while(--_0x6a543c){_0x198549['push'](_0x198549['shift']());}};_0x37f621(++_0x231fd3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0xcb91[_0x282a1f];return _0x296ea7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 140f7b8..d17aa21 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 _0x153a=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','fields','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x153a,0x1af));var _0xa153=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x153a[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xa153('0x0'));var rimraf=require(_0xa153('0x1'));var zipdir=require(_0xa153('0x2'));var jsonpatch=require(_0xa153('0x3'));var rp=require(_0xa153('0x4'));var moment=require(_0xa153('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa153('0x6'));var path=require(_0xa153('0x7'));var sox=require(_0xa153('0x8'));var csv=require(_0xa153('0x9'));var ejs=require(_0xa153('0xa'));var fs=require('fs');var fs_extra=require(_0xa153('0xb'));var _=require('lodash');var squel=require(_0xa153('0xc'));var crypto=require(_0xa153('0xd'));var jsforce=require(_0xa153('0xe'));var deskjs=require(_0xa153('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa153('0x10'));var Papa=require(_0xa153('0x11'));var Redis=require(_0xa153('0x12'));var authService=require(_0xa153('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa153('0x14'));var logger=require(_0xa153('0x15'))(_0xa153('0x16'));var utils=require(_0xa153('0x17'));var config=require(_0xa153('0x18'));var licenseUtil=require(_0xa153('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x339606,_0x684839){_0x684839=_0x684839||0xcc;return function(_0x254c58){if(_0x254c58){return _0x339606[_0xa153('0x1a')](_0x684839);}return _0x339606[_0xa153('0x1b')](_0x684839)[_0xa153('0x1c')]();};}function respondWithResult(_0x107cf4,_0x5b91dc){_0x5b91dc=_0x5b91dc||0xc8;return function(_0xdf69ea){if(_0xdf69ea){return _0x107cf4['status'](_0x5b91dc)['json'](_0xdf69ea);}};}function respondWithFilteredResult(_0x412013,_0x5edcef){return function(_0x30e5b4){if(_0x30e5b4){var _0x3cd8f8=typeof _0x5edcef[_0xa153('0x1d')]===_0xa153('0x1e')&&typeof _0x5edcef['limit']==='undefined';var _0xe03a46=_0x30e5b4[_0xa153('0x1f')];var _0x335fcd=_0x3cd8f8?0x0:_0x5edcef['offset'];var _0x347f1a=_0x3cd8f8?_0x30e5b4[_0xa153('0x1f')]:_0x5edcef[_0xa153('0x1d')]+_0x5edcef[_0xa153('0x20')];var _0x416196;if(_0x347f1a>=_0xe03a46){_0x347f1a=_0xe03a46;_0x416196=0xc8;}else{_0x416196=0xce;}_0x412013[_0xa153('0x1b')](_0x416196);return _0x412013[_0xa153('0x21')](_0xa153('0x22'),_0x335fcd+'-'+_0x347f1a+'/'+_0xe03a46)[_0xa153('0x23')](_0x30e5b4);}return null;};}function patchUpdates(_0x5d24f9){return function(_0x3e823f){try{jsonpatch[_0xa153('0x24')](_0x3e823f,_0x5d24f9,!![]);}catch(_0x44e3b9){return BPromise['reject'](_0x44e3b9);}return _0x3e823f[_0xa153('0x25')]();};}function saveUpdates(_0x286c13,_0x328abb){return function(_0x2f3cec){if(_0x2f3cec){return _0x2f3cec['update'](_0x286c13)[_0xa153('0x26')](function(_0x5afbf7){return _0x5afbf7;});}return null;};}function removeEntity(_0x396ee8,_0x451791){return function(_0xd2c997){if(_0xd2c997){return _0xd2c997[_0xa153('0x27')]()[_0xa153('0x26')](function(){_0x396ee8[_0xa153('0x1b')](0xcc)[_0xa153('0x1c')]();});}};}function handleEntityNotFound(_0x5c9db0,_0x94ccaf){return function(_0x3b2386){if(!_0x3b2386){_0x5c9db0[_0xa153('0x1a')](0x194);}return _0x3b2386;};}function handleError(_0x4f079b,_0x5ce722){_0x5ce722=_0x5ce722||0x1f4;return function(_0x58c7f4){logger[_0xa153('0x28')](_0x58c7f4[_0xa153('0x29')]);if(_0x58c7f4[_0xa153('0x2a')]){delete _0x58c7f4[_0xa153('0x2a')];}_0x4f079b[_0xa153('0x1b')](_0x5ce722)['send'](_0x58c7f4);};}exports[_0xa153('0x2b')]=function(_0x1cfb72,_0x45e638){var _0x45e35d={},_0x3c1472={},_0x1d0565={'count':0x0,'rows':[]};var _0x256f95=_[_0xa153('0x2c')](db[_0xa153('0x2d')][_0xa153('0x2e')],function(_0x1c636f){return{'name':_0x1c636f[_0xa153('0x2f')],'type':_0x1c636f[_0xa153('0x30')][_0xa153('0x31')]};});_0x3c1472['model']=_[_0xa153('0x2c')](_0x256f95,_0xa153('0x2a'));_0x3c1472['query']=_[_0xa153('0x32')](_0x1cfb72[_0xa153('0x33')]);_0x3c1472[_0xa153('0x34')]=_[_0xa153('0x35')](_0x3c1472[_0xa153('0x36')],_0x3c1472[_0xa153('0x33')]);_0x45e35d[_0xa153('0x37')]=_['intersection'](_0x3c1472['model'],qs['fields'](_0x1cfb72[_0xa153('0x33')]['fields']));_0x45e35d['attributes']=_0x45e35d[_0xa153('0x37')]['length']?_0x45e35d[_0xa153('0x37')]:_0x3c1472[_0xa153('0x36')];if(!_0x1cfb72[_0xa153('0x33')][_0xa153('0x38')]('nolimit')){_0x45e35d[_0xa153('0x20')]=qs[_0xa153('0x20')](_0x1cfb72[_0xa153('0x33')][_0xa153('0x20')]);_0x45e35d['offset']=qs[_0xa153('0x1d')](_0x1cfb72[_0xa153('0x33')][_0xa153('0x1d')]);}_0x45e35d[_0xa153('0x39')]=qs['sort'](_0x1cfb72[_0xa153('0x33')]['sort']);_0x45e35d[_0xa153('0x3a')]=qs[_0xa153('0x34')](_[_0xa153('0x3b')](_0x1cfb72['query'],_0x3c1472[_0xa153('0x34')]),_0x256f95);if(_0x1cfb72[_0xa153('0x33')][_0xa153('0x3c')]){_0x45e35d['where']=_[_0xa153('0x3d')](_0x45e35d[_0xa153('0x3a')],{'$or':_[_0xa153('0x2c')](_0x256f95,function(_0x23fbfd){if(_0x23fbfd[_0xa153('0x30')]!==_0xa153('0x3e')){var _0x3bb5ae={};_0x3bb5ae[_0x23fbfd[_0xa153('0x2a')]]={'$like':'%'+_0x1cfb72[_0xa153('0x33')]['filter']+'%'};return _0x3bb5ae;}})});}_0x45e35d=_[_0xa153('0x3d')]({},_0x45e35d,_0x1cfb72[_0xa153('0x3f')]);var _0xb819d={'where':_0x45e35d[_0xa153('0x3a')]};return db[_0xa153('0x2d')]['count'](_0xb819d)[_0xa153('0x26')](function(_0x14f32c){_0x1d0565[_0xa153('0x1f')]=_0x14f32c;if(_0x1cfb72[_0xa153('0x33')][_0xa153('0x40')]){_0x45e35d['include']=[{'all':!![]}];}return db[_0xa153('0x2d')][_0xa153('0x41')](_0x45e35d);})[_0xa153('0x26')](function(_0x290b16){_0x1d0565['rows']=_0x290b16;return _0x1d0565;})[_0xa153('0x26')](respondWithFilteredResult(_0x45e638,_0x45e35d))['catch'](handleError(_0x45e638,null));};exports['show']=function(_0x4c3b97,_0x3c28ba){var _0x3e3e44={'raw':!![],'where':{'id':_0x4c3b97[_0xa153('0x42')]['id']}},_0x2d1753={};_0x2d1753['model']=_[_0xa153('0x32')](db[_0xa153('0x2d')][_0xa153('0x2e')]);_0x2d1753[_0xa153('0x33')]=_[_0xa153('0x32')](_0x4c3b97[_0xa153('0x33')]);_0x2d1753[_0xa153('0x34')]=_[_0xa153('0x35')](_0x2d1753[_0xa153('0x36')],_0x2d1753[_0xa153('0x33')]);_0x3e3e44[_0xa153('0x37')]=_[_0xa153('0x35')](_0x2d1753[_0xa153('0x36')],qs[_0xa153('0x43')](_0x4c3b97[_0xa153('0x33')]['fields']));_0x3e3e44[_0xa153('0x37')]=_0x3e3e44[_0xa153('0x37')][_0xa153('0x44')]?_0x3e3e44[_0xa153('0x37')]:_0x2d1753['model'];if(_0x4c3b97[_0xa153('0x33')][_0xa153('0x40')]){_0x3e3e44['include']=[{'all':!![]}];}_0x3e3e44=_[_0xa153('0x3d')]({},_0x3e3e44,_0x4c3b97['options']);return db[_0xa153('0x2d')][_0xa153('0x45')](_0x3e3e44)[_0xa153('0x26')](handleEntityNotFound(_0x3c28ba,null))['then'](respondWithResult(_0x3c28ba,null))[_0xa153('0x46')](handleError(_0x3c28ba,null));};exports[_0xa153('0x47')]=function(_0x2a9f1a,_0x1350a8){return db[_0xa153('0x2d')][_0xa153('0x47')](_0x2a9f1a[_0xa153('0x48')],{})[_0xa153('0x26')](respondWithResult(_0x1350a8,0xc9))[_0xa153('0x46')](handleError(_0x1350a8,null));};exports[_0xa153('0x49')]=function(_0x2a69e5,_0x1422c6){if(_0x2a69e5[_0xa153('0x48')]['id']){delete _0x2a69e5[_0xa153('0x48')]['id'];}return db[_0xa153('0x2d')]['find']({'where':{'id':_0x2a69e5[_0xa153('0x42')]['id']}})['then'](handleEntityNotFound(_0x1422c6,null))[_0xa153('0x26')](saveUpdates(_0x2a69e5[_0xa153('0x48')],null))[_0xa153('0x26')](respondWithResult(_0x1422c6,null))[_0xa153('0x46')](handleError(_0x1422c6,null));};exports[_0xa153('0x27')]=function(_0x464e05,_0x14e745){return db['ChatTransferReport']['find']({'where':{'id':_0x464e05[_0xa153('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e745,null))['then'](removeEntity(_0x14e745,null))[_0xa153('0x46')](handleError(_0x14e745,null));};exports[_0xa153('0x4a')]=function(_0x3927e1,_0x1ece42){return db[_0xa153('0x2d')]['describe']()[_0xa153('0x26')](respondWithResult(_0x1ece42,null))[_0xa153('0x46')](handleError(_0x1ece42,null));};
\ No newline at end of file
+var _0x8813=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','destroy','then','end','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3590ed,_0x3a4587){var _0x21f72f=function(_0x45be21){while(--_0x45be21){_0x3590ed['push'](_0x3590ed['shift']());}};_0x21f72f(++_0x3a4587);}(_0x8813,0xd3));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3881('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3881('0x1'));var rp=require(_0x3881('0x2'));var moment=require(_0x3881('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3881('0x4'));var util=require(_0x3881('0x5'));var path=require(_0x3881('0x6'));var sox=require(_0x3881('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3881('0x8'));var crypto=require(_0x3881('0x9'));var jsforce=require(_0x3881('0xa'));var deskjs=require(_0x3881('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3881('0xc'));var Papa=require(_0x3881('0xd'));var Redis=require(_0x3881('0xe'));var authService=require(_0x3881('0xf'));var qs=require(_0x3881('0x10'));var as=require(_0x3881('0x11'));var hardwareService=require(_0x3881('0x12'));var logger=require(_0x3881('0x13'))(_0x3881('0x14'));var utils=require(_0x3881('0x15'));var config=require(_0x3881('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3881('0x17'))['db'];function respondWithStatusCode(_0x188ea8,_0x559f94){_0x559f94=_0x559f94||0xcc;return function(_0x330764){if(_0x330764){return _0x188ea8[_0x3881('0x18')](_0x559f94);}return _0x188ea8['status'](_0x559f94)['end']();};}function respondWithResult(_0x416e1b,_0x297869){_0x297869=_0x297869||0xc8;return function(_0x44b541){if(_0x44b541){return _0x416e1b[_0x3881('0x19')](_0x297869)['json'](_0x44b541);}};}function respondWithFilteredResult(_0x422f00,_0x254d87){return function(_0x3f7533){if(_0x3f7533){var _0x4c07be=typeof _0x254d87[_0x3881('0x1a')]===_0x3881('0x1b')&&typeof _0x254d87['limit']===_0x3881('0x1b');var _0x5dce5a=_0x3f7533['count'];var _0x1ecde4=_0x4c07be?0x0:_0x254d87['offset'];var _0x362ae4=_0x4c07be?_0x3f7533[_0x3881('0x1c')]:_0x254d87[_0x3881('0x1a')]+_0x254d87[_0x3881('0x1d')];var _0x44bd1d;if(_0x362ae4>=_0x5dce5a){_0x362ae4=_0x5dce5a;_0x44bd1d=0xc8;}else{_0x44bd1d=0xce;}_0x422f00['status'](_0x44bd1d);return _0x422f00[_0x3881('0x1e')]('Content-Range',_0x1ecde4+'-'+_0x362ae4+'/'+_0x5dce5a)[_0x3881('0x1f')](_0x3f7533);}return null;};}function patchUpdates(_0x2aae61){return function(_0x4b964f){try{jsonpatch[_0x3881('0x20')](_0x4b964f,_0x2aae61,!![]);}catch(_0xe54d38){return BPromise[_0x3881('0x21')](_0xe54d38);}return _0x4b964f['save']();};}function saveUpdates(_0x253b65,_0x2b5f57){return function(_0x158b61){if(_0x158b61){return _0x158b61[_0x3881('0x22')](_0x253b65)['then'](function(_0x5cd4c1){return _0x5cd4c1;});}return null;};}function removeEntity(_0x2255bd,_0xd9249a){return function(_0x1dc1e7){if(_0x1dc1e7){return _0x1dc1e7[_0x3881('0x23')]()[_0x3881('0x24')](function(){_0x2255bd['status'](0xcc)[_0x3881('0x25')]();});}};}function handleEntityNotFound(_0x14a3fc,_0x30d718){return function(_0x15caeb){if(!_0x15caeb){_0x14a3fc[_0x3881('0x18')](0x194);}return _0x15caeb;};}function handleError(_0x474bd7,_0x46d898){_0x46d898=_0x46d898||0x1f4;return function(_0x483ee5){logger[_0x3881('0x26')](_0x483ee5['stack']);if(_0x483ee5[_0x3881('0x27')]){delete _0x483ee5[_0x3881('0x27')];}_0x474bd7[_0x3881('0x19')](_0x46d898)['send'](_0x483ee5);};}exports[_0x3881('0x28')]=function(_0x2847ff,_0x3b15c2){var _0x106905={},_0xfd9ec6={},_0x48565b={'count':0x0,'rows':[]};var _0x2e40e5=_[_0x3881('0x29')](db[_0x3881('0x2a')][_0x3881('0x2b')],function(_0x19b3f1){return{'name':_0x19b3f1[_0x3881('0x2c')],'type':_0x19b3f1[_0x3881('0x2d')][_0x3881('0x2e')]};});_0xfd9ec6[_0x3881('0x2f')]=_[_0x3881('0x29')](_0x2e40e5,_0x3881('0x27'));_0xfd9ec6[_0x3881('0x30')]=_[_0x3881('0x31')](_0x2847ff['query']);_0xfd9ec6['filters']=_[_0x3881('0x32')](_0xfd9ec6[_0x3881('0x2f')],_0xfd9ec6[_0x3881('0x30')]);_0x106905['attributes']=_[_0x3881('0x32')](_0xfd9ec6['model'],qs[_0x3881('0x33')](_0x2847ff[_0x3881('0x30')]['fields']));_0x106905['attributes']=_0x106905[_0x3881('0x34')][_0x3881('0x35')]?_0x106905['attributes']:_0xfd9ec6[_0x3881('0x2f')];if(!_0x2847ff[_0x3881('0x30')][_0x3881('0x36')](_0x3881('0x37'))){_0x106905['limit']=qs[_0x3881('0x1d')](_0x2847ff['query'][_0x3881('0x1d')]);_0x106905[_0x3881('0x1a')]=qs['offset'](_0x2847ff[_0x3881('0x30')][_0x3881('0x1a')]);}_0x106905[_0x3881('0x38')]=qs[_0x3881('0x39')](_0x2847ff[_0x3881('0x30')]['sort']);_0x106905[_0x3881('0x3a')]=qs[_0x3881('0x3b')](_[_0x3881('0x3c')](_0x2847ff[_0x3881('0x30')],_0xfd9ec6[_0x3881('0x3b')]),_0x2e40e5);if(_0x2847ff[_0x3881('0x30')][_0x3881('0x3d')]){_0x106905[_0x3881('0x3a')]=_[_0x3881('0x3e')](_0x106905['where'],{'$or':_['map'](_0x2e40e5,function(_0x27db35){if(_0x27db35[_0x3881('0x2d')]!==_0x3881('0x3f')){var _0x21ba4d={};_0x21ba4d[_0x27db35['name']]={'$like':'%'+_0x2847ff[_0x3881('0x30')][_0x3881('0x3d')]+'%'};return _0x21ba4d;}})});}_0x106905=_[_0x3881('0x3e')]({},_0x106905,_0x2847ff[_0x3881('0x40')]);var _0x58720a={'where':_0x106905[_0x3881('0x3a')]};return db['ChatTransferReport'][_0x3881('0x1c')](_0x58720a)['then'](function(_0x1eb531){_0x48565b[_0x3881('0x1c')]=_0x1eb531;if(_0x2847ff[_0x3881('0x30')][_0x3881('0x41')]){_0x106905['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x3881('0x42')](_0x106905);})[_0x3881('0x24')](function(_0x48080a){_0x48565b['rows']=_0x48080a;return _0x48565b;})[_0x3881('0x24')](respondWithFilteredResult(_0x3b15c2,_0x106905))['catch'](handleError(_0x3b15c2,null));};exports[_0x3881('0x43')]=function(_0x43cf9a,_0xd5b8c1){var _0x126b58={'raw':!![],'where':{'id':_0x43cf9a[_0x3881('0x44')]['id']}},_0x553edc={};_0x553edc['model']=_[_0x3881('0x31')](db[_0x3881('0x2a')][_0x3881('0x2b')]);_0x553edc[_0x3881('0x30')]=_[_0x3881('0x31')](_0x43cf9a['query']);_0x553edc[_0x3881('0x3b')]=_['intersection'](_0x553edc['model'],_0x553edc[_0x3881('0x30')]);_0x126b58[_0x3881('0x34')]=_[_0x3881('0x32')](_0x553edc[_0x3881('0x2f')],qs[_0x3881('0x33')](_0x43cf9a['query'][_0x3881('0x33')]));_0x126b58[_0x3881('0x34')]=_0x126b58['attributes'][_0x3881('0x35')]?_0x126b58[_0x3881('0x34')]:_0x553edc['model'];if(_0x43cf9a[_0x3881('0x30')][_0x3881('0x41')]){_0x126b58[_0x3881('0x45')]=[{'all':!![]}];}_0x126b58=_[_0x3881('0x3e')]({},_0x126b58,_0x43cf9a[_0x3881('0x40')]);return db[_0x3881('0x2a')][_0x3881('0x46')](_0x126b58)[_0x3881('0x24')](handleEntityNotFound(_0xd5b8c1,null))[_0x3881('0x24')](respondWithResult(_0xd5b8c1,null))[_0x3881('0x47')](handleError(_0xd5b8c1,null));};exports[_0x3881('0x48')]=function(_0x2f97ee,_0x575ce3){return db[_0x3881('0x2a')][_0x3881('0x48')](_0x2f97ee['body'],{})[_0x3881('0x24')](respondWithResult(_0x575ce3,0xc9))[_0x3881('0x47')](handleError(_0x575ce3,null));};exports[_0x3881('0x22')]=function(_0x162126,_0x43d93b){if(_0x162126['body']['id']){delete _0x162126[_0x3881('0x49')]['id'];}return db[_0x3881('0x2a')]['find']({'where':{'id':_0x162126['params']['id']}})[_0x3881('0x24')](handleEntityNotFound(_0x43d93b,null))[_0x3881('0x24')](saveUpdates(_0x162126[_0x3881('0x49')],null))[_0x3881('0x24')](respondWithResult(_0x43d93b,null))['catch'](handleError(_0x43d93b,null));};exports[_0x3881('0x23')]=function(_0x4a0e81,_0x1babe7){return db[_0x3881('0x2a')][_0x3881('0x46')]({'where':{'id':_0x4a0e81[_0x3881('0x44')]['id']}})[_0x3881('0x24')](handleEntityNotFound(_0x1babe7,null))[_0x3881('0x24')](removeEntity(_0x1babe7,null))['catch'](handleError(_0x1babe7,null));};exports['describe']=function(_0x31c29e,_0xdd6da1){return db['ChatTransferReport'][_0x3881('0x4a')]()['then'](respondWithResult(_0xdd6da1,null))[_0x3881('0x47')](handleError(_0xdd6da1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 1f39f20..bb8ea5c 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 _0x2967=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x2967,0x15d));var _0x7296=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x2967[_0x3f477c];return _0x4c36b3;};'use strict';var _=require(_0x7296('0x0'));var util=require(_0x7296('0x1'));var logger=require('../../config/logger')(_0x7296('0x2'));var moment=require(_0x7296('0x3'));var BPromise=require(_0x7296('0x4'));var rp=require(_0x7296('0x5'));var fs=require('fs');var path=require(_0x7296('0x6'));var rimraf=require(_0x7296('0x7'));var config=require(_0x7296('0x8'));var attributes=require(_0x7296('0x9'));module[_0x7296('0xa')]=function(_0x3be96a,_0xec8756){return _0x3be96a[_0x7296('0xb')](_0x7296('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x7296('0xd'),'fields':[_0x7296('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2766=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x2370e8,_0x2f4a38){var _0x384b32=function(_0x318984){while(--_0x318984){_0x2370e8['push'](_0x2370e8['shift']());}};_0x384b32(++_0x2f4a38);}(_0x2766,0xdb));var _0x6276=function(_0x3dc85,_0x4f2d39){_0x3dc85=_0x3dc85-0x0;var _0x3e938e=_0x2766[_0x3dc85];return _0x3e938e;};'use strict';var _=require('lodash');var util=require(_0x6276('0x0'));var logger=require(_0x6276('0x1'))(_0x6276('0x2'));var moment=require(_0x6276('0x3'));var BPromise=require(_0x6276('0x4'));var rp=require(_0x6276('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6276('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x6276('0x7')]=function(_0x23d61e,_0x104b18){return _0x23d61e[_0x6276('0x8')](_0x6276('0x9'),attributes,{'tableName':_0x6276('0xa'),'paranoid':![],'indexes':[{'name':_0x6276('0xb'),'fields':[_0x6276('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 609b902..6e5941e 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 _0x7eee=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4fc583,_0x1c9563){var _0x3b884d=function(_0xe8ac6f){while(--_0xe8ac6f){_0x4fc583['push'](_0x4fc583['shift']());}};_0x3b884d(++_0x1c9563);}(_0x7eee,0x108));var _0xe7ee=function(_0x4b8b6a,_0x3aa424){_0x4b8b6a=_0x4b8b6a-0x0;var _0x4445ba=_0x7eee[_0x4b8b6a];return _0x4445ba;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var moment=require(_0xe7ee('0x2'));var BPromise=require(_0xe7ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7ee('0x4'))['db'];var utils=require(_0xe7ee('0x5'));var logger=require(_0xe7ee('0x6'))(_0xe7ee('0x7'));var config=require(_0xe7ee('0x8'));var jayson=require(_0xe7ee('0x9'));var client=jayson[_0xe7ee('0xa')][_0xe7ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x82345,_0x2a7f35,_0x4c203e){return new BPromise(function(_0x99ecc5,_0x523806){return client[_0xe7ee('0xc')](_0x82345,_0x4c203e)[_0xe7ee('0xd')](function(_0x5f6e82){logger[_0xe7ee('0xe')](_0xe7ee('0xf'),_0x2a7f35,_0xe7ee('0x10'));logger[_0xe7ee('0x11')](_0xe7ee('0x12'),_0x2a7f35,_0xe7ee('0x10'),JSON[_0xe7ee('0x13')](_0x5f6e82));if(_0x5f6e82[_0xe7ee('0x14')]){if(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x15')]===0x1f4){logger[_0xe7ee('0x14')](_0xe7ee('0xf'),_0x2a7f35,_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);return _0x523806(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);}logger['error'](_0xe7ee('0xf'),_0x2a7f35,_0x5f6e82[_0xe7ee('0x14')]['message']);return _0x99ecc5(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);}else{logger[_0xe7ee('0xe')](_0xe7ee('0xf'),_0x2a7f35,'request\x20sent');_0x99ecc5(_0x5f6e82[_0xe7ee('0x17')]['message']);}})[_0xe7ee('0x18')](function(_0x491867){logger['error'](_0xe7ee('0xf'),_0x2a7f35,_0x491867);_0x523806(_0x491867);});});}
\ No newline at end of file
+var _0xb1ef=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2538cc,_0x19ea15){var _0xa8c32e=function(_0x26b383){while(--_0x26b383){_0x2538cc['push'](_0x2538cc['shift']());}};_0xa8c32e(++_0x19ea15);}(_0xb1ef,0x186));var _0xfb1e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1ef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var moment=require(_0xfb1e('0x2'));var BPromise=require(_0xfb1e('0x3'));var rs=require(_0xfb1e('0x4'));var fs=require('fs');var Redis=require(_0xfb1e('0x5'));var db=require(_0xfb1e('0x6'))['db'];var utils=require(_0xfb1e('0x7'));var logger=require(_0xfb1e('0x8'))(_0xfb1e('0x9'));var config=require(_0xfb1e('0xa'));var jayson=require(_0xfb1e('0xb'));var client=jayson[_0xfb1e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399ad2,_0x1464f0,_0x56fa58){return new BPromise(function(_0x265c21,_0x2480a5){return client['request'](_0x399ad2,_0x56fa58)['then'](function(_0x56d58c){logger['info'](_0xfb1e('0xd'),_0x1464f0,_0xfb1e('0xe'));logger['debug'](_0xfb1e('0xf'),_0x1464f0,_0xfb1e('0xe'),JSON[_0xfb1e('0x10')](_0x56d58c));if(_0x56d58c[_0xfb1e('0x11')]){if(_0x56d58c[_0xfb1e('0x11')]['code']===0x1f4){logger[_0xfb1e('0x11')](_0xfb1e('0xd'),_0x1464f0,_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);return _0x2480a5(_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);}logger[_0xfb1e('0x11')](_0xfb1e('0xd'),_0x1464f0,_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);return _0x265c21(_0x56d58c[_0xfb1e('0x11')]['message']);}else{logger[_0xfb1e('0x13')](_0xfb1e('0xd'),_0x1464f0,'request\x20sent');_0x265c21(_0x56d58c[_0xfb1e('0x14')]['message']);}})[_0xfb1e('0x15')](function(_0x6af7fb){logger[_0xfb1e('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1464f0,_0x6af7fb);_0x2480a5(_0x6af7fb);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f9fb6b6..29f1f62 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 _0x5045=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4edd47,_0x58e0e1){var _0x61a0b5=function(_0x4c8e18){while(--_0x4c8e18){_0x4edd47['push'](_0x4edd47['shift']());}};_0x61a0b5(++_0x58e0e1);}(_0x5045,0xec));var _0x5504=function(_0x2b6e8b,_0x549fa4){_0x2b6e8b=_0x2b6e8b-0x0;var _0x4c6a40=_0x5045[_0x2b6e8b];return _0x4c6a40;};'use strict';var multer=require(_0x5504('0x0'));var util=require(_0x5504('0x1'));var path=require(_0x5504('0x2'));var timeout=require(_0x5504('0x3'));var express=require(_0x5504('0x4'));var router=express[_0x5504('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5504('0x6'));var interaction=require(_0x5504('0x7'));var config=require(_0x5504('0x8'));var controller=require(_0x5504('0x9'));router[_0x5504('0xa')]('/',auth['isAuthenticated'](),controller[_0x5504('0xb')]);router[_0x5504('0xa')](_0x5504('0xc'),auth[_0x5504('0xd')](),controller['describe']);router[_0x5504('0xa')]('/:id',auth[_0x5504('0xd')](),controller[_0x5504('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5504('0xf')]);router[_0x5504('0x10')](_0x5504('0x11'),auth['isAuthenticated'](),controller[_0x5504('0x12')]);router[_0x5504('0x13')](_0x5504('0x11'),auth[_0x5504('0xd')](),controller[_0x5504('0x14')]);module[_0x5504('0x15')]=router;
\ No newline at end of file
+var _0x95a7=['get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x156e8a,_0x5f4379){var _0x10da89=function(_0x2c212e){while(--_0x2c212e){_0x156e8a['push'](_0x156e8a['shift']());}};_0x10da89(++_0x5f4379);}(_0x95a7,0x129));var _0x795a=function(_0x24f862,_0x4b645a){_0x24f862=_0x24f862-0x0;var _0x198aa4=_0x95a7[_0x24f862];return _0x198aa4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x795a('0x0'));var timeout=require(_0x795a('0x1'));var express=require(_0x795a('0x2'));var router=express[_0x795a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x795a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x795a('0x5'));var controller=require(_0x795a('0x6'));router[_0x795a('0x7')]('/',auth[_0x795a('0x8')](),controller[_0x795a('0x9')]);router[_0x795a('0x7')](_0x795a('0xa'),auth[_0x795a('0x8')](),controller['describe']);router[_0x795a('0x7')]('/:id',auth[_0x795a('0x8')](),controller[_0x795a('0xb')]);router[_0x795a('0xc')]('/',auth[_0x795a('0x8')](),controller[_0x795a('0xd')]);router[_0x795a('0xe')](_0x795a('0xf'),auth[_0x795a('0x8')](),controller[_0x795a('0x10')]);router[_0x795a('0x11')]('/:id',auth[_0x795a('0x8')](),controller[_0x795a('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index c969b26..0a57923 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 _0x2dae=['Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x2dae,0xc3));var _0xe2da=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x2dae[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require(_0xe2da('0x0'));var rs=require('randomstring');module[_0xe2da('0x1')]={'name':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'unique':_0xe2da('0x3')},'description':{'type':Sequelize[_0xe2da('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x4')},'mapKeyOffline':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x4')},'key':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x5')},'customerAlias':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe2da('0x2')]},'animation':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe2da('0xa')](_0xe2da('0xb'),_0xe2da('0xc')),'defaultValue':_0xe2da('0xb')},'header_online':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'header_offline':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xe')},'download_transcript':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x11')},'noteTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x12')},'placeholderMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x13')},'closingMessageButton':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'skipMessageButton':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x14')},'ratingType':{'type':Sequelize[_0xe2da('0xa')](_0xe2da('0x15'),_0xe2da('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe2da('0x17')]({'items':[{'type':_0xe2da('0x18'),'variable':null,'config':{'placeholder':_0xe2da('0x19'),'type':_0xe2da('0x1a'),'required':!![]},'props':{'title':_0xe2da('0x19'),'helpText':''}},{'type':_0xe2da('0x18'),'props':{'title':_0xe2da('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe2da('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe2da('0x1b')](_0xe2da('0x1c'))?JSON[_0xe2da('0x1d')](this[_0xe2da('0x1b')](_0xe2da('0x1c'))):{};},'set':function(_0x230fb8){return this[_0xe2da('0x1e')]('onlineForm',JSON[_0xe2da('0x17')](_0x230fb8));}},'offlineForm':{'type':Sequelize[_0xe2da('0x1f')],'defaultValue':function(){return JSON[_0xe2da('0x17')]({'items':[{'type':_0xe2da('0x18'),'props':{'title':_0xe2da('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe2da('0x4'),'type':_0xe2da('0x4')},'variable':null},{'type':_0xe2da('0x20'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xe2da('0x1b')](_0xe2da('0x21'))?JSON[_0xe2da('0x1d')](this[_0xe2da('0x1b')]('offlineForm')):{};},'set':function(_0x490794){return this[_0xe2da('0x1e')](_0xe2da('0x21'),JSON[_0xe2da('0x17')](_0x490794));}},'token':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':function(){return rs[_0xe2da('0x22')]();}},'autoclose':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe2da('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x23')},'waitingMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x25')},'offlineMessageBody':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x27')},'skipUnmanaged':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x28')},'sendUnmanaged':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe2da('0x1f')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe2da('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe2da('0x1f')],'defaultValue':function(){return _0xe2da('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2b')},'messagesAlignment':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2c')},'defaultTitle':{'type':Sequelize[_0xe2da('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe2da('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe2da('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![],'comment':_0xe2da('0x2f'),'set':function(_0x26ba99){if(!_0x26ba99)this[_0xe2da('0x1e')](_0xe2da('0x30'),null);this[_0xe2da('0x1e')](_0xe2da('0x31'),_0x26ba99);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe2da('0x2')]},'vidaooTopic':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x32')},'vidaooNote':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':function(){return _0xe2da('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe2da('0x1f')]}};
\ No newline at end of file
+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(_0x2b1fc7,_0x55d41f){var _0x2bf78f=function(_0x3414f0){while(--_0x3414f0){_0x2b1fc7['push'](_0x2b1fc7['shift']());}};_0x2bf78f(++_0x55d41f);}(_0x41bb,0xc5));var _0xb41b=function(_0x366653,_0x4ec323){_0x366653=_0x366653-0x0;var _0x2a5739=_0x41bb[_0x366653];return _0x2a5739;};'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
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f4a69b8..127d9aa 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 _0x7995=['offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','Interval','getProactiveActions','../../config/license/util','License','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','remote','x-real-ip','virtual','replace','alignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','destroy','ChatWebsites','UserProfileResource','stack','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','name','filter','ChatWebsite','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','map','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','options','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','account','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','update','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7995,0x19f));var _0x5799=function(_0x10329c,_0x84cda4){_0x10329c=_0x10329c-0x0;var _0x59a9ee=_0x7995[_0x10329c];return _0x59a9ee;};'use strict';var BPromise=require(_0x5799('0x0'));var Mustache=require(_0x5799('0x1'));var util=require(_0x5799('0x2'));var path=require('path');var ejs=require(_0x5799('0x3'));var fs=require('fs');var fs_extra=require(_0x5799('0x4'));var _=require(_0x5799('0x5'));var querystring=require('querystring');var Redis=require(_0x5799('0x6'));var qs=require(_0x5799('0x7'));var logger=require('../../config/logger')(_0x5799('0x8'));var config=require(_0x5799('0x9'));var db=require('../../mysqldb')['db'];config[_0x5799('0xa')]=_[_0x5799('0xb')](config[_0x5799('0xa')],{'host':_0x5799('0xc'),'port':0x18eb});var socket=require(_0x5799('0xd'))(new Redis(config[_0x5799('0xa')]));require(_0x5799('0xe'))[_0x5799('0xf')](socket);var htmlToText=require(_0x5799('0x10'));var jayson=require(_0x5799('0x11'));var client=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x232c});var client9002=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x5799('0x13')]({'port':0x232b});var client9001=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x10b478,_0x22ec26,_0x398ee4,_0x1bedf5){return new BPromise(function(_0x21eb3d,_0x5b8352){var _0x462468=_0x1bedf5||client;return _0x462468[_0x5799('0x14')](_0x10b478,_0x398ee4)[_0x5799('0x15')](function(_0x30931d){logger['info'](_0x5799('0x16'),_0x22ec26,_0x5799('0x17'));logger[_0x5799('0x18')](_0x5799('0x19'),_0x22ec26,'request\x20sent',JSON[_0x5799('0x1a')](_0x30931d));if(_0x30931d['error']){if(_0x30931d[_0x5799('0x1b')][_0x5799('0x1c')]===0x1f4){logger[_0x5799('0x1b')](_0x5799('0x16'),_0x22ec26,_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);return _0x5b8352(_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x22ec26,_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);return _0x21eb3d(_0x30931d[_0x5799('0x1b')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x22ec26,'request\x20sent');_0x21eb3d(_0x30931d[_0x5799('0x1e')][_0x5799('0x1d')]);}})[_0x5799('0x1f')](function(_0x11351f){logger[_0x5799('0x1b')](_0x5799('0x16'),_0x22ec26,_0x11351f);_0x5b8352(_0x11351f);});});}function respondWithStatusCode(_0x15218a,_0x122e60){_0x122e60=_0x122e60||0xcc;return function(_0x32de29){if(_0x32de29){return _0x15218a[_0x5799('0x20')](_0x122e60);}return _0x15218a['status'](_0x122e60)[_0x5799('0x21')]();};}function respondWithResult(_0x5c196e,_0x5e0d86){_0x5e0d86=_0x5e0d86||0xc8;return function(_0x1cb708){if(_0x1cb708){return _0x5c196e[_0x5799('0x22')](_0x5e0d86)[_0x5799('0x23')](_0x1cb708);}};}function respondWithFilteredResult(_0xc8aae6,_0x506ab3){return function(_0x385144){if(_0x385144){var _0x92786a=typeof _0x506ab3['offset']===_0x5799('0x24')&&typeof _0x506ab3[_0x5799('0x25')]===_0x5799('0x24');var _0x4901df=_0x385144[_0x5799('0x26')];var _0x53afa7=_0x92786a?0x0:_0x506ab3[_0x5799('0x27')];var _0x22eb16=_0x92786a?_0x385144[_0x5799('0x26')]:_0x506ab3[_0x5799('0x27')]+_0x506ab3[_0x5799('0x25')];var _0x1036ea;if(_0x22eb16>=_0x4901df){_0x22eb16=_0x4901df;_0x1036ea=0xc8;}else{_0x1036ea=0xce;}_0xc8aae6[_0x5799('0x22')](_0x1036ea);return _0xc8aae6[_0x5799('0x28')](_0x5799('0x29'),_0x53afa7+'-'+_0x22eb16+'/'+_0x4901df)['json'](_0x385144);}return null;};}function saveUpdates(_0x3a5dec){return function(_0xb7afac){if(_0xb7afac){return _0xb7afac['update'](_0x3a5dec)[_0x5799('0x15')](function(_0x117161){return _0x117161;});}return null;};}function removeEntity(_0x68dd1a){return function(_0x3ecfba){if(_0x3ecfba){return _0x3ecfba[_0x5799('0x2a')]()[_0x5799('0x15')](function(){var _0x12cdd1=_0x3ecfba['get']({'plain':!![]});var _0x51e1fb=_0x5799('0x2b');return db[_0x5799('0x2c')]['destroy']({'where':{'type':_0x51e1fb,'resourceId':_0x12cdd1['id']}})[_0x5799('0x15')](function(){return _0x3ecfba;});})['then'](function(){_0x68dd1a[_0x5799('0x22')](0xcc)[_0x5799('0x21')]();});}};}function handleEntityNotFound(_0x526200){return function(_0x159f6b){if(!_0x159f6b){_0x526200[_0x5799('0x20')](0x194);}return _0x159f6b;};}function handleError(_0x1b363a,_0x1850a7){_0x1850a7=_0x1850a7||0x1f4;return function(_0x12c533){logger['error'](_0x12c533[_0x5799('0x2d')]);if(_0x12c533['name']){delete _0x12c533['name'];}_0x1b363a['status'](_0x1850a7)[_0x5799('0x2e')](_0x12c533);};}exports[_0x5799('0x2f')]=function(_0x5102bb,_0x23119b){var _0x1d9e35={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3f9215={},_0x29d695={'count':0x0,'rows':[]};var _0x5c3ae7=_['map'](db['ChatWebsite'][_0x5799('0x30')],function(_0x1172b7){return{'name':_0x1172b7['fieldName'],'type':_0x1172b7[_0x5799('0x31')][_0x5799('0x32')]};});_0x3f9215[_0x5799('0x33')]=_['map'](_0x5c3ae7,'name');_0x3f9215[_0x5799('0x34')]=_[_0x5799('0x35')](_0x5102bb[_0x5799('0x34')]);_0x3f9215[_0x5799('0x36')]=_[_0x5799('0x37')](_0x3f9215[_0x5799('0x33')],_0x3f9215[_0x5799('0x34')]);_0x1d9e35[_0x5799('0x38')]=_[_0x5799('0x37')](_0x3f9215[_0x5799('0x33')],qs[_0x5799('0x39')](_0x5102bb['query'][_0x5799('0x39')]));_0x1d9e35[_0x5799('0x38')]=_0x1d9e35[_0x5799('0x38')]['length']?_0x1d9e35[_0x5799('0x38')]:_0x3f9215['model'];if(!_0x5102bb[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x1d9e35[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x5102bb[_0x5799('0x34')][_0x5799('0x25')]);_0x1d9e35['offset']=qs['offset'](_0x5102bb[_0x5799('0x34')]['offset']);}_0x1d9e35[_0x5799('0x3c')]=qs[_0x5799('0x3d')](_0x5102bb['query'][_0x5799('0x3d')]);_0x1d9e35[_0x5799('0x3e')]=qs['filters'](_[_0x5799('0x3f')](_0x5102bb[_0x5799('0x34')],_0x3f9215[_0x5799('0x36')]),_0x5c3ae7);if(_0x5102bb[_0x5799('0x34')]['filter']){_0x1d9e35[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x1d9e35[_0x5799('0x3e')],{'$or':_['map'](_0x5c3ae7,function(_0xc35794){if(_0xc35794[_0x5799('0x31')]!==_0x5799('0x41')){var _0x5b7ecf={};_0x5b7ecf[_0xc35794[_0x5799('0x42')]]={'$like':'%'+_0x5102bb[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x5b7ecf;}})});}_0x1d9e35=_[_0x5799('0x40')]({},_0x1d9e35,_0x5102bb['options']);var _0x40beb7={'where':_0x1d9e35['where']};return db[_0x5799('0x44')]['count'](_0x40beb7)[_0x5799('0x15')](function(_0x1817df){_0x29d695[_0x5799('0x26')]=_0x1817df;if(_0x5102bb[_0x5799('0x34')][_0x5799('0x45')]){_0x1d9e35[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x44')][_0x5799('0x47')](_0x1d9e35);})[_0x5799('0x15')](function(_0x9cd928){_0x29d695['rows']=_0x9cd928;return _0x29d695;})[_0x5799('0x15')](respondWithFilteredResult(_0x23119b,_0x1d9e35))[_0x5799('0x1f')](handleError(_0x23119b,null));};exports[_0x5799('0x48')]=function(_0x4c612c,_0x178369){var _0x1c396c={'raw':![],'where':{'id':_0x4c612c[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x4a')],'as':_0x5799('0x4b')}]},_0xb78ffb={};_0xb78ffb[_0x5799('0x33')]=_[_0x5799('0x35')](db['ChatWebsite'][_0x5799('0x30')]);_0xb78ffb[_0x5799('0x34')]=_[_0x5799('0x35')](_0x4c612c[_0x5799('0x34')]);_0xb78ffb[_0x5799('0x36')]=_[_0x5799('0x37')](_0xb78ffb[_0x5799('0x33')],_0xb78ffb[_0x5799('0x34')]);_0x1c396c[_0x5799('0x38')]=_[_0x5799('0x37')](_0xb78ffb[_0x5799('0x33')],qs['fields'](_0x4c612c[_0x5799('0x34')]['fields']));_0x1c396c[_0x5799('0x38')]=_0x1c396c[_0x5799('0x38')][_0x5799('0x4c')]?_0x1c396c['attributes']:_0xb78ffb[_0x5799('0x33')];if(_0x4c612c[_0x5799('0x34')][_0x5799('0x45')]){_0x1c396c[_0x5799('0x46')]=[{'all':!![]}];}_0x1c396c=_[_0x5799('0x40')]({},_0x1c396c,_0x4c612c['options']);return db[_0x5799('0x44')][_0x5799('0x4d')](_0x1c396c)['then'](handleEntityNotFound(_0x178369,null))['then'](respondWithResult(_0x178369,null))['catch'](handleError(_0x178369,null));};exports[_0x5799('0x4e')]=function(_0x38e63d,_0x5c35fd){return db[_0x5799('0x44')][_0x5799('0x4e')](_0x38e63d[_0x5799('0x4f')],{})[_0x5799('0x15')](function(_0x5ea290){var _0x38d1d2=_0x38e63d[_0x5799('0x50')][_0x5799('0x51')]({'plain':!![]});if(!_0x38d1d2)throw new Error(_0x5799('0x52'));if(_0x38d1d2[_0x5799('0x53')]==='user'){var _0x402f8a=_0x5ea290[_0x5799('0x51')]({'plain':!![]});var _0x223d8e=_0x5799('0x2b');return db[_0x5799('0x54')][_0x5799('0x4d')]({'where':{'name':_0x223d8e,'userProfileId':_0x38d1d2[_0x5799('0x55')]},'raw':!![]})[_0x5799('0x15')](function(_0x5c7d40){if(_0x5c7d40&&_0x5c7d40['autoAssociation']===0x0){return db[_0x5799('0x2c')][_0x5799('0x4e')]({'name':_0x402f8a[_0x5799('0x42')],'resourceId':_0x402f8a['id'],'type':_0x5c7d40['name'],'sectionId':_0x5c7d40['id']},{})[_0x5799('0x15')](function(){return _0x5ea290;});}else{return _0x5ea290;}})[_0x5799('0x1f')](function(_0x3a7dfd){logger[_0x5799('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a7dfd);throw _0x3a7dfd;});}return _0x5ea290;})[_0x5799('0x15')](respondWithResult(_0x5c35fd,0xc9))[_0x5799('0x1f')](handleError(_0x5c35fd,null));};exports['update']=function(_0x538a1f,_0x3631e7){if(_0x538a1f['body']['id']){delete _0x538a1f[_0x5799('0x4f')]['id'];}return db[_0x5799('0x44')]['find']({'where':{'id':_0x538a1f[_0x5799('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x5799('0x4b')}]})['then'](handleEntityNotFound(_0x3631e7,null))['then'](saveUpdates(_0x538a1f['body'],null))['then'](respondWithResult(_0x3631e7,null))[_0x5799('0x1f')](handleError(_0x3631e7,null));};exports[_0x5799('0x2a')]=function(_0x4f6e72,_0x537355){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4f6e72[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x537355,null))[_0x5799('0x15')](removeEntity(_0x537355,null))[_0x5799('0x1f')](handleError(_0x537355,null));};exports['describe']=function(_0x32ce18,_0xbcb0e6){return db[_0x5799('0x44')][_0x5799('0x56')]()[_0x5799('0x15')](respondWithResult(_0xbcb0e6,null))['catch'](handleError(_0xbcb0e6,null));};exports[_0x5799('0x57')]=function(_0x388460,_0x4baf86){if(_0x388460[_0x5799('0x4f')]['id']){delete _0x388460['body']['id'];}return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x388460[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x4baf86,null))['then'](function(_0x59378c){if(_0x59378c){_0x388460[_0x5799('0x4f')][_0x5799('0x58')]=_0x59378c['id'];return db['Disposition'][_0x5799('0x4e')](_0x388460[_0x5799('0x4f')]);}})['then'](respondWithResult(_0x4baf86,null))[_0x5799('0x1f')](handleError(_0x4baf86,null));};exports[_0x5799('0x59')]=function(_0x50320a,_0x677a9){var _0x3bf202={'raw':![],'where':{}};var _0x132cb6={};var _0x35f997={'count':0x0,'rows':[]};return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x50320a['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x677a9,null))[_0x5799('0x15')](function(_0x4fb734){if(_0x4fb734){_0x132cb6[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0x5a')][_0x5799('0x30')]);_0x132cb6[_0x5799('0x34')]=_['keys'](_0x50320a[_0x5799('0x34')]);_0x132cb6[_0x5799('0x36')]=_[_0x5799('0x37')](_0x132cb6[_0x5799('0x33')],_0x132cb6[_0x5799('0x34')]);_0x3bf202['attributes']=_[_0x5799('0x37')](_0x132cb6[_0x5799('0x33')],qs[_0x5799('0x39')](_0x50320a['query'][_0x5799('0x39')]));_0x3bf202[_0x5799('0x38')]=_0x3bf202[_0x5799('0x38')][_0x5799('0x4c')]?_0x3bf202[_0x5799('0x38')]:_0x132cb6[_0x5799('0x33')];if(!_0x50320a[_0x5799('0x34')][_0x5799('0x3a')]('nolimit')){_0x3bf202[_0x5799('0x25')]=qs['limit'](_0x50320a[_0x5799('0x34')][_0x5799('0x25')]);_0x3bf202['offset']=qs['offset'](_0x50320a[_0x5799('0x34')][_0x5799('0x27')]);}_0x3bf202['order']=qs[_0x5799('0x3d')](_0x50320a[_0x5799('0x34')][_0x5799('0x3d')]);_0x3bf202[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0x50320a[_0x5799('0x34')],_0x132cb6['filters']));_0x3bf202[_0x5799('0x3e')]['ChatWebsiteId']=_0x4fb734['id'];if(_0x50320a['query'][_0x5799('0x43')]){_0x3bf202[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x3bf202[_0x5799('0x3e')],{'$or':_[_0x5799('0x5b')](_0x3bf202[_0x5799('0x38')],function(_0x3e8083){var _0x4c0b42={};_0x4c0b42[_0x3e8083]={'$like':'%'+_0x50320a[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x4c0b42;})});}_0x3bf202=_[_0x5799('0x40')]({},_0x3bf202,_0x50320a['options']);return db[_0x5799('0x5a')][_0x5799('0x26')]({'where':_0x3bf202[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x5aee4b){_0x35f997[_0x5799('0x26')]=_0x5aee4b;if(_0x50320a[_0x5799('0x34')][_0x5799('0x45')]){_0x3bf202[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x5a')][_0x5799('0x47')](_0x3bf202);})[_0x5799('0x15')](function(_0x1edd2b){_0x35f997[_0x5799('0x5c')]=_0x1edd2b;return _0x35f997;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x677a9,_0x3bf202))[_0x5799('0x1f')](handleError(_0x677a9,null));};exports[_0x5799('0x5d')]=function(_0x461965,_0x34e089){return db[_0x5799('0x44')]['find']({'where':{'id':_0x461965[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x34e089,null))[_0x5799('0x15')](function(_0x5c24fc){if(_0x5c24fc){return _0x5c24fc[_0x5799('0x5d')](_0x461965[_0x5799('0x34')][_0x5799('0x5e')]);}})[_0x5799('0x15')](respondWithStatusCode(_0x34e089,null))[_0x5799('0x1f')](handleError(_0x34e089,null));};exports[_0x5799('0x5f')]=function(_0x36cad4,_0x1f4aee){if(_0x36cad4[_0x5799('0x4f')]['id']){delete _0x36cad4[_0x5799('0x4f')]['id'];}return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x36cad4[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x1f4aee,null))[_0x5799('0x15')](function(_0x39bfc0){if(_0x39bfc0){_0x36cad4[_0x5799('0x4f')][_0x5799('0x58')]=_0x39bfc0['id'];return db['CannedAnswer'][_0x5799('0x4e')](_0x36cad4[_0x5799('0x4f')]);}})[_0x5799('0x15')](respondWithResult(_0x1f4aee,null))[_0x5799('0x1f')](handleError(_0x1f4aee,null));};exports[_0x5799('0x60')]=function(_0x13b453,_0x59e100){var _0x3f9329={'raw':![],'where':{}};var _0x376688={};var _0x4a093c={'count':0x0,'rows':[]};return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x13b453['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x59e100,null))[_0x5799('0x15')](function(_0x5b2cb3){if(_0x5b2cb3){_0x376688['model']=_[_0x5799('0x35')](db[_0x5799('0x61')][_0x5799('0x30')]);_0x376688['query']=_['keys'](_0x13b453[_0x5799('0x34')]);_0x376688[_0x5799('0x36')]=_[_0x5799('0x37')](_0x376688[_0x5799('0x33')],_0x376688[_0x5799('0x34')]);_0x3f9329[_0x5799('0x38')]=_[_0x5799('0x37')](_0x376688['model'],qs[_0x5799('0x39')](_0x13b453[_0x5799('0x34')]['fields']));_0x3f9329['attributes']=_0x3f9329[_0x5799('0x38')]['length']?_0x3f9329[_0x5799('0x38')]:_0x376688['model'];if(!_0x13b453[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x3f9329[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x13b453[_0x5799('0x34')][_0x5799('0x25')]);_0x3f9329['offset']=qs[_0x5799('0x27')](_0x13b453['query']['offset']);}_0x3f9329[_0x5799('0x3c')]=qs['sort'](_0x13b453[_0x5799('0x34')]['sort']);_0x3f9329[_0x5799('0x3e')]=qs[_0x5799('0x36')](_[_0x5799('0x3f')](_0x13b453[_0x5799('0x34')],_0x376688['filters']));_0x3f9329[_0x5799('0x3e')][_0x5799('0x58')]=_0x5b2cb3['id'];if(_0x13b453[_0x5799('0x34')][_0x5799('0x43')]){_0x3f9329[_0x5799('0x3e')]=_['merge'](_0x3f9329['where'],{'$or':_[_0x5799('0x5b')](_0x3f9329['attributes'],function(_0x113ce5){var _0x468191={};_0x468191[_0x113ce5]={'$like':'%'+_0x13b453[_0x5799('0x34')]['filter']+'%'};return _0x468191;})});}_0x3f9329=_['merge']({},_0x3f9329,_0x13b453[_0x5799('0x62')]);return db[_0x5799('0x61')]['count']({'where':_0x3f9329['where']})['then'](function(_0x1ab558){_0x4a093c[_0x5799('0x26')]=_0x1ab558;if(_0x13b453[_0x5799('0x34')][_0x5799('0x45')]){_0x3f9329[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x61')][_0x5799('0x47')](_0x3f9329);})[_0x5799('0x15')](function(_0x442f7b){_0x4a093c[_0x5799('0x5c')]=_0x442f7b;return _0x4a093c;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x59e100,_0x3f9329))[_0x5799('0x1f')](handleError(_0x59e100,null));};exports[_0x5799('0x63')]=function(_0x4108fe,_0x2b2d1f){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4108fe[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x2b2d1f,null))[_0x5799('0x15')](function(_0x429cfb){if(_0x429cfb){return _0x429cfb[_0x5799('0x63')](_0x4108fe['query'][_0x5799('0x5e')]);}})[_0x5799('0x15')](respondWithStatusCode(_0x2b2d1f,null))[_0x5799('0x1f')](handleError(_0x2b2d1f,null));};exports[_0x5799('0x64')]=function(_0x3fbc7b,_0x522e39){_0x3fbc7b[_0x5799('0x4f')][_0x5799('0x65')]=_0x3fbc7b['file'][_0x5799('0x66')];return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x3fbc7b[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x522e39,null))[_0x5799('0x15')](saveUpdates(_0x3fbc7b[_0x5799('0x4f')],null))[_0x5799('0x15')](respondWithResult(_0x522e39,null))[_0x5799('0x1f')](handleError(_0x522e39,null));};exports[_0x5799('0x67')]=function(_0x2a21dd,_0x327e0a){_0x2a21dd[_0x5799('0x4f')][_0x5799('0x68')]=_0x2a21dd[_0x5799('0x69')][_0x5799('0x66')];return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x2a21dd['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x327e0a,null))['then'](saveUpdates(_0x2a21dd['body'],null))[_0x5799('0x15')](respondWithResult(_0x327e0a,null))['catch'](handleError(_0x327e0a,null));};exports['addCustomerAvatar']=function(_0x4fd393,_0x287e9e){_0x4fd393['body'][_0x5799('0x6a')]=_0x4fd393['file'][_0x5799('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x4fd393[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x287e9e,null))[_0x5799('0x15')](saveUpdates(_0x4fd393['body'],null))[_0x5799('0x15')](respondWithResult(_0x287e9e,null))[_0x5799('0x1f')](handleError(_0x287e9e,null));};exports[_0x5799('0x6b')]=function(_0x2b7970,_0x38b227){_0x2b7970[_0x5799('0x4f')][_0x5799('0x6c')]=_0x2b7970[_0x5799('0x69')]['filename'];return db[_0x5799('0x44')]['find']({'where':{'id':_0x2b7970[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x38b227,null))[_0x5799('0x15')](saveUpdates(_0x2b7970[_0x5799('0x4f')],null))['then'](respondWithResult(_0x38b227,null))['catch'](handleError(_0x38b227,null));};exports['getLogo']=function(_0xe6f591,_0x55142f){var _0xce639c=path['join'](config[_0x5799('0x6d')],_0x5799('0x6e'));var _0xf3fa4e={'where':{'id':_0xe6f591[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x65')],'raw':!![]};var _0xcad851=![];return require('../../config/license/util')[_0x5799('0x6f')]()[_0x5799('0x15')](function(_0x192775){if(_0x192775){_0xcad851=_0x192775[_0x5799('0x70')];}})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')](_0xf3fa4e);})[_0x5799('0x15')](handleEntityNotFound(_0x55142f,null))[_0x5799('0x15')](function(_0x5b9127){if(_0x5b9127){if(!_['isNil'](_0x5b9127['sitepic'])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x73'),_0x5b9127[_0x5799('0x65')]))&&_0xcad851){_0xce639c=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x73'),_0x5b9127['sitepic']);}}return _0x55142f[_0x5799('0x74')](_0xce639c);}})[_0x5799('0x1f')](handleError(_0x55142f,null));};exports[_0x5799('0x75')]=function(_0x45263b,_0x1b88a6){var _0x18f852=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x76'));var _0x5c8486={'where':{'id':_0x45263b[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x68')],'raw':!![]};return db['ChatWebsite'][_0x5799('0x4d')](_0x5c8486)[_0x5799('0x15')](handleEntityNotFound(_0x1b88a6,null))[_0x5799('0x15')](function(_0x28645e){if(_0x28645e){if(!_[_0x5799('0x77')](_0x28645e['agentAvatar'])){if(fs['existsSync'](path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x28645e[_0x5799('0x68')]))){_0x18f852=path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x28645e['agentAvatar']);}}return _0x1b88a6[_0x5799('0x74')](_0x18f852);}})['catch'](handleError(_0x1b88a6,null));};exports[_0x5799('0x79')]=function(_0x218409,_0x2b0ab1){var _0x1964eb=path[_0x5799('0x72')](config['root'],_0x5799('0x7a'));var _0x348cc2={'where':{'id':_0x218409[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x6a'),_0x5799('0x7b')],'raw':!![]};return db[_0x5799('0x44')][_0x5799('0x4d')](_0x348cc2)[_0x5799('0x15')](handleEntityNotFound(_0x2b0ab1,null))['then'](function(_0x5b727a){if(_0x5b727a){if(!_['isNil'](_0x5b727a['customerAvatar'])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],'server/files/images/avatars/',_0x5b727a[_0x5799('0x6a')]))&&_0x5b727a['showCustomerAvatar']){_0x1964eb=path[_0x5799('0x72')](config['root'],_0x5799('0x78'),_0x5b727a[_0x5799('0x6a')]);}}return _0x2b0ab1[_0x5799('0x74')](_0x1964eb);}})[_0x5799('0x1f')](handleError(_0x2b0ab1,null));};exports[_0x5799('0x7c')]=function(_0x288c87,_0x85e016){var _0x559196=path[_0x5799('0x72')](config['root'],_0x5799('0x7d'));var _0x5c6777={'where':{'id':_0x288c87['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x5c6777)['then'](handleEntityNotFound(_0x85e016,null))['then'](function(_0x22180c){if(_0x22180c){if(!_['isNil'](_0x22180c[_0x5799('0x6c')])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x78'),_0x22180c[_0x5799('0x6c')]))){_0x559196=path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x22180c['systemAvatar']);}}return _0x85e016[_0x5799('0x74')](_0x559196);}})[_0x5799('0x1f')](handleError(_0x85e016,null));};exports[_0x5799('0x7e')]=function(_0x4bc9d2,_0xd6082d){var _0x42515c=require('user-agent-parser');var _0x23a813=new _0x42515c();var _0x45e2d4=_0x23a813[_0x5799('0x7f')](_0x4bc9d2['headers'][_0x5799('0x80')])[_0x5799('0x81')]();var _0x503722={'body':_0x4bc9d2[_0x5799('0x4f')],'channel':_0x5799('0x82')};var _0x253765=[];var _0x5adab4=[];var _0x36a051={};var _0x5f2631=![];return db[_0x5799('0x83')]['describe']()['then'](function(_0x27b90b){if(!_0x27b90b){throw new db['Sequelize'][(_0x5799('0x84'))]('no\x20available\x20attributes');}_0x253765=_[_0x5799('0x85')](_[_0x5799('0x35')](_0x27b90b),[_0x5799('0x86'),'updatedAt']);_0x5adab4=_[_0x5799('0x85')](_[_0x5799('0x35')](_0x27b90b),['createdAt',_0x5799('0x87'),_0x5799('0x88'),_0x5799('0x89')]);if(_0x4bc9d2[_0x5799('0x4f')]['id']){delete _0x4bc9d2[_0x5799('0x4f')]['id'];}if(_[_0x5799('0x77')](_0x4bc9d2['body']['from'])){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8b'));}if(_[_0x5799('0x77')](_0x4bc9d2['body']['body'])||_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x4f')]===''){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8c'));}if(_['isNil'](_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')])){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8e')+_0x5adab4);}if(!_[_0x5799('0x8f')](_0x5adab4,_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')])){throw new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x90')+_0x5adab4);}_0x36a051[_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')]]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')];})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4bc9d2['params']['id']},'include':[{'model':db[_0x5799('0x92')],'as':'List','include':[{'model':db[_0x5799('0x83')],'as':_0x5799('0x93'),'where':_0x36a051,'limit':0x1,'order':[[_0x5799('0x87'),_0x5799('0x94')]]}]},{'model':db[_0x5799('0x95')],'as':_0x5799('0x96')}]});})[_0x5799('0x15')](handleEntityNotFound(_0xd6082d,null))['then'](function(_0x19d3a3){if(_0x19d3a3&&_0x19d3a3[_0x5799('0x97')]){_0x503722['account']=_0x19d3a3;_0x503722[_0x5799('0x98')]=_0x19d3a3[_0x5799('0x96')];_0x503722[_0x5799('0x99')]=_0x19d3a3[_0x5799('0x97')];_0x503722[_0x5799('0x98')]=_[_0x5799('0x9a')](_0x503722[_0x5799('0x98')],['priority'],['asc']);if(_0x503722[_0x5799('0x9b')][_0x5799('0x96')]){delete _0x503722['account'][_0x5799('0x96')];}if(_0x503722[_0x5799('0x9b')][_0x5799('0x97')]&&_0x503722['account']['List'][_0x5799('0x93')][_0x5799('0x4c')]){return _0x503722[_0x5799('0x9b')][_0x5799('0x97')][_0x5799('0x93')][0x0];}var _0x9d55d2=_[_0x5799('0xb')](_0x4bc9d2[_0x5799('0x4f')],{'firstName':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')],'ListId':_0x19d3a3[_0x5799('0x89')]});_0x9d55d2[_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')]]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')];return db['CmContact'][_0x5799('0x4e')](_0x9d55d2,{'fields':_0x253765,'raw':!![]});}})[_0x5799('0x15')](handleEntityNotFound(_0xd6082d,null))[_0x5799('0x15')](function(_0x26c2cb){_0x503722['contact']=_0x26c2cb;var _0x2e9742=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x9c')];if(_0x4bc9d2['headers']['cf-connecting-ip']){_0x2e9742=_0x4bc9d2[_0x5799('0x9d')][_0x5799('0x9e')];}else if(_0x4bc9d2['headers'][_0x5799('0x9f')]){_0x2e9742=_[_0x5799('0xa0')](_0x4bc9d2['headers'][_0x5799('0x9f')][_0x5799('0xa1')](','));}if(_0x26c2cb){var _0x4bd715={'ContactId':_0x26c2cb['id'],'ChatWebsiteId':_0x4bc9d2[_0x5799('0x49')]['id'],'from':(_0x26c2cb[_0x5799('0xa2')]||'')+'\x20'+(_0x26c2cb[_0x5799('0xa3')]||''),'customerIp':_0x2e9742,'customerPort':_0x4bc9d2[_0x5799('0x9d')][_0x5799('0xa4')]?_0x4bc9d2[_0x5799('0x9d')]['x-real-port']:null,'referer':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xa5')],'browserName':_0x45e2d4[_0x5799('0xa6')][_0x5799('0x42')]&&_0x45e2d4[_0x5799('0xa6')]['version']?util[_0x5799('0xa7')](_0x5799('0xa8'),_0x45e2d4[_0x5799('0xa6')][_0x5799('0x42')],_0x45e2d4['browser']['version']):_0x5799('0xa9'),'browserVersion':_0x45e2d4[_0x5799('0xa6')][_0x5799('0xaa')]||_0x5799('0xa9'),'osName':util[_0x5799('0xa7')](_0x5799('0xa8'),_0x45e2d4['os']['name'],_0x45e2d4['os'][_0x5799('0xaa')]),'osVersion':_0x45e2d4['os'][_0x5799('0xaa')],'deviceModel':_0x45e2d4[_0x5799('0xab')][_0x5799('0x33')]&&_0x45e2d4[_0x5799('0xab')]['vendor']?util[_0x5799('0xa7')](_0x5799('0xac'),_0x45e2d4[_0x5799('0xab')]['model'],_0x45e2d4[_0x5799('0xab')]['vendor'],_0x45e2d4['device'][_0x5799('0x31')]):null,'deviceVendor':_0x45e2d4['device'][_0x5799('0xad')],'deviceType':_0x45e2d4[_0x5799('0xab')][_0x5799('0x31')],'formData':JSON[_0x5799('0x1a')](_0x4bc9d2[_0x5799('0x4f')])};var _0x1f1ad6={'ChatWebsiteId':_0x4bc9d2['params']['id'],'closed':![]};if(_0x4bc9d2['body']['threadId']){_0x1f1ad6[_0x5799('0xae')]=_0x4bc9d2['body'][_0x5799('0xae')];return db['ChatInteraction'][_0x5799('0x4d')]({'where':_0x1f1ad6})[_0x5799('0x15')](function(_0x27a83e){if(_0x27a83e){return[_0x27a83e,![]];}_0x4bd715[_0x5799('0xae')]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xae')];_0x4bd715[_0x5799('0xaf')]=_0x4bc9d2[_0x5799('0x4f')]['externalUrl'];return db[_0x5799('0xb0')][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x5c3702){return[_0x5c3702,!![]];});});}_0x1f1ad6[_0x5799('0xb1')]=_0x26c2cb['id'];if(_0x4bc9d2[_0x5799('0x4f')]['interaction']&&_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb2')]['id']){_0x1f1ad6['id']=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb2')]['id'];return db['ChatInteraction'][_0x5799('0x4d')]({'where':_0x1f1ad6})[_0x5799('0x15')](function(_0x1c629b){if(_0x1c629b){return[_0x1c629b,![]];}return db[_0x5799('0xb0')][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x5468b4){return[_0x5468b4,!![]];});});}return db['ChatInteraction'][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x4867cf){return[_0x4867cf,!![]];});}})[_0x5799('0xb3')](function(_0x26cf89,_0x35629b){if(_0x26cf89){_0x5f2631=_0x35629b;if(!_0x35629b){var _0x4647fd={'from':(_0x503722[_0x5799('0xb4')][_0x5799('0xa2')]||'')+'\x20'+(_0x503722[_0x5799('0xb4')][_0x5799('0xa3')]||'')};if(_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xae')]&&_0x4bc9d2['body'][_0x5799('0xb5')]&&_0x4bc9d2[_0x5799('0x4f')]['threadId']!=_0x4bc9d2[_0x5799('0x4f')]['messageId']){_0x4647fd[_0x5799('0xae')]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb5')];}return _0x26cf89[_0x5799('0xb6')](_0x4647fd);}else{return _0x26cf89;}}})['then'](function(_0x9810fe){_0x503722[_0x5799('0xb2')]=_0x9810fe['get']({'plain':!![]});_0x503722['interaction'][_0x5799('0xb7')]=_0x5f2631;if(_0x503722[_0x5799('0xb2')][_0x5799('0xb7')]){if(_0x503722[_0x5799('0x9b')][_0x5799('0xb8')]){_0x503722['applications'][_0x5799('0xb9')]({'id':0x0,'priority':_0x503722[_0x5799('0x98')][_0x5799('0x4c')]+0x1,'app':_0x5799('0xba'),'appdata':'unmanaged','interval':_0x5799('0xbb')});}}return db[_0x5799('0xbc')][_0x5799('0x4e')]({'body':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x4f')],'ChatWebsiteId':_0x4bc9d2[_0x5799('0x49')]['id'],'ChatInteractionId':_0x9810fe['id'],'direction':'in','ContactId':_0x503722['contact']['id'],'AttachmentId':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xbd')]});})[_0x5799('0x15')](function(_0x1ceb1a){_0x503722[_0x5799('0x1d')]=_0x1ceb1a;if(_0x503722[_0x5799('0xb2')][_0x5799('0xbe')]){return db[_0x5799('0xbf')][_0x5799('0x4d')]({'attributes':['id',_0x5799('0x42')],'where':{'id':_0x503722[_0x5799('0xb2')][_0x5799('0xbe')]}})[_0x5799('0x15')](function(_0x232921){if(_0x232921){_0x503722[_0x5799('0x98')][_0x5799('0xc0')]({'id':0x0,'priority':0x0,'app':_0x5799('0xc1'),'appdata':_0x232921[_0x5799('0x42')]+','+(_0x503722[_0x5799('0x9b')][_0x5799('0xc2')]||0xa),'interval':_0x5799('0xbb')});_0x503722['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5799('0xc3'),'startRouting',_0x503722);});}return respondWithRpcPromise(_0x5799('0xc3'),_0x5799('0xc4'),_0x503722);})[_0x5799('0x15')](function(_0x2db819){respondWithRpcPromise('EventManager','EventManager',{'event':_0x5799('0x7e'),'message':_0x2db819},client9002);return _0x2db819;})[_0x5799('0x15')](respondWithResult(_0xd6082d,null))[_0x5799('0x1f')](handleError(_0xd6082d,null));};exports[_0x5799('0xc5')]=function(_0x420685,_0x587dd3){var _0xaee532,_0x2f38a2,_0x245efa;var _0x260923=[];var _0x2ae2df={};var _0x3b630e=_0x420685[_0x5799('0xc6')]||[];var _0x38dad4=[];var _0x5cd906;return db[_0x5799('0x83')][_0x5799('0x56')]()[_0x5799('0x15')](function(_0xc3240b){if(!_0xc3240b){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))]('no\x20available\x20attributes');}_0x260923=_['difference'](_[_0x5799('0x35')](_0xc3240b),[_0x5799('0x86'),_0x5799('0x87'),_0x5799('0x88'),_0x5799('0x89')]);if(_0x420685[_0x5799('0x4f')]['id']){delete _0x420685[_0x5799('0x4f')]['id'];}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0x91')])){throw _0x587dd3['status'](0x1f4)[_0x5799('0x2e')](new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x8b')));}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0x4f')])||_0x420685[_0x5799('0x4f')][_0x5799('0x4f')]===''){throw _0x587dd3['status'](0x1f4)[_0x5799('0x2e')](new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x8c')));}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0xc7')])){throw _0x587dd3[_0x5799('0x22')](0x1f4)[_0x5799('0x2e')](new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0xc8')+_0x260923));}if(!_['includes'](_0x260923,_0x420685[_0x5799('0x4f')]['mapKeyOffline'])){throw _0x587dd3[_0x5799('0x22')](0x1f4)[_0x5799('0x2e')](new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0xc9')+_0x260923));}_0x2ae2df[_0x420685[_0x5799('0x4f')][_0x5799('0xc7')]]=_0x420685[_0x5799('0x4f')][_0x5799('0x91')];})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x420685[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x92')],'as':'List'},{'model':db[_0x5799('0xca')],'as':'MailAccount'}]});})[_0x5799('0x15')](handleEntityNotFound(_0x587dd3,null))['then'](function(_0x1507d7){if(_0x1507d7&&_0x1507d7[_0x5799('0x97')]){_0x2f38a2=_0x1507d7;var _0x47a23e=_[_0x5799('0xb')](_0x420685[_0x5799('0x4f')],{'firstName':_0x420685[_0x5799('0x4f')][_0x5799('0x91')],'phone':_0x420685[_0x5799('0x4f')][_0x5799('0x91')],'ListId':_0x1507d7[_0x5799('0x89')]});_0x47a23e[_0x420685[_0x5799('0x4f')][_0x5799('0xc7')]]=_0x420685[_0x5799('0x4f')][_0x5799('0x91')];return db[_0x5799('0x83')][_0x5799('0xcb')]({'where':_0x2ae2df,'defaults':_0x47a23e});}})[_0x5799('0xb3')](function(_0x1aeec2){if(_0x1aeec2){_0x245efa=_0x1aeec2;var _0x3cbc3f=fs[_0x5799('0xcc')](path[_0x5799('0x72')](config[_0x5799('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),_0x5799('0xcd'));var _0x5a9824=ejs[_0x5799('0xce')](_0x3cbc3f,{'body':_[_0x5799('0xcf')](_0x420685[_0x5799('0x4f')]['body']),'bodyTitle':_0x2f38a2[_0x5799('0xd0')]});return db['ChatOfflineMessage'][_0x5799('0x4e')]({'body':_0x5a9824,'plainBody':htmlToText[_0x5799('0xd1')](_0x5a9824),'ContactId':_0x1aeec2['id'],'ChatWebsiteId':_0x2f38a2['id']});}})[_0x5799('0x15')](function(_0x1e665f){_0x5cd906=_0x1e665f;if(_0x3b630e[_0x5799('0x4c')]){var _0x138a7b=_0x3b630e[_0x5799('0x5b')](function(_0x5f5977){return{'name':_0x5f5977[_0x5799('0xd2')],'basename':_0x5f5977[_0x5799('0x66')],'type':_0x5f5977[_0x5799('0xd3')],'ChatOfflineMessageId':_0x1e665f['id']};});_0x38dad4=_0x138a7b['map'](_0x39a4d8=>{var _0xcd9954={'filename':_0x39a4d8[_0x5799('0x42')],'path':path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0xd4'),_0x5799('0xc6'),'attachments',_0x5799('0xd5'),_0x39a4d8[_0x5799('0xd6')])};return _0xcd9954;});if(!_0x2f38a2[_0x5799('0xd7')]){return db[_0x5799('0xd8')][_0x5799('0xd9')](function(_0x43dfd5){return db['Attachment'][_0x5799('0xda')](_0x138a7b,{'transaction':_0x43dfd5});});}}})['then'](function(){if(_0x5cd906){_0xaee532=_0x5cd906;return db[_0x5799('0xca')][_0x5799('0xdb')]({'where':{'service':!![]},'include':[{'model':db[_0x5799('0xdc')],'as':_0x5799('0xdd'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5799('0xde'),'raw':!![]}]}]});}})[_0x5799('0x15')](function(_0x3da420){if(_0x3da420&&_0x3da420['Smtp']&&_0x2f38a2['forwardOffline']&&_0x2f38a2['forwardOfflineAddress']){var _0x519856=_0x3da420[_0x5799('0xdf')]();return respondWithRpcPromise(_0x5799('0xe0'),_0x5799('0xe1'),{'account':_0x519856,'message':{'from':util[_0x5799('0xa7')]('\x22%s\x22\x20<%s>',_0x3da420[_0x5799('0x42')],_0x3da420['email']||_0x3da420[_0x5799('0xdd')][_0x5799('0x50')]),'to':_0x2f38a2[_0x5799('0xe2')],'subject':_0x2f38a2[_0x5799('0xe3')],'html':_0xaee532[_0x5799('0x4f')],'attachments':_0x38dad4}},client9003)['then'](function(){return _0xaee532;})[_0x5799('0x1f')](function(_0x45a942){logger[_0x5799('0x1b')](_0x45a942);});}})['then'](function(){if(_0x2f38a2&&_0x2f38a2[_0x5799('0xd7')]&&_0x2f38a2[_0x5799('0xe4')]){var _0xbebce6=[];if(_0x3b630e['length']){_0xbebce6=_0x3b630e[_0x5799('0x5b')](function(_0x10bb25){return{'name':_0x10bb25['originalname'],'basename':_0x10bb25[_0x5799('0x66')],'type':_0x10bb25[_0x5799('0xd3')],'ChatOfflineMessageId':_0x5cd906['id']};});}var _0x3f24be;if(!_[_0x5799('0x77')](_0x2f38a2[_0x5799('0xe5')])){var _0x1df191=_[_0x5799('0x5b')](_0x420685['body'],function(_0x226052){return _0x226052;});var _0x4811d7=_[_0x5799('0xe6')](_0x1df191)[0x0];var _0x586f08=_[_0x5799('0xe7')](_0x4811d7,function(_0x52fdd7){return _0x52fdd7;});_0x3f24be=_0x586f08[0x1][_0x2f38a2[_0x5799('0xe5')]];}var _0x4e2966={'from':_0x245efa[_0x5799('0xe8')],'firstName':_0x245efa[_0x5799('0xa2')],'lastName':_0x245efa[_0x5799('0xa3')],'mapKey':_0x5799('0xe8'),'message':{'from':_0x245efa[_0x5799('0xe8')],'to':_0x2f38a2[_0x5799('0xca')][_0x5799('0xe8')],'cc':'','subject':_['isNil'](_0x3f24be)?_0x2f38a2[_0x5799('0xe3')]:_0x3f24be,'messageId':'','sentAt':new Date(),'attach':_0xbebce6[_0x5799('0x4c')],'attachments':_0xbebce6,'originChannel':_0x5799('0xe9'),'ChatWebsiteId':_0x2f38a2['id'],'ChatOfflineMessageId':_0xaee532['id'],'originTo':_0x2f38a2[_0x5799('0xca')][_0x5799('0xe8')]},'body':_0xaee532[_0x5799('0x4f')]};var _0x380c71={'account':{'id':_0x2f38a2[_0x5799('0xe4')]},'body':_0x4e2966,'log':_0x5799('0xea')};return respondWithRpcPromise(_0x5799('0xea'),_0x5799('0xeb'),_0x380c71,client9001)['then'](function(){return _0xaee532;})[_0x5799('0x1f')](function(_0x13472e){logger[_0x5799('0x1b')](_0x13472e);});}return;})['then'](function(){if(_0xaee532){return _0xaee532;}})[_0x5799('0x15')](respondWithResult(_0x587dd3,null))[_0x5799('0x1f')](function(_0x24c151){logger[_0x5799('0x1b')](_0x5799('0x1f'),_0x24c151);for(var _0x3f6f49 of _0x3b630e){var _0x39a290=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0xd4'),_0x5799('0xc6'),_0x5799('0xec'),_0x5799('0xd5'),_0x3f6f49['filename']);fs_extra['remove'](_0x39a290)['catch'](function(_0x39035a){logger['error'](_0x5799('0xed'),_0x39a290,_0x39035a);});}});};exports[_0x5799('0xee')]=function(_0x20f2e2,_0x2d972a){return db['ChatInteraction'][_0x5799('0x4d')]({'where':{'id':_0x20f2e2[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x2d972a,null))[_0x5799('0x15')](function(_0x48a624){if(_0x48a624){return _0x48a624[_0x5799('0xee')](_0x20f2e2[_0x5799('0x4f')][_0x5799('0x5e')],_['omit'](_0x20f2e2[_0x5799('0x4f')],[_0x5799('0x5e'),'id'])||{});}})[_0x5799('0x15')](respondWithResult(_0x2d972a,null))[_0x5799('0x1f')](handleError(_0x2d972a,null));};exports[_0x5799('0xef')]=function(_0xdab4b7,_0x48e8d8){var _0x352851={'raw':![],'where':{}};var _0x3a7372={};var _0x1dcee3={'count':0x0,'rows':[]};return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0xdab4b7[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x48e8d8,null))['then'](function(_0x62e87){if(_0x62e87){_0x3a7372[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0xb0')]['rawAttributes']);_0x3a7372['query']=_['keys'](_0xdab4b7[_0x5799('0x34')]);_0x3a7372[_0x5799('0x36')]=_[_0x5799('0x37')](_0x3a7372[_0x5799('0x33')],_0x3a7372[_0x5799('0x34')]);_0x352851['attributes']=_[_0x5799('0x37')](_0x3a7372[_0x5799('0x33')],qs['fields'](_0xdab4b7[_0x5799('0x34')][_0x5799('0x39')]));_0x352851[_0x5799('0x38')]=_0x352851[_0x5799('0x38')][_0x5799('0x4c')]?_0x352851[_0x5799('0x38')]:_0x3a7372['model'];if(!_0xdab4b7[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x352851[_0x5799('0x25')]=qs['limit'](_0xdab4b7['query'][_0x5799('0x25')]);_0x352851[_0x5799('0x27')]=qs[_0x5799('0x27')](_0xdab4b7['query'][_0x5799('0x27')]);}_0x352851['order']=qs['sort'](_0xdab4b7[_0x5799('0x34')]['sort']);_0x352851[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0xdab4b7[_0x5799('0x34')],_0x3a7372['filters']));_0x352851[_0x5799('0x3e')]['ChatWebsiteId']=_0x62e87['id'];if(_0xdab4b7[_0x5799('0x34')]['filter']){_0x352851[_0x5799('0x3e')]=_['merge'](_0x352851['where'],{'$or':_[_0x5799('0x5b')](_0x352851[_0x5799('0x38')],function(_0x2f0ec3){var _0x36b350={};_0x36b350[_0x2f0ec3]={'$like':'%'+_0xdab4b7[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x36b350;})});}_0x352851=_[_0x5799('0x40')]({},_0x352851,_0xdab4b7[_0x5799('0x62')]);return db['ChatInteraction'][_0x5799('0x26')]({'where':_0x352851[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x49fc14){_0x1dcee3[_0x5799('0x26')]=_0x49fc14;if(_0xdab4b7['query'][_0x5799('0x45')]){_0x352851['include']=[{'model':db[_0x5799('0x83')],'as':_0x5799('0xf0'),'required':![]},{'model':db['User'],'as':_0x5799('0xf1'),'attributes':[_0x5799('0x42'),'fullname',_0x5799('0xf2')],'required':![]},{'model':db[_0x5799('0xf3')],'as':_0x5799('0xf4'),'attributes':['id','name',_0x5799('0xf5')],'where':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]?{'id':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]}:undefined,'required':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]?!![]:![]}];}return db[_0x5799('0xb0')]['findAll'](_0x352851);})[_0x5799('0x15')](function(_0x35516f){_0x1dcee3[_0x5799('0x5c')]=_0x35516f;return _0x1dcee3;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x48e8d8,_0x352851))['catch'](handleError(_0x48e8d8,null));};function iftimePromise(_0x5c14ab,_0xaf6cf0){return respondWithRpcPromise(_0x5799('0xf7'),_0x5799('0xf8'),{'command':_0xaf6cf0['timezone']?util[_0x5799('0xa7')](_0x5799('0xf9'),_0x5c14ab['interval'],_0xaf6cf0['timezone']):util[_0x5799('0xa7')](_0x5799('0xfa'),_0x5c14ab[_0x5799('0xfb')])},client9002)[_0x5799('0x15')](function(_0x238c56){var _0x1ebad7=_0x238c56&&_0x238c56[_0x5799('0xfc')](_0x5799('0xfd'))>=0x0?!![]:![];logger[_0x5799('0xfe')](_0x5799('0xff'),_0xaf6cf0['id'],_0x5c14ab['id'],_0x5c14ab[_0x5799('0xfb')],_0x1ebad7?_0x5799('0x100'):_0x5799('0x101'),_0xaf6cf0[_0x5799('0x102')]?_0xaf6cf0[_0x5799('0x102')]:'No\x20timezone');return _0x1ebad7;})[_0x5799('0x1f')](function(_0x2394ea){logger[_0x5799('0x1b')](_0x5799('0xff'),_0xaf6cf0['id'],_0x5c14ab['id'],_0x5c14ab[_0x5799('0xfb')],util[_0x5799('0x103')](_0x2394ea,{'showHidden':![],'depth':null}),_0xaf6cf0[_0x5799('0x102')]?_0xaf6cf0['timezone']:'No\x20timezone');return![];});}exports[_0x5799('0xf8')]=function(_0xb82489,_0x5a8f49){var _0x1a2fb7=0x0;var _0x2e42ed=0x0;var _0xb50b91=![];var _0x19c2b1;var _0x2fc90d;return db[_0x5799('0x44')]['find']({'where':{'id':_0xb82489[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x104')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x5799('0xfb')],'raw':!![]}]}]})[_0x5799('0x15')](handleEntityNotFound(_0x5a8f49,null))['then'](function(_0xb2e125){if(_0xb2e125){_0x19c2b1=_0xb2e125;return _0xb2e125[_0x5799('0x105')]({'raw':!![]});}})[_0x5799('0x15')](function(_0x1f3706){if(_0x19c2b1){if(_0x1f3706){_0x2fc90d=_0x1f3706;}}return require(_0x5799('0x106'))[_0x5799('0x6f')]();})['then'](function(_0x1ccdd5){if(_0x1ccdd5){_0x2e42ed=_0x1ccdd5['virtual'];_0xb50b91=_0x1ccdd5[_0x5799('0x70')];}})[_0x5799('0x15')](function(){return db['ChatInteraction'][_0x5799('0x26')]({'where':{'closed':![]}});})[_0x5799('0x15')](function(_0x3b186b){_0x1a2fb7=_0x3b186b;if(_0x2e42ed&&_0x3b186b>_0x2e42ed){return db[_0x5799('0x107')][_0x5799('0xdb')]({'where':{'id':0x1}})[_0x5799('0x15')](function(_0x30b2f2){if(_0x30b2f2){_0x30b2f2[_0x5799('0x108')](_0x5799('0x109'));}});}})['then'](function(){if(_0x19c2b1['Interval']&&_0x19c2b1[_0x5799('0x104')]['Intervals']){var _0x2e62e9=[];for(var _0x12cad9=0x0;_0x12cad9<_0x19c2b1[_0x5799('0x104')][_0x5799('0x10a')][_0x5799('0x4c')];_0x12cad9++){var _0x141182=_0x19c2b1['Interval']['Intervals'][_0x12cad9][_0x5799('0x51')]({'plain':!![]});_0x2e62e9['push'](iftimePromise(_0x141182,_0x19c2b1));}return BPromise['all'](_0x2e62e9)[_0x5799('0x15')](function(_0x7ebd55){return _[_0x5799('0x10b')](_0x7ebd55);});}else{return!![];}})[_0x5799('0x15')](function(_0x2a17ec){var _0x4d874a=fs[_0x5799('0xcc')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x10c')),_0x5799('0xcd'));var _0x5203e9={'remote':_0x19c2b1[_0x5799('0x10d')],'query':querystring['stringify'](_[_0x5799('0x40')](_0x19c2b1[_0x5799('0x51')]({'plain':!![]}),{'customerIp':_0xb82489['headers'][_0x5799('0x9f')]||_0xb82489[_0x5799('0x9d')][_0x5799('0x10e')]||_0xb82489['connection']['remoteAddress']||_0xb82489['ip'],'referer':_0xb82489['headers']['referer'],'openedInteractions':_0x1a2fb7,'maxInteractions':_0x2e42ed,'virtual':_0xb50b91[_0x5799('0x10f')],'online':_0x2a17ec,'custom':_0xb50b91}))[_0x5799('0x110')](/'/g,'\x5c\x27')};_0x5a8f49['send'](ejs[_0x5799('0xce')](Mustache['render'](_0x4d874a,_0x5203e9),{'proactiveActions':_0x2fc90d,'alignment':_0x19c2b1[_0x5799('0x111')],'verticalAlignment':_0x19c2b1['verticalAlignment'],'div_color':_0x19c2b1[_0x5799('0xf5')],'labelText':_0x19c2b1[_0x5799('0x112')],'text_color':_0x19c2b1[_0x5799('0x113')],'text_button_color':_0x19c2b1[_0x5799('0x114')],'button_color':_0x19c2b1['color_button'],'background_color':_0x19c2b1[_0x5799('0x115')],'hideWhenOffline':_0x19c2b1[_0x5799('0x116')],'interval':_0x19c2b1[_0x5799('0x117')]}));})[_0x5799('0x1f')](handleError(_0x5a8f49,null));};exports[_0x5799('0x118')]=function(_0xfc678e,_0x23f8d9){var _0x451875=_0xfc678e[_0x5799('0x49')]['id'];var _0x6a4379=_0xfc678e[_0x5799('0x4f')];var _0x481101=0xc8;var _0x5aecb7=null;return db[_0x5799('0xd8')][_0x5799('0xd9')]({'isolationLevel':db[_0x5799('0xd8')][_0x5799('0x119')]['ISOLATION_LEVELS'][_0x5799('0x11a')]},function(_0x595d8d){return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x451875},'transaction':_0x595d8d})[_0x5799('0x15')](function(_0x5db6e9){if(_0x5db6e9){return db[_0x5799('0x95')][_0x5799('0x2a')]({'where':{'ChatWebsiteId':_0x451875},'transaction':_0x595d8d})[_0x5799('0x15')](function(){var _0x5e0137=_['map'](_0x6a4379,function(_0x133d2b){_0x133d2b['ChatWebsiteId']=_0x451875;return _0x133d2b;});return db[_0x5799('0x95')][_0x5799('0xda')](_0x5e0137,{'transaction':_0x595d8d});});}else{_0x481101=0x194;_0x5aecb7=[];}});})[_0x5799('0x15')](function(){if(_0x481101!==0x194){return db[_0x5799('0x95')][_0x5799('0x11b')]({'where':{'ChatWebsiteId':_0x451875},'order':'priority'})[_0x5799('0x15')](function(_0x446dad){_0x5aecb7=_0x446dad;});}})[_0x5799('0x1f')](function(_0x22ade9){_0x481101=0x1f4;logger[_0x5799('0x1b')](_0x22ade9[_0x5799('0x2d')]);if(_0x22ade9[_0x5799('0x42')]){delete _0x22ade9[_0x5799('0x42')];}_0x5aecb7=_0x22ade9;})[_0x5799('0x11c')](function(){if(_0x5aecb7===null){_0x23f8d9[_0x5799('0x20')](_0x481101);}else{if(_0x481101===0x1f4){_0x23f8d9[_0x5799('0x22')](_0x481101)[_0x5799('0x2e')](_0x5aecb7);}else{_0x23f8d9[_0x5799('0x22')](_0x481101)[_0x5799('0x23')](_0x5aecb7);}}});};exports[_0x5799('0x11d')]=function(_0x24fd7c,_0x3efd9b){var _0x182430={};var _0x3763da={};var _0x3c96f2;var _0x5e28ef;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x24fd7c[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x3efd9b,null))['then'](function(_0x1d0e21){if(_0x1d0e21){_0x3c96f2=_0x1d0e21;_0x3763da['model']=_[_0x5799('0x35')](db[_0x5799('0x95')][_0x5799('0x30')]);_0x3763da[_0x5799('0x34')]=_[_0x5799('0x35')](_0x24fd7c[_0x5799('0x34')]);_0x3763da[_0x5799('0x36')]=_['intersection'](_0x3763da[_0x5799('0x33')],_0x3763da[_0x5799('0x34')]);_0x182430[_0x5799('0x38')]=_[_0x5799('0x37')](_0x3763da[_0x5799('0x33')],qs[_0x5799('0x39')](_0x24fd7c['query'][_0x5799('0x39')]));_0x182430[_0x5799('0x38')]=_0x182430[_0x5799('0x38')][_0x5799('0x4c')]?_0x182430[_0x5799('0x38')]:_0x3763da[_0x5799('0x33')];_0x182430[_0x5799('0x3c')]=qs[_0x5799('0x3d')](_0x24fd7c[_0x5799('0x34')][_0x5799('0x3d')]);_0x182430[_0x5799('0x3e')]=qs[_0x5799('0x36')](_[_0x5799('0x3f')](_0x24fd7c[_0x5799('0x34')],_0x3763da[_0x5799('0x36')]));if(_0x24fd7c[_0x5799('0x34')][_0x5799('0x43')]){_0x182430[_0x5799('0x3e')]=_['merge'](_0x182430['where'],{'$or':_[_0x5799('0x5b')](_0x182430['attributes'],function(_0x465142){var _0x115c76={};_0x115c76[_0x465142]={'$like':'%'+_0x24fd7c[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x115c76;})});}_0x182430=_[_0x5799('0x40')]({},_0x182430,_0x24fd7c[_0x5799('0x62')]);return _0x3c96f2[_0x5799('0x11d')](_0x182430);}})[_0x5799('0x15')](function(_0x15640f){if(_0x15640f){_0x5e28ef=_0x15640f[_0x5799('0x4c')];if(!_0x24fd7c[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x182430[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x24fd7c['query'][_0x5799('0x25')]);_0x182430[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x24fd7c[_0x5799('0x34')]['offset']);}return _0x3c96f2[_0x5799('0x11d')](_0x182430);}})[_0x5799('0x15')](function(_0x1a2380){if(_0x1a2380){return _0x1a2380?{'count':_0x5e28ef,'rows':_0x1a2380}:null;}})[_0x5799('0x15')](respondWithResult(_0x3efd9b,null))['catch'](handleError(_0x3efd9b,null));};exports[_0x5799('0x11e')]=function(_0x58492c,_0x3cbcb6){return db[_0x5799('0x11f')][_0x5799('0x4d')]({'where':{'id':_0x58492c[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cbcb6,null))[_0x5799('0x15')](function(_0x43147c){if(_0x43147c){return _0x43147c['addProactiveActions'](_0x58492c[_0x5799('0x4f')]['ids'],_[_0x5799('0x120')](_0x58492c[_0x5799('0x4f')],[_0x5799('0x5e'),'id'])||{});}})[_0x5799('0x15')](respondWithResult(_0x3cbcb6,null))[_0x5799('0x1f')](handleError(_0x3cbcb6,null));};exports[_0x5799('0x105')]=function(_0x84620f,_0x5435d0){var _0x3b91bd={};var _0x30fe9a={};var _0x5cd74e;var _0x470e42;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x84620f[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x5435d0,null))['then'](function(_0x43aaca){if(_0x43aaca){_0x5cd74e=_0x43aaca;_0x30fe9a[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0x121')]['rawAttributes']);_0x30fe9a[_0x5799('0x34')]=_['keys'](_0x84620f[_0x5799('0x34')]);_0x30fe9a[_0x5799('0x36')]=_[_0x5799('0x37')](_0x30fe9a[_0x5799('0x33')],_0x30fe9a[_0x5799('0x34')]);_0x3b91bd['attributes']=_[_0x5799('0x37')](_0x30fe9a['model'],qs[_0x5799('0x39')](_0x84620f[_0x5799('0x34')][_0x5799('0x39')]));_0x3b91bd[_0x5799('0x38')]=_0x3b91bd[_0x5799('0x38')]['length']?_0x3b91bd['attributes']:_0x30fe9a[_0x5799('0x33')];_0x3b91bd[_0x5799('0x3c')]=qs['sort'](_0x84620f[_0x5799('0x34')][_0x5799('0x3d')]);_0x3b91bd[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0x84620f['query'],_0x30fe9a['filters']));if(_0x84620f['query'][_0x5799('0x43')]){_0x3b91bd[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x3b91bd[_0x5799('0x3e')],{'$or':_[_0x5799('0x5b')](_0x3b91bd[_0x5799('0x38')],function(_0xfd92fc){var _0x1c0757={};_0x1c0757[_0xfd92fc]={'$like':'%'+_0x84620f[_0x5799('0x34')]['filter']+'%'};return _0x1c0757;})});}_0x3b91bd=_[_0x5799('0x40')]({},_0x3b91bd,_0x84620f[_0x5799('0x62')]);return _0x5cd74e[_0x5799('0x105')](_0x3b91bd);}})[_0x5799('0x15')](function(_0x326d96){if(_0x326d96){_0x470e42=_0x326d96[_0x5799('0x4c')];if(!_0x84620f[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x3b91bd[_0x5799('0x25')]=qs['limit'](_0x84620f[_0x5799('0x34')][_0x5799('0x25')]);_0x3b91bd[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x84620f[_0x5799('0x34')][_0x5799('0x27')]);}return _0x5cd74e[_0x5799('0x105')](_0x3b91bd);}})[_0x5799('0x15')](function(_0x4041dc){if(_0x4041dc){return _0x4041dc?{'count':_0x470e42,'rows':_0x4041dc}:null;}})[_0x5799('0x15')](respondWithResult(_0x5435d0,null))[_0x5799('0x1f')](handleError(_0x5435d0,null));};exports['getFields']=function(_0x8846b,_0x58f6a){var _0x306764=_0x8846b[_0x5799('0x34')][_0x5799('0x122')]===_0x5799('0x123')?_0x5799('0x124'):_0x5799('0x125');return db[_0x5799('0x44')]['find']({'attributes':['id',_0x306764],'where':{'id':_0x8846b[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x58f6a,null))[_0x5799('0x15')](function(_0x399523){if(_0x399523){var _0x4f5960=_0x399523[_0x306764];var _0x40def1=_0x4f5960&&_0x4f5960[_0x5799('0x126')]?_0x4f5960[_0x5799('0x126')]:[];_0x58f6a[_0x5799('0x2e')]({'fromKey':_['isNil'](_0x4f5960['fromKey'])?undefined:_0x4f5960[_0x5799('0x127')],'count':_0x40def1[_0x5799('0x4c')],'rows':_0x40def1});}})['catch'](handleError(_0x58f6a,null));};exports[_0x5799('0x128')]=function(_0x5c200e,_0x5bb9e0){var _0x474094={'raw':![],'where':{}};var _0x55fb2c={};var _0x1faa8e={'count':0x0,'rows':[]};return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x5c200e['params']['id']}})['then'](handleEntityNotFound(_0x5bb9e0,null))[_0x5799('0x15')](function(_0x240149){if(_0x240149){_0x55fb2c['model']=_[_0x5799('0x35')](db[_0x5799('0x129')][_0x5799('0x30')]);_0x55fb2c['query']=_['keys'](_0x5c200e['query']);_0x55fb2c[_0x5799('0x36')]=_[_0x5799('0x37')](_0x55fb2c[_0x5799('0x33')],_0x55fb2c[_0x5799('0x34')]);_0x474094[_0x5799('0x38')]=_['intersection'](_0x55fb2c[_0x5799('0x33')],qs[_0x5799('0x39')](_0x5c200e['query'][_0x5799('0x39')]));_0x474094[_0x5799('0x38')]=_0x474094['attributes'][_0x5799('0x4c')]?_0x474094[_0x5799('0x38')]:_0x55fb2c[_0x5799('0x33')];if(!_0x5c200e[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x474094['limit']=qs['limit'](_0x5c200e[_0x5799('0x34')][_0x5799('0x25')]);_0x474094[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x5c200e['query'][_0x5799('0x27')]);}_0x474094[_0x5799('0x3c')]=qs['sort'](_0x5c200e[_0x5799('0x34')][_0x5799('0x3d')]);_0x474094['where']=qs['filters'](_[_0x5799('0x3f')](_0x5c200e[_0x5799('0x34')],_0x55fb2c[_0x5799('0x36')]));_0x474094['where']['ChatWebsiteId']=_0x240149['id'];if(_0x5c200e['query'][_0x5799('0x43')]){_0x474094[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x474094['where'],{'$or':_[_0x5799('0x5b')](_0x474094[_0x5799('0x38')],function(_0x510fed){var _0x259aed={};_0x259aed[_0x510fed]={'$like':'%'+_0x5c200e['query'][_0x5799('0x43')]+'%'};return _0x259aed;})});}_0x474094=_[_0x5799('0x40')]({},_0x474094,_0x5c200e['options']);return db[_0x5799('0x129')][_0x5799('0x26')]({'where':_0x474094[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x4f2867){_0x1faa8e[_0x5799('0x26')]=_0x4f2867;if(_0x5c200e[_0x5799('0x34')]['includeAll']){_0x474094[_0x5799('0x46')]=[{'all':!![]}];}else{_0x474094[_0x5799('0x46')]=[{'model':db[_0x5799('0x83')],'as':_0x5799('0xf0'),'required':![]},{'model':db['Attachment'],'as':_0x5799('0x12a'),'required':![]}];}return db[_0x5799('0x129')][_0x5799('0x47')](_0x474094);})[_0x5799('0x15')](function(_0x1e8a43){_0x1faa8e['rows']=_0x1e8a43;return _0x1faa8e;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x5bb9e0,_0x474094))['catch'](handleError(_0x5bb9e0,null));};exports['addAgents']=function(_0x4bdf95,_0x349466){return db['ChatWebsite'][_0x5799('0x4d')]({'where':{'id':_0x4bdf95[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x349466,null))[_0x5799('0x15')](function(_0x458eec){if(_0x458eec){return _0x458eec[_0x5799('0x12b')](_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')],_[_0x5799('0x120')](_0x4bdf95['body'],[_0x5799('0x5e'),'id'])||{})[_0x5799('0xb3')](function(_0x22e2a6){for(var _0x411214=0x0;_0x411214<_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')][_0x5799('0x4c')];_0x411214+=0x1){socket[_0x5799('0x12c')](_0x5799('0x12d'),{'UserId':Number(_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')][_0x411214]),'ChatWebsiteId':Number(_0x4bdf95[_0x5799('0x49')]['id'])});}return _0x22e2a6;});}})[_0x5799('0x15')](respondWithResult(_0x349466,null))[_0x5799('0x1f')](handleError(_0x349466,null));};exports[_0x5799('0x12e')]=function(_0x1a4bd0,_0x59671f){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x1a4bd0[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x59671f,null))[_0x5799('0x15')](function(_0x3f1fa6){if(_0x3f1fa6){return _0x3f1fa6[_0x5799('0x12e')](_0x1a4bd0['query'][_0x5799('0x5e')])['then'](function(){if(_[_0x5799('0x12f')](_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')])){for(var _0x5cc814=0x0;_0x5cc814<_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')][_0x5799('0x4c')];_0x5cc814+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x1a4bd0['query'][_0x5799('0x5e')][_0x5cc814]),'ChatWebsiteId':Number(_0x1a4bd0[_0x5799('0x49')]['id'])});}}else{socket[_0x5799('0x12c')](_0x5799('0x130'),{'UserId':Number(_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')]),'ChatWebsiteId':Number(_0x1a4bd0[_0x5799('0x49')]['id'])});}});}})[_0x5799('0x15')](respondWithStatusCode(_0x59671f,null))[_0x5799('0x1f')](handleError(_0x59671f,null));};exports['getAgents']=function(_0x476203,_0x195019){var _0x49f68e={};var _0xe930d={};var _0x1cc0a2;var _0x22af4f;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x476203[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x195019,null))[_0x5799('0x15')](function(_0x18601c){if(_0x18601c){_0x1cc0a2=_0x18601c;_0xe930d[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0xbf')]['rawAttributes']);_0xe930d[_0x5799('0x34')]=_[_0x5799('0x35')](_0x476203[_0x5799('0x34')]);_0xe930d[_0x5799('0x36')]=_['intersection'](_0xe930d[_0x5799('0x33')],_0xe930d[_0x5799('0x34')]);_0x49f68e[_0x5799('0x38')]=_[_0x5799('0x37')](_0xe930d[_0x5799('0x33')],qs[_0x5799('0x39')](_0x476203[_0x5799('0x34')][_0x5799('0x39')]));_0x49f68e['attributes']=_0x49f68e[_0x5799('0x38')]['length']?_0x49f68e[_0x5799('0x38')]:_0xe930d[_0x5799('0x33')];_0x49f68e['order']=qs[_0x5799('0x3d')](_0x476203[_0x5799('0x34')]['sort']);_0x49f68e[_0x5799('0x3e')]=qs['filters'](_[_0x5799('0x3f')](_0x476203[_0x5799('0x34')],_0xe930d[_0x5799('0x36')]));if(_0x476203[_0x5799('0x34')][_0x5799('0x43')]){_0x49f68e['where']=_[_0x5799('0x40')](_0x49f68e[_0x5799('0x3e')],{'$or':_['map'](_0x49f68e[_0x5799('0x38')],function(_0x5a37b0){var _0x15f6da={};_0x15f6da[_0x5a37b0]={'$like':'%'+_0x476203[_0x5799('0x34')]['filter']+'%'};return _0x15f6da;})});}_0x49f68e=_['merge']({},_0x49f68e,_0x476203[_0x5799('0x62')]);return _0x1cc0a2[_0x5799('0x131')](_0x49f68e);}})[_0x5799('0x15')](function(_0x38d572){if(_0x38d572){_0x22af4f=_0x38d572['length'];if(!_0x476203['query'][_0x5799('0x3a')](_0x5799('0x3b'))){_0x49f68e[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x476203[_0x5799('0x34')][_0x5799('0x25')]);_0x49f68e['offset']=qs['offset'](_0x476203[_0x5799('0x34')]['offset']);}return _0x1cc0a2['getAgents'](_0x49f68e);}})['then'](function(_0x583e36){if(_0x583e36){return _0x583e36?{'count':_0x22af4f,'rows':_0x583e36}:null;}})[_0x5799('0x15')](respondWithResult(_0x195019,null))[_0x5799('0x1f')](handleError(_0x195019,null));};
\ No newline at end of file
+var _0xfb7c=['account','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','Interval','Intervals','virtual','License','chatLicenseExceeded','push','some','server/files/chat/iframe.ejs','connection','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','findOne','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','name','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','Pause','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','describe','addDisposition','getDispositions','Disposition','sort','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc'];(function(_0xe57328,_0x2b94c3){var _0x528ed5=function(_0x4f0c12){while(--_0x4f0c12){_0xe57328['push'](_0xe57328['shift']());}};_0x528ed5(++_0x2b94c3);}(_0xfb7c,0x1af));var _0xcfb7=function(_0x50c17f,_0x55236e){_0x50c17f=_0x50c17f-0x0;var _0x4a11b3=_0xfb7c[_0x50c17f];return _0x4a11b3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcfb7('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xcfb7('0x1'));var fs=require('fs');var fs_extra=require(_0xcfb7('0x2'));var _=require(_0xcfb7('0x3'));var querystring=require(_0xcfb7('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xcfb7('0x5'))(_0xcfb7('0x6'));var config=require(_0xcfb7('0x7'));var db=require(_0xcfb7('0x8'))['db'];config[_0xcfb7('0x9')]=_[_0xcfb7('0xa')](config[_0xcfb7('0x9')],{'host':_0xcfb7('0xb'),'port':0x18eb});var socket=require(_0xcfb7('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xcfb7('0xd')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0xcfb7('0xe')][_0xcfb7('0xf')]({'port':0x232c});var client9002=jayson[_0xcfb7('0xe')]['http']({'port':0x232a});var client9003=jayson[_0xcfb7('0xe')][_0xcfb7('0xf')]({'port':0x232b});var client9001=jayson['client'][_0xcfb7('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x1fb9d4,_0x17866a,_0x8e1a2c,_0x17ca94){return new BPromise(function(_0x5afd27,_0xb4ef85){var _0x45f8a1=_0x17ca94||client;return _0x45f8a1['request'](_0x1fb9d4,_0x8e1a2c)[_0xcfb7('0x10')](function(_0xa1ec5e){logger['info'](_0xcfb7('0x11'),_0x17866a,_0xcfb7('0x12'));logger[_0xcfb7('0x13')](_0xcfb7('0x14'),_0x17866a,_0xcfb7('0x12'),JSON[_0xcfb7('0x15')](_0xa1ec5e));if(_0xa1ec5e[_0xcfb7('0x16')]){if(_0xa1ec5e[_0xcfb7('0x16')]['code']===0x1f4){logger[_0xcfb7('0x16')](_0xcfb7('0x11'),_0x17866a,_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);return _0xb4ef85(_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);}logger['error'](_0xcfb7('0x11'),_0x17866a,_0xa1ec5e['error'][_0xcfb7('0x17')]);return _0x5afd27(_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);}else{logger['info'](_0xcfb7('0x11'),_0x17866a,_0xcfb7('0x12'));_0x5afd27(_0xa1ec5e['result'][_0xcfb7('0x17')]);}})[_0xcfb7('0x18')](function(_0x54afc9){logger[_0xcfb7('0x16')](_0xcfb7('0x11'),_0x17866a,_0x54afc9);_0xb4ef85(_0x54afc9);});});}function respondWithStatusCode(_0x266384,_0x4dac7c){_0x4dac7c=_0x4dac7c||0xcc;return function(_0x587eac){if(_0x587eac){return _0x266384[_0xcfb7('0x19')](_0x4dac7c);}return _0x266384[_0xcfb7('0x1a')](_0x4dac7c)[_0xcfb7('0x1b')]();};}function respondWithResult(_0x3515ea,_0x4afbe0){_0x4afbe0=_0x4afbe0||0xc8;return function(_0x3c2a0e){if(_0x3c2a0e){return _0x3515ea[_0xcfb7('0x1a')](_0x4afbe0)[_0xcfb7('0x1c')](_0x3c2a0e);}};}function respondWithFilteredResult(_0x17f524,_0x1c5e97){return function(_0x2bd1bb){if(_0x2bd1bb){var _0x239c74=typeof _0x1c5e97[_0xcfb7('0x1d')]==='undefined'&&typeof _0x1c5e97[_0xcfb7('0x1e')]===_0xcfb7('0x1f');var _0x259e73=_0x2bd1bb[_0xcfb7('0x20')];var _0x2d1896=_0x239c74?0x0:_0x1c5e97[_0xcfb7('0x1d')];var _0xb8816c=_0x239c74?_0x2bd1bb[_0xcfb7('0x20')]:_0x1c5e97['offset']+_0x1c5e97[_0xcfb7('0x1e')];var _0x1e6bdd;if(_0xb8816c>=_0x259e73){_0xb8816c=_0x259e73;_0x1e6bdd=0xc8;}else{_0x1e6bdd=0xce;}_0x17f524[_0xcfb7('0x1a')](_0x1e6bdd);return _0x17f524[_0xcfb7('0x21')](_0xcfb7('0x22'),_0x2d1896+'-'+_0xb8816c+'/'+_0x259e73)[_0xcfb7('0x1c')](_0x2bd1bb);}return null;};}function saveUpdates(_0x5757fe){return function(_0x27461b){if(_0x27461b){return _0x27461b[_0xcfb7('0x23')](_0x5757fe)[_0xcfb7('0x10')](function(_0x170a05){return _0x170a05;});}return null;};}function removeEntity(_0x37b4c9){return function(_0x1350ef){if(_0x1350ef){return _0x1350ef[_0xcfb7('0x24')]()['then'](function(){var _0x523013=_0x1350ef[_0xcfb7('0x25')]({'plain':!![]});var _0x5d1998=_0xcfb7('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d1998,'resourceId':_0x523013['id']}})['then'](function(){return _0x1350ef;});})[_0xcfb7('0x10')](function(){_0x37b4c9[_0xcfb7('0x1a')](0xcc)[_0xcfb7('0x1b')]();});}};}function handleEntityNotFound(_0x220853){return function(_0x2b9566){if(!_0x2b9566){_0x220853[_0xcfb7('0x19')](0x194);}return _0x2b9566;};}function handleError(_0xc6bb96,_0x2380cb){_0x2380cb=_0x2380cb||0x1f4;return function(_0x130053){logger[_0xcfb7('0x16')](_0x130053['stack']);if(_0x130053['name']){delete _0x130053[_0xcfb7('0x27')];}_0xc6bb96[_0xcfb7('0x1a')](_0x2380cb)['send'](_0x130053);};}exports['index']=function(_0x4e27c5,_0x5052be){var _0x2ef97e={'include':[{'model':db['Pause'],'as':_0xcfb7('0x28')}]},_0x30685d={},_0x3998b7={'count':0x0,'rows':[]};var _0x5513da=_['map'](db[_0xcfb7('0x29')]['rawAttributes'],function(_0x3cdb0d){return{'name':_0x3cdb0d[_0xcfb7('0x2a')],'type':_0x3cdb0d[_0xcfb7('0x2b')][_0xcfb7('0x2c')]};});_0x30685d[_0xcfb7('0x2d')]=_[_0xcfb7('0x2e')](_0x5513da,_0xcfb7('0x27'));_0x30685d['query']=_['keys'](_0x4e27c5['query']);_0x30685d[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x30685d[_0xcfb7('0x2d')],_0x30685d[_0xcfb7('0x31')]);_0x2ef97e['attributes']=_['intersection'](_0x30685d[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4e27c5['query'][_0xcfb7('0x32')]));_0x2ef97e[_0xcfb7('0x33')]=_0x2ef97e[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x2ef97e[_0xcfb7('0x33')]:_0x30685d['model'];if(!_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x2ef97e[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x4e27c5['query'][_0xcfb7('0x1e')]);_0x2ef97e[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x2ef97e[_0xcfb7('0x37')]=qs['sort'](_0x4e27c5[_0xcfb7('0x31')]['sort']);_0x2ef97e[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x4e27c5[_0xcfb7('0x31')],_0x30685d[_0xcfb7('0x2f')]),_0x5513da);if(_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x2ef97e['where']=_[_0xcfb7('0x3b')](_0x2ef97e['where'],{'$or':_[_0xcfb7('0x2e')](_0x5513da,function(_0x3d6c96){if(_0x3d6c96[_0xcfb7('0x2b')]!==_0xcfb7('0x3c')){var _0x41f64e={};_0x41f64e[_0x3d6c96[_0xcfb7('0x27')]]={'$like':'%'+_0x4e27c5['query'][_0xcfb7('0x3a')]+'%'};return _0x41f64e;}})});}_0x2ef97e=_['merge']({},_0x2ef97e,_0x4e27c5[_0xcfb7('0x3d')]);var _0x42e854={'where':_0x2ef97e[_0xcfb7('0x38')]};return db[_0xcfb7('0x29')][_0xcfb7('0x20')](_0x42e854)[_0xcfb7('0x10')](function(_0x5ba5be){_0x3998b7[_0xcfb7('0x20')]=_0x5ba5be;if(_0x4e27c5['query'][_0xcfb7('0x3e')]){_0x2ef97e['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xcfb7('0x3f')](_0x2ef97e);})[_0xcfb7('0x10')](function(_0x4de10a){_0x3998b7['rows']=_0x4de10a;return _0x3998b7;})[_0xcfb7('0x10')](respondWithFilteredResult(_0x5052be,_0x2ef97e))['catch'](handleError(_0x5052be,null));};exports[_0xcfb7('0x40')]=function(_0x4c4ff2,_0x26d304){var _0x1f0c70={'raw':![],'where':{'id':_0x4c4ff2[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x42')],'as':_0xcfb7('0x28')}]},_0x4779b3={};_0x4779b3[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatWebsite'][_0xcfb7('0x44')]);_0x4779b3[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x4c4ff2[_0xcfb7('0x31')]);_0x4779b3[_0xcfb7('0x2f')]=_['intersection'](_0x4779b3['model'],_0x4779b3['query']);_0x1f0c70['attributes']=_['intersection'](_0x4779b3[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4c4ff2[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x1f0c70['attributes']=_0x1f0c70[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x1f0c70[_0xcfb7('0x33')]:_0x4779b3[_0xcfb7('0x2d')];if(_0x4c4ff2[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x1f0c70[_0xcfb7('0x45')]=[{'all':!![]}];}_0x1f0c70=_[_0xcfb7('0x3b')]({},_0x1f0c70,_0x4c4ff2[_0xcfb7('0x3d')]);return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x1f0c70)[_0xcfb7('0x10')](handleEntityNotFound(_0x26d304,null))[_0xcfb7('0x10')](respondWithResult(_0x26d304,null))[_0xcfb7('0x18')](handleError(_0x26d304,null));};exports[_0xcfb7('0x47')]=function(_0x2963f3,_0x2297d9){return db[_0xcfb7('0x29')][_0xcfb7('0x47')](_0x2963f3[_0xcfb7('0x48')],{})['then'](function(_0x3641f1){var _0x488aec=_0x2963f3[_0xcfb7('0x49')][_0xcfb7('0x25')]({'plain':!![]});if(!_0x488aec)throw new Error(_0xcfb7('0x4a'));if(_0x488aec[_0xcfb7('0x4b')]==='user'){var _0x4fd99a=_0x3641f1['get']({'plain':!![]});var _0x5caeec=_0xcfb7('0x26');return db[_0xcfb7('0x4c')][_0xcfb7('0x46')]({'where':{'name':_0x5caeec,'userProfileId':_0x488aec[_0xcfb7('0x4d')]},'raw':!![]})['then'](function(_0x530c39){if(_0x530c39&&_0x530c39['autoAssociation']===0x0){return db[_0xcfb7('0x4e')]['create']({'name':_0x4fd99a['name'],'resourceId':_0x4fd99a['id'],'type':_0x530c39[_0xcfb7('0x27')],'sectionId':_0x530c39['id']},{})['then'](function(){return _0x3641f1;});}else{return _0x3641f1;}})['catch'](function(_0x3932a1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3932a1);throw _0x3932a1;});}return _0x3641f1;})[_0xcfb7('0x10')](respondWithResult(_0x2297d9,0xc9))[_0xcfb7('0x18')](handleError(_0x2297d9,null));};exports['update']=function(_0x304b4f,_0x5c4626){if(_0x304b4f[_0xcfb7('0x48')]['id']){delete _0x304b4f[_0xcfb7('0x48')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x304b4f[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x42')],'as':_0xcfb7('0x28')}]})['then'](handleEntityNotFound(_0x5c4626,null))[_0xcfb7('0x10')](saveUpdates(_0x304b4f[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x5c4626,null))['catch'](handleError(_0x5c4626,null));};exports[_0xcfb7('0x24')]=function(_0x414816,_0x363050){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x414816[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x363050,null))['then'](removeEntity(_0x363050,null))['catch'](handleError(_0x363050,null));};exports[_0xcfb7('0x4f')]=function(_0x5eafa7,_0x5bc4a6){return db[_0xcfb7('0x29')][_0xcfb7('0x4f')]()[_0xcfb7('0x10')](respondWithResult(_0x5bc4a6,null))[_0xcfb7('0x18')](handleError(_0x5bc4a6,null));};exports[_0xcfb7('0x50')]=function(_0x33472d,_0x38760){if(_0x33472d[_0xcfb7('0x48')]['id']){delete _0x33472d[_0xcfb7('0x48')]['id'];}return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x33472d[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x38760,null))[_0xcfb7('0x10')](function(_0x1fa1c1){if(_0x1fa1c1){_0x33472d[_0xcfb7('0x48')]['ChatWebsiteId']=_0x1fa1c1['id'];return db['Disposition'][_0xcfb7('0x47')](_0x33472d[_0xcfb7('0x48')]);}})[_0xcfb7('0x10')](respondWithResult(_0x38760,null))[_0xcfb7('0x18')](handleError(_0x38760,null));};exports[_0xcfb7('0x51')]=function(_0x4917b3,_0x51ae83){var _0x34c1fe={'raw':![],'where':{}};var _0x12b38a={};var _0x208313={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x4917b3['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x51ae83,null))[_0xcfb7('0x10')](function(_0x46e485){if(_0x46e485){_0x12b38a['model']=_[_0xcfb7('0x43')](db[_0xcfb7('0x52')][_0xcfb7('0x44')]);_0x12b38a[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x4917b3[_0xcfb7('0x31')]);_0x12b38a[_0xcfb7('0x2f')]=_['intersection'](_0x12b38a[_0xcfb7('0x2d')],_0x12b38a['query']);_0x34c1fe['attributes']=_[_0xcfb7('0x30')](_0x12b38a[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x34c1fe[_0xcfb7('0x33')]=_0x34c1fe[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x34c1fe[_0xcfb7('0x33')]:_0x12b38a[_0xcfb7('0x2d')];if(!_0x4917b3['query']['hasOwnProperty']('nolimit')){_0x34c1fe['limit']=qs['limit'](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x34c1fe[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x34c1fe[_0xcfb7('0x37')]=qs['sort'](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x34c1fe[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x4917b3['query'],_0x12b38a[_0xcfb7('0x2f')]));_0x34c1fe[_0xcfb7('0x38')][_0xcfb7('0x54')]=_0x46e485['id'];if(_0x4917b3[_0xcfb7('0x31')]['filter']){_0x34c1fe[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x34c1fe[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x34c1fe[_0xcfb7('0x33')],function(_0xffc865){var _0x4dead3={};_0x4dead3[_0xffc865]={'$like':'%'+_0x4917b3['query'][_0xcfb7('0x3a')]+'%'};return _0x4dead3;})});}_0x34c1fe=_[_0xcfb7('0x3b')]({},_0x34c1fe,_0x4917b3[_0xcfb7('0x3d')]);return db[_0xcfb7('0x52')][_0xcfb7('0x20')]({'where':_0x34c1fe[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x49f772){_0x208313['count']=_0x49f772;if(_0x4917b3['query'][_0xcfb7('0x3e')]){_0x34c1fe[_0xcfb7('0x45')]=[{'all':!![]}];}return db[_0xcfb7('0x52')][_0xcfb7('0x3f')](_0x34c1fe);})[_0xcfb7('0x10')](function(_0x18f466){_0x208313[_0xcfb7('0x55')]=_0x18f466;return _0x208313;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x51ae83,_0x34c1fe))[_0xcfb7('0x18')](handleError(_0x51ae83,null));};exports[_0xcfb7('0x56')]=function(_0x41a97b,_0x385527){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x41a97b[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x385527,null))['then'](function(_0x2676a6){if(_0x2676a6){return _0x2676a6['removeDispositions'](_0x41a97b['query'][_0xcfb7('0x57')]);}})[_0xcfb7('0x10')](respondWithStatusCode(_0x385527,null))[_0xcfb7('0x18')](handleError(_0x385527,null));};exports[_0xcfb7('0x58')]=function(_0x42c21a,_0x5b5b2a){if(_0x42c21a[_0xcfb7('0x48')]['id']){delete _0x42c21a[_0xcfb7('0x48')]['id'];}return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x42c21a[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x5b5b2a,null))[_0xcfb7('0x10')](function(_0x517c8f){if(_0x517c8f){_0x42c21a[_0xcfb7('0x48')][_0xcfb7('0x54')]=_0x517c8f['id'];return db[_0xcfb7('0x59')]['create'](_0x42c21a[_0xcfb7('0x48')]);}})[_0xcfb7('0x10')](respondWithResult(_0x5b5b2a,null))[_0xcfb7('0x18')](handleError(_0x5b5b2a,null));};exports[_0xcfb7('0x5a')]=function(_0x2e2821,_0x292e3f){var _0x4be235={'raw':![],'where':{}};var _0x179945={};var _0x4550d9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2e2821[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x292e3f,null))[_0xcfb7('0x10')](function(_0x54a3b2){if(_0x54a3b2){_0x179945[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0x59')][_0xcfb7('0x44')]);_0x179945[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x2e2821[_0xcfb7('0x31')]);_0x179945['filters']=_['intersection'](_0x179945[_0xcfb7('0x2d')],_0x179945[_0xcfb7('0x31')]);_0x4be235['attributes']=_[_0xcfb7('0x30')](_0x179945[_0xcfb7('0x2d')],qs['fields'](_0x2e2821['query']['fields']));_0x4be235[_0xcfb7('0x33')]=_0x4be235[_0xcfb7('0x33')]['length']?_0x4be235['attributes']:_0x179945[_0xcfb7('0x2d')];if(!_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x4be235[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x2e2821['query'][_0xcfb7('0x1e')]);_0x4be235['offset']=qs[_0xcfb7('0x1d')](_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x4be235[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x4be235[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_['pick'](_0x2e2821[_0xcfb7('0x31')],_0x179945['filters']));_0x4be235[_0xcfb7('0x38')][_0xcfb7('0x54')]=_0x54a3b2['id'];if(_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x4be235[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x4be235['where'],{'$or':_['map'](_0x4be235[_0xcfb7('0x33')],function(_0x457192){var _0x47eacf={};_0x47eacf[_0x457192]={'$like':'%'+_0x2e2821['query'][_0xcfb7('0x3a')]+'%'};return _0x47eacf;})});}_0x4be235=_[_0xcfb7('0x3b')]({},_0x4be235,_0x2e2821[_0xcfb7('0x3d')]);return db[_0xcfb7('0x59')][_0xcfb7('0x20')]({'where':_0x4be235[_0xcfb7('0x38')]})['then'](function(_0x498b76){_0x4550d9['count']=_0x498b76;if(_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x4be235['include']=[{'all':!![]}];}return db[_0xcfb7('0x59')][_0xcfb7('0x3f')](_0x4be235);})[_0xcfb7('0x10')](function(_0x12686d){_0x4550d9[_0xcfb7('0x55')]=_0x12686d;return _0x4550d9;});}})['then'](respondWithFilteredResult(_0x292e3f,_0x4be235))[_0xcfb7('0x18')](handleError(_0x292e3f,null));};exports[_0xcfb7('0x5b')]=function(_0x5d2c9c,_0x218fad){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5d2c9c[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x218fad,null))['then'](function(_0x3f9d4e){if(_0x3f9d4e){return _0x3f9d4e[_0xcfb7('0x5b')](_0x5d2c9c[_0xcfb7('0x31')]['ids']);}})['then'](respondWithStatusCode(_0x218fad,null))[_0xcfb7('0x18')](handleError(_0x218fad,null));};exports['addLogo']=function(_0xae157f,_0x20ee69){_0xae157f['body'][_0xcfb7('0x5c')]=_0xae157f[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db['ChatWebsite'][_0xcfb7('0x46')]({'where':{'id':_0xae157f['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x20ee69,null))[_0xcfb7('0x10')](saveUpdates(_0xae157f[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x20ee69,null))[_0xcfb7('0x18')](handleError(_0x20ee69,null));};exports['addAvatar']=function(_0x257190,_0x274353){_0x257190[_0xcfb7('0x48')][_0xcfb7('0x5f')]=_0x257190[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x257190[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x274353,null))[_0xcfb7('0x10')](saveUpdates(_0x257190['body'],null))[_0xcfb7('0x10')](respondWithResult(_0x274353,null))[_0xcfb7('0x18')](handleError(_0x274353,null));};exports[_0xcfb7('0x60')]=function(_0x535f6d,_0x44c16f){_0x535f6d[_0xcfb7('0x48')][_0xcfb7('0x61')]=_0x535f6d[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db['ChatWebsite'][_0xcfb7('0x46')]({'where':{'id':_0x535f6d[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x44c16f,null))[_0xcfb7('0x10')](saveUpdates(_0x535f6d[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x44c16f,null))[_0xcfb7('0x18')](handleError(_0x44c16f,null));};exports[_0xcfb7('0x62')]=function(_0x4243b0,_0x2580ae){_0x4243b0[_0xcfb7('0x48')]['systemAvatar']=_0x4243b0['file']['filename'];return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x4243b0[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2580ae,null))['then'](saveUpdates(_0x4243b0[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x2580ae,null))['catch'](handleError(_0x2580ae,null));};exports[_0xcfb7('0x63')]=function(_0xb1bbc,_0x3d8bec){var _0x3e595a=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x66'));var _0x2bf518={'where':{'id':_0xb1bbc['params']['id']},'attributes':['id',_0xcfb7('0x5c')],'raw':!![]};var _0x4f1568=![];return require(_0xcfb7('0x67'))['getLicense']()[_0xcfb7('0x10')](function(_0x308bb0){if(_0x308bb0){_0x4f1568=_0x308bb0[_0xcfb7('0x68')];}})['then'](function(){return db['ChatWebsite']['find'](_0x2bf518);})[_0xcfb7('0x10')](handleEntityNotFound(_0x3d8bec,null))[_0xcfb7('0x10')](function(_0x31af09){if(_0x31af09){if(!_[_0xcfb7('0x69')](_0x31af09[_0xcfb7('0x5c')])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/logos/',_0x31af09['sitepic']))&&_0x4f1568){_0x3e595a=path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x6a'),_0x31af09[_0xcfb7('0x5c')]);}}return _0x3d8bec[_0xcfb7('0x6b')](_0x3e595a);}})[_0xcfb7('0x18')](handleError(_0x3d8bec,null));};exports[_0xcfb7('0x6c')]=function(_0xc6c2da,_0xa39b5e){var _0x3fa35e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6d'));var _0x5c6827={'where':{'id':_0xc6c2da[_0xcfb7('0x41')]['id']},'attributes':['id',_0xcfb7('0x5f')],'raw':!![]};return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x5c6827)['then'](handleEntityNotFound(_0xa39b5e,null))[_0xcfb7('0x10')](function(_0x13f498){if(_0x13f498){if(!_['isNil'](_0x13f498[_0xcfb7('0x5f')])){if(fs['existsSync'](path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x6e'),_0x13f498[_0xcfb7('0x5f')]))){_0x3fa35e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x13f498['agentAvatar']);}}return _0xa39b5e['download'](_0x3fa35e);}})[_0xcfb7('0x18')](handleError(_0xa39b5e,null));};exports[_0xcfb7('0x6f')]=function(_0x382e6b,_0xa1dbf6){var _0x5ddb31=path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x70'));var _0x50db96={'where':{'id':_0x382e6b['params']['id']},'attributes':['id',_0xcfb7('0x61'),_0xcfb7('0x71')],'raw':!![]};return db[_0xcfb7('0x29')]['find'](_0x50db96)[_0xcfb7('0x10')](handleEntityNotFound(_0xa1dbf6,null))[_0xcfb7('0x10')](function(_0x54f11f){if(_0x54f11f){if(!_[_0xcfb7('0x69')](_0x54f11f['customerAvatar'])){if(fs[_0xcfb7('0x72')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x54f11f['customerAvatar']))&&_0x54f11f['showCustomerAvatar']){_0x5ddb31=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x54f11f['customerAvatar']);}}return _0xa1dbf6['download'](_0x5ddb31);}})[_0xcfb7('0x18')](handleError(_0xa1dbf6,null));};exports[_0xcfb7('0x73')]=function(_0x57f262,_0x3471f5){var _0x22fa0a=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x74'));var _0x32b42e={'where':{'id':_0x57f262[_0xcfb7('0x41')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x32b42e)['then'](handleEntityNotFound(_0x3471f5,null))[_0xcfb7('0x10')](function(_0x1a8db7){if(_0x1a8db7){if(!_['isNil'](_0x1a8db7[_0xcfb7('0x75')])){if(fs[_0xcfb7('0x72')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],'server/files/images/avatars/',_0x1a8db7['systemAvatar']))){_0x22fa0a=path[_0xcfb7('0x64')](config['root'],'server/files/images/avatars/',_0x1a8db7[_0xcfb7('0x75')]);}}return _0x3471f5[_0xcfb7('0x6b')](_0x22fa0a);}})[_0xcfb7('0x18')](handleError(_0x3471f5,null));};exports[_0xcfb7('0x76')]=function(_0x4d1ff8,_0x2800f0){var _0x4884d8=require(_0xcfb7('0x77'));var _0x4fbb97=new _0x4884d8();var _0x5ca520=_0x4fbb97[_0xcfb7('0x78')](_0x4d1ff8[_0xcfb7('0x79')]['user-agent'])[_0xcfb7('0x7a')]();var _0x5b2f5a={'body':_0x4d1ff8[_0xcfb7('0x48')],'channel':_0xcfb7('0x7b')};var _0x4c976b=[];var _0x33c229=[];var _0x2b8533={};var _0x29efee=![];return db[_0xcfb7('0x7c')]['describe']()[_0xcfb7('0x10')](function(_0x50c468){if(!_0x50c468){throw new db['Sequelize'][(_0xcfb7('0x7d'))]('no\x20available\x20attributes');}_0x4c976b=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x50c468),[_0xcfb7('0x7f'),_0xcfb7('0x80')]);_0x33c229=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x50c468),['createdAt',_0xcfb7('0x80'),'CompanyId',_0xcfb7('0x81')]);if(_0x4d1ff8[_0xcfb7('0x48')]['id']){delete _0x4d1ff8[_0xcfb7('0x48')]['id'];}if(_[_0xcfb7('0x69')](_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')])){throw new db['Sequelize'][(_0xcfb7('0x7d'))]('from\x20is\x20mandatory');}if(_[_0xcfb7('0x69')](_0x4d1ff8[_0xcfb7('0x48')]['body'])||_0x4d1ff8[_0xcfb7('0x48')]['body']===''){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x84'));}if(_[_0xcfb7('0x69')](_0x4d1ff8['body'][_0xcfb7('0x85')])){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x86')+_0x33c229);}if(!_[_0xcfb7('0x87')](_0x33c229,_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x85')])){throw new db[(_0xcfb7('0x83'))]['ValidationError'](_0xcfb7('0x88')+_0x33c229);}_0x2b8533[_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x85')]]=_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4d1ff8[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x89')],'as':_0xcfb7('0x8a'),'include':[{'model':db['CmContact'],'as':_0xcfb7('0x8b'),'where':_0x2b8533,'limit':0x1,'order':[[_0xcfb7('0x80'),_0xcfb7('0x8c')]]}]},{'model':db[_0xcfb7('0x8d')],'as':_0xcfb7('0x8e')}]});})[_0xcfb7('0x10')](handleEntityNotFound(_0x2800f0,null))['then'](function(_0x2adae9){if(_0x2adae9&&_0x2adae9['List']){_0x5b2f5a['account']=_0x2adae9;_0x5b2f5a[_0xcfb7('0x8f')]=_0x2adae9[_0xcfb7('0x8e')];_0x5b2f5a[_0xcfb7('0x90')]=_0x2adae9['List'];_0x5b2f5a[_0xcfb7('0x8f')]=_[_0xcfb7('0x91')](_0x5b2f5a[_0xcfb7('0x8f')],['priority'],[_0xcfb7('0x92')]);if(_0x5b2f5a[_0xcfb7('0x93')]['Applications']){delete _0x5b2f5a['account'][_0xcfb7('0x8e')];}if(_0x5b2f5a[_0xcfb7('0x93')]['List']&&_0x5b2f5a['account'][_0xcfb7('0x8a')][_0xcfb7('0x8b')][_0xcfb7('0x34')]){return _0x5b2f5a['account'][_0xcfb7('0x8a')][_0xcfb7('0x8b')][0x0];}var _0x25797c=_[_0xcfb7('0xa')](_0x4d1ff8[_0xcfb7('0x48')],{'firstName':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')],'ListId':_0x2adae9['ListId']});_0x25797c[_0x4d1ff8['body']['mapKey']]=_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')];return db['CmContact']['create'](_0x25797c,{'fields':_0x4c976b,'raw':!![]});}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2800f0,null))[_0xcfb7('0x10')](function(_0x57efd4){_0x5b2f5a['contact']=_0x57efd4;var _0x1165be=_0x4d1ff8['body']['customerIp'];if(_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x94')]){_0x1165be=_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x94')];}else if(_0x4d1ff8['headers'][_0xcfb7('0x95')]){_0x1165be=_['first'](_0x4d1ff8['headers']['x-forwarded-for']['split'](','));}if(_0x57efd4){var _0x8f276d={'ContactId':_0x57efd4['id'],'ChatWebsiteId':_0x4d1ff8['params']['id'],'from':(_0x57efd4['firstName']||'')+'\x20'+(_0x57efd4[_0xcfb7('0x96')]||''),'customerIp':_0x1165be,'customerPort':_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x97')]?_0x4d1ff8[_0xcfb7('0x79')]['x-real-port']:null,'referer':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x98')],'browserName':_0x5ca520['browser'][_0xcfb7('0x27')]&&_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x9a')]?util[_0xcfb7('0x9b')](_0xcfb7('0x9c'),_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x27')],_0x5ca520[_0xcfb7('0x99')]['version']):'unknown','browserVersion':_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x9a')]||_0xcfb7('0x9d'),'osName':util['format']('%s\x20%s',_0x5ca520['os']['name'],_0x5ca520['os'][_0xcfb7('0x9a')]),'osVersion':_0x5ca520['os'][_0xcfb7('0x9a')],'deviceModel':_0x5ca520[_0xcfb7('0x9e')][_0xcfb7('0x2d')]&&_0x5ca520['device'][_0xcfb7('0x9f')]?util['format'](_0xcfb7('0xa0'),_0x5ca520['device'][_0xcfb7('0x2d')],_0x5ca520[_0xcfb7('0x9e')][_0xcfb7('0x9f')],_0x5ca520['device']['type']):null,'deviceVendor':_0x5ca520[_0xcfb7('0x9e')]['vendor'],'deviceType':_0x5ca520['device'][_0xcfb7('0x2b')],'formData':JSON['stringify'](_0x4d1ff8[_0xcfb7('0x48')])};var _0x5e071a={'ChatWebsiteId':_0x4d1ff8[_0xcfb7('0x41')]['id'],'closed':![]};if(_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa1')]){_0x5e071a[_0xcfb7('0xa1')]=_0x4d1ff8[_0xcfb7('0x48')]['threadId'];return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':_0x5e071a})[_0xcfb7('0x10')](function(_0x44e80b){if(_0x44e80b){return[_0x44e80b,![]];}_0x8f276d[_0xcfb7('0xa1')]=_0x4d1ff8[_0xcfb7('0x48')]['threadId'];_0x8f276d[_0xcfb7('0xa3')]=_0x4d1ff8['body'][_0xcfb7('0xa3')];return db[_0xcfb7('0xa2')][_0xcfb7('0x47')](_0x8f276d)[_0xcfb7('0x10')](function(_0x474d84){return[_0x474d84,!![]];});});}_0x5e071a[_0xcfb7('0xa4')]=_0x57efd4['id'];if(_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa5')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa5')]['id']){_0x5e071a['id']=_0x4d1ff8['body'][_0xcfb7('0xa5')]['id'];return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':_0x5e071a})[_0xcfb7('0x10')](function(_0x516428){if(_0x516428){return[_0x516428,![]];}return db['ChatInteraction'][_0xcfb7('0x47')](_0x8f276d)[_0xcfb7('0x10')](function(_0x41e4f5){return[_0x41e4f5,!![]];});});}return db[_0xcfb7('0xa2')]['create'](_0x8f276d)['then'](function(_0x499128){return[_0x499128,!![]];});}})[_0xcfb7('0xa6')](function(_0xf6eb3f,_0x229ffe){if(_0xf6eb3f){_0x29efee=_0x229ffe;if(!_0x229ffe){var _0x417866={'from':(_0x5b2f5a[_0xcfb7('0xa7')][_0xcfb7('0xa8')]||'')+'\x20'+(_0x5b2f5a['contact'][_0xcfb7('0x96')]||'')};if(_0x4d1ff8['body'][_0xcfb7('0xa1')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa9')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa1')]!=_0x4d1ff8['body'][_0xcfb7('0xa9')]){_0x417866['threadId']=_0x4d1ff8['body']['messageId'];}return _0xf6eb3f[_0xcfb7('0x23')](_0x417866);}else{return _0xf6eb3f;}}})['then'](function(_0x1e18ef){_0x5b2f5a[_0xcfb7('0xa5')]=_0x1e18ef['get']({'plain':!![]});_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xaa')]=_0x29efee;if(_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xaa')]){if(_0x5b2f5a[_0xcfb7('0x93')][_0xcfb7('0xab')]){_0x5b2f5a[_0xcfb7('0x8f')]['push']({'id':0x0,'priority':_0x5b2f5a[_0xcfb7('0x8f')][_0xcfb7('0x34')]+0x1,'app':_0xcfb7('0xac'),'appdata':_0xcfb7('0xad'),'interval':'*,*,*,*'});}}return db[_0xcfb7('0xae')][_0xcfb7('0x47')]({'body':_0x4d1ff8['body'][_0xcfb7('0x48')],'ChatWebsiteId':_0x4d1ff8[_0xcfb7('0x41')]['id'],'ChatInteractionId':_0x1e18ef['id'],'direction':'in','ContactId':_0x5b2f5a[_0xcfb7('0xa7')]['id'],'AttachmentId':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xaf')]});})['then'](function(_0x4f0da2){_0x5b2f5a[_0xcfb7('0x17')]=_0x4f0da2;if(_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xb0')]){return db[_0xcfb7('0xb1')][_0xcfb7('0x46')]({'attributes':['id',_0xcfb7('0x27')],'where':{'id':_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xb0')]}})[_0xcfb7('0x10')](function(_0xa1f2d6){if(_0xa1f2d6){_0x5b2f5a[_0xcfb7('0x8f')][_0xcfb7('0xb2')]({'id':0x0,'priority':0x0,'app':_0xcfb7('0xb3'),'appdata':_0xa1f2d6['name']+','+(_0x5b2f5a[_0xcfb7('0x93')][_0xcfb7('0xb4')]||0xa),'interval':_0xcfb7('0xb5')});_0x5b2f5a['forcedOwnership']=!![];}return respondWithRpcPromise(_0xcfb7('0xb6'),'startRouting',_0x5b2f5a);});}return respondWithRpcPromise(_0xcfb7('0xb6'),_0xcfb7('0xb7'),_0x5b2f5a);})[_0xcfb7('0x10')](function(_0x12a16c){respondWithRpcPromise('EventManager',_0xcfb7('0xb8'),{'event':_0xcfb7('0x76'),'message':_0x12a16c},client9002);return _0x12a16c;})[_0xcfb7('0x10')](respondWithResult(_0x2800f0,null))[_0xcfb7('0x18')](handleError(_0x2800f0,null));};exports[_0xcfb7('0xb9')]=function(_0x5462fc,_0x3d240a){var _0x20b520,_0x2d13f7,_0x448a42;var _0x1c95f2=[];var _0x30859d={};var _0x12326d=_0x5462fc[_0xcfb7('0xba')]||[];var _0x5d5fdd=[];var _0x24ac7f;return db['CmContact'][_0xcfb7('0x4f')]()[_0xcfb7('0x10')](function(_0x11748d){if(!_0x11748d){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))]('no\x20available\x20attributes');}_0x1c95f2=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x11748d),['createdAt','updatedAt',_0xcfb7('0xbb'),_0xcfb7('0x81')]);if(_0x5462fc[_0xcfb7('0x48')]['id']){delete _0x5462fc[_0xcfb7('0x48')]['id'];}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db['Sequelize'][(_0xcfb7('0x7d'))](_0xcfb7('0xbd')));}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')])||_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')]===''){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x84')));}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0xbe')])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0xbf')+_0x1c95f2));}if(!_[_0xcfb7('0x87')](_0x1c95f2,_0x5462fc['body']['mapKeyOffline'])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)['send'](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c95f2));}_0x30859d[_0x5462fc[_0xcfb7('0x48')]['mapKeyOffline']]=_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')];})['then'](function(){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5462fc[_0xcfb7('0x41')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xcfb7('0xc0')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x3d240a,null))[_0xcfb7('0x10')](function(_0x2e8e8f){if(_0x2e8e8f&&_0x2e8e8f[_0xcfb7('0x8a')]){_0x2d13f7=_0x2e8e8f;var _0x47eaee=_['defaults'](_0x5462fc[_0xcfb7('0x48')],{'firstName':_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')],'phone':_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')],'ListId':_0x2e8e8f[_0xcfb7('0x81')]});_0x47eaee[_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0xbe')]]=_0x5462fc[_0xcfb7('0x48')]['from'];return db['CmContact'][_0xcfb7('0xc1')]({'where':_0x30859d,'defaults':_0x47eaee});}})[_0xcfb7('0xa6')](function(_0xbe6ba4){if(_0xbe6ba4){_0x448a42=_0xbe6ba4;var _0x475522=fs[_0xcfb7('0xc2')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xc3')),_0xcfb7('0xc4'));var _0x1371d2=ejs[_0xcfb7('0xc5')](_0x475522,{'body':_[_0xcfb7('0xc6')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')]),'bodyTitle':_0x2d13f7['offlineMessageBody']});return db[_0xcfb7('0xc7')][_0xcfb7('0x47')]({'body':_0x1371d2,'plainBody':htmlToText[_0xcfb7('0xc8')](_0x1371d2),'ContactId':_0xbe6ba4['id'],'ChatWebsiteId':_0x2d13f7['id']});}})['then'](function(_0x30d944){_0x24ac7f=_0x30d944;if(_0x12326d[_0xcfb7('0x34')]){var _0x40684c=_0x12326d['map'](function(_0xa8321d){return{'name':_0xa8321d['originalname'],'basename':_0xa8321d[_0xcfb7('0x5e')],'type':_0xa8321d[_0xcfb7('0xc9')],'ChatOfflineMessageId':_0x30d944['id']};});_0x5d5fdd=_0x40684c[_0xcfb7('0x2e')](_0x40e3d5=>{var _0x3b766a={'filename':_0x40e3d5['name'],'path':path['join'](config[_0xcfb7('0x65')],_0xcfb7('0xca'),_0xcfb7('0xba'),'attachments','offline-chat',_0x40e3d5[_0xcfb7('0xcb')])};return _0x3b766a;});if(!_0x2d13f7[_0xcfb7('0xcc')]){return db[_0xcfb7('0xcd')][_0xcfb7('0xce')](function(_0x40f3ac){return db[_0xcfb7('0xcf')]['bulkCreate'](_0x40684c,{'transaction':_0x40f3ac});});}}})[_0xcfb7('0x10')](function(){if(_0x24ac7f){_0x20b520=_0x24ac7f;return db[_0xcfb7('0xc0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xcfb7('0xd0')],'as':_0xcfb7('0xd1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcfb7('0xd2'),'raw':!![]}]}]});}})[_0xcfb7('0x10')](function(_0x22a995){if(_0x22a995&&_0x22a995['Smtp']&&_0x2d13f7[_0xcfb7('0xd3')]&&_0x2d13f7['forwardOfflineAddress']){var _0x1cd526=_0x22a995[_0xcfb7('0xd4')]();return respondWithRpcPromise(_0xcfb7('0xd5'),_0xcfb7('0xd6'),{'account':_0x1cd526,'message':{'from':util[_0xcfb7('0x9b')](_0xcfb7('0xd7'),_0x22a995[_0xcfb7('0x27')],_0x22a995[_0xcfb7('0xd8')]||_0x22a995['Smtp']['user']),'to':_0x2d13f7[_0xcfb7('0xd9')],'subject':_0x2d13f7[_0xcfb7('0xda')],'html':_0x20b520[_0xcfb7('0x48')],'attachments':_0x5d5fdd}},client9003)[_0xcfb7('0x10')](function(){return _0x20b520;})[_0xcfb7('0x18')](function(_0x1a3961){logger['error'](_0x1a3961);});}})['then'](function(){if(_0x2d13f7&&_0x2d13f7[_0xcfb7('0xcc')]&&_0x2d13f7[_0xcfb7('0xdb')]){var _0x5a143f=[];if(_0x12326d[_0xcfb7('0x34')]){_0x5a143f=_0x12326d[_0xcfb7('0x2e')](function(_0x30a9bb){return{'name':_0x30a9bb[_0xcfb7('0xdc')],'basename':_0x30a9bb['filename'],'type':_0x30a9bb[_0xcfb7('0xc9')],'ChatOfflineMessageId':_0x24ac7f['id']};});}var _0x186b0a;if(!_[_0xcfb7('0x69')](_0x2d13f7['subjectOffline'])){var _0x3e5199=_[_0xcfb7('0x2e')](_0x5462fc[_0xcfb7('0x48')],function(_0x38e035){return _0x38e035;});var _0x2b37c9=_['toPairsIn'](_0x3e5199)[0x0];var _0x22c2d7=_[_0xcfb7('0xdd')](_0x2b37c9,function(_0x167b73){return _0x167b73;});_0x186b0a=_0x22c2d7[0x1][_0x2d13f7['subjectOffline']];}var _0x2aec6d={'from':_0x448a42[_0xcfb7('0xd8')],'firstName':_0x448a42[_0xcfb7('0xa8')],'lastName':_0x448a42[_0xcfb7('0x96')],'mapKey':_0xcfb7('0xd8'),'message':{'from':_0x448a42[_0xcfb7('0xd8')],'to':_0x2d13f7['MailAccount'][_0xcfb7('0xd8')],'cc':'','subject':_[_0xcfb7('0x69')](_0x186b0a)?_0x2d13f7['offlineMessageSubject']:_0x186b0a,'messageId':'','sentAt':new Date(),'attach':_0x5a143f[_0xcfb7('0x34')],'attachments':_0x5a143f,'originChannel':_0xcfb7('0xde'),'ChatWebsiteId':_0x2d13f7['id'],'ChatOfflineMessageId':_0x20b520['id'],'originTo':_0x2d13f7[_0xcfb7('0xc0')][_0xcfb7('0xd8')]},'body':_0x20b520[_0xcfb7('0x48')]};var _0x22257b={'account':{'id':_0x2d13f7[_0xcfb7('0xdb')]},'body':_0x2aec6d,'log':_0xcfb7('0xdf')};return respondWithRpcPromise(_0xcfb7('0xdf'),_0xcfb7('0xe0'),_0x22257b,client9001)[_0xcfb7('0x10')](function(){return _0x20b520;})[_0xcfb7('0x18')](function(_0x171fb8){logger['error'](_0x171fb8);});}return;})[_0xcfb7('0x10')](function(){if(_0x20b520){return _0x20b520;}})[_0xcfb7('0x10')](respondWithResult(_0x3d240a,null))[_0xcfb7('0x18')](function(_0x490ec2){logger[_0xcfb7('0x16')](_0xcfb7('0x18'),_0x490ec2);for(var _0x13b5f6 of _0x12326d){var _0xc4fe3e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xca'),_0xcfb7('0xba'),'attachments','offline-chat',_0x13b5f6[_0xcfb7('0x5e')]);fs_extra[_0xcfb7('0xe1')](_0xc4fe3e)[_0xcfb7('0x18')](function(_0x49c1dc){logger['error'](_0xcfb7('0xe2'),_0xc4fe3e,_0x49c1dc);});}});};exports[_0xcfb7('0xe3')]=function(_0x33b8c6,_0xd88e52){return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':{'id':_0x33b8c6[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0xd88e52,null))[_0xcfb7('0x10')](function(_0x16263d){if(_0x16263d){return _0x16263d[_0xcfb7('0xe3')](_0x33b8c6['body'][_0xcfb7('0x57')],_['omit'](_0x33b8c6[_0xcfb7('0x48')],[_0xcfb7('0x57'),'id'])||{});}})[_0xcfb7('0x10')](respondWithResult(_0xd88e52,null))[_0xcfb7('0x18')](handleError(_0xd88e52,null));};exports[_0xcfb7('0xe4')]=function(_0x54dadb,_0x489bd2){var _0x2ee4b4={'raw':![],'where':{}};var _0x471cfb={};var _0x45acb6={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x54dadb[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x489bd2,null))[_0xcfb7('0x10')](function(_0xe03bb8){if(_0xe03bb8){_0x471cfb[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatInteraction'][_0xcfb7('0x44')]);_0x471cfb[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x54dadb['query']);_0x471cfb['filters']=_[_0xcfb7('0x30')](_0x471cfb[_0xcfb7('0x2d')],_0x471cfb[_0xcfb7('0x31')]);_0x2ee4b4[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x471cfb[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x2ee4b4['attributes']=_0x2ee4b4[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x2ee4b4[_0xcfb7('0x33')]:_0x471cfb[_0xcfb7('0x2d')];if(!_0x54dadb['query'][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x2ee4b4[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x54dadb[_0xcfb7('0x31')]['limit']);_0x2ee4b4['offset']=qs[_0xcfb7('0x1d')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x2ee4b4[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x2ee4b4[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x54dadb[_0xcfb7('0x31')],_0x471cfb['filters']));_0x2ee4b4[_0xcfb7('0x38')]['ChatWebsiteId']=_0xe03bb8['id'];if(_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x2ee4b4[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x2ee4b4[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x2ee4b4['attributes'],function(_0x135644){var _0x12d8ce={};_0x12d8ce[_0x135644]={'$like':'%'+_0x54dadb['query']['filter']+'%'};return _0x12d8ce;})});}_0x2ee4b4=_[_0xcfb7('0x3b')]({},_0x2ee4b4,_0x54dadb[_0xcfb7('0x3d')]);return db[_0xcfb7('0xa2')][_0xcfb7('0x20')]({'where':_0x2ee4b4[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x5d1158){_0x45acb6['count']=_0x5d1158;if(_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x2ee4b4[_0xcfb7('0x45')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xcfb7('0xb1')],'as':_0xcfb7('0xe5'),'attributes':['name',_0xcfb7('0xe6'),_0xcfb7('0xe7')],'required':![]},{'model':db[_0xcfb7('0xe8')],'as':_0xcfb7('0xe9'),'attributes':['id',_0xcfb7('0x27'),_0xcfb7('0xea')],'where':_0x54dadb['query'][_0xcfb7('0xeb')]?{'id':_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0xeb')]}:undefined,'required':_0x54dadb['query']['tag']?!![]:![]}];}return db[_0xcfb7('0xa2')]['findAll'](_0x2ee4b4);})[_0xcfb7('0x10')](function(_0x2b5856){_0x45acb6[_0xcfb7('0x55')]=_0x2b5856;return _0x45acb6;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x489bd2,_0x2ee4b4))[_0xcfb7('0x18')](handleError(_0x489bd2,null));};function iftimePromise(_0x493237,_0x340db7){return respondWithRpcPromise(_0xcfb7('0xec'),_0xcfb7('0xed'),{'command':_0x340db7[_0xcfb7('0xee')]?util[_0xcfb7('0x9b')]('iftime\x20%s,%s',_0x493237[_0xcfb7('0xef')],_0x340db7[_0xcfb7('0xee')]):util[_0xcfb7('0x9b')]('iftime\x20%s',_0x493237[_0xcfb7('0xef')])},client9002)[_0xcfb7('0x10')](function(_0xedd922){var _0x3d409e=_0xedd922&&_0xedd922['indexOf'](_0xcfb7('0xf0'))>=0x0?!![]:![];logger[_0xcfb7('0xf1')](_0xcfb7('0xf2'),_0x340db7['id'],_0x493237['id'],_0x493237['interval'],_0x3d409e?'ONLINE':'OFFLINE',_0x340db7[_0xcfb7('0xee')]?_0x340db7[_0xcfb7('0xee')]:_0xcfb7('0xf3'));return _0x3d409e;})[_0xcfb7('0x18')](function(_0x1d4cce){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x340db7['id'],_0x493237['id'],_0x493237[_0xcfb7('0xef')],util['inspect'](_0x1d4cce,{'showHidden':![],'depth':null}),_0x340db7[_0xcfb7('0xee')]?_0x340db7[_0xcfb7('0xee')]:_0xcfb7('0xf3'));return![];});}exports['getSnippet']=function(_0x3ddfab,_0x8b3c77){var _0x280155=0x0;var _0x2ef97b=0x0;var _0x3cd15b=![];var _0x518d77;var _0x2725e1;return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x3ddfab[_0xcfb7('0x41')]['id']},'include':[{'model':db['Interval'],'as':_0xcfb7('0xf4'),'include':[{'model':db[_0xcfb7('0xf4')],'as':_0xcfb7('0xf5'),'attributes':['id',_0xcfb7('0xef')],'raw':!![]}]}]})[_0xcfb7('0x10')](handleEntityNotFound(_0x8b3c77,null))['then'](function(_0x4e1fe1){if(_0x4e1fe1){_0x518d77=_0x4e1fe1;return _0x4e1fe1['getProactiveActions']({'raw':!![]});}})['then'](function(_0x37ca38){if(_0x518d77){if(_0x37ca38){_0x2725e1=_0x37ca38;}}return require(_0xcfb7('0x67'))['getLicense']();})[_0xcfb7('0x10')](function(_0x3a035b){if(_0x3a035b){_0x2ef97b=_0x3a035b[_0xcfb7('0xf6')];_0x3cd15b=_0x3a035b['custom'];}})[_0xcfb7('0x10')](function(){return db[_0xcfb7('0xa2')]['count']({'where':{'closed':![]}});})[_0xcfb7('0x10')](function(_0x5428ab){_0x280155=_0x5428ab;if(_0x2ef97b&&_0x5428ab>_0x2ef97b){return db[_0xcfb7('0xf7')]['findOne']({'where':{'id':0x1}})['then'](function(_0x9ce544){if(_0x9ce544){_0x9ce544['increment'](_0xcfb7('0xf8'));}});}})[_0xcfb7('0x10')](function(){if(_0x518d77['Interval']&&_0x518d77[_0xcfb7('0xf4')][_0xcfb7('0xf5')]){var _0x608886=[];for(var _0x5a2c2a=0x0;_0x5a2c2a<_0x518d77[_0xcfb7('0xf4')][_0xcfb7('0xf5')][_0xcfb7('0x34')];_0x5a2c2a++){var _0x4757cf=_0x518d77['Interval']['Intervals'][_0x5a2c2a][_0xcfb7('0x25')]({'plain':!![]});_0x608886[_0xcfb7('0xf9')](iftimePromise(_0x4757cf,_0x518d77));}return BPromise['all'](_0x608886)['then'](function(_0x267ad3){return _[_0xcfb7('0xfa')](_0x267ad3);});}else{return!![];}})[_0xcfb7('0x10')](function(_0x4efb95){var _0x2aa5d1=fs[_0xcfb7('0xc2')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xfb')),_0xcfb7('0xc4'));var _0x515863={'remote':_0x518d77['remote'],'query':querystring['stringify'](_[_0xcfb7('0x3b')](_0x518d77[_0xcfb7('0x25')]({'plain':!![]}),{'customerIp':_0x3ddfab['headers'][_0xcfb7('0x95')]||_0x3ddfab[_0xcfb7('0x79')]['x-real-ip']||_0x3ddfab[_0xcfb7('0xfc')]['remoteAddress']||_0x3ddfab['ip'],'referer':_0x3ddfab['headers'][_0xcfb7('0x98')],'openedInteractions':_0x280155,'maxInteractions':_0x2ef97b,'virtual':_0x3cd15b[_0xcfb7('0xf6')],'online':_0x4efb95,'custom':_0x3cd15b}))['replace'](/'/g,'\x5c\x27')};_0x8b3c77[_0xcfb7('0xbc')](ejs[_0xcfb7('0xc5')](Mustache['render'](_0x2aa5d1,_0x515863),{'proactiveActions':_0x2725e1,'alignment':_0x518d77['alignment'],'verticalAlignment':_0x518d77['verticalAlignment'],'div_color':_0x518d77[_0xcfb7('0xea')],'labelText':_0x518d77['labelText'],'text_color':_0x518d77[_0xcfb7('0xfd')],'text_button_color':_0x518d77[_0xcfb7('0xfe')],'button_color':_0x518d77[_0xcfb7('0xff')],'background_color':_0x518d77[_0xcfb7('0x100')],'hideWhenOffline':_0x518d77['hideWhenOffline'],'interval':_0x518d77[_0xcfb7('0x101')]}));})['catch'](handleError(_0x8b3c77,null));};exports[_0xcfb7('0x102')]=function(_0x119dbd,_0x1de36b){var _0x28d5c9=_0x119dbd[_0xcfb7('0x41')]['id'];var _0x258984=_0x119dbd['body'];var _0x2a301d=0xc8;var _0x4bf8e6=null;return db[_0xcfb7('0xcd')][_0xcfb7('0xce')]({'isolationLevel':db[_0xcfb7('0xcd')][_0xcfb7('0x103')][_0xcfb7('0x104')][_0xcfb7('0x105')]},function(_0x5bf40d){return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x28d5c9},'transaction':_0x5bf40d})['then'](function(_0x35231f){if(_0x35231f){return db['ChatApplication'][_0xcfb7('0x24')]({'where':{'ChatWebsiteId':_0x28d5c9},'transaction':_0x5bf40d})[_0xcfb7('0x10')](function(){var _0x249c12=_[_0xcfb7('0x2e')](_0x258984,function(_0x26bb55){_0x26bb55[_0xcfb7('0x54')]=_0x28d5c9;return _0x26bb55;});return db[_0xcfb7('0x8d')][_0xcfb7('0x106')](_0x249c12,{'transaction':_0x5bf40d});});}else{_0x2a301d=0x194;_0x4bf8e6=[];}});})[_0xcfb7('0x10')](function(){if(_0x2a301d!==0x194){return db[_0xcfb7('0x8d')][_0xcfb7('0x107')]({'where':{'ChatWebsiteId':_0x28d5c9},'order':_0xcfb7('0x108')})['then'](function(_0x3fb265){_0x4bf8e6=_0x3fb265;});}})['catch'](function(_0x49830d){_0x2a301d=0x1f4;logger[_0xcfb7('0x16')](_0x49830d[_0xcfb7('0x109')]);if(_0x49830d[_0xcfb7('0x27')]){delete _0x49830d[_0xcfb7('0x27')];}_0x4bf8e6=_0x49830d;})[_0xcfb7('0x10a')](function(){if(_0x4bf8e6===null){_0x1de36b[_0xcfb7('0x19')](_0x2a301d);}else{if(_0x2a301d===0x1f4){_0x1de36b[_0xcfb7('0x1a')](_0x2a301d)['send'](_0x4bf8e6);}else{_0x1de36b[_0xcfb7('0x1a')](_0x2a301d)[_0xcfb7('0x1c')](_0x4bf8e6);}}});};exports[_0xcfb7('0x10b')]=function(_0x2a4a8b,_0x2edfda){var _0x3ebfe7={};var _0x2d73aa={};var _0x2c88fd;var _0x5676cb;return db['ChatWebsite']['findOne']({'where':{'id':_0x2a4a8b[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2edfda,null))['then'](function(_0x19c513){if(_0x19c513){_0x2c88fd=_0x19c513;_0x2d73aa[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatApplication']['rawAttributes']);_0x2d73aa[_0xcfb7('0x31')]=_['keys'](_0x2a4a8b[_0xcfb7('0x31')]);_0x2d73aa[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x2d73aa[_0xcfb7('0x2d')],_0x2d73aa['query']);_0x3ebfe7[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x2d73aa['model'],qs[_0xcfb7('0x32')](_0x2a4a8b['query']['fields']));_0x3ebfe7['attributes']=_0x3ebfe7[_0xcfb7('0x33')]['length']?_0x3ebfe7[_0xcfb7('0x33')]:_0x2d73aa[_0xcfb7('0x2d')];_0x3ebfe7[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x2a4a8b['query'][_0xcfb7('0x53')]);_0x3ebfe7[_0xcfb7('0x38')]=qs['filters'](_['pick'](_0x2a4a8b[_0xcfb7('0x31')],_0x2d73aa[_0xcfb7('0x2f')]));if(_0x2a4a8b['query']['filter']){_0x3ebfe7['where']=_['merge'](_0x3ebfe7[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x3ebfe7['attributes'],function(_0x56d25b){var _0x166c9e={};_0x166c9e[_0x56d25b]={'$like':'%'+_0x2a4a8b['query'][_0xcfb7('0x3a')]+'%'};return _0x166c9e;})});}_0x3ebfe7=_[_0xcfb7('0x3b')]({},_0x3ebfe7,_0x2a4a8b[_0xcfb7('0x3d')]);return _0x2c88fd[_0xcfb7('0x10b')](_0x3ebfe7);}})[_0xcfb7('0x10')](function(_0x572b74){if(_0x572b74){_0x5676cb=_0x572b74['length'];if(!_0x2a4a8b[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x3ebfe7[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x2a4a8b[_0xcfb7('0x31')]['limit']);_0x3ebfe7[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x2a4a8b[_0xcfb7('0x31')]['offset']);}return _0x2c88fd['getApplications'](_0x3ebfe7);}})['then'](function(_0xdf8330){if(_0xdf8330){return _0xdf8330?{'count':_0x5676cb,'rows':_0xdf8330}:null;}})[_0xcfb7('0x10')](respondWithResult(_0x2edfda,null))['catch'](handleError(_0x2edfda,null));};exports[_0xcfb7('0x10c')]=function(_0x340f08,_0x33d12f){return db[_0xcfb7('0x10d')][_0xcfb7('0x46')]({'where':{'id':_0x340f08[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x33d12f,null))[_0xcfb7('0x10')](function(_0x1fbdf9){if(_0x1fbdf9){return _0x1fbdf9[_0xcfb7('0x10c')](_0x340f08[_0xcfb7('0x48')][_0xcfb7('0x57')],_[_0xcfb7('0x10e')](_0x340f08['body'],[_0xcfb7('0x57'),'id'])||{});}})['then'](respondWithResult(_0x33d12f,null))[_0xcfb7('0x18')](handleError(_0x33d12f,null));};exports[_0xcfb7('0x10f')]=function(_0x5aa2f7,_0x4f35c9){var _0x4ec857={};var _0x3a0924={};var _0x579c34;var _0x1895ee;return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x5aa2f7[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x4f35c9,null))[_0xcfb7('0x10')](function(_0xc6bdbd){if(_0xc6bdbd){_0x579c34=_0xc6bdbd;_0x3a0924[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0x110')][_0xcfb7('0x44')]);_0x3a0924[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x5aa2f7['query']);_0x3a0924['filters']=_[_0xcfb7('0x30')](_0x3a0924[_0xcfb7('0x2d')],_0x3a0924[_0xcfb7('0x31')]);_0x4ec857[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x3a0924[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x5aa2f7['query']['fields']));_0x4ec857[_0xcfb7('0x33')]=_0x4ec857[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x4ec857['attributes']:_0x3a0924[_0xcfb7('0x2d')];_0x4ec857[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x4ec857[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_['pick'](_0x5aa2f7['query'],_0x3a0924[_0xcfb7('0x2f')]));if(_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x4ec857[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x4ec857[_0xcfb7('0x38')],{'$or':_['map'](_0x4ec857[_0xcfb7('0x33')],function(_0x42f47d){var _0x23d09c={};_0x23d09c[_0x42f47d]={'$like':'%'+_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x3a')]+'%'};return _0x23d09c;})});}_0x4ec857=_[_0xcfb7('0x3b')]({},_0x4ec857,_0x5aa2f7[_0xcfb7('0x3d')]);return _0x579c34['getProactiveActions'](_0x4ec857);}})[_0xcfb7('0x10')](function(_0x509288){if(_0x509288){_0x1895ee=_0x509288[_0xcfb7('0x34')];if(!_0x5aa2f7[_0xcfb7('0x31')]['hasOwnProperty'](_0xcfb7('0x36'))){_0x4ec857[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x4ec857[_0xcfb7('0x1d')]=qs['offset'](_0x5aa2f7[_0xcfb7('0x31')]['offset']);}return _0x579c34[_0xcfb7('0x10f')](_0x4ec857);}})[_0xcfb7('0x10')](function(_0x33e672){if(_0x33e672){return _0x33e672?{'count':_0x1895ee,'rows':_0x33e672}:null;}})['then'](respondWithResult(_0x4f35c9,null))[_0xcfb7('0x18')](handleError(_0x4f35c9,null));};exports[_0xcfb7('0x111')]=function(_0x4d3ff0,_0x400d86){var _0x3320b7=_0x4d3ff0[_0xcfb7('0x31')]['online']===_0xcfb7('0x112')?_0xcfb7('0x113'):'onlineForm';return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'attributes':['id',_0x3320b7],'where':{'id':_0x4d3ff0[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x400d86,null))[_0xcfb7('0x10')](function(_0x29a85a){if(_0x29a85a){var _0x3a2a9d=_0x29a85a[_0x3320b7];var _0x49306b=_0x3a2a9d&&_0x3a2a9d[_0xcfb7('0x114')]?_0x3a2a9d[_0xcfb7('0x114')]:[];_0x400d86[_0xcfb7('0xbc')]({'fromKey':_[_0xcfb7('0x69')](_0x3a2a9d[_0xcfb7('0x115')])?undefined:_0x3a2a9d['fromKey'],'count':_0x49306b[_0xcfb7('0x34')],'rows':_0x49306b});}})['catch'](handleError(_0x400d86,null));};exports[_0xcfb7('0x116')]=function(_0x277d96,_0x1e3c65){var _0x5b6502={'raw':![],'where':{}};var _0x13e1d6={};var _0x216dbf={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')][_0xcfb7('0x117')]({'where':{'id':_0x277d96['params']['id']}})['then'](handleEntityNotFound(_0x1e3c65,null))[_0xcfb7('0x10')](function(_0x28b7fe){if(_0x28b7fe){_0x13e1d6[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0xc7')][_0xcfb7('0x44')]);_0x13e1d6[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x277d96[_0xcfb7('0x31')]);_0x13e1d6[_0xcfb7('0x2f')]=_['intersection'](_0x13e1d6[_0xcfb7('0x2d')],_0x13e1d6[_0xcfb7('0x31')]);_0x5b6502[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x13e1d6['model'],qs[_0xcfb7('0x32')](_0x277d96['query'][_0xcfb7('0x32')]));_0x5b6502[_0xcfb7('0x33')]=_0x5b6502[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x5b6502['attributes']:_0x13e1d6['model'];if(!_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x5b6502[_0xcfb7('0x1e')]=qs['limit'](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x5b6502[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x5b6502[_0xcfb7('0x37')]=qs['sort'](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x5b6502[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x277d96[_0xcfb7('0x31')],_0x13e1d6[_0xcfb7('0x2f')]));_0x5b6502['where']['ChatWebsiteId']=_0x28b7fe['id'];if(_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x5b6502[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x5b6502['where'],{'$or':_[_0xcfb7('0x2e')](_0x5b6502[_0xcfb7('0x33')],function(_0x3b90c0){var _0x9e2165={};_0x9e2165[_0x3b90c0]={'$like':'%'+_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x3a')]+'%'};return _0x9e2165;})});}_0x5b6502=_[_0xcfb7('0x3b')]({},_0x5b6502,_0x277d96[_0xcfb7('0x3d')]);return db[_0xcfb7('0xc7')]['count']({'where':_0x5b6502[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x89635){_0x216dbf['count']=_0x89635;if(_0x277d96['query']['includeAll']){_0x5b6502[_0xcfb7('0x45')]=[{'all':!![]}];}else{_0x5b6502[_0xcfb7('0x45')]=[{'model':db[_0xcfb7('0x7c')],'as':_0xcfb7('0x118'),'required':![]},{'model':db['Attachment'],'as':_0xcfb7('0x119'),'required':![]}];}return db[_0xcfb7('0xc7')][_0xcfb7('0x3f')](_0x5b6502);})[_0xcfb7('0x10')](function(_0x1d2980){_0x216dbf[_0xcfb7('0x55')]=_0x1d2980;return _0x216dbf;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x1e3c65,_0x5b6502))[_0xcfb7('0x18')](handleError(_0x1e3c65,null));};exports['addAgents']=function(_0x40a5ee,_0x350a0a){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x40a5ee[_0xcfb7('0x41')]['id']}})['then'](handleEntityNotFound(_0x350a0a,null))['then'](function(_0x14b985){if(_0x14b985){return _0x14b985[_0xcfb7('0x11a')](_0x40a5ee[_0xcfb7('0x48')]['ids'],_['omit'](_0x40a5ee[_0xcfb7('0x48')],['ids','id'])||{})[_0xcfb7('0xa6')](function(_0x430bc9){for(var _0x30372a=0x0;_0x30372a<_0x40a5ee['body'][_0xcfb7('0x57')]['length'];_0x30372a+=0x1){socket[_0xcfb7('0x11b')](_0xcfb7('0x11c'),{'UserId':Number(_0x40a5ee['body'][_0xcfb7('0x57')][_0x30372a]),'ChatWebsiteId':Number(_0x40a5ee[_0xcfb7('0x41')]['id'])});}return _0x430bc9;});}})[_0xcfb7('0x10')](respondWithResult(_0x350a0a,null))[_0xcfb7('0x18')](handleError(_0x350a0a,null));};exports[_0xcfb7('0x11d')]=function(_0x5c581b,_0x54aefc){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5c581b['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x54aefc,null))[_0xcfb7('0x10')](function(_0x507d17){if(_0x507d17){return _0x507d17[_0xcfb7('0x11d')](_0x5c581b[_0xcfb7('0x31')]['ids'])[_0xcfb7('0x10')](function(){if(_[_0xcfb7('0x11e')](_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')])){for(var _0x332a6b=0x0;_0x332a6b<_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')]['length'];_0x332a6b+=0x1){socket[_0xcfb7('0x11b')](_0xcfb7('0x11f'),{'UserId':Number(_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')][_0x332a6b]),'ChatWebsiteId':Number(_0x5c581b['params']['id'])});}}else{socket['emit'](_0xcfb7('0x11f'),{'UserId':Number(_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')]),'ChatWebsiteId':Number(_0x5c581b['params']['id'])});}});}})[_0xcfb7('0x10')](respondWithStatusCode(_0x54aefc,null))[_0xcfb7('0x18')](handleError(_0x54aefc,null));};exports[_0xcfb7('0x120')]=function(_0x344102,_0x4ba4de){var _0x307ce1={};var _0x777f92={};var _0x4a189d;var _0x262275;return db[_0xcfb7('0x29')][_0xcfb7('0x117')]({'where':{'id':_0x344102[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x4ba4de,null))[_0xcfb7('0x10')](function(_0xa5f55e){if(_0xa5f55e){_0x4a189d=_0xa5f55e;_0x777f92[_0xcfb7('0x2d')]=_['keys'](db[_0xcfb7('0xb1')]['rawAttributes']);_0x777f92[_0xcfb7('0x31')]=_['keys'](_0x344102[_0xcfb7('0x31')]);_0x777f92[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x777f92['model'],_0x777f92[_0xcfb7('0x31')]);_0x307ce1['attributes']=_[_0xcfb7('0x30')](_0x777f92[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x344102['query'][_0xcfb7('0x32')]));_0x307ce1[_0xcfb7('0x33')]=_0x307ce1['attributes']['length']?_0x307ce1[_0xcfb7('0x33')]:_0x777f92[_0xcfb7('0x2d')];_0x307ce1[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x344102[_0xcfb7('0x31')]['sort']);_0x307ce1[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x344102[_0xcfb7('0x31')],_0x777f92[_0xcfb7('0x2f')]));if(_0x344102[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x307ce1[_0xcfb7('0x38')]=_['merge'](_0x307ce1['where'],{'$or':_[_0xcfb7('0x2e')](_0x307ce1['attributes'],function(_0x1c23a4){var _0x2d079d={};_0x2d079d[_0x1c23a4]={'$like':'%'+_0x344102[_0xcfb7('0x31')]['filter']+'%'};return _0x2d079d;})});}_0x307ce1=_[_0xcfb7('0x3b')]({},_0x307ce1,_0x344102[_0xcfb7('0x3d')]);return _0x4a189d[_0xcfb7('0x120')](_0x307ce1);}})[_0xcfb7('0x10')](function(_0x512fe8){if(_0x512fe8){_0x262275=_0x512fe8[_0xcfb7('0x34')];if(!_0x344102['query'][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x307ce1['limit']=qs[_0xcfb7('0x1e')](_0x344102[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x307ce1[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x344102[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}return _0x4a189d['getAgents'](_0x307ce1);}})[_0xcfb7('0x10')](function(_0x11ff71){if(_0x11ff71){return _0x11ff71?{'count':_0x262275,'rows':_0x11ff71}:null;}})[_0xcfb7('0x10')](respondWithResult(_0x4ba4de,null))[_0xcfb7('0x18')](handleError(_0x4ba4de,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 50c3574..228c1fa 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 _0x2d17=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x2d17,0x17e));var _0x72d1=function(_0x543adb,_0x4b4b87){_0x543adb=_0x543adb-0x0;var _0x41c893=_0x2d17[_0x543adb];return _0x41c893;};'use strict';var EventEmitter=require(_0x72d1('0x0'));var ChatWebsite=require(_0x72d1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x72d1('0x2')](0x0);var events={'afterCreate':_0x72d1('0x3'),'afterUpdate':'update','afterDestroy':_0x72d1('0x4')};function emitEvent(_0x38fec7){return function(_0x55b722,_0x1dd6d8,_0x4dfee1){ChatWebsiteEvents[_0x72d1('0x5')](_0x38fec7+':'+_0x55b722['id'],_0x55b722);ChatWebsiteEvents['emit'](_0x38fec7,_0x55b722);_0x4dfee1(null);};}for(var e in events){if(events[_0x72d1('0x6')](e)){var event=events[e];ChatWebsite[_0x72d1('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2830=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2830,0x117));var _0x0283=function(_0x4b196e,_0x1f067f){_0x4b196e=_0x4b196e-0x0;var _0x48049c=_0x2830[_0x4b196e];return _0x48049c;};'use strict';var EventEmitter=require(_0x0283('0x0'));var ChatWebsite=require(_0x0283('0x1'))['db'][_0x0283('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0283('0x3')](0x0);var events={'afterCreate':_0x0283('0x4'),'afterUpdate':_0x0283('0x5'),'afterDestroy':_0x0283('0x6')};function emitEvent(_0x56984a){return function(_0x414c89,_0x4aa050,_0x1a8998){ChatWebsiteEvents[_0x0283('0x7')](_0x56984a+':'+_0x414c89['id'],_0x414c89);ChatWebsiteEvents[_0x0283('0x7')](_0x56984a,_0x414c89);_0x1a8998(null);};}for(var e in events){if(events[_0x0283('0x8')](e)){var event=events[e];ChatWebsite[_0x0283('0x9')](e,emitEvent(event));}}module[_0x0283('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index b0abe4f..fdc3210 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 _0x78a4=['ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x591a3f,_0x307863){var _0x5b5d3f=function(_0x16cadf){while(--_0x16cadf){_0x591a3f['push'](_0x591a3f['shift']());}};_0x5b5d3f(++_0x307863);}(_0x78a4,0x9e));var _0x478a=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x78a4[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x478a('0x0'));var logger=require(_0x478a('0x1'))('api');var moment=require(_0x478a('0x2'));var BPromise=require(_0x478a('0x3'));var rp=require(_0x478a('0x4'));var fs=require('fs');var path=require(_0x478a('0x5'));var rimraf=require(_0x478a('0x6'));var config=require(_0x478a('0x7'));var attributes=require(_0x478a('0x8'));module[_0x478a('0x9')]=function(_0x1eb14c,_0x27724c){return _0x1eb14c[_0x478a('0xa')](_0x478a('0xb'),attributes,{'tableName':_0x478a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc52f=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x1805ce,_0x565a64){var _0x344d75=function(_0x1ec743){while(--_0x1ec743){_0x1805ce['push'](_0x1805ce['shift']());}};_0x344d75(++_0x565a64);}(_0xc52f,0xfa));var _0xfc52=function(_0x4daf4b,_0x485ac7){_0x4daf4b=_0x4daf4b-0x0;var _0x5a6635=_0xc52f[_0x4daf4b];return _0x5a6635;};'use strict';var _=require(_0xfc52('0x0'));var util=require('util');var logger=require(_0xfc52('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfc52('0x2'));var rp=require(_0xfc52('0x3'));var fs=require('fs');var path=require(_0xfc52('0x4'));var rimraf=require(_0xfc52('0x5'));var config=require(_0xfc52('0x6'));var attributes=require(_0xfc52('0x7'));module[_0xfc52('0x8')]=function(_0x247723,_0xa3d10b){return _0x247723['define'](_0xfc52('0x9'),attributes,{'tableName':'chat_websites','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 c59f939..e57bf24 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 _0xb793=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x44f88c,_0x2d8439){var _0x43998a=function(_0x4b4389){while(--_0x4b4389){_0x44f88c['push'](_0x44f88c['shift']());}};_0x43998a(++_0x2d8439);}(_0xb793,0x1b8));var _0x3b79=function(_0x4dc263,_0x149f28){_0x4dc263=_0x4dc263-0x0;var _0x3e653b=_0xb793[_0x4dc263];return _0x3e653b;};'use strict';var _=require('lodash');var util=require(_0x3b79('0x0'));var moment=require(_0x3b79('0x1'));var BPromise=require(_0x3b79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b79('0x3'));var db=require(_0x3b79('0x4'))['db'];var utils=require(_0x3b79('0x5'));var logger=require(_0x3b79('0x6'))('rpc');var config=require(_0x3b79('0x7'));var jayson=require(_0x3b79('0x8'));var client=jayson[_0x3b79('0x9')][_0x3b79('0xa')]({'port':0x232a});config[_0x3b79('0xb')]=_[_0x3b79('0xc')](config[_0x3b79('0xb')],{'host':_0x3b79('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x247d9b,_0x3c82e4,_0x12ab58){return new BPromise(function(_0x25e3d3,_0x58c158){return client[_0x3b79('0xe')](_0x247d9b,_0x12ab58)[_0x3b79('0xf')](function(_0xa9598a){logger['info'](_0x3b79('0x10'),_0x3c82e4,_0x3b79('0x11'));logger['debug'](_0x3b79('0x12'),_0x3c82e4,_0x3b79('0x11'),JSON[_0x3b79('0x13')](_0xa9598a));if(_0xa9598a[_0x3b79('0x14')]){if(_0xa9598a[_0x3b79('0x14')][_0x3b79('0x15')]===0x1f4){logger[_0x3b79('0x14')](_0x3b79('0x10'),_0x3c82e4,_0xa9598a['error'][_0x3b79('0x16')]);return _0x58c158(_0xa9598a[_0x3b79('0x14')][_0x3b79('0x16')]);}logger[_0x3b79('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3c82e4,_0xa9598a['error'][_0x3b79('0x16')]);return _0x25e3d3(_0xa9598a['error'][_0x3b79('0x16')]);}else{logger[_0x3b79('0x17')](_0x3b79('0x10'),_0x3c82e4,_0x3b79('0x11'));_0x25e3d3(_0xa9598a[_0x3b79('0x18')][_0x3b79('0x16')]);}})[_0x3b79('0x19')](function(_0x5ebedd){logger[_0x3b79('0x14')](_0x3b79('0x10'),_0x3c82e4,_0x5ebedd);_0x58c158(_0x5ebedd);});});}
\ No newline at end of file
+var _0x2365=['localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3ce4c1,_0x29fd23){var _0x527c34=function(_0x1759ae){while(--_0x1759ae){_0x3ce4c1['push'](_0x3ce4c1['shift']());}};_0x527c34(++_0x29fd23);}(_0x2365,0x10b));var _0x5236=function(_0x3b09fb,_0x22e654){_0x3b09fb=_0x3b09fb-0x0;var _0x1a0238=_0x2365[_0x3b09fb];return _0x1a0238;};'use strict';var _=require('lodash');var util=require(_0x5236('0x0'));var moment=require(_0x5236('0x1'));var BPromise=require(_0x5236('0x2'));var rs=require(_0x5236('0x3'));var fs=require('fs');var Redis=require(_0x5236('0x4'));var db=require(_0x5236('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5236('0x6'));var config=require(_0x5236('0x7'));var jayson=require(_0x5236('0x8'));var client=jayson[_0x5236('0x9')][_0x5236('0xa')]({'port':0x232a});config[_0x5236('0xb')]=_[_0x5236('0xc')](config['redis'],{'host':_0x5236('0xd'),'port':0x18eb});var socket=require(_0x5236('0xe'))(new Redis(config[_0x5236('0xb')]));require(_0x5236('0xf'))[_0x5236('0x10')](socket);function respondWithRpcPromise(_0x39978b,_0x39123c,_0x4c4bb5){return new BPromise(function(_0x34c46d,_0xf1badc){return client['request'](_0x39978b,_0x4c4bb5)[_0x5236('0x11')](function(_0x140793){logger[_0x5236('0x12')](_0x5236('0x13'),_0x39123c,_0x5236('0x14'));logger['debug'](_0x5236('0x15'),_0x39123c,_0x5236('0x14'),JSON[_0x5236('0x16')](_0x140793));if(_0x140793[_0x5236('0x17')]){if(_0x140793[_0x5236('0x17')][_0x5236('0x18')]===0x1f4){logger[_0x5236('0x17')](_0x5236('0x13'),_0x39123c,_0x140793['error'][_0x5236('0x19')]);return _0xf1badc(_0x140793[_0x5236('0x17')][_0x5236('0x19')]);}logger[_0x5236('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x39123c,_0x140793[_0x5236('0x17')]['message']);return _0x34c46d(_0x140793['error']['message']);}else{logger[_0x5236('0x12')](_0x5236('0x13'),_0x39123c,'request\x20sent');_0x34c46d(_0x140793[_0x5236('0x1a')][_0x5236('0x19')]);}})[_0x5236('0x1b')](function(_0x345377){logger['error'](_0x5236('0x13'),_0x39123c,_0x345377);_0xf1badc(_0x345377);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 0ca201b..9f20753 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 _0xaee5=['./chatWebsite.events','save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x305b12,_0x5ecd09){var _0x4141de=function(_0x3e7044){while(--_0x3e7044){_0x305b12['push'](_0x305b12['shift']());}};_0x4141de(++_0x5ecd09);}(_0xaee5,0x158));var _0x5aee=function(_0x20a33a,_0x3b908b){_0x20a33a=_0x20a33a-0x0;var _0x10a66d=_0xaee5[_0x20a33a];return _0x10a66d;};'use strict';var ChatWebsiteEvents=require(_0x5aee('0x0'));var events=[_0x5aee('0x1'),_0x5aee('0x2'),_0x5aee('0x3')];function createListener(_0x18359e,_0x24ac42){return function(_0x58a893){_0x24ac42['emit'](_0x18359e,_0x58a893);};}function removeListener(_0x12a4e6,_0x27a412){return function(){ChatWebsiteEvents[_0x5aee('0x4')](_0x12a4e6,_0x27a412);};}exports[_0x5aee('0x5')]=function(_0x3e3284){for(var _0x127e5c=0x0,_0x53c8ae=events[_0x5aee('0x6')];_0x127e5c<_0x53c8ae;_0x127e5c++){var _0x33ef72=events[_0x127e5c];var _0x32b224=createListener(_0x5aee('0x7')+_0x33ef72,_0x3e3284);ChatWebsiteEvents['on'](_0x33ef72,_0x32b224);}};
\ No newline at end of file
+var _0x6eef=['update','emit','removeListener','register','length','./chatWebsite.events','save'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x6eef,0x67));var _0xf6ee=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x6eef[_0x131585];return _0x1fcca2;};'use strict';var ChatWebsiteEvents=require(_0xf6ee('0x0'));var events=[_0xf6ee('0x1'),'remove',_0xf6ee('0x2')];function createListener(_0x1eaf58,_0x412715){return function(_0x58f1a2){_0x412715[_0xf6ee('0x3')](_0x1eaf58,_0x58f1a2);};}function removeListener(_0x159d7c,_0x23250f){return function(){ChatWebsiteEvents[_0xf6ee('0x4')](_0x159d7c,_0x23250f);};}exports[_0xf6ee('0x5')]=function(_0x45173d){for(var _0x2cf402=0x0,_0xadb21c=events[_0xf6ee('0x6')];_0x2cf402<_0xadb21c;_0x2cf402++){var _0x51db7b=events[_0x2cf402];var _0x10b442=createListener('chatWebsite:'+_0x51db7b,_0x45173d);ChatWebsiteEvents['on'](_0x51db7b,_0x10b442);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 6dc797a..a10e704 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 _0x4161=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addAnswer','join','root','server/files/images/logos/','format','now','originalname','/:id/logo','single','file','diskStorage','server/files/images/avatars/','addAvatar','%s-%s','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer'];(function(_0x477554,_0x5b6518){var _0x5b760e=function(_0x26a59f){while(--_0x26a59f){_0x477554['push'](_0x477554['shift']());}};_0x5b760e(++_0x5b6518);}(_0x4161,0x1c1));var _0x1416=function(_0x3e8bd2,_0x261ed5){_0x3e8bd2=_0x3e8bd2-0x0;var _0x33bdfe=_0x4161[_0x3e8bd2];return _0x33bdfe;};'use strict';var multer=require(_0x1416('0x0'));var util=require(_0x1416('0x1'));var path=require('path');var timeout=require(_0x1416('0x2'));var express=require(_0x1416('0x3'));var router=express[_0x1416('0x4')]();var fs_extra=require(_0x1416('0x5'));var auth=require(_0x1416('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1416('0x7'));router[_0x1416('0x8')]('/',auth[_0x1416('0x9')](),controller[_0x1416('0xa')]);router[_0x1416('0x8')](_0x1416('0xb'),auth['isAuthenticated'](),controller[_0x1416('0xc')]);router[_0x1416('0x8')]('/:id',auth[_0x1416('0x9')](),controller[_0x1416('0xd')]);router['get'](_0x1416('0xe'),auth['isAuthenticated'](),controller[_0x1416('0xf')]);router['get']('/:id/canned_answers',auth[_0x1416('0x9')](),controller[_0x1416('0x10')]);router[_0x1416('0x8')]('/:id/logo',controller[_0x1416('0x11')]);router['get'](_0x1416('0x12'),controller[_0x1416('0x13')]);router['get'](_0x1416('0x14'),controller[_0x1416('0x15')]);router[_0x1416('0x8')]('/:id/system_avatar',controller[_0x1416('0x16')]);router[_0x1416('0x8')](_0x1416('0x17'),auth['isAuthenticated'](),controller[_0x1416('0x18')]);router[_0x1416('0x8')]('/:id/snippet',controller[_0x1416('0x19')]);router[_0x1416('0x8')](_0x1416('0x1a'),auth[_0x1416('0x9')](),controller[_0x1416('0x1b')]);router[_0x1416('0x8')](_0x1416('0x1c'),auth['isAuthenticated'](),controller[_0x1416('0x1d')]);router['get'](_0x1416('0x1e'),controller[_0x1416('0x1f')]);router[_0x1416('0x8')](_0x1416('0x20'),auth[_0x1416('0x9')](),controller[_0x1416('0x21')]);router[_0x1416('0x8')](_0x1416('0x22'),auth[_0x1416('0x9')](),controller['getAgents']);router[_0x1416('0x23')]('/',auth[_0x1416('0x9')](),controller[_0x1416('0x24')]);router['post'](_0x1416('0xe'),auth[_0x1416('0x9')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x1416('0x9')](),controller[_0x1416('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x975a31,_0x54790c,_0x14ec3b){_0x14ec3b(null,path[_0x1416('0x26')](config[_0x1416('0x27')],_0x1416('0x28')));},'filename':function(_0x2e7a36,_0x3220ae,_0x54f489){_0x54f489(null,util[_0x1416('0x29')]('%s-%s',Date[_0x1416('0x2a')](),_0x3220ae[_0x1416('0x2b')]));}})});router['post'](_0x1416('0x2c'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x426ad6,_0x172367,_0x2f739f){_0x2f739f(null,path[_0x1416('0x26')](config['root'],_0x1416('0x30')));},'filename':function(_0x1a4c1d,_0x2881c0,_0x7530cc){_0x7530cc(null,util[_0x1416('0x29')]('%s-%s',Date[_0x1416('0x2a')](),_0x2881c0[_0x1416('0x2b')]));}})});router[_0x1416('0x23')](_0x1416('0x12'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller[_0x1416('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc5b9ca,_0x3fad03,_0x502845){_0x502845(null,path[_0x1416('0x26')](config['root'],_0x1416('0x30')));},'filename':function(_0x41aa6d,_0x1bb2c5,_0x144942){_0x144942(null,util[_0x1416('0x29')](_0x1416('0x32'),Date[_0x1416('0x2a')](),_0x1bb2c5[_0x1416('0x2b')]));}})});router[_0x1416('0x23')](_0x1416('0x14'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller[_0x1416('0x33')]);var upload=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x2af446,_0x5b6a0c,_0x3aaf73){_0x3aaf73(null,path['join'](config[_0x1416('0x27')],_0x1416('0x30')));},'filename':function(_0x156b47,_0x59b7fe,_0x2e51f2){_0x2e51f2(null,util[_0x1416('0x29')](_0x1416('0x32'),Date[_0x1416('0x2a')](),_0x59b7fe['originalname']));}})});router[_0x1416('0x23')]('/:id/system_avatar',upload[_0x1416('0x2d')]('file'),controller[_0x1416('0x34')]);router['post'](_0x1416('0x35'),controller[_0x1416('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x30f6d6,_0x1879c2,_0x1d065c){const _0x1da811=path['join'](config[_0x1416('0x27')],_0x1416('0x37'),_0x1416('0x38'),_0x1416('0x39'));fs_extra['ensureDir'](_0x1da811,function(){_0x1d065c(null,_0x1da811);});},'filename':function(_0x508a27,_0x49339c,_0x626d42){const _0x513e98=_0x49339c[_0x1416('0x2b')][_0x1416('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2140dd=path[_0x1416('0x3b')](_0x513e98);const _0x59a0b0=Date[_0x1416('0x2a')]()+'-'+_0x513e98[_0x1416('0x3a')](_0x2140dd,'')+_0x2140dd;_0x626d42(null,_0x59a0b0);}})});router[_0x1416('0x23')](_0x1416('0x3c'),offlineUploadMulter[_0x1416('0x3d')](),controller[_0x1416('0x3e')]);router[_0x1416('0x23')](_0x1416('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x1416('0x1a'),auth['isAuthenticated'](),controller[_0x1416('0x3f')]);router['post']('/:id/proactive_actions',auth[_0x1416('0x9')](),controller[_0x1416('0x40')]);router[_0x1416('0x23')](_0x1416('0x22'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1416('0x41')](_0x1416('0x42'),auth[_0x1416('0x9')](),controller[_0x1416('0x43')]);router[_0x1416('0x44')](_0x1416('0x42'),auth[_0x1416('0x9')](),controller[_0x1416('0x45')]);router['delete']('/:id/dispositions',auth[_0x1416('0x9')](),controller[_0x1416('0x46')]);router[_0x1416('0x44')](_0x1416('0x47'),auth['isAuthenticated'](),controller[_0x1416('0x48')]);router[_0x1416('0x44')](_0x1416('0x22'),auth[_0x1416('0x9')](),controller[_0x1416('0x49')]);module[_0x1416('0x4a')]=router;
\ No newline at end of file
+var _0xd133=['/:id/users','post','create','/:id/dispositions','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','update','delete','destroy','removeAnswers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/fields','getFields','/:id/offline_messages'];(function(_0x4b7944,_0x426228){var _0x27984e=function(_0x235a16){while(--_0x235a16){_0x4b7944['push'](_0x4b7944['shift']());}};_0x27984e(++_0x426228);}(_0xd133,0x6c));var _0x3d13=function(_0x3ad46a,_0x420179){_0x3ad46a=_0x3ad46a-0x0;var _0x1f6cfc=_0xd133[_0x3ad46a];return _0x1f6cfc;};'use strict';var multer=require(_0x3d13('0x0'));var util=require('util');var path=require(_0x3d13('0x1'));var timeout=require(_0x3d13('0x2'));var express=require(_0x3d13('0x3'));var router=express[_0x3d13('0x4')]();var fs_extra=require(_0x3d13('0x5'));var auth=require(_0x3d13('0x6'));var interaction=require(_0x3d13('0x7'));var config=require(_0x3d13('0x8'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x3d13('0x9')](),controller[_0x3d13('0xa')]);router['get'](_0x3d13('0xb'),auth['isAuthenticated'](),controller[_0x3d13('0xc')]);router[_0x3d13('0xd')](_0x3d13('0xe'),auth[_0x3d13('0x9')](),controller[_0x3d13('0xf')]);router[_0x3d13('0xd')]('/:id/dispositions',auth[_0x3d13('0x9')](),controller[_0x3d13('0x10')]);router[_0x3d13('0xd')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3d13('0x11')]);router[_0x3d13('0xd')](_0x3d13('0x12'),controller['getLogo']);router['get'](_0x3d13('0x13'),controller[_0x3d13('0x14')]);router[_0x3d13('0xd')](_0x3d13('0x15'),controller[_0x3d13('0x16')]);router[_0x3d13('0xd')](_0x3d13('0x17'),controller[_0x3d13('0x18')]);router[_0x3d13('0xd')](_0x3d13('0x19'),auth[_0x3d13('0x9')](),controller['getInteractions']);router[_0x3d13('0xd')](_0x3d13('0x1a'),controller[_0x3d13('0x1b')]);router['get'](_0x3d13('0x1c'),auth[_0x3d13('0x9')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x3d13('0x9')](),controller['getProactiveActions']);router[_0x3d13('0xd')](_0x3d13('0x1d'),controller[_0x3d13('0x1e')]);router['get'](_0x3d13('0x1f'),auth[_0x3d13('0x9')](),controller['getOfflineMessages']);router[_0x3d13('0xd')](_0x3d13('0x20'),auth[_0x3d13('0x9')](),controller['getAgents']);router[_0x3d13('0x21')]('/',auth[_0x3d13('0x9')](),controller[_0x3d13('0x22')]);router[_0x3d13('0x21')](_0x3d13('0x23'),auth[_0x3d13('0x9')](),controller['addDisposition']);router[_0x3d13('0x21')](_0x3d13('0x24'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x25')]);var upload=multer({'storage':multer[_0x3d13('0x26')]({'destination':function(_0x3deecf,_0x5bb586,_0x495126){_0x495126(null,path['join'](config[_0x3d13('0x27')],_0x3d13('0x28')));},'filename':function(_0x18e9ee,_0x4008ff,_0x350594){_0x350594(null,util['format'](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x4008ff[_0x3d13('0x2b')]));}})});router['post'](_0x3d13('0x12'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller[_0x3d13('0x2e')]);var upload=multer({'storage':multer[_0x3d13('0x26')]({'destination':function(_0x3bb52b,_0x1b8875,_0xb49b5){_0xb49b5(null,path[_0x3d13('0x2f')](config[_0x3d13('0x27')],_0x3d13('0x30')));},'filename':function(_0x5f3dd2,_0x4fb6bf,_0x569730){_0x569730(null,util[_0x3d13('0x31')](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x4fb6bf[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x13'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller[_0x3d13('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x327f3a,_0x209d6d,_0x4fdf3d){_0x4fdf3d(null,path['join'](config[_0x3d13('0x27')],_0x3d13('0x30')));},'filename':function(_0x3e0a26,_0x336d40,_0x138f1e){_0x138f1e(null,util['format'](_0x3d13('0x29'),Date['now'](),_0x336d40[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x15'),upload['single'](_0x3d13('0x2d')),controller[_0x3d13('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46b58d,_0x43a0fe,_0x3d7f80){_0x3d7f80(null,path[_0x3d13('0x2f')](config['root'],_0x3d13('0x30')));},'filename':function(_0x521b1f,_0x30ccbd,_0x136da9){_0x136da9(null,util[_0x3d13('0x31')](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x30ccbd[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x17'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller['addSystemAvatar']);router['post'](_0x3d13('0x34'),controller[_0x3d13('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x427093,_0x12bc02,_0x1361d6){const _0x228115=path[_0x3d13('0x2f')](config[_0x3d13('0x27')],'server/files','attachments',_0x3d13('0x36'));fs_extra[_0x3d13('0x37')](_0x228115,function(){_0x1361d6(null,_0x228115);});},'filename':function(_0x262643,_0x5d0466,_0x10fd14){const _0x31407e=_0x5d0466[_0x3d13('0x2b')][_0x3d13('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51a3ef=path[_0x3d13('0x39')](_0x31407e);const _0x2d48ef=Date[_0x3d13('0x2a')]()+'-'+_0x31407e[_0x3d13('0x38')](_0x51a3ef,'')+_0x51a3ef;_0x10fd14(null,_0x2d48ef);}})});router['post']('/:id/offline',offlineUploadMulter[_0x3d13('0x3a')](),controller[_0x3d13('0x3b')]);router[_0x3d13('0x21')](_0x3d13('0x19'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3c')]);router[_0x3d13('0x21')](_0x3d13('0x1c'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3d')]);router['post'](_0x3d13('0x3e'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3f')]);router[_0x3d13('0x21')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x3d13('0x40')]('/:id',auth[_0x3d13('0x9')](),controller[_0x3d13('0x41')]);router[_0x3d13('0x42')](_0x3d13('0xe'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x43')]);router[_0x3d13('0x42')](_0x3d13('0x23'),auth[_0x3d13('0x9')](),controller['removeDispositions']);router[_0x3d13('0x42')](_0x3d13('0x24'),auth['isAuthenticated'](),controller[_0x3d13('0x44')]);router[_0x3d13('0x42')]('/:id/users',auth[_0x3d13('0x9')](),controller['removeAgents']);module[_0x3d13('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c2ddb03..2b3a5e6 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 _0x59c1=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','production','app','get'];(function(_0x1d43bf,_0x2e68ae){var _0x44f97f=function(_0x2bbbc3){while(--_0x2bbbc3){_0x1d43bf['push'](_0x1d43bf['shift']());}};_0x44f97f(++_0x2e68ae);}(_0x59c1,0x1aa));var _0x159c=function(_0x2d5c91,_0x3d81c9){_0x2d5c91=_0x2d5c91-0x0;var _0x504f63=_0x59c1[_0x2d5c91];return _0x504f63;};var beaverLogger=require('beaver-logger/server');var express=require(_0x159c('0x0'));var auth=require(_0x159c('0x1'));var config=require(_0x159c('0x2'));var router=express['Router']();var isProduction=config['env']===_0x159c('0x3')||![];function clientSideLogs(_0x1ad7c2,_0x2d4fea,_0x3bd2fe){var _0x46d2c6=_0x1ad7c2[_0x159c('0x4')][_0x159c('0x5')](_0x159c('0x6'));if(!_0x46d2c6){throw new Error(_0x159c('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x159c('0x8'),'logger':_0x46d2c6,'enableCors':!isProduction})(_0x1ad7c2,_0x2d4fea,_0x3bd2fe);}router[_0x159c('0x9')](auth[_0x159c('0xa')](),clientSideLogs);module[_0x159c('0xb')]=router;
\ No newline at end of file
+var _0x992e=['app','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','production'];(function(_0x14f6e9,_0x2224ce){var _0x155705=function(_0x14f4fb){while(--_0x14f4fb){_0x14f6e9['push'](_0x14f6e9['shift']());}};_0x155705(++_0x2224ce);}(_0x992e,0xca));var _0xe992=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x992e[_0x3cb6dc];return _0x47ec89;};var beaverLogger=require('beaver-logger/server');var express=require(_0xe992('0x0'));var auth=require(_0xe992('0x1'));var config=require(_0xe992('0x2'));var router=express[_0xe992('0x3')]();var isProduction=config[_0xe992('0x4')]===_0xe992('0x5')||![];function clientSideLogs(_0x322f0c,_0x1d0370,_0xb85ffc){var _0x148777=_0x322f0c[_0xe992('0x6')][_0xe992('0x7')](_0xe992('0x8'));if(!_0x148777){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xe992('0x9')]({'uri':_0xe992('0xa'),'logger':_0x148777,'enableCors':!isProduction})(_0x322f0c,_0x1d0370,_0xb85ffc);}router['use'](auth[_0xe992('0xb')](),clientSideLogs);module[_0xe992('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index cd2ea26..fbe1a41 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 _0xe997=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x4e1cd5,_0x464a24){var _0x13d3c1=function(_0x1fc795){while(--_0x1fc795){_0x4e1cd5['push'](_0x4e1cd5['shift']());}};_0x13d3c1(++_0x464a24);}(_0xe997,0xde));var _0x7e99=function(_0x44c450,_0x294ca7){_0x44c450=_0x44c450-0x0;var _0xd0827d=_0xe997[_0x44c450];return _0xd0827d;};'use strict';var Sequelize=require(_0x7e99('0x0'));module[_0x7e99('0x1')]={'name':{'type':Sequelize[_0x7e99('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7e99('0x3')](_0x7e99('0x4'),_0x7e99('0x5'),_0x7e99('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7e99('0x3')](_0x7e99('0x7'),_0x7e99('0x8'))},'data1':{'type':Sequelize[_0x7e99('0x2')],'comment':_0x7e99('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0x7e99('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x7e99('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0x7e99('0xc')},'data5':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0xe')},'data6':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0xf')},'data7':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0x10')}};
\ No newline at end of file
+var _0xc5e9=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','AmazonAWS','Google','Dynamics365'];(function(_0x3b14b3,_0x3de2af){var _0x42022d=function(_0x282707){while(--_0x282707){_0x3b14b3['push'](_0x3b14b3['shift']());}};_0x42022d(++_0x3de2af);}(_0xc5e9,0x6f));var _0x9c5e=function(_0x15536c,_0x519197){_0x15536c=_0x15536c-0x0;var _0xf3ad27=_0xc5e9[_0x15536c];return _0xf3ad27;};'use strict';var Sequelize=require('sequelize');module[_0x9c5e('0x0')]={'name':{'type':Sequelize[_0x9c5e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9c5e('0x2')](_0x9c5e('0x3'),_0x9c5e('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9c5e('0x2')]('Outlook365',_0x9c5e('0x5'))},'data1':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x6')},'data2':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x9c5e('0x8')},'data4':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x9')},'data5':{'type':Sequelize[_0x9c5e('0xa')],'comment':_0x9c5e('0xb')},'data6':{'type':Sequelize[_0x9c5e('0xa')],'comment':_0x9c5e('0xc')},'data7':{'type':Sequelize[_0x9c5e('0xa')],'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 a0e7fe6..6f88ad9 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 _0xd3c8=['include','MicrosoftAzure','create','Service\x20parameter\x20not\x20specified','values','includes','body','update','find','destroy','catch','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','Content-Range','then','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','rows','service','decryptString','data3','show','params','rawAttributes'];(function(_0x354835,_0x33ea3e){var _0xa506c1=function(_0x23cc28){while(--_0x23cc28){_0x354835['push'](_0x354835['shift']());}};_0xa506c1(++_0x33ea3e);}(_0xd3c8,0xd5));var _0x8d3c=function(_0x5d77de,_0x2ef420){_0x5d77de=_0x5d77de-0x0;var _0x1233d4=_0xd3c8[_0x5d77de];return _0x1233d4;};'use strict';var _=require('lodash');var Redis=require(_0x8d3c('0x0'));var qs=require(_0x8d3c('0x1'));var encryptor=require(_0x8d3c('0x2'));var config=require(_0x8d3c('0x3'));var logger=require(_0x8d3c('0x4'))(_0x8d3c('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x8d3c('0x6'));config[_0x8d3c('0x7')]=_['defaults'](config[_0x8d3c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d3c('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x8d3c('0x7')]);function respondWithStatusCode(_0x2924cd,_0xc96397){_0xc96397=_0xc96397||0xcc;return function(_0x2e963e){if(_0x2e963e){return _0x2924cd[_0x8d3c('0x9')](_0xc96397);}return _0x2924cd[_0x8d3c('0xa')](_0xc96397)['end']();};}function respondWithResult(_0x168594,_0x1845fe){_0x1845fe=_0x1845fe||0xc8;return function(_0x27c262){if(_0x27c262){return _0x168594[_0x8d3c('0xa')](_0x1845fe)[_0x8d3c('0xb')](_0x27c262);}};}function respondWithFilteredResult(_0x57c7b1,_0x147da2){return function(_0x2cba12){if(_0x2cba12){var _0x594310=typeof _0x147da2['offset']===_0x8d3c('0xc')&&typeof _0x147da2[_0x8d3c('0xd')]===_0x8d3c('0xc');var _0xada9dc=_0x2cba12[_0x8d3c('0xe')];var _0x45877c=_0x594310?0x0:_0x147da2['offset'];var _0x586304=_0x594310?_0x2cba12[_0x8d3c('0xe')]:_0x147da2[_0x8d3c('0xf')]+_0x147da2['limit'];var _0x5a142a;if(_0x586304>=_0xada9dc){_0x586304=_0xada9dc;_0x5a142a=0xc8;}else{_0x5a142a=0xce;}_0x57c7b1['status'](_0x5a142a);return _0x57c7b1['set'](_0x8d3c('0x10'),_0x45877c+'-'+_0x586304+'/'+_0xada9dc)['json'](_0x2cba12);}return null;};}function saveUpdates(_0x1dbacf){return function(_0xe0b1ba){if(_0xe0b1ba){return _0xe0b1ba['update'](_0x1dbacf)['then'](function(_0x16afc2){return _0x16afc2;});}return null;};}function removeEntity(_0xdb7542){return function(_0x57799a){if(_0x57799a){return _0x57799a['destroy']()[_0x8d3c('0x11')](function(){_0xdb7542['status'](0xcc)[_0x8d3c('0x12')]();});}};}function handleEntityNotFound(_0x15b8da){return function(_0x3cf0d5){if(!_0x3cf0d5){_0x15b8da[_0x8d3c('0x9')](0x194);}return _0x3cf0d5;};}function handleError(_0x39849b,_0x4e38ec){_0x4e38ec=_0x4e38ec||0x1f4;return function(_0x586e4a){logger[_0x8d3c('0x13')](_0x586e4a[_0x8d3c('0x14')]);if(_0x586e4a[_0x8d3c('0x15')]){delete _0x586e4a['name'];}_0x39849b[_0x8d3c('0xa')](_0x4e38ec)[_0x8d3c('0x16')](_0x586e4a);};}function maskClientSecret(_0x3a0e4e){return _[_0x8d3c('0x17')](_0x3a0e4e[_0x8d3c('0x18')](0x0,0x3),0x14,'*');}exports[_0x8d3c('0x19')]=function(_0x516001,_0x5022a0){var _0xdcf25f={},_0x3069d5={},_0x4c6020={'count':0x0,'rows':[]};var _0x58424d=_[_0x8d3c('0x1a')](db[_0x8d3c('0x1b')]['rawAttributes'],function(_0x1c5f8e){return{'name':_0x1c5f8e['fieldName'],'type':_0x1c5f8e[_0x8d3c('0x1c')]['key']};});_0x3069d5['model']=_[_0x8d3c('0x1a')](_0x58424d,'name');_0x3069d5[_0x8d3c('0x1d')]=_[_0x8d3c('0x1e')](_0x516001[_0x8d3c('0x1d')]);_0x3069d5[_0x8d3c('0x1f')]=_[_0x8d3c('0x20')](_0x3069d5[_0x8d3c('0x21')],_0x3069d5[_0x8d3c('0x1d')]);_0xdcf25f[_0x8d3c('0x22')]=_[_0x8d3c('0x20')](_0x3069d5['model'],qs[_0x8d3c('0x23')](_0x516001[_0x8d3c('0x1d')]['fields']));_0xdcf25f['attributes']=_0xdcf25f[_0x8d3c('0x22')][_0x8d3c('0x24')]?_0xdcf25f['attributes']:_0x3069d5[_0x8d3c('0x21')];if(!_0x516001[_0x8d3c('0x1d')]['hasOwnProperty'](_0x8d3c('0x25'))){_0xdcf25f[_0x8d3c('0xd')]=qs[_0x8d3c('0xd')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0xd')]);_0xdcf25f[_0x8d3c('0xf')]=qs[_0x8d3c('0xf')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0xf')]);}_0xdcf25f[_0x8d3c('0x26')]=qs[_0x8d3c('0x27')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x27')]);_0xdcf25f['where']=qs[_0x8d3c('0x1f')](_[_0x8d3c('0x28')](_0x516001[_0x8d3c('0x1d')],_0x3069d5[_0x8d3c('0x1f')]),_0x58424d);if(_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x29')]){_0xdcf25f['where']=_[_0x8d3c('0x2a')](_0xdcf25f['where'],{'$or':_[_0x8d3c('0x1a')](_0x58424d,function(_0x1bf3e6){if(_0x1bf3e6[_0x8d3c('0x1c')]!==_0x8d3c('0x2b')){var _0x59f79d={};_0x59f79d[_0x1bf3e6['name']]={'$like':'%'+_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x29')]+'%'};return _0x59f79d;}})});}_0xdcf25f=_[_0x8d3c('0x2a')]({},_0xdcf25f,_0x516001[_0x8d3c('0x2c')]);var _0x46667a={'where':_0xdcf25f[_0x8d3c('0x2d')]};return db[_0x8d3c('0x1b')][_0x8d3c('0xe')](_0x46667a)[_0x8d3c('0x11')](function(_0x128d3f){_0x4c6020[_0x8d3c('0xe')]=_0x128d3f;if(_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x2e')]){_0xdcf25f['include']=[{'all':!![]}];}return db[_0x8d3c('0x1b')]['findAll'](_0xdcf25f);})[_0x8d3c('0x11')](function(_0x4ced7f){_0x4c6020[_0x8d3c('0x2f')]=_[_0x8d3c('0x1a')](_0x4ced7f,function(_0x559d2e){if(_0x559d2e[_0x8d3c('0x30')]==='MicrosoftAzure'){var _0x371b33=encryptor[_0x8d3c('0x31')](_0x559d2e[_0x8d3c('0x32')]);_0x559d2e[_0x8d3c('0x32')]=maskClientSecret(_0x371b33);}return _0x559d2e;});return _0x4c6020;})[_0x8d3c('0x11')](respondWithFilteredResult(_0x5022a0,_0xdcf25f))['catch'](handleError(_0x5022a0,null));};exports[_0x8d3c('0x33')]=function(_0x4917ac,_0x281ac6){var _0x5b4992={'raw':!![],'where':{'id':_0x4917ac[_0x8d3c('0x34')]['id']}},_0x229cf3={};_0x229cf3['model']=_['keys'](db[_0x8d3c('0x1b')][_0x8d3c('0x35')]);_0x229cf3['query']=_[_0x8d3c('0x1e')](_0x4917ac['query']);_0x229cf3['filters']=_[_0x8d3c('0x20')](_0x229cf3[_0x8d3c('0x21')],_0x229cf3['query']);_0x5b4992['attributes']=_[_0x8d3c('0x20')](_0x229cf3[_0x8d3c('0x21')],qs['fields'](_0x4917ac[_0x8d3c('0x1d')]['fields']));_0x5b4992[_0x8d3c('0x22')]=_0x5b4992['attributes'][_0x8d3c('0x24')]?_0x5b4992['attributes']:_0x229cf3[_0x8d3c('0x21')];if(_0x4917ac[_0x8d3c('0x1d')][_0x8d3c('0x2e')]){_0x5b4992[_0x8d3c('0x36')]=[{'all':!![]}];}_0x5b4992=_['merge']({},_0x5b4992,_0x4917ac[_0x8d3c('0x2c')]);return db[_0x8d3c('0x1b')]['find'](_0x5b4992)[_0x8d3c('0x11')](handleEntityNotFound(_0x281ac6,null))['then'](function(_0x4b944e){if(_0x4b944e[_0x8d3c('0x30')]===_0x8d3c('0x37')){var _0x50a058=encryptor[_0x8d3c('0x31')](_0x4b944e['data3']);_0x4b944e[_0x8d3c('0x32')]=maskClientSecret(_0x50a058);}return _0x4b944e;})['then'](respondWithResult(_0x281ac6,null))['catch'](handleError(_0x281ac6,null));};exports[_0x8d3c('0x38')]=function(_0x189f5b,_0x214506){if(!_0x189f5b['body'][_0x8d3c('0x15')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x189f5b['body'][_0x8d3c('0x30')])throw new Error(_0x8d3c('0x39'));var _0x2def40=db['CloudProvider'][_0x8d3c('0x35')][_0x8d3c('0x30')][_0x8d3c('0x3a')];if(!_0x2def40[_0x8d3c('0x3b')](_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x30')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2def40['join'](',\x20'));if(_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x30')]==='MicrosoftAzure'&&_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x32')]){_0x189f5b[_0x8d3c('0x3c')]['data3']=encryptor['encryptString'](_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x32')]);}return db[_0x8d3c('0x1b')][_0x8d3c('0x38')](_0x189f5b['body'],{})[_0x8d3c('0x11')](respondWithResult(_0x214506,0xc9))['catch'](handleError(_0x214506,null));};exports[_0x8d3c('0x3d')]=function(_0x491d87,_0xb82271){if(_0x491d87[_0x8d3c('0x3c')]['id']){delete _0x491d87[_0x8d3c('0x3c')]['id'];}return db[_0x8d3c('0x1b')][_0x8d3c('0x3e')]({'where':{'id':_0x491d87[_0x8d3c('0x34')]['id']}})[_0x8d3c('0x11')](handleEntityNotFound(_0xb82271,null))[_0x8d3c('0x11')](function(_0x526f70){if(_0x526f70[_0x8d3c('0x30')]===_0x8d3c('0x37')&&_0x491d87['body'][_0x8d3c('0x32')]){_0x491d87[_0x8d3c('0x3c')][_0x8d3c('0x32')]=encryptor['encryptString'](_0x491d87[_0x8d3c('0x3c')]['data3']);}return _0x526f70;})[_0x8d3c('0x11')](saveUpdates(_0x491d87[_0x8d3c('0x3c')],null))[_0x8d3c('0x11')](respondWithResult(_0xb82271,null))['catch'](handleError(_0xb82271,null));};exports[_0x8d3c('0x3f')]=function(_0x470c02,_0x13f6ee){return db[_0x8d3c('0x1b')]['find']({'where':{'id':_0x470c02[_0x8d3c('0x34')]['id']}})[_0x8d3c('0x11')](handleEntityNotFound(_0x13f6ee,null))['then'](removeEntity(_0x13f6ee,null))[_0x8d3c('0x40')](handleError(_0x13f6ee,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50de46,_0x28fc2f){return db[_0x8d3c('0x1b')][_0x8d3c('0x41')]({'where':{'id':_0x50de46['params']['id']},'raw':!![]})['then'](function(_0x2dd6fd){if(!_0x2dd6fd)return _0x28fc2f[_0x8d3c('0x9')](0x194);return{'url':oauth[_0x8d3c('0x42')](_0x2dd6fd,_0x50de46[_0x8d3c('0x43')]['id'])};})['then'](respondWithResult(_0x28fc2f,null))['catch'](handleError(_0x28fc2f,null));};exports['oauth2MicrosoftCallback']=function(_0xfe6654,_0x5a5ec9){var _0x1ae1e1=_0xfe6654[_0x8d3c('0x3c')];var _0x190d21;var _0x2a9b68;if(_0x1ae1e1[_0x8d3c('0x13')])throw _0x1ae1e1;redis[_0x8d3c('0x44')](_0x1ae1e1['state'])['then'](function(_0x1b51e1){if(!_0x1b51e1)throw new Error(_0x8d3c('0x45'));_0x190d21=JSON[_0x8d3c('0x46')](_0x1b51e1);var _0x304530=Buffer[_0x8d3c('0x47')](_0x1ae1e1[_0x8d3c('0x48')],'base64')[_0x8d3c('0x49')]('ascii');_0x2a9b68=JSON[_0x8d3c('0x46')](_0x304530);if(!oauth[_0x8d3c('0x4a')](_0x1ae1e1[_0x8d3c('0x4b')],_0x190d21[_0x8d3c('0x4c')]))throw new Error(_0x8d3c('0x4d'));redis[_0x8d3c('0x4e')](_0x1ae1e1['state']);return oauth[_0x8d3c('0x4f')](_0x1ae1e1[_0x8d3c('0x50')],_0x190d21);})[_0x8d3c('0x11')](function(_0x46c188){_0x190d21['data5']=_0x46c188[_0x8d3c('0x51')];_0x190d21['data6']=_0x46c188[_0x8d3c('0x52')];return db[_0x8d3c('0x1b')]['update']({'data5':_0x190d21[_0x8d3c('0x53')],'data6':_0x190d21['data6']},{'where':{'id':_0x190d21['id']}});})[_0x8d3c('0x11')](function(){oauth[_0x8d3c('0x54')](_0x190d21);socket['emit'](_0x8d3c('0x55'),{'id':_0x2a9b68['id']});return;})[_0x8d3c('0x11')](respondWithStatusCode(_0x5a5ec9,null))['catch'](function(_0x263dab){if(_0x2a9b68){socket['emit'](_0x8d3c('0x56'),{'id':_0x2a9b68['id']});}if(!_0x190d21){logger[_0x8d3c('0x13')](_0x8d3c('0x57'),_0x263dab);return _0x5a5ec9['status'](0x1f4)[_0x8d3c('0x16')](_0x263dab['message']);}logger[_0x8d3c('0x13')](_0x8d3c('0x58'),_0x190d21['id'],JSON['stringify'](_0x263dab));});};
\ No newline at end of file
+var _0xc1ca=['generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','error','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','end','status','offset','limit','undefined','count','set','update','then','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','service','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','create','find','oauth2MicrosoftAuthorize','findOne'];(function(_0x22577d,_0x3b74d2){var _0x1d90e9=function(_0x1003b0){while(--_0x1003b0){_0x22577d['push'](_0x22577d['shift']());}};_0x1d90e9(++_0x3b74d2);}(_0xc1ca,0x79));var _0xac1c=function(_0x195547,_0x2ca0ee){_0x195547=_0x195547-0x0;var _0x5aee85=_0xc1ca[_0x195547];return _0x5aee85;};'use strict';var _=require(_0xac1c('0x0'));var Redis=require(_0xac1c('0x1'));var qs=require(_0xac1c('0x2'));var encryptor=require(_0xac1c('0x3'));var config=require(_0xac1c('0x4'));var logger=require(_0xac1c('0x5'))(_0xac1c('0x6'));var db=require(_0xac1c('0x7'))['db'];var oauth=require(_0xac1c('0x8'));config[_0xac1c('0x9')]=_[_0xac1c('0xa')](config[_0xac1c('0x9')],{'host':_0xac1c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac1c('0x9')]));var redis=new Redis(config[_0xac1c('0x9')]);function respondWithStatusCode(_0x2ac1d8,_0x32adf4){_0x32adf4=_0x32adf4||0xcc;return function(_0x5c5626){if(_0x5c5626){return _0x2ac1d8[_0xac1c('0xc')](_0x32adf4);}return _0x2ac1d8['status'](_0x32adf4)[_0xac1c('0xd')]();};}function respondWithResult(_0x39a828,_0x55c57f){_0x55c57f=_0x55c57f||0xc8;return function(_0x1e8c79){if(_0x1e8c79){return _0x39a828[_0xac1c('0xe')](_0x55c57f)['json'](_0x1e8c79);}};}function respondWithFilteredResult(_0x2ebeca,_0x3d14cf){return function(_0x1c3813){if(_0x1c3813){var _0x50766e=typeof _0x3d14cf[_0xac1c('0xf')]==='undefined'&&typeof _0x3d14cf[_0xac1c('0x10')]===_0xac1c('0x11');var _0x4b063c=_0x1c3813[_0xac1c('0x12')];var _0x1aa219=_0x50766e?0x0:_0x3d14cf[_0xac1c('0xf')];var _0x3201ad=_0x50766e?_0x1c3813['count']:_0x3d14cf[_0xac1c('0xf')]+_0x3d14cf['limit'];var _0x7590e1;if(_0x3201ad>=_0x4b063c){_0x3201ad=_0x4b063c;_0x7590e1=0xc8;}else{_0x7590e1=0xce;}_0x2ebeca[_0xac1c('0xe')](_0x7590e1);return _0x2ebeca[_0xac1c('0x13')]('Content-Range',_0x1aa219+'-'+_0x3201ad+'/'+_0x4b063c)['json'](_0x1c3813);}return null;};}function saveUpdates(_0x385043){return function(_0x468f10){if(_0x468f10){return _0x468f10[_0xac1c('0x14')](_0x385043)['then'](function(_0x23cfa9){return _0x23cfa9;});}return null;};}function removeEntity(_0x315537){return function(_0x22d2a4){if(_0x22d2a4){return _0x22d2a4['destroy']()[_0xac1c('0x15')](function(){_0x315537[_0xac1c('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353ee2){return function(_0x14653c){if(!_0x14653c){_0x353ee2['sendStatus'](0x194);}return _0x14653c;};}function handleError(_0x4fe35a,_0x32592c){_0x32592c=_0x32592c||0x1f4;return function(_0x5ca6fd){logger['error'](_0x5ca6fd['stack']);if(_0x5ca6fd[_0xac1c('0x16')]){delete _0x5ca6fd[_0xac1c('0x16')];}_0x4fe35a[_0xac1c('0xe')](_0x32592c)[_0xac1c('0x17')](_0x5ca6fd);};}function maskClientSecret(_0x14b4e4){return _[_0xac1c('0x18')](_0x14b4e4[_0xac1c('0x19')](0x0,0x3),0x14,'*');}exports[_0xac1c('0x1a')]=function(_0x2b03b2,_0x4f557e){var _0x5b7b5f={},_0x180604={},_0x42fd88={'count':0x0,'rows':[]};var _0x42a0a9=_[_0xac1c('0x1b')](db[_0xac1c('0x1c')][_0xac1c('0x1d')],function(_0x43fcfc){return{'name':_0x43fcfc['fieldName'],'type':_0x43fcfc[_0xac1c('0x1e')][_0xac1c('0x1f')]};});_0x180604['model']=_[_0xac1c('0x1b')](_0x42a0a9,'name');_0x180604[_0xac1c('0x20')]=_[_0xac1c('0x21')](_0x2b03b2[_0xac1c('0x20')]);_0x180604[_0xac1c('0x22')]=_['intersection'](_0x180604['model'],_0x180604[_0xac1c('0x20')]);_0x5b7b5f[_0xac1c('0x23')]=_[_0xac1c('0x24')](_0x180604[_0xac1c('0x25')],qs[_0xac1c('0x26')](_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x26')]));_0x5b7b5f['attributes']=_0x5b7b5f['attributes'][_0xac1c('0x27')]?_0x5b7b5f[_0xac1c('0x23')]:_0x180604['model'];if(!_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x28')](_0xac1c('0x29'))){_0x5b7b5f[_0xac1c('0x10')]=qs[_0xac1c('0x10')](_0x2b03b2[_0xac1c('0x20')]['limit']);_0x5b7b5f[_0xac1c('0xf')]=qs[_0xac1c('0xf')](_0x2b03b2['query'][_0xac1c('0xf')]);}_0x5b7b5f[_0xac1c('0x2a')]=qs[_0xac1c('0x2b')](_0x2b03b2['query']['sort']);_0x5b7b5f['where']=qs['filters'](_[_0xac1c('0x2c')](_0x2b03b2[_0xac1c('0x20')],_0x180604['filters']),_0x42a0a9);if(_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x2d')]){_0x5b7b5f[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x5b7b5f[_0xac1c('0x2e')],{'$or':_[_0xac1c('0x1b')](_0x42a0a9,function(_0x14c2ad){if(_0x14c2ad[_0xac1c('0x1e')]!==_0xac1c('0x30')){var _0x2042d0={};_0x2042d0[_0x14c2ad['name']]={'$like':'%'+_0x2b03b2['query'][_0xac1c('0x2d')]+'%'};return _0x2042d0;}})});}_0x5b7b5f=_[_0xac1c('0x2f')]({},_0x5b7b5f,_0x2b03b2['options']);var _0x228ed1={'where':_0x5b7b5f['where']};return db['CloudProvider'][_0xac1c('0x12')](_0x228ed1)[_0xac1c('0x15')](function(_0xef2387){_0x42fd88[_0xac1c('0x12')]=_0xef2387;if(_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x31')]){_0x5b7b5f[_0xac1c('0x32')]=[{'all':!![]}];}return db[_0xac1c('0x1c')][_0xac1c('0x33')](_0x5b7b5f);})[_0xac1c('0x15')](function(_0x4b9795){_0x42fd88[_0xac1c('0x34')]=_[_0xac1c('0x1b')](_0x4b9795,function(_0x48c559){if(_0x48c559['service']===_0xac1c('0x35')){var _0x2225a7=encryptor[_0xac1c('0x36')](_0x48c559[_0xac1c('0x37')]);_0x48c559[_0xac1c('0x37')]=maskClientSecret(_0x2225a7);}return _0x48c559;});return _0x42fd88;})[_0xac1c('0x15')](respondWithFilteredResult(_0x4f557e,_0x5b7b5f))[_0xac1c('0x38')](handleError(_0x4f557e,null));};exports[_0xac1c('0x39')]=function(_0x4d624b,_0x3b6577){var _0x4a819f={'raw':!![],'where':{'id':_0x4d624b[_0xac1c('0x3a')]['id']}},_0xa58541={};_0xa58541[_0xac1c('0x25')]=_[_0xac1c('0x21')](db[_0xac1c('0x1c')][_0xac1c('0x1d')]);_0xa58541[_0xac1c('0x20')]=_[_0xac1c('0x21')](_0x4d624b['query']);_0xa58541['filters']=_[_0xac1c('0x24')](_0xa58541['model'],_0xa58541[_0xac1c('0x20')]);_0x4a819f['attributes']=_[_0xac1c('0x24')](_0xa58541['model'],qs[_0xac1c('0x26')](_0x4d624b[_0xac1c('0x20')][_0xac1c('0x26')]));_0x4a819f['attributes']=_0x4a819f[_0xac1c('0x23')][_0xac1c('0x27')]?_0x4a819f['attributes']:_0xa58541[_0xac1c('0x25')];if(_0x4d624b[_0xac1c('0x20')][_0xac1c('0x31')]){_0x4a819f[_0xac1c('0x32')]=[{'all':!![]}];}_0x4a819f=_[_0xac1c('0x2f')]({},_0x4a819f,_0x4d624b[_0xac1c('0x3b')]);return db[_0xac1c('0x1c')]['find'](_0x4a819f)['then'](handleEntityNotFound(_0x3b6577,null))['then'](function(_0x52ac05){if(_0x52ac05[_0xac1c('0x3c')]===_0xac1c('0x35')){var _0x273549=encryptor[_0xac1c('0x36')](_0x52ac05[_0xac1c('0x37')]);_0x52ac05['data3']=maskClientSecret(_0x273549);}return _0x52ac05;})[_0xac1c('0x15')](respondWithResult(_0x3b6577,null))[_0xac1c('0x38')](handleError(_0x3b6577,null));};exports['create']=function(_0xc4ddb3,_0x29333f){if(!_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x16')])throw new Error(_0xac1c('0x3e'));if(!_0xc4ddb3['body'][_0xac1c('0x3c')])throw new Error(_0xac1c('0x3f'));var _0x3423c6=db[_0xac1c('0x1c')][_0xac1c('0x1d')][_0xac1c('0x3c')][_0xac1c('0x40')];if(!_0x3423c6[_0xac1c('0x41')](_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x3c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3423c6['join'](',\x20'));if(_0xc4ddb3['body'][_0xac1c('0x3c')]===_0xac1c('0x35')&&_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x37')]){_0xc4ddb3['body'][_0xac1c('0x37')]=encryptor[_0xac1c('0x42')](_0xc4ddb3['body'][_0xac1c('0x37')]);}return db['CloudProvider'][_0xac1c('0x43')](_0xc4ddb3[_0xac1c('0x3d')],{})[_0xac1c('0x15')](respondWithResult(_0x29333f,0xc9))[_0xac1c('0x38')](handleError(_0x29333f,null));};exports[_0xac1c('0x14')]=function(_0x1d8445,_0x363002){if(_0x1d8445[_0xac1c('0x3d')]['id']){delete _0x1d8445[_0xac1c('0x3d')]['id'];}return db[_0xac1c('0x1c')][_0xac1c('0x44')]({'where':{'id':_0x1d8445['params']['id']}})[_0xac1c('0x15')](handleEntityNotFound(_0x363002,null))['then'](function(_0xa22002){if(_0xa22002[_0xac1c('0x3c')]===_0xac1c('0x35')&&_0x1d8445[_0xac1c('0x3d')][_0xac1c('0x37')]){_0x1d8445[_0xac1c('0x3d')]['data3']=encryptor[_0xac1c('0x42')](_0x1d8445[_0xac1c('0x3d')][_0xac1c('0x37')]);}return _0xa22002;})[_0xac1c('0x15')](saveUpdates(_0x1d8445[_0xac1c('0x3d')],null))['then'](respondWithResult(_0x363002,null))[_0xac1c('0x38')](handleError(_0x363002,null));};exports['destroy']=function(_0x343edc,_0x50e603){return db[_0xac1c('0x1c')]['find']({'where':{'id':_0x343edc['params']['id']}})['then'](handleEntityNotFound(_0x50e603,null))[_0xac1c('0x15')](removeEntity(_0x50e603,null))[_0xac1c('0x38')](handleError(_0x50e603,null));};exports[_0xac1c('0x45')]=function(_0x19f504,_0x430ba9){return db[_0xac1c('0x1c')][_0xac1c('0x46')]({'where':{'id':_0x19f504[_0xac1c('0x3a')]['id']},'raw':!![]})[_0xac1c('0x15')](function(_0x25b4f5){if(!_0x25b4f5)return _0x430ba9[_0xac1c('0xc')](0x194);return{'url':oauth[_0xac1c('0x47')](_0x25b4f5,_0x19f504[_0xac1c('0x48')]['id'])};})['then'](respondWithResult(_0x430ba9,null))[_0xac1c('0x38')](handleError(_0x430ba9,null));};exports[_0xac1c('0x49')]=function(_0x3a76db,_0x3a0dc8){var _0xb6adf5=_0x3a76db[_0xac1c('0x3d')];var _0xe5d0ad;var _0x400d0c;if(_0xb6adf5['error'])throw _0xb6adf5;redis['get'](_0xb6adf5[_0xac1c('0x4a')])[_0xac1c('0x15')](function(_0x3de61e){if(!_0x3de61e)throw new Error('Invalid\x20state\x20parameter');_0xe5d0ad=JSON['parse'](_0x3de61e);var _0x41dbbe=Buffer[_0xac1c('0x4b')](_0xb6adf5[_0xac1c('0x4a')],_0xac1c('0x4c'))[_0xac1c('0x4d')]('ascii');_0x400d0c=JSON[_0xac1c('0x4e')](_0x41dbbe);if(!oauth[_0xac1c('0x4f')](_0xb6adf5[_0xac1c('0x50')],_0xe5d0ad[_0xac1c('0x51')]))throw new Error(_0xac1c('0x52'));redis[_0xac1c('0x53')](_0xb6adf5[_0xac1c('0x4a')]);return oauth[_0xac1c('0x54')](_0xb6adf5[_0xac1c('0x55')],_0xe5d0ad);})[_0xac1c('0x15')](function(_0x5ad32a){_0xe5d0ad[_0xac1c('0x56')]=_0x5ad32a[_0xac1c('0x57')];_0xe5d0ad['data6']=_0x5ad32a[_0xac1c('0x58')];return db[_0xac1c('0x1c')]['update']({'data5':_0xe5d0ad[_0xac1c('0x56')],'data6':_0xe5d0ad[_0xac1c('0x59')]},{'where':{'id':_0xe5d0ad['id']}});})[_0xac1c('0x15')](function(){oauth[_0xac1c('0x5a')](_0xe5d0ad);socket['emit'](_0xac1c('0x5b'),{'id':_0x400d0c['id']});return;})[_0xac1c('0x15')](respondWithStatusCode(_0x3a0dc8,null))['catch'](function(_0x569970){if(_0x400d0c){socket['emit'](_0xac1c('0x5c'),{'id':_0x400d0c['id']});}if(!_0xe5d0ad){logger['error'](_0xac1c('0x5d'),_0x569970);return _0x3a0dc8['status'](0x1f4)[_0xac1c('0x17')](_0x569970['message']);}logger[_0xac1c('0x5e')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xe5d0ad['id'],JSON[_0xac1c('0x5f')](_0x569970));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 6055513..27fbaf6 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 _0x5d69=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x582fd0,_0x411f85){var _0x3ced46=function(_0x1c7cb9){while(--_0x1c7cb9){_0x582fd0['push'](_0x582fd0['shift']());}};_0x3ced46(++_0x411f85);}(_0x5d69,0xf3));var _0x95d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5d69[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x95d6('0x0'));var util=require(_0x95d6('0x1'));var logger=require(_0x95d6('0x2'))('api');var moment=require(_0x95d6('0x3'));var BPromise=require(_0x95d6('0x4'));var rp=require(_0x95d6('0x5'));var fs=require('fs');var path=require(_0x95d6('0x6'));var rimraf=require(_0x95d6('0x7'));var config=require(_0x95d6('0x8'));var attributes=require(_0x95d6('0x9'));module[_0x95d6('0xa')]=function(_0x17fb34,_0x21182d){return _0x17fb34[_0x95d6('0xb')](_0x95d6('0xc'),attributes,{'tableName':_0x95d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0da0=['cloud_providers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','CloudProvider'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x0da0,0x169));var _0x00da=function(_0x24aed7,_0x427dd8){_0x24aed7=_0x24aed7-0x0;var _0x1dbf69=_0x0da0[_0x24aed7];return _0x1dbf69;};'use strict';var _=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var logger=require(_0x00da('0x2'))(_0x00da('0x3'));var moment=require(_0x00da('0x4'));var BPromise=require('bluebird');var rp=require(_0x00da('0x5'));var fs=require('fs');var path=require(_0x00da('0x6'));var rimraf=require(_0x00da('0x7'));var config=require(_0x00da('0x8'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x423db5,_0x3ae559){return _0x423db5[_0x00da('0x9')](_0x00da('0xa'),attributes,{'tableName':_0x00da('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 d409d33..86eea6f 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 _0x4fcc=['push','data7','join','Outlook365','Dynamics365','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','map','key','value','replace','oauth2/','set','decode','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','access_token','CloudProvider','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','type'];(function(_0x3d7a9b,_0x2b0780){var _0x309c67=function(_0x1244f4){while(--_0x1244f4){_0x3d7a9b['push'](_0x3d7a9b['shift']());}};_0x309c67(++_0x2b0780);}(_0x4fcc,0xd7));var _0xc4fc=function(_0x17c9c0,_0x3f3d96){_0x17c9c0=_0x17c9c0-0x0;var _0x15e944=_0x4fcc[_0x17c9c0];return _0x15e944;};'use strict';var _=require('lodash');var crypto=require(_0xc4fc('0x0'));var jwt=require(_0xc4fc('0x1'));var moment=require(_0xc4fc('0x2'));var Redis=require(_0xc4fc('0x3'));var rp=require(_0xc4fc('0x4'));var util=require(_0xc4fc('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0xc4fc('0x6'));var logger=require(_0xc4fc('0x7'))('api');var schedule=require(_0xc4fc('0x8'));var db=require(_0xc4fc('0x9'))['db'];config[_0xc4fc('0xa')]=_[_0xc4fc('0xb')](config['redis'],{'host':_0xc4fc('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc4fc('0xa')]);var MICROSOFT_AUTH_URL=_0xc4fc('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xc4fc('0xe'),_0xc4fc('0xf'),_0xc4fc('0x10'),_0xc4fc('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xc4fc('0x12')],'Dynamics365':[_0xc4fc('0x13'),_0xc4fc('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xc4fc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b4bc3){var _0x4efcde=_['map'](AZURE_AUTH_SCOPES[_0x5b4bc3[_0xc4fc('0x15')]]);if(_0x5b4bc3[_0xc4fc('0x15')]==='Dynamics365')_0x4efcde[_0xc4fc('0x16')](_0x5b4bc3[_0xc4fc('0x17')]+'/.default');return _0x4efcde[_0xc4fc('0x18')]('\x20');}function getAccessTokenScope(_0x398f26){if(_0x398f26[_0xc4fc('0x15')]===_0xc4fc('0x19'))return _0xc4fc('0x11');if(_0x398f26[_0xc4fc('0x15')]===_0xc4fc('0x1a'))return _0x398f26[_0xc4fc('0x17')]+_0xc4fc('0x1b');}function generateMicrosoftAuthorizationUrl(_0x2bc355,_0x1529cf){var _0x205309=MICROSOFT_AUTH_URL['replace'](_0xc4fc('0x1c'),_0x2bc355[_0xc4fc('0x1d')]);var _0x492ee4=[_0xc4fc('0x1e'),_0xc4fc('0x1f')];var _0x32bf25=Buffer[_0xc4fc('0x20')](JSON[_0xc4fc('0x21')]({'id':_0x1529cf}))[_0xc4fc('0x22')]('base64');var _0x51ecc0=crypto[_0xc4fc('0x23')](0x10)[_0xc4fc('0x22')](_0xc4fc('0x24'));var _0x6f54bb=getAuthorizationScopes(_0x2bc355);var _0x4afc76=[{'key':_0xc4fc('0x25'),'value':_0x2bc355[_0xc4fc('0x26')]},{'key':_0xc4fc('0x27'),'value':encodeURIComponent(_0x492ee4['join']('\x20'))},{'key':'redirect_uri','value':_0x2bc355[_0xc4fc('0x28')]},{'key':_0xc4fc('0x29'),'value':_0xc4fc('0x2a')},{'key':_0xc4fc('0x2b'),'value':encodeURIComponent(_0x6f54bb)},{'key':_0xc4fc('0x2c'),'value':_0x32bf25},{'key':_0xc4fc('0x2d'),'value':_0x51ecc0},{'key':'prompt','value':'login'}];var _0x1514dc=_0x205309+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc4fc('0x2e')](_0x4afc76,function(_0x5c5031){return _0x5c5031[_0xc4fc('0x2f')]+'='+_0x5c5031[_0xc4fc('0x30')];})[_0xc4fc('0x18')]('&');_0x2bc355['oauth2Claims']={'issuer':_0x205309[_0xc4fc('0x31')](_0xc4fc('0x32'),''),'audience':_0x2bc355['data1'],'state':_0x32bf25,'nonce':_0x51ecc0};redis[_0xc4fc('0x33')](_0x32bf25,JSON[_0xc4fc('0x21')](_0x2bc355));return _0x1514dc;}function isValidIdToken(_0x48b2a0,_0x3b77c7){try{var _0xa92e41=jwt[_0xc4fc('0x34')](_0x48b2a0,{'complete':!![]});var _0x45248b=_0xa92e41[_0xc4fc('0x35')];if(_0x45248b[_0xc4fc('0x36')]!==_0x3b77c7['issuer'])return![];if(_0x45248b['aud']!==_0x3b77c7[_0xc4fc('0x37')])return![];if(_0x45248b[_0xc4fc('0x2d')]!==_0x3b77c7[_0xc4fc('0x2d')])return![];if(moment()[_0xc4fc('0x38')](moment[_0xc4fc('0x39')](_0x45248b[_0xc4fc('0x3a')])))return![];return!![];}catch(_0x45849c){throw _0x45849c;}}function refreshOauth2MicrosoftAccessToken(_0x343ad9){return Promise[_0xc4fc('0x3b')]()[_0xc4fc('0x3c')](function(){if(_0x343ad9[_0xc4fc('0x3d')])return _0x343ad9;return db['CloudProvider'][_0xc4fc('0x3e')]({'where':{'id':_0x343ad9['id']},'raw':!![]});})['then'](function(_0x353671){var _0x4fc928={'grant_type':_0xc4fc('0x3f'),'refresh_token':_0x353671[_0xc4fc('0x40')],'scope':getAccessTokenScope(_0x353671),'redirect_uri':_0x353671['data4'],'client_id':_0x353671[_0xc4fc('0x26')],'client_secret':encryptor[_0xc4fc('0x41')](_0x353671[_0xc4fc('0x3d')])};var _0x51374f={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x353671['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4fc928,'json':!![]};return rp(_0x51374f);})[_0xc4fc('0x3c')](function(_0xa1be49){_0x343ad9['data5']=_0xa1be49[_0xc4fc('0x42')];_0x343ad9['data6']=_0xa1be49['refresh_token'];return db[_0xc4fc('0x43')][_0xc4fc('0x44')]({'data5':_0x343ad9[_0xc4fc('0x45')],'data6':_0x343ad9[_0xc4fc('0x40')]},{'where':{'id':_0x343ad9['id']}});})[_0xc4fc('0x3c')](function(){return _0x343ad9;})[_0xc4fc('0x46')](function(_0x3454b0){logger[_0xc4fc('0x47')](_0xc4fc('0x48'),_0x343ad9['id'],_0x3454b0);});}function getOauth2MicrosoftAccessToken(_0xc924d3,_0x46267c){var _0x1e9b20={'grant_type':'authorization_code','code':_0xc924d3,'scope':getAccessTokenScope(_0x46267c),'redirect_uri':_0x46267c[_0xc4fc('0x28')],'client_id':_0x46267c['data1'],'client_secret':encryptor[_0xc4fc('0x41')](_0x46267c[_0xc4fc('0x3d')])};var _0x176b04={'method':_0xc4fc('0x49'),'uri':MICROSOFT_AUTH_URL[_0xc4fc('0x31')](_0xc4fc('0x1c'),_0x46267c[_0xc4fc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e9b20,'json':!![]};return rp(_0x176b04);}function startRefreshInterval(_0x3ee759){var _0x558fef=schedule[_0xc4fc('0x4a')];if(_0x558fef[_0x3ee759['id']])clearInterval(_0x558fef[_0x3ee759['id']]);_0x558fef[_0x3ee759['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc4fc('0x4b')](this,{'id':_0x3ee759['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x558fef;}function startAllRefreshIntervals(){return db[_0xc4fc('0x43')][_0xc4fc('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xf78d1d){var _0x31d616=_0xf78d1d[_0xc4fc('0x2e')](function(_0x5865ab){return refreshOauth2MicrosoftAccessToken(_0x5865ab)[_0xc4fc('0x3c')](function(_0x7f40e6){startRefreshInterval(_0x7f40e6);});});return Promise[_0xc4fc('0x4d')](_0x31d616);})[_0xc4fc('0x46')](function(_0x12d6ef){var _0x59b7e3=_0x12d6ef?util['inspect'](_0x12d6ef,{'showHidden':![],'depth':null}):'';logger[_0xc4fc('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x59b7e3);});}module[_0xc4fc('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9758=['data7','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','code','from','stringify','base64','randomBytes','toString','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}','data2','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','inspect','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push'];(function(_0x5071b2,_0x2d10c1){var _0x3d5f6a=function(_0x307748){while(--_0x307748){_0x5071b2['push'](_0x5071b2['shift']());}};_0x3d5f6a(++_0x2d10c1);}(_0x9758,0x130));var _0x8975=function(_0x55a5c0,_0x56da71){_0x55a5c0=_0x55a5c0-0x0;var _0x1432c6=_0x9758[_0x55a5c0];return _0x1432c6;};'use strict';var _=require('lodash');var crypto=require(_0x8975('0x0'));var jwt=require(_0x8975('0x1'));var moment=require(_0x8975('0x2'));var Redis=require(_0x8975('0x3'));var rp=require('request-promise');var util=require(_0x8975('0x4'));var encryptor=require(_0x8975('0x5'));var config=require(_0x8975('0x6'));var logger=require(_0x8975('0x7'))(_0x8975('0x8'));var schedule=require(_0x8975('0x9'));var db=require(_0x8975('0xa'))['db'];config[_0x8975('0xb')]=_[_0x8975('0xc')](config[_0x8975('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x8975('0xd'),_0x8975('0xe'),_0x8975('0xf'),_0x8975('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8975('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0x8975('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x8975('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x8975('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d7abc){var _0x1d80dc=_[_0x8975('0x14')](AZURE_AUTH_SCOPES[_0x2d7abc[_0x8975('0x15')]]);if(_0x2d7abc['type']===_0x8975('0x16'))_0x1d80dc[_0x8975('0x17')](_0x2d7abc[_0x8975('0x18')]+'/.default');return _0x1d80dc['join']('\x20');}function getAccessTokenScope(_0x10aa69){if(_0x10aa69[_0x8975('0x15')]===_0x8975('0x19'))return _0x8975('0x1a');if(_0x10aa69['type']==='Dynamics365')return _0x10aa69[_0x8975('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4f1ee1,_0x9c380d){var _0x94048c=MICROSOFT_AUTH_URL[_0x8975('0x1b')]('{TENANT_ID}',_0x4f1ee1['data2']);var _0x368ef8=[_0x8975('0x1c'),'id_token'];var _0x5fe7cf=Buffer[_0x8975('0x1d')](JSON[_0x8975('0x1e')]({'id':_0x9c380d}))['toString'](_0x8975('0x1f'));var _0x412c89=crypto[_0x8975('0x20')](0x10)[_0x8975('0x21')]('hex');var _0x272923=getAuthorizationScopes(_0x4f1ee1);var _0x46b80f=[{'key':_0x8975('0x22'),'value':_0x4f1ee1[_0x8975('0x23')]},{'key':_0x8975('0x24'),'value':encodeURIComponent(_0x368ef8[_0x8975('0x25')]('\x20'))},{'key':_0x8975('0x26'),'value':_0x4f1ee1[_0x8975('0x27')]},{'key':_0x8975('0x28'),'value':_0x8975('0x29')},{'key':_0x8975('0x2a'),'value':encodeURIComponent(_0x272923)},{'key':_0x8975('0x2b'),'value':_0x5fe7cf},{'key':_0x8975('0x2c'),'value':_0x412c89},{'key':_0x8975('0x2d'),'value':'login'}];var _0x1d422d=_0x94048c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8975('0x14')](_0x46b80f,function(_0x26f149){return _0x26f149[_0x8975('0x2e')]+'='+_0x26f149[_0x8975('0x2f')];})['join']('&');_0x4f1ee1[_0x8975('0x30')]={'issuer':_0x94048c[_0x8975('0x1b')](_0x8975('0x31'),''),'audience':_0x4f1ee1[_0x8975('0x23')],'state':_0x5fe7cf,'nonce':_0x412c89};redis[_0x8975('0x32')](_0x5fe7cf,JSON['stringify'](_0x4f1ee1));return _0x1d422d;}function isValidIdToken(_0xe524c1,_0x285e22){try{var _0x1f3443=jwt[_0x8975('0x33')](_0xe524c1,{'complete':!![]});var _0x54a603=_0x1f3443[_0x8975('0x34')];if(_0x54a603[_0x8975('0x35')]!==_0x285e22[_0x8975('0x36')])return![];if(_0x54a603[_0x8975('0x37')]!==_0x285e22[_0x8975('0x38')])return![];if(_0x54a603['nonce']!==_0x285e22['nonce'])return![];if(moment()[_0x8975('0x39')](moment[_0x8975('0x3a')](_0x54a603[_0x8975('0x3b')])))return![];return!![];}catch(_0x370239){throw _0x370239;}}function refreshOauth2MicrosoftAccessToken(_0x3b452f){return Promise[_0x8975('0x3c')]()[_0x8975('0x3d')](function(){if(_0x3b452f[_0x8975('0x3e')])return _0x3b452f;return db[_0x8975('0x3f')][_0x8975('0x40')]({'where':{'id':_0x3b452f['id']},'raw':!![]});})['then'](function(_0x2625d0){var _0x31c5d6={'grant_type':_0x8975('0x41'),'refresh_token':_0x2625d0['data6'],'scope':getAccessTokenScope(_0x2625d0),'redirect_uri':_0x2625d0['data4'],'client_id':_0x2625d0[_0x8975('0x23')],'client_secret':encryptor[_0x8975('0x42')](_0x2625d0['data3'])};var _0x30db90={'method':_0x8975('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8975('0x1b')](_0x8975('0x44'),_0x2625d0[_0x8975('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31c5d6,'json':!![]};return rp(_0x30db90);})[_0x8975('0x3d')](function(_0x1d13a5){_0x3b452f['data5']=_0x1d13a5[_0x8975('0x46')];_0x3b452f[_0x8975('0x47')]=_0x1d13a5[_0x8975('0x41')];return db['CloudProvider'][_0x8975('0x48')]({'data5':_0x3b452f[_0x8975('0x49')],'data6':_0x3b452f[_0x8975('0x47')]},{'where':{'id':_0x3b452f['id']}});})[_0x8975('0x3d')](function(){return _0x3b452f;})[_0x8975('0x4a')](function(_0x542f54){logger[_0x8975('0x4b')](_0x8975('0x4c'),_0x3b452f['id'],_0x542f54);});}function getOauth2MicrosoftAccessToken(_0x56d9f7,_0x3805da){var _0x562bd9={'grant_type':_0x8975('0x4d'),'code':_0x56d9f7,'scope':getAccessTokenScope(_0x3805da),'redirect_uri':_0x3805da['data4'],'client_id':_0x3805da[_0x8975('0x23')],'client_secret':encryptor[_0x8975('0x42')](_0x3805da[_0x8975('0x3e')])};var _0x1cb3c6={'method':_0x8975('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8975('0x1b')]('{TENANT_ID}',_0x3805da[_0x8975('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x562bd9,'json':!![]};return rp(_0x1cb3c6);}function startRefreshInterval(_0x5b8c15){var _0x439ca4=schedule[_0x8975('0x4e')];if(_0x439ca4[_0x5b8c15['id']])clearInterval(_0x439ca4[_0x5b8c15['id']]);_0x439ca4[_0x5b8c15['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8975('0x4f')](this,{'id':_0x5b8c15['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8975('0x4e')]=_0x439ca4;}function startAllRefreshIntervals(){return db[_0x8975('0x3f')][_0x8975('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8975('0x3d')](function(_0x5c55a4){var _0xefb826=_0x5c55a4[_0x8975('0x14')](function(_0x161a29){return refreshOauth2MicrosoftAccessToken(_0x161a29)[_0x8975('0x3d')](function(_0x527357){startRefreshInterval(_0x527357);});});return Promise['all'](_0xefb826);})[_0x8975('0x4a')](function(_0x2f5014){var _0x2184b9=_0x2f5014?util[_0x8975('0x51')](_0x2f5014,{'showHidden':![],'depth':null}):'';logger[_0x8975('0x4b')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2184b9);});}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 5277afe..372c71e 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 _0xd878=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x43612d,_0x4bf230){var _0x5434ee=function(_0x134301){while(--_0x134301){_0x43612d['push'](_0x43612d['shift']());}};_0x5434ee(++_0x4bf230);}(_0xd878,0x118));var _0x8d87=function(_0x5d6819,_0x7b07f5){_0x5d6819=_0x5d6819-0x0;var _0x3a467d=_0xd878[_0x5d6819];return _0x3a467d;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var moment=require(_0x8d87('0x2'));var BPromise=require(_0x8d87('0x3'));var rs=require(_0x8d87('0x4'));var fs=require('fs');var Redis=require(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d87('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b504e,_0xcb4dae,_0x1eba92){return new BPromise(function(_0x38fded,_0x2c1bd0){return client[_0x8d87('0x9')](_0x1b504e,_0x1eba92)[_0x8d87('0xa')](function(_0xf6aa49){logger['info'](_0x8d87('0xb'),_0xcb4dae,'request\x20sent');logger['debug'](_0x8d87('0xc'),_0xcb4dae,_0x8d87('0xd'),JSON[_0x8d87('0xe')](_0xf6aa49));if(_0xf6aa49[_0x8d87('0xf')]){if(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x10')]===0x1f4){logger['error'](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x2c1bd0(_0xf6aa49['error'][_0x8d87('0x11')]);}logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x38fded(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x11')]);}else{logger[_0x8d87('0x12')](_0x8d87('0xb'),_0xcb4dae,_0x8d87('0xd'));_0x38fded(_0xf6aa49[_0x8d87('0x13')][_0x8d87('0x11')]);}})[_0x8d87('0x14')](function(_0x520df5){logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0x520df5);_0x2c1bd0(_0x520df5);});});}
\ No newline at end of file
+var _0x896e=['CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x99c991,_0x439ce7){var _0x3e2061=function(_0x15bf1b){while(--_0x15bf1b){_0x99c991['push'](_0x99c991['shift']());}};_0x3e2061(++_0x439ce7);}(_0x896e,0x1e9));var _0xe896=function(_0xafc7cf,_0x14d3ca){_0xafc7cf=_0xafc7cf-0x0;var _0x241a61=_0x896e[_0xafc7cf];return _0x241a61;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index d59b004..76f1880 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 _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(_0x2d1576,_0x489418){var _0x4445be=function(_0x4785d){while(--_0x4785d){_0x2d1576['push'](_0x2d1576['shift']());}};_0x4445be(++_0x489418);}(_0x2ef3,0xba));var _0x32ef=function(_0x3540f3,_0x591573){_0x3540f3=_0x3540f3-0x0;var _0x2bc846=_0x2ef3[_0x3540f3];return _0x2bc846;};'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
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x5d2e56,_0x5dd641){var _0x3087c5=function(_0x296ef7){while(--_0x296ef7){_0x5d2e56['push'](_0x5d2e56['shift']());}};_0x3087c5(++_0x5dd641);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 375b48e..930bc99 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 _0x56c7=['sequelize','STRING'];(function(_0x29fe2e,_0x2cf4da){var _0x42fff4=function(_0x463c4f){while(--_0x463c4f){_0x29fe2e['push'](_0x29fe2e['shift']());}};_0x42fff4(++_0x2cf4da);}(_0x56c7,0x14c));var _0x756c=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x56c7[_0x1c1fba];return _0x37e346;};'use strict';var Sequelize=require(_0x756c('0x0'));module['exports']={'name':{'type':Sequelize[_0x756c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x756c('0x1')]},'website':{'type':Sequelize[_0x756c('0x1')]},'phone':{'type':Sequelize[_0x756c('0x1')]},'fax':{'type':Sequelize[_0x756c('0x1')]},'type':{'type':Sequelize[_0x756c('0x1')]},'street':{'type':Sequelize[_0x756c('0x1')]},'postalCode':{'type':Sequelize[_0x756c('0x1')]},'city':{'type':Sequelize[_0x756c('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x756c('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x756c('0x1')]},'sStreet':{'type':Sequelize[_0x756c('0x1')]},'sPostalCode':{'type':Sequelize[_0x756c('0x1')]},'sCity':{'type':Sequelize[_0x756c('0x1')]},'sCountry':{'type':Sequelize[_0x756c('0x1')]},'description':{'type':Sequelize[_0x756c('0x1')]}};
\ No newline at end of file
+var _0x82f5=['name','sequelize','exports','STRING'];(function(_0x183359,_0x3da03b){var _0x237bbe=function(_0x25511a){while(--_0x25511a){_0x183359['push'](_0x183359['shift']());}};_0x237bbe(++_0x3da03b);}(_0x82f5,0x15d));var _0x582f=function(_0x47da77,_0x19a4ff){_0x47da77=_0x47da77-0x0;var _0x2f3480=_0x82f5[_0x47da77];return _0x2f3480;};'use strict';var Sequelize=require(_0x582f('0x0'));module[_0x582f('0x1')]={'name':{'type':Sequelize[_0x582f('0x2')],'unique':_0x582f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x582f('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x582f('0x2')]},'fax':{'type':Sequelize[_0x582f('0x2')]},'type':{'type':Sequelize[_0x582f('0x2')]},'street':{'type':Sequelize[_0x582f('0x2')]},'postalCode':{'type':Sequelize[_0x582f('0x2')]},'city':{'type':Sequelize[_0x582f('0x2')]},'country':{'type':Sequelize[_0x582f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x582f('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x582f('0x2')]},'sCity':{'type':Sequelize[_0x582f('0x2')]},'sCountry':{'type':Sequelize[_0x582f('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 0960f9d..22c8aa9 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 _0xcb5e=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','getContacts','findOne','rawAttributes','pick','filter','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','CmCompany','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','map','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body'];(function(_0x393911,_0x56f98e){var _0x38230c=function(_0x2b9ef2){while(--_0x2b9ef2){_0x393911['push'](_0x393911['shift']());}};_0x38230c(++_0x56f98e);}(_0xcb5e,0x181));var _0xecb5=function(_0x4ec81d,_0x5e031c){_0x4ec81d=_0x4ec81d-0x0;var _0x3a864f=_0xcb5e[_0x4ec81d];return _0x3a864f;};'use strict';var emlformat=require(_0xecb5('0x0'));var rimraf=require(_0xecb5('0x1'));var zipdir=require(_0xecb5('0x2'));var jsonpatch=require(_0xecb5('0x3'));var rp=require(_0xecb5('0x4'));var moment=require(_0xecb5('0x5'));var BPromise=require(_0xecb5('0x6'));var Mustache=require(_0xecb5('0x7'));var util=require(_0xecb5('0x8'));var path=require(_0xecb5('0x9'));var sox=require(_0xecb5('0xa'));var csv=require(_0xecb5('0xb'));var ejs=require(_0xecb5('0xc'));var fs=require('fs');var fs_extra=require(_0xecb5('0xd'));var _=require(_0xecb5('0xe'));var squel=require('squel');var crypto=require(_0xecb5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xecb5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xecb5('0x11'));var Papa=require(_0xecb5('0x12'));var Redis=require(_0xecb5('0x13'));var authService=require(_0xecb5('0x14'));var qs=require(_0xecb5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecb5('0x16'));var logger=require(_0xecb5('0x17'))('api');var utils=require(_0xecb5('0x18'));var config=require(_0xecb5('0x19'));var licenseUtil=require(_0xecb5('0x1a'));var db=require(_0xecb5('0x1b'))['db'];function respondWithStatusCode(_0x23754e,_0x5b1370){_0x5b1370=_0x5b1370||0xcc;return function(_0x120b78){if(_0x120b78){return _0x23754e[_0xecb5('0x1c')](_0x5b1370);}return _0x23754e[_0xecb5('0x1d')](_0x5b1370)[_0xecb5('0x1e')]();};}function respondWithResult(_0x87d7b6,_0x538695){_0x538695=_0x538695||0xc8;return function(_0x37c9df){if(_0x37c9df){return _0x87d7b6[_0xecb5('0x1d')](_0x538695)[_0xecb5('0x1f')](_0x37c9df);}};}function respondWithFilteredResult(_0x4cd97b,_0x16f2d7){return function(_0x3a5df1){if(_0x3a5df1){var _0x29e360=typeof _0x16f2d7['offset']===_0xecb5('0x20')&&typeof _0x16f2d7[_0xecb5('0x21')]===_0xecb5('0x20');var _0x204033=_0x3a5df1['count'];var _0x13ad6b=_0x29e360?0x0:_0x16f2d7[_0xecb5('0x22')];var _0xc0b57=_0x29e360?_0x3a5df1[_0xecb5('0x23')]:_0x16f2d7[_0xecb5('0x22')]+_0x16f2d7[_0xecb5('0x21')];var _0x1f340b;if(_0xc0b57>=_0x204033){_0xc0b57=_0x204033;_0x1f340b=0xc8;}else{_0x1f340b=0xce;}_0x4cd97b[_0xecb5('0x1d')](_0x1f340b);return _0x4cd97b['set'](_0xecb5('0x24'),_0x13ad6b+'-'+_0xc0b57+'/'+_0x204033)[_0xecb5('0x1f')](_0x3a5df1);}return null;};}function patchUpdates(_0x405fbb){return function(_0x43f33c){try{jsonpatch['apply'](_0x43f33c,_0x405fbb,!![]);}catch(_0x47b222){return BPromise[_0xecb5('0x25')](_0x47b222);}return _0x43f33c[_0xecb5('0x26')]();};}function saveUpdates(_0x988e2a,_0x47caa2){return function(_0x4d00d0){if(_0x4d00d0){return _0x4d00d0[_0xecb5('0x27')](_0x988e2a)['then'](function(_0x46fa60){return _0x46fa60;});}return null;};}function removeEntity(_0x455594,_0x5cf179){return function(_0xa0abf1){if(_0xa0abf1){return _0xa0abf1[_0xecb5('0x28')]()['then'](function(){var _0x237440=_0xa0abf1[_0xecb5('0x29')]({'plain':!![]});var _0xe75add='Companies';return db[_0xecb5('0x2a')][_0xecb5('0x28')]({'where':{'type':_0xe75add,'resourceId':_0x237440['id']}})['then'](function(){return _0xa0abf1;});})[_0xecb5('0x2b')](function(){_0x455594[_0xecb5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492f64,_0x175cb7){return function(_0x42b63f){if(!_0x42b63f){_0x492f64[_0xecb5('0x1c')](0x194);}return _0x42b63f;};}function handleError(_0x83bdb6,_0x5ef57a){_0x5ef57a=_0x5ef57a||0x1f4;return function(_0x559234){logger[_0xecb5('0x2c')](_0x559234[_0xecb5('0x2d')]);if(_0x559234['name']){delete _0x559234[_0xecb5('0x2e')];}_0x83bdb6[_0xecb5('0x1d')](_0x5ef57a)['send'](_0x559234);};}exports[_0xecb5('0x2f')]=function(_0x3545bc,_0x429b15){var _0x19832d={},_0x320c28={},_0x1e7284={'count':0x0,'rows':[]};return db[_0xecb5('0x30')]['describe']()[_0xecb5('0x2b')](function(_0x55eb18){_0x320c28[_0xecb5('0x31')]=_[_0xecb5('0x32')](_0x55eb18);_0x320c28[_0xecb5('0x33')]=_[_0xecb5('0x32')](_0x3545bc[_0xecb5('0x33')]);_0x320c28['filters']=_[_0xecb5('0x34')](_0x320c28[_0xecb5('0x31')],_0x320c28['query']);_0x19832d[_0xecb5('0x35')]=_[_0xecb5('0x34')](_0x320c28[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x3545bc['query'][_0xecb5('0x36')]));_0x19832d[_0xecb5('0x35')]=_0x19832d[_0xecb5('0x35')][_0xecb5('0x37')]?_0x19832d['attributes']:_0x320c28[_0xecb5('0x31')];if(!_0x3545bc[_0xecb5('0x33')][_0xecb5('0x38')](_0xecb5('0x39'))){_0x19832d[_0xecb5('0x21')]=qs['limit'](_0x3545bc[_0xecb5('0x33')][_0xecb5('0x21')]);_0x19832d[_0xecb5('0x22')]=qs['offset'](_0x3545bc['query'][_0xecb5('0x22')]);}_0x19832d[_0xecb5('0x3a')]=qs[_0xecb5('0x3b')](_0x3545bc[_0xecb5('0x33')][_0xecb5('0x3b')]);_0x19832d[_0xecb5('0x3c')]=qs['filters'](_['pick'](_0x3545bc[_0xecb5('0x33')],_0x320c28[_0xecb5('0x3d')]),_0x55eb18);if(_0x3545bc[_0xecb5('0x33')]['filter']){_0x19832d[_0xecb5('0x3c')]=_['merge'](_0x19832d[_0xecb5('0x3c')],{'$or':_[_0xecb5('0x3e')](_0x19832d[_0xecb5('0x35')],function(_0x11bcf6){var _0x1a3298={};_0x1a3298[_0x11bcf6]={'$like':'%'+_0x3545bc[_0xecb5('0x33')]['filter']+'%'};return _0x1a3298;})});}_0x19832d=_['merge']({},_0x19832d,_0x3545bc[_0xecb5('0x3f')]);var _0x5697bb={'where':_0x19832d[_0xecb5('0x3c')]};return db[_0xecb5('0x30')][_0xecb5('0x23')](_0x5697bb)[_0xecb5('0x2b')](function(_0x1a6e40){_0x1e7284['count']=_0x1a6e40;if(_0x3545bc['query'][_0xecb5('0x40')]){_0x19832d[_0xecb5('0x41')]=[{'all':!![]}];}return db[_0xecb5('0x30')][_0xecb5('0x42')](_0x19832d);})['then'](function(_0x36fff0){_0x1e7284[_0xecb5('0x43')]=_0x36fff0;return _0x1e7284;})['then'](respondWithFilteredResult(_0x429b15,_0x19832d))['catch'](handleError(_0x429b15,null));})[_0xecb5('0x44')](handleError(_0x429b15,null));};exports[_0xecb5('0x45')]=function(_0x1e7297,_0x8c63f){var _0x1b370f={'raw':![],'where':{'id':_0x1e7297[_0xecb5('0x46')]['id']}},_0xd4d141={};_0xd4d141['model']=_[_0xecb5('0x32')](db[_0xecb5('0x30')]['rawAttributes']);_0xd4d141[_0xecb5('0x33')]=_[_0xecb5('0x32')](_0x1e7297[_0xecb5('0x33')]);_0xd4d141[_0xecb5('0x3d')]=_[_0xecb5('0x34')](_0xd4d141[_0xecb5('0x31')],_0xd4d141[_0xecb5('0x33')]);_0x1b370f[_0xecb5('0x35')]=_['intersection'](_0xd4d141[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x1e7297['query'][_0xecb5('0x36')]));_0x1b370f[_0xecb5('0x35')]=_0x1b370f[_0xecb5('0x35')][_0xecb5('0x37')]?_0x1b370f[_0xecb5('0x35')]:_0xd4d141[_0xecb5('0x31')];if(_0x1e7297[_0xecb5('0x33')][_0xecb5('0x40')]){_0x1b370f[_0xecb5('0x41')]=[{'all':!![]}];}_0x1b370f=_[_0xecb5('0x47')]({},_0x1b370f,_0x1e7297[_0xecb5('0x3f')]);return db[_0xecb5('0x30')][_0xecb5('0x48')](_0x1b370f)[_0xecb5('0x2b')](handleEntityNotFound(_0x8c63f,null))[_0xecb5('0x2b')](respondWithResult(_0x8c63f,null))[_0xecb5('0x44')](handleError(_0x8c63f,null));};exports[_0xecb5('0x49')]=function(_0x5c09c2,_0x5ab34a){return db[_0xecb5('0x30')][_0xecb5('0x49')](_0x5c09c2[_0xecb5('0x4a')],{})['then'](function(_0x3269bf){var _0x490378=_0x5c09c2[_0xecb5('0x4b')][_0xecb5('0x29')]({'plain':!![]});if(!_0x490378)throw new Error(_0xecb5('0x4c'));if(_0x490378['role']===_0xecb5('0x4b')){var _0x34c8b5=_0x3269bf[_0xecb5('0x29')]({'plain':!![]});var _0x132cc1=_0xecb5('0x4d');return db[_0xecb5('0x4e')]['find']({'where':{'name':_0x132cc1,'userProfileId':_0x490378[_0xecb5('0x4f')]},'raw':!![]})[_0xecb5('0x2b')](function(_0x2053f3){if(_0x2053f3&&_0x2053f3[_0xecb5('0x50')]===0x0){return db['UserProfileResource'][_0xecb5('0x49')]({'name':_0x34c8b5[_0xecb5('0x2e')],'resourceId':_0x34c8b5['id'],'type':_0x2053f3['name'],'sectionId':_0x2053f3['id']},{})[_0xecb5('0x2b')](function(){return _0x3269bf;});}else{return _0x3269bf;}})[_0xecb5('0x44')](function(_0x54cb90){logger[_0xecb5('0x2c')](_0xecb5('0x51'),_0x54cb90);throw _0x54cb90;});}return _0x3269bf;})['then'](respondWithResult(_0x5ab34a,0xc9))[_0xecb5('0x44')](handleError(_0x5ab34a,null));};exports[_0xecb5('0x27')]=function(_0xa3ca06,_0x20f15a){if(_0xa3ca06[_0xecb5('0x4a')]['id']){delete _0xa3ca06[_0xecb5('0x4a')]['id'];}return db[_0xecb5('0x30')][_0xecb5('0x48')]({'where':{'id':_0xa3ca06['params']['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x20f15a,null))[_0xecb5('0x2b')](saveUpdates(_0xa3ca06[_0xecb5('0x4a')],null))[_0xecb5('0x2b')](respondWithResult(_0x20f15a,null))[_0xecb5('0x44')](handleError(_0x20f15a,null));};exports['destroy']=function(_0xc24442,_0x290d42){return db[_0xecb5('0x30')][_0xecb5('0x48')]({'where':{'id':_0xc24442[_0xecb5('0x46')]['id']}})['then'](handleEntityNotFound(_0x290d42,null))[_0xecb5('0x2b')](removeEntity(_0x290d42,null))['catch'](handleError(_0x290d42,null));};exports[_0xecb5('0x52')]=function(_0x52b6ab,_0x49c7f9){return db['CmCompany'][_0xecb5('0x52')]()[_0xecb5('0x2b')](respondWithResult(_0x49c7f9,null))['catch'](handleError(_0x49c7f9,null));};exports[_0xecb5('0x53')]=function(_0xb4eda8,_0x489831,_0x29d589){return db[_0xecb5('0x54')][_0xecb5('0x48')]({'where':{'id':_0xb4eda8[_0xecb5('0x46')]['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x489831,null))[_0xecb5('0x2b')](function(_0x146802){if(_0x146802){return _0x146802['addContacts'](_0xb4eda8[_0xecb5('0x4a')]['ids'],_[_0xecb5('0x55')](_0xb4eda8['body'],[_0xecb5('0x56'),'id'])||{});}})[_0xecb5('0x2b')](respondWithResult(_0x489831,null))[_0xecb5('0x44')](handleError(_0x489831,null));};exports[_0xecb5('0x57')]=function(_0x2fe44e,_0x286a05,_0x45cd8d){var _0x4180f2={};var _0x3542d6={};var _0x476c53;var _0x1a49c1;return db[_0xecb5('0x30')][_0xecb5('0x58')]({'where':{'id':_0x2fe44e['params']['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x286a05,null))[_0xecb5('0x2b')](function(_0x3c738d){if(_0x3c738d){_0x476c53=_0x3c738d;_0x3542d6['model']=_[_0xecb5('0x32')](db[_0xecb5('0x54')][_0xecb5('0x59')]);_0x3542d6['query']=_[_0xecb5('0x32')](_0x2fe44e[_0xecb5('0x33')]);_0x3542d6['filters']=_[_0xecb5('0x34')](_0x3542d6[_0xecb5('0x31')],_0x3542d6[_0xecb5('0x33')]);_0x4180f2[_0xecb5('0x35')]=_['intersection'](_0x3542d6[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x36')]));_0x4180f2[_0xecb5('0x35')]=_0x4180f2[_0xecb5('0x35')]['length']?_0x4180f2[_0xecb5('0x35')]:_0x3542d6[_0xecb5('0x31')];_0x4180f2[_0xecb5('0x3a')]=qs[_0xecb5('0x3b')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x3b')]);_0x4180f2[_0xecb5('0x3c')]=qs['filters'](_[_0xecb5('0x5a')](_0x2fe44e[_0xecb5('0x33')],_0x3542d6['filters']));if(_0x2fe44e['query'][_0xecb5('0x5b')]){_0x4180f2[_0xecb5('0x3c')]=_[_0xecb5('0x47')](_0x4180f2['where'],{'$or':_[_0xecb5('0x3e')](_0x4180f2[_0xecb5('0x35')],function(_0x379f94){var _0x4a918b={};_0x4a918b[_0x379f94]={'$like':'%'+_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x5b')]+'%'};return _0x4a918b;})});}_0x4180f2=_[_0xecb5('0x47')]({},_0x4180f2,_0x2fe44e[_0xecb5('0x3f')]);return _0x476c53[_0xecb5('0x57')](_0x4180f2);}})[_0xecb5('0x2b')](function(_0x424afd){if(_0x424afd){_0x1a49c1=_0x424afd[_0xecb5('0x37')];if(!_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x38')]('nolimit')){_0x4180f2[_0xecb5('0x21')]=qs[_0xecb5('0x21')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x21')]);_0x4180f2[_0xecb5('0x22')]=qs[_0xecb5('0x22')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x22')]);}return _0x476c53[_0xecb5('0x57')](_0x4180f2);}})[_0xecb5('0x2b')](function(_0x32b552){if(_0x32b552){return _0x32b552?{'count':_0x1a49c1,'rows':_0x32b552}:null;}})['then'](respondWithResult(_0x286a05,null))[_0xecb5('0x44')](handleError(_0x286a05,null));};
\ No newline at end of file
+var _0x3a87=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','addContacts','omit','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xad67c0,_0x420add){var _0x900008=function(_0x37718c){while(--_0x37718c){_0xad67c0['push'](_0xad67c0['shift']());}};_0x900008(++_0x420add);}(_0x3a87,0xe4));var _0x73a8=function(_0x1b9c2a,_0x50582e){_0x1b9c2a=_0x1b9c2a-0x0;var _0x21ab47=_0x3a87[_0x1b9c2a];return _0x21ab47;};'use strict';var emlformat=require(_0x73a8('0x0'));var rimraf=require(_0x73a8('0x1'));var zipdir=require(_0x73a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73a8('0x3'));var BPromise=require(_0x73a8('0x4'));var Mustache=require(_0x73a8('0x5'));var util=require(_0x73a8('0x6'));var path=require(_0x73a8('0x7'));var sox=require(_0x73a8('0x8'));var csv=require(_0x73a8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73a8('0xa'));var _=require(_0x73a8('0xb'));var squel=require(_0x73a8('0xc'));var crypto=require(_0x73a8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x73a8('0xe'));var toCsv=require(_0x73a8('0x9'));var querystring=require(_0x73a8('0xf'));var Papa=require('papaparse');var Redis=require(_0x73a8('0x10'));var authService=require(_0x73a8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73a8('0x12'));var logger=require(_0x73a8('0x13'))(_0x73a8('0x14'));var utils=require('../../config/utils');var config=require(_0x73a8('0x15'));var licenseUtil=require(_0x73a8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc1e1fe,_0x2aacdb){_0x2aacdb=_0x2aacdb||0xcc;return function(_0x454ff7){if(_0x454ff7){return _0xc1e1fe[_0x73a8('0x17')](_0x2aacdb);}return _0xc1e1fe[_0x73a8('0x18')](_0x2aacdb)['end']();};}function respondWithResult(_0x68ead5,_0x4d7301){_0x4d7301=_0x4d7301||0xc8;return function(_0x5c7740){if(_0x5c7740){return _0x68ead5[_0x73a8('0x18')](_0x4d7301)['json'](_0x5c7740);}};}function respondWithFilteredResult(_0x185b29,_0x8b73df){return function(_0x8289d1){if(_0x8289d1){var _0x2e61b4=typeof _0x8b73df[_0x73a8('0x19')]===_0x73a8('0x1a')&&typeof _0x8b73df['limit']===_0x73a8('0x1a');var _0x2f15ec=_0x8289d1[_0x73a8('0x1b')];var _0x16bec1=_0x2e61b4?0x0:_0x8b73df[_0x73a8('0x19')];var _0x2b2fc3=_0x2e61b4?_0x8289d1['count']:_0x8b73df[_0x73a8('0x19')]+_0x8b73df[_0x73a8('0x1c')];var _0x37e273;if(_0x2b2fc3>=_0x2f15ec){_0x2b2fc3=_0x2f15ec;_0x37e273=0xc8;}else{_0x37e273=0xce;}_0x185b29[_0x73a8('0x18')](_0x37e273);return _0x185b29[_0x73a8('0x1d')](_0x73a8('0x1e'),_0x16bec1+'-'+_0x2b2fc3+'/'+_0x2f15ec)[_0x73a8('0x1f')](_0x8289d1);}return null;};}function patchUpdates(_0x498d11){return function(_0x470a71){try{jsonpatch['apply'](_0x470a71,_0x498d11,!![]);}catch(_0x31faf3){return BPromise[_0x73a8('0x20')](_0x31faf3);}return _0x470a71['save']();};}function saveUpdates(_0x4343d1,_0x4b7466){return function(_0x4c479e){if(_0x4c479e){return _0x4c479e[_0x73a8('0x21')](_0x4343d1)[_0x73a8('0x22')](function(_0x2b0f79){return _0x2b0f79;});}return null;};}function removeEntity(_0x50c7f1,_0x32d34c){return function(_0x406ced){if(_0x406ced){return _0x406ced[_0x73a8('0x23')]()['then'](function(){var _0x482a17=_0x406ced[_0x73a8('0x24')]({'plain':!![]});var _0x521f89=_0x73a8('0x25');return db[_0x73a8('0x26')][_0x73a8('0x23')]({'where':{'type':_0x521f89,'resourceId':_0x482a17['id']}})['then'](function(){return _0x406ced;});})['then'](function(){_0x50c7f1['status'](0xcc)[_0x73a8('0x27')]();});}};}function handleEntityNotFound(_0x1e698e,_0x5bcdac){return function(_0x4a733e){if(!_0x4a733e){_0x1e698e['sendStatus'](0x194);}return _0x4a733e;};}function handleError(_0x314636,_0x1408b2){_0x1408b2=_0x1408b2||0x1f4;return function(_0x54536b){logger[_0x73a8('0x28')](_0x54536b[_0x73a8('0x29')]);if(_0x54536b[_0x73a8('0x2a')]){delete _0x54536b[_0x73a8('0x2a')];}_0x314636[_0x73a8('0x18')](_0x1408b2)['send'](_0x54536b);};}exports[_0x73a8('0x2b')]=function(_0x52e2ee,_0x1f1019){var _0x56d14b={},_0x3f1c2d={},_0x18ae8d={'count':0x0,'rows':[]};return db[_0x73a8('0x2c')][_0x73a8('0x2d')]()[_0x73a8('0x22')](function(_0x57efe3){_0x3f1c2d[_0x73a8('0x2e')]=_['keys'](_0x57efe3);_0x3f1c2d['query']=_[_0x73a8('0x2f')](_0x52e2ee[_0x73a8('0x30')]);_0x3f1c2d['filters']=_[_0x73a8('0x31')](_0x3f1c2d[_0x73a8('0x2e')],_0x3f1c2d[_0x73a8('0x30')]);_0x56d14b[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x3f1c2d[_0x73a8('0x2e')],qs[_0x73a8('0x33')](_0x52e2ee['query'][_0x73a8('0x33')]));_0x56d14b[_0x73a8('0x32')]=_0x56d14b[_0x73a8('0x32')][_0x73a8('0x34')]?_0x56d14b[_0x73a8('0x32')]:_0x3f1c2d[_0x73a8('0x2e')];if(!_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x35')]('nolimit')){_0x56d14b[_0x73a8('0x1c')]=qs['limit'](_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x1c')]);_0x56d14b['offset']=qs[_0x73a8('0x19')](_0x52e2ee['query'][_0x73a8('0x19')]);}_0x56d14b[_0x73a8('0x36')]=qs[_0x73a8('0x37')](_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x37')]);_0x56d14b[_0x73a8('0x38')]=qs[_0x73a8('0x39')](_[_0x73a8('0x3a')](_0x52e2ee[_0x73a8('0x30')],_0x3f1c2d[_0x73a8('0x39')]),_0x57efe3);if(_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3b')]){_0x56d14b[_0x73a8('0x38')]=_[_0x73a8('0x3c')](_0x56d14b[_0x73a8('0x38')],{'$or':_[_0x73a8('0x3d')](_0x56d14b[_0x73a8('0x32')],function(_0x51250a){var _0x5bcf80={};_0x5bcf80[_0x51250a]={'$like':'%'+_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3b')]+'%'};return _0x5bcf80;})});}_0x56d14b=_[_0x73a8('0x3c')]({},_0x56d14b,_0x52e2ee[_0x73a8('0x3e')]);var _0xd81353={'where':_0x56d14b[_0x73a8('0x38')]};return db['CmCompany'][_0x73a8('0x1b')](_0xd81353)['then'](function(_0x28d380){_0x18ae8d[_0x73a8('0x1b')]=_0x28d380;if(_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3f')]){_0x56d14b[_0x73a8('0x40')]=[{'all':!![]}];}return db[_0x73a8('0x2c')][_0x73a8('0x41')](_0x56d14b);})[_0x73a8('0x22')](function(_0x260a66){_0x18ae8d['rows']=_0x260a66;return _0x18ae8d;})[_0x73a8('0x22')](respondWithFilteredResult(_0x1f1019,_0x56d14b))[_0x73a8('0x42')](handleError(_0x1f1019,null));})['catch'](handleError(_0x1f1019,null));};exports[_0x73a8('0x43')]=function(_0x41492f,_0x1ec88f){var _0x1a0458={'raw':![],'where':{'id':_0x41492f[_0x73a8('0x44')]['id']}},_0x1ee843={};_0x1ee843[_0x73a8('0x2e')]=_[_0x73a8('0x2f')](db[_0x73a8('0x2c')][_0x73a8('0x45')]);_0x1ee843[_0x73a8('0x30')]=_[_0x73a8('0x2f')](_0x41492f[_0x73a8('0x30')]);_0x1ee843[_0x73a8('0x39')]=_[_0x73a8('0x31')](_0x1ee843[_0x73a8('0x2e')],_0x1ee843[_0x73a8('0x30')]);_0x1a0458[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x1ee843[_0x73a8('0x2e')],qs['fields'](_0x41492f['query'][_0x73a8('0x33')]));_0x1a0458[_0x73a8('0x32')]=_0x1a0458[_0x73a8('0x32')]['length']?_0x1a0458['attributes']:_0x1ee843[_0x73a8('0x2e')];if(_0x41492f[_0x73a8('0x30')][_0x73a8('0x3f')]){_0x1a0458[_0x73a8('0x40')]=[{'all':!![]}];}_0x1a0458=_['merge']({},_0x1a0458,_0x41492f[_0x73a8('0x3e')]);return db[_0x73a8('0x2c')][_0x73a8('0x46')](_0x1a0458)['then'](handleEntityNotFound(_0x1ec88f,null))[_0x73a8('0x22')](respondWithResult(_0x1ec88f,null))['catch'](handleError(_0x1ec88f,null));};exports[_0x73a8('0x47')]=function(_0x5b2672,_0x4d5f28){return db[_0x73a8('0x2c')][_0x73a8('0x47')](_0x5b2672[_0x73a8('0x48')],{})['then'](function(_0x1ce0b3){var _0x3fd0d3=_0x5b2672['user']['get']({'plain':!![]});if(!_0x3fd0d3)throw new Error(_0x73a8('0x49'));if(_0x3fd0d3[_0x73a8('0x4a')]===_0x73a8('0x4b')){var _0x37ed83=_0x1ce0b3[_0x73a8('0x24')]({'plain':!![]});var _0x2656fa=_0x73a8('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x2656fa,'userProfileId':_0x3fd0d3['userProfileId']},'raw':!![]})[_0x73a8('0x22')](function(_0x51c922){if(_0x51c922&&_0x51c922['autoAssociation']===0x0){return db[_0x73a8('0x26')][_0x73a8('0x47')]({'name':_0x37ed83[_0x73a8('0x2a')],'resourceId':_0x37ed83['id'],'type':_0x51c922[_0x73a8('0x2a')],'sectionId':_0x51c922['id']},{})['then'](function(){return _0x1ce0b3;});}else{return _0x1ce0b3;}})[_0x73a8('0x42')](function(_0x58d4da){logger[_0x73a8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d4da);throw _0x58d4da;});}return _0x1ce0b3;})[_0x73a8('0x22')](respondWithResult(_0x4d5f28,0xc9))[_0x73a8('0x42')](handleError(_0x4d5f28,null));};exports['update']=function(_0x265898,_0x181f30){if(_0x265898['body']['id']){delete _0x265898['body']['id'];}return db['CmCompany'][_0x73a8('0x46')]({'where':{'id':_0x265898[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x181f30,null))[_0x73a8('0x22')](saveUpdates(_0x265898[_0x73a8('0x48')],null))['then'](respondWithResult(_0x181f30,null))[_0x73a8('0x42')](handleError(_0x181f30,null));};exports[_0x73a8('0x23')]=function(_0x2a7bbd,_0x5d9242){return db[_0x73a8('0x2c')][_0x73a8('0x46')]({'where':{'id':_0x2a7bbd[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x5d9242,null))[_0x73a8('0x22')](removeEntity(_0x5d9242,null))[_0x73a8('0x42')](handleError(_0x5d9242,null));};exports[_0x73a8('0x2d')]=function(_0x422d8c,_0x2973fe){return db[_0x73a8('0x2c')]['describe']()[_0x73a8('0x22')](respondWithResult(_0x2973fe,null))['catch'](handleError(_0x2973fe,null));};exports['addContacts']=function(_0x37031f,_0x5d9203,_0x5f5c2d){return db['CmContact'][_0x73a8('0x46')]({'where':{'id':_0x37031f[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x5d9203,null))['then'](function(_0x5130e5){if(_0x5130e5){return _0x5130e5[_0x73a8('0x4c')](_0x37031f[_0x73a8('0x48')]['ids'],_[_0x73a8('0x4d')](_0x37031f[_0x73a8('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d9203,null))[_0x73a8('0x42')](handleError(_0x5d9203,null));};exports[_0x73a8('0x4e')]=function(_0x3936b7,_0x8d786e,_0x1b0cc2){var _0x3d3292={};var _0x5eae7a={};var _0x51c9fc;var _0x170151;return db[_0x73a8('0x2c')][_0x73a8('0x4f')]({'where':{'id':_0x3936b7[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x8d786e,null))[_0x73a8('0x22')](function(_0x563595){if(_0x563595){_0x51c9fc=_0x563595;_0x5eae7a[_0x73a8('0x2e')]=_[_0x73a8('0x2f')](db[_0x73a8('0x50')][_0x73a8('0x45')]);_0x5eae7a[_0x73a8('0x30')]=_[_0x73a8('0x2f')](_0x3936b7[_0x73a8('0x30')]);_0x5eae7a['filters']=_[_0x73a8('0x31')](_0x5eae7a[_0x73a8('0x2e')],_0x5eae7a[_0x73a8('0x30')]);_0x3d3292[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x5eae7a[_0x73a8('0x2e')],qs['fields'](_0x3936b7['query'][_0x73a8('0x33')]));_0x3d3292[_0x73a8('0x32')]=_0x3d3292['attributes']['length']?_0x3d3292[_0x73a8('0x32')]:_0x5eae7a[_0x73a8('0x2e')];_0x3d3292['order']=qs['sort'](_0x3936b7[_0x73a8('0x30')]['sort']);_0x3d3292[_0x73a8('0x38')]=qs[_0x73a8('0x39')](_[_0x73a8('0x3a')](_0x3936b7[_0x73a8('0x30')],_0x5eae7a[_0x73a8('0x39')]));if(_0x3936b7[_0x73a8('0x30')]['filter']){_0x3d3292[_0x73a8('0x38')]=_[_0x73a8('0x3c')](_0x3d3292[_0x73a8('0x38')],{'$or':_[_0x73a8('0x3d')](_0x3d3292['attributes'],function(_0x5edc1e){var _0x3d045f={};_0x3d045f[_0x5edc1e]={'$like':'%'+_0x3936b7[_0x73a8('0x30')]['filter']+'%'};return _0x3d045f;})});}_0x3d3292=_['merge']({},_0x3d3292,_0x3936b7[_0x73a8('0x3e')]);return _0x51c9fc[_0x73a8('0x4e')](_0x3d3292);}})[_0x73a8('0x22')](function(_0x3ac4cf){if(_0x3ac4cf){_0x170151=_0x3ac4cf[_0x73a8('0x34')];if(!_0x3936b7['query'][_0x73a8('0x35')](_0x73a8('0x51'))){_0x3d3292[_0x73a8('0x1c')]=qs[_0x73a8('0x1c')](_0x3936b7['query'][_0x73a8('0x1c')]);_0x3d3292[_0x73a8('0x19')]=qs[_0x73a8('0x19')](_0x3936b7[_0x73a8('0x30')][_0x73a8('0x19')]);}return _0x51c9fc[_0x73a8('0x4e')](_0x3d3292);}})[_0x73a8('0x22')](function(_0x5ed8c3){if(_0x5ed8c3){return _0x5ed8c3?{'count':_0x170151,'rows':_0x5ed8c3}:null;}})[_0x73a8('0x22')](respondWithResult(_0x8d786e,null))[_0x73a8('0x42')](handleError(_0x8d786e,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e50af64..4fd0d3d 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 _0xf433=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','api'];(function(_0x1e6015,_0x2af67b){var _0x58a3d9=function(_0x5520d2){while(--_0x5520d2){_0x1e6015['push'](_0x1e6015['shift']());}};_0x58a3d9(++_0x2af67b);}(_0xf433,0x66));var _0x3f43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf433[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3f43('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f43('0x1'));var moment=require(_0x3f43('0x2'));var BPromise=require(_0x3f43('0x3'));var rp=require(_0x3f43('0x4'));var fs=require('fs');var path=require(_0x3f43('0x5'));var rimraf=require(_0x3f43('0x6'));var config=require(_0x3f43('0x7'));var attributes=require(_0x3f43('0x8'));module[_0x3f43('0x9')]=function(_0x36dac7,_0x278132){return _0x36dac7[_0x3f43('0xa')](_0x3f43('0xb'),attributes,{'tableName':_0x3f43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8f3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb8f3,0x138));var _0x3b8f=function(_0x328cdc,_0xe9775){_0x328cdc=_0x328cdc-0x0;var _0x17eea7=_0xb8f3[_0x328cdc];return _0x17eea7;};'use strict';var _=require('lodash');var util=require(_0x3b8f('0x0'));var logger=require(_0x3b8f('0x1'))(_0x3b8f('0x2'));var moment=require(_0x3b8f('0x3'));var BPromise=require(_0x3b8f('0x4'));var rp=require(_0x3b8f('0x5'));var fs=require('fs');var path=require(_0x3b8f('0x6'));var rimraf=require('rimraf');var config=require(_0x3b8f('0x7'));var attributes=require(_0x3b8f('0x8'));module[_0x3b8f('0x9')]=function(_0x25b49e,_0x7d6bd8){return _0x25b49e[_0x3b8f('0xa')](_0x3b8f('0xb'),attributes,{'tableName':_0x3b8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 289381c..8d07cda 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 _0xec89=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xec89,0x123));var _0x9ec8=function(_0x236174,_0x3c8f93){_0x236174=_0x236174-0x0;var _0x3b2486=_0xec89[_0x236174];return _0x3b2486;};'use strict';var _=require(_0x9ec8('0x0'));var util=require('util');var moment=require(_0x9ec8('0x1'));var BPromise=require(_0x9ec8('0x2'));var rs=require(_0x9ec8('0x3'));var fs=require('fs');var Redis=require(_0x9ec8('0x4'));var db=require(_0x9ec8('0x5'))['db'];var utils=require(_0x9ec8('0x6'));var logger=require(_0x9ec8('0x7'))('rpc');var config=require(_0x9ec8('0x8'));var jayson=require(_0x9ec8('0x9'));var client=jayson['client'][_0x9ec8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x167e6b,_0x4070e4,_0x1d0966){return new BPromise(function(_0x23f674,_0xed07d8){return client[_0x9ec8('0xb')](_0x167e6b,_0x1d0966)[_0x9ec8('0xc')](function(_0x4a982e){logger[_0x9ec8('0xd')](_0x9ec8('0xe'),_0x4070e4,_0x9ec8('0xf'));logger[_0x9ec8('0x10')](_0x9ec8('0x11'),_0x4070e4,'request\x20sent',JSON[_0x9ec8('0x12')](_0x4a982e));if(_0x4a982e['error']){if(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x14')]===0x1f4){logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);return _0xed07d8(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);}logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x4a982e[_0x9ec8('0x13')]['message']);return _0x23f674(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);}else{logger[_0x9ec8('0xd')]('CmCompany,\x20%s,\x20%s',_0x4070e4,_0x9ec8('0xf'));_0x23f674(_0x4a982e[_0x9ec8('0x16')][_0x9ec8('0x15')]);}})[_0x9ec8('0x17')](function(_0x352e54){logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x352e54);_0xed07d8(_0x352e54);});});}
\ No newline at end of file
+var _0xe5fe=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0xa0be1c,_0x152d5d){var _0x546eec=function(_0x371eae){while(--_0x371eae){_0xa0be1c['push'](_0xa0be1c['shift']());}};_0x546eec(++_0x152d5d);}(_0xe5fe,0xcf));var _0xee5f=function(_0x2265c0,_0x24881e){_0x2265c0=_0x2265c0-0x0;var _0x27a246=_0xe5fe[_0x2265c0];return _0x27a246;};'use strict';var _=require(_0xee5f('0x0'));var util=require(_0xee5f('0x1'));var moment=require(_0xee5f('0x2'));var BPromise=require(_0xee5f('0x3'));var rs=require(_0xee5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee5f('0x5'))['db'];var utils=require(_0xee5f('0x6'));var logger=require(_0xee5f('0x7'))(_0xee5f('0x8'));var config=require('../../config/environment');var jayson=require(_0xee5f('0x9'));var client=jayson[_0xee5f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d795c,_0x2adeee,_0x3a5632){return new BPromise(function(_0x4f8f8e,_0x51864){return client[_0xee5f('0xb')](_0x1d795c,_0x3a5632)['then'](function(_0x54e939){logger[_0xee5f('0xc')](_0xee5f('0xd'),_0x2adeee,_0xee5f('0xe'));logger[_0xee5f('0xf')](_0xee5f('0x10'),_0x2adeee,_0xee5f('0xe'),JSON[_0xee5f('0x11')](_0x54e939));if(_0x54e939[_0xee5f('0x12')]){if(_0x54e939[_0xee5f('0x12')]['code']===0x1f4){logger[_0xee5f('0x12')]('CmCompany,\x20%s,\x20%s',_0x2adeee,_0x54e939['error']['message']);return _0x51864(_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);}logger[_0xee5f('0x12')](_0xee5f('0xd'),_0x2adeee,_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);return _0x4f8f8e(_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);}else{logger['info'](_0xee5f('0xd'),_0x2adeee,_0xee5f('0xe'));_0x4f8f8e(_0x54e939[_0xee5f('0x14')][_0xee5f('0x13')]);}})[_0xee5f('0x15')](function(_0x340d2d){logger[_0xee5f('0x12')](_0xee5f('0xd'),_0x2adeee,_0x340d2d);_0x51864(_0x340d2d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ebdc60b..02c9a0e 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 _0x2dad=['getContacts','post','create','addContacts','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts'];(function(_0x1e9fa9,_0xaaee57){var _0xcb4baf=function(_0x492425){while(--_0x492425){_0x1e9fa9['push'](_0x1e9fa9['shift']());}};_0xcb4baf(++_0xaaee57);}(_0x2dad,0x1cf));var _0xd2da=function(_0x5e0672,_0xef3b77){_0x5e0672=_0x5e0672-0x0;var _0x3fba57=_0x2dad[_0x5e0672];return _0x3fba57;};'use strict';var multer=require(_0xd2da('0x0'));var util=require(_0xd2da('0x1'));var path=require(_0xd2da('0x2'));var timeout=require(_0xd2da('0x3'));var express=require(_0xd2da('0x4'));var router=express[_0xd2da('0x5')]();var fs_extra=require(_0xd2da('0x6'));var auth=require(_0xd2da('0x7'));var interaction=require(_0xd2da('0x8'));var config=require(_0xd2da('0x9'));var controller=require('./cmCompany.controller');router[_0xd2da('0xa')]('/',auth[_0xd2da('0xb')](),controller[_0xd2da('0xc')]);router['get']('/describe',auth[_0xd2da('0xb')](),controller[_0xd2da('0xd')]);router['get'](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller[_0xd2da('0xf')]);router[_0xd2da('0xa')](_0xd2da('0x10'),auth['isAuthenticated'](),controller[_0xd2da('0x11')]);router[_0xd2da('0x12')]('/',auth[_0xd2da('0xb')](),controller[_0xd2da('0x13')]);router[_0xd2da('0x12')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xd2da('0x14')]);router['put'](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller[_0xd2da('0x15')]);router[_0xd2da('0x16')](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller['destroy']);module[_0xd2da('0x17')]=router;
\ No newline at end of file
+var _0x8d6f=['path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','addContacts','put','update','delete','destroy','exports','multer','util'];(function(_0x30d9c4,_0x40244c){var _0x1c7dfa=function(_0xc3ad49){while(--_0xc3ad49){_0x30d9c4['push'](_0x30d9c4['shift']());}};_0x1c7dfa(++_0x40244c);}(_0x8d6f,0xa9));var _0xf8d6=function(_0x1fd2e5,_0x4ed9ea){_0x1fd2e5=_0x1fd2e5-0x0;var _0x3fe02d=_0x8d6f[_0x1fd2e5];return _0x3fe02d;};'use strict';var multer=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var path=require(_0xf8d6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf8d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf8d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8d6('0x5'));var controller=require('./cmCompany.controller');router[_0xf8d6('0x6')]('/',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0x8')]);router[_0xf8d6('0x6')](_0xf8d6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf8d6('0x6')](_0xf8d6('0xa'),auth[_0xf8d6('0x7')](),controller['show']);router['get']('/:id/contacts',auth[_0xf8d6('0x7')](),controller['getContacts']);router[_0xf8d6('0xb')]('/',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xc')]);router[_0xf8d6('0xb')]('/:id/contacts',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xd')]);router[_0xf8d6('0xe')](_0xf8d6('0xa'),auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xf')]);router[_0xf8d6('0x10')]('/:id',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0x11')]);module[_0xf8d6('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 8349a48..fc50ebd 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 _0x6c4e=['lodash','sequelize','STRING','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c4e,0xb6));var _0xe6c4=function(_0x42a587,_0x40e417){_0x42a587=_0x42a587-0x0;var _0x33965a=_0x6c4e[_0x42a587];return _0x33965a;};'use strict';var _=require(_0xe6c4('0x0'));var Sequelize=require(_0xe6c4('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xe6c4('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe6c4('0x2')]},'city':{'type':Sequelize[_0xe6c4('0x2')]},'country':{'type':Sequelize[_0xe6c4('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe6c4('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe6c4('0x2')]},'fax':{'type':Sequelize[_0xe6c4('0x2')]},'email':{'type':Sequelize[_0xe6c4('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xe6c4('0x2')]},'fb_data':{'type':Sequelize[_0xe6c4('0x2')]},'twitter':{'type':Sequelize[_0xe6c4('0x2')]},'skype':{'type':Sequelize[_0xe6c4('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xe6c4('0x2')]},'line':{'type':Sequelize[_0xe6c4('0x2')]},'wechat':{'type':Sequelize[_0xe6c4('0x2')]},'telegram':{'type':Sequelize[_0xe6c4('0x2')]},'UserId':{'type':Sequelize[_0xe6c4('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xe6c4('0x2')]},'priority':{'type':Sequelize[_0xe6c4('0x3')](0x2)[_0xe6c4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe6c4('0x5')],'defaultValue':Sequelize[_0xe6c4('0x6')]},'dialTimezone':{'type':Sequelize[_0xe6c4('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc844=['NOW','lodash','exports','STRING','INTEGER','DATE'];(function(_0x406c64,_0x89d983){var _0x3ca465=function(_0x3d1c9c){while(--_0x3d1c9c){_0x406c64['push'](_0x406c64['shift']());}};_0x3ca465(++_0x89d983);}(_0xc844,0xdf));var _0x4c84=function(_0x6da2f,_0x300a55){_0x6da2f=_0x6da2f-0x0;var _0x3adae1=_0xc844[_0x6da2f];return _0x3adae1;};'use strict';var _=require(_0x4c84('0x0'));var Sequelize=require('sequelize');module[_0x4c84('0x1')]={'firstName':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4c84('0x2')]},'postalCode':{'type':Sequelize[_0x4c84('0x2')]},'city':{'type':Sequelize[_0x4c84('0x2')]},'country':{'type':Sequelize[_0x4c84('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4c84('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4c84('0x2')]},'mobile':{'type':Sequelize[_0x4c84('0x2')]},'fax':{'type':Sequelize[_0x4c84('0x2')]},'email':{'type':Sequelize[_0x4c84('0x2')]},'url':{'type':Sequelize[_0x4c84('0x2')]},'facebook':{'type':Sequelize[_0x4c84('0x2')]},'fb_data':{'type':Sequelize[_0x4c84('0x2')]},'twitter':{'type':Sequelize[_0x4c84('0x2')]},'skype':{'type':Sequelize[_0x4c84('0x2')]},'teams':{'type':Sequelize[_0x4c84('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x4c84('0x2')]},'wechat':{'type':Sequelize[_0x4c84('0x2')]},'telegram':{'type':Sequelize[_0x4c84('0x2')]},'UserId':{'type':Sequelize[_0x4c84('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x4c84('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4c84('0x4')],'defaultValue':Sequelize[_0x4c84('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x4c84('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index fef9141..b7fdcc2 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','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','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','auth=Bearer\x20','join','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','@xcally.com','value','name','substring','indexOf','length','Anonymous','pop','isEmpty','anonymous'];(function(_0x52976d,_0x1bd280){var _0x757b7e=function(_0x3dec56){while(--_0x3dec56){_0x52976d['push'](_0x52976d['shift']());}};_0x757b7e(++_0x1bd280);}(_0x1443,0x112));var _0x3144=function(_0x359334,_0x5d17ef){_0x359334=_0x359334-0x0;var _0x53bb24=_0x1443[_0x359334];return _0x53bb24;};'use strict';var _=require(_0x3144('0x0'));var moment=require(_0x3144('0x1'));var random=require(_0x3144('0x2'));var fs=require('fs');var path=require(_0x3144('0x3'));var util=require(_0x3144('0x4'));var tnef=require(_0x3144('0x5'));var logger=require(_0x3144('0x6'))(_0x3144('0x7'));var config=require(_0x3144('0x8'));function getAddress(_0x45bb32){var _0x13de23=_[_0x3144('0x9')](_0x45bb32['value']);return _0x13de23&&_0x13de23[_0x3144('0xa')]?_0x13de23[_0x3144('0xa')]:'anonymous'+random[_0x3144('0xb')](0x6)+_0x3144('0xc');}function getFirstName(_0x38ee76){var _0x4cc250=_['head'](_0x38ee76[_0x3144('0xd')]);if(_0x4cc250&&_0x4cc250[_0x3144('0xe')]){if(_0x4cc250[_0x3144('0xe')]==_0x4cc250[_0x3144('0xa')]){return _0x4cc250['name'][_0x3144('0xf')](0x0,_0x4cc250['name'][_0x3144('0x10')]('@'));}var _0x2bada0=_0x4cc250[_0x3144('0xe')]['split'](/\s+/);return _0x2bada0[_0x3144('0x11')]>0x1?_0x2bada0['slice'](0x0,-0x1)['join']('\x20'):_0x4cc250['name'];}return _0x3144('0x12');}function getLastName(_0x1e47a3){var _0x474b61=_[_0x3144('0x9')](_0x1e47a3[_0x3144('0xd')]);if(_0x474b61&&_0x474b61['name']){var _0x40276f=_0x474b61['name']['split'](/\s+/);return _0x40276f[_0x3144('0x11')]>0x1?_0x40276f[_0x3144('0x13')]():'';}return'';}function getMails(_0x4dae4a,_0x189fd3){var _0x3fd5a4='';for(var _0x4ac3c4=0x0;_0x4ac3c4<_0x189fd3[_0x3144('0xd')]['length'];_0x4ac3c4+=0x1){if(_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]!==_0x4dae4a){if(!_[_0x3144('0x14')](_0x3fd5a4)){_0x3fd5a4+=',';}_0x3fd5a4+=_0x189fd3['value'][_0x4ac3c4][_0x3144('0xe')]||_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]||'';_0x3fd5a4+='\x20<';_0x3fd5a4+=_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]?_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]:_0x3144('0x15')+random['generate'](0x6)+_0x3144('0xc');_0x3fd5a4+='>';}}return _0x3fd5a4;}function parseEmail(_0x1870bf,_0x23491b,_0x1c4397){if(_0x23491b['html']){var _0x509cbd=/