From: Andrea Amorese
Date: Fri, 26 Nov 2021 13:33:34 +0000 (+0100)
Subject: Built motion from commit 0b90e591.|2.5.33
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com//%22my-avatar.png/%22?a=commitdiff_plain;h=a20a47b8a59796a057889c77efed17ab02a04548;p=motion2.git
Built motion from commit 0b90e591.|2.5.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 93e590e..065097a 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-26T13:09:50.435Z",
+ "time": "2021-11-26T13:23:55.785Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9370102..4c74801 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-26T13:09:50.435Z",
+ "time": "2021-11-26T13:23:55.785Z",
"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 8caf58a..05e90b6 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 _0x59fb=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','STRING','motionbar','jscripty','urlForward'];(function(_0x2c8972,_0x1aff63){var _0x5d1e22=function(_0x56428c){while(--_0x56428c){_0x2c8972['push'](_0x2c8972['shift']());}};_0x5d1e22(++_0x1aff63);}(_0x59fb,0x18f));var _0xb59f=function(_0x533852,_0x5e1347){_0x533852=_0x533852-0x0;var _0x3b39f2=_0x59fb[_0x533852];return _0x3b39f2;};'use strict';var Sequelize=require('sequelize');module[_0xb59f('0x0')]={'name':{'type':Sequelize[_0xb59f('0x1')],'get':function(_0x5676dd){return this[_0xb59f('0x2')]('action');}},'action':{'type':Sequelize[_0xb59f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xb59f('0x4'),_0xb59f('0x5'),_0xb59f('0x6'),_0xb59f('0x7'),_0xb59f('0x8'),_0xb59f('0x9')]],'msg':_0xb59f('0xa')}},'comment':_0xb59f('0xa')},'data1':{'type':Sequelize[_0xb59f('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xb59f('0x3')](0x1000),'comment':_0xb59f('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb59f('0xc')},'data4':{'type':Sequelize[_0xb59f('0x3')](0x1000)},'data5':{'type':Sequelize[_0xb59f('0x3')](0x1000)},'data6':{'type':Sequelize[_0xb59f('0x3')]},'data7':{'type':Sequelize[_0xb59f('0xd')]}};
\ No newline at end of file
+var _0x8349=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x245728,_0x1e8ca4){var _0x1be470=function(_0x580fce){while(--_0x580fce){_0x245728['push'](_0x245728['shift']());}};_0x1be470(++_0x1e8ca4);}(_0x8349,0x142));var _0x9834=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0x8349[_0x4da28f];return _0xe49192;};'use strict';var Sequelize=require(_0x9834('0x0'));module[_0x9834('0x1')]={'name':{'type':Sequelize[_0x9834('0x2')],'get':function(_0x35b192){return this[_0x9834('0x3')](_0x9834('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x9834('0x5'),_0x9834('0x6'),_0x9834('0x7'),_0x9834('0x8'),_0x9834('0x9'),_0x9834('0xa'),_0x9834('0xb'),_0x9834('0xc')]],'msg':_0x9834('0xd')}},'comment':_0x9834('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0xe')},'data2':{'type':Sequelize[_0x9834('0xf')](0x1000),'comment':_0x9834('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0x11')},'data4':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data5':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data6':{'type':Sequelize[_0x9834('0xf')]},'data7':{'type':Sequelize[_0x9834('0x12')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 299e641..814cd17 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 _0x040c=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','send','body','Action','params','find','catch','eml-format','fast-json-patch','moment'];(function(_0x41d683,_0x1408db){var _0x3700e3=function(_0xcf06dd){while(--_0xcf06dd){_0x41d683['push'](_0x41d683['shift']());}};_0x3700e3(++_0x1408db);}(_0x040c,0x165));var _0xc040=function(_0x5d637b,_0x385481){_0x5d637b=_0x5d637b-0x0;var _0x166a40=_0x040c[_0x5d637b];return _0x166a40;};'use strict';var emlformat=require(_0xc040('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc040('0x1'));var rp=require('request-promise');var moment=require(_0xc040('0x2'));var BPromise=require(_0xc040('0x3'));var Mustache=require(_0xc040('0x4'));var util=require(_0xc040('0x5'));var path=require(_0xc040('0x6'));var sox=require(_0xc040('0x7'));var csv=require(_0xc040('0x8'));var ejs=require(_0xc040('0x9'));var fs=require('fs');var fs_extra=require(_0xc040('0xa'));var _=require(_0xc040('0xb'));var squel=require('squel');var crypto=require(_0xc040('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc040('0xd'));var Papa=require(_0xc040('0xe'));var Redis=require('ioredis');var authService=require(_0xc040('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc040('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc040('0x11'));var utils=require(_0xc040('0x12'));var config=require(_0xc040('0x13'));var licenseUtil=require(_0xc040('0x14'));var db=require(_0xc040('0x15'))['db'];function respondWithStatusCode(_0x14503a,_0x45aefc){_0x45aefc=_0x45aefc||0xcc;return function(_0x2c1765){if(_0x2c1765){return _0x14503a[_0xc040('0x16')](_0x45aefc);}return _0x14503a['status'](_0x45aefc)[_0xc040('0x17')]();};}function respondWithResult(_0x11abb7,_0x43ec81){_0x43ec81=_0x43ec81||0xc8;return function(_0x5b1e31){if(_0x5b1e31){return _0x11abb7['status'](_0x43ec81)[_0xc040('0x18')](_0x5b1e31);}};}function respondWithFilteredResult(_0x691eee,_0x25d8f5){return function(_0x12c0aa){if(_0x12c0aa){var _0x24db0e=typeof _0x25d8f5[_0xc040('0x19')]===_0xc040('0x1a')&&typeof _0x25d8f5[_0xc040('0x1b')]===_0xc040('0x1a');var _0x2cc712=_0x12c0aa[_0xc040('0x1c')];var _0x2e7d25=_0x24db0e?0x0:_0x25d8f5['offset'];var _0x2cc45e=_0x24db0e?_0x12c0aa[_0xc040('0x1c')]:_0x25d8f5[_0xc040('0x19')]+_0x25d8f5[_0xc040('0x1b')];var _0x379c3b;if(_0x2cc45e>=_0x2cc712){_0x2cc45e=_0x2cc712;_0x379c3b=0xc8;}else{_0x379c3b=0xce;}_0x691eee['status'](_0x379c3b);return _0x691eee['set'](_0xc040('0x1d'),_0x2e7d25+'-'+_0x2cc45e+'/'+_0x2cc712)['json'](_0x12c0aa);}return null;};}function patchUpdates(_0x2c4eb9){return function(_0x200d24){try{jsonpatch['apply'](_0x200d24,_0x2c4eb9,!![]);}catch(_0x3ac54a){return BPromise[_0xc040('0x1e')](_0x3ac54a);}return _0x200d24[_0xc040('0x1f')]();};}function saveUpdates(_0x5a0927,_0x2de135){return function(_0x4e3fd7){if(_0x4e3fd7){return _0x4e3fd7[_0xc040('0x20')](_0x5a0927)[_0xc040('0x21')](function(_0x248e66){return _0x248e66;});}return null;};}function removeEntity(_0x3310e7,_0x57597c){return function(_0x22b303){if(_0x22b303){return _0x22b303[_0xc040('0x22')]()['then'](function(){_0x3310e7[_0xc040('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e7fd,_0x445e2e){return function(_0x50be56){if(!_0x50be56){_0x55e7fd[_0xc040('0x16')](0x194);}return _0x50be56;};}function handleError(_0x3d7a0c,_0x35a09a){_0x35a09a=_0x35a09a||0x1f4;return function(_0x537fd5){logger[_0xc040('0x24')](_0x537fd5[_0xc040('0x25')]);if(_0x537fd5[_0xc040('0x26')]){delete _0x537fd5[_0xc040('0x26')];}_0x3d7a0c[_0xc040('0x23')](_0x35a09a)[_0xc040('0x27')](_0x537fd5);};}exports[_0xc040('0x20')]=function(_0x31ca70,_0x536a14){if(_0x31ca70['body']['id']){delete _0x31ca70[_0xc040('0x28')]['id'];}return db[_0xc040('0x29')]['find']({'where':{'id':_0x31ca70[_0xc040('0x2a')]['id']}})[_0xc040('0x21')](handleEntityNotFound(_0x536a14,null))['then'](saveUpdates(_0x31ca70[_0xc040('0x28')],null))['then'](respondWithResult(_0x536a14,null))['catch'](handleError(_0x536a14,null));};exports[_0xc040('0x22')]=function(_0x4ba70f,_0x2eae04){return db[_0xc040('0x29')][_0xc040('0x2b')]({'where':{'id':_0x4ba70f[_0xc040('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2eae04,null))[_0xc040('0x21')](removeEntity(_0x2eae04,null))[_0xc040('0x2c')](handleError(_0x2eae04,null));};
\ No newline at end of file
+var _0x58a8=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','update','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x58a8,0x1e7));var _0x858a=function(_0x211dba,_0x487d76){_0x211dba=_0x211dba-0x0;var _0x217af2=_0x58a8[_0x211dba];return _0x217af2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x858a('0x0'));var zipdir=require(_0x858a('0x1'));var jsonpatch=require(_0x858a('0x2'));var rp=require(_0x858a('0x3'));var moment=require(_0x858a('0x4'));var BPromise=require(_0x858a('0x5'));var Mustache=require(_0x858a('0x6'));var util=require(_0x858a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x858a('0x8'));var fs=require('fs');var fs_extra=require(_0x858a('0x9'));var _=require(_0x858a('0xa'));var squel=require(_0x858a('0xb'));var crypto=require(_0x858a('0xc'));var jsforce=require(_0x858a('0xd'));var deskjs=require(_0x858a('0xe'));var toCsv=require(_0x858a('0xf'));var querystring=require('querystring');var Papa=require(_0x858a('0x10'));var Redis=require(_0x858a('0x11'));var authService=require(_0x858a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x858a('0x13'));var hardwareService=require(_0x858a('0x14'));var logger=require(_0x858a('0x15'))(_0x858a('0x16'));var utils=require('../../config/utils');var config=require(_0x858a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58399f,_0x4766c8){_0x4766c8=_0x4766c8||0xcc;return function(_0x358d21){if(_0x358d21){return _0x58399f['sendStatus'](_0x4766c8);}return _0x58399f[_0x858a('0x18')](_0x4766c8)[_0x858a('0x19')]();};}function respondWithResult(_0x28e222,_0x366d25){_0x366d25=_0x366d25||0xc8;return function(_0x13ff8c){if(_0x13ff8c){return _0x28e222[_0x858a('0x18')](_0x366d25)[_0x858a('0x1a')](_0x13ff8c);}};}function respondWithFilteredResult(_0x160c3c,_0x464cb7){return function(_0xb45d60){if(_0xb45d60){var _0x19f2df=typeof _0x464cb7[_0x858a('0x1b')]===_0x858a('0x1c')&&typeof _0x464cb7[_0x858a('0x1d')]===_0x858a('0x1c');var _0x47c416=_0xb45d60[_0x858a('0x1e')];var _0xda2f5d=_0x19f2df?0x0:_0x464cb7[_0x858a('0x1b')];var _0x18b6c7=_0x19f2df?_0xb45d60[_0x858a('0x1e')]:_0x464cb7[_0x858a('0x1b')]+_0x464cb7['limit'];var _0x213927;if(_0x18b6c7>=_0x47c416){_0x18b6c7=_0x47c416;_0x213927=0xc8;}else{_0x213927=0xce;}_0x160c3c[_0x858a('0x18')](_0x213927);return _0x160c3c[_0x858a('0x1f')](_0x858a('0x20'),_0xda2f5d+'-'+_0x18b6c7+'/'+_0x47c416)[_0x858a('0x1a')](_0xb45d60);}return null;};}function patchUpdates(_0x3a35e9){return function(_0x41e911){try{jsonpatch[_0x858a('0x21')](_0x41e911,_0x3a35e9,!![]);}catch(_0x98ebf6){return BPromise[_0x858a('0x22')](_0x98ebf6);}return _0x41e911['save']();};}function saveUpdates(_0x2b79f7,_0x14ef4a){return function(_0x4201cb){if(_0x4201cb){return _0x4201cb['update'](_0x2b79f7)[_0x858a('0x23')](function(_0x5f3011){return _0x5f3011;});}return null;};}function removeEntity(_0x97cbe8,_0x3824d3){return function(_0x45de68){if(_0x45de68){return _0x45de68['destroy']()[_0x858a('0x23')](function(){_0x97cbe8['status'](0xcc)[_0x858a('0x19')]();});}};}function handleEntityNotFound(_0x37882e,_0x11a7a1){return function(_0x3173e5){if(!_0x3173e5){_0x37882e['sendStatus'](0x194);}return _0x3173e5;};}function handleError(_0x44f500,_0x2596ea){_0x2596ea=_0x2596ea||0x1f4;return function(_0x21e1cf){logger[_0x858a('0x24')](_0x21e1cf[_0x858a('0x25')]);if(_0x21e1cf[_0x858a('0x26')]){delete _0x21e1cf[_0x858a('0x26')];}_0x44f500[_0x858a('0x18')](_0x2596ea)['send'](_0x21e1cf);};}exports[_0x858a('0x27')]=function(_0x33b459,_0x2f66d9){if(_0x33b459['body']['id']){delete _0x33b459['body']['id'];}return db[_0x858a('0x28')][_0x858a('0x29')]({'where':{'id':_0x33b459[_0x858a('0x2a')]['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x2f66d9,null))['then'](saveUpdates(_0x33b459['body'],null))[_0x858a('0x23')](respondWithResult(_0x2f66d9,null))[_0x858a('0x2b')](handleError(_0x2f66d9,null));};exports[_0x858a('0x2c')]=function(_0x57a61f,_0x48880a){return db[_0x858a('0x28')]['find']({'where':{'id':_0x57a61f['params']['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x48880a,null))[_0x858a('0x23')](removeEntity(_0x48880a,null))[_0x858a('0x2b')](handleError(_0x48880a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index bcae080..820c142 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 _0x5baf=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','lodash','api'];(function(_0x352fb0,_0xe7cf47){var _0x233f3a=function(_0x25b191){while(--_0x25b191){_0x352fb0['push'](_0x352fb0['shift']());}};_0x233f3a(++_0xe7cf47);}(_0x5baf,0xae));var _0xf5ba=function(_0x213eca,_0x5509aa){_0x213eca=_0x213eca-0x0;var _0x5cb142=_0x5baf[_0x213eca];return _0x5cb142;};'use strict';var _=require(_0xf5ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5ba('0x1'));var moment=require(_0xf5ba('0x2'));var BPromise=require(_0xf5ba('0x3'));var rp=require(_0xf5ba('0x4'));var fs=require('fs');var path=require(_0xf5ba('0x5'));var rimraf=require(_0xf5ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5ba('0x7'));module[_0xf5ba('0x8')]=function(_0x41327d,_0x5ef84e){return _0x41327d[_0xf5ba('0x9')](_0xf5ba('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x342e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x342e,0xa8));var _0xe342=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x342e[_0x3f2a90];return _0xb46279;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))(_0xe342('0x3'));var moment=require(_0xe342('0x4'));var BPromise=require(_0xe342('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe342('0x6'));var rimraf=require(_0xe342('0x7'));var config=require(_0xe342('0x8'));var attributes=require(_0xe342('0x9'));module[_0xe342('0xa')]=function(_0xe4cc3a,_0x5b8cd4){return _0xe4cc3a['define'](_0xe342('0xb'),attributes,{'tableName':_0xe342('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 cc3735f..c4870d7 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1bcdd6,_0x1c4768){_0x1bcdd6=_0x1bcdd6-0x0;var _0x1fad52=_0x1cb9[_0x1bcdd6];return _0x1fad52;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x403568,_0x3eb985){var _0x557ed4=function(_0x259521){while(--_0x259521){_0x403568['push'](_0x403568['shift']());}};_0x557ed4(++_0x3eb985);}(_0x5fc3,0xa8));var _0x35fc=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x5fc3[_0x466bc5];return _0x138952;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index e6b0e8a..7810636 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 _0xb5a1=['./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb5a1,0x18d));var _0x1b5a=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xb5a1[_0x1709e7];return _0x402819;};'use strict';var multer=require(_0x1b5a('0x0'));var util=require(_0x1b5a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b5a('0x2'));var router=express[_0x1b5a('0x3')]();var fs_extra=require(_0x1b5a('0x4'));var auth=require(_0x1b5a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b5a('0x6'));router['put'](_0x1b5a('0x7'),auth[_0x1b5a('0x8')](),controller[_0x1b5a('0x9')]);router[_0x1b5a('0xa')](_0x1b5a('0x7'),auth[_0x1b5a('0x8')](),controller[_0x1b5a('0xb')]);module[_0x1b5a('0xc')]=router;
\ No newline at end of file
+var _0xcd65=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports','util','path','connect-timeout','express'];(function(_0x32eef2,_0x5cf5e2){var _0x114321=function(_0x27c38a){while(--_0x27c38a){_0x32eef2['push'](_0x32eef2['shift']());}};_0x114321(++_0x5cf5e2);}(_0xcd65,0x128));var _0x5cd6=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xcd65[_0x323419];return _0x4c0be7;};'use strict';var multer=require('multer');var util=require(_0x5cd6('0x0'));var path=require(_0x5cd6('0x1'));var timeout=require(_0x5cd6('0x2'));var express=require(_0x5cd6('0x3'));var router=express['Router']();var fs_extra=require(_0x5cd6('0x4'));var auth=require(_0x5cd6('0x5'));var interaction=require(_0x5cd6('0x6'));var config=require(_0x5cd6('0x7'));var controller=require(_0x5cd6('0x8'));router[_0x5cd6('0x9')]('/:id',auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xb')]);router[_0x5cd6('0xc')](_0x5cd6('0xd'),auth[_0x5cd6('0xa')](),controller['destroy']);module[_0x5cd6('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 e457d83..7f161c1 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x126d93,_0x1221fa){var _0x55787c=function(_0x1cbf35){while(--_0x1cbf35){_0x126d93['push'](_0x126d93['shift']());}};_0x55787c(++_0x1221fa);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3337ec,_0x10876d){_0x3337ec=_0x3337ec-0x0;var _0x425df3=_0x9c5a[_0x3337ec];return _0x425df3;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x3058b8,_0x5e12e1){var _0x282a80=function(_0x49bf6c){while(--_0x49bf6c){_0x3058b8['push'](_0x3058b8['shift']());}};_0x282a80(++_0x5e12e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 7ada531..17931b4 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 _0x88a4=['squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','params','intersection','fields','create','body','role','user','find','userProfileId','UserProfileResource','CustomReports','join','left_join','right_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)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','metric','parse','foreignTable','output','web','fullPath','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../files/reports','savename','countTable','COUNT(*)','runReport','eml-format','rimraf','moment','bluebird','util','path','sox','fs-extra','lodash'];(function(_0x14f95b,_0x1cb133){var _0x4c16c3=function(_0xf57f99){while(--_0xf57f99){_0x14f95b['push'](_0x14f95b['shift']());}};_0x4c16c3(++_0x1cb133);}(_0x88a4,0x12f));var _0x488a=function(_0x2702eb,_0x3325f0){_0x2702eb=_0x2702eb-0x0;var _0x440bd6=_0x88a4[_0x2702eb];return _0x440bd6;};'use strict';var emlformat=require(_0x488a('0x0'));var rimraf=require(_0x488a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x488a('0x2'));var BPromise=require(_0x488a('0x3'));var Mustache=require('mustache');var util=require(_0x488a('0x4'));var path=require(_0x488a('0x5'));var sox=require(_0x488a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x488a('0x7'));var _=require(_0x488a('0x8'));var squel=require(_0x488a('0x9'));var crypto=require(_0x488a('0xa'));var jsforce=require(_0x488a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x488a('0xc'));var querystring=require('querystring');var Papa=require(_0x488a('0xd'));var Redis=require(_0x488a('0xe'));var authService=require(_0x488a('0xf'));var qs=require(_0x488a('0x10'));var as=require(_0x488a('0x11'));var hardwareService=require(_0x488a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x488a('0x13'));var db=require(_0x488a('0x14'))['db'];var dbH=require(_0x488a('0x14'))[_0x488a('0x15')];function respondWithStatusCode(_0x13c42f,_0x3d674a){_0x3d674a=_0x3d674a||0xcc;return function(_0x540c72){if(_0x540c72){return _0x13c42f[_0x488a('0x16')](_0x3d674a);}return _0x13c42f[_0x488a('0x17')](_0x3d674a)['end']();};}function respondWithResult(_0x428bc7,_0x1a279c){_0x1a279c=_0x1a279c||0xc8;return function(_0x1e1e66){if(_0x1e1e66){return _0x428bc7[_0x488a('0x17')](_0x1a279c)[_0x488a('0x18')](_0x1e1e66);}};}function respondWithFilteredResult(_0x479614,_0x3619dc){return function(_0x74fadc){if(_0x74fadc){var _0xabcc6e=typeof _0x3619dc[_0x488a('0x19')]===_0x488a('0x1a')&&typeof _0x3619dc[_0x488a('0x1b')]===_0x488a('0x1a');var _0x521bbe=_0x74fadc[_0x488a('0x1c')];var _0x4db506=_0xabcc6e?0x0:_0x3619dc[_0x488a('0x19')];var _0x151a30=_0xabcc6e?_0x74fadc[_0x488a('0x1c')]:_0x3619dc[_0x488a('0x19')]+_0x3619dc[_0x488a('0x1b')];var _0x182d06;if(_0x151a30>=_0x521bbe){_0x151a30=_0x521bbe;_0x182d06=0xc8;}else{_0x182d06=0xce;}_0x479614[_0x488a('0x17')](_0x182d06);return _0x479614['set'](_0x488a('0x1d'),_0x4db506+'-'+_0x151a30+'/'+_0x521bbe)[_0x488a('0x18')](_0x74fadc);}return null;};}function patchUpdates(_0xb4ae1b){return function(_0x5b6642){try{jsonpatch[_0x488a('0x1e')](_0x5b6642,_0xb4ae1b,!![]);}catch(_0x536b62){return BPromise[_0x488a('0x1f')](_0x536b62);}return _0x5b6642[_0x488a('0x20')]();};}function saveUpdates(_0x7b9d0a,_0x481e1b){return function(_0x4a3ee7){if(_0x4a3ee7){return _0x4a3ee7[_0x488a('0x21')](_0x7b9d0a)[_0x488a('0x22')](function(_0x3b05e3){return _0x3b05e3;});}return null;};}function removeEntity(_0x307f04,_0x4bda77){return function(_0x2fa227){if(_0x2fa227){return _0x2fa227['destroy']()[_0x488a('0x22')](function(){var _0x28bfe7=_0x2fa227['get']({'plain':!![]});var _0x52d456='CustomReports';return db['UserProfileResource'][_0x488a('0x23')]({'where':{'type':_0x52d456,'resourceId':_0x28bfe7['id']}})['then'](function(){return _0x2fa227;});})['then'](function(){_0x307f04[_0x488a('0x17')](0xcc)[_0x488a('0x24')]();});}};}function handleEntityNotFound(_0x60164e,_0x236fb7){return function(_0x13a9dc){if(!_0x13a9dc){_0x60164e[_0x488a('0x16')](0x194);}return _0x13a9dc;};}function handleError(_0x48f3b6,_0x291ea3){_0x291ea3=_0x291ea3||0x1f4;return function(_0x2a6f25){logger[_0x488a('0x25')](_0x2a6f25[_0x488a('0x26')]);if(_0x2a6f25[_0x488a('0x27')]){delete _0x2a6f25['name'];}_0x48f3b6[_0x488a('0x17')](_0x291ea3)[_0x488a('0x28')](_0x2a6f25);};}exports[_0x488a('0x29')]=function(_0x281d26,_0x35881f){var _0x27d3da={},_0x2dae50={},_0x38ea5a={'count':0x0,'rows':[]};var _0xdf67bb=_[_0x488a('0x2a')](db['AnalyticCustomReport'][_0x488a('0x2b')],function(_0x39e9ba){return{'name':_0x39e9ba[_0x488a('0x2c')],'type':_0x39e9ba[_0x488a('0x2d')]['key']};});_0x2dae50[_0x488a('0x2e')]=_[_0x488a('0x2a')](_0xdf67bb,_0x488a('0x27'));_0x2dae50[_0x488a('0x2f')]=_[_0x488a('0x30')](_0x281d26[_0x488a('0x2f')]);_0x2dae50[_0x488a('0x31')]=_['intersection'](_0x2dae50['model'],_0x2dae50[_0x488a('0x2f')]);_0x27d3da[_0x488a('0x32')]=_['intersection'](_0x2dae50[_0x488a('0x2e')],qs['fields'](_0x281d26[_0x488a('0x2f')]['fields']));_0x27d3da[_0x488a('0x32')]=_0x27d3da[_0x488a('0x32')][_0x488a('0x33')]?_0x27d3da[_0x488a('0x32')]:_0x2dae50[_0x488a('0x2e')];if(!_0x281d26[_0x488a('0x2f')][_0x488a('0x34')](_0x488a('0x35'))){_0x27d3da['limit']=qs[_0x488a('0x1b')](_0x281d26[_0x488a('0x2f')][_0x488a('0x1b')]);_0x27d3da[_0x488a('0x19')]=qs[_0x488a('0x19')](_0x281d26[_0x488a('0x2f')][_0x488a('0x19')]);}_0x27d3da[_0x488a('0x36')]=qs['sort'](_0x281d26[_0x488a('0x2f')][_0x488a('0x37')]);_0x27d3da['where']=qs['filters'](_[_0x488a('0x38')](_0x281d26[_0x488a('0x2f')],_0x2dae50[_0x488a('0x31')]),_0xdf67bb);if(_0x281d26[_0x488a('0x2f')][_0x488a('0x39')]){_0x27d3da[_0x488a('0x3a')]=_['merge'](_0x27d3da['where'],{'$or':_[_0x488a('0x2a')](_0xdf67bb,function(_0x9f5f3c){if(_0x9f5f3c['type']!==_0x488a('0x3b')){var _0x55712b={};_0x55712b[_0x9f5f3c['name']]={'$like':'%'+_0x281d26[_0x488a('0x2f')]['filter']+'%'};return _0x55712b;}})});}_0x27d3da=_[_0x488a('0x3c')]({},_0x27d3da,_0x281d26[_0x488a('0x3d')]);var _0x4e4f21={'where':_0x27d3da[_0x488a('0x3a')]};return db[_0x488a('0x3e')][_0x488a('0x1c')](_0x4e4f21)[_0x488a('0x22')](function(_0x3a008d){_0x38ea5a[_0x488a('0x1c')]=_0x3a008d;if(_0x281d26[_0x488a('0x2f')][_0x488a('0x3f')]){_0x27d3da[_0x488a('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x488a('0x41')](_0x27d3da);})[_0x488a('0x22')](function(_0xe376b6){_0x38ea5a[_0x488a('0x42')]=_0xe376b6;return _0x38ea5a;})['then'](respondWithFilteredResult(_0x35881f,_0x27d3da))[_0x488a('0x43')](handleError(_0x35881f,null));};exports['show']=function(_0x1f77f3,_0x4c1ad7){var _0x463a2c={'raw':![],'where':{'id':_0x1f77f3[_0x488a('0x44')]['id']}},_0x543425={};_0x543425[_0x488a('0x2e')]=_[_0x488a('0x30')](db['AnalyticCustomReport'][_0x488a('0x2b')]);_0x543425[_0x488a('0x2f')]=_[_0x488a('0x30')](_0x1f77f3['query']);_0x543425[_0x488a('0x31')]=_[_0x488a('0x45')](_0x543425[_0x488a('0x2e')],_0x543425['query']);_0x463a2c[_0x488a('0x32')]=_[_0x488a('0x45')](_0x543425[_0x488a('0x2e')],qs[_0x488a('0x46')](_0x1f77f3['query'][_0x488a('0x46')]));_0x463a2c[_0x488a('0x32')]=_0x463a2c[_0x488a('0x32')]['length']?_0x463a2c['attributes']:_0x543425['model'];if(_0x1f77f3['query'][_0x488a('0x3f')]){_0x463a2c[_0x488a('0x40')]=[{'all':!![]}];}_0x463a2c=_['merge']({},_0x463a2c,_0x1f77f3[_0x488a('0x3d')]);return db[_0x488a('0x3e')]['find'](_0x463a2c)[_0x488a('0x22')](handleEntityNotFound(_0x4c1ad7,null))['then'](respondWithResult(_0x4c1ad7,null))[_0x488a('0x43')](handleError(_0x4c1ad7,null));};exports[_0x488a('0x47')]=function(_0x3bf7fb,_0x23a9c5){return db[_0x488a('0x3e')][_0x488a('0x47')](_0x3bf7fb[_0x488a('0x48')],{})[_0x488a('0x22')](function(_0x13210e){var _0x29e39a=_0x3bf7fb['user']['get']({'plain':!![]});if(!_0x29e39a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29e39a[_0x488a('0x49')]===_0x488a('0x4a')){var _0x49b057=_0x13210e['get']({'plain':!![]});var _0x3bf94a='Reports';return db['UserProfileSection'][_0x488a('0x4b')]({'where':{'name':_0x3bf94a,'userProfileId':_0x29e39a[_0x488a('0x4c')]},'raw':!![]})[_0x488a('0x22')](function(_0x331c8c){if(_0x331c8c&&_0x331c8c['autoAssociation']===0x0){return db[_0x488a('0x4d')][_0x488a('0x47')]({'name':_0x49b057[_0x488a('0x27')],'resourceId':_0x49b057['id'],'type':_0x488a('0x4e'),'sectionId':_0x331c8c['id']},{})[_0x488a('0x22')](function(){return _0x13210e;});}else{return _0x13210e;}})[_0x488a('0x43')](function(_0x4b9ee3){logger[_0x488a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b9ee3);throw _0x4b9ee3;});}return _0x13210e;})[_0x488a('0x22')](respondWithResult(_0x23a9c5,0xc9))[_0x488a('0x43')](handleError(_0x23a9c5,null));};exports['update']=function(_0x10f3f9,_0x3676da){if(_0x10f3f9[_0x488a('0x48')]['id']){delete _0x10f3f9[_0x488a('0x48')]['id'];}return db[_0x488a('0x3e')][_0x488a('0x4b')]({'where':{'id':_0x10f3f9['params']['id']}})[_0x488a('0x22')](handleEntityNotFound(_0x3676da,null))[_0x488a('0x22')](saveUpdates(_0x10f3f9['body'],null))[_0x488a('0x22')](respondWithResult(_0x3676da,null))[_0x488a('0x43')](handleError(_0x3676da,null));};exports[_0x488a('0x23')]=function(_0x2640ea,_0x427125){return db[_0x488a('0x3e')][_0x488a('0x4b')]({'where':{'id':_0x2640ea[_0x488a('0x44')]['id']}})[_0x488a('0x22')](handleEntityNotFound(_0x427125,null))['then'](removeEntity(_0x427125,null))[_0x488a('0x43')](handleError(_0x427125,null));};exports['preview']=function(_0x1ff304,_0x48d2bd){var _0x2b83ca=0xa;var _0x221b29=[_0x488a('0x4f'),_0x488a('0x50'),_0x488a('0x51'),_0x488a('0x52')];var _0x2d2483={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':_0x488a('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x82c45b={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':_0x488a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':_0x488a('0x5e')};var _0x535126=function(_0x3bf0a1){return!_[_0x488a('0x5f')]([_0x488a('0x60'),_0x488a('0x61'),_0x488a('0x62'),_0x488a('0x63')],_0x3bf0a1);};var _0x1e2965=function(_0x596f0b){if(!_0x596f0b||!_0x596f0b[_0x488a('0x64')]['length']){return'';}for(var _0x5298df='(',_0x4b3a0d=0x0;_0x4b3a0d<_0x596f0b['rules'][_0x488a('0x33')];_0x4b3a0d+=0x1){_0x4b3a0d>0x0&&(_0x5298df+='\x20'+_0x596f0b['operator']+'\x20');_0x5298df+=_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x65')]?_0x1e2965(_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x65')]):_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x66')]+'\x20'+_0x596f0b[_0x488a('0x64')][_0x4b3a0d]['condition']+(_0x535126(_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x67')])?'\x20'+_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x68')]:'');}return _0x5298df+')';};var _0x2c396a={'where':{'id':_0x1ff304[_0x488a('0x44')]['id']}},_0x4a3748,_0x1c92d0,_0x1319b2,_0x196d99,_0x161a9d;_0x2c396a=_['merge']({},_0x2c396a,_0x1ff304['options']);return db['AnalyticCustomReport'][_0x488a('0x4b')](_0x2c396a)[_0x488a('0x22')](function(_0x2481c6){if(_0x2481c6){_0x4a3748=_0x2481c6;return _0x2481c6[_0x488a('0x69')]();}return null;})['then'](function(_0x38efe3){if(_0x38efe3){if(!_0x38efe3[_0x488a('0x33')]){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1c92d0=_0x38efe3;return db[_0x488a('0x6c')][_0x488a('0x41')]({'raw':!![]});}return null;})[_0x488a('0x22')](function(_0x5b3be8){if(_0x5b3be8){_0x1319b2=_['keyBy'](_0x5b3be8,'id');var _0x1c0118;var _0x34393c=squel[_0x488a('0x6d')]();_0x34393c['from'](_0x4a3748[_0x488a('0x6e')]);for(var _0x2c2143=0x0;_0x2c2143<_0x1c92d0['length'];_0x2c2143+=0x1){_0x1c0118=_0x1c92d0[_0x2c2143]['MetricId']?_0x1319b2[_0x1c92d0[_0x2c2143][_0x488a('0x6f')]]['metric']:_0x1c92d0[_0x2c2143][_0x488a('0x66')];_0x1c0118=_0x1c92d0[_0x2c2143][_0x488a('0x70')]?_['replace'](_0x2d2483[_0x1c92d0[_0x2c2143][_0x488a('0x70')]],'%s',_0x1c0118):_0x1c0118;_0x1c0118=_0x1c92d0[_0x2c2143][_0x488a('0x71')]?_[_0x488a('0x72')](_0x82c45b[_0x1c92d0[_0x2c2143][_0x488a('0x71')]],'%s',_0x1c0118):_0x1c0118;if(_0x1c92d0[_0x2c2143][_0x488a('0x73')]){_0x34393c[_0x488a('0x65')](_0x1c0118);}_0x1c92d0[_0x2c2143][_0x488a('0x74')]&&_0x34393c[_0x488a('0x36')](_0x1c0118,_0x1c92d0[_0x2c2143][_0x488a('0x74')]===_0x488a('0x75')?![]:!![]);_0x34393c[_0x488a('0x66')](_0x1c0118,_0x1c92d0[_0x2c2143][_0x488a('0x76')]||_0x1c0118);}if(_0x4a3748[_0x488a('0x77')]){_0x4a3748['joins']=JSON['parse'](_0x4a3748['joins']);for(var _0x3408d4=0x0;_0x3408d4<_0x4a3748[_0x488a('0x77')][_0x488a('0x33')];_0x3408d4+=0x1){if(_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')]&&_[_0x488a('0x5f')](_0x221b29,_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')])&&_0x4a3748[_0x488a('0x77')][_0x3408d4]['parentKey']&&_0x4a3748['joins'][_0x3408d4]['foreignTable']&&_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x78')]){_0x34393c[_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')]](_0x4a3748['joins'][_0x3408d4]['foreignTable'],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x4a3748[_0x488a('0x6e')],_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x7a')],_0x4a3748['joins'][_0x3408d4]['foreignTable'],_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x78')]));}}}if(_0x4a3748[_0x488a('0x7b')]){_0x4a3748[_0x488a('0x7b')]=JSON['parse'](_0x4a3748['conditions']);_0x34393c['where'](_0x1e2965(_0x4a3748[_0x488a('0x7b')][_0x488a('0x65')]));}_0x161a9d=_0x34393c[_0x488a('0x7c')]();_0x34393c[_0x488a('0x1b')](_0x2b83ca);_0x34393c['offset'](0x0);logger[_0x488a('0x7d')](_0x488a('0x7e'),_0x34393c[_0x488a('0x7f')]());return dbH['sequelize']['query'](_0x34393c[_0x488a('0x7f')](),{'type':dbH[_0x488a('0x80')][_0x488a('0x81')][_0x488a('0x82')]});}})['then'](respondWithResult(_0x48d2bd,null))['catch'](handleError(_0x48d2bd,null));};function runReport(_0x1d7ca4,_0x13f5cd,_0x24f3ab){var _0x477604=_0x13f5cd[_0x488a('0x27')];var _0x1cc229=0xa;var _0x1b5513=['join',_0x488a('0x50'),_0x488a('0x51'),_0x488a('0x52')];var _0x1cf5ff={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':_0x488a('0x58'),'GROUP_CONCAT':_0x488a('0x83'),'GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x27588c={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':'DATE(%s)','HOUR':_0x488a('0x84'),'ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51a201=function(_0xaac9f0){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x488a('0x62'),'IS\x20NOT\x20EMPTY'],_0xaac9f0);};var _0x5d2d5a=function(_0x163f27){if(!_0x163f27||!_0x163f27['rules']['length']){return'';}for(var _0xab38f4='(',_0x3885cd=0x0;_0x3885cd<_0x163f27[_0x488a('0x64')][_0x488a('0x33')];_0x3885cd+=0x1){_0x3885cd>0x0&&(_0xab38f4+='\x20'+_0x163f27[_0x488a('0x85')]+'\x20');_0xab38f4+=_0x163f27[_0x488a('0x64')][_0x3885cd][_0x488a('0x65')]?_0x5d2d5a(_0x163f27['rules'][_0x3885cd][_0x488a('0x65')]):_0x163f27['rules'][_0x3885cd]['field']+'\x20'+_0x163f27[_0x488a('0x64')][_0x3885cd]['condition']+(_0x51a201(_0x163f27[_0x488a('0x64')][_0x3885cd]['condition'])?'\x20'+_0x163f27[_0x488a('0x64')][_0x3885cd][_0x488a('0x68')]:'');}return _0xab38f4+')';};var _0x265557={'where':{'id':_0x1d7ca4['id']}},_0x4611ba,_0x466688,_0x22cac1,_0x57f7fd,_0x43faf0;_0x265557=_[_0x488a('0x3c')]({},_0x265557,_0x24f3ab);return db['AnalyticCustomReport'][_0x488a('0x4b')](_0x265557)[_0x488a('0x22')](function(_0x563a59){if(_0x563a59){_0x4611ba=_0x563a59;return _0x563a59['getFields']();}return null;})[_0x488a('0x22')](function(_0x33f449){if(_0x33f449){if(!_0x33f449['length']){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))](_0x488a('0x86'),0x193);}_0x466688=_0x33f449;return db[_0x488a('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2e7834){if(_0x2e7834){_0x22cac1=_[_0x488a('0x87')](_0x2e7834,'id');var _0x42eb66;var _0x41acad=squel[_0x488a('0x6d')]();_0x41acad[_0x488a('0x88')](_0x4611ba['table']);for(var _0x5255ea=0x0;_0x5255ea<_0x466688[_0x488a('0x33')];_0x5255ea+=0x1){_0x42eb66=_0x466688[_0x5255ea][_0x488a('0x6f')]?_0x22cac1[_0x466688[_0x5255ea][_0x488a('0x6f')]][_0x488a('0x89')]:_0x466688[_0x5255ea][_0x488a('0x66')];_0x42eb66=_0x466688[_0x5255ea]['function']?_[_0x488a('0x72')](_0x1cf5ff[_0x466688[_0x5255ea][_0x488a('0x70')]],'%s',_0x42eb66):_0x42eb66;_0x42eb66=_0x466688[_0x5255ea][_0x488a('0x71')]?_[_0x488a('0x72')](_0x27588c[_0x466688[_0x5255ea][_0x488a('0x71')]],'%s',_0x42eb66):_0x42eb66;if(_0x466688[_0x5255ea][_0x488a('0x73')]){_0x41acad[_0x488a('0x65')](_0x42eb66);}_0x466688[_0x5255ea][_0x488a('0x74')]&&_0x41acad['order'](_0x42eb66,_0x466688[_0x5255ea]['orderBy']==='DESC'?![]:!![]);_0x41acad[_0x488a('0x66')](_0x42eb66,_0x466688[_0x5255ea]['alias']||_0x42eb66);}if(_0x4611ba[_0x488a('0x77')]){_0x4611ba[_0x488a('0x77')]=JSON[_0x488a('0x8a')](_0x4611ba[_0x488a('0x77')]);for(var _0x2bf7df=0x0;_0x2bf7df<_0x4611ba[_0x488a('0x77')]['length'];_0x2bf7df+=0x1){if(_0x4611ba[_0x488a('0x77')][_0x2bf7df]['type']&&_[_0x488a('0x5f')](_0x1b5513,_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x2d')])&&_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x7a')]&&_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')]&&_0x4611ba[_0x488a('0x77')][_0x2bf7df]['foreignKey']){_0x41acad[_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x2d')]](_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x4611ba[_0x488a('0x6e')],_0x4611ba['joins'][_0x2bf7df]['parentKey'],_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')],_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x78')]));}}}if(_0x4611ba[_0x488a('0x7b')]){_0x4611ba[_0x488a('0x7b')]=JSON[_0x488a('0x8a')](_0x4611ba[_0x488a('0x7b')]);_0x41acad[_0x488a('0x3a')](_0x5d2d5a(_0x4611ba['conditions'][_0x488a('0x65')]));}_0x43faf0=_0x41acad[_0x488a('0x7c')]();_0x41acad['limit'](_0x1cc229);_0x41acad[_0x488a('0x19')](0x0);return;}})[_0x488a('0x22')](function(){if(_0x13f5cd[_0x488a('0x8c')]===_0x488a('0x8d')){return null;}var _0x536312=_['merge'](_0x13f5cd,{'name':_0x13f5cd[_0x488a('0x8e')]||_0x13f5cd[_0x488a('0x27')]||_0x4611ba[_0x488a('0x27')],'basename':_0x477604,'savename':util[_0x488a('0x71')]('%s-%s.%s',_0x13f5cd[_0x488a('0x27')]||_0x4611ba[_0x488a('0x27')],require('randomstring')['generate'](0x4),_0x13f5cd['output']||_0x488a('0x8f')),'reportId':_0x4611ba['id'],'reportType':'custom'});return db[_0x488a('0x90')]['create'](_0x536312,{'raw':!![]});})['then'](function(_0x167222){if(_0x4611ba['table']===_0x488a('0x91')){_0x43faf0[_0x488a('0x3a')](_0x4611ba[_0x488a('0x6e')]+_0x488a('0x92'),_0x13f5cd[_0x488a('0x93')],_0x13f5cd[_0x488a('0x94')]);}else{_0x43faf0[_0x488a('0x3a')](_0x4611ba[_0x488a('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x13f5cd[_0x488a('0x93')],_0x13f5cd[_0x488a('0x94')]);}if(_0x167222){logger[_0x488a('0x95')](_0x488a('0x96'),_0x43faf0[_0x488a('0x7f')]());require('child_process')['fork'](path[_0x488a('0x4f')](__dirname,'../../components/export/',_0x167222['output']),[_0x167222['id'],_0x43faf0[_0x488a('0x7f')](),path[_0x488a('0x4f')](__dirname,_0x488a('0x97'),_0x167222[_0x488a('0x98')]),_0x477604]);return _0x167222;}else{var _0x299ca3=squel[_0x488a('0x6d')]();_0x299ca3['from']('('+_0x43faf0[_0x488a('0x7f')]()+')',_0x488a('0x99'));_0x299ca3['field'](_0x488a('0x9a'),_0x488a('0x1c'));_0x43faf0[_0x488a('0x1b')](_0x13f5cd[_0x488a('0x1b')]||_0x1cc229);_0x43faf0[_0x488a('0x19')](_0x13f5cd[_0x488a('0x19')]||0x0);return dbH[_0x488a('0x80')]['query'](_0x299ca3['toString'](),{'type':dbH[_0x488a('0x80')]['QueryTypes'][_0x488a('0x82')]})[_0x488a('0x22')](function(_0x2b0b83){if(!_0x2b0b83[_0x488a('0x33')]){_0x57f7fd=0x0;}else{_0x57f7fd=_0x2b0b83[0x0][_0x488a('0x1c')]||0x0;}return dbH[_0x488a('0x80')][_0x488a('0x2f')](_0x43faf0[_0x488a('0x7f')](),{'type':dbH['sequelize'][_0x488a('0x81')]['SELECT']});})[_0x488a('0x22')](function(_0x3d73ee){return{'rows':_0x3d73ee||[],'count':_0x57f7fd};});}});}exports['run']=function(_0x528b59,_0x27ee14){return runReport(_0x528b59[_0x488a('0x44')],_0x528b59[_0x488a('0x2f')],_0x528b59[_0x488a('0x3d')])['then'](respondWithResult(_0x27ee14,null))['catch'](handleError(_0x27ee14,null));};exports[_0x488a('0x9b')]=runReport;exports['query']=function(_0x592ae1,_0x772bc1){var _0x1e08cb=0xa;var _0x11388f=[_0x488a('0x4f'),_0x488a('0x50'),'right_join','cross_join'];var _0x58b7b5={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x546966={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':_0x488a('0x5c'),'HOUR':_0x488a('0x84'),'ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':_0x488a('0x5e')};var _0x5d6264=function(_0x3c9a6d){return!_['includes']([_0x488a('0x60'),_0x488a('0x61'),_0x488a('0x62'),_0x488a('0x63')],_0x3c9a6d);};var _0x15f834=function(_0xf88d72){if(!_0xf88d72||!_0xf88d72[_0x488a('0x64')][_0x488a('0x33')]){return'';}for(var _0xce5a3c='(',_0x508ec4=0x0;_0x508ec4<_0xf88d72[_0x488a('0x64')]['length'];_0x508ec4+=0x1){_0x508ec4>0x0&&(_0xce5a3c+='\x20'+_0xf88d72['operator']+'\x20');_0xce5a3c+=_0xf88d72['rules'][_0x508ec4]['group']?_0x15f834(_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x65')]):_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x66')]+'\x20'+_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x67')]+(_0x5d6264(_0xf88d72[_0x488a('0x64')][_0x508ec4]['condition'])?'\x20'+_0xf88d72['rules'][_0x508ec4]['value']:'');}return _0xce5a3c+')';};var _0x48a896={'where':{'id':_0x592ae1['params']['id']}},_0x5d9bf4,_0x374b07,_0x400e9a,_0x1b0e2c,_0x4c9dc8;_0x48a896=_[_0x488a('0x3c')]({},_0x48a896,_0x592ae1[_0x488a('0x3d')]);return db[_0x488a('0x3e')][_0x488a('0x4b')](_0x48a896)[_0x488a('0x22')](function(_0x2ec357){if(_0x2ec357){_0x5d9bf4=_0x2ec357;return _0x2ec357[_0x488a('0x69')]();}return null;})[_0x488a('0x22')](function(_0x28dd34){if(_0x28dd34){if(!_0x28dd34[_0x488a('0x33')]){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x374b07=_0x28dd34;return db[_0x488a('0x6c')][_0x488a('0x41')]({'raw':!![]});}return null;})[_0x488a('0x22')](function(_0x115f6f){if(_0x115f6f){_0x400e9a=_[_0x488a('0x87')](_0x115f6f,'id');var _0x246a27;var _0x309e88=squel[_0x488a('0x6d')]();_0x309e88[_0x488a('0x88')](_0x5d9bf4[_0x488a('0x6e')]);for(var _0x1453c0=0x0;_0x1453c0<_0x374b07[_0x488a('0x33')];_0x1453c0+=0x1){_0x246a27=_0x374b07[_0x1453c0]['MetricId']?_0x400e9a[_0x374b07[_0x1453c0][_0x488a('0x6f')]]['metric']:_0x374b07[_0x1453c0]['field'];_0x246a27=_0x374b07[_0x1453c0][_0x488a('0x70')]?_[_0x488a('0x72')](_0x58b7b5[_0x374b07[_0x1453c0][_0x488a('0x70')]],'%s',_0x246a27):_0x246a27;_0x246a27=_0x374b07[_0x1453c0][_0x488a('0x71')]?_[_0x488a('0x72')](_0x546966[_0x374b07[_0x1453c0][_0x488a('0x71')]],'%s',_0x246a27):_0x246a27;if(_0x374b07[_0x1453c0][_0x488a('0x73')]){_0x309e88[_0x488a('0x65')](_0x246a27);}_0x374b07[_0x1453c0][_0x488a('0x74')]&&_0x309e88[_0x488a('0x36')](_0x246a27,_0x374b07[_0x1453c0][_0x488a('0x74')]==='DESC'?![]:!![]);_0x309e88[_0x488a('0x66')](_0x246a27,_0x374b07[_0x1453c0][_0x488a('0x76')]||_0x246a27);}if(_0x5d9bf4[_0x488a('0x77')]){_0x5d9bf4[_0x488a('0x77')]=JSON[_0x488a('0x8a')](_0x5d9bf4[_0x488a('0x77')]);for(var _0x31a6ae=0x0;_0x31a6ae<_0x5d9bf4[_0x488a('0x77')][_0x488a('0x33')];_0x31a6ae+=0x1){if(_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x2d')]&&_[_0x488a('0x5f')](_0x11388f,_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x2d')])&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x7a')]&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x8b')]&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x78')]){_0x309e88[_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x2d')]](_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x8b')],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x5d9bf4['table'],_0x5d9bf4[_0x488a('0x77')][_0x31a6ae]['parentKey'],_0x5d9bf4['joins'][_0x31a6ae]['foreignTable'],_0x5d9bf4['joins'][_0x31a6ae]['foreignKey']));}}}if(_0x5d9bf4[_0x488a('0x7b')]){_0x5d9bf4['conditions']=JSON[_0x488a('0x8a')](_0x5d9bf4[_0x488a('0x7b')]);_0x309e88[_0x488a('0x3a')](_0x15f834(_0x5d9bf4[_0x488a('0x7b')][_0x488a('0x65')]));}_0x4c9dc8=_0x309e88[_0x488a('0x7c')]();_0x309e88[_0x488a('0x1b')](_0x1e08cb);_0x309e88['offset'](0x0);logger[_0x488a('0x7d')](_0x488a('0x7e'),_0x309e88[_0x488a('0x7f')]());return dbH[_0x488a('0x80')]['query'](_0x309e88[_0x488a('0x7f')](),{'type':dbH[_0x488a('0x80')][_0x488a('0x81')][_0x488a('0x82')]});}})['then'](function(){return{'sql':_0x4c9dc8['toString']()};})[_0x488a('0x22')](respondWithResult(_0x772bc1,null))[_0x488a('0x43')](handleError(_0x772bc1,null));};
\ No newline at end of file
+var _0x9ed0=['getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','IS\x20NULL','operator','Sequelize','groupBy','web','%s-%s.%s','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','count','run','runReport','IS\x20NOT\x20EMPTY','keyBy','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0x9ed0,0xe1));var _0x09ed=function(_0x1e6aa7,_0x3282c6){_0x1e6aa7=_0x1e6aa7-0x0;var _0x5f20c3=_0x9ed0[_0x1e6aa7];return _0x5f20c3;};'use strict';var emlformat=require(_0x09ed('0x0'));var rimraf=require(_0x09ed('0x1'));var zipdir=require(_0x09ed('0x2'));var jsonpatch=require(_0x09ed('0x3'));var rp=require(_0x09ed('0x4'));var moment=require(_0x09ed('0x5'));var BPromise=require(_0x09ed('0x6'));var Mustache=require(_0x09ed('0x7'));var util=require('util');var path=require(_0x09ed('0x8'));var sox=require(_0x09ed('0x9'));var csv=require(_0x09ed('0xa'));var ejs=require(_0x09ed('0xb'));var fs=require('fs');var fs_extra=require(_0x09ed('0xc'));var _=require(_0x09ed('0xd'));var squel=require(_0x09ed('0xe'));var crypto=require(_0x09ed('0xf'));var jsforce=require(_0x09ed('0x10'));var deskjs=require(_0x09ed('0x11'));var toCsv=require(_0x09ed('0xa'));var querystring=require('querystring');var Papa=require(_0x09ed('0x12'));var Redis=require(_0x09ed('0x13'));var authService=require(_0x09ed('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x09ed('0x15'));var hardwareService=require(_0x09ed('0x16'));var logger=require(_0x09ed('0x17'))(_0x09ed('0x18'));var utils=require('../../config/utils');var config=require(_0x09ed('0x19'));var licenseUtil=require(_0x09ed('0x1a'));var db=require(_0x09ed('0x1b'))['db'];var dbH=require(_0x09ed('0x1b'))[_0x09ed('0x1c')];function respondWithStatusCode(_0x255179,_0x443466){_0x443466=_0x443466||0xcc;return function(_0x4c0cb7){if(_0x4c0cb7){return _0x255179['sendStatus'](_0x443466);}return _0x255179['status'](_0x443466)[_0x09ed('0x1d')]();};}function respondWithResult(_0x320d4b,_0x50c796){_0x50c796=_0x50c796||0xc8;return function(_0x4b41d5){if(_0x4b41d5){return _0x320d4b[_0x09ed('0x1e')](_0x50c796)[_0x09ed('0x1f')](_0x4b41d5);}};}function respondWithFilteredResult(_0x5a2786,_0x5de4da){return function(_0x43d212){if(_0x43d212){var _0x4df999=typeof _0x5de4da[_0x09ed('0x20')]===_0x09ed('0x21')&&typeof _0x5de4da[_0x09ed('0x22')]===_0x09ed('0x21');var _0x262daa=_0x43d212['count'];var _0x257007=_0x4df999?0x0:_0x5de4da['offset'];var _0x2effe0=_0x4df999?_0x43d212['count']:_0x5de4da[_0x09ed('0x20')]+_0x5de4da[_0x09ed('0x22')];var _0x1eec0e;if(_0x2effe0>=_0x262daa){_0x2effe0=_0x262daa;_0x1eec0e=0xc8;}else{_0x1eec0e=0xce;}_0x5a2786['status'](_0x1eec0e);return _0x5a2786[_0x09ed('0x23')](_0x09ed('0x24'),_0x257007+'-'+_0x2effe0+'/'+_0x262daa)[_0x09ed('0x1f')](_0x43d212);}return null;};}function patchUpdates(_0x27e440){return function(_0x477c4c){try{jsonpatch['apply'](_0x477c4c,_0x27e440,!![]);}catch(_0x21d632){return BPromise[_0x09ed('0x25')](_0x21d632);}return _0x477c4c[_0x09ed('0x26')]();};}function saveUpdates(_0x201963,_0x1db8d0){return function(_0x2a1b72){if(_0x2a1b72){return _0x2a1b72['update'](_0x201963)['then'](function(_0x24a05e){return _0x24a05e;});}return null;};}function removeEntity(_0xe9859d,_0x5248bc){return function(_0x8634c3){if(_0x8634c3){return _0x8634c3['destroy']()[_0x09ed('0x27')](function(){var _0x2f10e1=_0x8634c3[_0x09ed('0x28')]({'plain':!![]});var _0x3a4ed3=_0x09ed('0x29');return db[_0x09ed('0x2a')][_0x09ed('0x2b')]({'where':{'type':_0x3a4ed3,'resourceId':_0x2f10e1['id']}})[_0x09ed('0x27')](function(){return _0x8634c3;});})[_0x09ed('0x27')](function(){_0xe9859d[_0x09ed('0x1e')](0xcc)[_0x09ed('0x1d')]();});}};}function handleEntityNotFound(_0x4171df,_0x3bb7ad){return function(_0x24d820){if(!_0x24d820){_0x4171df[_0x09ed('0x2c')](0x194);}return _0x24d820;};}function handleError(_0x485931,_0x2aab77){_0x2aab77=_0x2aab77||0x1f4;return function(_0xfaa0e2){logger[_0x09ed('0x2d')](_0xfaa0e2[_0x09ed('0x2e')]);if(_0xfaa0e2['name']){delete _0xfaa0e2[_0x09ed('0x2f')];}_0x485931[_0x09ed('0x1e')](_0x2aab77)[_0x09ed('0x30')](_0xfaa0e2);};}exports[_0x09ed('0x31')]=function(_0x42bbc9,_0x3c3ae0){var _0x2e6750={},_0x3c73ea={},_0x1ec9b9={'count':0x0,'rows':[]};var _0x31081f=_[_0x09ed('0x32')](db[_0x09ed('0x33')][_0x09ed('0x34')],function(_0x3072f9){return{'name':_0x3072f9['fieldName'],'type':_0x3072f9['type'][_0x09ed('0x35')]};});_0x3c73ea[_0x09ed('0x36')]=_[_0x09ed('0x32')](_0x31081f,'name');_0x3c73ea['query']=_[_0x09ed('0x37')](_0x42bbc9[_0x09ed('0x38')]);_0x3c73ea[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0x3c73ea['model'],_0x3c73ea[_0x09ed('0x38')]);_0x2e6750[_0x09ed('0x3b')]=_[_0x09ed('0x3a')](_0x3c73ea[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x42bbc9['query']['fields']));_0x2e6750[_0x09ed('0x3b')]=_0x2e6750[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x2e6750[_0x09ed('0x3b')]:_0x3c73ea[_0x09ed('0x36')];if(!_0x42bbc9[_0x09ed('0x38')]['hasOwnProperty']('nolimit')){_0x2e6750[_0x09ed('0x22')]=qs[_0x09ed('0x22')](_0x42bbc9['query'][_0x09ed('0x22')]);_0x2e6750[_0x09ed('0x20')]=qs[_0x09ed('0x20')](_0x42bbc9['query'][_0x09ed('0x20')]);}_0x2e6750[_0x09ed('0x3e')]=qs['sort'](_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x3f')]);_0x2e6750[_0x09ed('0x40')]=qs[_0x09ed('0x39')](_[_0x09ed('0x41')](_0x42bbc9['query'],_0x3c73ea[_0x09ed('0x39')]),_0x31081f);if(_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]){_0x2e6750['where']=_[_0x09ed('0x43')](_0x2e6750['where'],{'$or':_[_0x09ed('0x32')](_0x31081f,function(_0x412c0b){if(_0x412c0b[_0x09ed('0x44')]!==_0x09ed('0x45')){var _0x2472bc={};_0x2472bc[_0x412c0b[_0x09ed('0x2f')]]={'$like':'%'+_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]+'%'};return _0x2472bc;}})});}_0x2e6750=_[_0x09ed('0x43')]({},_0x2e6750,_0x42bbc9[_0x09ed('0x46')]);var _0x44e1a7={'where':_0x2e6750[_0x09ed('0x40')]};return db[_0x09ed('0x33')]['count'](_0x44e1a7)[_0x09ed('0x27')](function(_0x3e2800){_0x1ec9b9['count']=_0x3e2800;if(_0x42bbc9['query'][_0x09ed('0x47')]){_0x2e6750['include']=[{'all':!![]}];}return db[_0x09ed('0x33')]['findAll'](_0x2e6750);})[_0x09ed('0x27')](function(_0x202261){_0x1ec9b9[_0x09ed('0x48')]=_0x202261;return _0x1ec9b9;})[_0x09ed('0x27')](respondWithFilteredResult(_0x3c3ae0,_0x2e6750))[_0x09ed('0x49')](handleError(_0x3c3ae0,null));};exports[_0x09ed('0x4a')]=function(_0x3ac483,_0xaf0e60){var _0x57f9dd={'raw':![],'where':{'id':_0x3ac483[_0x09ed('0x4b')]['id']}},_0xcf1fb1={};_0xcf1fb1['model']=_[_0x09ed('0x37')](db[_0x09ed('0x33')][_0x09ed('0x34')]);_0xcf1fb1[_0x09ed('0x38')]=_[_0x09ed('0x37')](_0x3ac483[_0x09ed('0x38')]);_0xcf1fb1[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0xcf1fb1[_0x09ed('0x36')],_0xcf1fb1[_0x09ed('0x38')]);_0x57f9dd['attributes']=_['intersection'](_0xcf1fb1[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x3ac483[_0x09ed('0x38')]['fields']));_0x57f9dd[_0x09ed('0x3b')]=_0x57f9dd[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x57f9dd[_0x09ed('0x3b')]:_0xcf1fb1[_0x09ed('0x36')];if(_0x3ac483[_0x09ed('0x38')][_0x09ed('0x47')]){_0x57f9dd[_0x09ed('0x4c')]=[{'all':!![]}];}_0x57f9dd=_[_0x09ed('0x43')]({},_0x57f9dd,_0x3ac483[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x57f9dd)[_0x09ed('0x27')](handleEntityNotFound(_0xaf0e60,null))[_0x09ed('0x27')](respondWithResult(_0xaf0e60,null))[_0x09ed('0x49')](handleError(_0xaf0e60,null));};exports[_0x09ed('0x4e')]=function(_0x247a91,_0x18fc2f){return db['AnalyticCustomReport'][_0x09ed('0x4e')](_0x247a91[_0x09ed('0x4f')],{})['then'](function(_0x3f158a){var _0x544438=_0x247a91[_0x09ed('0x50')][_0x09ed('0x28')]({'plain':!![]});if(!_0x544438)throw new Error(_0x09ed('0x51'));if(_0x544438[_0x09ed('0x52')]===_0x09ed('0x50')){var _0x3b223e=_0x3f158a[_0x09ed('0x28')]({'plain':!![]});var _0xb59573=_0x09ed('0x53');return db['UserProfileSection'][_0x09ed('0x4d')]({'where':{'name':_0xb59573,'userProfileId':_0x544438['userProfileId']},'raw':!![]})[_0x09ed('0x27')](function(_0x2e5b0d){if(_0x2e5b0d&&_0x2e5b0d[_0x09ed('0x54')]===0x0){return db['UserProfileResource'][_0x09ed('0x4e')]({'name':_0x3b223e[_0x09ed('0x2f')],'resourceId':_0x3b223e['id'],'type':'CustomReports','sectionId':_0x2e5b0d['id']},{})[_0x09ed('0x27')](function(){return _0x3f158a;});}else{return _0x3f158a;}})[_0x09ed('0x49')](function(_0x3f9b71){logger[_0x09ed('0x2d')](_0x09ed('0x55'),_0x3f9b71);throw _0x3f9b71;});}return _0x3f158a;})['then'](respondWithResult(_0x18fc2f,0xc9))[_0x09ed('0x49')](handleError(_0x18fc2f,null));};exports[_0x09ed('0x56')]=function(_0x173f4f,_0x370d7c){if(_0x173f4f[_0x09ed('0x4f')]['id']){delete _0x173f4f[_0x09ed('0x4f')]['id'];}return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x173f4f[_0x09ed('0x4b')]['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x370d7c,null))[_0x09ed('0x27')](saveUpdates(_0x173f4f[_0x09ed('0x4f')],null))[_0x09ed('0x27')](respondWithResult(_0x370d7c,null))[_0x09ed('0x49')](handleError(_0x370d7c,null));};exports[_0x09ed('0x2b')]=function(_0x4d351b,_0x11aa22){return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x4d351b['params']['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x11aa22,null))[_0x09ed('0x27')](removeEntity(_0x11aa22,null))['catch'](handleError(_0x11aa22,null));};exports[_0x09ed('0x57')]=function(_0x518218,_0x1f0bc7){var _0x2ca01a=0xa;var _0x2b4ea9=[_0x09ed('0x58'),'left_join',_0x09ed('0x59'),_0x09ed('0x5a')];var _0x285cd9={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x397963={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':_0x09ed('0x67')};var _0x4882aa=function(_0x3967fa){return!_['includes'](['IS\x20NULL',_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x3967fa);};var _0x544e02=function(_0x3b66a5){if(!_0x3b66a5||!_0x3b66a5[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x2627b7='(',_0x26c03d=0x0;_0x26c03d<_0x3b66a5[_0x09ed('0x6a')]['length'];_0x26c03d+=0x1){_0x26c03d>0x0&&(_0x2627b7+='\x20'+_0x3b66a5['operator']+'\x20');_0x2627b7+=_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6b')]?_0x544e02(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d]['group']):_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6c')]+'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')]+(_0x4882aa(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')])?'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6e')]:'');}return _0x2627b7+')';};var _0x57671f={'where':{'id':_0x518218[_0x09ed('0x4b')]['id']}},_0x4bcb9b,_0x4e3d7a,_0x267ba2,_0x5b0dd5,_0x300d1a;_0x57671f=_[_0x09ed('0x43')]({},_0x57671f,_0x518218[_0x09ed('0x46')]);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x57671f)[_0x09ed('0x27')](function(_0x498d43){if(_0x498d43){_0x4bcb9b=_0x498d43;return _0x498d43[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x4dca1e){if(_0x4dca1e){if(!_0x4dca1e[_0x09ed('0x3d')]){throw new db['Sequelize'][(_0x09ed('0x70'))](_0x09ed('0x71'),0x193);}_0x4e3d7a=_0x4dca1e;return db[_0x09ed('0x72')][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0x492d89){if(_0x492d89){_0x267ba2=_['keyBy'](_0x492d89,'id');var _0x34548a;var _0x47af34=squel[_0x09ed('0x74')]();_0x47af34[_0x09ed('0x75')](_0x4bcb9b[_0x09ed('0x76')]);for(var _0x2267b7=0x0;_0x2267b7<_0x4e3d7a['length'];_0x2267b7+=0x1){_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]?_0x267ba2[_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x4e3d7a[_0x2267b7][_0x09ed('0x6c')];_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x285cd9[_0x4e3d7a[_0x2267b7]['function']],'%s',_0x34548a):_0x34548a;_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]?_['replace'](_0x397963[_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]],'%s',_0x34548a):_0x34548a;if(_0x4e3d7a[_0x2267b7]['groupBy']){_0x47af34[_0x09ed('0x6b')](_0x34548a);}_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]&&_0x47af34[_0x09ed('0x3e')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x47af34[_0x09ed('0x6c')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7e')]||_0x34548a);}if(_0x4bcb9b[_0x09ed('0x7f')]){_0x4bcb9b[_0x09ed('0x7f')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x7f')]);for(var _0x1d2779=0x0;_0x1d2779<_0x4bcb9b[_0x09ed('0x7f')]['length'];_0x1d2779+=0x1){if(_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]&&_[_0x09ed('0x81')](_0x2b4ea9,_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')])&&_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x82')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['foreignKey']){_0x47af34[_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]](_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')],null,util['format'](_0x09ed('0x84'),_0x4bcb9b[_0x09ed('0x76')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['parentKey'],_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x83')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x85')]));}}}if(_0x4bcb9b[_0x09ed('0x86')]){_0x4bcb9b[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x86')]);_0x47af34[_0x09ed('0x40')](_0x544e02(_0x4bcb9b['conditions'][_0x09ed('0x6b')]));}_0x300d1a=_0x47af34[_0x09ed('0x87')]();_0x47af34[_0x09ed('0x22')](_0x2ca01a);_0x47af34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x47af34[_0x09ed('0x88')]());return dbH[_0x09ed('0x89')]['query'](_0x47af34[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});}})[_0x09ed('0x27')](respondWithResult(_0x1f0bc7,null))[_0x09ed('0x49')](handleError(_0x1f0bc7,null));};function runReport(_0x59c345,_0x175f0f,_0x469f5b){var _0x58594a=_0x175f0f[_0x09ed('0x2f')];var _0x259dee=0xa;var _0x26e4ac=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x4f3458={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':'MIN(%s)','AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x27e831={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a1657=function(_0x27683a){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x27683a);};var _0x42508a=function(_0xe1bb43){if(!_0xe1bb43||!_0xe1bb43[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x12b98f='(',_0x283992=0x0;_0x283992<_0xe1bb43['rules'][_0x09ed('0x3d')];_0x283992+=0x1){_0x283992>0x0&&(_0x12b98f+='\x20'+_0xe1bb43[_0x09ed('0x8f')]+'\x20');_0x12b98f+=_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]?_0x42508a(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]):_0xe1bb43[_0x09ed('0x6a')][_0x283992]['field']+'\x20'+_0xe1bb43['rules'][_0x283992][_0x09ed('0x6d')]+(_0x5a1657(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6d')])?'\x20'+_0xe1bb43[_0x09ed('0x6a')][_0x283992]['value']:'');}return _0x12b98f+')';};var _0x387b96={'where':{'id':_0x59c345['id']}},_0x271b83,_0x2bf4ec,_0x4619c5,_0x43f365,_0x421ca2;_0x387b96=_['merge']({},_0x387b96,_0x469f5b);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x387b96)[_0x09ed('0x27')](function(_0x3a3af9){if(_0x3a3af9){_0x271b83=_0x3a3af9;return _0x3a3af9['getFields']();}return null;})[_0x09ed('0x27')](function(_0x34deed){if(_0x34deed){if(!_0x34deed[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))][(_0x09ed('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bf4ec=_0x34deed;return db[_0x09ed('0x72')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x66faa2){if(_0x66faa2){_0x4619c5=_['keyBy'](_0x66faa2,'id');var _0x1cddd9;var _0x282f0a=squel['select']();_0x282f0a[_0x09ed('0x75')](_0x271b83[_0x09ed('0x76')]);for(var _0x4fd105=0x0;_0x4fd105<_0x2bf4ec[_0x09ed('0x3d')];_0x4fd105+=0x1){_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x77')]?_0x4619c5[_0x2bf4ec[_0x4fd105]['MetricId']][_0x09ed('0x78')]:_0x2bf4ec[_0x4fd105][_0x09ed('0x6c')];_0x1cddd9=_0x2bf4ec[_0x4fd105]['function']?_[_0x09ed('0x7a')](_0x4f3458[_0x2bf4ec[_0x4fd105][_0x09ed('0x79')]],'%s',_0x1cddd9):_0x1cddd9;_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x27e831[_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]],'%s',_0x1cddd9):_0x1cddd9;if(_0x2bf4ec[_0x4fd105][_0x09ed('0x91')]){_0x282f0a[_0x09ed('0x6b')](_0x1cddd9);}_0x2bf4ec[_0x4fd105]['orderBy']&&_0x282f0a[_0x09ed('0x3e')](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x282f0a['field'](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7e')]||_0x1cddd9);}if(_0x271b83['joins']){_0x271b83[_0x09ed('0x7f')]=JSON['parse'](_0x271b83[_0x09ed('0x7f')]);for(var _0x192c80=0x0;_0x192c80<_0x271b83[_0x09ed('0x7f')][_0x09ed('0x3d')];_0x192c80+=0x1){if(_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]&&_['includes'](_0x26e4ac,_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')])&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['parentKey']&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['foreignTable']&&_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x85')]){_0x282f0a[_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]](_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x83')],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x271b83[_0x09ed('0x76')],_0x271b83['joins'][_0x192c80][_0x09ed('0x82')],_0x271b83['joins'][_0x192c80][_0x09ed('0x83')],_0x271b83['joins'][_0x192c80][_0x09ed('0x85')]));}}}if(_0x271b83[_0x09ed('0x86')]){_0x271b83[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x271b83[_0x09ed('0x86')]);_0x282f0a[_0x09ed('0x40')](_0x42508a(_0x271b83['conditions'][_0x09ed('0x6b')]));}_0x421ca2=_0x282f0a[_0x09ed('0x87')]();_0x282f0a[_0x09ed('0x22')](_0x259dee);_0x282f0a[_0x09ed('0x20')](0x0);return;}})[_0x09ed('0x27')](function(){if(_0x175f0f['output']===_0x09ed('0x92')){return null;}var _0x252d4b=_['merge'](_0x175f0f,{'name':_0x175f0f['fullPath']||_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],'basename':_0x58594a,'savename':util[_0x09ed('0x7b')](_0x09ed('0x93'),_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],require('randomstring')['generate'](0x4),_0x175f0f[_0x09ed('0x94')]||'csv'),'reportId':_0x271b83['id'],'reportType':_0x09ed('0x95')});return db[_0x09ed('0x96')]['create'](_0x252d4b,{'raw':!![]});})[_0x09ed('0x27')](function(_0x7207){if(_0x271b83[_0x09ed('0x76')]==='cdr'){_0x421ca2['where'](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x97'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}else{_0x421ca2[_0x09ed('0x40')](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x9a'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}if(_0x7207){logger[_0x09ed('0x9b')](_0x09ed('0x9c'),_0x421ca2[_0x09ed('0x88')]());require(_0x09ed('0x9d'))['fork'](path[_0x09ed('0x58')](__dirname,_0x09ed('0x9e'),_0x7207[_0x09ed('0x94')]),[_0x7207['id'],_0x421ca2['toString'](),path['join'](__dirname,_0x09ed('0x9f'),_0x7207[_0x09ed('0xa0')]),_0x58594a]);return _0x7207;}else{var _0x3df215=squel[_0x09ed('0x74')]();_0x3df215[_0x09ed('0x75')]('('+_0x421ca2[_0x09ed('0x88')]()+')','countTable');_0x3df215[_0x09ed('0x6c')](_0x09ed('0xa1'),_0x09ed('0xa2'));_0x421ca2[_0x09ed('0x22')](_0x175f0f['limit']||_0x259dee);_0x421ca2[_0x09ed('0x20')](_0x175f0f['offset']||0x0);return dbH['sequelize'][_0x09ed('0x38')](_0x3df215[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']})['then'](function(_0x48a1af){if(!_0x48a1af[_0x09ed('0x3d')]){_0x43f365=0x0;}else{_0x43f365=_0x48a1af[0x0][_0x09ed('0xa2')]||0x0;}return dbH[_0x09ed('0x89')][_0x09ed('0x38')](_0x421ca2[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});})[_0x09ed('0x27')](function(_0x41e851){return{'rows':_0x41e851||[],'count':_0x43f365};});}});}exports[_0x09ed('0xa3')]=function(_0x2569ae,_0x4a827){return runReport(_0x2569ae[_0x09ed('0x4b')],_0x2569ae[_0x09ed('0x38')],_0x2569ae[_0x09ed('0x46')])[_0x09ed('0x27')](respondWithResult(_0x4a827,null))['catch'](handleError(_0x4a827,null));};exports[_0x09ed('0xa4')]=runReport;exports[_0x09ed('0x38')]=function(_0x459905,_0x5d80b7){var _0x46f2c9=0xa;var _0x569c79=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x214a1f={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x120e88={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x21bdd2=function(_0x1e9e7f){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),'IS\x20EMPTY',_0x09ed('0xa5')],_0x1e9e7f);};var _0x161f36=function(_0x26986d){if(!_0x26986d||!_0x26986d['rules'][_0x09ed('0x3d')]){return'';}for(var _0x390a98='(',_0x5416ad=0x0;_0x5416ad<_0x26986d[_0x09ed('0x6a')]['length'];_0x5416ad+=0x1){_0x5416ad>0x0&&(_0x390a98+='\x20'+_0x26986d[_0x09ed('0x8f')]+'\x20');_0x390a98+=_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6b')]?_0x161f36(_0x26986d['rules'][_0x5416ad][_0x09ed('0x6b')]):_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6c')]+'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad]['condition']+(_0x21bdd2(_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6d')])?'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6e')]:'');}return _0x390a98+')';};var _0x22da97={'where':{'id':_0x459905[_0x09ed('0x4b')]['id']}},_0x8360b2,_0x1f566e,_0x495839,_0x3b3e8b,_0x4f4e85;_0x22da97=_[_0x09ed('0x43')]({},_0x22da97,_0x459905[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x22da97)['then'](function(_0x546af0){if(_0x546af0){_0x8360b2=_0x546af0;return _0x546af0[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x3b7ad2){if(_0x3b7ad2){if(!_0x3b7ad2[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))]['ValidationErrorItem'](_0x09ed('0x71'),0x193);}_0x1f566e=_0x3b7ad2;return db['AnalyticMetric'][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0xff1d4){if(_0xff1d4){_0x495839=_[_0x09ed('0xa6')](_0xff1d4,'id');var _0x2991a1;var _0x543312=squel[_0x09ed('0x74')]();_0x543312['from'](_0x8360b2[_0x09ed('0x76')]);for(var _0x5ad66e=0x0;_0x5ad66e<_0x1f566e['length'];_0x5ad66e+=0x1){_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x77')]?_0x495839[_0x1f566e[_0x5ad66e][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x1f566e[_0x5ad66e][_0x09ed('0x6c')];_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x214a1f[_0x1f566e[_0x5ad66e]['function']],'%s',_0x2991a1):_0x2991a1;_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x120e88[_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]],'%s',_0x2991a1):_0x2991a1;if(_0x1f566e[_0x5ad66e][_0x09ed('0x91')]){_0x543312[_0x09ed('0x6b')](_0x2991a1);}_0x1f566e[_0x5ad66e][_0x09ed('0x7c')]&&_0x543312[_0x09ed('0x3e')](_0x2991a1,_0x1f566e[_0x5ad66e]['orderBy']===_0x09ed('0x7d')?![]:!![]);_0x543312['field'](_0x2991a1,_0x1f566e[_0x5ad66e][_0x09ed('0x7e')]||_0x2991a1);}if(_0x8360b2['joins']){_0x8360b2['joins']=JSON[_0x09ed('0x80')](_0x8360b2[_0x09ed('0x7f')]);for(var _0x345e82=0x0;_0x345e82<_0x8360b2['joins'][_0x09ed('0x3d')];_0x345e82+=0x1){if(_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']&&_[_0x09ed('0x81')](_0x569c79,_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x44')])&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x82')]&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x83')]&&_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]){_0x543312[_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']](_0x8360b2['joins'][_0x345e82]['foreignTable'],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x8360b2[_0x09ed('0x76')],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['parentKey'],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['foreignTable'],_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]));}}}if(_0x8360b2[_0x09ed('0x86')]){_0x8360b2['conditions']=JSON['parse'](_0x8360b2['conditions']);_0x543312['where'](_0x161f36(_0x8360b2['conditions'][_0x09ed('0x6b')]));}_0x4f4e85=_0x543312[_0x09ed('0x87')]();_0x543312[_0x09ed('0x22')](_0x46f2c9);_0x543312[_0x09ed('0x20')](0x0);logger['debug'](_0x09ed('0xa7'),_0x543312[_0x09ed('0x88')]());return dbH['sequelize'][_0x09ed('0x38')](_0x543312[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']});}})[_0x09ed('0x27')](function(){return{'sql':_0x4f4e85[_0x09ed('0x88')]()};})[_0x09ed('0x27')](respondWithResult(_0x5d80b7,null))[_0x09ed('0x49')](handleError(_0x5d80b7,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 4df9740..37fb60e 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 _0x6aab=['rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','path'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x6aab,0x1df));var _0xb6aa=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6aab[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xb6aa('0x0'));var util=require(_0xb6aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb6aa('0x2'));var BPromise=require(_0xb6aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6aa('0x4'));var rimraf=require(_0xb6aa('0x5'));var config=require('../../config/environment');var attributes=require(_0xb6aa('0x6'));module[_0xb6aa('0x7')]=function(_0x4cae8e,_0x311ceb){return _0x4cae8e[_0xb6aa('0x8')](_0xb6aa('0x9'),attributes,{'tableName':_0xb6aa('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6faf=['exports','define','analytics_custom_reports','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6faf,0x1f2));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf6fa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6fa('0x1'));var moment=require(_0xf6fa('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6fa('0x3'));var fs=require('fs');var path=require(_0xf6fa('0x4'));var rimraf=require('rimraf');var config=require(_0xf6fa('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0xf6fa('0x6')]=function(_0x5bb903,_0x556dbd){return _0x5bb903[_0xf6fa('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xf6fa('0x8'),'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 20ed4a7..af60264 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 _0xb624=['util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0xb624,0xdb));var _0x4b62=function(_0x3d9e94,_0x48136c){_0x3d9e94=_0x3d9e94-0x0;var _0x45f76e=_0xb624[_0x3d9e94];return _0x45f76e;};'use strict';var _=require(_0x4b62('0x0'));var util=require(_0x4b62('0x1'));var moment=require(_0x4b62('0x2'));var BPromise=require(_0x4b62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b62('0x4'))['db'];var utils=require(_0x4b62('0x5'));var logger=require('../../config/logger')(_0x4b62('0x6'));var config=require(_0x4b62('0x7'));var jayson=require(_0x4b62('0x8'));var client=jayson[_0x4b62('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x683a8e,_0x2e059e,_0x12731f){return new BPromise(function(_0x4ba4a3,_0x2f85fa){return client[_0x4b62('0xa')](_0x683a8e,_0x12731f)[_0x4b62('0xb')](function(_0x4602da){logger[_0x4b62('0xc')](_0x4b62('0xd'),_0x2e059e,_0x4b62('0xe'));logger[_0x4b62('0xf')](_0x4b62('0x10'),_0x2e059e,_0x4b62('0xe'),JSON[_0x4b62('0x11')](_0x4602da));if(_0x4602da['error']){if(_0x4602da['error'][_0x4b62('0x12')]===0x1f4){logger['error'](_0x4b62('0xd'),_0x2e059e,_0x4602da[_0x4b62('0x13')]['message']);return _0x2f85fa(_0x4602da['error'][_0x4b62('0x14')]);}logger[_0x4b62('0x13')](_0x4b62('0xd'),_0x2e059e,_0x4602da[_0x4b62('0x13')][_0x4b62('0x14')]);return _0x4ba4a3(_0x4602da[_0x4b62('0x13')]['message']);}else{logger[_0x4b62('0xc')](_0x4b62('0xd'),_0x2e059e,_0x4b62('0xe'));_0x4ba4a3(_0x4602da[_0x4b62('0x15')][_0x4b62('0x14')]);}})['catch'](function(_0x25003e){logger[_0x4b62('0x13')](_0x4b62('0xd'),_0x2e059e,_0x25003e);_0x2f85fa(_0x25003e);});});}
\ No newline at end of file
+var _0xc75b=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x10fc0e,_0x3b68d1){var _0x1f47b6=function(_0x20f622){while(--_0x20f622){_0x10fc0e['push'](_0x10fc0e['shift']());}};_0x1f47b6(++_0x3b68d1);}(_0xc75b,0xdf));var _0xbc75=function(_0x23d39d,_0x68a19f){_0x23d39d=_0x23d39d-0x0;var _0x4e0cdf=_0xc75b[_0x23d39d];return _0x4e0cdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc75('0x0'));var BPromise=require(_0xbc75('0x1'));var rs=require(_0xbc75('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc75('0x4'))(_0xbc75('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc75('0x6'));var client=jayson[_0xbc75('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9873,_0x1fe8c4,_0x56372f){return new BPromise(function(_0x297327,_0x34f05b){return client[_0xbc75('0x8')](_0x1a9873,_0x56372f)[_0xbc75('0x9')](function(_0x3b3cdf){logger[_0xbc75('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0xbc75('0xb'));logger[_0xbc75('0xc')](_0xbc75('0xd'),_0x1fe8c4,_0xbc75('0xb'),JSON['stringify'](_0x3b3cdf));if(_0x3b3cdf[_0xbc75('0xe')]){if(_0x3b3cdf['error']['code']===0x1f4){logger[_0xbc75('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x34f05b(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}logger[_0xbc75('0xe')](_0xbc75('0x10'),_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x297327(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}else{logger[_0xbc75('0xa')](_0xbc75('0x10'),_0x1fe8c4,'request\x20sent');_0x297327(_0x3b3cdf[_0xbc75('0x11')][_0xbc75('0xf')]);}})[_0xbc75('0x12')](function(_0x47edd4){logger['error'](_0xbc75('0x10'),_0x1fe8c4,_0x47edd4);_0x34f05b(_0x47edd4);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index af3435c..ad89b7e 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 _0x0b90=['isAuthenticated','get','/:id','show','/:id/preview','/:id/run','/:id/query','query','create','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b90,0x1e6));var _0x00b9=function(_0x9ac6f2,_0x43d9e9){_0x9ac6f2=_0x9ac6f2-0x0;var _0x5bc954=_0x0b90[_0x9ac6f2];return _0x5bc954;};'use strict';var multer=require(_0x00b9('0x0'));var util=require(_0x00b9('0x1'));var path=require(_0x00b9('0x2'));var timeout=require(_0x00b9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x00b9('0x4'));var auth=require(_0x00b9('0x5'));var interaction=require(_0x00b9('0x6'));var config=require(_0x00b9('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x00b9('0x8')](),controller['index']);router[_0x00b9('0x9')](_0x00b9('0xa'),auth['isAuthenticated'](),controller[_0x00b9('0xb')]);router[_0x00b9('0x9')](_0x00b9('0xc'),auth[_0x00b9('0x8')](),controller['preview']);router['get'](_0x00b9('0xd'),auth[_0x00b9('0x8')](),controller['run']);router[_0x00b9('0x9')](_0x00b9('0xe'),auth[_0x00b9('0x8')](),controller[_0x00b9('0xf')]);router['post']('/',auth[_0x00b9('0x8')](),controller[_0x00b9('0x10')]);router['put']('/:id',auth[_0x00b9('0x8')](),controller[_0x00b9('0x11')]);router[_0x00b9('0x12')](_0x00b9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd143=['create','put','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd143,0x138));var _0x3d14=function(_0x2fb049,_0x2a4364){_0x2fb049=_0x2fb049-0x0;var _0x22af82=_0xd143[_0x2fb049];return _0x22af82;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3d14('0x0'));var express=require('express');var router=express[_0x3d14('0x1')]();var fs_extra=require(_0x3d14('0x2'));var auth=require(_0x3d14('0x3'));var interaction=require(_0x3d14('0x4'));var config=require(_0x3d14('0x5'));var controller=require(_0x3d14('0x6'));router[_0x3d14('0x7')]('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x9')]);router[_0x3d14('0x7')](_0x3d14('0xa'),auth['isAuthenticated'](),controller[_0x3d14('0xb')]);router[_0x3d14('0x7')](_0x3d14('0xc'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xd')]);router['get'](_0x3d14('0xe'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xf')]);router['get'](_0x3d14('0x10'),auth['isAuthenticated'](),controller[_0x3d14('0x11')]);router['post']('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x12')]);router[_0x3d14('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3d14('0x14')]('/:id',auth[_0x3d14('0x8')](),controller[_0x3d14('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 392395c..3f38b6c 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x2df968,_0x2392ee){var _0x5d9cb1=function(_0x33c591){while(--_0x33c591){_0x2df968['push'](_0x2df968['shift']());}};_0x5d9cb1(++_0x2392ee);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x284540,_0x207799){_0x284540=_0x284540-0x0;var _0xaabefd=_0x1cb9[_0x284540];return _0xaabefd;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7a5ca7e..8e4c93e 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x4819,0xcd));var _0x9481=function(_0x2cf077,_0x5aa683){_0x2cf077=_0x2cf077-0x0;var _0x430718=_0x4819[_0x2cf077];return _0x430718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2ef3,0xba));var _0x32ef=function(_0x8670b9,_0x168af2){_0x8670b9=_0x8670b9-0x0;var _0x564460=_0x2ef3[_0x8670b9];return _0x564460;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 80b9ca8..0a3b37d 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 _0x6052=['./analyticDefaultReport.attributes','define','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6052,0x1e7));var _0x2605=function(_0x329984,_0x5c235e){_0x329984=_0x329984-0x0;var _0x4be6cf=_0x6052[_0x329984];return _0x4be6cf;};'use strict';var _=require('lodash');var util=require(_0x2605('0x0'));var logger=require(_0x2605('0x1'))(_0x2605('0x2'));var moment=require(_0x2605('0x3'));var BPromise=require(_0x2605('0x4'));var rp=require(_0x2605('0x5'));var fs=require('fs');var path=require(_0x2605('0x6'));var rimraf=require(_0x2605('0x7'));var config=require('../../config/environment');var attributes=require(_0x2605('0x8'));module['exports']=function(_0x3ce05d,_0x5e7dcd){return _0x3ce05d[_0x2605('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x2605('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fe9=['util','../../config/logger','api','request-promise','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x25c38f,_0x1538b4){var _0x2de94e=function(_0x3b836d){while(--_0x3b836d){_0x25c38f['push'](_0x25c38f['shift']());}};_0x2de94e(++_0x1538b4);}(_0x9fe9,0x1c1));var _0x99fe=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x9fe9[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require(_0x99fe('0x0'));var util=require(_0x99fe('0x1'));var logger=require(_0x99fe('0x2'))(_0x99fe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99fe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99fe('0x5'));var config=require('../../config/environment');var attributes=require(_0x99fe('0x6'));module['exports']=function(_0x25f9ed,_0xd96fb9){return _0x25f9ed[_0x99fe('0x7')](_0x99fe('0x8'),attributes,{'tableName':_0x99fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 554065e..f34db5f 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 _0x1651=['stringify','error','message','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1651,0x6e));var _0x1165=function(_0xe6d7a0,_0x1aaa78){_0xe6d7a0=_0xe6d7a0-0x0;var _0x5efef2=_0x1651[_0xe6d7a0];return _0x5efef2;};'use strict';var _=require(_0x1165('0x0'));var util=require(_0x1165('0x1'));var moment=require(_0x1165('0x2'));var BPromise=require('bluebird');var rs=require(_0x1165('0x3'));var fs=require('fs');var Redis=require(_0x1165('0x4'));var db=require(_0x1165('0x5'))['db'];var utils=require(_0x1165('0x6'));var logger=require(_0x1165('0x7'))(_0x1165('0x8'));var config=require('../../config/environment');var jayson=require(_0x1165('0x9'));var client=jayson['client'][_0x1165('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33b7f3,_0xa6bf88,_0x385c1f){return new BPromise(function(_0x52013f,_0x282e20){return client[_0x1165('0xb')](_0x33b7f3,_0x385c1f)[_0x1165('0xc')](function(_0xef780a){logger[_0x1165('0xd')](_0x1165('0xe'),_0xa6bf88,'request\x20sent');logger[_0x1165('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xa6bf88,'request\x20sent',JSON[_0x1165('0x10')](_0xef780a));if(_0xef780a[_0x1165('0x11')]){if(_0xef780a[_0x1165('0x11')]['code']===0x1f4){logger[_0x1165('0x11')](_0x1165('0xe'),_0xa6bf88,_0xef780a[_0x1165('0x11')]['message']);return _0x282e20(_0xef780a[_0x1165('0x11')][_0x1165('0x12')]);}logger['error'](_0x1165('0xe'),_0xa6bf88,_0xef780a['error'][_0x1165('0x12')]);return _0x52013f(_0xef780a['error']['message']);}else{logger[_0x1165('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa6bf88,_0x1165('0x13'));_0x52013f(_0xef780a['result']['message']);}})[_0x1165('0x14')](function(_0x49d790){logger[_0x1165('0x11')](_0x1165('0xe'),_0xa6bf88,_0x49d790);_0x282e20(_0x49d790);});});}
\ No newline at end of file
+var _0x86e0=['rpc','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f5b04,_0x56202c){var _0x2b587c=function(_0x18479c){while(--_0x18479c){_0x2f5b04['push'](_0x2f5b04['shift']());}};_0x2b587c(++_0x56202c);}(_0x86e0,0x1f3));var _0x086e=function(_0x189cef,_0x515130){_0x189cef=_0x189cef-0x0;var _0x332a74=_0x86e0[_0x189cef];return _0x332a74;};'use strict';var _=require(_0x086e('0x0'));var util=require('util');var moment=require(_0x086e('0x1'));var BPromise=require('bluebird');var rs=require(_0x086e('0x2'));var fs=require('fs');var Redis=require(_0x086e('0x3'));var db=require(_0x086e('0x4'))['db'];var utils=require(_0x086e('0x5'));var logger=require(_0x086e('0x6'))(_0x086e('0x7'));var config=require('../../config/environment');var jayson=require(_0x086e('0x8'));var client=jayson['client'][_0x086e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x576c1f,_0x3aa423,_0x2f32cf){return new BPromise(function(_0x454d2d,_0x30b38c){return client[_0x086e('0xa')](_0x576c1f,_0x2f32cf)[_0x086e('0xb')](function(_0xefffdb){logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));logger[_0x086e('0xf')](_0x086e('0x10'),_0x3aa423,_0x086e('0xe'),JSON[_0x086e('0x11')](_0xefffdb));if(_0xefffdb[_0x086e('0x12')]){if(_0xefffdb['error'][_0x086e('0x13')]===0x1f4){logger[_0x086e('0x12')](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x30b38c(_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);}logger['error'](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x454d2d(_0xefffdb[_0x086e('0x12')]['message']);}else{logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));_0x454d2d(_0xefffdb[_0x086e('0x15')][_0x086e('0x14')]);}})[_0x086e('0x16')](function(_0x241758){logger[_0x086e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3aa423,_0x241758);_0x30b38c(_0x241758);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8dde066..e3c7318 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 _0xeb5d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','post','create','update','delete','multer','util'];(function(_0x58208b,_0x2a944e){var _0x5960b0=function(_0x37a623){while(--_0x37a623){_0x58208b['push'](_0x58208b['shift']());}};_0x5960b0(++_0x2a944e);}(_0xeb5d,0x174));var _0xdeb5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xeb5d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xdeb5('0x0'));var util=require(_0xdeb5('0x1'));var path=require(_0xdeb5('0x2'));var timeout=require(_0xdeb5('0x3'));var express=require(_0xdeb5('0x4'));var router=express['Router']();var fs_extra=require(_0xdeb5('0x5'));var auth=require(_0xdeb5('0x6'));var interaction=require(_0xdeb5('0x7'));var config=require(_0xdeb5('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xdeb5('0x9')]('/',auth['isAuthenticated'](),controller[_0xdeb5('0xa')]);router[_0xdeb5('0x9')](_0xdeb5('0xb'),auth[_0xdeb5('0xc')](),controller['show']);router['get'](_0xdeb5('0xd'),auth[_0xdeb5('0xc')](),controller['preview']);router[_0xdeb5('0x9')](_0xdeb5('0xe'),auth[_0xdeb5('0xc')](),controller[_0xdeb5('0xf')]);router[_0xdeb5('0x9')](_0xdeb5('0x10'),auth[_0xdeb5('0xc')](),controller[_0xdeb5('0x11')]);router[_0xdeb5('0x12')]('/',auth['isAuthenticated'](),controller[_0xdeb5('0x13')]);router['put'](_0xdeb5('0xb'),auth['isAuthenticated'](),controller[_0xdeb5('0x14')]);router[_0xdeb5('0x15')]('/:id',auth[_0xdeb5('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc6a2=['get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xc6a2,0x69));var _0x2c6a=function(_0x4c7ce9,_0x3428df){_0x4c7ce9=_0x4c7ce9-0x0;var _0x37eee2=_0xc6a2[_0x4c7ce9];return _0x37eee2;};'use strict';var multer=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var path=require('path');var timeout=require(_0x2c6a('0x2'));var express=require(_0x2c6a('0x3'));var router=express[_0x2c6a('0x4')]();var fs_extra=require(_0x2c6a('0x5'));var auth=require(_0x2c6a('0x6'));var interaction=require(_0x2c6a('0x7'));var config=require(_0x2c6a('0x8'));var controller=require(_0x2c6a('0x9'));router[_0x2c6a('0xa')]('/',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xc')]);router[_0x2c6a('0xa')](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller['show']);router[_0x2c6a('0xa')](_0x2c6a('0xe'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xf')]);router[_0x2c6a('0xa')](_0x2c6a('0x10'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x11')]);router['get']('/:id/query',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x12')]);router[_0x2c6a('0x13')]('/',auth[_0x2c6a('0xb')](),controller['create']);router['put'](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c6a('0x15')]);module[_0x2c6a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index a721159..0211e30 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 _0xfba7=['sequelize','moment','exports','STRING','ENUM','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x13388e,_0x484c73){var _0x16cdbb=function(_0x39ab16){while(--_0x39ab16){_0x13388e['push'](_0x13388e['shift']());}};_0x16cdbb(++_0x484c73);}(_0xfba7,0x108));var _0x7fba=function(_0x2439d5,_0x51d2f6){_0x2439d5=_0x2439d5-0x0;var _0x56d082=_0xfba7[_0x2439d5];return _0x56d082;};'use strict';var Sequelize=require(_0x7fba('0x0'));var moment=require(_0x7fba('0x1'));module[_0x7fba('0x2')]={'name':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7fba('0x4')]('csv','pdf',_0x7fba('0x5')),'allowNull':![],'defaultValue':_0x7fba('0x6')},'savename':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7fba('0x7')]},'status':{'type':Sequelize[_0x7fba('0x3')],'defaultValue':_0x7fba('0x8')},'type':{'type':Sequelize[_0x7fba('0x4')](_0x7fba('0x9'),_0x7fba('0xa')),'allowNull':![],'defaultValue':_0x7fba('0x9')},'reportId':{'type':Sequelize[_0x7fba('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x7fba('0x3')]}};
\ No newline at end of file
+var _0x1b4d=['moment','exports','STRING','csv','pdf','DATE','Loading','ENUM','scheduled','manual','UNSIGNED'];(function(_0x2841d8,_0x32296e){var _0x4e2df3=function(_0x31003e){while(--_0x31003e){_0x2841d8['push'](_0x2841d8['shift']());}};_0x4e2df3(++_0x32296e);}(_0x1b4d,0x1ef));var _0xd1b4=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x1b4d[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1b4('0x0'));module[_0xd1b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd1b4('0x3'),_0xd1b4('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd1b4('0x5')]},'endDate':{'type':Sequelize[_0xd1b4('0x5')]},'status':{'type':Sequelize[_0xd1b4('0x2')],'defaultValue':_0xd1b4('0x6')},'type':{'type':Sequelize[_0xd1b4('0x7')]('manual',_0xd1b4('0x8')),'allowNull':![],'defaultValue':_0xd1b4('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xd1b4('0xa')]},'reportType':{'type':Sequelize[_0xd1b4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 3fc143f..2ce4d5f 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 _0x4f11=['update','body','download','basename','savename','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','AnalyticExtractedReport','rows','catch','show','params','intersection','fields','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4f11,0x1d7));var _0x14f1=function(_0x16d673,_0x115d95){_0x16d673=_0x16d673-0x0;var _0x1b3984=_0x4f11[_0x16d673];return _0x1b3984;};'use strict';var emlformat=require(_0x14f1('0x0'));var rimraf=require(_0x14f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14f1('0x2'));var rp=require(_0x14f1('0x3'));var moment=require('moment');var BPromise=require(_0x14f1('0x4'));var Mustache=require(_0x14f1('0x5'));var util=require(_0x14f1('0x6'));var path=require(_0x14f1('0x7'));var sox=require(_0x14f1('0x8'));var csv=require(_0x14f1('0x9'));var ejs=require(_0x14f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14f1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x14f1('0xc'));var deskjs=require(_0x14f1('0xd'));var toCsv=require(_0x14f1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x14f1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14f1('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x14f1('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388fef,_0x115613){_0x115613=_0x115613||0xcc;return function(_0x295fb3){if(_0x295fb3){return _0x388fef[_0x14f1('0x11')](_0x115613);}return _0x388fef[_0x14f1('0x12')](_0x115613)[_0x14f1('0x13')]();};}function respondWithResult(_0x47a5cb,_0x3aea06){_0x3aea06=_0x3aea06||0xc8;return function(_0x32b362){if(_0x32b362){return _0x47a5cb['status'](_0x3aea06)[_0x14f1('0x14')](_0x32b362);}};}function respondWithFilteredResult(_0x35a099,_0x2d7a30){return function(_0x59791f){if(_0x59791f){var _0x11cc8d=typeof _0x2d7a30[_0x14f1('0x15')]==='undefined'&&typeof _0x2d7a30[_0x14f1('0x16')]==='undefined';var _0x2d6d32=_0x59791f['count'];var _0x99f828=_0x11cc8d?0x0:_0x2d7a30['offset'];var _0x519b5c=_0x11cc8d?_0x59791f[_0x14f1('0x17')]:_0x2d7a30[_0x14f1('0x15')]+_0x2d7a30[_0x14f1('0x16')];var _0x30ccf6;if(_0x519b5c>=_0x2d6d32){_0x519b5c=_0x2d6d32;_0x30ccf6=0xc8;}else{_0x30ccf6=0xce;}_0x35a099[_0x14f1('0x12')](_0x30ccf6);return _0x35a099[_0x14f1('0x18')](_0x14f1('0x19'),_0x99f828+'-'+_0x519b5c+'/'+_0x2d6d32)[_0x14f1('0x14')](_0x59791f);}return null;};}function patchUpdates(_0x586728){return function(_0x540379){try{jsonpatch[_0x14f1('0x1a')](_0x540379,_0x586728,!![]);}catch(_0x14d82a){return BPromise[_0x14f1('0x1b')](_0x14d82a);}return _0x540379[_0x14f1('0x1c')]();};}function saveUpdates(_0x555bca,_0x19dc34){return function(_0xf436e0){if(_0xf436e0){return _0xf436e0['update'](_0x555bca)[_0x14f1('0x1d')](function(_0xe45771){return _0xe45771;});}return null;};}function removeEntity(_0x3691f6,_0x35cae2){return function(_0x3b4b37){if(_0x3b4b37){return _0x3b4b37[_0x14f1('0x1e')]()[_0x14f1('0x1d')](function(){var _0x5a5c06=_0x3b4b37[_0x14f1('0x1f')]({'plain':!![]});var _0x45cbdf=_0x14f1('0x20');return db[_0x14f1('0x21')][_0x14f1('0x1e')]({'where':{'type':_0x45cbdf,'resourceId':_0x5a5c06['id']}})[_0x14f1('0x1d')](function(){return _0x3b4b37;});})[_0x14f1('0x1d')](function(){_0x3691f6[_0x14f1('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0e3b,_0x205b36){return function(_0x39083c){if(!_0x39083c){_0x5d0e3b[_0x14f1('0x11')](0x194);}return _0x39083c;};}function handleError(_0x410987,_0x56f0fe){_0x56f0fe=_0x56f0fe||0x1f4;return function(_0x473fbe){logger[_0x14f1('0x22')](_0x473fbe[_0x14f1('0x23')]);if(_0x473fbe['name']){delete _0x473fbe[_0x14f1('0x24')];}_0x410987[_0x14f1('0x12')](_0x56f0fe)['send'](_0x473fbe);};}exports[_0x14f1('0x25')]=function(_0x4612b6,_0x58d69f){var _0x22a2d7={},_0x3f0ad8={},_0x1995b7={'count':0x0,'rows':[]};var _0x363c0d=_['map'](db['AnalyticExtractedReport'][_0x14f1('0x26')],function(_0x3ee402){return{'name':_0x3ee402[_0x14f1('0x27')],'type':_0x3ee402['type'][_0x14f1('0x28')]};});_0x3f0ad8[_0x14f1('0x29')]=_['map'](_0x363c0d,_0x14f1('0x24'));_0x3f0ad8['query']=_[_0x14f1('0x2a')](_0x4612b6[_0x14f1('0x2b')]);_0x3f0ad8[_0x14f1('0x2c')]=_['intersection'](_0x3f0ad8[_0x14f1('0x29')],_0x3f0ad8[_0x14f1('0x2b')]);_0x22a2d7[_0x14f1('0x2d')]=_['intersection'](_0x3f0ad8[_0x14f1('0x29')],qs['fields'](_0x4612b6[_0x14f1('0x2b')]['fields']));_0x22a2d7[_0x14f1('0x2d')]=_0x22a2d7[_0x14f1('0x2d')]['length']?_0x22a2d7[_0x14f1('0x2d')]:_0x3f0ad8[_0x14f1('0x29')];if(!_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x2e')](_0x14f1('0x2f'))){_0x22a2d7[_0x14f1('0x16')]=qs['limit'](_0x4612b6[_0x14f1('0x2b')]['limit']);_0x22a2d7[_0x14f1('0x15')]=qs['offset'](_0x4612b6['query'][_0x14f1('0x15')]);}_0x22a2d7[_0x14f1('0x30')]=qs[_0x14f1('0x31')](_0x4612b6['query'][_0x14f1('0x31')]);_0x22a2d7[_0x14f1('0x32')]=qs[_0x14f1('0x2c')](_[_0x14f1('0x33')](_0x4612b6['query'],_0x3f0ad8[_0x14f1('0x2c')]),_0x363c0d);if(_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x34')]){_0x22a2d7[_0x14f1('0x32')]=_['merge'](_0x22a2d7[_0x14f1('0x32')],{'$or':_['map'](_0x363c0d,function(_0x21086b){if(_0x21086b[_0x14f1('0x35')]!==_0x14f1('0x36')){var _0x3a4df3={};_0x3a4df3[_0x21086b['name']]={'$like':'%'+_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x34')]+'%'};return _0x3a4df3;}})});}_0x22a2d7=_['merge']({},_0x22a2d7,_0x4612b6[_0x14f1('0x37')]);var _0x3258f6={'where':_0x22a2d7[_0x14f1('0x32')]};return db['AnalyticExtractedReport'][_0x14f1('0x17')](_0x3258f6)[_0x14f1('0x1d')](function(_0x251019){_0x1995b7[_0x14f1('0x17')]=_0x251019;if(_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x38')]){_0x22a2d7[_0x14f1('0x39')]=[{'all':!![]}];}return db[_0x14f1('0x3a')]['findAll'](_0x22a2d7);})[_0x14f1('0x1d')](function(_0x3242a7){_0x1995b7[_0x14f1('0x3b')]=_0x3242a7;return _0x1995b7;})['then'](respondWithFilteredResult(_0x58d69f,_0x22a2d7))[_0x14f1('0x3c')](handleError(_0x58d69f,null));};exports[_0x14f1('0x3d')]=function(_0x2e8768,_0x31ebbd){var _0x4eaf7b={'raw':!![],'where':{'id':_0x2e8768[_0x14f1('0x3e')]['id']}},_0x5571e7={};_0x5571e7[_0x14f1('0x29')]=_[_0x14f1('0x2a')](db['AnalyticExtractedReport'][_0x14f1('0x26')]);_0x5571e7[_0x14f1('0x2b')]=_[_0x14f1('0x2a')](_0x2e8768['query']);_0x5571e7[_0x14f1('0x2c')]=_[_0x14f1('0x3f')](_0x5571e7[_0x14f1('0x29')],_0x5571e7[_0x14f1('0x2b')]);_0x4eaf7b[_0x14f1('0x2d')]=_['intersection'](_0x5571e7[_0x14f1('0x29')],qs[_0x14f1('0x40')](_0x2e8768[_0x14f1('0x2b')]['fields']));_0x4eaf7b['attributes']=_0x4eaf7b[_0x14f1('0x2d')]['length']?_0x4eaf7b[_0x14f1('0x2d')]:_0x5571e7['model'];if(_0x2e8768['query'][_0x14f1('0x38')]){_0x4eaf7b[_0x14f1('0x39')]=[{'all':!![]}];}_0x4eaf7b=_[_0x14f1('0x41')]({},_0x4eaf7b,_0x2e8768[_0x14f1('0x37')]);return db[_0x14f1('0x3a')][_0x14f1('0x42')](_0x4eaf7b)[_0x14f1('0x1d')](handleEntityNotFound(_0x31ebbd,null))[_0x14f1('0x1d')](respondWithResult(_0x31ebbd,null))[_0x14f1('0x3c')](handleError(_0x31ebbd,null));};exports[_0x14f1('0x43')]=function(_0x2c4fec,_0x16ec2e){return db[_0x14f1('0x3a')][_0x14f1('0x43')](_0x2c4fec['body'],{})[_0x14f1('0x1d')](function(_0x3e04f8){var _0x2e1fe7=_0x2c4fec[_0x14f1('0x44')][_0x14f1('0x1f')]({'plain':!![]});if(!_0x2e1fe7)throw new Error(_0x14f1('0x45'));if(_0x2e1fe7[_0x14f1('0x46')]===_0x14f1('0x44')){var _0x5ed798=_0x3e04f8[_0x14f1('0x1f')]({'plain':!![]});var _0x41858e='ExtractedReports';return db[_0x14f1('0x47')][_0x14f1('0x42')]({'where':{'name':_0x41858e,'userProfileId':_0x2e1fe7[_0x14f1('0x48')]},'raw':!![]})['then'](function(_0x382752){if(_0x382752&&_0x382752[_0x14f1('0x49')]===0x0){return db[_0x14f1('0x21')][_0x14f1('0x43')]({'name':_0x5ed798[_0x14f1('0x24')],'resourceId':_0x5ed798['id'],'type':_0x382752['name'],'sectionId':_0x382752['id']},{})['then'](function(){return _0x3e04f8;});}else{return _0x3e04f8;}})[_0x14f1('0x3c')](function(_0x4df40c){logger[_0x14f1('0x22')](_0x14f1('0x4a'),_0x4df40c);throw _0x4df40c;});}return _0x3e04f8;})[_0x14f1('0x1d')](respondWithResult(_0x16ec2e,0xc9))[_0x14f1('0x3c')](handleError(_0x16ec2e,null));};exports[_0x14f1('0x4b')]=function(_0x24e8a7,_0x522d53){if(_0x24e8a7[_0x14f1('0x4c')]['id']){delete _0x24e8a7[_0x14f1('0x4c')]['id'];}return db[_0x14f1('0x3a')][_0x14f1('0x42')]({'where':{'id':_0x24e8a7[_0x14f1('0x3e')]['id']}})[_0x14f1('0x1d')](handleEntityNotFound(_0x522d53,null))[_0x14f1('0x1d')](saveUpdates(_0x24e8a7[_0x14f1('0x4c')],null))[_0x14f1('0x1d')](respondWithResult(_0x522d53,null))[_0x14f1('0x3c')](handleError(_0x522d53,null));};exports[_0x14f1('0x1e')]=function(_0x4ddf25,_0x1186dc){return db[_0x14f1('0x3a')][_0x14f1('0x42')]({'where':{'id':_0x4ddf25[_0x14f1('0x3e')]['id']}})[_0x14f1('0x1d')](handleEntityNotFound(_0x1186dc,null))[_0x14f1('0x1d')](removeEntity(_0x1186dc,null))[_0x14f1('0x3c')](handleError(_0x1186dc,null));};exports[_0x14f1('0x4d')]=function(_0x516b4e,_0x1f7807,_0x3fc09c){return db['AnalyticExtractedReport'][_0x14f1('0x42')]({'where':{'id':_0x516b4e[_0x14f1('0x3e')]['id']},'attributes':[_0x14f1('0x24'),_0x14f1('0x4e'),_0x14f1('0x4f'),'output'],'raw':!![]})[_0x14f1('0x1d')](handleEntityNotFound(_0x1f7807,null))[_0x14f1('0x1d')](function(_0x4f9cd1){if(_0x4f9cd1){if(!fs[_0x14f1('0x50')](path[_0x14f1('0x51')](config['root'],_0x14f1('0x52'),_0x4f9cd1['savename']))){throw new db['Sequelize'][(_0x14f1('0x53'))](_0x14f1('0x54'));}if(_0x516b4e[_0x14f1('0x2b')][_0x14f1('0x55')]){return _0x1f7807[_0x14f1('0x11')](0xc8);}return _0x1f7807[_0x14f1('0x4d')](path[_0x14f1('0x51')](config[_0x14f1('0x56')],_0x14f1('0x52'),_0x4f9cd1['savename']),util[_0x14f1('0x57')](_0x14f1('0x58'),_0x4f9cd1[_0x14f1('0x4e')]||_0x4f9cd1['name'],_0x4f9cd1[_0x14f1('0x59')][_0x14f1('0x5a')]()));}})['catch'](handleError(_0x1f7807,null));};
\ No newline at end of file
+var _0x016a=['keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','output','existsSync','join','root','server/files/reports','Sequelize','exists','download','savename','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query'];(function(_0x2f599f,_0x111228){var _0x42efc6=function(_0x573b99){while(--_0x573b99){_0x2f599f['push'](_0x2f599f['shift']());}};_0x42efc6(++_0x111228);}(_0x016a,0xee));var _0xa016=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x016a[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0xa016('0x0'));var rimraf=require(_0xa016('0x1'));var zipdir=require(_0xa016('0x2'));var jsonpatch=require(_0xa016('0x3'));var rp=require(_0xa016('0x4'));var moment=require(_0xa016('0x5'));var BPromise=require(_0xa016('0x6'));var Mustache=require(_0xa016('0x7'));var util=require(_0xa016('0x8'));var path=require(_0xa016('0x9'));var sox=require(_0xa016('0xa'));var csv=require(_0xa016('0xb'));var ejs=require(_0xa016('0xc'));var fs=require('fs');var fs_extra=require(_0xa016('0xd'));var _=require(_0xa016('0xe'));var squel=require(_0xa016('0xf'));var crypto=require(_0xa016('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xa016('0x11'));var toCsv=require(_0xa016('0xb'));var querystring=require(_0xa016('0x12'));var Papa=require(_0xa016('0x13'));var Redis=require(_0xa016('0x14'));var authService=require(_0xa016('0x15'));var qs=require(_0xa016('0x16'));var as=require(_0xa016('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa016('0x18'))(_0xa016('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa016('0x1a'));var db=require(_0xa016('0x1b'))['db'];function respondWithStatusCode(_0x53512f,_0x1ce96c){_0x1ce96c=_0x1ce96c||0xcc;return function(_0x56836d){if(_0x56836d){return _0x53512f[_0xa016('0x1c')](_0x1ce96c);}return _0x53512f[_0xa016('0x1d')](_0x1ce96c)[_0xa016('0x1e')]();};}function respondWithResult(_0x232cd4,_0x3567b4){_0x3567b4=_0x3567b4||0xc8;return function(_0x5b0d11){if(_0x5b0d11){return _0x232cd4['status'](_0x3567b4)[_0xa016('0x1f')](_0x5b0d11);}};}function respondWithFilteredResult(_0x18361e,_0x5ceb21){return function(_0x4c6187){if(_0x4c6187){var _0x450f4d=typeof _0x5ceb21['offset']===_0xa016('0x20')&&typeof _0x5ceb21[_0xa016('0x21')]===_0xa016('0x20');var _0x40a7d2=_0x4c6187['count'];var _0x303b9a=_0x450f4d?0x0:_0x5ceb21[_0xa016('0x22')];var _0x3c8bd7=_0x450f4d?_0x4c6187['count']:_0x5ceb21[_0xa016('0x22')]+_0x5ceb21[_0xa016('0x21')];var _0x2ad233;if(_0x3c8bd7>=_0x40a7d2){_0x3c8bd7=_0x40a7d2;_0x2ad233=0xc8;}else{_0x2ad233=0xce;}_0x18361e[_0xa016('0x1d')](_0x2ad233);return _0x18361e[_0xa016('0x23')](_0xa016('0x24'),_0x303b9a+'-'+_0x3c8bd7+'/'+_0x40a7d2)[_0xa016('0x1f')](_0x4c6187);}return null;};}function patchUpdates(_0x1c1286){return function(_0x577a85){try{jsonpatch['apply'](_0x577a85,_0x1c1286,!![]);}catch(_0x5381ef){return BPromise[_0xa016('0x25')](_0x5381ef);}return _0x577a85['save']();};}function saveUpdates(_0x5a1093,_0x427652){return function(_0x3002bb){if(_0x3002bb){return _0x3002bb[_0xa016('0x26')](_0x5a1093)[_0xa016('0x27')](function(_0x1d610b){return _0x1d610b;});}return null;};}function removeEntity(_0x2da0d8,_0xcebaea){return function(_0x2a2971){if(_0x2a2971){return _0x2a2971['destroy']()['then'](function(){var _0xf1309=_0x2a2971[_0xa016('0x28')]({'plain':!![]});var _0x444bdf=_0xa016('0x29');return db[_0xa016('0x2a')]['destroy']({'where':{'type':_0x444bdf,'resourceId':_0xf1309['id']}})[_0xa016('0x27')](function(){return _0x2a2971;});})[_0xa016('0x27')](function(){_0x2da0d8[_0xa016('0x1d')](0xcc)[_0xa016('0x1e')]();});}};}function handleEntityNotFound(_0x15d297,_0x2da888){return function(_0x185732){if(!_0x185732){_0x15d297[_0xa016('0x1c')](0x194);}return _0x185732;};}function handleError(_0xe9bd65,_0x3e2db7){_0x3e2db7=_0x3e2db7||0x1f4;return function(_0x6597a8){logger[_0xa016('0x2b')](_0x6597a8['stack']);if(_0x6597a8[_0xa016('0x2c')]){delete _0x6597a8[_0xa016('0x2c')];}_0xe9bd65[_0xa016('0x1d')](_0x3e2db7)[_0xa016('0x2d')](_0x6597a8);};}exports['index']=function(_0x406da2,_0x7794fe){var _0x2e5b94={},_0xfcf6ad={},_0x16000a={'count':0x0,'rows':[]};var _0x498483=_[_0xa016('0x2e')](db[_0xa016('0x2f')][_0xa016('0x30')],function(_0x2c9e24){return{'name':_0x2c9e24[_0xa016('0x31')],'type':_0x2c9e24[_0xa016('0x32')][_0xa016('0x33')]};});_0xfcf6ad['model']=_[_0xa016('0x2e')](_0x498483,_0xa016('0x2c'));_0xfcf6ad[_0xa016('0x34')]=_[_0xa016('0x35')](_0x406da2[_0xa016('0x34')]);_0xfcf6ad['filters']=_['intersection'](_0xfcf6ad[_0xa016('0x36')],_0xfcf6ad[_0xa016('0x34')]);_0x2e5b94[_0xa016('0x37')]=_[_0xa016('0x38')](_0xfcf6ad['model'],qs[_0xa016('0x39')](_0x406da2['query'][_0xa016('0x39')]));_0x2e5b94[_0xa016('0x37')]=_0x2e5b94[_0xa016('0x37')]['length']?_0x2e5b94[_0xa016('0x37')]:_0xfcf6ad[_0xa016('0x36')];if(!_0x406da2[_0xa016('0x34')][_0xa016('0x3a')](_0xa016('0x3b'))){_0x2e5b94[_0xa016('0x21')]=qs[_0xa016('0x21')](_0x406da2[_0xa016('0x34')][_0xa016('0x21')]);_0x2e5b94['offset']=qs[_0xa016('0x22')](_0x406da2[_0xa016('0x34')][_0xa016('0x22')]);}_0x2e5b94['order']=qs['sort'](_0x406da2[_0xa016('0x34')]['sort']);_0x2e5b94[_0xa016('0x3c')]=qs[_0xa016('0x3d')](_[_0xa016('0x3e')](_0x406da2[_0xa016('0x34')],_0xfcf6ad[_0xa016('0x3d')]),_0x498483);if(_0x406da2[_0xa016('0x34')][_0xa016('0x3f')]){_0x2e5b94[_0xa016('0x3c')]=_[_0xa016('0x40')](_0x2e5b94['where'],{'$or':_[_0xa016('0x2e')](_0x498483,function(_0x2981d3){if(_0x2981d3[_0xa016('0x32')]!==_0xa016('0x41')){var _0x4d4ceb={};_0x4d4ceb[_0x2981d3['name']]={'$like':'%'+_0x406da2[_0xa016('0x34')]['filter']+'%'};return _0x4d4ceb;}})});}_0x2e5b94=_[_0xa016('0x40')]({},_0x2e5b94,_0x406da2[_0xa016('0x42')]);var _0x28f6dd={'where':_0x2e5b94[_0xa016('0x3c')]};return db[_0xa016('0x2f')]['count'](_0x28f6dd)['then'](function(_0x16cf10){_0x16000a[_0xa016('0x43')]=_0x16cf10;if(_0x406da2[_0xa016('0x34')][_0xa016('0x44')]){_0x2e5b94['include']=[{'all':!![]}];}return db[_0xa016('0x2f')]['findAll'](_0x2e5b94);})[_0xa016('0x27')](function(_0x11d64c){_0x16000a[_0xa016('0x45')]=_0x11d64c;return _0x16000a;})[_0xa016('0x27')](respondWithFilteredResult(_0x7794fe,_0x2e5b94))['catch'](handleError(_0x7794fe,null));};exports[_0xa016('0x46')]=function(_0x1d6fff,_0x5c3420){var _0x387277={'raw':!![],'where':{'id':_0x1d6fff[_0xa016('0x47')]['id']}},_0x256d68={};_0x256d68['model']=_['keys'](db[_0xa016('0x2f')][_0xa016('0x30')]);_0x256d68['query']=_[_0xa016('0x35')](_0x1d6fff['query']);_0x256d68['filters']=_[_0xa016('0x38')](_0x256d68['model'],_0x256d68[_0xa016('0x34')]);_0x387277[_0xa016('0x37')]=_[_0xa016('0x38')](_0x256d68[_0xa016('0x36')],qs[_0xa016('0x39')](_0x1d6fff[_0xa016('0x34')][_0xa016('0x39')]));_0x387277[_0xa016('0x37')]=_0x387277['attributes'][_0xa016('0x48')]?_0x387277[_0xa016('0x37')]:_0x256d68[_0xa016('0x36')];if(_0x1d6fff[_0xa016('0x34')][_0xa016('0x44')]){_0x387277[_0xa016('0x49')]=[{'all':!![]}];}_0x387277=_[_0xa016('0x40')]({},_0x387277,_0x1d6fff['options']);return db['AnalyticExtractedReport'][_0xa016('0x4a')](_0x387277)['then'](handleEntityNotFound(_0x5c3420,null))[_0xa016('0x27')](respondWithResult(_0x5c3420,null))[_0xa016('0x4b')](handleError(_0x5c3420,null));};exports[_0xa016('0x4c')]=function(_0x25e9fe,_0x18874d){return db[_0xa016('0x2f')]['create'](_0x25e9fe['body'],{})['then'](function(_0xfca099){var _0x157c30=_0x25e9fe[_0xa016('0x4d')]['get']({'plain':!![]});if(!_0x157c30)throw new Error(_0xa016('0x4e'));if(_0x157c30[_0xa016('0x4f')]===_0xa016('0x4d')){var _0x41b612=_0xfca099[_0xa016('0x28')]({'plain':!![]});var _0x247072=_0xa016('0x29');return db[_0xa016('0x50')][_0xa016('0x4a')]({'where':{'name':_0x247072,'userProfileId':_0x157c30[_0xa016('0x51')]},'raw':!![]})[_0xa016('0x27')](function(_0x5b12ba){if(_0x5b12ba&&_0x5b12ba[_0xa016('0x52')]===0x0){return db[_0xa016('0x2a')]['create']({'name':_0x41b612[_0xa016('0x2c')],'resourceId':_0x41b612['id'],'type':_0x5b12ba[_0xa016('0x2c')],'sectionId':_0x5b12ba['id']},{})['then'](function(){return _0xfca099;});}else{return _0xfca099;}})[_0xa016('0x4b')](function(_0x3fd966){logger[_0xa016('0x2b')](_0xa016('0x53'),_0x3fd966);throw _0x3fd966;});}return _0xfca099;})[_0xa016('0x27')](respondWithResult(_0x18874d,0xc9))[_0xa016('0x4b')](handleError(_0x18874d,null));};exports[_0xa016('0x26')]=function(_0xaf174f,_0x16ab90){if(_0xaf174f[_0xa016('0x54')]['id']){delete _0xaf174f[_0xa016('0x54')]['id'];}return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xaf174f['params']['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x16ab90,null))[_0xa016('0x27')](saveUpdates(_0xaf174f[_0xa016('0x54')],null))[_0xa016('0x27')](respondWithResult(_0x16ab90,null))[_0xa016('0x4b')](handleError(_0x16ab90,null));};exports['destroy']=function(_0xb0215a,_0x5bf83e){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xb0215a[_0xa016('0x47')]['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x5bf83e,null))[_0xa016('0x27')](removeEntity(_0x5bf83e,null))[_0xa016('0x4b')](handleError(_0x5bf83e,null));};exports['download']=function(_0x15ffdf,_0x7826f8,_0x375a68){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0x15ffdf[_0xa016('0x47')]['id']},'attributes':[_0xa016('0x2c'),_0xa016('0x55'),'savename',_0xa016('0x56')],'raw':!![]})[_0xa016('0x27')](handleEntityNotFound(_0x7826f8,null))[_0xa016('0x27')](function(_0x12ccf1){if(_0x12ccf1){if(!fs[_0xa016('0x57')](path[_0xa016('0x58')](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1['savename']))){throw new db[(_0xa016('0x5b'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x15ffdf['query'][_0xa016('0x5c')]){return _0x7826f8[_0xa016('0x1c')](0xc8);}return _0x7826f8[_0xa016('0x5d')](path['join'](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1[_0xa016('0x5e')]),util[_0xa016('0x5f')]('%s.%s',_0x12ccf1['basename']||_0x12ccf1['name'],_0x12ccf1[_0xa016('0x56')][_0xa016('0x60')]()));}})[_0xa016('0x4b')](handleError(_0x7826f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 748731d..db045b0 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 _0x5be0=['path','rimraf','../../config/environment','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise'];(function(_0x34d823,_0x2d20b0){var _0x1eb90c=function(_0x43eda6){while(--_0x43eda6){_0x34d823['push'](_0x34d823['shift']());}};_0x1eb90c(++_0x2d20b0);}(_0x5be0,0x15a));var _0x05be=function(_0x2917c2,_0x5732d9){_0x2917c2=_0x2917c2-0x0;var _0x2e7448=_0x5be0[_0x2917c2];return _0x2e7448;};'use strict';var _=require(_0x05be('0x0'));var util=require(_0x05be('0x1'));var logger=require('../../config/logger')(_0x05be('0x2'));var moment=require(_0x05be('0x3'));var BPromise=require(_0x05be('0x4'));var rp=require(_0x05be('0x5'));var fs=require('fs');var path=require(_0x05be('0x6'));var rimraf=require(_0x05be('0x7'));var config=require(_0x05be('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x589fb1,_0x2d3763){return _0x589fb1[_0x05be('0x9')](_0x05be('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa121=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','define','AnalyticExtractedReport'];(function(_0x2621e7,_0x3323f0){var _0x216828=function(_0x581cb3){while(--_0x581cb3){_0x2621e7['push'](_0x2621e7['shift']());}};_0x216828(++_0x3323f0);}(_0xa121,0xc9));var _0x1a12=function(_0x53f940,_0x1e4088){_0x53f940=_0x53f940-0x0;var _0x365769=_0xa121[_0x53f940];return _0x365769;};'use strict';var _=require(_0x1a12('0x0'));var util=require(_0x1a12('0x1'));var logger=require(_0x1a12('0x2'))('api');var moment=require(_0x1a12('0x3'));var BPromise=require(_0x1a12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a12('0x5'));var rimraf=require(_0x1a12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x5cc6f4,_0x2b6777){return _0x5cc6f4[_0x1a12('0x7')](_0x1a12('0x8'),attributes,{'tableName':_0x1a12('0x9'),'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 6d05ecc..83c70c2 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 _0x9a0c=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2273c9,_0x5262f6){var _0x80c2c4=function(_0x42308c){while(--_0x42308c){_0x2273c9['push'](_0x2273c9['shift']());}};_0x80c2c4(++_0x5262f6);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x131261,_0xbd871a){_0x131261=_0x131261-0x0;var _0x58433c=_0x9a0c[_0x131261];return _0x58433c;};'use strict';var _=require('lodash');var util=require(_0xc9a0('0x0'));var moment=require(_0xc9a0('0x1'));var BPromise=require(_0xc9a0('0x2'));var rs=require(_0xc9a0('0x3'));var fs=require('fs');var Redis=require(_0xc9a0('0x4'));var db=require(_0xc9a0('0x5'))['db'];var utils=require(_0xc9a0('0x6'));var logger=require(_0xc9a0('0x7'))(_0xc9a0('0x8'));var config=require(_0xc9a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc9a0('0xa')][_0xc9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb6e094,_0x5d26d8,_0x33f345){return new BPromise(function(_0x16a48b,_0xaf35e9){return client[_0xc9a0('0xc')](_0xb6e094,_0x33f345)[_0xc9a0('0xd')](function(_0x37534c){logger[_0xc9a0('0xe')](_0xc9a0('0xf'),_0x5d26d8,_0xc9a0('0x10'));logger[_0xc9a0('0x11')](_0xc9a0('0x12'),_0x5d26d8,_0xc9a0('0x10'),JSON[_0xc9a0('0x13')](_0x37534c));if(_0x37534c[_0xc9a0('0x14')]){if(_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x15')]===0x1f4){logger[_0xc9a0('0x14')](_0xc9a0('0xf'),_0x5d26d8,_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);return _0xaf35e9(_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);}logger[_0xc9a0('0x14')](_0xc9a0('0xf'),_0x5d26d8,_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);return _0x16a48b(_0x37534c[_0xc9a0('0x14')]['message']);}else{logger[_0xc9a0('0xe')](_0xc9a0('0xf'),_0x5d26d8,_0xc9a0('0x10'));_0x16a48b(_0x37534c[_0xc9a0('0x17')]['message']);}})[_0xc9a0('0x18')](function(_0x3d6122){logger['error'](_0xc9a0('0xf'),_0x5d26d8,_0x3d6122);_0xaf35e9(_0x3d6122);});});}
\ No newline at end of file
+var _0xa1ab=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2cade4,_0x4bf38f){var _0x5bafa8=function(_0x59edd4){while(--_0x59edd4){_0x2cade4['push'](_0x2cade4['shift']());}};_0x5bafa8(++_0x4bf38f);}(_0xa1ab,0x1a1));var _0xba1a=function(_0x1e3a63,_0x154185){_0x1e3a63=_0x1e3a63-0x0;var _0x4a7209=_0xa1ab[_0x1e3a63];return _0x4a7209;};'use strict';var _=require('lodash');var util=require(_0xba1a('0x0'));var moment=require(_0xba1a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1a('0x2'));var db=require(_0xba1a('0x3'))['db'];var utils=require(_0xba1a('0x4'));var logger=require(_0xba1a('0x5'))(_0xba1a('0x6'));var config=require(_0xba1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba1a('0x8')][_0xba1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19b3bc,_0x35ba1f,_0x40e1fa){return new BPromise(function(_0x1a2cd3,_0x3384b8){return client[_0xba1a('0xa')](_0x19b3bc,_0x40e1fa)[_0xba1a('0xb')](function(_0x213554){logger[_0xba1a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,_0xba1a('0xd'));logger[_0xba1a('0xe')](_0xba1a('0xf'),_0x35ba1f,_0xba1a('0xd'),JSON[_0xba1a('0x10')](_0x213554));if(_0x213554['error']){if(_0x213554[_0xba1a('0x11')][_0xba1a('0x12')]===0x1f4){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);return _0x3384b8(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554['error'][_0xba1a('0x14')]);return _0x1a2cd3(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,'request\x20sent');_0x1a2cd3(_0x213554[_0xba1a('0x15')][_0xba1a('0x14')]);}})[_0xba1a('0x16')](function(_0x13cd4e){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x13cd4e);_0x3384b8(_0x13cd4e);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 5b99618..d297b4e 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 _0xa951=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','put','update','delete','destroy'];(function(_0x588eba,_0x3b1f4e){var _0x157625=function(_0xc37713){while(--_0xc37713){_0x588eba['push'](_0x588eba['shift']());}};_0x157625(++_0x3b1f4e);}(_0xa951,0xf1));var _0x1a95=function(_0x337942,_0x28e1c3){_0x337942=_0x337942-0x0;var _0x398aea=_0xa951[_0x337942];return _0x398aea;};'use strict';var multer=require(_0x1a95('0x0'));var util=require(_0x1a95('0x1'));var path=require('path');var timeout=require(_0x1a95('0x2'));var express=require(_0x1a95('0x3'));var router=express['Router']();var fs_extra=require(_0x1a95('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1a95('0x5'));var config=require(_0x1a95('0x6'));var controller=require(_0x1a95('0x7'));router[_0x1a95('0x8')]('/',auth[_0x1a95('0x9')](),controller[_0x1a95('0xa')]);router[_0x1a95('0x8')](_0x1a95('0xb'),auth[_0x1a95('0x9')](),controller[_0x1a95('0xc')]);router['get'](_0x1a95('0xd'),auth[_0x1a95('0x9')](),controller['download']);router[_0x1a95('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a95('0xf')]('/:id',auth[_0x1a95('0x9')](),controller[_0x1a95('0x10')]);router[_0x1a95('0x11')](_0x1a95('0xb'),auth['isAuthenticated'](),controller[_0x1a95('0x12')]);module[_0x1a95('0x13')]=router;
\ No newline at end of file
+var _0x77d4=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x77d4,0x152));var _0x477d=function(_0x5dca60,_0x2b2eeb){_0x5dca60=_0x5dca60-0x0;var _0xb2e3a9=_0x77d4[_0x5dca60];return _0xb2e3a9;};'use strict';var multer=require(_0x477d('0x0'));var util=require('util');var path=require(_0x477d('0x1'));var timeout=require('connect-timeout');var express=require(_0x477d('0x2'));var router=express[_0x477d('0x3')]();var fs_extra=require(_0x477d('0x4'));var auth=require(_0x477d('0x5'));var interaction=require(_0x477d('0x6'));var config=require(_0x477d('0x7'));var controller=require(_0x477d('0x8'));router['get']('/',auth[_0x477d('0x9')](),controller['index']);router[_0x477d('0xa')](_0x477d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x477d('0xa')](_0x477d('0xc'),auth[_0x477d('0x9')](),controller[_0x477d('0xd')]);router[_0x477d('0xe')]('/',auth['isAuthenticated'](),controller[_0x477d('0xf')]);router[_0x477d('0x10')](_0x477d('0xb'),auth[_0x477d('0x9')](),controller[_0x477d('0x11')]);router[_0x477d('0x12')](_0x477d('0xb'),auth['isAuthenticated'](),controller[_0x477d('0x13')]);module[_0x477d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1948754..9e4fba8 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 _0x6f0d=['STRING','BOOLEAN','sequelize'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0x6f0d,0x1a3));var _0xd6f0=function(_0x46eb67,_0x539066){_0x46eb67=_0x46eb67-0x0;var _0x10b133=_0x6f0d[_0x46eb67];return _0x10b133;};'use strict';var Sequelize=require(_0xd6f0('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd6f0('0x1')]},'format':{'type':Sequelize[_0xd6f0('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd6f0('0x1')]},'custom':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8d12=['exports','TEXT','STRING','BOOLEAN'];(function(_0x598b78,_0xf4ee7e){var _0x6392fa=function(_0x810353){while(--_0x810353){_0x598b78['push'](_0x598b78['shift']());}};_0x6392fa(++_0xf4ee7e);}(_0x8d12,0x70));var _0x28d1=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8d12[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require('sequelize');module[_0x28d1('0x0')]={'field':{'type':Sequelize[_0x28d1('0x1')]},'alias':{'type':Sequelize[_0x28d1('0x2')]},'function':{'type':Sequelize[_0x28d1('0x2')]},'format':{'type':Sequelize[_0x28d1('0x2')]},'groupBy':{'type':Sequelize[_0x28d1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 8e26b3c..7510168 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 _0xce92=['order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','AnalyticFieldReport','rawAttributes','type','model','query','intersection','attributes','fields','length'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xce92,0x1e8));var _0x2ce9=function(_0x2145c0,_0x549319){_0x2145c0=_0x2145c0-0x0;var _0x4c613a=_0xce92[_0x2145c0];return _0x4c613a;};'use strict';var emlformat=require(_0x2ce9('0x0'));var rimraf=require(_0x2ce9('0x1'));var zipdir=require(_0x2ce9('0x2'));var jsonpatch=require(_0x2ce9('0x3'));var rp=require(_0x2ce9('0x4'));var moment=require(_0x2ce9('0x5'));var BPromise=require(_0x2ce9('0x6'));var Mustache=require(_0x2ce9('0x7'));var util=require(_0x2ce9('0x8'));var path=require('path');var sox=require(_0x2ce9('0x9'));var csv=require(_0x2ce9('0xa'));var ejs=require(_0x2ce9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ce9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2ce9('0xd'));var deskjs=require(_0x2ce9('0xe'));var toCsv=require(_0x2ce9('0xa'));var querystring=require('querystring');var Papa=require(_0x2ce9('0xf'));var Redis=require('ioredis');var authService=require(_0x2ce9('0x10'));var qs=require(_0x2ce9('0x11'));var as=require(_0x2ce9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ce9('0x13'))(_0x2ce9('0x14'));var utils=require(_0x2ce9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2ce9('0x16'))['db'];function respondWithStatusCode(_0x16cbd0,_0x3a9fbb){_0x3a9fbb=_0x3a9fbb||0xcc;return function(_0x16ebfa){if(_0x16ebfa){return _0x16cbd0['sendStatus'](_0x3a9fbb);}return _0x16cbd0[_0x2ce9('0x17')](_0x3a9fbb)[_0x2ce9('0x18')]();};}function respondWithResult(_0x517bac,_0x4aaea8){_0x4aaea8=_0x4aaea8||0xc8;return function(_0x10c9e5){if(_0x10c9e5){return _0x517bac[_0x2ce9('0x17')](_0x4aaea8)[_0x2ce9('0x19')](_0x10c9e5);}};}function respondWithFilteredResult(_0x26ccd9,_0x3cb913){return function(_0x4a28fc){if(_0x4a28fc){var _0x2c2788=typeof _0x3cb913[_0x2ce9('0x1a')]===_0x2ce9('0x1b')&&typeof _0x3cb913['limit']==='undefined';var _0x15171d=_0x4a28fc[_0x2ce9('0x1c')];var _0x56978c=_0x2c2788?0x0:_0x3cb913['offset'];var _0x273069=_0x2c2788?_0x4a28fc[_0x2ce9('0x1c')]:_0x3cb913[_0x2ce9('0x1a')]+_0x3cb913[_0x2ce9('0x1d')];var _0x379c57;if(_0x273069>=_0x15171d){_0x273069=_0x15171d;_0x379c57=0xc8;}else{_0x379c57=0xce;}_0x26ccd9[_0x2ce9('0x17')](_0x379c57);return _0x26ccd9['set'](_0x2ce9('0x1e'),_0x56978c+'-'+_0x273069+'/'+_0x15171d)[_0x2ce9('0x19')](_0x4a28fc);}return null;};}function patchUpdates(_0x4a7f7a){return function(_0x48690c){try{jsonpatch[_0x2ce9('0x1f')](_0x48690c,_0x4a7f7a,!![]);}catch(_0x1718dc){return BPromise[_0x2ce9('0x20')](_0x1718dc);}return _0x48690c[_0x2ce9('0x21')]();};}function saveUpdates(_0x413570,_0x2fc8ca){return function(_0x3b3806){if(_0x3b3806){return _0x3b3806[_0x2ce9('0x22')](_0x413570)[_0x2ce9('0x23')](function(_0xc61832){return _0xc61832;});}return null;};}function removeEntity(_0x1f5d07,_0xe697bb){return function(_0x467cab){if(_0x467cab){return _0x467cab[_0x2ce9('0x24')]()[_0x2ce9('0x23')](function(){_0x1f5d07[_0x2ce9('0x17')](0xcc)[_0x2ce9('0x18')]();});}};}function handleEntityNotFound(_0x309743,_0x52a608){return function(_0x27f360){if(!_0x27f360){_0x309743[_0x2ce9('0x25')](0x194);}return _0x27f360;};}function handleError(_0xf54c1e,_0x5d3407){_0x5d3407=_0x5d3407||0x1f4;return function(_0x557c16){logger[_0x2ce9('0x26')](_0x557c16['stack']);if(_0x557c16['name']){delete _0x557c16[_0x2ce9('0x27')];}_0xf54c1e['status'](_0x5d3407)['send'](_0x557c16);};}exports[_0x2ce9('0x28')]=function(_0x5f37c4,_0x412e8a){var _0x30c8a1={},_0x23d16a={},_0x301ac7={'count':0x0,'rows':[]};var _0x5835c4=_[_0x2ce9('0x29')](db[_0x2ce9('0x2a')][_0x2ce9('0x2b')],function(_0x4eac0a){return{'name':_0x4eac0a['fieldName'],'type':_0x4eac0a[_0x2ce9('0x2c')]['key']};});_0x23d16a[_0x2ce9('0x2d')]=_[_0x2ce9('0x29')](_0x5835c4,'name');_0x23d16a[_0x2ce9('0x2e')]=_['keys'](_0x5f37c4['query']);_0x23d16a['filters']=_[_0x2ce9('0x2f')](_0x23d16a[_0x2ce9('0x2d')],_0x23d16a[_0x2ce9('0x2e')]);_0x30c8a1[_0x2ce9('0x30')]=_[_0x2ce9('0x2f')](_0x23d16a[_0x2ce9('0x2d')],qs['fields'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x31')]));_0x30c8a1[_0x2ce9('0x30')]=_0x30c8a1['attributes'][_0x2ce9('0x32')]?_0x30c8a1[_0x2ce9('0x30')]:_0x23d16a[_0x2ce9('0x2d')];if(!_0x5f37c4['query']['hasOwnProperty']('nolimit')){_0x30c8a1[_0x2ce9('0x1d')]=qs[_0x2ce9('0x1d')](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x1d')]);_0x30c8a1[_0x2ce9('0x1a')]=qs['offset'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x1a')]);}_0x30c8a1[_0x2ce9('0x33')]=qs['sort'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x34')]);_0x30c8a1[_0x2ce9('0x35')]=qs[_0x2ce9('0x36')](_[_0x2ce9('0x37')](_0x5f37c4[_0x2ce9('0x2e')],_0x23d16a[_0x2ce9('0x36')]),_0x5835c4);if(_0x5f37c4['query']['filter']){_0x30c8a1[_0x2ce9('0x35')]=_[_0x2ce9('0x38')](_0x30c8a1[_0x2ce9('0x35')],{'$or':_[_0x2ce9('0x29')](_0x5835c4,function(_0xcf5779){if(_0xcf5779[_0x2ce9('0x2c')]!==_0x2ce9('0x39')){var _0x944a7d={};_0x944a7d[_0xcf5779[_0x2ce9('0x27')]]={'$like':'%'+_0x5f37c4[_0x2ce9('0x2e')]['filter']+'%'};return _0x944a7d;}})});}_0x30c8a1=_[_0x2ce9('0x38')]({},_0x30c8a1,_0x5f37c4[_0x2ce9('0x3a')]);var _0x3040af={'where':_0x30c8a1['where']};return db[_0x2ce9('0x2a')]['count'](_0x3040af)['then'](function(_0x4a5b50){_0x301ac7[_0x2ce9('0x1c')]=_0x4a5b50;if(_0x5f37c4['query'][_0x2ce9('0x3b')]){_0x30c8a1[_0x2ce9('0x3c')]=[{'all':!![]}];}return db[_0x2ce9('0x2a')]['findAll'](_0x30c8a1);})[_0x2ce9('0x23')](function(_0x4bb941){_0x301ac7['rows']=_0x4bb941;return _0x301ac7;})[_0x2ce9('0x23')](respondWithFilteredResult(_0x412e8a,_0x30c8a1))[_0x2ce9('0x3d')](handleError(_0x412e8a,null));};exports[_0x2ce9('0x3e')]=function(_0x49f18e,_0x372f68){var _0x95258b={'raw':![],'where':{'id':_0x49f18e[_0x2ce9('0x3f')]['id']}},_0x5eaeb1={};_0x5eaeb1[_0x2ce9('0x2d')]=_[_0x2ce9('0x40')](db['AnalyticFieldReport']['rawAttributes']);_0x5eaeb1['query']=_[_0x2ce9('0x40')](_0x49f18e['query']);_0x5eaeb1[_0x2ce9('0x36')]=_['intersection'](_0x5eaeb1[_0x2ce9('0x2d')],_0x5eaeb1[_0x2ce9('0x2e')]);_0x95258b[_0x2ce9('0x30')]=_[_0x2ce9('0x2f')](_0x5eaeb1[_0x2ce9('0x2d')],qs[_0x2ce9('0x31')](_0x49f18e[_0x2ce9('0x2e')][_0x2ce9('0x31')]));_0x95258b[_0x2ce9('0x30')]=_0x95258b[_0x2ce9('0x30')][_0x2ce9('0x32')]?_0x95258b['attributes']:_0x5eaeb1[_0x2ce9('0x2d')];if(_0x49f18e[_0x2ce9('0x2e')][_0x2ce9('0x3b')]){_0x95258b['include']=[{'all':!![]}];}_0x95258b=_[_0x2ce9('0x38')]({},_0x95258b,_0x49f18e['options']);return db[_0x2ce9('0x2a')][_0x2ce9('0x41')](_0x95258b)[_0x2ce9('0x23')](handleEntityNotFound(_0x372f68,null))[_0x2ce9('0x23')](respondWithResult(_0x372f68,null))['catch'](handleError(_0x372f68,null));};exports[_0x2ce9('0x42')]=function(_0x47732b,_0x2d75c4){return db[_0x2ce9('0x2a')]['create'](_0x47732b['body'],{})[_0x2ce9('0x23')](respondWithResult(_0x2d75c4,0xc9))[_0x2ce9('0x3d')](handleError(_0x2d75c4,null));};exports[_0x2ce9('0x43')]=function(_0x59b969,_0x262071){return db['AnalyticFieldReport']['bulkCreate'](_0x59b969['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x262071,0xc9))[_0x2ce9('0x3d')](handleError(_0x262071,null));};exports[_0x2ce9('0x22')]=function(_0x5f0e0b,_0x3f9031){if(_0x5f0e0b[_0x2ce9('0x44')]['id']){delete _0x5f0e0b[_0x2ce9('0x44')]['id'];}return db[_0x2ce9('0x2a')][_0x2ce9('0x41')]({'where':{'id':_0x5f0e0b[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x3f9031,null))[_0x2ce9('0x23')](saveUpdates(_0x5f0e0b[_0x2ce9('0x44')],null))[_0x2ce9('0x23')](respondWithResult(_0x3f9031,null))[_0x2ce9('0x3d')](handleError(_0x3f9031,null));};exports[_0x2ce9('0x24')]=function(_0x3b757c,_0x1c4060){return db['AnalyticFieldReport'][_0x2ce9('0x41')]({'where':{'id':_0x3b757c[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x1c4060,null))['then'](removeEntity(_0x1c4060,null))[_0x2ce9('0x3d')](handleError(_0x1c4060,null));};exports[_0x2ce9('0x45')]=function(_0x21981b,_0x384eca){return db[_0x2ce9('0x2a')][_0x2ce9('0x24')]({'where':{'id':_0x21981b[_0x2ce9('0x2e')][_0x2ce9('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x2ce9('0x23')](respondWithResult(_0x384eca,0xcc))[_0x2ce9('0x3d')](handleError(_0x384eca,null));};exports[_0x2ce9('0x47')]=function(_0x45fcc9,_0x2fec49,_0x5406ca){return db[_0x2ce9('0x48')]['findOne']({'where':{'id':_0x45fcc9[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x2fec49,null))[_0x2ce9('0x23')](function(_0x49f303){if(_0x49f303){return db[_0x2ce9('0x49')][_0x2ce9('0x4a')](function(_0x34788c){return db[_0x2ce9('0x2a')][_0x2ce9('0x24')]({'where':{'CustomReportId':_0x45fcc9['params']['id']},'transaction':_0x34788c})[_0x2ce9('0x23')](function(_0x5dce53){var _0x685305=_[_0x2ce9('0x29')](_0x45fcc9[_0x2ce9('0x44')],function(_0x500647){delete _0x500647['id'];_0x500647[_0x2ce9('0x4b')]=_0x45fcc9[_0x2ce9('0x3f')]['id'];return _0x500647;});return db[_0x2ce9('0x2a')][_0x2ce9('0x43')](_0x685305,{'transaction':_0x34788c});});})[_0x2ce9('0x23')](function(){return db[_0x2ce9('0x2a')][_0x2ce9('0x4c')]({'where':{'CustomReportId':_0x45fcc9[_0x2ce9('0x3f')]['id']}});});}})[_0x2ce9('0x23')](respondWithResult(_0x2fec49,null))['catch'](handleError(_0x2fec49,null));};
\ No newline at end of file
+var _0x037b=['sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','bulkCreate','body','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x1f7330,_0x13e6c4){var _0x16ec2e=function(_0xa925b1){while(--_0xa925b1){_0x1f7330['push'](_0x1f7330['shift']());}};_0x16ec2e(++_0x13e6c4);}(_0x037b,0x19c));var _0xb037=function(_0x1d16e8,_0x14d94e){_0x1d16e8=_0x1d16e8-0x0;var _0x8d6085=_0x037b[_0x1d16e8];return _0x8d6085;};'use strict';var emlformat=require(_0xb037('0x0'));var rimraf=require(_0xb037('0x1'));var zipdir=require(_0xb037('0x2'));var jsonpatch=require(_0xb037('0x3'));var rp=require(_0xb037('0x4'));var moment=require(_0xb037('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb037('0x6'));var path=require(_0xb037('0x7'));var sox=require(_0xb037('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb037('0x9'));var squel=require(_0xb037('0xa'));var crypto=require(_0xb037('0xb'));var jsforce=require(_0xb037('0xc'));var deskjs=require(_0xb037('0xd'));var toCsv=require(_0xb037('0xe'));var querystring=require('querystring');var Papa=require(_0xb037('0xf'));var Redis=require(_0xb037('0x10'));var authService=require(_0xb037('0x11'));var qs=require(_0xb037('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb037('0x13'));var logger=require(_0xb037('0x14'))(_0xb037('0x15'));var utils=require('../../config/utils');var config=require(_0xb037('0x16'));var licenseUtil=require(_0xb037('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5287a5,_0x56b843){_0x56b843=_0x56b843||0xcc;return function(_0x3cd18a){if(_0x3cd18a){return _0x5287a5['sendStatus'](_0x56b843);}return _0x5287a5[_0xb037('0x18')](_0x56b843)[_0xb037('0x19')]();};}function respondWithResult(_0x594534,_0xcf9645){_0xcf9645=_0xcf9645||0xc8;return function(_0x2fa2e6){if(_0x2fa2e6){return _0x594534[_0xb037('0x18')](_0xcf9645)[_0xb037('0x1a')](_0x2fa2e6);}};}function respondWithFilteredResult(_0x3757fa,_0x414ba0){return function(_0x24cc65){if(_0x24cc65){var _0x18005b=typeof _0x414ba0[_0xb037('0x1b')]===_0xb037('0x1c')&&typeof _0x414ba0[_0xb037('0x1d')]===_0xb037('0x1c');var _0x281b56=_0x24cc65[_0xb037('0x1e')];var _0x1b9dd5=_0x18005b?0x0:_0x414ba0[_0xb037('0x1b')];var _0x46695e=_0x18005b?_0x24cc65[_0xb037('0x1e')]:_0x414ba0[_0xb037('0x1b')]+_0x414ba0[_0xb037('0x1d')];var _0x1129b3;if(_0x46695e>=_0x281b56){_0x46695e=_0x281b56;_0x1129b3=0xc8;}else{_0x1129b3=0xce;}_0x3757fa['status'](_0x1129b3);return _0x3757fa['set'](_0xb037('0x1f'),_0x1b9dd5+'-'+_0x46695e+'/'+_0x281b56)['json'](_0x24cc65);}return null;};}function patchUpdates(_0xc0e6ab){return function(_0x1ae27c){try{jsonpatch[_0xb037('0x20')](_0x1ae27c,_0xc0e6ab,!![]);}catch(_0x5a686c){return BPromise[_0xb037('0x21')](_0x5a686c);}return _0x1ae27c[_0xb037('0x22')]();};}function saveUpdates(_0x1302a7,_0x3376d2){return function(_0x54cbc1){if(_0x54cbc1){return _0x54cbc1[_0xb037('0x23')](_0x1302a7)[_0xb037('0x24')](function(_0x3e7f31){return _0x3e7f31;});}return null;};}function removeEntity(_0x291bbc,_0x3b38a2){return function(_0x4dc61a){if(_0x4dc61a){return _0x4dc61a['destroy']()['then'](function(){_0x291bbc['status'](0xcc)[_0xb037('0x19')]();});}};}function handleEntityNotFound(_0x302c67,_0x548cfb){return function(_0x23f716){if(!_0x23f716){_0x302c67[_0xb037('0x25')](0x194);}return _0x23f716;};}function handleError(_0x89e2c1,_0x526b1f){_0x526b1f=_0x526b1f||0x1f4;return function(_0x477c15){logger[_0xb037('0x26')](_0x477c15[_0xb037('0x27')]);if(_0x477c15['name']){delete _0x477c15[_0xb037('0x28')];}_0x89e2c1[_0xb037('0x18')](_0x526b1f)[_0xb037('0x29')](_0x477c15);};}exports[_0xb037('0x2a')]=function(_0x57254a,_0x2560ab){var _0x221797={},_0x5f04fc={},_0x504ac7={'count':0x0,'rows':[]};var _0x10d96a=_['map'](db['AnalyticFieldReport'][_0xb037('0x2b')],function(_0x50cb69){return{'name':_0x50cb69[_0xb037('0x2c')],'type':_0x50cb69[_0xb037('0x2d')][_0xb037('0x2e')]};});_0x5f04fc[_0xb037('0x2f')]=_['map'](_0x10d96a,_0xb037('0x28'));_0x5f04fc[_0xb037('0x30')]=_[_0xb037('0x31')](_0x57254a[_0xb037('0x30')]);_0x5f04fc[_0xb037('0x32')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],_0x5f04fc[_0xb037('0x30')]);_0x221797[_0xb037('0x34')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],qs['fields'](_0x57254a[_0xb037('0x30')][_0xb037('0x35')]));_0x221797[_0xb037('0x34')]=_0x221797[_0xb037('0x34')][_0xb037('0x36')]?_0x221797['attributes']:_0x5f04fc[_0xb037('0x2f')];if(!_0x57254a[_0xb037('0x30')][_0xb037('0x37')](_0xb037('0x38'))){_0x221797[_0xb037('0x1d')]=qs[_0xb037('0x1d')](_0x57254a['query'][_0xb037('0x1d')]);_0x221797['offset']=qs[_0xb037('0x1b')](_0x57254a[_0xb037('0x30')]['offset']);}_0x221797[_0xb037('0x39')]=qs[_0xb037('0x3a')](_0x57254a[_0xb037('0x30')][_0xb037('0x3a')]);_0x221797[_0xb037('0x3b')]=qs[_0xb037('0x32')](_[_0xb037('0x3c')](_0x57254a[_0xb037('0x30')],_0x5f04fc['filters']),_0x10d96a);if(_0x57254a['query'][_0xb037('0x3d')]){_0x221797[_0xb037('0x3b')]=_[_0xb037('0x3e')](_0x221797[_0xb037('0x3b')],{'$or':_[_0xb037('0x3f')](_0x10d96a,function(_0x33ba05){if(_0x33ba05[_0xb037('0x2d')]!==_0xb037('0x40')){var _0x4e7911={};_0x4e7911[_0x33ba05['name']]={'$like':'%'+_0x57254a['query'][_0xb037('0x3d')]+'%'};return _0x4e7911;}})});}_0x221797=_[_0xb037('0x3e')]({},_0x221797,_0x57254a['options']);var _0x1d5cf4={'where':_0x221797[_0xb037('0x3b')]};return db[_0xb037('0x41')][_0xb037('0x1e')](_0x1d5cf4)[_0xb037('0x24')](function(_0x434690){_0x504ac7[_0xb037('0x1e')]=_0x434690;if(_0x57254a[_0xb037('0x30')][_0xb037('0x42')]){_0x221797[_0xb037('0x43')]=[{'all':!![]}];}return db[_0xb037('0x41')][_0xb037('0x44')](_0x221797);})[_0xb037('0x24')](function(_0x8cf7fe){_0x504ac7[_0xb037('0x45')]=_0x8cf7fe;return _0x504ac7;})['then'](respondWithFilteredResult(_0x2560ab,_0x221797))[_0xb037('0x46')](handleError(_0x2560ab,null));};exports[_0xb037('0x47')]=function(_0x49d902,_0xceb0bd){var _0x4364c5={'raw':![],'where':{'id':_0x49d902[_0xb037('0x48')]['id']}},_0x38f8af={};_0x38f8af['model']=_['keys'](db[_0xb037('0x41')][_0xb037('0x2b')]);_0x38f8af[_0xb037('0x30')]=_['keys'](_0x49d902[_0xb037('0x30')]);_0x38f8af[_0xb037('0x32')]=_[_0xb037('0x33')](_0x38f8af[_0xb037('0x2f')],_0x38f8af[_0xb037('0x30')]);_0x4364c5[_0xb037('0x34')]=_['intersection'](_0x38f8af['model'],qs[_0xb037('0x35')](_0x49d902[_0xb037('0x30')]['fields']));_0x4364c5[_0xb037('0x34')]=_0x4364c5['attributes'][_0xb037('0x36')]?_0x4364c5[_0xb037('0x34')]:_0x38f8af[_0xb037('0x2f')];if(_0x49d902['query'][_0xb037('0x42')]){_0x4364c5[_0xb037('0x43')]=[{'all':!![]}];}_0x4364c5=_[_0xb037('0x3e')]({},_0x4364c5,_0x49d902[_0xb037('0x49')]);return db[_0xb037('0x41')][_0xb037('0x4a')](_0x4364c5)[_0xb037('0x24')](handleEntityNotFound(_0xceb0bd,null))[_0xb037('0x24')](respondWithResult(_0xceb0bd,null))[_0xb037('0x46')](handleError(_0xceb0bd,null));};exports[_0xb037('0x4b')]=function(_0x319c48,_0x4f3aef){return db[_0xb037('0x41')][_0xb037('0x4b')](_0x319c48['body'],{})[_0xb037('0x24')](respondWithResult(_0x4f3aef,0xc9))[_0xb037('0x46')](handleError(_0x4f3aef,null));};exports[_0xb037('0x4c')]=function(_0x58d1c5,_0x1df94f){return db[_0xb037('0x41')][_0xb037('0x4c')](_0x58d1c5['body'],{'raw':![],'individualHooks':!![]})[_0xb037('0x24')](respondWithResult(_0x1df94f,0xc9))[_0xb037('0x46')](handleError(_0x1df94f,null));};exports[_0xb037('0x23')]=function(_0x4fd0cd,_0x5ee22f){if(_0x4fd0cd['body']['id']){delete _0x4fd0cd[_0xb037('0x4d')]['id'];}return db[_0xb037('0x41')][_0xb037('0x4a')]({'where':{'id':_0x4fd0cd['params']['id']}})['then'](handleEntityNotFound(_0x5ee22f,null))[_0xb037('0x24')](saveUpdates(_0x4fd0cd[_0xb037('0x4d')],null))[_0xb037('0x24')](respondWithResult(_0x5ee22f,null))[_0xb037('0x46')](handleError(_0x5ee22f,null));};exports[_0xb037('0x4e')]=function(_0x5c6b76,_0x166de5){return db[_0xb037('0x41')]['find']({'where':{'id':_0x5c6b76['params']['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x166de5,null))['then'](removeEntity(_0x166de5,null))[_0xb037('0x46')](handleError(_0x166de5,null));};exports[_0xb037('0x4f')]=function(_0x50d35a,_0x3f2072){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'id':_0x50d35a['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3f2072,0xcc))[_0xb037('0x46')](handleError(_0x3f2072,null));};exports[_0xb037('0x50')]=function(_0xf04815,_0x830a5d,_0x483ca4){return db[_0xb037('0x51')][_0xb037('0x52')]({'where':{'id':_0xf04815[_0xb037('0x48')]['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x830a5d,null))[_0xb037('0x24')](function(_0x1fc0c0){if(_0x1fc0c0){return db['sequelize'][_0xb037('0x53')](function(_0x2217f4){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'CustomReportId':_0xf04815['params']['id']},'transaction':_0x2217f4})[_0xb037('0x24')](function(_0xb5d70c){var _0x4db1eb=_[_0xb037('0x3f')](_0xf04815[_0xb037('0x4d')],function(_0x574cde){delete _0x574cde['id'];_0x574cde['CustomReportId']=_0xf04815[_0xb037('0x48')]['id'];return _0x574cde;});return db['AnalyticFieldReport'][_0xb037('0x4c')](_0x4db1eb,{'transaction':_0x2217f4});});})[_0xb037('0x24')](function(){return db['AnalyticFieldReport'][_0xb037('0x44')]({'where':{'CustomReportId':_0xf04815[_0xb037('0x48')]['id']}});});}})[_0xb037('0x24')](respondWithResult(_0x830a5d,null))['catch'](handleError(_0x830a5d,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d611935..8ce0668 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 _0xddac=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42d2e0,_0x590383){var _0x5e6265=function(_0x5e12e0){while(--_0x5e12e0){_0x42d2e0['push'](_0x42d2e0['shift']());}};_0x5e6265(++_0x590383);}(_0xddac,0xc5));var _0xcdda=function(_0x280988,_0x5551b6){_0x280988=_0x280988-0x0;var _0x5add5d=_0xddac[_0x280988];return _0x5add5d;};'use strict';var _=require('lodash');var util=require(_0xcdda('0x0'));var logger=require(_0xcdda('0x1'))('api');var moment=require(_0xcdda('0x2'));var BPromise=require(_0xcdda('0x3'));var rp=require(_0xcdda('0x4'));var fs=require('fs');var path=require(_0xcdda('0x5'));var rimraf=require(_0xcdda('0x6'));var config=require('../../config/environment');var attributes=require(_0xcdda('0x7'));module[_0xcdda('0x8')]=function(_0x1aa4a7,_0x3ee8a9){return _0x1aa4a7[_0xcdda('0x9')](_0xcdda('0xa'),attributes,{'tableName':_0xcdda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe320=['../../config/logger','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x2694a4,_0x46b7cb){var _0x113c52=function(_0x500d3b){while(--_0x500d3b){_0x2694a4['push'](_0x2694a4['shift']());}};_0x113c52(++_0x46b7cb);}(_0xe320,0x13b));var _0x0e32=function(_0x3ad25e,_0x5d80a6){_0x3ad25e=_0x3ad25e-0x0;var _0x156775=_0xe320[_0x3ad25e];return _0x156775;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e32('0x0'))('api');var moment=require(_0x0e32('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e32('0x2'));var rimraf=require(_0x0e32('0x3'));var config=require(_0x0e32('0x4'));var attributes=require(_0x0e32('0x5'));module[_0x0e32('0x6')]=function(_0x43d378,_0x3bf241){return _0x43d378[_0x0e32('0x7')](_0x0e32('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index c5a8b41..bf30447 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 _0xf182=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x144375,_0x41183d){var _0x4b0399=function(_0x15acb9){while(--_0x15acb9){_0x144375['push'](_0x144375['shift']());}};_0x4b0399(++_0x41183d);}(_0xf182,0x1b5));var _0x2f18=function(_0x4c2c83,_0x4d5747){_0x4c2c83=_0x4c2c83-0x0;var _0x51752d=_0xf182[_0x4c2c83];return _0x51752d;};'use strict';var _=require(_0x2f18('0x0'));var util=require(_0x2f18('0x1'));var moment=require(_0x2f18('0x2'));var BPromise=require(_0x2f18('0x3'));var rs=require(_0x2f18('0x4'));var fs=require('fs');var Redis=require(_0x2f18('0x5'));var db=require(_0x2f18('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f18('0x7'))(_0x2f18('0x8'));var config=require(_0x2f18('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f18('0xa')][_0x2f18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e3816,_0x244e2a,_0x554012){return new BPromise(function(_0x30e5e7,_0x292b0f){return client[_0x2f18('0xc')](_0x1e3816,_0x554012)[_0x2f18('0xd')](function(_0x1902cd){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x244e2a,_0x2f18('0xe'));logger[_0x2f18('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x244e2a,_0x2f18('0xe'),JSON[_0x2f18('0x10')](_0x1902cd));if(_0x1902cd['error']){if(_0x1902cd[_0x2f18('0x11')]['code']===0x1f4){logger[_0x2f18('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x244e2a,_0x1902cd[_0x2f18('0x11')]['message']);return _0x292b0f(_0x1902cd[_0x2f18('0x11')]['message']);}logger[_0x2f18('0x11')](_0x2f18('0x12'),_0x244e2a,_0x1902cd[_0x2f18('0x11')][_0x2f18('0x13')]);return _0x30e5e7(_0x1902cd[_0x2f18('0x11')][_0x2f18('0x13')]);}else{logger[_0x2f18('0x14')](_0x2f18('0x12'),_0x244e2a,_0x2f18('0xe'));_0x30e5e7(_0x1902cd[_0x2f18('0x15')][_0x2f18('0x13')]);}})['catch'](function(_0x4022a2){logger[_0x2f18('0x11')](_0x2f18('0x12'),_0x244e2a,_0x4022a2);_0x292b0f(_0x4022a2);});});}
\ No newline at end of file
+var _0xcf90=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0xcf90,0x175));var _0x0cf9=function(_0x1b514f,_0x30fba3){_0x1b514f=_0x1b514f-0x0;var _0x3d5c97=_0xcf90[_0x1b514f];return _0x3d5c97;};'use strict';var _=require(_0x0cf9('0x0'));var util=require(_0x0cf9('0x1'));var moment=require('moment');var BPromise=require(_0x0cf9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf9('0x3'));var db=require(_0x0cf9('0x4'))['db'];var utils=require(_0x0cf9('0x5'));var logger=require(_0x0cf9('0x6'))(_0x0cf9('0x7'));var config=require('../../config/environment');var jayson=require(_0x0cf9('0x8'));var client=jayson[_0x0cf9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25973d,_0x20e17d,_0x51a0cb){return new BPromise(function(_0x5a1046,_0x34915){return client[_0x0cf9('0xa')](_0x25973d,_0x51a0cb)[_0x0cf9('0xb')](function(_0x418068){logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));logger[_0x0cf9('0xf')](_0x0cf9('0x10'),_0x20e17d,_0x0cf9('0xe'),JSON[_0x0cf9('0x11')](_0x418068));if(_0x418068['error']){if(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x13')]===0x1f4){logger[_0x0cf9('0x12')](_0x0cf9('0xd'),_0x20e17d,_0x418068['error'][_0x0cf9('0x14')]);return _0x34915(_0x418068['error'][_0x0cf9('0x14')]);}logger[_0x0cf9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20e17d,_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);return _0x5a1046(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);}else{logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));_0x5a1046(_0x418068[_0x0cf9('0x15')][_0x0cf9('0x14')]);}})['catch'](function(_0x5dbda8){logger['error'](_0x0cf9('0xd'),_0x20e17d,_0x5dbda8);_0x34915(_0x5dbda8);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0c413b1..378dd4e 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(_0x2ab75d,_0x257584){var _0x29c1e0=function(_0x5b46ad){while(--_0x5b46ad){_0x2ab75d['push'](_0x2ab75d['shift']());}};_0x29c1e0(++_0x257584);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x1c7033,_0x895853){var _0xf93472=function(_0x54d328){while(--_0x54d328){_0x1c7033['push'](_0x1c7033['shift']());}};_0xf93472(++_0x895853);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 1387905..0f00c70 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 _0xc4e1=['sequelize','exports','STRING','name','TEXT'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xc4e1,0x172));var _0x1c4e=function(_0x17559a,_0x154e59){_0x17559a=_0x17559a-0x0;var _0x61be60=_0xc4e1[_0x17559a];return _0x61be60;};'use strict';var Sequelize=require(_0x1c4e('0x0'));module[_0x1c4e('0x1')]={'name':{'type':Sequelize[_0x1c4e('0x2')],'allowNull':![],'unique':_0x1c4e('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c4e('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaf1d=['exports','STRING','name','TEXT','sequelize'];(function(_0x1b96f2,_0x14f728){var _0x53eace=function(_0x3eee42){while(--_0x3eee42){_0x1b96f2['push'](_0x1b96f2['shift']());}};_0x53eace(++_0x14f728);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x526cde,_0x505ef0){_0x526cde=_0x526cde-0x0;var _0x489274=_0xaf1d[_0x526cde];return _0x489274;};'use strict';var Sequelize=require(_0xdaf1('0x0'));module[_0xdaf1('0x1')]={'name':{'type':Sequelize[_0xdaf1('0x2')],'allowNull':![],'unique':_0xdaf1('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xdaf1('0x4')]},'description':{'type':Sequelize[_0xdaf1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index af24d2f..050d849 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x3f591a,_0x52cd00){var _0x461939=function(_0xe2822c){while(--_0xe2822c){_0x3f591a['push'](_0x3f591a['shift']());}};_0x461939(++_0x52cd00);}(_0x98a8,0x12c));var _0x898a=function(_0x469be9,_0x2f5493){_0x469be9=_0x469be9-0x0;var _0x3e819b=_0x98a8[_0x469be9];return _0x3e819b;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x3a0f4b,_0x365b6e){var _0x1238c8=function(_0x182d57){while(--_0x182d57){_0x3a0f4b['push'](_0x3a0f4b['shift']());}};_0x1238c8(++_0x365b6e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6760208..4b89328 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 _0xfcbe=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54f573,_0x4bfb56){var _0x458f83=function(_0x58a3da){while(--_0x58a3da){_0x54f573['push'](_0x54f573['shift']());}};_0x458f83(++_0x4bfb56);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x4f6d73,_0x37d4c4){_0x4f6d73=_0x4f6d73-0x0;var _0x411c83=_0xfcbe[_0x4f6d73];return _0x411c83;};'use strict';var _=require('lodash');var util=require(_0xefcb('0x0'));var logger=require(_0xefcb('0x1'))(_0xefcb('0x2'));var moment=require(_0xefcb('0x3'));var BPromise=require(_0xefcb('0x4'));var rp=require(_0xefcb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefcb('0x6'));var config=require(_0xefcb('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x50dcde,_0x3f322c){return _0x50dcde['define']('AnalyticMetric',attributes,{'tableName':_0xefcb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x482d=['path','../../config/environment','./analyticMetric.attributes','exports','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x84d8fb,_0x107be4){var _0x4de1fb=function(_0x28a4b1){while(--_0x28a4b1){_0x84d8fb['push'](_0x84d8fb['shift']());}};_0x4de1fb(++_0x107be4);}(_0x482d,0x16c));var _0xd482=function(_0x3b71e2,_0x35c979){_0x3b71e2=_0x3b71e2-0x0;var _0x1bd52e=_0x482d[_0x3b71e2];return _0x1bd52e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd482('0x0'))(_0xd482('0x1'));var moment=require(_0xd482('0x2'));var BPromise=require(_0xd482('0x3'));var rp=require(_0xd482('0x4'));var fs=require('fs');var path=require(_0xd482('0x5'));var rimraf=require('rimraf');var config=require(_0xd482('0x6'));var attributes=require(_0xd482('0x7'));module[_0xd482('0x8')]=function(_0x57cd2c,_0x3b9989){return _0x57cd2c['define']('AnalyticMetric',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 aa5a3c4..433f1b3 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 _0x305c=['request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47ad6d,_0xf4793d){var _0x505990=function(_0x2a3f44){while(--_0x2a3f44){_0x47ad6d['push'](_0x47ad6d['shift']());}};_0x505990(++_0xf4793d);}(_0x305c,0x15e));var _0xc305=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x305c[_0x37c22c];return _0x119d79;};'use strict';var _=require('lodash');var util=require(_0xc305('0x0'));var moment=require(_0xc305('0x1'));var BPromise=require(_0xc305('0x2'));var rs=require(_0xc305('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc305('0x4'));var logger=require('../../config/logger')(_0xc305('0x5'));var config=require(_0xc305('0x6'));var jayson=require(_0xc305('0x7'));var client=jayson[_0xc305('0x8')][_0xc305('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d134d,_0x565bff,_0x430e9f){return new BPromise(function(_0x13a02a,_0x3714fa){return client[_0xc305('0xa')](_0x2d134d,_0x430e9f)[_0xc305('0xb')](function(_0x12fe5f){logger[_0xc305('0xc')](_0xc305('0xd'),_0x565bff,_0xc305('0xe'));logger[_0xc305('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x565bff,_0xc305('0xe'),JSON[_0xc305('0x10')](_0x12fe5f));if(_0x12fe5f['error']){if(_0x12fe5f['error'][_0xc305('0x11')]===0x1f4){logger[_0xc305('0x12')](_0xc305('0xd'),_0x565bff,_0x12fe5f[_0xc305('0x12')][_0xc305('0x13')]);return _0x3714fa(_0x12fe5f['error'][_0xc305('0x13')]);}logger[_0xc305('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x565bff,_0x12fe5f[_0xc305('0x12')]['message']);return _0x13a02a(_0x12fe5f[_0xc305('0x12')][_0xc305('0x13')]);}else{logger[_0xc305('0xc')](_0xc305('0xd'),_0x565bff,_0xc305('0xe'));_0x13a02a(_0x12fe5f['result'][_0xc305('0x13')]);}})['catch'](function(_0x4fe07b){logger[_0xc305('0x12')](_0xc305('0xd'),_0x565bff,_0x4fe07b);_0x3714fa(_0x4fe07b);});});}
\ No newline at end of file
+var _0x2e39=['jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2e39,0x1c5));var _0x92e3=function(_0x319a63,_0x3a7d3f){_0x319a63=_0x319a63-0x0;var _0x353bca=_0x2e39[_0x319a63];return _0x353bca;};'use strict';var _=require(_0x92e3('0x0'));var util=require(_0x92e3('0x1'));var moment=require('moment');var BPromise=require(_0x92e3('0x2'));var rs=require(_0x92e3('0x3'));var fs=require('fs');var Redis=require(_0x92e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x92e3('0x5'));var config=require(_0x92e3('0x6'));var jayson=require(_0x92e3('0x7'));var client=jayson[_0x92e3('0x8')][_0x92e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14f09a,_0x33e336,_0x4d9789){return new BPromise(function(_0x374696,_0x25dc98){return client['request'](_0x14f09a,_0x4d9789)[_0x92e3('0xa')](function(_0x2f4ca2){logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,'request\x20sent');logger[_0x92e3('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x33e336,_0x92e3('0xe'),JSON[_0x92e3('0xf')](_0x2f4ca2));if(_0x2f4ca2[_0x92e3('0x10')]){if(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x11')]===0x1f4){logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2[_0x92e3('0x10')]['message']);return _0x25dc98(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2['error'][_0x92e3('0x12')]);return _0x374696(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}else{logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,_0x92e3('0xe'));_0x374696(_0x2f4ca2['result'][_0x92e3('0x12')]);}})[_0x92e3('0x13')](function(_0x5051c4){logger['error'](_0x92e3('0xc'),_0x33e336,_0x5051c4);_0x25dc98(_0x5051c4);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e3f7cb6..06ee8a6 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 _0x1d7e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','exports','util','path','connect-timeout'];(function(_0x3fd9af,_0xe1e30){var _0x2c10b5=function(_0x4549c7){while(--_0x4549c7){_0x3fd9af['push'](_0x3fd9af['shift']());}};_0x2c10b5(++_0xe1e30);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1d7e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require('multer');var util=require(_0xe1d7('0x0'));var path=require(_0xe1d7('0x1'));var timeout=require(_0xe1d7('0x2'));var express=require('express');var router=express[_0xe1d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe1d7('0x4'));var interaction=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var controller=require(_0xe1d7('0x7'));router[_0xe1d7('0x8')]('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xa')]);router[_0xe1d7('0x8')](_0xe1d7('0xb'),auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xc')]);router['post']('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xd')]);router['put'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller[_0xe1d7('0xe')]);router['delete'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe1d7('0xf')]=router;
\ No newline at end of file
+var _0x5398=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x5398,0xe2));var _0x8539=function(_0xf771fe,_0x1d1fa8){_0xf771fe=_0xf771fe-0x0;var _0x27eecc=_0x5398[_0xf771fe];return _0x27eecc;};'use strict';var multer=require('multer');var util=require(_0x8539('0x0'));var path=require(_0x8539('0x1'));var timeout=require(_0x8539('0x2'));var express=require(_0x8539('0x3'));var router=express[_0x8539('0x4')]();var fs_extra=require(_0x8539('0x5'));var auth=require(_0x8539('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8539('0x7'));router[_0x8539('0x8')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xa')]);router[_0x8539('0x8')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0xc')]);router[_0x8539('0xd')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xe')]);router[_0x8539('0xf')](_0x8539('0xb'),auth[_0x8539('0x9')](),controller[_0x8539('0x10')]);router[_0x8539('0x11')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0x12')]);module[_0x8539('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8ffe2f3..6f3e560 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 _0xd343=['TEXT'];(function(_0x21dccd,_0x30b1bb){var _0x94fc9b=function(_0x47b91c){while(--_0x47b91c){_0x21dccd['push'](_0x21dccd['shift']());}};_0x94fc9b(++_0x30b1bb);}(_0xd343,0x130));var _0x3d34=function(_0x56c74a,_0x7e7580){_0x56c74a=_0x56c74a-0x0;var _0x409137=_0xd343[_0x56c74a];return _0x409137;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x3d34('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x32ac=['TEXT','sequelize'];(function(_0x313866,_0x3ecd92){var _0x5a818f=function(_0x507e58){while(--_0x507e58){_0x313866['push'](_0x313866['shift']());}};_0x5a818f(++_0x3ecd92);}(_0x32ac,0x113));var _0xc32a=function(_0x4ad9cd,_0x43e881){_0x4ad9cd=_0x4ad9cd-0x0;var _0x5e34b1=_0x32ac[_0x4ad9cd];return _0x5e34b1;};'use strict';var Sequelize=require(_0xc32a('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc32a('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 791615c..8c7fd34 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 _0xaa13=['body','find','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','AnalyticTreeReport','fieldName','type','key','model','map','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','create'];(function(_0x41e122,_0xa1a841){var _0x3c927d=function(_0x2e762e){while(--_0x2e762e){_0x41e122['push'](_0x41e122['shift']());}};_0x3c927d(++_0xa1a841);}(_0xaa13,0x179));var _0x3aa1=function(_0x112e83,_0x4c70ab){_0x112e83=_0x112e83-0x0;var _0x5afcaa=_0xaa13[_0x112e83];return _0x5afcaa;};'use strict';var emlformat=require(_0x3aa1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3aa1('0x1'));var rp=require(_0x3aa1('0x2'));var moment=require(_0x3aa1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3aa1('0x4'));var util=require(_0x3aa1('0x5'));var path=require(_0x3aa1('0x6'));var sox=require(_0x3aa1('0x7'));var csv=require(_0x3aa1('0x8'));var ejs=require(_0x3aa1('0x9'));var fs=require('fs');var fs_extra=require(_0x3aa1('0xa'));var _=require(_0x3aa1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3aa1('0xc'));var deskjs=require(_0x3aa1('0xd'));var toCsv=require(_0x3aa1('0x8'));var querystring=require(_0x3aa1('0xe'));var Papa=require(_0x3aa1('0xf'));var Redis=require(_0x3aa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3aa1('0x11'));var as=require(_0x3aa1('0x12'));var hardwareService=require(_0x3aa1('0x13'));var logger=require(_0x3aa1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3aa1('0x15'));var licenseUtil=require(_0x3aa1('0x16'));var db=require(_0x3aa1('0x17'))['db'];function respondWithStatusCode(_0x5bd7b4,_0xcf9e12){_0xcf9e12=_0xcf9e12||0xcc;return function(_0x49259a){if(_0x49259a){return _0x5bd7b4['sendStatus'](_0xcf9e12);}return _0x5bd7b4[_0x3aa1('0x18')](_0xcf9e12)[_0x3aa1('0x19')]();};}function respondWithResult(_0x5c0899,_0x5c7f44){_0x5c7f44=_0x5c7f44||0xc8;return function(_0xd7be4a){if(_0xd7be4a){return _0x5c0899[_0x3aa1('0x18')](_0x5c7f44)[_0x3aa1('0x1a')](_0xd7be4a);}};}function respondWithFilteredResult(_0x4fec74,_0x214051){return function(_0x49e605){if(_0x49e605){var _0x3a73be=typeof _0x214051[_0x3aa1('0x1b')]===_0x3aa1('0x1c')&&typeof _0x214051[_0x3aa1('0x1d')]===_0x3aa1('0x1c');var _0x1bd01c=_0x49e605[_0x3aa1('0x1e')];var _0x1001c2=_0x3a73be?0x0:_0x214051[_0x3aa1('0x1b')];var _0x2a8a89=_0x3a73be?_0x49e605[_0x3aa1('0x1e')]:_0x214051[_0x3aa1('0x1b')]+_0x214051[_0x3aa1('0x1d')];var _0x1965e3;if(_0x2a8a89>=_0x1bd01c){_0x2a8a89=_0x1bd01c;_0x1965e3=0xc8;}else{_0x1965e3=0xce;}_0x4fec74[_0x3aa1('0x18')](_0x1965e3);return _0x4fec74[_0x3aa1('0x1f')](_0x3aa1('0x20'),_0x1001c2+'-'+_0x2a8a89+'/'+_0x1bd01c)[_0x3aa1('0x1a')](_0x49e605);}return null;};}function patchUpdates(_0x58b026){return function(_0x22b7c9){try{jsonpatch['apply'](_0x22b7c9,_0x58b026,!![]);}catch(_0x23bfbb){return BPromise[_0x3aa1('0x21')](_0x23bfbb);}return _0x22b7c9[_0x3aa1('0x22')]();};}function saveUpdates(_0x31ba9e,_0x2c87e3){return function(_0x4a4647){if(_0x4a4647){return _0x4a4647[_0x3aa1('0x23')](_0x31ba9e)[_0x3aa1('0x24')](function(_0x3d69b2){return _0x3d69b2;});}return null;};}function removeEntity(_0x35bb69,_0x4ee962){return function(_0x5bf926){if(_0x5bf926){return _0x5bf926[_0x3aa1('0x25')]()['then'](function(){_0x35bb69[_0x3aa1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2113,_0x307161){return function(_0x28758e){if(!_0x28758e){_0x3a2113[_0x3aa1('0x26')](0x194);}return _0x28758e;};}function handleError(_0x5efd75,_0x9727f5){_0x9727f5=_0x9727f5||0x1f4;return function(_0x22707b){logger[_0x3aa1('0x27')](_0x22707b[_0x3aa1('0x28')]);if(_0x22707b['name']){delete _0x22707b[_0x3aa1('0x29')];}_0x5efd75[_0x3aa1('0x18')](_0x9727f5)['send'](_0x22707b);};}exports[_0x3aa1('0x2a')]=function(_0x5a4442,_0x2567e6){var _0x57b7ec={},_0x26af50={},_0x54db2a={'count':0x0,'rows':[]};var _0x5ce255=_['map'](db[_0x3aa1('0x2b')]['rawAttributes'],function(_0x385c0e){return{'name':_0x385c0e[_0x3aa1('0x2c')],'type':_0x385c0e[_0x3aa1('0x2d')][_0x3aa1('0x2e')]};});_0x26af50[_0x3aa1('0x2f')]=_[_0x3aa1('0x30')](_0x5ce255,'name');_0x26af50['query']=_[_0x3aa1('0x31')](_0x5a4442['query']);_0x26af50[_0x3aa1('0x32')]=_[_0x3aa1('0x33')](_0x26af50['model'],_0x26af50[_0x3aa1('0x34')]);_0x57b7ec['attributes']=_[_0x3aa1('0x33')](_0x26af50[_0x3aa1('0x2f')],qs[_0x3aa1('0x35')](_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x35')]));_0x57b7ec['attributes']=_0x57b7ec['attributes'][_0x3aa1('0x36')]?_0x57b7ec[_0x3aa1('0x37')]:_0x26af50[_0x3aa1('0x2f')];if(!_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x38')](_0x3aa1('0x39'))){_0x57b7ec[_0x3aa1('0x1d')]=qs[_0x3aa1('0x1d')](_0x5a4442['query']['limit']);_0x57b7ec['offset']=qs[_0x3aa1('0x1b')](_0x5a4442[_0x3aa1('0x34')]['offset']);}_0x57b7ec[_0x3aa1('0x3a')]=qs[_0x3aa1('0x3b')](_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x3b')]);_0x57b7ec['where']=qs['filters'](_[_0x3aa1('0x3c')](_0x5a4442[_0x3aa1('0x34')],_0x26af50['filters']),_0x5ce255);if(_0x5a4442['query'][_0x3aa1('0x3d')]){_0x57b7ec['where']=_[_0x3aa1('0x3e')](_0x57b7ec[_0x3aa1('0x3f')],{'$or':_[_0x3aa1('0x30')](_0x5ce255,function(_0x1118e7){if(_0x1118e7[_0x3aa1('0x2d')]!==_0x3aa1('0x40')){var _0x49c9a3={};_0x49c9a3[_0x1118e7[_0x3aa1('0x29')]]={'$like':'%'+_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x3d')]+'%'};return _0x49c9a3;}})});}_0x57b7ec=_[_0x3aa1('0x3e')]({},_0x57b7ec,_0x5a4442[_0x3aa1('0x41')]);var _0x3bd32e={'where':_0x57b7ec['where']};return db[_0x3aa1('0x2b')][_0x3aa1('0x1e')](_0x3bd32e)[_0x3aa1('0x24')](function(_0x206a32){_0x54db2a[_0x3aa1('0x1e')]=_0x206a32;if(_0x5a4442[_0x3aa1('0x34')]['includeAll']){_0x57b7ec[_0x3aa1('0x42')]=[{'all':!![]}];}return db[_0x3aa1('0x2b')][_0x3aa1('0x43')](_0x57b7ec);})['then'](function(_0x3028e6){_0x54db2a[_0x3aa1('0x44')]=_0x3028e6;return _0x54db2a;})['then'](respondWithFilteredResult(_0x2567e6,_0x57b7ec))['catch'](handleError(_0x2567e6,null));};exports[_0x3aa1('0x45')]=function(_0x29cda5,_0x38b88d){var _0x1a15fd={'raw':!![],'where':{'id':_0x29cda5[_0x3aa1('0x46')]['id']}},_0x17ba4a={};_0x17ba4a[_0x3aa1('0x2f')]=_[_0x3aa1('0x31')](db[_0x3aa1('0x2b')][_0x3aa1('0x47')]);_0x17ba4a[_0x3aa1('0x34')]=_[_0x3aa1('0x31')](_0x29cda5[_0x3aa1('0x34')]);_0x17ba4a[_0x3aa1('0x32')]=_[_0x3aa1('0x33')](_0x17ba4a[_0x3aa1('0x2f')],_0x17ba4a[_0x3aa1('0x34')]);_0x1a15fd[_0x3aa1('0x37')]=_[_0x3aa1('0x33')](_0x17ba4a[_0x3aa1('0x2f')],qs[_0x3aa1('0x35')](_0x29cda5['query'][_0x3aa1('0x35')]));_0x1a15fd['attributes']=_0x1a15fd[_0x3aa1('0x37')][_0x3aa1('0x36')]?_0x1a15fd[_0x3aa1('0x37')]:_0x17ba4a[_0x3aa1('0x2f')];if(_0x29cda5[_0x3aa1('0x34')]['includeAll']){_0x1a15fd['include']=[{'all':!![]}];}_0x1a15fd=_[_0x3aa1('0x3e')]({},_0x1a15fd,_0x29cda5[_0x3aa1('0x41')]);return db[_0x3aa1('0x2b')]['find'](_0x1a15fd)[_0x3aa1('0x24')](handleEntityNotFound(_0x38b88d,null))[_0x3aa1('0x24')](respondWithResult(_0x38b88d,null))['catch'](handleError(_0x38b88d,null));};exports[_0x3aa1('0x48')]=function(_0x2c2080,_0x3fa7e2){return db[_0x3aa1('0x2b')]['create'](_0x2c2080[_0x3aa1('0x49')],{})[_0x3aa1('0x24')](respondWithResult(_0x3fa7e2,0xc9))['catch'](handleError(_0x3fa7e2,null));};exports[_0x3aa1('0x23')]=function(_0x5f72fd,_0x410a89){if(_0x5f72fd['body']['id']){delete _0x5f72fd['body']['id'];}return db['AnalyticTreeReport'][_0x3aa1('0x4a')]({'where':{'id':_0x5f72fd['params']['id']}})[_0x3aa1('0x24')](handleEntityNotFound(_0x410a89,null))['then'](saveUpdates(_0x5f72fd[_0x3aa1('0x49')],null))['then'](respondWithResult(_0x410a89,null))['catch'](handleError(_0x410a89,null));};exports['destroy']=function(_0x16d3bd,_0x4fadc4){return db[_0x3aa1('0x2b')]['find']({'where':{'id':_0x16d3bd[_0x3aa1('0x46')]['id']}})[_0x3aa1('0x24')](handleEntityNotFound(_0x4fadc4,null))[_0x3aa1('0x24')](removeEntity(_0x4fadc4,null))['catch'](handleError(_0x4fadc4,null));};
\ No newline at end of file
+var _0x4cf3=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','includeAll','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x275d47,_0x2e98e6){var _0x2e09e2=function(_0x3d46bb){while(--_0x3d46bb){_0x275d47['push'](_0x275d47['shift']());}};_0x2e09e2(++_0x2e98e6);}(_0x4cf3,0x13f));var _0x34cf=function(_0x2a5950,_0x12cadf){_0x2a5950=_0x2a5950-0x0;var _0x1bc546=_0x4cf3[_0x2a5950];return _0x1bc546;};'use strict';var emlformat=require(_0x34cf('0x0'));var rimraf=require(_0x34cf('0x1'));var zipdir=require(_0x34cf('0x2'));var jsonpatch=require(_0x34cf('0x3'));var rp=require(_0x34cf('0x4'));var moment=require(_0x34cf('0x5'));var BPromise=require(_0x34cf('0x6'));var Mustache=require(_0x34cf('0x7'));var util=require(_0x34cf('0x8'));var path=require(_0x34cf('0x9'));var sox=require(_0x34cf('0xa'));var csv=require('to-csv');var ejs=require(_0x34cf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34cf('0xc'));var squel=require(_0x34cf('0xd'));var crypto=require(_0x34cf('0xe'));var jsforce=require(_0x34cf('0xf'));var deskjs=require(_0x34cf('0x10'));var toCsv=require(_0x34cf('0x11'));var querystring=require(_0x34cf('0x12'));var Papa=require(_0x34cf('0x13'));var Redis=require(_0x34cf('0x14'));var authService=require(_0x34cf('0x15'));var qs=require(_0x34cf('0x16'));var as=require(_0x34cf('0x17'));var hardwareService=require(_0x34cf('0x18'));var logger=require(_0x34cf('0x19'))(_0x34cf('0x1a'));var utils=require(_0x34cf('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x34cf('0x1c'));var db=require(_0x34cf('0x1d'))['db'];function respondWithStatusCode(_0xee105d,_0x4cbbeb){_0x4cbbeb=_0x4cbbeb||0xcc;return function(_0x443bd6){if(_0x443bd6){return _0xee105d[_0x34cf('0x1e')](_0x4cbbeb);}return _0xee105d[_0x34cf('0x1f')](_0x4cbbeb)['end']();};}function respondWithResult(_0x631798,_0x251de0){_0x251de0=_0x251de0||0xc8;return function(_0x1e5056){if(_0x1e5056){return _0x631798[_0x34cf('0x1f')](_0x251de0)[_0x34cf('0x20')](_0x1e5056);}};}function respondWithFilteredResult(_0xf79b44,_0xdb1e64){return function(_0x1212e1){if(_0x1212e1){var _0x28086d=typeof _0xdb1e64[_0x34cf('0x21')]==='undefined'&&typeof _0xdb1e64['limit']===_0x34cf('0x22');var _0x4e3380=_0x1212e1[_0x34cf('0x23')];var _0x5ba400=_0x28086d?0x0:_0xdb1e64[_0x34cf('0x21')];var _0x56e976=_0x28086d?_0x1212e1[_0x34cf('0x23')]:_0xdb1e64[_0x34cf('0x21')]+_0xdb1e64['limit'];var _0x146267;if(_0x56e976>=_0x4e3380){_0x56e976=_0x4e3380;_0x146267=0xc8;}else{_0x146267=0xce;}_0xf79b44[_0x34cf('0x1f')](_0x146267);return _0xf79b44[_0x34cf('0x24')](_0x34cf('0x25'),_0x5ba400+'-'+_0x56e976+'/'+_0x4e3380)[_0x34cf('0x20')](_0x1212e1);}return null;};}function patchUpdates(_0x3f47e5){return function(_0x12031b){try{jsonpatch[_0x34cf('0x26')](_0x12031b,_0x3f47e5,!![]);}catch(_0x43cc6f){return BPromise[_0x34cf('0x27')](_0x43cc6f);}return _0x12031b[_0x34cf('0x28')]();};}function saveUpdates(_0x5f5af1,_0x590aae){return function(_0x11cc35){if(_0x11cc35){return _0x11cc35[_0x34cf('0x29')](_0x5f5af1)[_0x34cf('0x2a')](function(_0x94055c){return _0x94055c;});}return null;};}function removeEntity(_0x27ea20,_0x52fd70){return function(_0x3e69f6){if(_0x3e69f6){return _0x3e69f6['destroy']()['then'](function(){_0x27ea20[_0x34cf('0x1f')](0xcc)[_0x34cf('0x2b')]();});}};}function handleEntityNotFound(_0x489cc5,_0x126a6d){return function(_0x3afffb){if(!_0x3afffb){_0x489cc5[_0x34cf('0x1e')](0x194);}return _0x3afffb;};}function handleError(_0x5c8a7e,_0x1888c6){_0x1888c6=_0x1888c6||0x1f4;return function(_0x3bafd6){logger[_0x34cf('0x2c')](_0x3bafd6[_0x34cf('0x2d')]);if(_0x3bafd6[_0x34cf('0x2e')]){delete _0x3bafd6['name'];}_0x5c8a7e['status'](_0x1888c6)['send'](_0x3bafd6);};}exports[_0x34cf('0x2f')]=function(_0x3c241d,_0x41d01a){var _0x514848={},_0x2379ce={},_0x1beb03={'count':0x0,'rows':[]};var _0x531704=_['map'](db[_0x34cf('0x30')][_0x34cf('0x31')],function(_0x559b2e){return{'name':_0x559b2e[_0x34cf('0x32')],'type':_0x559b2e[_0x34cf('0x33')][_0x34cf('0x34')]};});_0x2379ce[_0x34cf('0x35')]=_[_0x34cf('0x36')](_0x531704,_0x34cf('0x2e'));_0x2379ce[_0x34cf('0x37')]=_[_0x34cf('0x38')](_0x3c241d['query']);_0x2379ce[_0x34cf('0x39')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],_0x2379ce['query']);_0x514848[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],qs['fields'](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x514848[_0x34cf('0x3b')]=_0x514848[_0x34cf('0x3b')][_0x34cf('0x3d')]?_0x514848[_0x34cf('0x3b')]:_0x2379ce[_0x34cf('0x35')];if(!_0x3c241d[_0x34cf('0x37')]['hasOwnProperty'](_0x34cf('0x3e'))){_0x514848[_0x34cf('0x3f')]=qs[_0x34cf('0x3f')](_0x3c241d[_0x34cf('0x37')]['limit']);_0x514848[_0x34cf('0x21')]=qs[_0x34cf('0x21')](_0x3c241d['query'][_0x34cf('0x21')]);}_0x514848[_0x34cf('0x40')]=qs[_0x34cf('0x41')](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x41')]);_0x514848[_0x34cf('0x42')]=qs[_0x34cf('0x39')](_[_0x34cf('0x43')](_0x3c241d[_0x34cf('0x37')],_0x2379ce['filters']),_0x531704);if(_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]){_0x514848[_0x34cf('0x42')]=_['merge'](_0x514848[_0x34cf('0x42')],{'$or':_[_0x34cf('0x36')](_0x531704,function(_0x3f4402){if(_0x3f4402[_0x34cf('0x33')]!=='VIRTUAL'){var _0x49a9fd={};_0x49a9fd[_0x3f4402['name']]={'$like':'%'+_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]+'%'};return _0x49a9fd;}})});}_0x514848=_[_0x34cf('0x45')]({},_0x514848,_0x3c241d[_0x34cf('0x46')]);var _0x5634ec={'where':_0x514848[_0x34cf('0x42')]};return db[_0x34cf('0x30')][_0x34cf('0x23')](_0x5634ec)[_0x34cf('0x2a')](function(_0x345dc5){_0x1beb03['count']=_0x345dc5;if(_0x3c241d['query']['includeAll']){_0x514848[_0x34cf('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x514848);})[_0x34cf('0x2a')](function(_0x45c597){_0x1beb03[_0x34cf('0x48')]=_0x45c597;return _0x1beb03;})['then'](respondWithFilteredResult(_0x41d01a,_0x514848))[_0x34cf('0x49')](handleError(_0x41d01a,null));};exports[_0x34cf('0x4a')]=function(_0x327044,_0x16fe28){var _0x36da12={'raw':!![],'where':{'id':_0x327044['params']['id']}},_0x3641aa={};_0x3641aa[_0x34cf('0x35')]=_[_0x34cf('0x38')](db[_0x34cf('0x30')]['rawAttributes']);_0x3641aa['query']=_[_0x34cf('0x38')](_0x327044[_0x34cf('0x37')]);_0x3641aa[_0x34cf('0x39')]=_['intersection'](_0x3641aa[_0x34cf('0x35')],_0x3641aa[_0x34cf('0x37')]);_0x36da12[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x3641aa['model'],qs['fields'](_0x327044[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x36da12['attributes']=_0x36da12['attributes'][_0x34cf('0x3d')]?_0x36da12['attributes']:_0x3641aa['model'];if(_0x327044[_0x34cf('0x37')][_0x34cf('0x4b')]){_0x36da12['include']=[{'all':!![]}];}_0x36da12=_['merge']({},_0x36da12,_0x327044[_0x34cf('0x46')]);return db[_0x34cf('0x30')]['find'](_0x36da12)[_0x34cf('0x2a')](handleEntityNotFound(_0x16fe28,null))[_0x34cf('0x2a')](respondWithResult(_0x16fe28,null))['catch'](handleError(_0x16fe28,null));};exports['create']=function(_0x397b44,_0x472969){return db[_0x34cf('0x30')][_0x34cf('0x4c')](_0x397b44[_0x34cf('0x4d')],{})[_0x34cf('0x2a')](respondWithResult(_0x472969,0xc9))[_0x34cf('0x49')](handleError(_0x472969,null));};exports[_0x34cf('0x29')]=function(_0x14bfdf,_0x198f73){if(_0x14bfdf[_0x34cf('0x4d')]['id']){delete _0x14bfdf[_0x34cf('0x4d')]['id'];}return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x14bfdf[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0x198f73,null))[_0x34cf('0x2a')](saveUpdates(_0x14bfdf[_0x34cf('0x4d')],null))[_0x34cf('0x2a')](respondWithResult(_0x198f73,null))[_0x34cf('0x49')](handleError(_0x198f73,null));};exports[_0x34cf('0x50')]=function(_0x39cc72,_0xac54fb){return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x39cc72[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0xac54fb,null))['then'](removeEntity(_0xac54fb,null))[_0x34cf('0x49')](handleError(_0xac54fb,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7e89565..140423d 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 _0xda8d=['moment','rimraf','./analyticTreeReport.attributes','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x115bf9,_0x5e5adc){var _0x4d8750=function(_0x66e03e){while(--_0x66e03e){_0x115bf9['push'](_0x115bf9['shift']());}};_0x4d8750(++_0x5e5adc);}(_0xda8d,0x74));var _0xdda8=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0xda8d[_0x36e0f6];return _0xc90479;};'use strict';var _=require(_0xdda8('0x0'));var util=require(_0xdda8('0x1'));var logger=require(_0xdda8('0x2'))(_0xdda8('0x3'));var moment=require(_0xdda8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdda8('0x5'));var config=require('../../config/environment');var attributes=require(_0xdda8('0x6'));module['exports']=function(_0xf301be,_0x18cb56){return _0xf301be['define']('AnalyticTreeReport',attributes,{'tableName':_0xdda8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x743c=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x743c,0x14d));var _0xc743=function(_0x8e6768,_0x997aad){_0x8e6768=_0x8e6768-0x0;var _0x4db9e9=_0x743c[_0x8e6768];return _0x4db9e9;};'use strict';var _=require(_0xc743('0x0'));var util=require(_0xc743('0x1'));var logger=require('../../config/logger')(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require(_0xc743('0x4'));var rp=require(_0xc743('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc743('0x6'));var config=require(_0xc743('0x7'));var attributes=require(_0xc743('0x8'));module[_0xc743('0x9')]=function(_0x958b03,_0x521ebf){return _0x958b03[_0xc743('0xa')](_0xc743('0xb'),attributes,{'tableName':_0xc743('0xc'),'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 33ec677..9f06527 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1970ed,_0x122980){var _0x4ae926=function(_0x20f96c){while(--_0x20f96c){_0x1970ed['push'](_0x1970ed['shift']());}};_0x4ae926(++_0x122980);}(_0xdb28,0x106));var _0x8db2=function(_0x61d1c6,_0x9953a2){_0x61d1c6=_0x61d1c6-0x0;var _0x56fd99=_0xdb28[_0x61d1c6];return _0x56fd99;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x18a669,_0x3e97f7){var _0x57cd6f=function(_0x5de55b){while(--_0x5de55b){_0x18a669['push'](_0x18a669['shift']());}};_0x57cd6f(++_0x3e97f7);}(_0xdb28,0x106));var _0x8db2=function(_0x565777,_0x169f59){_0x565777=_0x565777-0x0;var _0x56d505=_0xdb28[_0x565777];return _0x56d505;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 1a5110d..88b64a4 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 _0xd377=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42475f,_0x231ca8){var _0x29d6fb=function(_0x4a8fe3){while(--_0x4a8fe3){_0x42475f['push'](_0x42475f['shift']());}};_0x29d6fb(++_0x231ca8);}(_0xd377,0x150));var _0x7d37=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd377[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7d37('0x0'));var util=require(_0x7d37('0x1'));var path=require(_0x7d37('0x2'));var timeout=require(_0x7d37('0x3'));var express=require(_0x7d37('0x4'));var router=express[_0x7d37('0x5')]();var fs_extra=require(_0x7d37('0x6'));var auth=require(_0x7d37('0x7'));var interaction=require(_0x7d37('0x8'));var config=require(_0x7d37('0x9'));var controller=require(_0x7d37('0xa'));router[_0x7d37('0xb')]('/',auth['isAuthenticated'](),controller[_0x7d37('0xc')]);router[_0x7d37('0xb')](_0x7d37('0xd'),auth[_0x7d37('0xe')](),controller['show']);router[_0x7d37('0xf')]('/',auth[_0x7d37('0xe')](),controller['create']);router[_0x7d37('0x10')](_0x7d37('0xd'),auth[_0x7d37('0xe')](),controller['update']);router[_0x7d37('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7d37('0x12')]=router;
\ No newline at end of file
+var _0x2220=['path','express','Router','fs-extra','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','util'];(function(_0x553dca,_0x3dcc0c){var _0x4ecbdf=function(_0x21e89b){while(--_0x21e89b){_0x553dca['push'](_0x553dca['shift']());}};_0x4ecbdf(++_0x3dcc0c);}(_0x2220,0xdf));var _0x0222=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2220[_0x5f3f88];return _0xd08119;};'use strict';var multer=require('multer');var util=require(_0x0222('0x0'));var path=require(_0x0222('0x1'));var timeout=require('connect-timeout');var express=require(_0x0222('0x2'));var router=express[_0x0222('0x3')]();var fs_extra=require(_0x0222('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x0222('0x5')]('/',auth[_0x0222('0x6')](),controller[_0x0222('0x7')]);router[_0x0222('0x5')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0x8')]);router[_0x0222('0x9')]('/',auth[_0x0222('0x6')](),controller['create']);router[_0x0222('0xa')](_0x0222('0xb'),auth[_0x0222('0x6')](),controller['update']);router[_0x0222('0xc')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0xd')]);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 9d27808..28c3deb 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 _0x9ef8=['exports','STRING','sequelize'];(function(_0xe0e3d0,_0x3eabd9){var _0x4a7f63=function(_0x15754d){while(--_0x15754d){_0xe0e3d0['push'](_0xe0e3d0['shift']());}};_0x4a7f63(++_0x3eabd9);}(_0x9ef8,0x17f));var _0x89ef=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x9ef8[_0x5c6244];return _0x5800ce;};'use strict';var Sequelize=require(_0x89ef('0x0'));module[_0x89ef('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x89ef('0x2')]},'type':{'type':Sequelize[_0x89ef('0x2')]}};
\ No newline at end of file
+var _0x2cc1=['STRING','sequelize','exports'];(function(_0x5a4e76,_0x11f33f){var _0x38b339=function(_0x41bfac){while(--_0x41bfac){_0x5a4e76['push'](_0x5a4e76['shift']());}};_0x38b339(++_0x11f33f);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x31f5ce,_0x379d01){_0x31f5ce=_0x31f5ce-0x0;var _0x156662=_0x2cc1[_0x31f5ce];return _0x156662;};'use strict';var Sequelize=require(_0x12cc('0x0'));module[_0x12cc('0x1')]={'name':{'type':Sequelize[_0x12cc('0x2')]},'basename':{'type':Sequelize[_0x12cc('0x2')]},'type':{'type':Sequelize[_0x12cc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 3f2f97f..aa1ab11 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 _0x8508=['findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','../../config/license/util','end','status','json','offset','count','limit','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','VIRTUAL','options','includeAll','include','Attachment','findAll','rows','catch','show','find','clone','params','rawAttributes','merge','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','download'];(function(_0x394f83,_0xbdc65){var _0x533e74=function(_0x6101e0){while(--_0x6101e0){_0x394f83['push'](_0x394f83['shift']());}};_0x533e74(++_0xbdc65);}(_0x8508,0x165));var _0x8850=function(_0x20dcb9,_0x1018ab){_0x20dcb9=_0x20dcb9-0x0;var _0x3267b1=_0x8508[_0x20dcb9];return _0x3267b1;};'use strict';var emlformat=require(_0x8850('0x0'));var rimraf=require(_0x8850('0x1'));var zipdir=require(_0x8850('0x2'));var jsonpatch=require(_0x8850('0x3'));var rp=require(_0x8850('0x4'));var moment=require(_0x8850('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8850('0x6'));var path=require(_0x8850('0x7'));var sox=require(_0x8850('0x8'));var csv=require(_0x8850('0x9'));var ejs=require(_0x8850('0xa'));var fs=require('fs');var fs_extra=require(_0x8850('0xb'));var _=require(_0x8850('0xc'));var squel=require(_0x8850('0xd'));var crypto=require('crypto');var jsforce=require(_0x8850('0xe'));var deskjs=require(_0x8850('0xf'));var toCsv=require(_0x8850('0x9'));var querystring=require(_0x8850('0x10'));var Papa=require(_0x8850('0x11'));var Redis=require(_0x8850('0x12'));var authService=require(_0x8850('0x13'));var qs=require(_0x8850('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8850('0x15'));var logger=require(_0x8850('0x16'))(_0x8850('0x17'));var utils=require(_0x8850('0x18'));var config=require(_0x8850('0x19'));var licenseUtil=require(_0x8850('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f802,_0x4cfef7){_0x4cfef7=_0x4cfef7||0xcc;return function(_0x467301){if(_0x467301){return _0x14f802['sendStatus'](_0x4cfef7);}return _0x14f802['status'](_0x4cfef7)[_0x8850('0x1b')]();};}function respondWithResult(_0x433fa2,_0x10b63a){_0x10b63a=_0x10b63a||0xc8;return function(_0x511559){if(_0x511559){return _0x433fa2[_0x8850('0x1c')](_0x10b63a)[_0x8850('0x1d')](_0x511559);}};}function respondWithFilteredResult(_0x3e94c6,_0x2a4575){return function(_0x52df25){if(_0x52df25){var _0x4f9459=typeof _0x2a4575[_0x8850('0x1e')]==='undefined'&&typeof _0x2a4575['limit']==='undefined';var _0x52f1b5=_0x52df25[_0x8850('0x1f')];var _0x2b065f=_0x4f9459?0x0:_0x2a4575[_0x8850('0x1e')];var _0x3b3db7=_0x4f9459?_0x52df25[_0x8850('0x1f')]:_0x2a4575[_0x8850('0x1e')]+_0x2a4575[_0x8850('0x20')];var _0xa08d92;if(_0x3b3db7>=_0x52f1b5){_0x3b3db7=_0x52f1b5;_0xa08d92=0xc8;}else{_0xa08d92=0xce;}_0x3e94c6[_0x8850('0x1c')](_0xa08d92);return _0x3e94c6['set']('Content-Range',_0x2b065f+'-'+_0x3b3db7+'/'+_0x52f1b5)['json'](_0x52df25);}return null;};}function patchUpdates(_0x4cdf9b){return function(_0x37cd01){try{jsonpatch['apply'](_0x37cd01,_0x4cdf9b,!![]);}catch(_0x5a97ff){return BPromise['reject'](_0x5a97ff);}return _0x37cd01[_0x8850('0x21')]();};}function saveUpdates(_0x5615f7,_0x47ccb0){return function(_0x3aa1bd){if(_0x3aa1bd){return _0x3aa1bd[_0x8850('0x22')](_0x5615f7)[_0x8850('0x23')](function(_0x4f2d2f){return _0x4f2d2f;});}return null;};}function removeEntity(_0x41fa30,_0x356d27){return function(_0x3e1f3e){if(_0x3e1f3e){return _0x3e1f3e[_0x8850('0x24')]()['then'](function(){_0x41fa30[_0x8850('0x1c')](0xcc)[_0x8850('0x1b')]();});}};}function handleEntityNotFound(_0x5a4fbe,_0xd91635){return function(_0x120a18){if(!_0x120a18){_0x5a4fbe[_0x8850('0x25')](0x194);}return _0x120a18;};}function handleError(_0x4c415f,_0x56045f){_0x56045f=_0x56045f||0x1f4;return function(_0x353792){logger[_0x8850('0x26')](_0x353792['stack']);if(_0x353792[_0x8850('0x27')]){delete _0x353792[_0x8850('0x27')];}_0x4c415f['status'](_0x56045f)[_0x8850('0x28')](_0x353792);};}exports[_0x8850('0x29')]=function(_0x344f8b,_0x246ae6){var _0xf8d9a3={},_0x29fbf9={},_0x4d9ca3={'count':0x0,'rows':[]};var _0x4d11c3=_[_0x8850('0x2a')](db['Attachment']['rawAttributes'],function(_0x27b1e4){return{'name':_0x27b1e4[_0x8850('0x2b')],'type':_0x27b1e4[_0x8850('0x2c')][_0x8850('0x2d')]};});_0x29fbf9[_0x8850('0x2e')]=_[_0x8850('0x2a')](_0x4d11c3,_0x8850('0x27'));_0x29fbf9[_0x8850('0x2f')]=_[_0x8850('0x30')](_0x344f8b[_0x8850('0x2f')]);_0x29fbf9['filters']=_[_0x8850('0x31')](_0x29fbf9[_0x8850('0x2e')],_0x29fbf9[_0x8850('0x2f')]);_0xf8d9a3[_0x8850('0x32')]=_[_0x8850('0x31')](_0x29fbf9['model'],qs[_0x8850('0x33')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x33')]));_0xf8d9a3[_0x8850('0x32')]=_0xf8d9a3[_0x8850('0x32')][_0x8850('0x34')]?_0xf8d9a3[_0x8850('0x32')]:_0x29fbf9[_0x8850('0x2e')];if(!_0x344f8b[_0x8850('0x2f')]['hasOwnProperty'](_0x8850('0x35'))){_0xf8d9a3[_0x8850('0x20')]=qs[_0x8850('0x20')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x20')]);_0xf8d9a3[_0x8850('0x1e')]=qs[_0x8850('0x1e')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x1e')]);}_0xf8d9a3['order']=qs[_0x8850('0x36')](_0x344f8b[_0x8850('0x2f')]['sort']);_0xf8d9a3[_0x8850('0x37')]=qs[_0x8850('0x38')](_['pick'](_0x344f8b[_0x8850('0x2f')],_0x29fbf9['filters']),_0x4d11c3);if(_0x344f8b[_0x8850('0x2f')]['filter']){_0xf8d9a3[_0x8850('0x37')]=_['merge'](_0xf8d9a3[_0x8850('0x37')],{'$or':_[_0x8850('0x2a')](_0x4d11c3,function(_0x414621){if(_0x414621[_0x8850('0x2c')]!==_0x8850('0x39')){var _0x89fa8e={};_0x89fa8e[_0x414621['name']]={'$like':'%'+_0x344f8b['query']['filter']+'%'};return _0x89fa8e;}})});}_0xf8d9a3=_['merge']({},_0xf8d9a3,_0x344f8b[_0x8850('0x3a')]);var _0x4e3857={'where':_0xf8d9a3[_0x8850('0x37')]};return db['Attachment'][_0x8850('0x1f')](_0x4e3857)[_0x8850('0x23')](function(_0x1c1e05){_0x4d9ca3['count']=_0x1c1e05;if(_0x344f8b['query'][_0x8850('0x3b')]){_0xf8d9a3[_0x8850('0x3c')]=[{'all':!![]}];}return db[_0x8850('0x3d')][_0x8850('0x3e')](_0xf8d9a3);})[_0x8850('0x23')](function(_0x15477f){_0x4d9ca3[_0x8850('0x3f')]=_0x15477f;return _0x4d9ca3;})[_0x8850('0x23')](respondWithFilteredResult(_0x246ae6,_0xf8d9a3))[_0x8850('0x40')](handleError(_0x246ae6,null));};exports[_0x8850('0x41')]=function(_0x30880e,_0x49f243){var _0x5780ad={'raw':!![],'where':{'id':_0x30880e['params']['id']}},_0x418170={};_0x418170[_0x8850('0x2e')]=_[_0x8850('0x30')](db[_0x8850('0x3d')]['rawAttributes']);_0x418170[_0x8850('0x2f')]=_['keys'](_0x30880e[_0x8850('0x2f')]);_0x418170[_0x8850('0x38')]=_[_0x8850('0x31')](_0x418170[_0x8850('0x2e')],_0x418170[_0x8850('0x2f')]);_0x5780ad['attributes']=_[_0x8850('0x31')](_0x418170[_0x8850('0x2e')],qs[_0x8850('0x33')](_0x30880e['query'][_0x8850('0x33')]));_0x5780ad[_0x8850('0x32')]=_0x5780ad[_0x8850('0x32')][_0x8850('0x34')]?_0x5780ad[_0x8850('0x32')]:_0x418170[_0x8850('0x2e')];if(_0x30880e[_0x8850('0x2f')]['includeAll']){_0x5780ad[_0x8850('0x3c')]=[{'all':!![]}];}_0x5780ad=_['merge']({},_0x5780ad,_0x30880e['options']);return db[_0x8850('0x3d')][_0x8850('0x42')](_0x5780ad)[_0x8850('0x23')](handleEntityNotFound(_0x49f243,null))[_0x8850('0x23')](respondWithResult(_0x49f243,null))[_0x8850('0x40')](handleError(_0x49f243,null));};exports[_0x8850('0x43')]=function(_0x491b2e,_0x49d189){var _0x174b17={'where':{'id':_0x491b2e[_0x8850('0x44')]['id']}},_0x37133c={};_0x37133c[_0x8850('0x2e')]=_['keys'](db[_0x8850('0x3d')][_0x8850('0x45')]);_0x174b17[_0x8850('0x32')]=_[_0x8850('0x31')](_0x37133c[_0x8850('0x2e')],qs[_0x8850('0x33')](_0x491b2e[_0x8850('0x2f')][_0x8850('0x33')]));_0x174b17[_0x8850('0x32')]=_0x174b17[_0x8850('0x32')][_0x8850('0x34')]?_0x174b17[_0x8850('0x32')]:_0x37133c[_0x8850('0x2e')];if(_0x491b2e[_0x8850('0x2f')][_0x8850('0x3b')]){_0x174b17[_0x8850('0x3c')]=[{'all':!![]}];}_0x174b17=_[_0x8850('0x46')]({},_0x174b17,_0x491b2e[_0x8850('0x3a')]);return db['Attachment'][_0x8850('0x42')](_0x174b17)[_0x8850('0x23')](handleEntityNotFound(_0x49d189,null))[_0x8850('0x23')](function(_0xbb5c9d){if(_0xbb5c9d){var _0x273190=_0xbb5c9d[_0x8850('0x47')]({'plain':!![]});_0x273190=qs[_0x8850('0x48')](_0x273190,['id',_0x8850('0x49'),'updatedAt']);_0x491b2e[_0x8850('0x4a')]=_[_0x8850('0x48')](_0x491b2e[_0x8850('0x4a')],['id',_0x8850('0x49'),_0x8850('0x4b')]);return db[_0x8850('0x3d')]['create'](_['merge'](_0x273190,_0x491b2e[_0x8850('0x4a')]),{'include':_0x491b2e[_0x8850('0x2f')][_0x8850('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x49d189,0xc9))['catch'](handleError(_0x49d189,null));};exports[_0x8850('0x22')]=function(_0x3eb4dd,_0x190cba){if(_0x3eb4dd[_0x8850('0x4a')]['id']){delete _0x3eb4dd[_0x8850('0x4a')]['id'];}return db[_0x8850('0x3d')][_0x8850('0x42')]({'where':{'id':_0x3eb4dd['params']['id']}})['then'](handleEntityNotFound(_0x190cba,null))[_0x8850('0x23')](saveUpdates(_0x3eb4dd[_0x8850('0x4a')],null))[_0x8850('0x23')](respondWithResult(_0x190cba,null))[_0x8850('0x40')](handleError(_0x190cba,null));};exports[_0x8850('0x24')]=function(_0x1d1616,_0x3bc92f){return db[_0x8850('0x3d')][_0x8850('0x42')]({'where':{'id':_0x1d1616[_0x8850('0x44')]['id']}})[_0x8850('0x23')](handleEntityNotFound(_0x3bc92f,null))['then'](removeEntity(_0x3bc92f,null))[_0x8850('0x40')](handleError(_0x3bc92f,null));};exports[_0x8850('0x4c')]=function(_0x32ea7c,_0x3d7839,_0xb1b154){_0x32ea7c[_0x8850('0x4a')][_0x8850('0x27')]=_0x32ea7c[_0x8850('0x4d')][_0x8850('0x4e')];_0x32ea7c['body'][_0x8850('0x4f')]=_0x32ea7c['file'][_0x8850('0x50')];_0x32ea7c[_0x8850('0x4a')][_0x8850('0x2c')]=_0x32ea7c[_0x8850('0x4d')][_0x8850('0x51')];return db[_0x8850('0x3d')][_0x8850('0x4c')](_0x32ea7c['body'])[_0x8850('0x23')](respondWithResult(_0x3d7839,0xc9))[_0x8850('0x40')](handleError(_0x3d7839,null));};exports[_0x8850('0x52')]=function(_0x143624,_0x348c94,_0x134d9){return db['Attachment'][_0x8850('0x53')]({'where':{'id':_0x143624['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x348c94,null))[_0x8850('0x23')](function(_0xe01287){if(_0xe01287){var _0x14c492=_0xe01287[_0x8850('0x54')]!==null;var _0x18681d=path[_0x8850('0x55')](config['root'],_0x8850('0x56'));if(_0x14c492){_0x18681d=path['join'](_0x18681d,_0x8850('0x57'));}var _0x105e34=path['join'](_0x18681d,_0xe01287[_0x8850('0x4f')]);return _0x348c94[_0x8850('0x52')](_0x105e34);}})[_0x8850('0x40')](handleError(_0x348c94,null));};
\ No newline at end of file
+var _0x490c=['clone','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','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','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x490c,0x11c));var _0xc490=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x490c[_0x58f245];return _0x1f0cfb;};'use strict';var emlformat=require(_0xc490('0x0'));var rimraf=require(_0xc490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc490('0x2'));var rp=require(_0xc490('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc490('0x4'));var util=require(_0xc490('0x5'));var path=require('path');var sox=require(_0xc490('0x6'));var csv=require(_0xc490('0x7'));var ejs=require(_0xc490('0x8'));var fs=require('fs');var fs_extra=require(_0xc490('0x9'));var _=require(_0xc490('0xa'));var squel=require(_0xc490('0xb'));var crypto=require(_0xc490('0xc'));var jsforce=require(_0xc490('0xd'));var deskjs=require(_0xc490('0xe'));var toCsv=require(_0xc490('0x7'));var querystring=require(_0xc490('0xf'));var Papa=require('papaparse');var Redis=require(_0xc490('0x10'));var authService=require(_0xc490('0x11'));var qs=require(_0xc490('0x12'));var as=require(_0xc490('0x13'));var hardwareService=require(_0xc490('0x14'));var logger=require('../../config/logger')(_0xc490('0x15'));var utils=require('../../config/utils');var config=require(_0xc490('0x16'));var licenseUtil=require(_0xc490('0x17'));var db=require(_0xc490('0x18'))['db'];function respondWithStatusCode(_0x13d053,_0x1239c9){_0x1239c9=_0x1239c9||0xcc;return function(_0x19a16a){if(_0x19a16a){return _0x13d053['sendStatus'](_0x1239c9);}return _0x13d053[_0xc490('0x19')](_0x1239c9)[_0xc490('0x1a')]();};}function respondWithResult(_0x259221,_0x11b794){_0x11b794=_0x11b794||0xc8;return function(_0x572e8e){if(_0x572e8e){return _0x259221[_0xc490('0x19')](_0x11b794)[_0xc490('0x1b')](_0x572e8e);}};}function respondWithFilteredResult(_0x18e5d4,_0x241ff3){return function(_0x35e024){if(_0x35e024){var _0x4a9bbf=typeof _0x241ff3[_0xc490('0x1c')]===_0xc490('0x1d')&&typeof _0x241ff3['limit']===_0xc490('0x1d');var _0x19c66d=_0x35e024[_0xc490('0x1e')];var _0x372dca=_0x4a9bbf?0x0:_0x241ff3['offset'];var _0x2ca73a=_0x4a9bbf?_0x35e024[_0xc490('0x1e')]:_0x241ff3['offset']+_0x241ff3[_0xc490('0x1f')];var _0x5f52b5;if(_0x2ca73a>=_0x19c66d){_0x2ca73a=_0x19c66d;_0x5f52b5=0xc8;}else{_0x5f52b5=0xce;}_0x18e5d4[_0xc490('0x19')](_0x5f52b5);return _0x18e5d4[_0xc490('0x20')](_0xc490('0x21'),_0x372dca+'-'+_0x2ca73a+'/'+_0x19c66d)[_0xc490('0x1b')](_0x35e024);}return null;};}function patchUpdates(_0x4eebc0){return function(_0x4fa1c5){try{jsonpatch[_0xc490('0x22')](_0x4fa1c5,_0x4eebc0,!![]);}catch(_0x54a37f){return BPromise[_0xc490('0x23')](_0x54a37f);}return _0x4fa1c5['save']();};}function saveUpdates(_0x3d5c17,_0x5db2f9){return function(_0x315445){if(_0x315445){return _0x315445[_0xc490('0x24')](_0x3d5c17)[_0xc490('0x25')](function(_0x5e24c1){return _0x5e24c1;});}return null;};}function removeEntity(_0x3b5891,_0x50030d){return function(_0x333030){if(_0x333030){return _0x333030[_0xc490('0x26')]()['then'](function(){_0x3b5891[_0xc490('0x19')](0xcc)[_0xc490('0x1a')]();});}};}function handleEntityNotFound(_0x1146fd,_0x17f80b){return function(_0x3c64c3){if(!_0x3c64c3){_0x1146fd[_0xc490('0x27')](0x194);}return _0x3c64c3;};}function handleError(_0x1bc904,_0x20aa0d){_0x20aa0d=_0x20aa0d||0x1f4;return function(_0x51430a){logger[_0xc490('0x28')](_0x51430a[_0xc490('0x29')]);if(_0x51430a['name']){delete _0x51430a[_0xc490('0x2a')];}_0x1bc904[_0xc490('0x19')](_0x20aa0d)['send'](_0x51430a);};}exports[_0xc490('0x2b')]=function(_0x3ea7a2,_0x25a007){var _0x45cb07={},_0x46c13f={},_0x382ebb={'count':0x0,'rows':[]};var _0x27587b=_[_0xc490('0x2c')](db[_0xc490('0x2d')][_0xc490('0x2e')],function(_0x37f80c){return{'name':_0x37f80c[_0xc490('0x2f')],'type':_0x37f80c[_0xc490('0x30')][_0xc490('0x31')]};});_0x46c13f[_0xc490('0x32')]=_[_0xc490('0x2c')](_0x27587b,_0xc490('0x2a'));_0x46c13f['query']=_[_0xc490('0x33')](_0x3ea7a2[_0xc490('0x34')]);_0x46c13f['filters']=_['intersection'](_0x46c13f[_0xc490('0x32')],_0x46c13f[_0xc490('0x34')]);_0x45cb07[_0xc490('0x35')]=_[_0xc490('0x36')](_0x46c13f[_0xc490('0x32')],qs[_0xc490('0x37')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x37')]));_0x45cb07[_0xc490('0x35')]=_0x45cb07[_0xc490('0x35')][_0xc490('0x38')]?_0x45cb07['attributes']:_0x46c13f['model'];if(!_0x3ea7a2[_0xc490('0x34')][_0xc490('0x39')]('nolimit')){_0x45cb07[_0xc490('0x1f')]=qs['limit'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1f')]);_0x45cb07[_0xc490('0x1c')]=qs['offset'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1c')]);}_0x45cb07[_0xc490('0x3a')]=qs[_0xc490('0x3b')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3b')]);_0x45cb07[_0xc490('0x3c')]=qs[_0xc490('0x3d')](_['pick'](_0x3ea7a2[_0xc490('0x34')],_0x46c13f[_0xc490('0x3d')]),_0x27587b);if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3e')]){_0x45cb07[_0xc490('0x3c')]=_[_0xc490('0x3f')](_0x45cb07[_0xc490('0x3c')],{'$or':_[_0xc490('0x2c')](_0x27587b,function(_0x4516f3){if(_0x4516f3['type']!==_0xc490('0x40')){var _0x5930a7={};_0x5930a7[_0x4516f3[_0xc490('0x2a')]]={'$like':'%'+_0x3ea7a2['query'][_0xc490('0x3e')]+'%'};return _0x5930a7;}})});}_0x45cb07=_[_0xc490('0x3f')]({},_0x45cb07,_0x3ea7a2[_0xc490('0x41')]);var _0x5ac065={'where':_0x45cb07[_0xc490('0x3c')]};return db[_0xc490('0x2d')][_0xc490('0x1e')](_0x5ac065)[_0xc490('0x25')](function(_0x381d0f){_0x382ebb[_0xc490('0x1e')]=_0x381d0f;if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x42')]){_0x45cb07['include']=[{'all':!![]}];}return db[_0xc490('0x2d')]['findAll'](_0x45cb07);})[_0xc490('0x25')](function(_0x48ba3f){_0x382ebb[_0xc490('0x43')]=_0x48ba3f;return _0x382ebb;})[_0xc490('0x25')](respondWithFilteredResult(_0x25a007,_0x45cb07))[_0xc490('0x44')](handleError(_0x25a007,null));};exports['show']=function(_0x1b9637,_0x93ebbe){var _0x588fce={'raw':!![],'where':{'id':_0x1b9637[_0xc490('0x45')]['id']}},_0xd8c8ed={};_0xd8c8ed['model']=_[_0xc490('0x33')](db[_0xc490('0x2d')]['rawAttributes']);_0xd8c8ed['query']=_[_0xc490('0x33')](_0x1b9637['query']);_0xd8c8ed[_0xc490('0x3d')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],_0xd8c8ed[_0xc490('0x34')]);_0x588fce[_0xc490('0x35')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1b9637['query']['fields']));_0x588fce[_0xc490('0x35')]=_0x588fce[_0xc490('0x35')][_0xc490('0x38')]?_0x588fce['attributes']:_0xd8c8ed[_0xc490('0x32')];if(_0x1b9637[_0xc490('0x34')][_0xc490('0x42')]){_0x588fce[_0xc490('0x46')]=[{'all':!![]}];}_0x588fce=_['merge']({},_0x588fce,_0x1b9637[_0xc490('0x41')]);return db[_0xc490('0x2d')][_0xc490('0x47')](_0x588fce)['then'](handleEntityNotFound(_0x93ebbe,null))[_0xc490('0x25')](respondWithResult(_0x93ebbe,null))[_0xc490('0x44')](handleError(_0x93ebbe,null));};exports[_0xc490('0x48')]=function(_0x1777e0,_0x31d7c4){var _0x232df8={'where':{'id':_0x1777e0[_0xc490('0x45')]['id']}},_0x3025ea={};_0x3025ea[_0xc490('0x32')]=_[_0xc490('0x33')](db[_0xc490('0x2d')][_0xc490('0x2e')]);_0x232df8['attributes']=_[_0xc490('0x36')](_0x3025ea[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1777e0[_0xc490('0x34')][_0xc490('0x37')]));_0x232df8[_0xc490('0x35')]=_0x232df8['attributes'][_0xc490('0x38')]?_0x232df8[_0xc490('0x35')]:_0x3025ea['model'];if(_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]){_0x232df8[_0xc490('0x46')]=[{'all':!![]}];}_0x232df8=_['merge']({},_0x232df8,_0x1777e0[_0xc490('0x41')]);return db[_0xc490('0x2d')]['find'](_0x232df8)[_0xc490('0x25')](handleEntityNotFound(_0x31d7c4,null))['then'](function(_0x2bc600){if(_0x2bc600){var _0x26523a=_0x2bc600[_0xc490('0x49')]({'plain':!![]});_0x26523a=qs['omit'](_0x26523a,['id',_0xc490('0x4a'),_0xc490('0x4b')]);_0x1777e0[_0xc490('0x4c')]=_[_0xc490('0x4d')](_0x1777e0['body'],['id',_0xc490('0x4a'),_0xc490('0x4b')]);return db['Attachment'][_0xc490('0x4e')](_[_0xc490('0x3f')](_0x26523a,_0x1777e0[_0xc490('0x4c')]),{'include':_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]?[{'all':!![]}]:undefined});}})[_0xc490('0x25')](respondWithResult(_0x31d7c4,0xc9))[_0xc490('0x44')](handleError(_0x31d7c4,null));};exports[_0xc490('0x24')]=function(_0x1d1432,_0xb71699){if(_0x1d1432[_0xc490('0x4c')]['id']){delete _0x1d1432[_0xc490('0x4c')]['id'];}return db[_0xc490('0x2d')]['find']({'where':{'id':_0x1d1432['params']['id']}})[_0xc490('0x25')](handleEntityNotFound(_0xb71699,null))[_0xc490('0x25')](saveUpdates(_0x1d1432['body'],null))['then'](respondWithResult(_0xb71699,null))[_0xc490('0x44')](handleError(_0xb71699,null));};exports[_0xc490('0x26')]=function(_0x3b09ae,_0x51ba3e){return db[_0xc490('0x2d')][_0xc490('0x47')]({'where':{'id':_0x3b09ae[_0xc490('0x45')]['id']}})[_0xc490('0x25')](handleEntityNotFound(_0x51ba3e,null))[_0xc490('0x25')](removeEntity(_0x51ba3e,null))[_0xc490('0x44')](handleError(_0x51ba3e,null));};exports[_0xc490('0x4e')]=function(_0x275937,_0x735f56,_0x358ad4){_0x275937[_0xc490('0x4c')][_0xc490('0x2a')]=_0x275937[_0xc490('0x4f')][_0xc490('0x50')];_0x275937[_0xc490('0x4c')][_0xc490('0x51')]=_0x275937[_0xc490('0x4f')][_0xc490('0x52')];_0x275937['body'][_0xc490('0x30')]=_0x275937['file']['mimetype'];return db['Attachment'][_0xc490('0x4e')](_0x275937[_0xc490('0x4c')])[_0xc490('0x25')](respondWithResult(_0x735f56,0xc9))[_0xc490('0x44')](handleError(_0x735f56,null));};exports[_0xc490('0x53')]=function(_0x1c8f8a,_0x3150a4,_0x2d9a07){return db[_0xc490('0x2d')][_0xc490('0x54')]({'where':{'id':_0x1c8f8a[_0xc490('0x45')]['id']},'raw':!![]})[_0xc490('0x25')](handleEntityNotFound(_0x3150a4,null))[_0xc490('0x25')](function(_0x35aa66){if(_0x35aa66){var _0x426998=_0x35aa66[_0xc490('0x55')]!==null;var _0x1d6fdd=path[_0xc490('0x56')](config[_0xc490('0x57')],_0xc490('0x58'));if(_0x426998){_0x1d6fdd=path[_0xc490('0x56')](_0x1d6fdd,'offline-chat/');}var _0x5b72ac=path['join'](_0x1d6fdd,_0x35aa66[_0xc490('0x51')]);return _0x3150a4['download'](_0x5b72ac);}})[_0xc490('0x44')](handleError(_0x3150a4,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 06d0577..49a5534 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 _0x7939=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./attachment.attributes','define'];(function(_0x194e91,_0x42d67f){var _0x39a718=function(_0x598b6f){while(--_0x598b6f){_0x194e91['push'](_0x194e91['shift']());}};_0x39a718(++_0x42d67f);}(_0x7939,0x65));var _0x9793=function(_0x684285,_0x4f2315){_0x684285=_0x684285-0x0;var _0x215e4c=_0x7939[_0x684285];return _0x215e4c;};'use strict';var _=require(_0x9793('0x0'));var util=require(_0x9793('0x1'));var logger=require(_0x9793('0x2'))('api');var moment=require(_0x9793('0x3'));var BPromise=require(_0x9793('0x4'));var rp=require(_0x9793('0x5'));var fs=require('fs');var path=require(_0x9793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9793('0x7'));module['exports']=function(_0xe5d727,_0x34d8ea){return _0xe5d727[_0x9793('0x8')](_0x9793('0x9'),attributes,{'tableName':_0x9793('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x233b=['rimraf','../../config/environment','./attachment.attributes','exports','define','../../config/logger','api','moment','bluebird','path'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x233b,0x1a9));var _0xb233=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x233b[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb233('0x0'))(_0xb233('0x1'));var moment=require(_0xb233('0x2'));var BPromise=require(_0xb233('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb233('0x4'));var rimraf=require(_0xb233('0x5'));var config=require(_0xb233('0x6'));var attributes=require(_0xb233('0x7'));module[_0xb233('0x8')]=function(_0x45fdc9,_0x49a7fa){return _0x45fdc9[_0xb233('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 631b5fd..f430c54 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 _0xaa7c=['debug','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x34e36e,_0x331372){var _0x3d2b23=function(_0x222ceb){while(--_0x222ceb){_0x34e36e['push'](_0x34e36e['shift']());}};_0x3d2b23(++_0x331372);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x53bf95,_0xee0a50){_0x53bf95=_0x53bf95-0x0;var _0xead38f=_0xaa7c[_0x53bf95];return _0xead38f;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaa7('0x3'))(_0xcaa7('0x4'));var config=require(_0xcaa7('0x5'));var jayson=require(_0xcaa7('0x6'));var client=jayson[_0xcaa7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9df0,_0x5bd940,_0x55f6a4){return new BPromise(function(_0x4e4fc1,_0x126043){return client[_0xcaa7('0x8')](_0x4b9df0,_0x55f6a4)['then'](function(_0x20cd40){logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));logger[_0xcaa7('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5bd940,_0xcaa7('0xb'),JSON[_0xcaa7('0xd')](_0x20cd40));if(_0x20cd40[_0xcaa7('0xe')]){if(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0xf')]===0x1f4){logger[_0xcaa7('0xe')]('Attachment,\x20%s,\x20%s',_0x5bd940,_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);return _0x126043(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);}logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x20cd40[_0xcaa7('0xe')]['message']);return _0x4e4fc1(_0x20cd40['error'][_0xcaa7('0x10')]);}else{logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));_0x4e4fc1(_0x20cd40['result'][_0xcaa7('0x10')]);}})[_0xcaa7('0x11')](function(_0x23c8f3){logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x23c8f3);_0x126043(_0x23c8f3);});});}exports[_0xcaa7('0x12')]=function(_0x20ede0){var _0x5c2a74=this;return new Promise(function(_0x53e1cb,_0x4309e0){return db[_0xcaa7('0x13')][_0xcaa7('0x14')](_0x20ede0[_0xcaa7('0x15')],{'raw':_0x20ede0[_0xcaa7('0x16')]?_0x20ede0[_0xcaa7('0x16')][_0xcaa7('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x89e8a0){logger[_0xcaa7('0x9')](_0xcaa7('0x12'),_0x20ede0);logger[_0xcaa7('0xc')](_0xcaa7('0x12'),_0x20ede0,JSON[_0xcaa7('0xd')](_0x89e8a0));_0x53e1cb(_0x89e8a0);})[_0xcaa7('0x11')](function(_0x4259b7){logger[_0xcaa7('0xe')](_0xcaa7('0x12'),_0x4259b7[_0xcaa7('0x10')],_0x20ede0);_0x4309e0(_0x5c2a74[_0xcaa7('0xe')](0x1f4,_0x4259b7[_0xcaa7('0x10')]));});});};
\ No newline at end of file
+var _0x032a=['result','catch','CreateAttachment','Attachment','create','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x032a,0xf0));var _0xa032=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x032a[_0x50e7e0];return _0x1a0307;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40128a,_0x54275c,_0x616437){return new BPromise(function(_0x4a5d8e,_0x5d0744){return client[_0xa032('0xc')](_0x40128a,_0x616437)['then'](function(_0x18283a){logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,_0xa032('0xf'));logger[_0xa032('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x54275c,_0xa032('0xf'),JSON[_0xa032('0x11')](_0x18283a));if(_0x18283a['error']){if(_0x18283a[_0xa032('0x12')][_0xa032('0x13')]===0x1f4){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')]['message']);return _0x5d0744(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);return _0x4a5d8e(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}else{logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,'request\x20sent');_0x4a5d8e(_0x18283a[_0xa032('0x15')][_0xa032('0x14')]);}})[_0xa032('0x16')](function(_0x2caacd){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x2caacd);_0x5d0744(_0x2caacd);});});}exports[_0xa032('0x17')]=function(_0x577406){var _0xff6817=this;return new Promise(function(_0x54fba7,_0x1d8cf4){return db[_0xa032('0x18')][_0xa032('0x19')](_0x577406['body'],{'raw':_0x577406[_0xa032('0x1a')]?_0x577406['options'][_0xa032('0x1b')]===undefined?!![]:![]:!![]})[_0xa032('0x1c')](function(_0x471757){logger[_0xa032('0xd')](_0xa032('0x17'),_0x577406);logger[_0xa032('0x10')]('CreateAttachment',_0x577406,JSON[_0xa032('0x11')](_0x471757));_0x54fba7(_0x471757);})[_0xa032('0x16')](function(_0x5a817b){logger[_0xa032('0x12')]('CreateAttachment',_0x5a817b[_0xa032('0x14')],_0x577406);_0x1d8cf4(_0xff6817['error'](0x1f4,_0x5a817b[_0xa032('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8aee56f..54e5ff7 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x14728d,_0x5c08df){var _0x39216f=function(_0x72c010){while(--_0x72c010){_0x14728d['push'](_0x14728d['shift']());}};_0x39216f(++_0x5c08df);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb10b[_0x1c37a5];return _0x389d03;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x30e43f,_0x418ef7){var _0x571e18=function(_0x41d3df){while(--_0x41d3df){_0x30e43f['push'](_0x30e43f['shift']());}};_0x571e18(++_0x418ef7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c802c,_0x177ac9){_0x1c802c=_0x1c802c-0x0;var _0x1e53da=_0x5f2f[_0x1c802c];return _0x1e53da;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 3d4a3f6..fe4a83c 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 _0xbf6d=['then','map','emails','value','admin','user','agent','blockedAt','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','authenticate','clientID','clientSecret','secret','callbackURL','Setting','blockDuration'];(function(_0x14996e,_0x108636){var _0x2f0151=function(_0x20dd91){while(--_0x20dd91){_0x14996e['push'](_0x14996e['shift']());}};_0x2f0151(++_0x108636);}(_0xbf6d,0x161));var _0xdbf6=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0xbf6d[_0x5b9d3a];return _0x383375;};'use strict';var _=require('lodash');var passport=require(_0xdbf6('0x0'));var GoogleStrategy=require(_0xdbf6('0x1'))[_0xdbf6('0x2')];var moment=require(_0xdbf6('0x3'));var db=require(_0xdbf6('0x4'))['db'];var config=require(_0xdbf6('0x5'));var signToken=require(_0xdbf6('0x6'))[_0xdbf6('0x7')];var utils=require(_0xdbf6('0x8'));exports[_0xdbf6('0x9')]=passport['authenticate'](_0xdbf6('0xa'),{'failureRedirect':_0xdbf6('0xb'),'scope':[_0xdbf6('0xc'),_0xdbf6('0xd')],'session':![]});exports['callback']=passport[_0xdbf6('0xe')]('google',{'failureRedirect':_0xdbf6('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0xdbf6('0xa')][_0xdbf6('0xf')]:'id','clientSecret':config[_0xdbf6('0xa')]?config['google'][_0xdbf6('0x10')]:_0xdbf6('0x11'),'callbackURL':config['google']?config[_0xdbf6('0xa')][_0xdbf6('0x12')]:''},function(_0x20c4ef,_0x332fab,_0x53744c,_0x580ff8){var _0x560979,_0x4ed14a;return db[_0xdbf6('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xdbf6('0x14')],'raw':!![]})[_0xdbf6('0x15')](function(_0x28c4d7){_0x560979=_0x28c4d7;return db['User']['find']({'where':{'email':_[_0xdbf6('0x16')](_0x53744c[_0xdbf6('0x17')],_0xdbf6('0x18')),'role':{'$or':[_0xdbf6('0x19'),_0xdbf6('0x1a'),_0xdbf6('0x1b')]}}});})[_0xdbf6('0x15')](function(_0x574d6b){_0x4ed14a=_0x574d6b;if(_0x4ed14a){if(_0x4ed14a['disabled']){return _0x580ff8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x560979[_0xdbf6('0x14')]>0x0){if(_0x4ed14a['blocked']){if(moment(_0x4ed14a[_0xdbf6('0x1c')])[_0xdbf6('0x1d')](_0x560979[_0xdbf6('0x14')],'minutes')>moment()){return _0x580ff8(_0xdbf6('0x1e'));}else{return utils[_0xdbf6('0x1f')](_0x4ed14a,0x0,![],null)[_0xdbf6('0x15')](function(){return utils[_0xdbf6('0x20')](_0x4ed14a);})['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}else{return utils['getLicense'](_0x4ed14a)['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}else{return utils[_0xdbf6('0x20')](_0x4ed14a)['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}return _0x580ff8(_0xdbf6('0x1e'));})[_0xdbf6('0x21')](function(_0x43d960){_0x580ff8(_0x43d960);});}));
\ No newline at end of file
+var _0x0983=['email','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0x0983,0x151));var _0x3098=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0983[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x3098('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x3098('0x1'))[_0x3098('0x2')];var moment=require(_0x3098('0x3'));var db=require(_0x3098('0x4'))['db'];var config=require(_0x3098('0x5'));var signToken=require(_0x3098('0x6'))['signToken'];var utils=require(_0x3098('0x7'));exports[_0x3098('0x8')]=passport[_0x3098('0x9')](_0x3098('0xa'),{'failureRedirect':_0x3098('0xb'),'scope':[_0x3098('0xc'),_0x3098('0xd')],'session':![]});exports['callback']=passport[_0x3098('0x9')]('google',{'failureRedirect':_0x3098('0xb'),'session':![]});passport[_0x3098('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x3098('0xa')][_0x3098('0xf')]:'id','clientSecret':config[_0x3098('0xa')]?config[_0x3098('0xa')]['clientSecret']:_0x3098('0x10'),'callbackURL':config['google']?config[_0x3098('0xa')][_0x3098('0x11')]:''},function(_0x4b3b3c,_0x37a2c4,_0x567748,_0x1d3cf2){var _0x522c66,_0x4ce235;return db[_0x3098('0x12')][_0x3098('0x13')]({'where':{'id':0x1},'attributes':[_0x3098('0x14'),_0x3098('0x15')],'raw':!![]})[_0x3098('0x16')](function(_0x58a6fe){_0x522c66=_0x58a6fe;return db[_0x3098('0x17')]['find']({'where':{'email':_[_0x3098('0x18')](_0x567748[_0x3098('0x19')],'value'),'role':{'$or':['admin',_0x3098('0x1a'),_0x3098('0x1b')]}}});})[_0x3098('0x16')](function(_0x869728){_0x4ce235=_0x869728;if(_0x4ce235){if(_0x4ce235[_0x3098('0x1c')]){return _0x1d3cf2(_0x3098('0x1d'));}else if(_0x522c66[_0x3098('0x15')]>0x0){if(_0x4ce235[_0x3098('0x1e')]){if(moment(_0x4ce235[_0x3098('0x1f')])['add'](_0x522c66['blockDuration'],'minutes')>moment()){return _0x1d3cf2(_0x3098('0x1d'));}else{return utils[_0x3098('0x20')](_0x4ce235,0x0,![],null)[_0x3098('0x16')](function(){return utils[_0x3098('0x21')](_0x4ce235);})[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}return _0x1d3cf2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x3098('0x22')](function(_0x16a087){_0x1d3cf2(_0x16a087);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 44bf7ca..9feafa2 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 _0x2b1e=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x2b1e,0x19b));var _0xe2b1=function(_0x59a4a5,_0x59e4fc){_0x59a4a5=_0x59a4a5-0x0;var _0x5dff0e=_0x2b1e[_0x59a4a5];return _0x5dff0e;};'use strict';var express=require(_0xe2b1('0x0'));var passport=require(_0xe2b1('0x1'));var router=express['Router']();var controller=require(_0xe2b1('0x2'));var userController=require(_0xe2b1('0x3'));var authService=require('../../components/auth/service');router[_0xe2b1('0x4')]('/',controller[_0xe2b1('0x5')]);router[_0xe2b1('0x4')](_0xe2b1('0x6'),controller[_0xe2b1('0x7')],authService[_0xe2b1('0x8')],userController['login'],authService['setTokenCookie']);module[_0xe2b1('0x9')]=router;
\ No newline at end of file
+var _0x1d99=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get'];(function(_0x3553cb,_0x16f3db){var _0x47f419=function(_0x398197){while(--_0x398197){_0x3553cb['push'](_0x3553cb['shift']());}};_0x47f419(++_0x16f3db);}(_0x1d99,0xaa));var _0x91d9=function(_0xe289f7,_0x5f21cb){_0xe289f7=_0xe289f7-0x0;var _0x45314c=_0x1d99[_0xe289f7];return _0x45314c;};'use strict';var express=require(_0x91d9('0x0'));var passport=require(_0x91d9('0x1'));var router=express[_0x91d9('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x91d9('0x3'));var authService=require(_0x91d9('0x4'));router[_0x91d9('0x5')]('/',controller[_0x91d9('0x6')]);router[_0x91d9('0x5')]('/callback',controller[_0x91d9('0x7')],authService[_0x91d9('0x8')],userController[_0x91d9('0x6')],authService[_0x91d9('0x9')]);module[_0x91d9('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 3f5dc4a..84e52b9 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 _0x5f3a=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local'];(function(_0x4d2bab,_0x2e701b){var _0x239bdd=function(_0x10eadb){while(--_0x10eadb){_0x4d2bab['push'](_0x4d2bab['shift']());}};_0x239bdd(++_0x2e701b);}(_0x5f3a,0x16d));var _0xa5f3=function(_0x137b48,_0x1c5b32){_0x137b48=_0x137b48-0x0;var _0x57d796=_0x5f3a[_0x137b48];return _0x57d796;};'use strict';var util=require(_0xa5f3('0x0'));var passport=require(_0xa5f3('0x1'));var LocalStrategy=require(_0xa5f3('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xa5f3('0x3'));var rs=require(_0xa5f3('0x4'));var moment=require(_0xa5f3('0x5'));var db=require(_0xa5f3('0x6'))['db'];var authService=require(_0xa5f3('0x7'));var utils=require(_0xa5f3('0x8'));var client=jayson[_0xa5f3('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x3b4c8b,_0xc25bf1,_0x2a1b08,_0x1b73bc){var _0x4ea4b6,_0x4a6896;return db[_0xa5f3('0xa')][_0xa5f3('0xb')]({'where':{'id':0x1},'attributes':[_0xa5f3('0xc'),_0xa5f3('0xd')],'raw':!![]})['then'](function(_0x51cc2b){_0x4ea4b6=_0x51cc2b;return _0x3b4c8b[_0xa5f3('0xb')]({'attributes':['id',_0xa5f3('0xe'),_0xa5f3('0xf'),_0xa5f3('0x10'),_0xa5f3('0x11'),_0xa5f3('0x12'),_0xa5f3('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0xc25bf1,'role':{'$or':['admin',_0xa5f3('0x14'),_0xa5f3('0x15')]}}});})[_0xa5f3('0x16')](function(_0x3af0ec){if(!_0x3af0ec||_0x3af0ec&&_0x3af0ec['name']!==_0xc25bf1){throw new Error(_0xa5f3('0x17'));}else{_0x4a6896=_0x3af0ec;return _0x4a6896;}})[_0xa5f3('0x16')](function(){_0x4a6896[_0xa5f3('0x18')](_0x2a1b08,function(_0x3fc084,_0x276c5b){var _0x220abb=_0x4a6896['loginAttempts']+0x1;if(_0x3fc084){return _0x1b73bc(_0x3fc084);}else if(!_0x276c5b){if(_0x4a6896[_0xa5f3('0x12')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea4b6[_0xa5f3('0xc')]>0x0){if(_0x4a6896['blocked']){if(_0x4ea4b6[_0xa5f3('0xd')]>0x0){if(moment(_0x4a6896[_0xa5f3('0x19')])['add'](_0x4ea4b6[_0xa5f3('0xd')],'minutes')>moment()){return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}else{return utils['clearBlockUser'](_0x4a6896,_0x220abb,![],null)['then'](function(){return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});});}}else{return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}}else{if(_0x220abb>=_0x4ea4b6[_0xa5f3('0xc')]){return utils[_0xa5f3('0x1a')](_0x4a6896,0x0,!![],moment())['then'](function(){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa5f3('0x1a')](_0x4a6896,_0x220abb,![],null)[_0xa5f3('0x16')](function(){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}}else{if(_0x4a6896[_0xa5f3('0x12')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea4b6[_0xa5f3('0xc')]>0x0){if(_0x4a6896['blocked']){if(_0x4ea4b6['blockDuration']>0x0){if(moment(_0x4a6896['blockedAt'])[_0xa5f3('0x1b')](_0x4ea4b6[_0xa5f3('0xd')],_0xa5f3('0x1c'))>moment()){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4a6896,0x0,![],null)[_0xa5f3('0x16')](function(){return utils[_0xa5f3('0x1d')](_0x4a6896);})['then'](function(){return _0x1b73bc(null,_0x4a6896);});}}else{return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xa5f3('0x1a')](_0x4a6896,0x0,![],null)[_0xa5f3('0x16')](function(){return utils[_0xa5f3('0x1d')](_0x4a6896);})[_0xa5f3('0x16')](function(){return _0x1b73bc(null,_0x4a6896);})[_0xa5f3('0x1e')](function(_0x6ded35){return _0x1b73bc(null,![],_0x6ded35);});}}else{if(_0x4a6896[_0xa5f3('0x13')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x4a6896)['then'](function(){return _0x1b73bc(null,_0x4a6896);});}}}});})['catch'](function(_0x5086cc){return _0x1b73bc(null,![],_0x5086cc);});}function sendServiceMail(_0x19f6f4){return db[_0xa5f3('0x1f')][_0xa5f3('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xa5f3('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xa5f3('0x22')}]})[_0xa5f3('0x16')](function(_0x5741da){if(!_0x5741da){throw new Error(_0xa5f3('0x23'));}var _0xcb7e4e={'tls':{'rejectUnauthorized':![]}};if(_0x5741da[_0xa5f3('0x22')]['service']){_0xcb7e4e[_0xa5f3('0x24')]=_0x5741da['Smtp'][_0xa5f3('0x24')];}else{_0xcb7e4e['host']=_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x25')];_0xcb7e4e[_0xa5f3('0x26')]=_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x26')];_0xcb7e4e['secure']=_0x5741da['Smtp'][_0xa5f3('0x27')];}if(_0x5741da[_0xa5f3('0x22')]['authentication']){_0xcb7e4e[_0xa5f3('0x28')]={'user':_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x14')],'pass':_0x5741da['Smtp'][_0xa5f3('0x29')]};}var _0x37185f={'account':_0xcb7e4e,'message':_[_0xa5f3('0x2a')]({'from':util[_0xa5f3('0x2b')](_0xa5f3('0x2c'),_0x5741da['name'],_0x5741da[_0xa5f3('0x21')]||_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x14')])},_0x19f6f4)};return client[_0xa5f3('0x2d')](_0xa5f3('0x2e'),_0x37185f);})['then'](function(_0x2b13c8){if(_0x2b13c8[_0xa5f3('0x2f')]){throw new Error(util[_0xa5f3('0x2b')](_0xa5f3('0x30'),_0x2b13c8[_0xa5f3('0x2f')][_0xa5f3('0x31')]||JSON[_0xa5f3('0x32')](_0x2b13c8[_0xa5f3('0x2f')])));}return!![];});}function handleError(_0x32417a,_0x180e89,_0x3c0714){return _0x32417a[_0xa5f3('0x33')](_0x180e89||0x1f4)[_0xa5f3('0x34')]({'message':_0x3c0714?_0x3c0714['message']||_0x3c0714:''});}exports[_0xa5f3('0x35')]=function(_0x15f8db,_0x11c8e1,_0x9a33e9){passport[_0xa5f3('0x18')](_0xa5f3('0x36'),function(_0x59d1e8,_0x1576be,_0x1a6118){var _0x73cb73=_0x59d1e8||_0x1a6118;if(_0x73cb73){return handleError(_0x11c8e1,0x191,_0x73cb73);}if(!_0x1576be){return handleError(_0x11c8e1,0x194,{'message':_0xa5f3('0x37')});}else{var _0x35fd3c={'payload':{'id':_0x1576be['id'],'role':_0x1576be[_0xa5f3('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xa5f3('0x38')](_0x35fd3c)[_0xa5f3('0x16')](function(_0x5e041){_0x11c8e1['json']({'id':_0x1576be['id'],'token':_0x5e041,'statusCall':'','isAlreadyLogged':_0x1576be['online']});});}})(_0x15f8db,_0x11c8e1,_0x9a33e9);};exports[_0xa5f3('0x39')]=function(_0x54024f,_0x37ff78,_0x2a9e94){if(!_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]){return handleError(_0x37ff78,0x1f4,{'message':_0xa5f3('0x3b')});}var _0x5bc29a=rs[_0xa5f3('0x3c')]();_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]=_0x54024f[_0xa5f3('0x3a')]['email']['trim']()['toLowerCase']();var _0x15c17f;return db[_0xa5f3('0xa')][_0xa5f3('0xb')]({'where':{'id':0x1},'attributes':[_0xa5f3('0xc'),_0xa5f3('0xd')],'raw':!![]})[_0xa5f3('0x16')](function(_0x733220){_0x15c17f=_0x733220;return db[_0xa5f3('0x3d')][_0xa5f3('0x20')]({'where':{'email':_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]}});})['then'](function(_0x16a143){if(!_0x16a143){throw new Error(_0xa5f3('0x3e'));}if(_0x16a143[_0xa5f3('0x12')]){throw new Error(_0xa5f3('0x3f'));}if(_0x16a143[_0xa5f3('0x13')]){if(moment(_0x16a143[_0xa5f3('0x19')])[_0xa5f3('0x1b')](_0x15c17f[_0xa5f3('0xd')],_0xa5f3('0x1c'))>moment()){throw new Error(_0xa5f3('0x40'));}else{_0x16a143[_0xa5f3('0x13')]=![];_0x16a143[_0xa5f3('0x19')]=null;}}_0x16a143['resetPasswordToken']=_0x5bc29a;_0x16a143[_0xa5f3('0x41')]=Date[_0xa5f3('0x42')]()+0x36ee80;return _0x16a143[_0xa5f3('0x43')]();})[_0xa5f3('0x16')](function(){return sendServiceMail({'to':_0x54024f[_0xa5f3('0x3a')]['email'],'subject':_0xa5f3('0x44'),'text':_0xa5f3('0x45')+_0xa5f3('0x46')+_0xa5f3('0x47')+_0x54024f['headers']['host']+_0xa5f3('0x48')+_0x5bc29a+'\x0a\x0a'+_0xa5f3('0x49')});})[_0xa5f3('0x16')](function(){_0x37ff78[_0xa5f3('0x33')](0xc8)[_0xa5f3('0x34')]({'message':_0xa5f3('0x4a')});})[_0xa5f3('0x1e')](function(_0x555378){return handleError(_0x37ff78,0x1f4,_0x555378);});};exports[_0xa5f3('0x4b')]=function(_0x41d376,_0x2d7a75,_0x3ebb68){return db['User'][_0xa5f3('0x20')]({'where':{'resetPasswordToken':_0x41d376['params'][_0xa5f3('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xa5f3('0x42')]()}}})['then'](function(_0x4cfd09){if(!_0x4cfd09){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xa5f3('0xb')]({'attributes':['id',_0xa5f3('0x4d'),_0xa5f3('0x4e'),_0xa5f3('0x4f')]})[_0xa5f3('0x16')](function(_0x36face){if(_0x36face[_0xa5f3('0x4d')])authService['validatePasswordPattern'](_0x41d376['body'][_0xa5f3('0xf')]);if(!_0x36face[_0xa5f3('0x4e')]||!_0x4cfd09['previousPasswords'])return _0x4cfd09;authService[_0xa5f3('0x50')](_0x41d376[_0xa5f3('0x3a')][_0xa5f3('0xf')],_0x4cfd09[_0xa5f3('0x51')],_0x36face[_0xa5f3('0x4f')]);return _0x4cfd09;})[_0xa5f3('0x16')](function(){_0x4cfd09[_0xa5f3('0xf')]=_0x41d376[_0xa5f3('0x3a')][_0xa5f3('0xf')];_0x4cfd09['resetPasswordToken']=null;_0x4cfd09[_0xa5f3('0x41')]=null;return _0x4cfd09['save']();});})[_0xa5f3('0x16')](function(){_0x2d7a75[_0xa5f3('0x33')](0xc8)[_0xa5f3('0x34')]({'message':_0xa5f3('0x52')});})[_0xa5f3('0x1e')](function(_0x1e993b){return handleError(_0x2d7a75,0x1f4,_0x1e993b);});};passport[_0xa5f3('0x53')](new LocalStrategy({'usernameField':_0xa5f3('0xe'),'passwordField':_0xa5f3('0xf')},function(_0x48cbbd,_0xda4af0,_0x4e1e85){return localAuthenticate(db['User'],_0x48cbbd,_0xda4af0,_0x4e1e85);}));
\ No newline at end of file
+var _0x5d44=['error','message','stringify','status','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','format'];(function(_0x560a6d,_0x42c234){var _0x4b29aa=function(_0x24309c){while(--_0x24309c){_0x560a6d['push'](_0x560a6d['shift']());}};_0x4b29aa(++_0x42c234);}(_0x5d44,0xd1));var _0x45d4=function(_0x20b91e,_0xe4e682){_0x20b91e=_0x20b91e-0x0;var _0x41d214=_0x5d44[_0x20b91e];return _0x41d214;};'use strict';var util=require(_0x45d4('0x0'));var passport=require(_0x45d4('0x1'));var LocalStrategy=require(_0x45d4('0x2'))['Strategy'];var jayson=require(_0x45d4('0x3'));var _=require(_0x45d4('0x4'));var rs=require(_0x45d4('0x5'));var moment=require(_0x45d4('0x6'));var db=require(_0x45d4('0x7'))['db'];var authService=require(_0x45d4('0x8'));var utils=require(_0x45d4('0x9'));var client=jayson['client'][_0x45d4('0xa')]({'port':0x232b});function localAuthenticate(_0x17e99c,_0x32d570,_0x56fe0b,_0x2717b2){var _0x4ecf33,_0x102cbe;return db['Setting'][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x4d9bae){_0x4ecf33=_0x4d9bae;return _0x17e99c[_0x45d4('0xb')]({'attributes':['id',_0x45d4('0xf'),_0x45d4('0x10'),_0x45d4('0x11'),_0x45d4('0x12'),'disabled',_0x45d4('0x13'),_0x45d4('0x14'),_0x45d4('0x15')],'where':{'name':_0x32d570,'role':{'$or':[_0x45d4('0x16'),_0x45d4('0x17'),_0x45d4('0x18')]}}});})[_0x45d4('0xe')](function(_0x45eb36){if(!_0x45eb36||_0x45eb36&&_0x45eb36[_0x45d4('0xf')]!==_0x32d570){throw new Error(_0x45d4('0x19'));}else{_0x102cbe=_0x45eb36;return _0x102cbe;}})[_0x45d4('0xe')](function(){_0x102cbe[_0x45d4('0x1a')](_0x56fe0b,function(_0x152ecb,_0x1adc55){var _0x2ba0e0=_0x102cbe[_0x45d4('0x15')]+0x1;if(_0x152ecb){return _0x2717b2(_0x152ecb);}else if(!_0x1adc55){if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33[_0x45d4('0xc')]>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33[_0x45d4('0xd')]>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33['blockDuration'],_0x45d4('0x1d'))>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,_0x2ba0e0,![],null)['then'](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{if(_0x2ba0e0>=_0x4ecf33[_0x45d4('0xc')]){return utils[_0x45d4('0x1e')](_0x102cbe,0x0,!![],moment())[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}else{return utils[_0x45d4('0x1e')](_0x102cbe,_0x2ba0e0,![],null)[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}}else{return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33['allowedLoginAttempts']>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33['blockDuration']>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33[_0x45d4('0xd')],'minutes')>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{return utils[_0x45d4('0x1e')](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);})[_0x45d4('0x20')](function(_0x30781e){return _0x2717b2(null,![],_0x30781e);});}}else{if(_0x102cbe[_0x45d4('0x13')]){return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x45d4('0x1f')](_0x102cbe)[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}}});})['catch'](function(_0x3cf0c1){return _0x2717b2(null,![],_0x3cf0c1);});}function sendServiceMail(_0x6bc17b){return db[_0x45d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x45d4('0xf'),_0x45d4('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x45d4('0x23')}]})[_0x45d4('0xe')](function(_0x23bd4c){if(!_0x23bd4c){throw new Error(_0x45d4('0x24'));}var _0x4cbdd2={'tls':{'rejectUnauthorized':![]}};if(_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x25')]){_0x4cbdd2[_0x45d4('0x25')]=_0x23bd4c['Smtp'][_0x45d4('0x25')];}else{_0x4cbdd2[_0x45d4('0x26')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x26')];_0x4cbdd2[_0x45d4('0x27')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x27')];_0x4cbdd2[_0x45d4('0x28')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x28')];}if(_0x23bd4c[_0x45d4('0x23')]['authentication']){_0x4cbdd2['auth']={'user':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')],'pass':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x29')]};}var _0x282f61={'account':_0x4cbdd2,'message':_['merge']({'from':util[_0x45d4('0x2a')]('\x22%s\x22\x20<%s>',_0x23bd4c[_0x45d4('0xf')],_0x23bd4c['email']||_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')])},_0x6bc17b)};return client['request']('SendMail',_0x282f61);})[_0x45d4('0xe')](function(_0x2889db){if(_0x2889db[_0x45d4('0x2b')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2889db['error'][_0x45d4('0x2c')]||JSON[_0x45d4('0x2d')](_0x2889db[_0x45d4('0x2b')])));}return!![];});}function handleError(_0x3cc141,_0x15f3e5,_0xe02fb2){return _0x3cc141[_0x45d4('0x2e')](_0x15f3e5||0x1f4)['send']({'message':_0xe02fb2?_0xe02fb2[_0x45d4('0x2c')]||_0xe02fb2:''});}exports[_0x45d4('0x2f')]=function(_0x26aa1f,_0x2e7491,_0x41eba8){passport['authenticate']('local',function(_0x23db01,_0x399f78,_0x569e9d){var _0x139859=_0x23db01||_0x569e9d;if(_0x139859){return handleError(_0x2e7491,0x191,_0x139859);}if(!_0x399f78){return handleError(_0x2e7491,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x55d270={'payload':{'id':_0x399f78['id'],'role':_0x399f78[_0x45d4('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x45d4('0x30')](_0x55d270)[_0x45d4('0xe')](function(_0xfafe6a){_0x2e7491['json']({'id':_0x399f78['id'],'token':_0xfafe6a,'statusCall':'','isAlreadyLogged':_0x399f78[_0x45d4('0x31')]});});}})(_0x26aa1f,_0x2e7491,_0x41eba8);};exports[_0x45d4('0x32')]=function(_0x3be779,_0x2616dd,_0xb51b99){if(!_0x3be779[_0x45d4('0x33')]['email']){return handleError(_0x2616dd,0x1f4,{'message':_0x45d4('0x34')});}var _0x39920e=rs[_0x45d4('0x35')]();_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')]=_0x3be779['body'][_0x45d4('0x22')][_0x45d4('0x36')]()[_0x45d4('0x37')]();var _0x59df68;return db[_0x45d4('0x38')][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x199bf6){_0x59df68=_0x199bf6;return db['User'][_0x45d4('0x39')]({'where':{'email':_0x3be779['body'][_0x45d4('0x22')]}});})[_0x45d4('0xe')](function(_0x16ed41){if(!_0x16ed41){throw new Error(_0x45d4('0x3a'));}if(_0x16ed41[_0x45d4('0x1b')]){throw new Error(_0x45d4('0x3b'));}if(_0x16ed41[_0x45d4('0x13')]){if(moment(_0x16ed41[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x59df68[_0x45d4('0xd')],_0x45d4('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x16ed41['blocked']=![];_0x16ed41[_0x45d4('0x14')]=null;}}_0x16ed41[_0x45d4('0x3c')]=_0x39920e;_0x16ed41[_0x45d4('0x3d')]=Date[_0x45d4('0x3e')]()+0x36ee80;return _0x16ed41[_0x45d4('0x3f')]();})[_0x45d4('0xe')](function(){return sendServiceMail({'to':_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x45d4('0x40')+_0x45d4('0x41')+_0x45d4('0x42')+_0x3be779[_0x45d4('0x43')][_0x45d4('0x26')]+_0x45d4('0x44')+_0x39920e+'\x0a\x0a'+_0x45d4('0x45')});})[_0x45d4('0xe')](function(){_0x2616dd['status'](0xc8)[_0x45d4('0x46')]({'message':_0x45d4('0x47')});})[_0x45d4('0x20')](function(_0x14ef5d){return handleError(_0x2616dd,0x1f4,_0x14ef5d);});};exports[_0x45d4('0x48')]=function(_0x5d56da,_0x206e2c,_0x48e552){return db[_0x45d4('0x49')][_0x45d4('0x39')]({'where':{'resetPasswordToken':_0x5d56da[_0x45d4('0x4a')][_0x45d4('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x45d4('0x3e')]()}}})[_0x45d4('0xe')](function(_0x3a76eb){if(!_0x3a76eb){throw new Error(_0x45d4('0x4c'));}return db[_0x45d4('0x38')]['findOne']({'attributes':['id',_0x45d4('0x4d'),_0x45d4('0x4e'),_0x45d4('0x4f')]})['then'](function(_0xb9bc4f){if(_0xb9bc4f[_0x45d4('0x4d')])authService[_0x45d4('0x50')](_0x5d56da['body'][_0x45d4('0x10')]);if(!_0xb9bc4f[_0x45d4('0x4e')]||!_0x3a76eb[_0x45d4('0x51')])return _0x3a76eb;authService[_0x45d4('0x52')](_0x5d56da['body'][_0x45d4('0x10')],_0x3a76eb['previousPasswords'],_0xb9bc4f[_0x45d4('0x4f')]);return _0x3a76eb;})[_0x45d4('0xe')](function(){_0x3a76eb[_0x45d4('0x10')]=_0x5d56da[_0x45d4('0x33')][_0x45d4('0x10')];_0x3a76eb[_0x45d4('0x3c')]=null;_0x3a76eb[_0x45d4('0x3d')]=null;return _0x3a76eb[_0x45d4('0x3f')]();});})[_0x45d4('0xe')](function(){_0x206e2c[_0x45d4('0x2e')](0xc8)['send']({'message':_0x45d4('0x53')});})[_0x45d4('0x20')](function(_0x59a201){return handleError(_0x206e2c,0x1f4,_0x59a201);});};passport['use'](new LocalStrategy({'usernameField':_0x45d4('0xf'),'passwordField':_0x45d4('0x10')},function(_0x5a1889,_0x115804,_0x51eb90){return localAuthenticate(db[_0x45d4('0x49')],_0x5a1889,_0x115804,_0x51eb90);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 99eeff3..b145197 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 _0xc0d5=['Router','post','/forgot','forgot','/reset/:token','exports','express'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc0d5,0xfb));var _0x5c0d=function(_0x103e4b,_0x4ecec6){_0x103e4b=_0x103e4b-0x0;var _0x23aef9=_0xc0d5[_0x103e4b];return _0x23aef9;};'use strict';var express=require(_0x5c0d('0x0'));var router=express[_0x5c0d('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0x5c0d('0x2')](_0x5c0d('0x3'),controller[_0x5c0d('0x4')]);router[_0x5c0d('0x2')](_0x5c0d('0x5'),controller['reset']);module[_0x5c0d('0x6')]=router;
\ No newline at end of file
+var _0x8a1a=['login','forgot','./authLocal.controller','post'];(function(_0x155116,_0x27df78){var _0x403b73=function(_0x2eb7b4){while(--_0x2eb7b4){_0x155116['push'](_0x155116['shift']());}};_0x403b73(++_0x27df78);}(_0x8a1a,0x96));var _0xa8a1=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x8a1a[_0x1168a1];return _0xcc5ad8;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa8a1('0x0'));router[_0xa8a1('0x1')]('/',controller[_0xa8a1('0x2')]);router[_0xa8a1('0x1')]('/forgot',controller[_0xa8a1('0x3')]);router[_0xa8a1('0x1')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a892be3..adfbbde 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 _0x2fc1=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x51f0dd,_0x13e184){var _0x43df8c=function(_0x1299ac){while(--_0x1299ac){_0x51f0dd['push'](_0x51f0dd['shift']());}};_0x43df8c(++_0x13e184);}(_0x2fc1,0x130));var _0x12fc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2fc1[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x12fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x12fc('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x12fc('0x1')]},'description':{'type':Sequelize[_0x12fc('0x1')]},'status':{'type':Sequelize[_0x12fc('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x12fc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x84b8=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x267556,_0x293028){var _0x1ec0b1=function(_0xf02080){while(--_0xf02080){_0x267556['push'](_0x267556['shift']());}};_0x1ec0b1(++_0x293028);}(_0x84b8,0x174));var _0x884b=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x84b8[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x884b('0x0'));module[_0x884b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x884b('0x2')]},'status':{'type':Sequelize[_0x884b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x884b('0x4')],'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 2967875..3273ced 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 _0xfab6=['type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','catch','show','includeAll','find','create','body','params','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','Automation','rawAttributes'];(function(_0x3d6157,_0x3f5107){var _0x4be21e=function(_0x52e268){while(--_0x52e268){_0x3d6157['push'](_0x3d6157['shift']());}};_0x4be21e(++_0x3f5107);}(_0xfab6,0x76));var _0x6fab=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfab6[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x6fab('0x0'));var rimraf=require(_0x6fab('0x1'));var zipdir=require(_0x6fab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fab('0x3'));var moment=require(_0x6fab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6fab('0x5'));var path=require(_0x6fab('0x6'));var sox=require('sox');var csv=require(_0x6fab('0x7'));var ejs=require(_0x6fab('0x8'));var fs=require('fs');var fs_extra=require(_0x6fab('0x9'));var _=require(_0x6fab('0xa'));var squel=require(_0x6fab('0xb'));var crypto=require(_0x6fab('0xc'));var jsforce=require(_0x6fab('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6fab('0xe'));var Papa=require(_0x6fab('0xf'));var Redis=require(_0x6fab('0x10'));var authService=require(_0x6fab('0x11'));var qs=require(_0x6fab('0x12'));var as=require(_0x6fab('0x13'));var hardwareService=require(_0x6fab('0x14'));var logger=require(_0x6fab('0x15'))(_0x6fab('0x16'));var utils=require(_0x6fab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6fab('0x18'));var db=require(_0x6fab('0x19'))['db'];function respondWithStatusCode(_0x89dc85,_0x485320){_0x485320=_0x485320||0xcc;return function(_0x2a94a0){if(_0x2a94a0){return _0x89dc85[_0x6fab('0x1a')](_0x485320);}return _0x89dc85['status'](_0x485320)[_0x6fab('0x1b')]();};}function respondWithResult(_0x210f3b,_0x20a129){_0x20a129=_0x20a129||0xc8;return function(_0x1f1922){if(_0x1f1922){return _0x210f3b['status'](_0x20a129)[_0x6fab('0x1c')](_0x1f1922);}};}function respondWithFilteredResult(_0x5183f3,_0x1639e){return function(_0x5ae462){if(_0x5ae462){var _0x5a9611=typeof _0x1639e[_0x6fab('0x1d')]===_0x6fab('0x1e')&&typeof _0x1639e[_0x6fab('0x1f')]===_0x6fab('0x1e');var _0x3f72a3=_0x5ae462['count'];var _0x7ce83b=_0x5a9611?0x0:_0x1639e[_0x6fab('0x1d')];var _0x51c5bf=_0x5a9611?_0x5ae462[_0x6fab('0x20')]:_0x1639e[_0x6fab('0x1d')]+_0x1639e[_0x6fab('0x1f')];var _0x5f3d0e;if(_0x51c5bf>=_0x3f72a3){_0x51c5bf=_0x3f72a3;_0x5f3d0e=0xc8;}else{_0x5f3d0e=0xce;}_0x5183f3[_0x6fab('0x21')](_0x5f3d0e);return _0x5183f3[_0x6fab('0x22')](_0x6fab('0x23'),_0x7ce83b+'-'+_0x51c5bf+'/'+_0x3f72a3)[_0x6fab('0x1c')](_0x5ae462);}return null;};}function patchUpdates(_0x16fccf){return function(_0x3fbcd0){try{jsonpatch[_0x6fab('0x24')](_0x3fbcd0,_0x16fccf,!![]);}catch(_0x426dc4){return BPromise[_0x6fab('0x25')](_0x426dc4);}return _0x3fbcd0['save']();};}function saveUpdates(_0x2aa1a1,_0x157980){return function(_0x1e41cd){if(_0x1e41cd){return _0x1e41cd[_0x6fab('0x26')](_0x2aa1a1)[_0x6fab('0x27')](function(_0x1d6d8e){return _0x1d6d8e;});}return null;};}function removeEntity(_0x6cd75b,_0x427c26){return function(_0x5a31e6){if(_0x5a31e6){return _0x5a31e6[_0x6fab('0x28')]()[_0x6fab('0x27')](function(){_0x6cd75b['status'](0xcc)[_0x6fab('0x1b')]();});}};}function handleEntityNotFound(_0x54e084,_0x3b2e84){return function(_0x2f6155){if(!_0x2f6155){_0x54e084[_0x6fab('0x1a')](0x194);}return _0x2f6155;};}function handleError(_0xb092cc,_0x46711d){_0x46711d=_0x46711d||0x1f4;return function(_0x20baec){logger[_0x6fab('0x29')](_0x20baec[_0x6fab('0x2a')]);if(_0x20baec['name']){delete _0x20baec['name'];}_0xb092cc['status'](_0x46711d)[_0x6fab('0x2b')](_0x20baec);};}exports[_0x6fab('0x2c')]=function(_0x620c1b,_0xb896cc){var _0x8e48db={},_0x22e661={},_0x2aef15={'count':0x0,'rows':[]};var _0x4e9b03=_[_0x6fab('0x2d')](db[_0x6fab('0x2e')][_0x6fab('0x2f')],function(_0xba784a){return{'name':_0xba784a['fieldName'],'type':_0xba784a[_0x6fab('0x30')]['key']};});_0x22e661[_0x6fab('0x31')]=_['map'](_0x4e9b03,_0x6fab('0x32'));_0x22e661[_0x6fab('0x33')]=_[_0x6fab('0x34')](_0x620c1b[_0x6fab('0x33')]);_0x22e661[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x22e661[_0x6fab('0x31')],_0x22e661['query']);_0x8e48db[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0x22e661[_0x6fab('0x31')],qs[_0x6fab('0x38')](_0x620c1b['query']['fields']));_0x8e48db[_0x6fab('0x37')]=_0x8e48db[_0x6fab('0x37')][_0x6fab('0x39')]?_0x8e48db['attributes']:_0x22e661[_0x6fab('0x31')];if(!_0x620c1b[_0x6fab('0x33')][_0x6fab('0x3a')](_0x6fab('0x3b'))){_0x8e48db[_0x6fab('0x1f')]=qs[_0x6fab('0x1f')](_0x620c1b[_0x6fab('0x33')]['limit']);_0x8e48db['offset']=qs['offset'](_0x620c1b[_0x6fab('0x33')][_0x6fab('0x1d')]);}_0x8e48db[_0x6fab('0x3c')]=qs['sort'](_0x620c1b[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x8e48db[_0x6fab('0x3e')]=qs['filters'](_[_0x6fab('0x3f')](_0x620c1b[_0x6fab('0x33')],_0x22e661['filters']),_0x4e9b03);if(_0x620c1b[_0x6fab('0x33')][_0x6fab('0x40')]){_0x8e48db[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x8e48db[_0x6fab('0x3e')],{'$or':_[_0x6fab('0x2d')](_0x4e9b03,function(_0x25b284){if(_0x25b284[_0x6fab('0x30')]!=='VIRTUAL'){var _0x1015a8={};_0x1015a8[_0x25b284[_0x6fab('0x32')]]={'$like':'%'+_0x620c1b[_0x6fab('0x33')][_0x6fab('0x40')]+'%'};return _0x1015a8;}})});}_0x8e48db=_[_0x6fab('0x41')]({},_0x8e48db,_0x620c1b[_0x6fab('0x42')]);var _0x366466={'where':_0x8e48db[_0x6fab('0x3e')]};return db[_0x6fab('0x2e')][_0x6fab('0x20')](_0x366466)[_0x6fab('0x27')](function(_0x16bb03){_0x2aef15[_0x6fab('0x20')]=_0x16bb03;if(_0x620c1b[_0x6fab('0x33')]['includeAll']){_0x8e48db['include']=[{'all':!![]}];}return db[_0x6fab('0x2e')]['findAll'](_0x8e48db);})[_0x6fab('0x27')](function(_0x1be165){_0x2aef15['rows']=_0x1be165;return _0x2aef15;})[_0x6fab('0x27')](respondWithFilteredResult(_0xb896cc,_0x8e48db))[_0x6fab('0x43')](handleError(_0xb896cc,null));};exports[_0x6fab('0x44')]=function(_0x3f4c45,_0x876057){var _0x3c60ef={'raw':![],'where':{'id':_0x3f4c45['params']['id']}},_0x23ab97={};_0x23ab97[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x2e')][_0x6fab('0x2f')]);_0x23ab97[_0x6fab('0x33')]=_['keys'](_0x3f4c45[_0x6fab('0x33')]);_0x23ab97[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x23ab97['model'],_0x23ab97[_0x6fab('0x33')]);_0x3c60ef[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0x23ab97[_0x6fab('0x31')],qs[_0x6fab('0x38')](_0x3f4c45[_0x6fab('0x33')][_0x6fab('0x38')]));_0x3c60ef[_0x6fab('0x37')]=_0x3c60ef[_0x6fab('0x37')][_0x6fab('0x39')]?_0x3c60ef['attributes']:_0x23ab97[_0x6fab('0x31')];if(_0x3f4c45[_0x6fab('0x33')][_0x6fab('0x45')]){_0x3c60ef['include']=[{'all':!![]}];}_0x3c60ef=_['merge']({},_0x3c60ef,_0x3f4c45[_0x6fab('0x42')]);return db['Automation'][_0x6fab('0x46')](_0x3c60ef)[_0x6fab('0x27')](handleEntityNotFound(_0x876057,null))['then'](respondWithResult(_0x876057,null))['catch'](handleError(_0x876057,null));};exports['create']=function(_0x527dd,_0x378934){return db[_0x6fab('0x2e')][_0x6fab('0x47')](_0x527dd[_0x6fab('0x48')],{})['then'](respondWithResult(_0x378934,0xc9))[_0x6fab('0x43')](handleError(_0x378934,null));};exports['update']=function(_0x350d5c,_0xe7299){if(_0x350d5c[_0x6fab('0x48')]['id']){delete _0x350d5c[_0x6fab('0x48')]['id'];}return db[_0x6fab('0x2e')][_0x6fab('0x46')]({'where':{'id':_0x350d5c[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0xe7299,null))[_0x6fab('0x27')](saveUpdates(_0x350d5c[_0x6fab('0x48')],null))[_0x6fab('0x27')](respondWithResult(_0xe7299,null))[_0x6fab('0x43')](handleError(_0xe7299,null));};exports['destroy']=function(_0x80e448,_0x17e5a3){return db[_0x6fab('0x2e')][_0x6fab('0x46')]({'where':{'id':_0x80e448[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x17e5a3,null))[_0x6fab('0x27')](removeEntity(_0x17e5a3,null))['catch'](handleError(_0x17e5a3,null));};exports[_0x6fab('0x4a')]=function(_0x161d1d,_0x35f853,_0x225264){return db[_0x6fab('0x4b')][_0x6fab('0x46')]({'where':{'id':_0x161d1d[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x35f853,null))['then'](function(_0x29bb57){if(_0x29bb57){return _0x29bb57[_0x6fab('0x4a')](_0x161d1d['body'][_0x6fab('0x4c')],_[_0x6fab('0x4d')](_0x161d1d[_0x6fab('0x48')],[_0x6fab('0x4c'),'id'])||{});}})[_0x6fab('0x27')](respondWithResult(_0x35f853,null))[_0x6fab('0x43')](handleError(_0x35f853,null));};exports['getConditions']=function(_0xc0c987,_0x109ee6,_0x39e9a7){var _0x19717b={};var _0xca9bcc={};var _0x157501;var _0xcd992f;return db[_0x6fab('0x2e')]['findOne']({'where':{'id':_0xc0c987[_0x6fab('0x49')]['id']}})['then'](handleEntityNotFound(_0x109ee6,null))[_0x6fab('0x27')](function(_0x164291){if(_0x164291){_0x157501=_0x164291;_0xca9bcc[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x4b')]['rawAttributes']);_0xca9bcc[_0x6fab('0x33')]=_[_0x6fab('0x34')](_0xc0c987['query']);_0xca9bcc[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0xca9bcc[_0x6fab('0x31')],_0xca9bcc[_0x6fab('0x33')]);_0x19717b[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0xca9bcc[_0x6fab('0x31')],qs['fields'](_0xc0c987[_0x6fab('0x33')]['fields']));_0x19717b[_0x6fab('0x37')]=_0x19717b[_0x6fab('0x37')][_0x6fab('0x39')]?_0x19717b[_0x6fab('0x37')]:_0xca9bcc[_0x6fab('0x31')];_0x19717b[_0x6fab('0x3c')]=qs[_0x6fab('0x3d')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x19717b['where']=qs['filters'](_['pick'](_0xc0c987[_0x6fab('0x33')],_0xca9bcc[_0x6fab('0x35')]));if(_0xc0c987[_0x6fab('0x33')]['filter']){_0x19717b[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x19717b[_0x6fab('0x3e')],{'$or':_['map'](_0x19717b['attributes'],function(_0x6bbcb4){var _0x11c4e1={};_0x11c4e1[_0x6bbcb4]={'$like':'%'+_0xc0c987[_0x6fab('0x33')][_0x6fab('0x40')]+'%'};return _0x11c4e1;})});}_0x19717b=_[_0x6fab('0x41')]({},_0x19717b,_0xc0c987[_0x6fab('0x42')]);return _0x157501[_0x6fab('0x4e')](_0x19717b);}})[_0x6fab('0x27')](function(_0x5146f){if(_0x5146f){_0xcd992f=_0x5146f['length'];if(!_0xc0c987[_0x6fab('0x33')][_0x6fab('0x3a')]('nolimit')){_0x19717b[_0x6fab('0x1f')]=qs[_0x6fab('0x1f')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x1f')]);_0x19717b[_0x6fab('0x1d')]=qs[_0x6fab('0x1d')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x1d')]);}return _0x157501[_0x6fab('0x4e')](_0x19717b);}})['then'](function(_0x5a6af4){if(_0x5a6af4){return _0x5a6af4?{'count':_0xcd992f,'rows':_0x5a6af4}:null;}})[_0x6fab('0x27')](respondWithResult(_0x109ee6,null))['catch'](handleError(_0x109ee6,null));};exports[_0x6fab('0x4f')]=function(_0x448daa,_0x3a11c6,_0x23724f){return db[_0x6fab('0x50')][_0x6fab('0x46')]({'where':{'id':_0x448daa[_0x6fab('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a11c6,null))['then'](function(_0x4202ea){if(_0x4202ea){return _0x4202ea[_0x6fab('0x4f')](_0x448daa[_0x6fab('0x48')][_0x6fab('0x4c')],_[_0x6fab('0x4d')](_0x448daa['body'],[_0x6fab('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x3a11c6,null))[_0x6fab('0x43')](handleError(_0x3a11c6,null));};exports[_0x6fab('0x51')]=function(_0x38d1b9,_0x5aec9a,_0x43cac1){var _0x3ec90e={};var _0x2b4c22={};var _0x29bd89;var _0x59b7e5;return db[_0x6fab('0x2e')][_0x6fab('0x52')]({'where':{'id':_0x38d1b9[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x5aec9a,null))['then'](function(_0x22879b){if(_0x22879b){_0x29bd89=_0x22879b;_0x2b4c22[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x50')][_0x6fab('0x2f')]);_0x2b4c22['query']=_[_0x6fab('0x34')](_0x38d1b9['query']);_0x2b4c22[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x2b4c22[_0x6fab('0x31')],_0x2b4c22['query']);_0x3ec90e[_0x6fab('0x37')]=_['intersection'](_0x2b4c22[_0x6fab('0x31')],qs['fields'](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x38')]));_0x3ec90e[_0x6fab('0x37')]=_0x3ec90e[_0x6fab('0x37')][_0x6fab('0x39')]?_0x3ec90e[_0x6fab('0x37')]:_0x2b4c22[_0x6fab('0x31')];_0x3ec90e[_0x6fab('0x3c')]=qs[_0x6fab('0x3d')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x3ec90e[_0x6fab('0x3e')]=qs[_0x6fab('0x35')](_[_0x6fab('0x3f')](_0x38d1b9['query'],_0x2b4c22[_0x6fab('0x35')]));if(_0x38d1b9[_0x6fab('0x33')]['filter']){_0x3ec90e[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x3ec90e[_0x6fab('0x3e')],{'$or':_[_0x6fab('0x2d')](_0x3ec90e[_0x6fab('0x37')],function(_0x579c2c){var _0x1574ce={};_0x1574ce[_0x579c2c]={'$like':'%'+_0x38d1b9[_0x6fab('0x33')]['filter']+'%'};return _0x1574ce;})});}_0x3ec90e=_[_0x6fab('0x41')]({},_0x3ec90e,_0x38d1b9[_0x6fab('0x42')]);return _0x29bd89[_0x6fab('0x51')](_0x3ec90e);}})[_0x6fab('0x27')](function(_0x39a2f5){if(_0x39a2f5){_0x59b7e5=_0x39a2f5[_0x6fab('0x39')];if(!_0x38d1b9['query'][_0x6fab('0x3a')](_0x6fab('0x3b'))){_0x3ec90e['limit']=qs[_0x6fab('0x1f')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x1f')]);_0x3ec90e[_0x6fab('0x1d')]=qs[_0x6fab('0x1d')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x1d')]);}return _0x29bd89[_0x6fab('0x51')](_0x3ec90e);}})[_0x6fab('0x27')](function(_0x3c78b6){if(_0x3c78b6){return _0x3c78b6?{'count':_0x59b7e5,'rows':_0x3c78b6}:null;}})['then'](respondWithResult(_0x5aec9a,null))[_0x6fab('0x43')](handleError(_0x5aec9a,null));};
\ No newline at end of file
+var _0x7ca7=['findOne','Condition','order','pick','getConditions','Action','addActions','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','options','find','body','addConditions','ids','omit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7ca7,0x164));var _0x77ca=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x7ca7[_0x238671];return _0x474844;};'use strict';var emlformat=require(_0x77ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77ca('0x1'));var rp=require(_0x77ca('0x2'));var moment=require(_0x77ca('0x3'));var BPromise=require(_0x77ca('0x4'));var Mustache=require('mustache');var util=require(_0x77ca('0x5'));var path=require(_0x77ca('0x6'));var sox=require(_0x77ca('0x7'));var csv=require('to-csv');var ejs=require(_0x77ca('0x8'));var fs=require('fs');var fs_extra=require(_0x77ca('0x9'));var _=require(_0x77ca('0xa'));var squel=require(_0x77ca('0xb'));var crypto=require('crypto');var jsforce=require(_0x77ca('0xc'));var deskjs=require(_0x77ca('0xd'));var toCsv=require(_0x77ca('0xe'));var querystring=require('querystring');var Papa=require(_0x77ca('0xf'));var Redis=require(_0x77ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77ca('0x11'));var as=require(_0x77ca('0x12'));var hardwareService=require(_0x77ca('0x13'));var logger=require(_0x77ca('0x14'))(_0x77ca('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x77ca('0x16'));var db=require(_0x77ca('0x17'))['db'];function respondWithStatusCode(_0x27d5f9,_0xdb00b5){_0xdb00b5=_0xdb00b5||0xcc;return function(_0x30dc9c){if(_0x30dc9c){return _0x27d5f9[_0x77ca('0x18')](_0xdb00b5);}return _0x27d5f9[_0x77ca('0x19')](_0xdb00b5)[_0x77ca('0x1a')]();};}function respondWithResult(_0xacb434,_0x1e2600){_0x1e2600=_0x1e2600||0xc8;return function(_0x5f1ccb){if(_0x5f1ccb){return _0xacb434['status'](_0x1e2600)[_0x77ca('0x1b')](_0x5f1ccb);}};}function respondWithFilteredResult(_0x5313fe,_0x52614a){return function(_0x119b53){if(_0x119b53){var _0x68daf8=typeof _0x52614a['offset']==='undefined'&&typeof _0x52614a[_0x77ca('0x1c')]===_0x77ca('0x1d');var _0x1c4faf=_0x119b53[_0x77ca('0x1e')];var _0x2e4a87=_0x68daf8?0x0:_0x52614a['offset'];var _0x56905b=_0x68daf8?_0x119b53['count']:_0x52614a[_0x77ca('0x1f')]+_0x52614a[_0x77ca('0x1c')];var _0x41e27b;if(_0x56905b>=_0x1c4faf){_0x56905b=_0x1c4faf;_0x41e27b=0xc8;}else{_0x41e27b=0xce;}_0x5313fe[_0x77ca('0x19')](_0x41e27b);return _0x5313fe[_0x77ca('0x20')](_0x77ca('0x21'),_0x2e4a87+'-'+_0x56905b+'/'+_0x1c4faf)[_0x77ca('0x1b')](_0x119b53);}return null;};}function patchUpdates(_0x4d8655){return function(_0x34ab02){try{jsonpatch[_0x77ca('0x22')](_0x34ab02,_0x4d8655,!![]);}catch(_0x4af6dc){return BPromise[_0x77ca('0x23')](_0x4af6dc);}return _0x34ab02[_0x77ca('0x24')]();};}function saveUpdates(_0xe9d25f,_0x59be2e){return function(_0x42ed21){if(_0x42ed21){return _0x42ed21[_0x77ca('0x25')](_0xe9d25f)['then'](function(_0x1a8e36){return _0x1a8e36;});}return null;};}function removeEntity(_0x10dba5,_0x592483){return function(_0x4b01ea){if(_0x4b01ea){return _0x4b01ea[_0x77ca('0x26')]()[_0x77ca('0x27')](function(){_0x10dba5[_0x77ca('0x19')](0xcc)[_0x77ca('0x1a')]();});}};}function handleEntityNotFound(_0x271b12,_0x571db9){return function(_0x5e5c12){if(!_0x5e5c12){_0x271b12['sendStatus'](0x194);}return _0x5e5c12;};}function handleError(_0x17188f,_0x3bfb29){_0x3bfb29=_0x3bfb29||0x1f4;return function(_0x5a7d44){logger[_0x77ca('0x28')](_0x5a7d44[_0x77ca('0x29')]);if(_0x5a7d44[_0x77ca('0x2a')]){delete _0x5a7d44[_0x77ca('0x2a')];}_0x17188f[_0x77ca('0x19')](_0x3bfb29)[_0x77ca('0x2b')](_0x5a7d44);};}exports[_0x77ca('0x2c')]=function(_0x2f67cc,_0x82a6cd){var _0x358086={},_0xb868a8={},_0x4ac1a2={'count':0x0,'rows':[]};var _0xbfc35a=_[_0x77ca('0x2d')](db[_0x77ca('0x2e')][_0x77ca('0x2f')],function(_0x2c9f69){return{'name':_0x2c9f69[_0x77ca('0x30')],'type':_0x2c9f69[_0x77ca('0x31')][_0x77ca('0x32')]};});_0xb868a8[_0x77ca('0x33')]=_[_0x77ca('0x2d')](_0xbfc35a,_0x77ca('0x2a'));_0xb868a8[_0x77ca('0x34')]=_['keys'](_0x2f67cc['query']);_0xb868a8[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],_0xb868a8[_0x77ca('0x34')]);_0x358086[_0x77ca('0x37')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],qs['fields'](_0x2f67cc['query']['fields']));_0x358086[_0x77ca('0x37')]=_0x358086[_0x77ca('0x37')]['length']?_0x358086[_0x77ca('0x37')]:_0xb868a8[_0x77ca('0x33')];if(!_0x2f67cc['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x358086['limit']=qs[_0x77ca('0x1c')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x358086[_0x77ca('0x1f')]=qs[_0x77ca('0x1f')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1f')]);}_0x358086['order']=qs[_0x77ca('0x3a')](_0x2f67cc['query'][_0x77ca('0x3a')]);_0x358086[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_['pick'](_0x2f67cc[_0x77ca('0x34')],_0xb868a8['filters']),_0xbfc35a);if(_0x2f67cc['query'][_0x77ca('0x3c')]){_0x358086[_0x77ca('0x3b')]=_[_0x77ca('0x3d')](_0x358086['where'],{'$or':_[_0x77ca('0x2d')](_0xbfc35a,function(_0x12a9ef){if(_0x12a9ef['type']!==_0x77ca('0x3e')){var _0x30af40={};_0x30af40[_0x12a9ef[_0x77ca('0x2a')]]={'$like':'%'+_0x2f67cc['query']['filter']+'%'};return _0x30af40;}})});}_0x358086=_[_0x77ca('0x3d')]({},_0x358086,_0x2f67cc['options']);var _0x4c3cec={'where':_0x358086[_0x77ca('0x3b')]};return db['Automation'][_0x77ca('0x1e')](_0x4c3cec)['then'](function(_0x2d5e53){_0x4ac1a2[_0x77ca('0x1e')]=_0x2d5e53;if(_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x3f')]){_0x358086[_0x77ca('0x40')]=[{'all':!![]}];}return db[_0x77ca('0x2e')][_0x77ca('0x41')](_0x358086);})[_0x77ca('0x27')](function(_0x5b04bd){_0x4ac1a2[_0x77ca('0x42')]=_0x5b04bd;return _0x4ac1a2;})[_0x77ca('0x27')](respondWithFilteredResult(_0x82a6cd,_0x358086))[_0x77ca('0x43')](handleError(_0x82a6cd,null));};exports[_0x77ca('0x44')]=function(_0x13c9fc,_0x2f62cc){var _0x27d739={'raw':![],'where':{'id':_0x13c9fc[_0x77ca('0x45')]['id']}},_0x18366b={};_0x18366b[_0x77ca('0x33')]=_['keys'](db['Automation'][_0x77ca('0x2f')]);_0x18366b[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x13c9fc['query']);_0x18366b['filters']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],_0x18366b[_0x77ca('0x34')]);_0x27d739['attributes']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],qs[_0x77ca('0x47')](_0x13c9fc[_0x77ca('0x34')][_0x77ca('0x47')]));_0x27d739[_0x77ca('0x37')]=_0x27d739[_0x77ca('0x37')][_0x77ca('0x48')]?_0x27d739[_0x77ca('0x37')]:_0x18366b[_0x77ca('0x33')];if(_0x13c9fc['query']['includeAll']){_0x27d739['include']=[{'all':!![]}];}_0x27d739=_[_0x77ca('0x3d')]({},_0x27d739,_0x13c9fc[_0x77ca('0x49')]);return db[_0x77ca('0x2e')][_0x77ca('0x4a')](_0x27d739)[_0x77ca('0x27')](handleEntityNotFound(_0x2f62cc,null))['then'](respondWithResult(_0x2f62cc,null))['catch'](handleError(_0x2f62cc,null));};exports['create']=function(_0x25e635,_0x9e8bcf){return db['Automation']['create'](_0x25e635['body'],{})['then'](respondWithResult(_0x9e8bcf,0xc9))[_0x77ca('0x43')](handleError(_0x9e8bcf,null));};exports['update']=function(_0x3f0279,_0x54a55c){if(_0x3f0279[_0x77ca('0x4b')]['id']){delete _0x3f0279['body']['id'];}return db[_0x77ca('0x2e')]['find']({'where':{'id':_0x3f0279[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x54a55c,null))[_0x77ca('0x27')](saveUpdates(_0x3f0279['body'],null))[_0x77ca('0x27')](respondWithResult(_0x54a55c,null))[_0x77ca('0x43')](handleError(_0x54a55c,null));};exports[_0x77ca('0x26')]=function(_0x4bd644,_0x3901a4){return db['Automation'][_0x77ca('0x4a')]({'where':{'id':_0x4bd644[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x3901a4,null))[_0x77ca('0x27')](removeEntity(_0x3901a4,null))[_0x77ca('0x43')](handleError(_0x3901a4,null));};exports[_0x77ca('0x4c')]=function(_0x4fec2c,_0x118fea,_0x515d27){return db['Condition'][_0x77ca('0x4a')]({'where':{'id':_0x4fec2c[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x118fea,null))[_0x77ca('0x27')](function(_0x5b0e75){if(_0x5b0e75){return _0x5b0e75[_0x77ca('0x4c')](_0x4fec2c['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4fec2c[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x118fea,null))[_0x77ca('0x43')](handleError(_0x118fea,null));};exports['getConditions']=function(_0x3caf44,_0x2eb218,_0x1da7c6){var _0x26212f={};var _0x4a0fdf={};var _0x40f590;var _0x24d8c8;return db[_0x77ca('0x2e')][_0x77ca('0x4f')]({'where':{'id':_0x3caf44[_0x77ca('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb218,null))['then'](function(_0x19601e){if(_0x19601e){_0x40f590=_0x19601e;_0x4a0fdf[_0x77ca('0x33')]=_['keys'](db[_0x77ca('0x50')][_0x77ca('0x2f')]);_0x4a0fdf[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x3caf44[_0x77ca('0x34')]);_0x4a0fdf[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0x4a0fdf[_0x77ca('0x33')],_0x4a0fdf['query']);_0x26212f['attributes']=_['intersection'](_0x4a0fdf['model'],qs[_0x77ca('0x47')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x47')]));_0x26212f[_0x77ca('0x37')]=_0x26212f[_0x77ca('0x37')][_0x77ca('0x48')]?_0x26212f['attributes']:_0x4a0fdf['model'];_0x26212f[_0x77ca('0x51')]=qs[_0x77ca('0x3a')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x26212f[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_[_0x77ca('0x52')](_0x3caf44[_0x77ca('0x34')],_0x4a0fdf['filters']));if(_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x26212f['where']=_['merge'](_0x26212f['where'],{'$or':_['map'](_0x26212f['attributes'],function(_0xaa62f4){var _0x5734d1={};_0x5734d1[_0xaa62f4]={'$like':'%'+_0x3caf44[_0x77ca('0x34')]['filter']+'%'};return _0x5734d1;})});}_0x26212f=_[_0x77ca('0x3d')]({},_0x26212f,_0x3caf44['options']);return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x50030f){if(_0x50030f){_0x24d8c8=_0x50030f[_0x77ca('0x48')];if(!_0x3caf44[_0x77ca('0x34')][_0x77ca('0x38')]('nolimit')){_0x26212f[_0x77ca('0x1c')]=qs[_0x77ca('0x1c')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x26212f['offset']=qs[_0x77ca('0x1f')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x24602c){if(_0x24602c){return _0x24602c?{'count':_0x24d8c8,'rows':_0x24602c}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2eb218,null))['catch'](handleError(_0x2eb218,null));};exports['addActions']=function(_0x4213fe,_0x28bcfe,_0x73d048){return db[_0x77ca('0x54')][_0x77ca('0x4a')]({'where':{'id':_0x4213fe[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x28bcfe,null))[_0x77ca('0x27')](function(_0x3f2724){if(_0x3f2724){return _0x3f2724[_0x77ca('0x55')](_0x4213fe['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4213fe[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x28bcfe,null))[_0x77ca('0x43')](handleError(_0x28bcfe,null));};exports['getActions']=function(_0x395457,_0x2a4ba4,_0x2f5489){var _0x1f73ea={};var _0x5e0505={};var _0x3bf12a;var _0x47c23c;return db[_0x77ca('0x2e')]['findOne']({'where':{'id':_0x395457[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x2a4ba4,null))[_0x77ca('0x27')](function(_0x6ec020){if(_0x6ec020){_0x3bf12a=_0x6ec020;_0x5e0505[_0x77ca('0x33')]=_[_0x77ca('0x46')](db['Action'][_0x77ca('0x2f')]);_0x5e0505[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x395457[_0x77ca('0x34')]);_0x5e0505['filters']=_['intersection'](_0x5e0505[_0x77ca('0x33')],_0x5e0505[_0x77ca('0x34')]);_0x1f73ea['attributes']=_[_0x77ca('0x36')](_0x5e0505['model'],qs[_0x77ca('0x47')](_0x395457[_0x77ca('0x34')][_0x77ca('0x47')]));_0x1f73ea['attributes']=_0x1f73ea[_0x77ca('0x37')]['length']?_0x1f73ea[_0x77ca('0x37')]:_0x5e0505[_0x77ca('0x33')];_0x1f73ea[_0x77ca('0x51')]=qs['sort'](_0x395457[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x1f73ea['where']=qs[_0x77ca('0x35')](_['pick'](_0x395457['query'],_0x5e0505[_0x77ca('0x35')]));if(_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x1f73ea[_0x77ca('0x3b')]=_['merge'](_0x1f73ea[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x2d')](_0x1f73ea[_0x77ca('0x37')],function(_0x26db94){var _0x4b8e5f={};_0x4b8e5f[_0x26db94]={'$like':'%'+_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]+'%'};return _0x4b8e5f;})});}_0x1f73ea=_[_0x77ca('0x3d')]({},_0x1f73ea,_0x395457['options']);return _0x3bf12a['getActions'](_0x1f73ea);}})['then'](function(_0x58d232){if(_0x58d232){_0x47c23c=_0x58d232[_0x77ca('0x48')];if(!_0x395457['query']['hasOwnProperty'](_0x77ca('0x39'))){_0x1f73ea[_0x77ca('0x1c')]=qs['limit'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x1f73ea[_0x77ca('0x1f')]=qs['offset'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x3bf12a[_0x77ca('0x56')](_0x1f73ea);}})['then'](function(_0x4e5907){if(_0x4e5907){return _0x4e5907?{'count':_0x47c23c,'rows':_0x4e5907}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2a4ba4,null))[_0x77ca('0x43')](handleError(_0x2a4ba4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index bb0fac5..c52220b 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 _0x27bd=['path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x494eb3,_0x5378c8){var _0x2a7eef=function(_0x20934f){while(--_0x20934f){_0x494eb3['push'](_0x494eb3['shift']());}};_0x2a7eef(++_0x5378c8);}(_0x27bd,0x66));var _0xd27b=function(_0x2a98d4,_0x4a0924){_0x2a98d4=_0x2a98d4-0x0;var _0x48c785=_0x27bd[_0x2a98d4];return _0x48c785;};'use strict';var _=require(_0xd27b('0x0'));var util=require(_0xd27b('0x1'));var logger=require('../../config/logger')(_0xd27b('0x2'));var moment=require(_0xd27b('0x3'));var BPromise=require(_0xd27b('0x4'));var rp=require(_0xd27b('0x5'));var fs=require('fs');var path=require(_0xd27b('0x6'));var rimraf=require(_0xd27b('0x7'));var config=require('../../config/environment');var attributes=require(_0xd27b('0x8'));module[_0xd27b('0x9')]=function(_0x391aba,_0x1ad258){return _0x391aba[_0xd27b('0xa')]('Automation',attributes,{'tableName':_0xd27b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7a4=['define','Automation','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xb7a4,0xe2));var _0x4b7a=function(_0x258a9f,_0xdd62ce){_0x258a9f=_0x258a9f-0x0;var _0xd06cb8=_0xb7a4[_0x258a9f];return _0xd06cb8;};'use strict';var _=require(_0x4b7a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4b7a('0x1'));var BPromise=require(_0x4b7a('0x2'));var rp=require(_0x4b7a('0x3'));var fs=require('fs');var path=require(_0x4b7a('0x4'));var rimraf=require('rimraf');var config=require(_0x4b7a('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x120f07,_0x144416){return _0x120f07[_0x4b7a('0x6')](_0x4b7a('0x7'),attributes,{'tableName':'tools_automations','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 97701ba..d3d443d 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 _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xf911e5,_0x2909ee){var _0x26e8f4=function(_0x331ede){while(--_0x331ede){_0xf911e5['push'](_0xf911e5['shift']());}};_0x26e8f4(++_0x2909ee);}(_0x753c,0x96));var _0xc753=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x753c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});}
\ No newline at end of file
+var _0xb79a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x689cd7,_0x596cb1){var _0x1da31d=function(_0x132cac){while(--_0x132cac){_0x689cd7['push'](_0x689cd7['shift']());}};_0x1da31d(++_0x596cb1);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var moment=require('moment');var BPromise=require(_0xab79('0x2'));var rs=require(_0xab79('0x3'));var fs=require('fs');var Redis=require(_0xab79('0x4'));var db=require(_0xab79('0x5'))['db'];var utils=require(_0xab79('0x6'));var logger=require(_0xab79('0x7'))(_0xab79('0x8'));var config=require(_0xab79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8ba5a,_0x10d402,_0x11ceb3){return new BPromise(function(_0x7eabd1,_0x4585fe){return client[_0xab79('0xb')](_0xe8ba5a,_0x11ceb3)[_0xab79('0xc')](function(_0x426cb9){logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,_0xab79('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10d402,_0xab79('0xf'),JSON[_0xab79('0x10')](_0x426cb9));if(_0x426cb9[_0xab79('0x11')]){if(_0x426cb9[_0xab79('0x11')][_0xab79('0x12')]===0x1f4){logger[_0xab79('0x11')]('Automation,\x20%s,\x20%s',_0x10d402,_0x426cb9['error'][_0xab79('0x13')]);return _0x4585fe(_0x426cb9['error'][_0xab79('0x13')]);}logger[_0xab79('0x11')](_0xab79('0xe'),_0x10d402,_0x426cb9['error']['message']);return _0x7eabd1(_0x426cb9['error']['message']);}else{logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,'request\x20sent');_0x7eabd1(_0x426cb9['result']['message']);}})[_0xab79('0x14')](function(_0xc9650d){logger['error'](_0xab79('0xe'),_0x10d402,_0xc9650d);_0x4585fe(_0xc9650d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 03c0491..5731bab 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 _0x1229=['index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','put','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./automation.controller','get'];(function(_0x215842,_0x533f47){var _0x151ee5=function(_0x25ee9b){while(--_0x25ee9b){_0x215842['push'](_0x215842['shift']());}};_0x151ee5(++_0x533f47);}(_0x1229,0xac));var _0x9122=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x1229[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require('multer');var util=require(_0x9122('0x0'));var path=require(_0x9122('0x1'));var timeout=require(_0x9122('0x2'));var express=require(_0x9122('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9122('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9122('0x5'));var controller=require(_0x9122('0x6'));router[_0x9122('0x7')]('/',auth['isAuthenticated'](),controller[_0x9122('0x8')]);router[_0x9122('0x7')](_0x9122('0x9'),auth[_0x9122('0xa')](),controller[_0x9122('0xb')]);router['get'](_0x9122('0xc'),auth['isAuthenticated'](),controller[_0x9122('0xd')]);router[_0x9122('0x7')](_0x9122('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0x9122('0xf')]('/',auth[_0x9122('0xa')](),controller['create']);router[_0x9122('0xf')](_0x9122('0xc'),auth[_0x9122('0xa')](),controller[_0x9122('0x10')]);router[_0x9122('0xf')](_0x9122('0xe'),auth[_0x9122('0xa')](),controller['addActions']);router[_0x9122('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9122('0x12')](_0x9122('0x9'),auth[_0x9122('0xa')](),controller[_0x9122('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x833b=['get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x833b,0x131));var _0xb833=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x833b[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0x7')](_0xb833('0xc'),auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router['get'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0xf')]);router[_0xb833('0x10')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x11')]);router['post']('/:id/conditions',auth[_0xb833('0x8')](),controller[_0xb833('0x12')]);router['post'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0x13')]);router[_0xb833('0x14')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0x15')]);router[_0xb833('0x16')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller['destroy']);module[_0xb833('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6d69e94..f7d3d96 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 _0x5fbd=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#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','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5fbd,0x109));var _0xd5fb=function(_0x3d41ba,_0x4fce49){_0x3d41ba=_0x3d41ba-0x0;var _0x375cfd=_0x5fbd[_0x3d41ba];return _0x375cfd;};'use strict';var Sequelize=require('sequelize');module[_0xd5fb('0x0')]={'name':{'type':Sequelize[_0xd5fb('0x1')],'unique':_0xd5fb('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd5fb('0x3')](_0xd5fb('0x4')),'allowNull':![],'defaultValue':_0xd5fb('0x4')},'description':{'type':Sequelize[_0xd5fb('0x1')]},'active':{'type':Sequelize[_0xd5fb('0x5')],'defaultValue':0x0,'comment':_0xd5fb('0x6')},'limitCalls':{'type':Sequelize[_0xd5fb('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd5fb('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd5fb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd5fb('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd5fb('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd5fb('0x11')},'dialTimezone':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':_0xd5fb('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xd5fb('0x3')](_0xd5fb('0x13'),_0xd5fb('0x14'),_0xd5fb('0x15')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd5fb('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd5fb('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd5fb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd5fb('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd5fb('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd5fb('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd5fb('0x1a'),'ASC'),'defaultValue':_0xd5fb('0x1a')},'dialPrefix':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd5fb('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd5fb('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x24')}};
\ No newline at end of file
+var _0x62a8=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x62a8,0x16b));var _0x862a=function(_0x49be98,_0x441f1c){_0x49be98=_0x49be98-0x0;var _0x5053b2=_0x62a8[_0x49be98];return _0x5053b2;};'use strict';var Sequelize=require(_0x862a('0x0'));module[_0x862a('0x1')]={'name':{'type':Sequelize[_0x862a('0x2')],'unique':_0x862a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x862a('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x862a('0x5')},'description':{'type':Sequelize[_0x862a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x862a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x862a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x862a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x862a('0xf')},'dialTimezone':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x862a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x862a('0x4')](_0x862a('0x10'),'never',_0x862a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x862a('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x862a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x862a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x862a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x862a('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x862a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x862a('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x862a('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x862a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('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':_0x862a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 83049b2..486f150 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 _0x9563=['CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','reject','save','update','destroy','then','IvrCampaigns','end','error','stack','name','send','map','Campaign','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','UserProfileSection','getHoppers','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks'];(function(_0x472d57,_0x322895){var _0x6e7242=function(_0x1ed660){while(--_0x1ed660){_0x472d57['push'](_0x472d57['shift']());}};_0x6e7242(++_0x322895);}(_0x9563,0x1e7));var _0x3956=function(_0x238071,_0x317867){_0x238071=_0x238071-0x0;var _0x183456=_0x9563[_0x238071];return _0x183456;};'use strict';var emlformat=require(_0x3956('0x0'));var rimraf=require(_0x3956('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3956('0x2'));var rp=require(_0x3956('0x3'));var moment=require(_0x3956('0x4'));var BPromise=require(_0x3956('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3956('0x6'));var sox=require('sox');var csv=require(_0x3956('0x7'));var ejs=require(_0x3956('0x8'));var fs=require('fs');var fs_extra=require(_0x3956('0x9'));var _=require(_0x3956('0xa'));var squel=require('squel');var crypto=require(_0x3956('0xb'));var jsforce=require(_0x3956('0xc'));var deskjs=require(_0x3956('0xd'));var toCsv=require(_0x3956('0x7'));var querystring=require(_0x3956('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3956('0xf'));var qs=require(_0x3956('0x10'));var as=require(_0x3956('0x11'));var hardwareService=require(_0x3956('0x12'));var logger=require('../../config/logger')(_0x3956('0x13'));var utils=require(_0x3956('0x14'));var config=require(_0x3956('0x15'));var licenseUtil=require(_0x3956('0x16'));var db=require(_0x3956('0x17'))['db'];function respondWithStatusCode(_0x1b417f,_0x44d37c){_0x44d37c=_0x44d37c||0xcc;return function(_0x1156a3){if(_0x1156a3){return _0x1b417f[_0x3956('0x18')](_0x44d37c);}return _0x1b417f['status'](_0x44d37c)['end']();};}function respondWithResult(_0x53c577,_0xb7fad6){_0xb7fad6=_0xb7fad6||0xc8;return function(_0x3b5eb1){if(_0x3b5eb1){return _0x53c577['status'](_0xb7fad6)[_0x3956('0x19')](_0x3b5eb1);}};}function respondWithFilteredResult(_0x384b31,_0x375980){return function(_0x19bd9c){if(_0x19bd9c){var _0x29b3bf=typeof _0x375980[_0x3956('0x1a')]===_0x3956('0x1b')&&typeof _0x375980[_0x3956('0x1c')]===_0x3956('0x1b');var _0x1e9745=_0x19bd9c[_0x3956('0x1d')];var _0x189e6c=_0x29b3bf?0x0:_0x375980[_0x3956('0x1a')];var _0x5e23e5=_0x29b3bf?_0x19bd9c[_0x3956('0x1d')]:_0x375980[_0x3956('0x1a')]+_0x375980[_0x3956('0x1c')];var _0x1a305e;if(_0x5e23e5>=_0x1e9745){_0x5e23e5=_0x1e9745;_0x1a305e=0xc8;}else{_0x1a305e=0xce;}_0x384b31[_0x3956('0x1e')](_0x1a305e);return _0x384b31[_0x3956('0x1f')]('Content-Range',_0x189e6c+'-'+_0x5e23e5+'/'+_0x1e9745)[_0x3956('0x19')](_0x19bd9c);}return null;};}function patchUpdates(_0x401aa2){return function(_0x5a2ba1){try{jsonpatch['apply'](_0x5a2ba1,_0x401aa2,!![]);}catch(_0x4d98b0){return BPromise[_0x3956('0x20')](_0x4d98b0);}return _0x5a2ba1[_0x3956('0x21')]();};}function saveUpdates(_0x4e7e56,_0x2f9bb5){return function(_0x5b2fdd){if(_0x5b2fdd){return _0x5b2fdd[_0x3956('0x22')](_0x4e7e56)['then'](function(_0x13feee){return _0x13feee;});}return null;};}function removeEntity(_0x1d39f7,_0x1395d4){return function(_0x1d9163){if(_0x1d9163){return _0x1d9163[_0x3956('0x23')]()[_0x3956('0x24')](function(){var _0x5e27fd=_0x1d9163['get']({'plain':!![]});var _0x23053d=_0x3956('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x23053d,'resourceId':_0x5e27fd['id']}})[_0x3956('0x24')](function(){return _0x1d9163;});})[_0x3956('0x24')](function(){_0x1d39f7['status'](0xcc)[_0x3956('0x26')]();});}};}function handleEntityNotFound(_0x34c843,_0x6dcf67){return function(_0x98bbcf){if(!_0x98bbcf){_0x34c843[_0x3956('0x18')](0x194);}return _0x98bbcf;};}function handleError(_0x4389be,_0x49d309){_0x49d309=_0x49d309||0x1f4;return function(_0x3fa582){logger[_0x3956('0x27')](_0x3fa582[_0x3956('0x28')]);if(_0x3fa582['name']){delete _0x3fa582[_0x3956('0x29')];}_0x4389be[_0x3956('0x1e')](_0x49d309)[_0x3956('0x2a')](_0x3fa582);};}exports['index']=function(_0x1bc983,_0x887861){var _0x8d5bdb={},_0x1681ba={},_0xef1b56={'count':0x0,'rows':[]};var _0x2e60f9=_[_0x3956('0x2b')](db[_0x3956('0x2c')][_0x3956('0x2d')],function(_0x3a6cdf){return{'name':_0x3a6cdf['fieldName'],'type':_0x3a6cdf[_0x3956('0x2e')][_0x3956('0x2f')]};});_0x1681ba['model']=_[_0x3956('0x2b')](_0x2e60f9,_0x3956('0x29'));_0x1681ba['query']=_[_0x3956('0x30')](_0x1bc983['query']);_0x1681ba[_0x3956('0x31')]=_[_0x3956('0x32')](_0x1681ba[_0x3956('0x33')],_0x1681ba['query']);_0x8d5bdb['attributes']=_[_0x3956('0x32')](_0x1681ba[_0x3956('0x33')],qs['fields'](_0x1bc983[_0x3956('0x34')]['fields']));_0x8d5bdb[_0x3956('0x35')]=_0x8d5bdb[_0x3956('0x35')][_0x3956('0x36')]?_0x8d5bdb[_0x3956('0x35')]:_0x1681ba[_0x3956('0x33')];if(!_0x1bc983[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x8d5bdb['limit']=qs[_0x3956('0x1c')](_0x1bc983['query'][_0x3956('0x1c')]);_0x8d5bdb[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x1bc983[_0x3956('0x34')][_0x3956('0x1a')]);}_0x8d5bdb[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x1bc983[_0x3956('0x34')][_0x3956('0x3a')]);_0x8d5bdb[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x1bc983['query'],_0x1681ba[_0x3956('0x31')]),_0x2e60f9);if(_0x1bc983[_0x3956('0x34')][_0x3956('0x3d')]){_0x8d5bdb[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x8d5bdb[_0x3956('0x3b')],{'$or':_[_0x3956('0x2b')](_0x2e60f9,function(_0x6f98f9){if(_0x6f98f9['type']!==_0x3956('0x3f')){var _0xbddef1={};_0xbddef1[_0x6f98f9[_0x3956('0x29')]]={'$like':'%'+_0x1bc983['query'][_0x3956('0x3d')]+'%'};return _0xbddef1;}})});}_0x8d5bdb=_[_0x3956('0x3e')]({},_0x8d5bdb,_0x1bc983['options']);var _0x4774c6={'where':_0x8d5bdb[_0x3956('0x3b')]};return db[_0x3956('0x2c')]['count'](_0x4774c6)[_0x3956('0x24')](function(_0x3e7e2e){_0xef1b56['count']=_0x3e7e2e;if(_0x1bc983['query'][_0x3956('0x40')]){_0x8d5bdb[_0x3956('0x41')]=[{'all':!![]}];}return db[_0x3956('0x2c')][_0x3956('0x42')](_0x8d5bdb);})[_0x3956('0x24')](function(_0x555fec){_0xef1b56[_0x3956('0x43')]=_0x555fec;return _0xef1b56;})['then'](respondWithFilteredResult(_0x887861,_0x8d5bdb))[_0x3956('0x44')](handleError(_0x887861,null));};exports[_0x3956('0x45')]=function(_0x52ed4e,_0x3bdf1e){var _0x4b4abd={'raw':![],'where':{'id':_0x52ed4e[_0x3956('0x46')]['id']}},_0x3f760d={};_0x3f760d[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x2c')][_0x3956('0x2d')]);_0x3f760d[_0x3956('0x34')]=_[_0x3956('0x30')](_0x52ed4e[_0x3956('0x34')]);_0x3f760d['filters']=_[_0x3956('0x32')](_0x3f760d['model'],_0x3f760d[_0x3956('0x34')]);_0x4b4abd[_0x3956('0x35')]=_[_0x3956('0x32')](_0x3f760d['model'],qs['fields'](_0x52ed4e['query'][_0x3956('0x47')]));_0x4b4abd[_0x3956('0x35')]=_0x4b4abd[_0x3956('0x35')][_0x3956('0x36')]?_0x4b4abd['attributes']:_0x3f760d[_0x3956('0x33')];if(_0x52ed4e[_0x3956('0x34')][_0x3956('0x40')]){_0x4b4abd[_0x3956('0x41')]=[{'all':!![]}];}_0x4b4abd=_[_0x3956('0x3e')]({},_0x4b4abd,_0x52ed4e[_0x3956('0x48')]);return db[_0x3956('0x2c')][_0x3956('0x49')](_0x4b4abd)[_0x3956('0x24')](handleEntityNotFound(_0x3bdf1e,null))['then'](respondWithResult(_0x3bdf1e,null))['catch'](handleError(_0x3bdf1e,null));};exports[_0x3956('0x4a')]=function(_0x42ecf4,_0x388587){return db[_0x3956('0x2c')]['create'](_0x42ecf4[_0x3956('0x4b')],{})['then'](function(_0x5ad00c){var _0x6bd2fd=_0x42ecf4[_0x3956('0x4c')][_0x3956('0x4d')]({'plain':!![]});if(!_0x6bd2fd)throw new Error(_0x3956('0x4e'));if(_0x6bd2fd[_0x3956('0x4f')]===_0x3956('0x4c')){var _0x5ebd96=_0x5ad00c[_0x3956('0x4d')]({'plain':!![]});var _0x39a651=_0x3956('0x25');return db['UserProfileSection'][_0x3956('0x49')]({'where':{'name':_0x39a651,'userProfileId':_0x6bd2fd[_0x3956('0x50')]},'raw':!![]})[_0x3956('0x24')](function(_0x5c01a4){if(_0x5c01a4&&_0x5c01a4[_0x3956('0x51')]===0x0){return db['UserProfileResource'][_0x3956('0x4a')]({'name':_0x5ebd96[_0x3956('0x29')],'resourceId':_0x5ebd96['id'],'type':_0x5c01a4[_0x3956('0x29')],'sectionId':_0x5c01a4['id']},{})[_0x3956('0x24')](function(){return _0x5ad00c;});}else{return _0x5ad00c;}})['catch'](function(_0x179d32){logger[_0x3956('0x27')](_0x3956('0x52'),_0x179d32);throw _0x179d32;});}return _0x5ad00c;})[_0x3956('0x24')](respondWithResult(_0x388587,0xc9))[_0x3956('0x44')](handleError(_0x388587,null));};exports[_0x3956('0x53')]=function(_0x58e930,_0x15e523){var _0x33aac9={'where':{'id':_0x58e930[_0x3956('0x46')]['id']}},_0x26c266={};_0x26c266[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x2c')][_0x3956('0x2d')]);_0x33aac9[_0x3956('0x35')]=_[_0x3956('0x32')](_0x26c266[_0x3956('0x33')],qs[_0x3956('0x47')](_0x58e930['query'][_0x3956('0x47')]));_0x33aac9['attributes']=_0x33aac9['attributes'][_0x3956('0x36')]?_0x33aac9[_0x3956('0x35')]:_0x26c266['model'];if(_0x58e930[_0x3956('0x34')][_0x3956('0x40')]){_0x33aac9[_0x3956('0x41')]=[{'all':!![]}];}_0x33aac9=_['merge']({},_0x33aac9,_0x58e930[_0x3956('0x48')]);return db[_0x3956('0x2c')]['find'](_0x33aac9)['then'](handleEntityNotFound(_0x15e523,null))[_0x3956('0x24')](function(_0x1fd8d6){if(_0x1fd8d6){var _0x290cfe=_0x1fd8d6[_0x3956('0x4d')]({'plain':!![]});_0x290cfe=qs[_0x3956('0x54')](_0x290cfe,['id','createdAt',_0x3956('0x55')]);_0x58e930['body']=_[_0x3956('0x54')](_0x58e930[_0x3956('0x4b')],['id',_0x3956('0x56'),'updatedAt']);return db[_0x3956('0x2c')][_0x3956('0x4a')](_['merge'](_0x290cfe,_0x58e930[_0x3956('0x4b')]),{'include':_0x58e930['query'][_0x3956('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x1fae63){var _0x1cc14a=_0x58e930[_0x3956('0x4c')][_0x3956('0x4d')]({'plain':!![]});if(!_0x1cc14a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cc14a[_0x3956('0x4f')]==='user'){var _0x1ee246=_0x1fae63[_0x3956('0x4d')]({'plain':!![]});var _0x8667ca=_0x3956('0x25');return db[_0x3956('0x57')][_0x3956('0x49')]({'where':{'name':_0x8667ca,'userProfileId':_0x1cc14a[_0x3956('0x50')]},'raw':!![]})[_0x3956('0x24')](function(_0x1954a4){if(_0x1954a4&&_0x1954a4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1ee246[_0x3956('0x29')],'resourceId':_0x1ee246['id'],'type':_0x1954a4[_0x3956('0x29')],'sectionId':_0x1954a4['id']},{})[_0x3956('0x24')](function(){return _0x1fae63;});}else{return _0x1fae63;}})[_0x3956('0x44')](function(_0x32e201){logger['error'](_0x3956('0x52'),_0x32e201);throw _0x32e201;});}return _0x1fae63;});}})[_0x3956('0x24')](respondWithResult(_0x15e523,0xc9))[_0x3956('0x44')](handleError(_0x15e523,null));};exports[_0x3956('0x22')]=function(_0x567160,_0xf913ed){if(_0x567160[_0x3956('0x4b')]['id']){delete _0x567160[_0x3956('0x4b')]['id'];}return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x567160[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0xf913ed,null))[_0x3956('0x24')](saveUpdates(_0x567160[_0x3956('0x4b')],null))['then'](respondWithResult(_0xf913ed,null))['catch'](handleError(_0xf913ed,null));};exports['destroy']=function(_0x7841a6,_0x14aada){return db['Campaign'][_0x3956('0x49')]({'where':{'id':_0x7841a6['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x14aada,null))['then'](removeEntity(_0x14aada,null))['catch'](handleError(_0x14aada,null));};exports[_0x3956('0x58')]=function(_0x404096,_0x2f3e94,_0xb52013){var _0x4a1baa={'raw':!![],'where':{}};var _0x54d174={};var _0x55e3de={'count':0x0,'rows':[]};return db[_0x3956('0x2c')]['findOne']({'where':{'id':_0x404096['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x2f3e94,null))[_0x3956('0x24')](function(_0x1691e2){if(_0x1691e2){_0x54d174[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x59')][_0x3956('0x2d')]);_0x54d174['query']=_[_0x3956('0x30')](_0x404096[_0x3956('0x34')]);_0x54d174['filters']=_[_0x3956('0x32')](_0x54d174[_0x3956('0x33')],_0x54d174[_0x3956('0x34')]);_0x4a1baa[_0x3956('0x35')]=_[_0x3956('0x32')](_0x54d174[_0x3956('0x33')],qs['fields'](_0x404096[_0x3956('0x34')][_0x3956('0x47')]));_0x4a1baa[_0x3956('0x35')]=_0x4a1baa[_0x3956('0x35')]['length']?_0x4a1baa[_0x3956('0x35')]:_0x54d174[_0x3956('0x33')];if(!_0x404096[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x4a1baa[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x404096[_0x3956('0x34')][_0x3956('0x1c')]);_0x4a1baa['offset']=qs[_0x3956('0x1a')](_0x404096[_0x3956('0x34')]['offset']);}_0x4a1baa[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x404096[_0x3956('0x34')][_0x3956('0x3a')]);_0x4a1baa[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x404096[_0x3956('0x34')],_0x54d174[_0x3956('0x31')]));_0x4a1baa['where'][_0x3956('0x5a')]=_0x1691e2['id'];if(_0x404096[_0x3956('0x34')][_0x3956('0x3d')]){_0x4a1baa[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x4a1baa['where'],{'$or':_[_0x3956('0x2b')](_0x4a1baa[_0x3956('0x35')],function(_0x2cd057){var _0x4d9105={};_0x4d9105[_0x2cd057]={'$like':'%'+_0x404096['query']['filter']+'%'};return _0x4d9105;})});}_0x4a1baa=_['merge']({},_0x4a1baa,_0x404096[_0x3956('0x48')]);return db[_0x3956('0x59')][_0x3956('0x1d')]({'where':_0x4a1baa[_0x3956('0x3b')]})['then'](function(_0x51e223){_0x55e3de[_0x3956('0x1d')]=_0x51e223;if(_0x404096[_0x3956('0x34')][_0x3956('0x40')]){_0x4a1baa[_0x3956('0x41')]=[{'all':!![]}];}return db[_0x3956('0x59')]['findAll'](_0x4a1baa);})['then'](function(_0x32784b){_0x55e3de['rows']=_0x32784b;return _0x55e3de;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x2f3e94,_0x4a1baa))['catch'](handleError(_0x2f3e94,null));};exports[_0x3956('0x5b')]=function(_0x1d1e30,_0x9d9343,_0x59b46f){var _0x5d0d85={'raw':!![],'where':{}};var _0x2fcd97={};var _0x2e1161={'count':0x0,'rows':[]};return db[_0x3956('0x2c')]['findOne']({'where':{'id':_0x1d1e30[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x9d9343,null))[_0x3956('0x24')](function(_0x18f78b){if(_0x18f78b){_0x2fcd97['model']=_[_0x3956('0x30')](db[_0x3956('0x5c')][_0x3956('0x2d')]);_0x2fcd97[_0x3956('0x34')]=_['keys'](_0x1d1e30[_0x3956('0x34')]);_0x2fcd97[_0x3956('0x31')]=_[_0x3956('0x32')](_0x2fcd97['model'],_0x2fcd97[_0x3956('0x34')]);_0x5d0d85[_0x3956('0x35')]=_[_0x3956('0x32')](_0x2fcd97[_0x3956('0x33')],qs[_0x3956('0x47')](_0x1d1e30[_0x3956('0x34')]['fields']));_0x5d0d85[_0x3956('0x35')]=_0x5d0d85[_0x3956('0x35')][_0x3956('0x36')]?_0x5d0d85[_0x3956('0x35')]:_0x2fcd97['model'];if(!_0x1d1e30[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x5d0d85[_0x3956('0x1c')]=qs['limit'](_0x1d1e30[_0x3956('0x34')][_0x3956('0x1c')]);_0x5d0d85[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x1d1e30[_0x3956('0x34')][_0x3956('0x1a')]);}_0x5d0d85[_0x3956('0x39')]=qs['sort'](_0x1d1e30[_0x3956('0x34')]['sort']);_0x5d0d85[_0x3956('0x3b')]=qs[_0x3956('0x31')](_['pick'](_0x1d1e30[_0x3956('0x34')],_0x2fcd97['filters']));_0x5d0d85[_0x3956('0x3b')][_0x3956('0x5a')]=_0x18f78b['id'];if(_0x1d1e30[_0x3956('0x34')][_0x3956('0x3d')]){_0x5d0d85[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x5d0d85['where'],{'$or':_[_0x3956('0x2b')](_0x5d0d85[_0x3956('0x35')],function(_0x479e82){var _0x495902={};_0x495902[_0x479e82]={'$like':'%'+_0x1d1e30[_0x3956('0x34')]['filter']+'%'};return _0x495902;})});}_0x5d0d85=_[_0x3956('0x3e')]({},_0x5d0d85,_0x1d1e30[_0x3956('0x48')]);return db['CmHopperHistory'][_0x3956('0x1d')]({'where':_0x5d0d85[_0x3956('0x3b')]})['then'](function(_0x42b110){_0x2e1161[_0x3956('0x1d')]=_0x42b110;if(_0x1d1e30['query']['includeAll']){_0x5d0d85[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3956('0x42')](_0x5d0d85);})[_0x3956('0x24')](function(_0x42ddc9){_0x2e1161['rows']=_0x42ddc9;return _0x2e1161;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x9d9343,_0x5d0d85))['catch'](handleError(_0x9d9343,null));};exports[_0x3956('0x5d')]=function(_0x705055,_0x48741a,_0x20af9e){var _0x4083a8={'raw':!![],'where':{}};var _0x351529={};var _0xec91f7={'count':0x0,'rows':[]};return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x705055[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x48741a,null))[_0x3956('0x24')](function(_0x17cd9d){if(_0x17cd9d){_0x351529[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x5f')][_0x3956('0x2d')]);_0x351529[_0x3956('0x34')]=_[_0x3956('0x30')](_0x705055['query']);_0x351529[_0x3956('0x31')]=_['intersection'](_0x351529[_0x3956('0x33')],_0x351529[_0x3956('0x34')]);_0x4083a8[_0x3956('0x35')]=_[_0x3956('0x32')](_0x351529['model'],qs[_0x3956('0x47')](_0x705055[_0x3956('0x34')][_0x3956('0x47')]));_0x4083a8['attributes']=_0x4083a8[_0x3956('0x35')][_0x3956('0x36')]?_0x4083a8[_0x3956('0x35')]:_0x351529[_0x3956('0x33')];if(!_0x705055['query'][_0x3956('0x37')]('nolimit')){_0x4083a8[_0x3956('0x1c')]=qs['limit'](_0x705055[_0x3956('0x34')]['limit']);_0x4083a8['offset']=qs['offset'](_0x705055[_0x3956('0x34')][_0x3956('0x1a')]);}_0x4083a8[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x705055[_0x3956('0x34')][_0x3956('0x3a')]);_0x4083a8['where']=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x705055['query'],_0x351529[_0x3956('0x31')]));_0x4083a8[_0x3956('0x3b')]['CampaignId']=_0x17cd9d['id'];if(_0x705055['query']['filter']){_0x4083a8['where']=_['merge'](_0x4083a8['where'],{'$or':_[_0x3956('0x2b')](_0x4083a8[_0x3956('0x35')],function(_0x1c2944){var _0x3b7bd1={};_0x3b7bd1[_0x1c2944]={'$like':'%'+_0x705055[_0x3956('0x34')]['filter']+'%'};return _0x3b7bd1;})});}_0x4083a8=_[_0x3956('0x3e')]({},_0x4083a8,_0x705055[_0x3956('0x48')]);return db['CmHopperFinal']['count']({'where':_0x4083a8['where']})[_0x3956('0x24')](function(_0x222b4b){_0xec91f7[_0x3956('0x1d')]=_0x222b4b;if(_0x705055[_0x3956('0x34')][_0x3956('0x40')]){_0x4083a8[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3956('0x42')](_0x4083a8);})['then'](function(_0x5da717){_0xec91f7['rows']=_0x5da717;return _0xec91f7;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x48741a,_0x4083a8))[_0x3956('0x44')](handleError(_0x48741a,null));};exports[_0x3956('0x60')]=function(_0x437730,_0x2172a2,_0x5e2763){var _0x287f8c={'raw':!![],'where':{}};var _0x38b198={};var _0x1c64ed={'count':0x0,'rows':[]};return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x437730[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x2172a2,null))[_0x3956('0x24')](function(_0x14ef33){if(_0x14ef33){_0x38b198[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x61')][_0x3956('0x2d')]);_0x38b198[_0x3956('0x34')]=_['keys'](_0x437730['query']);_0x38b198[_0x3956('0x31')]=_[_0x3956('0x32')](_0x38b198[_0x3956('0x33')],_0x38b198[_0x3956('0x34')]);_0x287f8c[_0x3956('0x35')]=_[_0x3956('0x32')](_0x38b198[_0x3956('0x33')],qs[_0x3956('0x47')](_0x437730['query']['fields']));_0x287f8c[_0x3956('0x35')]=_0x287f8c['attributes'][_0x3956('0x36')]?_0x287f8c['attributes']:_0x38b198[_0x3956('0x33')];if(!_0x437730[_0x3956('0x34')]['hasOwnProperty'](_0x3956('0x38'))){_0x287f8c[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x437730[_0x3956('0x34')]['limit']);_0x287f8c['offset']=qs[_0x3956('0x1a')](_0x437730[_0x3956('0x34')]['offset']);}_0x287f8c[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x437730[_0x3956('0x34')][_0x3956('0x3a')]);_0x287f8c['where']=qs['filters'](_[_0x3956('0x3c')](_0x437730['query'],_0x38b198[_0x3956('0x31')]));_0x287f8c[_0x3956('0x3b')][_0x3956('0x5a')]=_0x14ef33['id'];if(_0x437730[_0x3956('0x34')]['filter']){_0x287f8c[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x287f8c[_0x3956('0x3b')],{'$or':_['map'](_0x287f8c[_0x3956('0x35')],function(_0xbbeff4){var _0x5b5a89={};_0x5b5a89[_0xbbeff4]={'$like':'%'+_0x437730[_0x3956('0x34')][_0x3956('0x3d')]+'%'};return _0x5b5a89;})});}_0x287f8c=_[_0x3956('0x3e')]({},_0x287f8c,_0x437730[_0x3956('0x48')]);return db[_0x3956('0x61')][_0x3956('0x1d')]({'where':_0x287f8c['where']})[_0x3956('0x24')](function(_0x576f34){_0x1c64ed[_0x3956('0x1d')]=_0x576f34;if(_0x437730[_0x3956('0x34')][_0x3956('0x40')]){_0x287f8c[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x287f8c);})['then'](function(_0x11feda){_0x1c64ed[_0x3956('0x43')]=_0x11feda;return _0x1c64ed;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x2172a2,_0x287f8c))[_0x3956('0x44')](handleError(_0x2172a2,null));};exports[_0x3956('0x62')]=function(_0x151687,_0xa98fd1,_0x3b06ff){var _0x7227a4={};var _0x42eddc={};var _0x370ea9;var _0x57fdb6;return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x151687[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0xa98fd1,null))[_0x3956('0x24')](function(_0x891395){if(_0x891395){_0x370ea9=_0x891395;_0x42eddc[_0x3956('0x33')]=_[_0x3956('0x30')](db['CmList']['rawAttributes']);_0x42eddc[_0x3956('0x34')]=_['keys'](_0x151687[_0x3956('0x34')]);_0x42eddc[_0x3956('0x31')]=_[_0x3956('0x32')](_0x42eddc[_0x3956('0x33')],_0x42eddc[_0x3956('0x34')]);_0x7227a4[_0x3956('0x35')]=_[_0x3956('0x32')](_0x42eddc[_0x3956('0x33')],qs[_0x3956('0x47')](_0x151687['query'][_0x3956('0x47')]));_0x7227a4[_0x3956('0x35')]=_0x7227a4[_0x3956('0x35')][_0x3956('0x36')]?_0x7227a4[_0x3956('0x35')]:_0x42eddc[_0x3956('0x33')];_0x7227a4[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x151687['query'][_0x3956('0x3a')]);_0x7227a4[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x151687[_0x3956('0x34')],_0x42eddc[_0x3956('0x31')]));if(_0x151687[_0x3956('0x34')][_0x3956('0x3d')]){_0x7227a4['where']=_[_0x3956('0x3e')](_0x7227a4[_0x3956('0x3b')],{'$or':_['map'](_0x7227a4['attributes'],function(_0x1b58c2){var _0x3da877={};_0x3da877[_0x1b58c2]={'$like':'%'+_0x151687[_0x3956('0x34')]['filter']+'%'};return _0x3da877;})});}_0x7227a4=_[_0x3956('0x3e')]({},_0x7227a4,_0x151687['options']);return _0x370ea9[_0x3956('0x62')](_0x7227a4);}})['then'](function(_0x1ed3f9){if(_0x1ed3f9){_0x57fdb6=_0x1ed3f9[_0x3956('0x36')];if(!_0x151687['query']['hasOwnProperty']('nolimit')){_0x7227a4['limit']=qs['limit'](_0x151687[_0x3956('0x34')]['limit']);_0x7227a4[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x151687['query'][_0x3956('0x1a')]);}return _0x370ea9['getLists'](_0x7227a4);}})[_0x3956('0x24')](function(_0xca7e8){if(_0xca7e8){return _0xca7e8?{'count':_0x57fdb6,'rows':_0xca7e8}:null;}})[_0x3956('0x24')](respondWithResult(_0xa98fd1,null))[_0x3956('0x44')](handleError(_0xa98fd1,null));};exports[_0x3956('0x63')]=function(_0x34c4c8,_0x416e33,_0x365ddd){var _0x544edf,_0x1306e2;var _0x75b3ca=[];var _0x5ac05e=moment()['format'](_0x3956('0x64'));return db['Campaign'][_0x3956('0x49')]({'where':{'id':_0x34c4c8[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x416e33,null))[_0x3956('0x24')](function(_0x2f958e){if(_0x2f958e){_0x1306e2=_0x2f958e;return _0x2f958e['addLists'](_0x34c4c8[_0x3956('0x4b')]['ids'],_['omit'](_0x34c4c8[_0x3956('0x4b')],['ids','id'])||{});}return null;})[_0x3956('0x65')](function(_0x542534){var _0x58c70e;var _0x50a0d3;_0x544edf=_0x542534||[];var _0x110744=[];if(_0x542534){for(var _0x4b4955=0x0;_0x4b4955<_0x542534[_0x3956('0x36')];_0x4b4955+=0x1){var _0x472179=_0x542534[_0x4b4955][_0x3956('0x4d')]({'plain':!![]});_0x1306e2[_0x3956('0x66')]=_0x34c4c8[_0x3956('0x4b')][_0x3956('0x66')]?_0x34c4c8[_0x3956('0x4b')][_0x3956('0x66')]:_0x1306e2[_0x3956('0x66')];switch(_0x1306e2[_0x3956('0x66')]){case _0x3956('0x67'):_0x58c70e=squel['insert']()[_0x3956('0x68')](_0x3956('0x69'))[_0x3956('0x6a')](['phone',_0x3956('0x6b'),_0x3956('0x6c'),'ListId',_0x3956('0x5a'),_0x3956('0x56'),'updatedAt'],squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x6f'),_0x3956('0x6f'))['field'](_0x3956('0x70'),_0x3956('0x6b'))[_0x3956('0x6e')]('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),_0x3956('0x73'))[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id']['toString'](),_0x3956('0x5a'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')]('cm_contacts')[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77'))[_0x3956('0x3b')](_0x3956('0x78'),squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x79'))[_0x3956('0x74')]('cm_hopper_final')[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]()))[_0x3956('0x3b')](_0x3956('0x78'),squel[_0x3956('0x6d')]()['field']('COALESCE(phone,\x27\x27)')[_0x3956('0x74')](_0x3956('0x69'))[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())))[_0x3956('0x72')]();break;case _0x3956('0x7b'):_0x58c70e=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x69'))['fromQuery'](['phone','scheduledAt',_0x3956('0x6c'),_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('phone',_0x3956('0x6f'))[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x6b'))['field']('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),'ListId')[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')](),_0x3956('0x5a'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')](_0x3956('0x7d'))[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77'))['where'](_0x3956('0x78'),squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x7e'))[_0x3956('0x74')](_0x3956('0x69'))[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())))[_0x3956('0x72')]();break;default:_0x58c70e=squel[_0x3956('0x7c')]()[_0x3956('0x68')]('cm_hopper')[_0x3956('0x6a')](['phone','scheduledAt','ContactId',_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('phone',_0x3956('0x6f'))['field']('NOW()',_0x3956('0x6b'))['field']('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),'ListId')[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id']['toString'](),'CampaignId')[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')](_0x3956('0x7d'))[_0x3956('0x3b')]('deletedAt\x20IS\x20NULL')[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())['where'](_0x3956('0x77')))[_0x3956('0x72')]();}_0x50a0d3=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x7f'))[_0x3956('0x6a')]([_0x3956('0x80'),_0x3956('0x6b'),_0x3956('0x6f'),_0x3956('0x81'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('h.id','id')[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x6b'))[_0x3956('0x6e')]('ci.item',_0x3956('0x6f'))[_0x3956('0x6e')](_0x3956('0x82'),_0x3956('0x81'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x55'))[_0x3956('0x74')](_0x3956('0x83'),'ci')['join'](_0x3956('0x69'),'h',_0x3956('0x84'))[_0x3956('0x3b')](_0x3956('0x85'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x86'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x87'),_0x5ac05e))[_0x3956('0x72')]();_0x110744[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x58c70e));_0x75b3ca[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x50a0d3));}return BPromise[_0x3956('0x8a')](_0x110744);}})[_0x3956('0x24')](function(){return BPromise[_0x3956('0x8a')](_0x75b3ca);})['then'](function(){return _0x544edf;})[_0x3956('0x24')](respondWithResult(_0x416e33,null))[_0x3956('0x44')](handleError(_0x416e33,null));};exports[_0x3956('0x8b')]=function(_0x129263,_0x269f91,_0x17c85f){return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x129263['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x269f91,null))[_0x3956('0x24')](function(_0x3ebff1){if(_0x3ebff1){return _0x3ebff1[_0x3956('0x8b')](_0x129263[_0x3956('0x34')][_0x3956('0x8c')]);}})['then'](function(_0xe176d){if(_0xe176d){return db[_0x3956('0x59')]['destroy']({'where':{'ListId':_0x129263[_0x3956('0x34')][_0x3956('0x8c')],'CampaignId':_0x129263[_0x3956('0x46')]['id']}})[_0x3956('0x24')](function(){return _0xe176d;});}})[_0x3956('0x24')](respondWithStatusCode(_0x269f91,null))[_0x3956('0x44')](handleError(_0x269f91,null));};exports[_0x3956('0x8d')]=function(_0x141c99,_0x3cff5d,_0x4a999e){var _0xc25415={};var _0x4662d9={};var _0x1b7843;var _0xa17b7c;return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x141c99[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cff5d,null))[_0x3956('0x24')](function(_0x25a631){if(_0x25a631){_0x1b7843=_0x25a631;_0x4662d9['model']=_[_0x3956('0x30')](db[_0x3956('0x8e')][_0x3956('0x2d')]);_0x4662d9[_0x3956('0x34')]=_['keys'](_0x141c99[_0x3956('0x34')]);_0x4662d9[_0x3956('0x31')]=_[_0x3956('0x32')](_0x4662d9[_0x3956('0x33')],_0x4662d9[_0x3956('0x34')]);_0xc25415[_0x3956('0x35')]=_[_0x3956('0x32')](_0x4662d9[_0x3956('0x33')],qs[_0x3956('0x47')](_0x141c99[_0x3956('0x34')][_0x3956('0x47')]));_0xc25415[_0x3956('0x35')]=_0xc25415[_0x3956('0x35')][_0x3956('0x36')]?_0xc25415[_0x3956('0x35')]:_0x4662d9[_0x3956('0x33')];_0xc25415[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x141c99[_0x3956('0x34')][_0x3956('0x3a')]);_0xc25415[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x141c99['query'],_0x4662d9[_0x3956('0x31')]));if(_0x141c99[_0x3956('0x34')]['filter']){_0xc25415[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0xc25415[_0x3956('0x3b')],{'$or':_[_0x3956('0x2b')](_0xc25415['attributes'],function(_0x59e0b7){var _0x2d2581={};_0x2d2581[_0x59e0b7]={'$like':'%'+_0x141c99[_0x3956('0x34')][_0x3956('0x3d')]+'%'};return _0x2d2581;})});}_0xc25415=_[_0x3956('0x3e')]({},_0xc25415,_0x141c99[_0x3956('0x48')]);return _0x1b7843[_0x3956('0x8d')](_0xc25415);}})[_0x3956('0x24')](function(_0x11176f){if(_0x11176f){_0xa17b7c=_0x11176f[_0x3956('0x36')];if(!_0x141c99['query'][_0x3956('0x37')](_0x3956('0x38'))){_0xc25415[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x141c99[_0x3956('0x34')]['limit']);_0xc25415[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x141c99[_0x3956('0x34')][_0x3956('0x1a')]);}return _0x1b7843['getBlackLists'](_0xc25415);}})[_0x3956('0x24')](function(_0x4d8c7a){if(_0x4d8c7a){return _0x4d8c7a?{'count':_0xa17b7c,'rows':_0x4d8c7a}:null;}})['then'](respondWithResult(_0x3cff5d,null))['catch'](handleError(_0x3cff5d,null));};exports[_0x3956('0x8f')]=function(_0x1bb6af,_0x18ed6b,_0x5fffc9){var _0x10dd2e,_0x43aae2;var _0x31c62a=[];var _0x4ca802=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3956('0x2c')]['find']({'where':{'id':_0x1bb6af[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ed6b,null))[_0x3956('0x24')](function(_0x1f91b5){if(_0x1f91b5){_0x43aae2=_0x1f91b5;return _0x1f91b5[_0x3956('0x8f')](_0x1bb6af[_0x3956('0x4b')][_0x3956('0x8c')],_['omit'](_0x1bb6af[_0x3956('0x4b')],[_0x3956('0x8c'),'id'])||{});}return null;})[_0x3956('0x65')](function(_0x82ae4e){var _0x4f1d80;var _0x4c1bc9;_0x10dd2e=_0x82ae4e||[];var _0x3f7708=[];if(_0x82ae4e){for(var _0x25e5be=0x0;_0x25e5be<_0x82ae4e[_0x3956('0x36')];_0x25e5be+=0x1){var _0xccaaa0=_0x82ae4e[_0x25e5be][_0x3956('0x4d')]({'plain':!![]});_0x4f1d80=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x90'))[_0x3956('0x6a')](['phone',_0x3956('0x6c'),_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x6f'),'phone')[_0x3956('0x6e')]('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0xccaaa0[_0x3956('0x71')][_0x3956('0x72')](),_0x3956('0x73'))[_0x3956('0x6e')](_0x1bb6af['params']['id'][_0x3956('0x72')](),_0x3956('0x5a'))[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x56'))['field'](_0x3956('0x70'),_0x3956('0x55'))[_0x3956('0x74')]('cm_contacts')[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0xccaaa0['CmListId'][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77')))[_0x3956('0x72')]();_0x3f7708[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x4f1d80));}return BPromise['all'](_0x3f7708);}})[_0x3956('0x24')](function(){return _0x10dd2e;})['then'](respondWithResult(_0x18ed6b,null))[_0x3956('0x44')](handleError(_0x18ed6b,null));};exports['removeBlackLists']=function(_0x25d2c3,_0x3beaff,_0x40aac6){return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x25d2c3['params']['id']}})['then'](handleEntityNotFound(_0x3beaff,null))[_0x3956('0x24')](function(_0x374f64){if(_0x374f64){return _0x374f64[_0x3956('0x91')](_0x25d2c3[_0x3956('0x34')][_0x3956('0x8c')]);}})[_0x3956('0x24')](function(_0xce0535){if(_0xce0535){return db[_0x3956('0x61')][_0x3956('0x23')]({'where':{'ListId':_0x25d2c3[_0x3956('0x34')][_0x3956('0x8c')],'CampaignId':_0x25d2c3[_0x3956('0x46')]['id']}})[_0x3956('0x24')](function(){return _0xce0535;});}})[_0x3956('0x24')](respondWithStatusCode(_0x3beaff,null))[_0x3956('0x44')](handleError(_0x3beaff,null));};
\ No newline at end of file
+var _0x60d7=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','from','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','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','count','offset','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','CmHopperHistory','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x60d7,0x139));var _0x760d=function(_0x238e2d,_0x3fc80c){_0x238e2d=_0x238e2d-0x0;var _0x51eb18=_0x60d7[_0x238e2d];return _0x51eb18;};'use strict';var emlformat=require(_0x760d('0x0'));var rimraf=require(_0x760d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x760d('0x2'));var rp=require('request-promise');var moment=require(_0x760d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x760d('0x4'));var util=require(_0x760d('0x5'));var path=require(_0x760d('0x6'));var sox=require(_0x760d('0x7'));var csv=require('to-csv');var ejs=require(_0x760d('0x8'));var fs=require('fs');var fs_extra=require(_0x760d('0x9'));var _=require(_0x760d('0xa'));var squel=require(_0x760d('0xb'));var crypto=require(_0x760d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x760d('0xd'));var toCsv=require(_0x760d('0xe'));var querystring=require(_0x760d('0xf'));var Papa=require('papaparse');var Redis=require(_0x760d('0x10'));var authService=require(_0x760d('0x11'));var qs=require(_0x760d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x760d('0x13'));var logger=require(_0x760d('0x14'))('api');var utils=require(_0x760d('0x15'));var config=require(_0x760d('0x16'));var licenseUtil=require(_0x760d('0x17'));var db=require(_0x760d('0x18'))['db'];function respondWithStatusCode(_0x1c6d0d,_0x40b3ee){_0x40b3ee=_0x40b3ee||0xcc;return function(_0xffb1f9){if(_0xffb1f9){return _0x1c6d0d[_0x760d('0x19')](_0x40b3ee);}return _0x1c6d0d[_0x760d('0x1a')](_0x40b3ee)[_0x760d('0x1b')]();};}function respondWithResult(_0x28bd1b,_0x543d6e){_0x543d6e=_0x543d6e||0xc8;return function(_0x1fed3a){if(_0x1fed3a){return _0x28bd1b['status'](_0x543d6e)[_0x760d('0x1c')](_0x1fed3a);}};}function respondWithFilteredResult(_0x62b5e9,_0x13118d){return function(_0x86e62a){if(_0x86e62a){var _0x49c0d4=typeof _0x13118d['offset']===_0x760d('0x1d')&&typeof _0x13118d[_0x760d('0x1e')]===_0x760d('0x1d');var _0x436bbd=_0x86e62a[_0x760d('0x1f')];var _0x1bed8=_0x49c0d4?0x0:_0x13118d['offset'];var _0x49cac3=_0x49c0d4?_0x86e62a[_0x760d('0x1f')]:_0x13118d[_0x760d('0x20')]+_0x13118d[_0x760d('0x1e')];var _0x2bbf82;if(_0x49cac3>=_0x436bbd){_0x49cac3=_0x436bbd;_0x2bbf82=0xc8;}else{_0x2bbf82=0xce;}_0x62b5e9[_0x760d('0x1a')](_0x2bbf82);return _0x62b5e9[_0x760d('0x21')](_0x760d('0x22'),_0x1bed8+'-'+_0x49cac3+'/'+_0x436bbd)[_0x760d('0x1c')](_0x86e62a);}return null;};}function patchUpdates(_0x37d5a5){return function(_0x2f74b5){try{jsonpatch['apply'](_0x2f74b5,_0x37d5a5,!![]);}catch(_0xf3c65f){return BPromise[_0x760d('0x23')](_0xf3c65f);}return _0x2f74b5[_0x760d('0x24')]();};}function saveUpdates(_0x2797bf,_0x234934){return function(_0x57dcea){if(_0x57dcea){return _0x57dcea[_0x760d('0x25')](_0x2797bf)[_0x760d('0x26')](function(_0x1fac3c){return _0x1fac3c;});}return null;};}function removeEntity(_0x516133,_0x55b45a){return function(_0x44b653){if(_0x44b653){return _0x44b653[_0x760d('0x27')]()[_0x760d('0x26')](function(){var _0x19cd53=_0x44b653[_0x760d('0x28')]({'plain':!![]});var _0x16bbdb=_0x760d('0x29');return db[_0x760d('0x2a')]['destroy']({'where':{'type':_0x16bbdb,'resourceId':_0x19cd53['id']}})[_0x760d('0x26')](function(){return _0x44b653;});})[_0x760d('0x26')](function(){_0x516133[_0x760d('0x1a')](0xcc)[_0x760d('0x1b')]();});}};}function handleEntityNotFound(_0x47c5e6,_0x2b2251){return function(_0x58b4fb){if(!_0x58b4fb){_0x47c5e6['sendStatus'](0x194);}return _0x58b4fb;};}function handleError(_0x10696b,_0x4619ed){_0x4619ed=_0x4619ed||0x1f4;return function(_0x3bb676){logger[_0x760d('0x2b')](_0x3bb676[_0x760d('0x2c')]);if(_0x3bb676[_0x760d('0x2d')]){delete _0x3bb676[_0x760d('0x2d')];}_0x10696b[_0x760d('0x1a')](_0x4619ed)['send'](_0x3bb676);};}exports[_0x760d('0x2e')]=function(_0xc4fec8,_0x27cb58){var _0x149732={},_0x4b5bfb={},_0x5584c7={'count':0x0,'rows':[]};var _0x47ef8f=_[_0x760d('0x2f')](db[_0x760d('0x30')][_0x760d('0x31')],function(_0x3cd782){return{'name':_0x3cd782[_0x760d('0x32')],'type':_0x3cd782[_0x760d('0x33')][_0x760d('0x34')]};});_0x4b5bfb[_0x760d('0x35')]=_[_0x760d('0x2f')](_0x47ef8f,_0x760d('0x2d'));_0x4b5bfb[_0x760d('0x36')]=_[_0x760d('0x37')](_0xc4fec8['query']);_0x4b5bfb[_0x760d('0x38')]=_[_0x760d('0x39')](_0x4b5bfb['model'],_0x4b5bfb['query']);_0x149732[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4b5bfb['model'],qs[_0x760d('0x3b')](_0xc4fec8['query']['fields']));_0x149732[_0x760d('0x3a')]=_0x149732[_0x760d('0x3a')][_0x760d('0x3c')]?_0x149732[_0x760d('0x3a')]:_0x4b5bfb[_0x760d('0x35')];if(!_0xc4fec8['query']['hasOwnProperty']('nolimit')){_0x149732['limit']=qs[_0x760d('0x1e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x1e')]);_0x149732[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xc4fec8[_0x760d('0x36')]['offset']);}_0x149732[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x3e')]);_0x149732[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xc4fec8[_0x760d('0x36')],_0x4b5bfb['filters']),_0x47ef8f);if(_0xc4fec8[_0x760d('0x36')]['filter']){_0x149732[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x149732['where'],{'$or':_[_0x760d('0x2f')](_0x47ef8f,function(_0x551e9d){if(_0x551e9d['type']!==_0x760d('0x42')){var _0x4ef63f={};_0x4ef63f[_0x551e9d['name']]={'$like':'%'+_0xc4fec8[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x4ef63f;}})});}_0x149732=_[_0x760d('0x41')]({},_0x149732,_0xc4fec8['options']);var _0x57d950={'where':_0x149732['where']};return db[_0x760d('0x30')][_0x760d('0x1f')](_0x57d950)[_0x760d('0x26')](function(_0x3be521){_0x5584c7[_0x760d('0x1f')]=_0x3be521;if(_0xc4fec8[_0x760d('0x36')][_0x760d('0x44')]){_0x149732[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x30')]['findAll'](_0x149732);})['then'](function(_0x3dbc36){_0x5584c7['rows']=_0x3dbc36;return _0x5584c7;})[_0x760d('0x26')](respondWithFilteredResult(_0x27cb58,_0x149732))[_0x760d('0x46')](handleError(_0x27cb58,null));};exports[_0x760d('0x47')]=function(_0xe11b50,_0x2e4df3){var _0x974af2={'raw':![],'where':{'id':_0xe11b50[_0x760d('0x48')]['id']}},_0x18d132={};_0x18d132[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x30')][_0x760d('0x31')]);_0x18d132[_0x760d('0x36')]=_[_0x760d('0x37')](_0xe11b50[_0x760d('0x36')]);_0x18d132[_0x760d('0x38')]=_[_0x760d('0x39')](_0x18d132['model'],_0x18d132['query']);_0x974af2['attributes']=_['intersection'](_0x18d132[_0x760d('0x35')],qs[_0x760d('0x3b')](_0xe11b50[_0x760d('0x36')]['fields']));_0x974af2[_0x760d('0x3a')]=_0x974af2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x974af2[_0x760d('0x3a')]:_0x18d132[_0x760d('0x35')];if(_0xe11b50[_0x760d('0x36')]['includeAll']){_0x974af2[_0x760d('0x45')]=[{'all':!![]}];}_0x974af2=_[_0x760d('0x41')]({},_0x974af2,_0xe11b50[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x974af2)[_0x760d('0x26')](handleEntityNotFound(_0x2e4df3,null))[_0x760d('0x26')](respondWithResult(_0x2e4df3,null))[_0x760d('0x46')](handleError(_0x2e4df3,null));};exports[_0x760d('0x4b')]=function(_0x823b7b,_0x5b7555){return db['Campaign'][_0x760d('0x4b')](_0x823b7b[_0x760d('0x4c')],{})['then'](function(_0xa211d6){var _0x5f1e09=_0x823b7b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x5f1e09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1e09[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x3dbfa5=_0xa211d6[_0x760d('0x28')]({'plain':!![]});var _0x5d6426=_0x760d('0x29');return db[_0x760d('0x4f')]['find']({'where':{'name':_0x5d6426,'userProfileId':_0x5f1e09[_0x760d('0x50')]},'raw':!![]})['then'](function(_0x453582){if(_0x453582&&_0x453582[_0x760d('0x51')]===0x0){return db[_0x760d('0x2a')]['create']({'name':_0x3dbfa5[_0x760d('0x2d')],'resourceId':_0x3dbfa5['id'],'type':_0x453582[_0x760d('0x2d')],'sectionId':_0x453582['id']},{})[_0x760d('0x26')](function(){return _0xa211d6;});}else{return _0xa211d6;}})[_0x760d('0x46')](function(_0x102e7d){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x102e7d);throw _0x102e7d;});}return _0xa211d6;})['then'](respondWithResult(_0x5b7555,0xc9))[_0x760d('0x46')](handleError(_0x5b7555,null));};exports[_0x760d('0x53')]=function(_0x6dbc5b,_0xc7610d){var _0x187e28={'where':{'id':_0x6dbc5b['params']['id']}},_0x83749a={};_0x83749a['model']=_[_0x760d('0x37')](db[_0x760d('0x30')]['rawAttributes']);_0x187e28[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x83749a['model'],qs[_0x760d('0x3b')](_0x6dbc5b['query'][_0x760d('0x3b')]));_0x187e28[_0x760d('0x3a')]=_0x187e28[_0x760d('0x3a')][_0x760d('0x3c')]?_0x187e28[_0x760d('0x3a')]:_0x83749a['model'];if(_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]){_0x187e28[_0x760d('0x45')]=[{'all':!![]}];}_0x187e28=_[_0x760d('0x41')]({},_0x187e28,_0x6dbc5b[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x187e28)[_0x760d('0x26')](handleEntityNotFound(_0xc7610d,null))[_0x760d('0x26')](function(_0x23fc40){if(_0x23fc40){var _0x42b713=_0x23fc40[_0x760d('0x28')]({'plain':!![]});_0x42b713=qs['omit'](_0x42b713,['id','createdAt',_0x760d('0x54')]);_0x6dbc5b[_0x760d('0x4c')]=_[_0x760d('0x55')](_0x6dbc5b[_0x760d('0x4c')],['id',_0x760d('0x56'),_0x760d('0x54')]);return db[_0x760d('0x30')][_0x760d('0x4b')](_[_0x760d('0x41')](_0x42b713,_0x6dbc5b[_0x760d('0x4c')]),{'include':_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]?[{'all':!![]}]:undefined})[_0x760d('0x26')](function(_0x4084a8){var _0x322be2=_0x6dbc5b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x322be2)throw new Error(_0x760d('0x57'));if(_0x322be2[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x36dfa0=_0x4084a8[_0x760d('0x28')]({'plain':!![]});var _0x5ca3f7=_0x760d('0x29');return db['UserProfileSection'][_0x760d('0x4a')]({'where':{'name':_0x5ca3f7,'userProfileId':_0x322be2[_0x760d('0x50')]},'raw':!![]})[_0x760d('0x26')](function(_0x1fddbe){if(_0x1fddbe&&_0x1fddbe['autoAssociation']===0x0){return db[_0x760d('0x2a')][_0x760d('0x4b')]({'name':_0x36dfa0['name'],'resourceId':_0x36dfa0['id'],'type':_0x1fddbe[_0x760d('0x2d')],'sectionId':_0x1fddbe['id']},{})[_0x760d('0x26')](function(){return _0x4084a8;});}else{return _0x4084a8;}})[_0x760d('0x46')](function(_0x30d6ec){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x30d6ec);throw _0x30d6ec;});}return _0x4084a8;});}})[_0x760d('0x26')](respondWithResult(_0xc7610d,0xc9))['catch'](handleError(_0xc7610d,null));};exports[_0x760d('0x25')]=function(_0x509100,_0x3ad4bc){if(_0x509100[_0x760d('0x4c')]['id']){delete _0x509100[_0x760d('0x4c')]['id'];}return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x509100['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3ad4bc,null))[_0x760d('0x26')](saveUpdates(_0x509100[_0x760d('0x4c')],null))[_0x760d('0x26')](respondWithResult(_0x3ad4bc,null))[_0x760d('0x46')](handleError(_0x3ad4bc,null));};exports['destroy']=function(_0x1c52f5,_0x17baa4){return db[_0x760d('0x30')]['find']({'where':{'id':_0x1c52f5[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x17baa4,null))[_0x760d('0x26')](removeEntity(_0x17baa4,null))['catch'](handleError(_0x17baa4,null));};exports['getHoppers']=function(_0x5aea04,_0x292b0f,_0x356959){var _0x56b2c2={'raw':!![],'where':{}};var _0x55bd28={};var _0x2ccd9b={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x5aea04[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x292b0f,null))[_0x760d('0x26')](function(_0x1483db){if(_0x1483db){_0x55bd28[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x59')]['rawAttributes']);_0x55bd28[_0x760d('0x36')]=_[_0x760d('0x37')](_0x5aea04['query']);_0x55bd28['filters']=_[_0x760d('0x39')](_0x55bd28[_0x760d('0x35')],_0x55bd28['query']);_0x56b2c2[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x55bd28['model'],qs[_0x760d('0x3b')](_0x5aea04['query'][_0x760d('0x3b')]));_0x56b2c2['attributes']=_0x56b2c2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56b2c2['attributes']:_0x55bd28['model'];if(!_0x5aea04[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56b2c2['limit']=qs[_0x760d('0x1e')](_0x5aea04['query']['limit']);_0x56b2c2[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x5aea04[_0x760d('0x36')]['offset']);}_0x56b2c2['order']=qs[_0x760d('0x3e')](_0x5aea04[_0x760d('0x36')][_0x760d('0x3e')]);_0x56b2c2[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x5aea04['query'],_0x55bd28[_0x760d('0x38')]));_0x56b2c2[_0x760d('0x3f')][_0x760d('0x5c')]=_0x1483db['id'];if(_0x5aea04[_0x760d('0x36')]['filter']){_0x56b2c2[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56b2c2['where'],{'$or':_[_0x760d('0x2f')](_0x56b2c2['attributes'],function(_0xee30f9){var _0x3702b2={};_0x3702b2[_0xee30f9]={'$like':'%'+_0x5aea04[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x3702b2;})});}_0x56b2c2=_[_0x760d('0x41')]({},_0x56b2c2,_0x5aea04['options']);return db['CmHopper'][_0x760d('0x1f')]({'where':_0x56b2c2[_0x760d('0x3f')]})['then'](function(_0x33cb84){_0x2ccd9b[_0x760d('0x1f')]=_0x33cb84;if(_0x5aea04['query'][_0x760d('0x44')]){_0x56b2c2[_0x760d('0x45')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x56b2c2);})[_0x760d('0x26')](function(_0x10de79){_0x2ccd9b['rows']=_0x10de79;return _0x2ccd9b;});}})[_0x760d('0x26')](respondWithFilteredResult(_0x292b0f,_0x56b2c2))[_0x760d('0x46')](handleError(_0x292b0f,null));};exports['getHopperHistories']=function(_0x28e84a,_0x571519,_0x45804b){var _0x3c6431={'raw':!![],'where':{}};var _0x4dbb24={};var _0x429579={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28e84a[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x571519,null))['then'](function(_0x5d7a8e){if(_0x5d7a8e){_0x4dbb24['model']=_[_0x760d('0x37')](db[_0x760d('0x5d')][_0x760d('0x31')]);_0x4dbb24[_0x760d('0x36')]=_[_0x760d('0x37')](_0x28e84a[_0x760d('0x36')]);_0x4dbb24['filters']=_['intersection'](_0x4dbb24[_0x760d('0x35')],_0x4dbb24['query']);_0x3c6431[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4dbb24[_0x760d('0x35')],qs['fields'](_0x28e84a[_0x760d('0x36')][_0x760d('0x3b')]));_0x3c6431[_0x760d('0x3a')]=_0x3c6431[_0x760d('0x3a')][_0x760d('0x3c')]?_0x3c6431[_0x760d('0x3a')]:_0x4dbb24[_0x760d('0x35')];if(!_0x28e84a[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x3c6431[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x1e')]);_0x3c6431[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x28e84a['query']['offset']);}_0x3c6431[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x3e')]);_0x3c6431['where']=qs[_0x760d('0x38')](_['pick'](_0x28e84a['query'],_0x4dbb24[_0x760d('0x38')]));_0x3c6431[_0x760d('0x3f')][_0x760d('0x5c')]=_0x5d7a8e['id'];if(_0x28e84a['query'][_0x760d('0x43')]){_0x3c6431[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x3c6431[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x3c6431[_0x760d('0x3a')],function(_0x211a08){var _0x31d6ee={};_0x31d6ee[_0x211a08]={'$like':'%'+_0x28e84a[_0x760d('0x36')]['filter']+'%'};return _0x31d6ee;})});}_0x3c6431=_[_0x760d('0x41')]({},_0x3c6431,_0x28e84a[_0x760d('0x49')]);return db['CmHopperHistory'][_0x760d('0x1f')]({'where':_0x3c6431[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x27e44b){_0x429579['count']=_0x27e44b;if(_0x28e84a[_0x760d('0x36')][_0x760d('0x44')]){_0x3c6431['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x760d('0x5e')](_0x3c6431);})[_0x760d('0x26')](function(_0x7ce645){_0x429579[_0x760d('0x5f')]=_0x7ce645;return _0x429579;});}})['then'](respondWithFilteredResult(_0x571519,_0x3c6431))[_0x760d('0x46')](handleError(_0x571519,null));};exports[_0x760d('0x60')]=function(_0x282c3b,_0x4dd845,_0x48f562){var _0x5f24c3={'raw':!![],'where':{}};var _0x135544={};var _0x29219d={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x282c3b[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x4dd845,null))[_0x760d('0x26')](function(_0x18bc64){if(_0x18bc64){_0x135544[_0x760d('0x35')]=_['keys'](db['CmHopperFinal'][_0x760d('0x31')]);_0x135544[_0x760d('0x36')]=_[_0x760d('0x37')](_0x282c3b[_0x760d('0x36')]);_0x135544[_0x760d('0x38')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],_0x135544[_0x760d('0x36')]);_0x5f24c3[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x282c3b[_0x760d('0x36')]['fields']));_0x5f24c3['attributes']=_0x5f24c3[_0x760d('0x3a')][_0x760d('0x3c')]?_0x5f24c3['attributes']:_0x135544['model'];if(!_0x282c3b[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x5f24c3[_0x760d('0x1e')]=qs['limit'](_0x282c3b['query'][_0x760d('0x1e')]);_0x5f24c3[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x282c3b[_0x760d('0x36')]['offset']);}_0x5f24c3[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x282c3b[_0x760d('0x36')][_0x760d('0x3e')]);_0x5f24c3[_0x760d('0x3f')]=qs['filters'](_[_0x760d('0x40')](_0x282c3b[_0x760d('0x36')],_0x135544['filters']));_0x5f24c3[_0x760d('0x3f')][_0x760d('0x5c')]=_0x18bc64['id'];if(_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]){_0x5f24c3[_0x760d('0x3f')]=_['merge'](_0x5f24c3[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x5f24c3[_0x760d('0x3a')],function(_0x3265d3){var _0x275662={};_0x275662[_0x3265d3]={'$like':'%'+_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x275662;})});}_0x5f24c3=_[_0x760d('0x41')]({},_0x5f24c3,_0x282c3b['options']);return db[_0x760d('0x61')][_0x760d('0x1f')]({'where':_0x5f24c3[_0x760d('0x3f')]})['then'](function(_0x26ffbe){_0x29219d[_0x760d('0x1f')]=_0x26ffbe;if(_0x282c3b[_0x760d('0x36')]['includeAll']){_0x5f24c3[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x61')]['findAll'](_0x5f24c3);})[_0x760d('0x26')](function(_0x189885){_0x29219d[_0x760d('0x5f')]=_0x189885;return _0x29219d;});}})['then'](respondWithFilteredResult(_0x4dd845,_0x5f24c3))[_0x760d('0x46')](handleError(_0x4dd845,null));};exports[_0x760d('0x62')]=function(_0x3ff551,_0x35116b,_0x52e16a){var _0x356602={'raw':!![],'where':{}};var _0x28576f={};var _0x165985={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3ff551[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x35116b,null))['then'](function(_0x364036){if(_0x364036){_0x28576f[_0x760d('0x35')]=_['keys'](db[_0x760d('0x63')][_0x760d('0x31')]);_0x28576f[_0x760d('0x36')]=_['keys'](_0x3ff551[_0x760d('0x36')]);_0x28576f[_0x760d('0x38')]=_[_0x760d('0x39')](_0x28576f['model'],_0x28576f[_0x760d('0x36')]);_0x356602['attributes']=_[_0x760d('0x39')](_0x28576f[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x3ff551[_0x760d('0x36')][_0x760d('0x3b')]));_0x356602[_0x760d('0x3a')]=_0x356602[_0x760d('0x3a')]['length']?_0x356602[_0x760d('0x3a')]:_0x28576f[_0x760d('0x35')];if(!_0x3ff551[_0x760d('0x36')]['hasOwnProperty'](_0x760d('0x5b'))){_0x356602[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3ff551[_0x760d('0x36')][_0x760d('0x1e')]);_0x356602[_0x760d('0x20')]=qs['offset'](_0x3ff551[_0x760d('0x36')]['offset']);}_0x356602[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x3ff551['query']['sort']);_0x356602[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3ff551[_0x760d('0x36')],_0x28576f['filters']));_0x356602['where']['CampaignId']=_0x364036['id'];if(_0x3ff551[_0x760d('0x36')][_0x760d('0x43')]){_0x356602[_0x760d('0x3f')]=_['merge'](_0x356602[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x356602[_0x760d('0x3a')],function(_0x5e13e5){var _0x6a2688={};_0x6a2688[_0x5e13e5]={'$like':'%'+_0x3ff551[_0x760d('0x36')]['filter']+'%'};return _0x6a2688;})});}_0x356602=_['merge']({},_0x356602,_0x3ff551['options']);return db[_0x760d('0x63')][_0x760d('0x1f')]({'where':_0x356602[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x4ccd36){_0x165985[_0x760d('0x1f')]=_0x4ccd36;if(_0x3ff551[_0x760d('0x36')][_0x760d('0x44')]){_0x356602['include']=[{'all':!![]}];}return db[_0x760d('0x63')][_0x760d('0x5e')](_0x356602);})[_0x760d('0x26')](function(_0x24006a){_0x165985[_0x760d('0x5f')]=_0x24006a;return _0x165985;});}})['then'](respondWithFilteredResult(_0x35116b,_0x356602))[_0x760d('0x46')](handleError(_0x35116b,null));};exports[_0x760d('0x64')]=function(_0x3082ed,_0x4c2377,_0x49085c){var _0x18a1ef={};var _0x2b3fb9={};var _0x2eef8e;var _0x8e8791;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x3082ed[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c2377,null))[_0x760d('0x26')](function(_0x2a6b76){if(_0x2a6b76){_0x2eef8e=_0x2a6b76;_0x2b3fb9[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x2b3fb9['query']=_[_0x760d('0x37')](_0x3082ed[_0x760d('0x36')]);_0x2b3fb9[_0x760d('0x38')]=_[_0x760d('0x39')](_0x2b3fb9[_0x760d('0x35')],_0x2b3fb9[_0x760d('0x36')]);_0x18a1ef[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x2b3fb9['model'],qs[_0x760d('0x3b')](_0x3082ed[_0x760d('0x36')][_0x760d('0x3b')]));_0x18a1ef[_0x760d('0x3a')]=_0x18a1ef[_0x760d('0x3a')][_0x760d('0x3c')]?_0x18a1ef[_0x760d('0x3a')]:_0x2b3fb9[_0x760d('0x35')];_0x18a1ef[_0x760d('0x3d')]=qs['sort'](_0x3082ed[_0x760d('0x36')][_0x760d('0x3e')]);_0x18a1ef[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3082ed['query'],_0x2b3fb9[_0x760d('0x38')]));if(_0x3082ed['query']['filter']){_0x18a1ef[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x18a1ef[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x18a1ef['attributes'],function(_0x463d20){var _0x4b96fd={};_0x4b96fd[_0x463d20]={'$like':'%'+_0x3082ed[_0x760d('0x36')]['filter']+'%'};return _0x4b96fd;})});}_0x18a1ef=_[_0x760d('0x41')]({},_0x18a1ef,_0x3082ed[_0x760d('0x49')]);return _0x2eef8e[_0x760d('0x64')](_0x18a1ef);}})[_0x760d('0x26')](function(_0x58835d){if(_0x58835d){_0x8e8791=_0x58835d['length'];if(!_0x3082ed[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x18a1ef[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3082ed[_0x760d('0x36')]['limit']);_0x18a1ef['offset']=qs[_0x760d('0x20')](_0x3082ed[_0x760d('0x36')]['offset']);}return _0x2eef8e['getLists'](_0x18a1ef);}})[_0x760d('0x26')](function(_0x475940){if(_0x475940){return _0x475940?{'count':_0x8e8791,'rows':_0x475940}:null;}})[_0x760d('0x26')](respondWithResult(_0x4c2377,null))[_0x760d('0x46')](handleError(_0x4c2377,null));};exports[_0x760d('0x65')]=function(_0x35bb84,_0x5f5aa3,_0x151416){var _0xbbfbde,_0x440539;var _0x4525a0=[];var _0x6cf52=moment()[_0x760d('0x66')](_0x760d('0x67'));return db[_0x760d('0x30')]['find']({'where':{'id':_0x35bb84['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x5f5aa3,null))[_0x760d('0x26')](function(_0x5d6d3c){if(_0x5d6d3c){_0x440539=_0x5d6d3c;return _0x5d6d3c['addLists'](_0x35bb84[_0x760d('0x4c')]['ids'],_[_0x760d('0x55')](_0x35bb84[_0x760d('0x4c')],['ids','id'])||{});}return null;})[_0x760d('0x68')](function(_0x26c5c8){var _0x260404;var _0x589503;_0xbbfbde=_0x26c5c8||[];var _0x213958=[];if(_0x26c5c8){for(var _0x55c677=0x0;_0x55c677<_0x26c5c8['length'];_0x55c677+=0x1){var _0x1b8928=_0x26c5c8[_0x55c677][_0x760d('0x28')]({'plain':!![]});_0x440539[_0x760d('0x69')]=_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]?_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]:_0x440539[_0x760d('0x69')];switch(_0x440539[_0x760d('0x69')]){case _0x760d('0x6a'):_0x260404=squel[_0x760d('0x6b')]()[_0x760d('0x6c')]('cm_hopper')['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),_0x760d('0x70'),_0x760d('0x5c'),'createdAt',_0x760d('0x54')],squel[_0x760d('0x71')]()[_0x760d('0x72')]('phone',_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928['CmListId'][_0x760d('0x74')](),'ListId')[_0x760d('0x72')](_0x35bb84['params']['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27','createdAt')['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7b'))['from']('cm_hopper_final')[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')]()))['where'](_0x760d('0x7a'),squel[_0x760d('0x71')]()['field'](_0x760d('0x7d'))['from'](_0x760d('0x7e'))[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;case _0x760d('0x7f'):_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))[_0x760d('0x80')]([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId',_0x760d('0x5c'),_0x760d('0x56'),_0x760d('0x54')],squel['select']()['field'](_0x760d('0x6d'),_0x760d('0x6d'))['field'](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))[_0x760d('0x72')](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))['field'](_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27','createdAt')[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from']('cm_contacts')['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId']['toString']())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7d'))[_0x760d('0x81')]('cm_hopper')['where'](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;default:_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),_0x760d('0x54')],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))[_0x760d('0x72')](_0x35bb84[_0x760d('0x48')]['id']['toString'](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();}_0x589503=squel['insert']()['into'](_0x760d('0x82'))[_0x760d('0x80')](['cmHopperId','scheduledAt',_0x760d('0x6d'),'OrderBy','createdAt',_0x760d('0x54')],squel['select']()[_0x760d('0x72')]('h.id','id')[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('ci.item',_0x760d('0x6d'))[_0x760d('0x72')]('ci.OrderBY',_0x760d('0x83'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))[_0x760d('0x81')](_0x760d('0x84'),'ci')[_0x760d('0x85')](_0x760d('0x7e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x760d('0x3f')]('h.ListId\x20=\x20?',_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x86'),_0x35bb84['params']['id'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x87'),_0x6cf52))[_0x760d('0x74')]();_0x213958[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x260404));_0x4525a0[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x589503));}return BPromise[_0x760d('0x8a')](_0x213958);}})[_0x760d('0x26')](function(){return BPromise[_0x760d('0x8a')](_0x4525a0);})[_0x760d('0x26')](function(){return _0xbbfbde;})['then'](respondWithResult(_0x5f5aa3,null))[_0x760d('0x46')](handleError(_0x5f5aa3,null));};exports[_0x760d('0x8b')]=function(_0x5a3dd0,_0x13e10c,_0x1e02d2){return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x5a3dd0['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x13e10c,null))[_0x760d('0x26')](function(_0x56db54){if(_0x56db54){return _0x56db54[_0x760d('0x8b')](_0x5a3dd0['query'][_0x760d('0x8c')]);}})['then'](function(_0x434173){if(_0x434173){return db['CmHopper']['destroy']({'where':{'ListId':_0x5a3dd0['query'][_0x760d('0x8c')],'CampaignId':_0x5a3dd0[_0x760d('0x48')]['id']}})['then'](function(){return _0x434173;});}})['then'](respondWithStatusCode(_0x13e10c,null))[_0x760d('0x46')](handleError(_0x13e10c,null));};exports[_0x760d('0x8d')]=function(_0xeac13,_0x56e2ae,_0x559f2e){var _0x56f9cf={};var _0x176814={};var _0x3dc8ad;var _0x25927b;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0xeac13['params']['id']}})['then'](handleEntityNotFound(_0x56e2ae,null))['then'](function(_0x519188){if(_0x519188){_0x3dc8ad=_0x519188;_0x176814[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x176814[_0x760d('0x36')]=_[_0x760d('0x37')](_0xeac13['query']);_0x176814[_0x760d('0x38')]=_[_0x760d('0x39')](_0x176814['model'],_0x176814[_0x760d('0x36')]);_0x56f9cf[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x176814['model'],qs[_0x760d('0x3b')](_0xeac13[_0x760d('0x36')]['fields']));_0x56f9cf[_0x760d('0x3a')]=_0x56f9cf[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56f9cf[_0x760d('0x3a')]:_0x176814[_0x760d('0x35')];_0x56f9cf[_0x760d('0x3d')]=qs['sort'](_0xeac13[_0x760d('0x36')][_0x760d('0x3e')]);_0x56f9cf[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xeac13[_0x760d('0x36')],_0x176814[_0x760d('0x38')]));if(_0xeac13['query'][_0x760d('0x43')]){_0x56f9cf[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56f9cf[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x56f9cf[_0x760d('0x3a')],function(_0x5ae107){var _0xf38411={};_0xf38411[_0x5ae107]={'$like':'%'+_0xeac13['query']['filter']+'%'};return _0xf38411;})});}_0x56f9cf=_[_0x760d('0x41')]({},_0x56f9cf,_0xeac13[_0x760d('0x49')]);return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x53369d){if(_0x53369d){_0x25927b=_0x53369d[_0x760d('0x3c')];if(!_0xeac13[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56f9cf[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0xeac13['query'][_0x760d('0x1e')]);_0x56f9cf[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xeac13[_0x760d('0x36')][_0x760d('0x20')]);}return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x1e241f){if(_0x1e241f){return _0x1e241f?{'count':_0x25927b,'rows':_0x1e241f}:null;}})[_0x760d('0x26')](respondWithResult(_0x56e2ae,null))[_0x760d('0x46')](handleError(_0x56e2ae,null));};exports['addBlackLists']=function(_0xecae35,_0xf3cd8b,_0x59b57b){var _0x5aa429,_0xfcb74e;var _0x5b8487=[];var _0x4ecd17=moment()['format'](_0x760d('0x67'));return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0xecae35[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0xf3cd8b,null))['then'](function(_0x2117ad){if(_0x2117ad){_0xfcb74e=_0x2117ad;return _0x2117ad[_0x760d('0x8e')](_0xecae35[_0x760d('0x4c')][_0x760d('0x8c')],_[_0x760d('0x55')](_0xecae35['body'],[_0x760d('0x8c'),'id'])||{});}return null;})['spread'](function(_0x3bd7ba){var _0x391200;var _0x228c03;_0x5aa429=_0x3bd7ba||[];var _0x2bdbfe=[];if(_0x3bd7ba){for(var _0x10d180=0x0;_0x10d180<_0x3bd7ba[_0x760d('0x3c')];_0x10d180+=0x1){var _0x3c1c13=_0x3bd7ba[_0x10d180][_0x760d('0x28')]({'plain':!![]});_0x391200=squel['insert']()[_0x760d('0x6c')](_0x760d('0x8f'))[_0x760d('0x80')](['phone',_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),'updatedAt'],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')]('id','ContactId')[_0x760d('0x72')](_0x3c1c13[_0x760d('0x78')]['toString'](),_0x760d('0x70'))[_0x760d('0x72')](_0xecae35[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x56'))['field'](_0x760d('0x73'),_0x760d('0x54'))[_0x760d('0x81')]('cm_contacts')[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x3c1c13['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();_0x2bdbfe[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x391200));}return BPromise[_0x760d('0x8a')](_0x2bdbfe);}})[_0x760d('0x26')](function(){return _0x5aa429;})[_0x760d('0x26')](respondWithResult(_0xf3cd8b,null))[_0x760d('0x46')](handleError(_0xf3cd8b,null));};exports[_0x760d('0x90')]=function(_0x58bb24,_0x3e7f75,_0x428f7f){return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0x58bb24['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3e7f75,null))[_0x760d('0x26')](function(_0x3b8ad3){if(_0x3b8ad3){return _0x3b8ad3[_0x760d('0x90')](_0x58bb24['query'][_0x760d('0x8c')]);}})[_0x760d('0x26')](function(_0x4a9598){if(_0x4a9598){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x58bb24[_0x760d('0x36')][_0x760d('0x8c')],'CampaignId':_0x58bb24[_0x760d('0x48')]['id']}})[_0x760d('0x26')](function(){return _0x4a9598;});}})['then'](respondWithStatusCode(_0x3e7f75,null))[_0x760d('0x46')](handleError(_0x3e7f75,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7aa8665..d945f9b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x27b059,_0x275671){var _0x982b2a=function(_0x1e7d71){while(--_0x1e7d71){_0x27b059['push'](_0x27b059['shift']());}};_0x982b2a(++_0x275671);}(_0x7a54,0x106));var _0x47a5=function(_0x26f796,_0x4baec2){_0x26f796=_0x26f796-0x0;var _0x33e8b7=_0x7a54[_0x26f796];return _0x33e8b7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x59f638,_0x45a5d0){var _0x348cfc=function(_0x5a5760){while(--_0x5a5760){_0x59f638['push'](_0x59f638['shift']());}};_0x348cfc(++_0x45a5d0);}(_0x7a54,0x106));var _0x47a5=function(_0xd3f3f4,_0x4ebd90){_0xd3f3f4=_0xd3f3f4-0x0;var _0x1b27d9=_0x7a54[_0xd3f3f4];return _0x1b27d9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index b9572fc..8ebd6ed 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 _0x5ebe=['error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCampaign','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ebe,0x69));var _0xe5eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ebe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe5eb('0x0'));var moment=require(_0xe5eb('0x1'));var BPromise=require(_0xe5eb('0x2'));var rs=require(_0xe5eb('0x3'));var fs=require('fs');var Redis=require(_0xe5eb('0x4'));var db=require(_0xe5eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe5eb('0x6'));var config=require(_0xe5eb('0x7'));var jayson=require(_0xe5eb('0x8'));var client=jayson[_0xe5eb('0x9')][_0xe5eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae8d2,_0x1465d8,_0x1acd9d){return new BPromise(function(_0x5158f0,_0x59234a){return client['request'](_0x3ae8d2,_0x1acd9d)['then'](function(_0x2a15ee){logger['info'](_0xe5eb('0xb'),_0x1465d8,_0xe5eb('0xc'));logger[_0xe5eb('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1465d8,_0xe5eb('0xc'),JSON[_0xe5eb('0xe')](_0x2a15ee));if(_0x2a15ee[_0xe5eb('0xf')]){if(_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x10')]===0x1f4){logger['error'](_0xe5eb('0xb'),_0x1465d8,_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x11')]);return _0x59234a(_0x2a15ee['error']['message']);}logger[_0xe5eb('0xf')](_0xe5eb('0xb'),_0x1465d8,_0x2a15ee[_0xe5eb('0xf')]['message']);return _0x5158f0(_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x11')]);}else{logger['info'](_0xe5eb('0xb'),_0x1465d8,'request\x20sent');_0x5158f0(_0x2a15ee['result']['message']);}})[_0xe5eb('0x12')](function(_0x1590a0){logger['error'](_0xe5eb('0xb'),_0x1465d8,_0x1590a0);_0x59234a(_0x1590a0);});});}exports['GetCampaign']=function(_0x32c84c){var _0xc6b8df=this;return new Promise(function(_0x22d217,_0x2159a4){return db['Campaign'][_0xe5eb('0x13')]({'raw':_0x32c84c[_0xe5eb('0x14')]?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x15')]===undefined?!![]:![]:!![],'where':_0x32c84c[_0xe5eb('0x14')]?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x16')]||null:null,'attributes':_0x32c84c['options']?_0x32c84c['options'][_0xe5eb('0x17')]||null:null,'limit':_0x32c84c['options']?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x18')]||null:null,'include':_0x32c84c['options']?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x19')]?_[_0xe5eb('0x1a')](_0x32c84c['options'][_0xe5eb('0x19')],function(_0x430836){return{'model':db[_0x430836[_0xe5eb('0x1b')]],'as':_0x430836['as'],'attributes':_0x430836['attributes'],'include':_0x430836[_0xe5eb('0x19')]?_[_0xe5eb('0x1a')](_0x430836['include'],function(_0x2cd698){return{'model':db[_0x2cd698[_0xe5eb('0x1b')]],'as':_0x2cd698['as'],'attributes':_0x2cd698[_0xe5eb('0x17')],'include':_0x2cd698['include']?_[_0xe5eb('0x1a')](_0x2cd698[_0xe5eb('0x19')],function(_0x40ecb1){return{'model':db[_0x40ecb1[_0xe5eb('0x1b')]],'as':_0x40ecb1['as'],'attributes':_0x40ecb1[_0xe5eb('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22fc1c){logger[_0xe5eb('0x1c')](_0xe5eb('0x1d'),_0x32c84c);logger[_0xe5eb('0xd')]('GetCampaign',_0x32c84c,JSON['stringify'](_0x22fc1c));_0x22d217(_0x22fc1c);})['catch'](function(_0x39dc8f){logger['error'](_0xe5eb('0x1d'),_0x39dc8f[_0xe5eb('0x11')],_0x32c84c);_0x2159a4(_0xc6b8df['error'](0x1f4,_0x39dc8f[_0xe5eb('0x11')]));});});};
\ No newline at end of file
+var _0x80c7=['result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2583a8,_0x4130a5){var _0x51b92a=function(_0x3c6ba0){while(--_0x3c6ba0){_0x2583a8['push'](_0x2583a8['shift']());}};_0x51b92a(++_0x4130a5);}(_0x80c7,0x8d));var _0x780c=function(_0x444a1f,_0x22127b){_0x444a1f=_0x444a1f-0x0;var _0x5dec75=_0x80c7[_0x444a1f];return _0x5dec75;};'use strict';var _=require(_0x780c('0x0'));var util=require(_0x780c('0x1'));var moment=require(_0x780c('0x2'));var BPromise=require(_0x780c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x780c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x780c('0x5'))(_0x780c('0x6'));var config=require(_0x780c('0x7'));var jayson=require(_0x780c('0x8'));var client=jayson[_0x780c('0x9')][_0x780c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4170ef,_0x269976,_0x4041cb){return new BPromise(function(_0x2d858f,_0x1d87ca){return client['request'](_0x4170ef,_0x4041cb)[_0x780c('0xb')](function(_0x3411de){logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));logger[_0x780c('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x269976,_0x780c('0xd'),JSON[_0x780c('0xf')](_0x3411de));if(_0x3411de[_0x780c('0x10')]){if(_0x3411de[_0x780c('0x10')][_0x780c('0x11')]===0x1f4){logger[_0x780c('0x10')](_0x780c('0xc'),_0x269976,_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);return _0x1d87ca(_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);}logger[_0x780c('0x10')]('Campaign,\x20%s,\x20%s',_0x269976,_0x3411de['error'][_0x780c('0x12')]);return _0x2d858f(_0x3411de[_0x780c('0x10')]['message']);}else{logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));_0x2d858f(_0x3411de[_0x780c('0x13')][_0x780c('0x12')]);}})[_0x780c('0x14')](function(_0x33c514){logger['error'](_0x780c('0xc'),_0x269976,_0x33c514);_0x1d87ca(_0x33c514);});});}exports[_0x780c('0x15')]=function(_0x2127e2){var _0x2dbcd8=this;return new Promise(function(_0x48e6fe,_0xcd171e){return db[_0x780c('0x16')][_0x780c('0x17')]({'raw':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options'][_0x780c('0x19')]===undefined?!![]:![]:!![],'where':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options']['where']||null:null,'attributes':_0x2127e2['options']?_0x2127e2[_0x780c('0x18')][_0x780c('0x1a')]||null:null,'limit':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1b')]||null:null,'include':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')],function(_0x55fc81){return{'model':db[_0x55fc81[_0x780c('0x1e')]],'as':_0x55fc81['as'],'attributes':_0x55fc81[_0x780c('0x1a')],'include':_0x55fc81[_0x780c('0x1c')]?_['map'](_0x55fc81[_0x780c('0x1c')],function(_0x121199){return{'model':db[_0x121199[_0x780c('0x1e')]],'as':_0x121199['as'],'attributes':_0x121199[_0x780c('0x1a')],'include':_0x121199[_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x121199['include'],function(_0x1cb65e){return{'model':db[_0x1cb65e[_0x780c('0x1e')]],'as':_0x1cb65e['as'],'attributes':_0x1cb65e[_0x780c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9702){logger[_0x780c('0x1f')](_0x780c('0x15'),_0x2127e2);logger[_0x780c('0xe')](_0x780c('0x15'),_0x2127e2,JSON[_0x780c('0xf')](_0x2d9702));_0x48e6fe(_0x2d9702);})[_0x780c('0x14')](function(_0x35b97a){logger[_0x780c('0x10')](_0x780c('0x15'),_0x35b97a[_0x780c('0x12')],_0x2127e2);_0xcd171e(_0x2dbcd8[_0x780c('0x10')](0x1f4,_0x35b97a[_0x780c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 864204c..20c5f5b 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 _0xda42=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists'];(function(_0x320909,_0x17e27a){var _0x3b19b5=function(_0x5268c7){while(--_0x5268c7){_0x320909['push'](_0x320909['shift']());}};_0x3b19b5(++_0x17e27a);}(_0xda42,0x155));var _0x2da4=function(_0x549e63,_0x44b35b){_0x549e63=_0x549e63-0x0;var _0x4d102b=_0xda42[_0x549e63];return _0x4d102b;};'use strict';var multer=require(_0x2da4('0x0'));var util=require('util');var path=require(_0x2da4('0x1'));var timeout=require(_0x2da4('0x2'));var express=require(_0x2da4('0x3'));var router=express[_0x2da4('0x4')]();var fs_extra=require(_0x2da4('0x5'));var auth=require(_0x2da4('0x6'));var interaction=require(_0x2da4('0x7'));var config=require('../../config/environment');var controller=require(_0x2da4('0x8'));router['get']('/',auth[_0x2da4('0x9')](),controller[_0x2da4('0xa')]);router[_0x2da4('0xb')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller['show']);router[_0x2da4('0xb')]('/:id/hoppers',auth[_0x2da4('0x9')](),controller[_0x2da4('0xd')]);router['get'](_0x2da4('0xe'),auth[_0x2da4('0x9')](),controller[_0x2da4('0xf')]);router[_0x2da4('0xb')](_0x2da4('0x10'),auth['isAuthenticated'](),controller[_0x2da4('0x11')]);router[_0x2da4('0xb')](_0x2da4('0x12'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x13')]);router['get'](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x15')]);router['get'](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller['getBlackLists']);router[_0x2da4('0x17')]('/',auth['isAuthenticated'](),controller[_0x2da4('0x18')]);router[_0x2da4('0x17')]('/:id/clone',auth[_0x2da4('0x9')](),controller[_0x2da4('0x19')]);router[_0x2da4('0x17')](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1a')]);router[_0x2da4('0x17')](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1b')]);router[_0x2da4('0x1c')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1d')]);router[_0x2da4('0x1e')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1f')]);router[_0x2da4('0x1e')](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x20')]);router[_0x2da4('0x1e')](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller['removeBlackLists']);module[_0x2da4('0x21')]=router;
\ No newline at end of file
+var _0xce5c=['getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x41b1fa,_0x19c954){var _0x1c4822=function(_0xb9e25d){while(--_0xb9e25d){_0x41b1fa['push'](_0x41b1fa['shift']());}};_0x1c4822(++_0x19c954);}(_0xce5c,0x79));var _0xcce5=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xce5c[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require(_0xcce5('0x0'));var util=require('util');var path=require(_0xcce5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcce5('0x2')]();var fs_extra=require(_0xcce5('0x3'));var auth=require(_0xcce5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcce5('0x5'));var controller=require(_0xcce5('0x6'));router[_0xcce5('0x7')]('/',auth[_0xcce5('0x8')](),controller[_0xcce5('0x9')]);router[_0xcce5('0x7')](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xb')]);router['get'](_0xcce5('0xc'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xd')]);router[_0xcce5('0x7')](_0xcce5('0xe'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xf')]);router[_0xcce5('0x7')](_0xcce5('0x10'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x11')]);router[_0xcce5('0x7')](_0xcce5('0x12'),auth['isAuthenticated'](),controller[_0xcce5('0x13')]);router['get']('/:id/lists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x14')]);router['get'](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x16')]);router[_0xcce5('0x17')]('/',auth['isAuthenticated'](),controller[_0xcce5('0x18')]);router[_0xcce5('0x17')](_0xcce5('0x19'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1a')]);router[_0xcce5('0x17')](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1c')]);router[_0xcce5('0x17')]('/:id/blacklists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x1d')]);router['put'](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1e')]);router[_0xcce5('0x1f')]('/:id',auth[_0xcce5('0x8')](),controller[_0xcce5('0x20')]);router['delete'](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x21')]);router[_0xcce5('0x1f')](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller['removeBlackLists']);module[_0xcce5('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f766f1a..bb7c5a9 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 _0x3498=['sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x42bc73,_0x17278d){var _0x2f3f24=function(_0x1ec8dc){while(--_0x1ec8dc){_0x42bc73['push'](_0x42bc73['shift']());}};_0x2f3f24(++_0x17278d);}(_0x3498,0x78));var _0x8349=function(_0x50c154,_0x4e08a2){_0x50c154=_0x50c154-0x0;var _0x23aad4=_0x3498[_0x50c154];return _0x23aad4;};'use strict';var Sequelize=require(_0x8349('0x0'));module[_0x8349('0x1')]={'key':{'type':Sequelize[_0x8349('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8349('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8349('0x2')]},'name':{'type':Sequelize[_0x8349('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x5288=['exports','STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x5276c6,_0x252a1a){var _0x5825d8=function(_0x1f61cf){while(--_0x1f61cf){_0x5276c6['push'](_0x5276c6['shift']());}};_0x5825d8(++_0x252a1a);}(_0x5288,0x197));var _0x8528=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x5288[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0x8528('0x0'));module[_0x8528('0x1')]={'key':{'type':Sequelize[_0x8528('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8528('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8528('0x2')]},'name':{'type':Sequelize[_0x8528('0x4')],'get':function(){return this['getDataValue'](_0x8528('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index aa21183..08ccf42 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 _0x28f5=['Sequelize','ValidationError','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','json','offset','undefined','status','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','count','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x4162a0,_0x58f1eb){var _0x1f926d=function(_0x4e0eec){while(--_0x4e0eec){_0x4162a0['push'](_0x4162a0['shift']());}};_0x1f926d(++_0x58f1eb);}(_0x28f5,0x162));var _0x528f=function(_0x32f5d4,_0x4f6164){_0x32f5d4=_0x32f5d4-0x0;var _0x4c051=_0x28f5[_0x32f5d4];return _0x4c051;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x528f('0x0'));var zipdir=require(_0x528f('0x1'));var jsonpatch=require(_0x528f('0x2'));var rp=require(_0x528f('0x3'));var moment=require(_0x528f('0x4'));var BPromise=require(_0x528f('0x5'));var Mustache=require(_0x528f('0x6'));var util=require(_0x528f('0x7'));var path=require(_0x528f('0x8'));var sox=require(_0x528f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x528f('0xa'));var _=require(_0x528f('0xb'));var squel=require('squel');var crypto=require(_0x528f('0xc'));var jsforce=require(_0x528f('0xd'));var deskjs=require(_0x528f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x528f('0xf'));var Papa=require(_0x528f('0x10'));var Redis=require(_0x528f('0x11'));var authService=require(_0x528f('0x12'));var qs=require(_0x528f('0x13'));var as=require(_0x528f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x528f('0x15'))(_0x528f('0x16'));var utils=require('../../config/utils');var config=require(_0x528f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x528f('0x18'))['db'];function respondWithStatusCode(_0x1a1e46,_0x51c2c4){_0x51c2c4=_0x51c2c4||0xcc;return function(_0x1aea87){if(_0x1aea87){return _0x1a1e46['sendStatus'](_0x51c2c4);}return _0x1a1e46['status'](_0x51c2c4)[_0x528f('0x19')]();};}function respondWithResult(_0x25d575,_0x248952){_0x248952=_0x248952||0xc8;return function(_0x33a3b6){if(_0x33a3b6){return _0x25d575['status'](_0x248952)[_0x528f('0x1a')](_0x33a3b6);}};}function respondWithFilteredResult(_0x1a0276,_0x16c059){return function(_0x54753d){if(_0x54753d){var _0x9e385c=typeof _0x16c059[_0x528f('0x1b')]===_0x528f('0x1c')&&typeof _0x16c059['limit']===_0x528f('0x1c');var _0x26635d=_0x54753d['count'];var _0x3c0a6d=_0x9e385c?0x0:_0x16c059[_0x528f('0x1b')];var _0x3b7557=_0x9e385c?_0x54753d['count']:_0x16c059['offset']+_0x16c059['limit'];var _0xef558;if(_0x3b7557>=_0x26635d){_0x3b7557=_0x26635d;_0xef558=0xc8;}else{_0xef558=0xce;}_0x1a0276[_0x528f('0x1d')](_0xef558);return _0x1a0276['set'](_0x528f('0x1e'),_0x3c0a6d+'-'+_0x3b7557+'/'+_0x26635d)[_0x528f('0x1a')](_0x54753d);}return null;};}function patchUpdates(_0x35a656){return function(_0x4bd977){try{jsonpatch[_0x528f('0x1f')](_0x4bd977,_0x35a656,!![]);}catch(_0x5e5eb3){return BPromise[_0x528f('0x20')](_0x5e5eb3);}return _0x4bd977[_0x528f('0x21')]();};}function saveUpdates(_0x32e5bd,_0x4bad70){return function(_0x427e93){if(_0x427e93){return _0x427e93['update'](_0x32e5bd)[_0x528f('0x22')](function(_0x228b9a){return _0x228b9a;});}return null;};}function removeEntity(_0x2043e0,_0x27a3ff){return function(_0x52be6e){if(_0x52be6e){return _0x52be6e[_0x528f('0x23')]()[_0x528f('0x22')](function(){var _0x27870a=_0x52be6e[_0x528f('0x24')]({'plain':!![]});var _0x46d232=_0x528f('0x25');return db[_0x528f('0x26')][_0x528f('0x23')]({'where':{'type':_0x46d232,'resourceId':_0x27870a['id']}})['then'](function(){return _0x52be6e;});})[_0x528f('0x22')](function(){_0x2043e0['status'](0xcc)[_0x528f('0x19')]();});}};}function handleEntityNotFound(_0x236299,_0x49f77b){return function(_0x3b3a93){if(!_0x3b3a93){_0x236299[_0x528f('0x27')](0x194);}return _0x3b3a93;};}function handleError(_0x44cda0,_0x1d9dc5){_0x1d9dc5=_0x1d9dc5||0x1f4;return function(_0x4e4d93){logger[_0x528f('0x28')](_0x4e4d93[_0x528f('0x29')]);if(_0x4e4d93[_0x528f('0x2a')]){delete _0x4e4d93[_0x528f('0x2a')];}_0x44cda0['status'](_0x1d9dc5)['send'](_0x4e4d93);};}exports[_0x528f('0x2b')]=function(_0x4882b7,_0x538c4f){var _0x1c9fec={},_0x2a70d6={},_0x3918e3={'count':0x0,'rows':[]};var _0x317f2f=_['map'](db[_0x528f('0x2c')][_0x528f('0x2d')],function(_0x5941e6){return{'name':_0x5941e6['fieldName'],'type':_0x5941e6[_0x528f('0x2e')][_0x528f('0x2f')]};});_0x2a70d6[_0x528f('0x30')]=_['map'](_0x317f2f,_0x528f('0x2a'));_0x2a70d6['query']=_[_0x528f('0x31')](_0x4882b7[_0x528f('0x32')]);_0x2a70d6[_0x528f('0x33')]=_[_0x528f('0x34')](_0x2a70d6[_0x528f('0x30')],_0x2a70d6['query']);_0x1c9fec[_0x528f('0x35')]=_[_0x528f('0x34')](_0x2a70d6[_0x528f('0x30')],qs[_0x528f('0x36')](_0x4882b7[_0x528f('0x32')][_0x528f('0x36')]));_0x1c9fec[_0x528f('0x35')]=_0x1c9fec[_0x528f('0x35')][_0x528f('0x37')]?_0x1c9fec[_0x528f('0x35')]:_0x2a70d6[_0x528f('0x30')];if(!_0x4882b7[_0x528f('0x32')][_0x528f('0x38')](_0x528f('0x39'))){_0x1c9fec[_0x528f('0x3a')]=qs[_0x528f('0x3a')](_0x4882b7[_0x528f('0x32')][_0x528f('0x3a')]);_0x1c9fec[_0x528f('0x1b')]=qs[_0x528f('0x1b')](_0x4882b7[_0x528f('0x32')][_0x528f('0x1b')]);}_0x1c9fec[_0x528f('0x3b')]=qs[_0x528f('0x3c')](_0x4882b7['query'][_0x528f('0x3c')]);_0x1c9fec[_0x528f('0x3d')]=qs[_0x528f('0x33')](_[_0x528f('0x3e')](_0x4882b7[_0x528f('0x32')],_0x2a70d6[_0x528f('0x33')]),_0x317f2f);if(_0x4882b7[_0x528f('0x32')]['filter']){_0x1c9fec[_0x528f('0x3d')]=_[_0x528f('0x3f')](_0x1c9fec[_0x528f('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4882b7[_0x528f('0x32')][_0x528f('0x40')]+'%'}},{'value':{'$like':'%'+_0x4882b7['query']['filter']+'%'}}]});}_0x1c9fec=_[_0x528f('0x3f')]({},_0x1c9fec,_0x4882b7['options']);var _0x58fbb1={'where':_0x1c9fec[_0x528f('0x3d')]};return db['CannedAnswer']['count'](_0x58fbb1)[_0x528f('0x22')](function(_0x4efc51){_0x3918e3[_0x528f('0x41')]=_0x4efc51;if(_0x4882b7[_0x528f('0x32')][_0x528f('0x42')]){_0x1c9fec[_0x528f('0x43')]=[{'all':!![]}];}return db[_0x528f('0x2c')][_0x528f('0x44')](_0x1c9fec);})['then'](function(_0x446d42){_0x3918e3[_0x528f('0x45')]=_0x446d42;return _0x3918e3;})[_0x528f('0x22')](respondWithFilteredResult(_0x538c4f,_0x1c9fec))[_0x528f('0x46')](handleError(_0x538c4f,null));};exports[_0x528f('0x47')]=function(_0x407225,_0x196643){var _0x374b87={'raw':!![],'where':{'id':_0x407225['params']['id']}},_0x27da9b={};_0x27da9b[_0x528f('0x30')]=_[_0x528f('0x31')](db[_0x528f('0x2c')][_0x528f('0x2d')]);_0x27da9b[_0x528f('0x32')]=_[_0x528f('0x31')](_0x407225['query']);_0x27da9b[_0x528f('0x33')]=_[_0x528f('0x34')](_0x27da9b[_0x528f('0x30')],_0x27da9b['query']);_0x374b87['attributes']=_['intersection'](_0x27da9b[_0x528f('0x30')],qs[_0x528f('0x36')](_0x407225[_0x528f('0x32')][_0x528f('0x36')]));_0x374b87[_0x528f('0x35')]=_0x374b87[_0x528f('0x35')][_0x528f('0x37')]?_0x374b87[_0x528f('0x35')]:_0x27da9b['model'];if(_0x407225[_0x528f('0x32')][_0x528f('0x42')]){_0x374b87[_0x528f('0x43')]=[{'all':!![]}];}_0x374b87=_[_0x528f('0x3f')]({},_0x374b87,_0x407225[_0x528f('0x48')]);return db[_0x528f('0x2c')][_0x528f('0x49')](_0x374b87)[_0x528f('0x22')](handleEntityNotFound(_0x196643,null))[_0x528f('0x22')](respondWithResult(_0x196643,null))[_0x528f('0x46')](handleError(_0x196643,null));};exports['update']=function(_0x2af3a5,_0x428d3a){if(_0x2af3a5[_0x528f('0x4a')]['id']){delete _0x2af3a5['body']['id'];}return db['CannedAnswer'][_0x528f('0x49')]({'where':{'id':_0x2af3a5[_0x528f('0x4b')]['id']}})[_0x528f('0x22')](handleEntityNotFound(_0x428d3a,null))[_0x528f('0x22')](saveUpdates(_0x2af3a5['body'],null))['then'](respondWithResult(_0x428d3a,null))[_0x528f('0x46')](handleError(_0x428d3a,null));};exports[_0x528f('0x23')]=function(_0x48bd2e,_0x45a4ee){return db[_0x528f('0x2c')][_0x528f('0x49')]({'where':{'id':_0x48bd2e['params']['id']}})[_0x528f('0x22')](handleEntityNotFound(_0x45a4ee,null))[_0x528f('0x22')](removeEntity(_0x45a4ee,null))[_0x528f('0x46')](handleError(_0x45a4ee,null));};exports[_0x528f('0x4c')]=function(_0x336079,_0x5ad115){var _0x4e9df3={'key':_0x336079[_0x528f('0x4a')][_0x528f('0x2f')]};if(_0x336079[_0x528f('0x4a')][_0x528f('0x4d')]){_0x4e9df3['MailAccountId']=_0x336079['body']['MailAccountId'];}else if(_0x336079[_0x528f('0x4a')][_0x528f('0x4e')]){_0x4e9df3[_0x528f('0x4e')]=_0x336079[_0x528f('0x4a')][_0x528f('0x4e')];}else if(_0x336079[_0x528f('0x4a')]['OpenchannelAccountId']){_0x4e9df3[_0x528f('0x4f')]=_0x336079['body'][_0x528f('0x4f')];}else if(_0x336079[_0x528f('0x4a')][_0x528f('0x50')]){_0x4e9df3['ChatWebsiteId']=_0x336079[_0x528f('0x4a')][_0x528f('0x50')];}return db[_0x528f('0x2c')][_0x528f('0x49')]({'where':_0x4e9df3})[_0x528f('0x22')](function(_0x40b9fc){if(_0x40b9fc){throw new db[(_0x528f('0x51'))][(_0x528f('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x528f('0x2c')][_0x528f('0x4c')](_0x336079[_0x528f('0x4a')]);})[_0x528f('0x22')](function(_0x533c63){var _0x135d21=_0x336079[_0x528f('0x53')][_0x528f('0x24')]({'plain':!![]});if(!_0x135d21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135d21[_0x528f('0x54')]===_0x528f('0x53')){var _0x54479c=_0x533c63[_0x528f('0x24')]({'plain':!![]});return db[_0x528f('0x55')]['find']({'where':{'name':_0x528f('0x25'),'userProfileId':_0x135d21['userProfileId']},'raw':!![]})[_0x528f('0x22')](function(_0x391815){if(_0x391815&&_0x391815['autoAssociation']===0x0){return db[_0x528f('0x26')][_0x528f('0x4c')]({'name':_0x54479c['name'],'resourceId':_0x54479c['id'],'type':_0x391815['name'],'sectionId':_0x391815['id']},{})[_0x528f('0x22')](function(){return _0x533c63;});}else{return _0x533c63;}})[_0x528f('0x46')](function(_0x23eb69){logger[_0x528f('0x28')](_0x528f('0x56'),_0x23eb69);throw _0x23eb69;});}return _0x533c63;})[_0x528f('0x22')](respondWithResult(_0x5ad115,0xc9))['catch'](handleError(_0x5ad115,null));};
\ No newline at end of file
+var _0xe7f3=['status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x15882b,_0xc30d9d){var _0x59612d=function(_0x774f8){while(--_0x774f8){_0x15882b['push'](_0x15882b['shift']());}};_0x59612d(++_0xc30d9d);}(_0xe7f3,0x97));var _0x3e7f=function(_0x492039,_0x487df3){_0x492039=_0x492039-0x0;var _0xf1a5a2=_0xe7f3[_0x492039];return _0xf1a5a2;};'use strict';var emlformat=require(_0x3e7f('0x0'));var rimraf=require(_0x3e7f('0x1'));var zipdir=require(_0x3e7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e7f('0x3'));var moment=require('moment');var BPromise=require(_0x3e7f('0x4'));var Mustache=require('mustache');var util=require(_0x3e7f('0x5'));var path=require('path');var sox=require(_0x3e7f('0x6'));var csv=require(_0x3e7f('0x7'));var ejs=require(_0x3e7f('0x8'));var fs=require('fs');var fs_extra=require(_0x3e7f('0x9'));var _=require(_0x3e7f('0xa'));var squel=require(_0x3e7f('0xb'));var crypto=require(_0x3e7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e7f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e7f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e7f('0xf'));var qs=require(_0x3e7f('0x10'));var as=require(_0x3e7f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e7f('0x12'))('api');var utils=require(_0x3e7f('0x13'));var config=require(_0x3e7f('0x14'));var licenseUtil=require(_0x3e7f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51e0e3,_0x542a5a){_0x542a5a=_0x542a5a||0xcc;return function(_0x3e122f){if(_0x3e122f){return _0x51e0e3[_0x3e7f('0x16')](_0x542a5a);}return _0x51e0e3[_0x3e7f('0x17')](_0x542a5a)['end']();};}function respondWithResult(_0x4d8c34,_0x510d08){_0x510d08=_0x510d08||0xc8;return function(_0xa44d8f){if(_0xa44d8f){return _0x4d8c34[_0x3e7f('0x17')](_0x510d08)[_0x3e7f('0x18')](_0xa44d8f);}};}function respondWithFilteredResult(_0x13a887,_0x45b57e){return function(_0x1b4bd1){if(_0x1b4bd1){var _0x39929b=typeof _0x45b57e['offset']===_0x3e7f('0x19')&&typeof _0x45b57e['limit']===_0x3e7f('0x19');var _0x5c8e4a=_0x1b4bd1[_0x3e7f('0x1a')];var _0x199f83=_0x39929b?0x0:_0x45b57e['offset'];var _0x5e0638=_0x39929b?_0x1b4bd1['count']:_0x45b57e[_0x3e7f('0x1b')]+_0x45b57e[_0x3e7f('0x1c')];var _0x26021a;if(_0x5e0638>=_0x5c8e4a){_0x5e0638=_0x5c8e4a;_0x26021a=0xc8;}else{_0x26021a=0xce;}_0x13a887[_0x3e7f('0x17')](_0x26021a);return _0x13a887[_0x3e7f('0x1d')](_0x3e7f('0x1e'),_0x199f83+'-'+_0x5e0638+'/'+_0x5c8e4a)[_0x3e7f('0x18')](_0x1b4bd1);}return null;};}function patchUpdates(_0x17302d){return function(_0x5e7246){try{jsonpatch[_0x3e7f('0x1f')](_0x5e7246,_0x17302d,!![]);}catch(_0x328edb){return BPromise[_0x3e7f('0x20')](_0x328edb);}return _0x5e7246[_0x3e7f('0x21')]();};}function saveUpdates(_0x2d04b,_0x3c0301){return function(_0x26d477){if(_0x26d477){return _0x26d477[_0x3e7f('0x22')](_0x2d04b)[_0x3e7f('0x23')](function(_0x2b185e){return _0x2b185e;});}return null;};}function removeEntity(_0xdbcce6,_0x5db45c){return function(_0x3ccdfe){if(_0x3ccdfe){return _0x3ccdfe[_0x3e7f('0x24')]()['then'](function(){var _0x660f11=_0x3ccdfe['get']({'plain':!![]});var _0x33e901=_0x3e7f('0x25');return db['UserProfileResource'][_0x3e7f('0x24')]({'where':{'type':_0x33e901,'resourceId':_0x660f11['id']}})[_0x3e7f('0x23')](function(){return _0x3ccdfe;});})[_0x3e7f('0x23')](function(){_0xdbcce6[_0x3e7f('0x17')](0xcc)[_0x3e7f('0x26')]();});}};}function handleEntityNotFound(_0x1cd40c,_0x4c7e30){return function(_0x28eb8e){if(!_0x28eb8e){_0x1cd40c[_0x3e7f('0x16')](0x194);}return _0x28eb8e;};}function handleError(_0x8638ca,_0x55a939){_0x55a939=_0x55a939||0x1f4;return function(_0xe1a67b){logger[_0x3e7f('0x27')](_0xe1a67b[_0x3e7f('0x28')]);if(_0xe1a67b[_0x3e7f('0x29')]){delete _0xe1a67b[_0x3e7f('0x29')];}_0x8638ca[_0x3e7f('0x17')](_0x55a939)[_0x3e7f('0x2a')](_0xe1a67b);};}exports[_0x3e7f('0x2b')]=function(_0xff948f,_0x32109f){var _0x362acc={},_0xeee457={},_0x159aea={'count':0x0,'rows':[]};var _0x51fdb3=_['map'](db[_0x3e7f('0x2c')][_0x3e7f('0x2d')],function(_0x57074d){return{'name':_0x57074d[_0x3e7f('0x2e')],'type':_0x57074d[_0x3e7f('0x2f')]['key']};});_0xeee457[_0x3e7f('0x30')]=_[_0x3e7f('0x31')](_0x51fdb3,_0x3e7f('0x29'));_0xeee457['query']=_['keys'](_0xff948f['query']);_0xeee457['filters']=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],_0xeee457[_0x3e7f('0x33')]);_0x362acc[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0xff948f['query'][_0x3e7f('0x35')]));_0x362acc['attributes']=_0x362acc[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x362acc['attributes']:_0xeee457[_0x3e7f('0x30')];if(!_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x37')](_0x3e7f('0x38'))){_0x362acc[_0x3e7f('0x1c')]=qs['limit'](_0xff948f[_0x3e7f('0x33')]['limit']);_0x362acc[_0x3e7f('0x1b')]=qs[_0x3e7f('0x1b')](_0xff948f['query'][_0x3e7f('0x1b')]);}_0x362acc[_0x3e7f('0x39')]=qs[_0x3e7f('0x3a')](_0xff948f['query'][_0x3e7f('0x3a')]);_0x362acc['where']=qs[_0x3e7f('0x3b')](_['pick'](_0xff948f[_0x3e7f('0x33')],_0xeee457[_0x3e7f('0x3b')]),_0x51fdb3);if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]){_0x362acc[_0x3e7f('0x3d')]=_[_0x3e7f('0x3e')](_0x362acc[_0x3e7f('0x3d')],{'$or':[{'key':{'$like':'%'+_0xff948f[_0x3e7f('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]+'%'}}]});}_0x362acc=_[_0x3e7f('0x3e')]({},_0x362acc,_0xff948f['options']);var _0x1344f4={'where':_0x362acc[_0x3e7f('0x3d')]};return db[_0x3e7f('0x2c')]['count'](_0x1344f4)[_0x3e7f('0x23')](function(_0x201cac){_0x159aea[_0x3e7f('0x1a')]=_0x201cac;if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x362acc[_0x3e7f('0x40')]=[{'all':!![]}];}return db[_0x3e7f('0x2c')][_0x3e7f('0x41')](_0x362acc);})[_0x3e7f('0x23')](function(_0x17ad0a){_0x159aea[_0x3e7f('0x42')]=_0x17ad0a;return _0x159aea;})[_0x3e7f('0x23')](respondWithFilteredResult(_0x32109f,_0x362acc))[_0x3e7f('0x43')](handleError(_0x32109f,null));};exports[_0x3e7f('0x44')]=function(_0x3e7c08,_0x22cfb0){var _0x52b81b={'raw':!![],'where':{'id':_0x3e7c08[_0x3e7f('0x45')]['id']}},_0x227842={};_0x227842['model']=_['keys'](db[_0x3e7f('0x2c')]['rawAttributes']);_0x227842['query']=_[_0x3e7f('0x46')](_0x3e7c08[_0x3e7f('0x33')]);_0x227842[_0x3e7f('0x3b')]=_['intersection'](_0x227842['model'],_0x227842['query']);_0x52b81b[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0x227842[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0x3e7c08['query']['fields']));_0x52b81b['attributes']=_0x52b81b[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x52b81b[_0x3e7f('0x34')]:_0x227842[_0x3e7f('0x30')];if(_0x3e7c08[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x52b81b['include']=[{'all':!![]}];}_0x52b81b=_[_0x3e7f('0x3e')]({},_0x52b81b,_0x3e7c08['options']);return db['CannedAnswer'][_0x3e7f('0x47')](_0x52b81b)[_0x3e7f('0x23')](handleEntityNotFound(_0x22cfb0,null))[_0x3e7f('0x23')](respondWithResult(_0x22cfb0,null))['catch'](handleError(_0x22cfb0,null));};exports['update']=function(_0x44f1ec,_0x14a122){if(_0x44f1ec[_0x3e7f('0x48')]['id']){delete _0x44f1ec[_0x3e7f('0x48')]['id'];}return db['CannedAnswer'][_0x3e7f('0x47')]({'where':{'id':_0x44f1ec[_0x3e7f('0x45')]['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x14a122,null))['then'](saveUpdates(_0x44f1ec[_0x3e7f('0x48')],null))['then'](respondWithResult(_0x14a122,null))[_0x3e7f('0x43')](handleError(_0x14a122,null));};exports['destroy']=function(_0x515a60,_0x4d83b3){return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':{'id':_0x515a60['params']['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x4d83b3,null))[_0x3e7f('0x23')](removeEntity(_0x4d83b3,null))[_0x3e7f('0x43')](handleError(_0x4d83b3,null));};exports[_0x3e7f('0x49')]=function(_0x42a44c,_0x46a443){var _0x538e37={'key':_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4a')]};if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4b')]){_0x538e37['MailAccountId']=_0x42a44c['body'][_0x3e7f('0x4b')];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4c')]){_0x538e37[_0x3e7f('0x4c')]=_0x42a44c[_0x3e7f('0x48')]['SmsAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4d')]){_0x538e37[_0x3e7f('0x4d')]=_0x42a44c[_0x3e7f('0x48')]['OpenchannelAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')]){_0x538e37[_0x3e7f('0x4e')]=_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')];}return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':_0x538e37})[_0x3e7f('0x23')](function(_0x139ae2){if(_0x139ae2){throw new db['Sequelize'][(_0x3e7f('0x4f'))](_0x3e7f('0x50'));}return db[_0x3e7f('0x2c')][_0x3e7f('0x49')](_0x42a44c['body']);})[_0x3e7f('0x23')](function(_0x5a624a){var _0x4bda60=_0x42a44c[_0x3e7f('0x51')][_0x3e7f('0x52')]({'plain':!![]});if(!_0x4bda60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bda60[_0x3e7f('0x53')]===_0x3e7f('0x51')){var _0x4ba8e1=_0x5a624a[_0x3e7f('0x52')]({'plain':!![]});return db[_0x3e7f('0x54')]['find']({'where':{'name':_0x3e7f('0x25'),'userProfileId':_0x4bda60[_0x3e7f('0x55')]},'raw':!![]})[_0x3e7f('0x23')](function(_0x2df04e){if(_0x2df04e&&_0x2df04e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ba8e1['name'],'resourceId':_0x4ba8e1['id'],'type':_0x2df04e['name'],'sectionId':_0x2df04e['id']},{})[_0x3e7f('0x23')](function(){return _0x5a624a;});}else{return _0x5a624a;}})[_0x3e7f('0x43')](function(_0x4db259){logger[_0x3e7f('0x27')](_0x3e7f('0x56'),_0x4db259);throw _0x4db259;});}return _0x5a624a;})[_0x3e7f('0x23')](respondWithResult(_0x46a443,0xc9))['catch'](handleError(_0x46a443,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7297ca5..34ba175 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 _0x8cf2=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x3fa63f,_0x548355){var _0x3a99ed=function(_0x17b249){while(--_0x17b249){_0x3fa63f['push'](_0x3fa63f['shift']());}};_0x3a99ed(++_0x548355);}(_0x8cf2,0x1a7));var _0x28cf=function(_0x3a7ae7,_0x33e3a7){_0x3a7ae7=_0x3a7ae7-0x0;var _0x1b8913=_0x8cf2[_0x3a7ae7];return _0x1b8913;};'use strict';var _=require(_0x28cf('0x0'));var util=require(_0x28cf('0x1'));var logger=require(_0x28cf('0x2'))(_0x28cf('0x3'));var moment=require(_0x28cf('0x4'));var BPromise=require(_0x28cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28cf('0x6'));var rimraf=require(_0x28cf('0x7'));var config=require(_0x28cf('0x8'));var attributes=require(_0x28cf('0x9'));module['exports']=function(_0x13a089,_0xbbabf8){return _0x13a089[_0x28cf('0xa')](_0x28cf('0xb'),attributes,{'tableName':_0x28cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28cf('0xd'),'collate':_0x28cf('0xe')});};
\ No newline at end of file
+var _0x5e29=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5e29,0x149));var _0x95e2=function(_0x57caf0,_0x1fe145){_0x57caf0=_0x57caf0-0x0;var _0x65d871=_0x5e29[_0x57caf0];return _0x65d871;};'use strict';var _=require(_0x95e2('0x0'));var util=require('util');var logger=require(_0x95e2('0x1'))('api');var moment=require(_0x95e2('0x2'));var BPromise=require(_0x95e2('0x3'));var rp=require(_0x95e2('0x4'));var fs=require('fs');var path=require(_0x95e2('0x5'));var rimraf=require(_0x95e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e2('0x7'));module[_0x95e2('0x8')]=function(_0x3ba9d3,_0x1373d6){return _0x3ba9d3['define'](_0x95e2('0x9'),attributes,{'tableName':_0x95e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95e2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 5540400..39d4ae1 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(_0x2e7213,_0xe14507){var _0x3643db=function(_0x3c27ee){while(--_0x3c27ee){_0x2e7213['push'](_0x2e7213['shift']());}};_0x3643db(++_0xe14507);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1ad31b,_0x50da64){var _0x17f2f0=function(_0x5483b6){while(--_0x5483b6){_0x1ad31b['push'](_0x1ad31b['shift']());}};_0x17f2f0(++_0x50da64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 a2d1d30..a92e274 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 _0x2241=['util','connect-timeout','express','Router','fs-extra','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4e5b0e,_0x15a6b0){var _0x1606bd=function(_0x1a18ec){while(--_0x1a18ec){_0x4e5b0e['push'](_0x4e5b0e['shift']());}};_0x1606bd(++_0x15a6b0);}(_0x2241,0x97));var _0x1224=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2241[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x1224('0x0'));var util=require(_0x1224('0x1'));var path=require('path');var timeout=require(_0x1224('0x2'));var express=require(_0x1224('0x3'));var router=express[_0x1224('0x4')]();var fs_extra=require(_0x1224('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1224('0x6'));router[_0x1224('0x7')]('/',auth[_0x1224('0x8')](),controller[_0x1224('0x9')]);router[_0x1224('0x7')]('/:id',auth[_0x1224('0x8')](),controller[_0x1224('0xa')]);router[_0x1224('0xb')]('/',auth[_0x1224('0x8')](),controller[_0x1224('0xc')]);router[_0x1224('0xd')](_0x1224('0xe'),auth[_0x1224('0x8')](),controller[_0x1224('0xf')]);router[_0x1224('0x10')]('/:id',auth[_0x1224('0x8')](),controller[_0x1224('0x11')]);module[_0x1224('0x12')]=router;
\ No newline at end of file
+var _0x9dbc=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x938c4e,_0x2fa5ca){var _0x2bb9a9=function(_0x3a2a61){while(--_0x3a2a61){_0x938c4e['push'](_0x938c4e['shift']());}};_0x2bb9a9(++_0x2fa5ca);}(_0x9dbc,0xc1));var _0xc9db=function(_0xcc1266,_0x27ba6d){_0xcc1266=_0xcc1266-0x0;var _0x34e46a=_0x9dbc[_0xcc1266];return _0x34e46a;};'use strict';var multer=require(_0xc9db('0x0'));var util=require(_0xc9db('0x1'));var path=require(_0xc9db('0x2'));var timeout=require(_0xc9db('0x3'));var express=require(_0xc9db('0x4'));var router=express[_0xc9db('0x5')]();var fs_extra=require(_0xc9db('0x6'));var auth=require(_0xc9db('0x7'));var interaction=require(_0xc9db('0x8'));var config=require(_0xc9db('0x9'));var controller=require('./cannedAnswer.controller');router[_0xc9db('0xa')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xc')]);router[_0xc9db('0xa')](_0xc9db('0xd'),auth[_0xc9db('0xb')](),controller['show']);router[_0xc9db('0xe')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xf')]);router[_0xc9db('0x10')]('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x11')]);router['delete']('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x12')]);module[_0xc9db('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 8b26f6d..bca494b 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 _0x2504=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x51b8ec,_0x4293bd){var _0x25d058=function(_0x4d7d3a){while(--_0x4d7d3a){_0x51b8ec['push'](_0x51b8ec['shift']());}};_0x25d058(++_0x4293bd);}(_0x2504,0xee));var _0x4250=function(_0x2fb3b8,_0xf4d664){_0x2fb3b8=_0x2fb3b8-0x0;var _0x51db65=_0x2504[_0x2fb3b8];return _0x51db65;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'calldate':{'type':Sequelize[_0x4250('0x2')],'allowNull':![],'defaultValue':_0x4250('0x3')},'clid':{'type':Sequelize[_0x4250('0x4')]},'src':{'type':Sequelize[_0x4250('0x4')]},'dst':{'type':Sequelize[_0x4250('0x4')]},'dcontext':{'type':Sequelize[_0x4250('0x4')]},'channel':{'type':Sequelize[_0x4250('0x4')]},'dstchannel':{'type':Sequelize[_0x4250('0x4')]},'lastapp':{'type':Sequelize[_0x4250('0x4')]},'lastdata':{'type':Sequelize[_0x4250('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4250('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4250('0x4')]},'userfield':{'type':Sequelize[_0x4250('0x4')]},'uniqueid':{'type':Sequelize[_0x4250('0x4')]},'linkedid':{'type':Sequelize[_0x4250('0x4')]},'sequence':{'type':Sequelize[_0x4250('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4250('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7217=['INTEGER','DATE','STRING'];(function(_0x2fe487,_0x2b78f6){var _0x250916=function(_0x4b9a0c){while(--_0x4b9a0c){_0x2fe487['push'](_0x2fe487['shift']());}};_0x250916(++_0x2b78f6);}(_0x7217,0xa9));var _0x7721=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7217[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x7721('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7721('0x1')]},'src':{'type':Sequelize[_0x7721('0x1')]},'dst':{'type':Sequelize[_0x7721('0x1')]},'dcontext':{'type':Sequelize[_0x7721('0x1')]},'channel':{'type':Sequelize[_0x7721('0x1')]},'dstchannel':{'type':Sequelize[_0x7721('0x1')]},'lastapp':{'type':Sequelize[_0x7721('0x1')]},'lastdata':{'type':Sequelize[_0x7721('0x1')]},'duration':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7721('0x1')]},'userfield':{'type':Sequelize[_0x7721('0x1')]},'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7721('0x1')]},'peeraccount':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7721('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 4cc4dca..d8cca91 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 _0x038b=['lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv'];(function(_0x375072,_0x1ad2ed){var _0x3e82e7=function(_0x2a03ec){while(--_0x2a03ec){_0x375072['push'](_0x375072['shift']());}};_0x3e82e7(++_0x1ad2ed);}(_0x038b,0x114));var _0xb038=function(_0x236021,_0x5acc10){_0x236021=_0x236021-0x0;var _0x4d5fa6=_0x038b[_0x236021];return _0x4d5fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':!![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['Cdr']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['Cdr'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['describe']=function(_0x1f4997,_0x2f3622){return db[_0xb038('0x27')][_0xb038('0x46')]()[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));};
\ No newline at end of file
+var _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x57e648,_0x2d8f7e){var _0x3edc8f=function(_0x426502){while(--_0x426502){_0x57e648['push'](_0x57e648['shift']());}};_0x3edc8f(++_0x2d8f7e);}(_0xcb81,0x154));var _0x1cb8=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xcb81[_0x2440fe];return _0x5cf734;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 86d50ca..d2c887a 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(_0x2ab6f0,_0xbcac98){var _0x140f2=function(_0x240529){while(--_0x240529){_0x2ab6f0['push'](_0x2ab6f0['shift']());}};_0x140f2(++_0xbcac98);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x52c27d,_0xda4996){var _0x3e712a=function(_0x4bc790){while(--_0x4bc790){_0x52c27d['push'](_0x52c27d['shift']());}};_0x3e712a(++_0xda4996);}(_0x7a54,0x106));var _0x47a5=function(_0x1ffa19,_0x143952){_0x1ffa19=_0x1ffa19-0x0;var _0x125b11=_0x7a54[_0x1ffa19];return _0x125b11;};'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 8d281fa..10dc045 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 _0x93e6=['ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93e6,0xcc));var _0x693e=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0x93e6[_0x485c9f];return _0x2ba76e;};'use strict';var _=require(_0x693e('0x0'));var util=require(_0x693e('0x1'));var moment=require(_0x693e('0x2'));var BPromise=require(_0x693e('0x3'));var rs=require(_0x693e('0x4'));var fs=require('fs');var Redis=require(_0x693e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x6'));var logger=require(_0x693e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x693e('0x8'));var client=jayson['client'][_0x693e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52cbf5,_0x4f6ffa,_0x3cbefd){return new BPromise(function(_0x38da4c,_0x58b9a3){return client[_0x693e('0xa')](_0x52cbf5,_0x3cbefd)[_0x693e('0xb')](function(_0x56d87f){logger[_0x693e('0xc')](_0x693e('0xd'),_0x4f6ffa,'request\x20sent');logger[_0x693e('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4f6ffa,_0x693e('0xf'),JSON['stringify'](_0x56d87f));if(_0x56d87f[_0x693e('0x10')]){if(_0x56d87f[_0x693e('0x10')]['code']===0x1f4){logger[_0x693e('0x10')](_0x693e('0xd'),_0x4f6ffa,_0x56d87f[_0x693e('0x10')]['message']);return _0x58b9a3(_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);}logger[_0x693e('0x10')](_0x693e('0xd'),_0x4f6ffa,_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);return _0x38da4c(_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);}else{logger[_0x693e('0xc')](_0x693e('0xd'),_0x4f6ffa,_0x693e('0xf'));_0x38da4c(_0x56d87f['result'][_0x693e('0x11')]);}})[_0x693e('0x12')](function(_0x3a793f){logger['error'](_0x693e('0xd'),_0x4f6ffa,_0x3a793f);_0x58b9a3(_0x3a793f);});});}
\ No newline at end of file
+var _0xecdd=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2a1445,_0x5d2b8d){var _0x5ec7f4=function(_0x54492a){while(--_0x54492a){_0x2a1445['push'](_0x2a1445['shift']());}};_0x5ec7f4(++_0x5d2b8d);}(_0xecdd,0x169));var _0xdecd=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xecdd[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xdecd('0x0'));var moment=require(_0xdecd('0x1'));var BPromise=require('bluebird');var rs=require(_0xdecd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdecd('0x3'))['db'];var utils=require(_0xdecd('0x4'));var logger=require(_0xdecd('0x5'))(_0xdecd('0x6'));var config=require(_0xdecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdecd('0x8')][_0xdecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28537c,_0x535609,_0x213407){return new BPromise(function(_0x582899,_0x4302e8){return client[_0xdecd('0xa')](_0x28537c,_0x213407)[_0xdecd('0xb')](function(_0x122a36){logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));logger[_0xdecd('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x535609,_0xdecd('0xe'),JSON[_0xdecd('0x10')](_0x122a36));if(_0x122a36['error']){if(_0x122a36[_0xdecd('0x11')][_0xdecd('0x12')]===0x1f4){logger[_0xdecd('0x11')]('Cdr,\x20%s,\x20%s',_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x4302e8(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}logger['error'](_0xdecd('0xd'),_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x582899(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}else{logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));_0x582899(_0x122a36[_0xdecd('0x14')][_0xdecd('0x13')]);}})[_0xdecd('0x15')](function(_0xc014a3){logger[_0xdecd('0x11')](_0xdecd('0xd'),_0x535609,_0xc014a3);_0x4302e8(_0xc014a3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e8e56a6..e322466 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1f808f,_0x172b10){var _0x282348=function(_0xfa8c2){while(--_0xfa8c2){_0x1f808f['push'](_0x1f808f['shift']());}};_0x282348(++_0x172b10);}(_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 c67368e..10536ea 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 _0xbddc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x575b4c,_0x547381){var _0x1dd85f=function(_0x49317f){while(--_0x49317f){_0x575b4c['push'](_0x575b4c['shift']());}};_0x1dd85f(++_0x547381);}(_0xbddc,0x126));var _0xcbdd=function(_0x1521fa,_0x59b606){_0x1521fa=_0x1521fa-0x0;var _0x4eb3e2=_0xbddc[_0x1521fa];return _0x4eb3e2;};'use strict';var Sequelize=require(_0xcbdd('0x0'));module[_0xcbdd('0x1')]={'priority':{'type':Sequelize[_0xcbdd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcbdd('0x3')],'allowNull':![],'defaultValue':_0xcbdd('0x4')},'appdata':{'type':Sequelize[_0xcbdd('0x5')]()},'description':{'type':Sequelize[_0xcbdd('0x3')]},'interval':{'type':Sequelize[_0xcbdd('0x3')],'defaultValue':_0xcbdd('0x6')}};
\ No newline at end of file
+var _0xbd13=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xbd13,0xc7));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3bd1('0x0'));module[_0x3bd1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3bd1('0x2')},'appdata':{'type':Sequelize[_0x3bd1('0x3')]()},'description':{'type':Sequelize[_0x3bd1('0x4')]},'interval':{'type':Sequelize[_0x3bd1('0x4')],'defaultValue':_0x3bd1('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 0221860..edf1ff2 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 _0x9b00=['filters','intersection','model','attributes','fields','length','include','options','find','then','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','reject','save','update','destroy','error','stack','name','show','params','keys','ChatApplication','rawAttributes','query'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x9b00,0xcc));var _0x09b0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9b00[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x09b0('0x0'));var rimraf=require(_0x09b0('0x1'));var zipdir=require(_0x09b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09b0('0x3'));var moment=require(_0x09b0('0x4'));var BPromise=require(_0x09b0('0x5'));var Mustache=require(_0x09b0('0x6'));var util=require(_0x09b0('0x7'));var path=require(_0x09b0('0x8'));var sox=require(_0x09b0('0x9'));var csv=require('to-csv');var ejs=require(_0x09b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09b0('0xb'));var squel=require(_0x09b0('0xc'));var crypto=require(_0x09b0('0xd'));var jsforce=require(_0x09b0('0xe'));var deskjs=require(_0x09b0('0xf'));var toCsv=require(_0x09b0('0x10'));var querystring=require(_0x09b0('0x11'));var Papa=require('papaparse');var Redis=require(_0x09b0('0x12'));var authService=require(_0x09b0('0x13'));var qs=require(_0x09b0('0x14'));var as=require(_0x09b0('0x15'));var hardwareService=require(_0x09b0('0x16'));var logger=require(_0x09b0('0x17'))(_0x09b0('0x18'));var utils=require(_0x09b0('0x19'));var config=require(_0x09b0('0x1a'));var licenseUtil=require(_0x09b0('0x1b'));var db=require(_0x09b0('0x1c'))['db'];function respondWithStatusCode(_0x48689b,_0x2e2ad5){_0x2e2ad5=_0x2e2ad5||0xcc;return function(_0x3a43d9){if(_0x3a43d9){return _0x48689b[_0x09b0('0x1d')](_0x2e2ad5);}return _0x48689b['status'](_0x2e2ad5)[_0x09b0('0x1e')]();};}function respondWithResult(_0xfe198a,_0x4d8830){_0x4d8830=_0x4d8830||0xc8;return function(_0x255354){if(_0x255354){return _0xfe198a['status'](_0x4d8830)[_0x09b0('0x1f')](_0x255354);}};}function respondWithFilteredResult(_0x8eb78b,_0x2b8cdf){return function(_0x223cc1){if(_0x223cc1){var _0x4c23d0=typeof _0x2b8cdf['offset']==='undefined'&&typeof _0x2b8cdf[_0x09b0('0x20')]===_0x09b0('0x21');var _0x493307=_0x223cc1[_0x09b0('0x22')];var _0x4bc35a=_0x4c23d0?0x0:_0x2b8cdf['offset'];var _0x51bc60=_0x4c23d0?_0x223cc1[_0x09b0('0x22')]:_0x2b8cdf[_0x09b0('0x23')]+_0x2b8cdf[_0x09b0('0x20')];var _0x32e8c7;if(_0x51bc60>=_0x493307){_0x51bc60=_0x493307;_0x32e8c7=0xc8;}else{_0x32e8c7=0xce;}_0x8eb78b[_0x09b0('0x24')](_0x32e8c7);return _0x8eb78b[_0x09b0('0x25')](_0x09b0('0x26'),_0x4bc35a+'-'+_0x51bc60+'/'+_0x493307)[_0x09b0('0x1f')](_0x223cc1);}return null;};}function patchUpdates(_0x4b0c2c){return function(_0x243da2){try{jsonpatch['apply'](_0x243da2,_0x4b0c2c,!![]);}catch(_0x14a922){return BPromise[_0x09b0('0x27')](_0x14a922);}return _0x243da2[_0x09b0('0x28')]();};}function saveUpdates(_0x1fd062,_0x29f169){return function(_0x4f71b3){if(_0x4f71b3){return _0x4f71b3[_0x09b0('0x29')](_0x1fd062)['then'](function(_0x560369){return _0x560369;});}return null;};}function removeEntity(_0x3276d1,_0x56b841){return function(_0x47633b){if(_0x47633b){return _0x47633b[_0x09b0('0x2a')]()['then'](function(){_0x3276d1[_0x09b0('0x24')](0xcc)[_0x09b0('0x1e')]();});}};}function handleEntityNotFound(_0x224681,_0x286998){return function(_0x1ba431){if(!_0x1ba431){_0x224681[_0x09b0('0x1d')](0x194);}return _0x1ba431;};}function handleError(_0x8c6e10,_0x13fd45){_0x13fd45=_0x13fd45||0x1f4;return function(_0x35f7cd){logger[_0x09b0('0x2b')](_0x35f7cd[_0x09b0('0x2c')]);if(_0x35f7cd[_0x09b0('0x2d')]){delete _0x35f7cd['name'];}_0x8c6e10[_0x09b0('0x24')](_0x13fd45)['send'](_0x35f7cd);};}exports[_0x09b0('0x2e')]=function(_0x4ea9fa,_0x16894b){var _0x3aecf6={'raw':!![],'where':{'id':_0x4ea9fa[_0x09b0('0x2f')]['id']}},_0x16a864={};_0x16a864['model']=_[_0x09b0('0x30')](db[_0x09b0('0x31')][_0x09b0('0x32')]);_0x16a864['query']=_[_0x09b0('0x30')](_0x4ea9fa[_0x09b0('0x33')]);_0x16a864[_0x09b0('0x34')]=_[_0x09b0('0x35')](_0x16a864[_0x09b0('0x36')],_0x16a864['query']);_0x3aecf6[_0x09b0('0x37')]=_[_0x09b0('0x35')](_0x16a864[_0x09b0('0x36')],qs[_0x09b0('0x38')](_0x4ea9fa[_0x09b0('0x33')][_0x09b0('0x38')]));_0x3aecf6[_0x09b0('0x37')]=_0x3aecf6[_0x09b0('0x37')][_0x09b0('0x39')]?_0x3aecf6[_0x09b0('0x37')]:_0x16a864[_0x09b0('0x36')];if(_0x4ea9fa[_0x09b0('0x33')]['includeAll']){_0x3aecf6[_0x09b0('0x3a')]=[{'all':!![]}];}_0x3aecf6=_['merge']({},_0x3aecf6,_0x4ea9fa[_0x09b0('0x3b')]);return db['ChatApplication'][_0x09b0('0x3c')](_0x3aecf6)[_0x09b0('0x3d')](handleEntityNotFound(_0x16894b,null))[_0x09b0('0x3d')](respondWithResult(_0x16894b,null))[_0x09b0('0x3e')](handleError(_0x16894b,null));};exports['update']=function(_0x4a0934,_0x3be7ab){if(_0x4a0934[_0x09b0('0x3f')]['id']){delete _0x4a0934[_0x09b0('0x3f')]['id'];}return db[_0x09b0('0x31')]['find']({'where':{'id':_0x4a0934[_0x09b0('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3be7ab,null))['then'](saveUpdates(_0x4a0934[_0x09b0('0x3f')],null))[_0x09b0('0x3d')](respondWithResult(_0x3be7ab,null))[_0x09b0('0x3e')](handleError(_0x3be7ab,null));};exports[_0x09b0('0x2a')]=function(_0x6d5576,_0x2bccc4){return db[_0x09b0('0x31')]['find']({'where':{'id':_0x6d5576[_0x09b0('0x2f')]['id']}})[_0x09b0('0x3d')](handleEntityNotFound(_0x2bccc4,null))[_0x09b0('0x3d')](removeEntity(_0x2bccc4,null))['catch'](handleError(_0x2bccc4,null));};
\ No newline at end of file
+var _0xeea4=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','options','find','then','catch','body','ChatApplication','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xeea4,0x19e));var _0x4eea=function(_0x34bea7,_0x36c7f7){_0x34bea7=_0x34bea7-0x0;var _0x33cf81=_0xeea4[_0x34bea7];return _0x33cf81;};'use strict';var emlformat=require(_0x4eea('0x0'));var rimraf=require(_0x4eea('0x1'));var zipdir=require(_0x4eea('0x2'));var jsonpatch=require(_0x4eea('0x3'));var rp=require(_0x4eea('0x4'));var moment=require(_0x4eea('0x5'));var BPromise=require(_0x4eea('0x6'));var Mustache=require(_0x4eea('0x7'));var util=require(_0x4eea('0x8'));var path=require('path');var sox=require(_0x4eea('0x9'));var csv=require('to-csv');var ejs=require(_0x4eea('0xa'));var fs=require('fs');var fs_extra=require(_0x4eea('0xb'));var _=require(_0x4eea('0xc'));var squel=require('squel');var crypto=require(_0x4eea('0xd'));var jsforce=require(_0x4eea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4eea('0xf'));var querystring=require(_0x4eea('0x10'));var Papa=require(_0x4eea('0x11'));var Redis=require(_0x4eea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4eea('0x13'));var as=require(_0x4eea('0x14'));var hardwareService=require(_0x4eea('0x15'));var logger=require(_0x4eea('0x16'))(_0x4eea('0x17'));var utils=require(_0x4eea('0x18'));var config=require(_0x4eea('0x19'));var licenseUtil=require(_0x4eea('0x1a'));var db=require(_0x4eea('0x1b'))['db'];function respondWithStatusCode(_0x130507,_0x47b971){_0x47b971=_0x47b971||0xcc;return function(_0x54fa8c){if(_0x54fa8c){return _0x130507[_0x4eea('0x1c')](_0x47b971);}return _0x130507[_0x4eea('0x1d')](_0x47b971)[_0x4eea('0x1e')]();};}function respondWithResult(_0x238405,_0x3327e0){_0x3327e0=_0x3327e0||0xc8;return function(_0x328275){if(_0x328275){return _0x238405[_0x4eea('0x1d')](_0x3327e0)[_0x4eea('0x1f')](_0x328275);}};}function respondWithFilteredResult(_0x5828e0,_0x1654c0){return function(_0x34ce09){if(_0x34ce09){var _0x150d60=typeof _0x1654c0[_0x4eea('0x20')]==='undefined'&&typeof _0x1654c0[_0x4eea('0x21')]===_0x4eea('0x22');var _0x3fbe8b=_0x34ce09[_0x4eea('0x23')];var _0x27a227=_0x150d60?0x0:_0x1654c0['offset'];var _0x1571f3=_0x150d60?_0x34ce09[_0x4eea('0x23')]:_0x1654c0['offset']+_0x1654c0[_0x4eea('0x21')];var _0x325185;if(_0x1571f3>=_0x3fbe8b){_0x1571f3=_0x3fbe8b;_0x325185=0xc8;}else{_0x325185=0xce;}_0x5828e0[_0x4eea('0x1d')](_0x325185);return _0x5828e0[_0x4eea('0x24')](_0x4eea('0x25'),_0x27a227+'-'+_0x1571f3+'/'+_0x3fbe8b)[_0x4eea('0x1f')](_0x34ce09);}return null;};}function patchUpdates(_0x56fefc){return function(_0xf054a7){try{jsonpatch[_0x4eea('0x26')](_0xf054a7,_0x56fefc,!![]);}catch(_0x24f371){return BPromise[_0x4eea('0x27')](_0x24f371);}return _0xf054a7[_0x4eea('0x28')]();};}function saveUpdates(_0x496ab6,_0x4898e8){return function(_0x3b7513){if(_0x3b7513){return _0x3b7513['update'](_0x496ab6)['then'](function(_0x5a2722){return _0x5a2722;});}return null;};}function removeEntity(_0x37f024,_0x3be3f3){return function(_0x505e50){if(_0x505e50){return _0x505e50[_0x4eea('0x29')]()['then'](function(){_0x37f024[_0x4eea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x111e65,_0x5a1ec7){return function(_0x1e8f29){if(!_0x1e8f29){_0x111e65[_0x4eea('0x1c')](0x194);}return _0x1e8f29;};}function handleError(_0x22f706,_0x430a46){_0x430a46=_0x430a46||0x1f4;return function(_0xd09e64){logger[_0x4eea('0x2a')](_0xd09e64[_0x4eea('0x2b')]);if(_0xd09e64[_0x4eea('0x2c')]){delete _0xd09e64[_0x4eea('0x2c')];}_0x22f706[_0x4eea('0x1d')](_0x430a46)[_0x4eea('0x2d')](_0xd09e64);};}exports['show']=function(_0x58c0df,_0x3e602c){var _0x3eeb41={'raw':!![],'where':{'id':_0x58c0df['params']['id']}},_0x591b2f={};_0x591b2f['model']=_[_0x4eea('0x2e')](db['ChatApplication'][_0x4eea('0x2f')]);_0x591b2f[_0x4eea('0x30')]=_[_0x4eea('0x2e')](_0x58c0df['query']);_0x591b2f[_0x4eea('0x31')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],_0x591b2f['query']);_0x3eeb41[_0x4eea('0x34')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],qs['fields'](_0x58c0df['query'][_0x4eea('0x35')]));_0x3eeb41[_0x4eea('0x34')]=_0x3eeb41['attributes'][_0x4eea('0x36')]?_0x3eeb41[_0x4eea('0x34')]:_0x591b2f[_0x4eea('0x33')];if(_0x58c0df[_0x4eea('0x30')]['includeAll']){_0x3eeb41[_0x4eea('0x37')]=[{'all':!![]}];}_0x3eeb41=_['merge']({},_0x3eeb41,_0x58c0df[_0x4eea('0x38')]);return db['ChatApplication'][_0x4eea('0x39')](_0x3eeb41)[_0x4eea('0x3a')](handleEntityNotFound(_0x3e602c,null))['then'](respondWithResult(_0x3e602c,null))[_0x4eea('0x3b')](handleError(_0x3e602c,null));};exports['update']=function(_0x1df208,_0x2e7b37){if(_0x1df208['body']['id']){delete _0x1df208[_0x4eea('0x3c')]['id'];}return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x1df208['params']['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x2e7b37,null))['then'](saveUpdates(_0x1df208['body'],null))[_0x4eea('0x3a')](respondWithResult(_0x2e7b37,null))[_0x4eea('0x3b')](handleError(_0x2e7b37,null));};exports[_0x4eea('0x29')]=function(_0x4c8dd2,_0x57e9b6){return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x4c8dd2[_0x4eea('0x3e')]['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x57e9b6,null))[_0x4eea('0x3a')](removeEntity(_0x57e9b6,null))['catch'](handleError(_0x57e9b6,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9b59102..5105a8d 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 _0xb9f7=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash','../../config/logger'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xb9f7,0x1df));var _0x7b9f=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xb9f7[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x7b9f('0x0'));var util=require('util');var logger=require(_0x7b9f('0x1'))(_0x7b9f('0x2'));var moment=require('moment');var BPromise=require(_0x7b9f('0x3'));var rp=require(_0x7b9f('0x4'));var fs=require('fs');var path=require(_0x7b9f('0x5'));var rimraf=require(_0x7b9f('0x6'));var config=require(_0x7b9f('0x7'));var attributes=require(_0x7b9f('0x8'));module[_0x7b9f('0x9')]=function(_0x52b46d,_0x215cb3){return _0x52b46d[_0x7b9f('0xa')](_0x7b9f('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b9f('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdb90=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x2ca94e,_0xd97864){var _0x1c6718=function(_0x44c561){while(--_0x44c561){_0x2ca94e['push'](_0x2ca94e['shift']());}};_0x1c6718(++_0xd97864);}(_0xdb90,0xcb));var _0x0db9=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0xdb90[_0xc889e1];return _0x17ab9e;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var logger=require('../../config/logger')(_0x0db9('0x2'));var moment=require(_0x0db9('0x3'));var BPromise=require('bluebird');var rp=require(_0x0db9('0x4'));var fs=require('fs');var path=require(_0x0db9('0x5'));var rimraf=require(_0x0db9('0x6'));var config=require(_0x0db9('0x7'));var attributes=require(_0x0db9('0x8'));module[_0x0db9('0x9')]=function(_0x227647,_0x513a01){return _0x227647[_0x0db9('0xa')](_0x0db9('0xb'),attributes,{'tableName':_0x0db9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0db9('0xd'),'collate':_0x0db9('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5a395d4..da4eda1 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 _0x9bb2=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2b69ac,_0x4f94f4){var _0x421f95=function(_0xfdf883){while(--_0xfdf883){_0x2b69ac['push'](_0x2b69ac['shift']());}};_0x421f95(++_0x4f94f4);}(_0x9bb2,0x12b));var _0x29bb=function(_0x252875,_0x3d4d96){_0x252875=_0x252875-0x0;var _0x426a5d=_0x9bb2[_0x252875];return _0x426a5d;};'use strict';var _=require(_0x29bb('0x0'));var util=require(_0x29bb('0x1'));var moment=require('moment');var BPromise=require(_0x29bb('0x2'));var rs=require(_0x29bb('0x3'));var fs=require('fs');var Redis=require(_0x29bb('0x4'));var db=require(_0x29bb('0x5'))['db'];var utils=require(_0x29bb('0x6'));var logger=require('../../config/logger')(_0x29bb('0x7'));var config=require(_0x29bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x29bb('0x9')][_0x29bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c68fd,_0x330dcf,_0x896344){return new BPromise(function(_0x1e98e2,_0x40ef0d){return client[_0x29bb('0xb')](_0x1c68fd,_0x896344)[_0x29bb('0xc')](function(_0xb06c0d){logger[_0x29bb('0xd')](_0x29bb('0xe'),_0x330dcf,'request\x20sent');logger[_0x29bb('0xf')](_0x29bb('0x10'),_0x330dcf,_0x29bb('0x11'),JSON[_0x29bb('0x12')](_0xb06c0d));if(_0xb06c0d['error']){if(_0xb06c0d[_0x29bb('0x13')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x330dcf,_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);return _0x40ef0d(_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);}logger[_0x29bb('0x13')](_0x29bb('0xe'),_0x330dcf,_0xb06c0d[_0x29bb('0x13')]['message']);return _0x1e98e2(_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);}else{logger['info'](_0x29bb('0xe'),_0x330dcf,'request\x20sent');_0x1e98e2(_0xb06c0d['result'][_0x29bb('0x14')]);}})[_0x29bb('0x15')](function(_0x74ecf2){logger[_0x29bb('0x13')](_0x29bb('0xe'),_0x330dcf,_0x74ecf2);_0x40ef0d(_0x74ecf2);});});}
\ No newline at end of file
+var _0xd6f8=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x11aee6,_0x18af38){var _0x5094cd=function(_0x4d70fe){while(--_0x4d70fe){_0x11aee6['push'](_0x11aee6['shift']());}};_0x5094cd(++_0x18af38);}(_0xd6f8,0x1e4));var _0x8d6f=function(_0x1966f3,_0x210ea3){_0x1966f3=_0x1966f3-0x0;var _0x17575f=_0xd6f8[_0x1966f3];return _0x17575f;};'use strict';var _=require(_0x8d6f('0x0'));var util=require(_0x8d6f('0x1'));var moment=require(_0x8d6f('0x2'));var BPromise=require(_0x8d6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d6f('0x4'));var db=require(_0x8d6f('0x5'))['db'];var utils=require(_0x8d6f('0x6'));var logger=require(_0x8d6f('0x7'))(_0x8d6f('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d6f('0x9'));var client=jayson[_0x8d6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x738815,_0x459349,_0x383b05){return new BPromise(function(_0x6608f,_0xa86649){return client[_0x8d6f('0xb')](_0x738815,_0x383b05)[_0x8d6f('0xc')](function(_0x238a42){logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));logger[_0x8d6f('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x459349,_0x8d6f('0xf'),JSON['stringify'](_0x238a42));if(_0x238a42[_0x8d6f('0x11')]){if(_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x12')]===0x1f4){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x13')]);return _0xa86649(_0x238a42['error'][_0x8d6f('0x13')]);}logger['error'](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')]['message']);return _0x6608f(_0x238a42[_0x8d6f('0x11')]['message']);}else{logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));_0x6608f(_0x238a42[_0x8d6f('0x14')]['message']);}})['catch'](function(_0x507b82){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x507b82);_0xa86649(_0x507b82);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index cccb96f..9120d0a 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 _0xfb47=['show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xfb47,0x135));var _0x7fb4=function(_0x5402e3,_0x2643c7){_0x5402e3=_0x5402e3-0x0;var _0x2fe81f=_0xfb47[_0x5402e3];return _0x2fe81f;};'use strict';var multer=require(_0x7fb4('0x0'));var util=require(_0x7fb4('0x1'));var path=require(_0x7fb4('0x2'));var timeout=require(_0x7fb4('0x3'));var express=require(_0x7fb4('0x4'));var router=express[_0x7fb4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7fb4('0x6'));var interaction=require(_0x7fb4('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x7fb4('0x8')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xb')]);router[_0x7fb4('0xc')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xd')]);router[_0x7fb4('0xe')]('/:id',auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x74be=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74be,0x67));var _0xe74b=function(_0x548b6,_0x5e84a4){_0x548b6=_0x548b6-0x0;var _0x169764=_0x74be[_0x548b6];return _0x169764;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require(_0xe74b('0x1'));var timeout=require('connect-timeout');var express=require(_0xe74b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x3'));var interaction=require(_0xe74b('0x4'));var config=require(_0xe74b('0x5'));var controller=require(_0xe74b('0x6'));router[_0xe74b('0x7')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xa')]);router[_0xe74b('0xb')](_0xe74b('0x8'),auth['isAuthenticated'](),controller[_0xe74b('0xc')]);router[_0xe74b('0xd')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xe')]);module[_0xe74b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d07f895..0ab73e3 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 _0x9536=['exports','STRING','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9536,0x179));var _0x6953=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x9536[_0x212bf5];return _0xfcad21;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6953('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xba6e=['sequelize','exports','STRING'];(function(_0x2433e3,_0x28ac1e){var _0x3e5feb=function(_0x47f203){while(--_0x47f203){_0x2433e3['push'](_0x2433e3['shift']());}};_0x3e5feb(++_0x28ac1e);}(_0xba6e,0x168));var _0xeba6=function(_0x3b1252,_0x43691c){_0x3b1252=_0x3b1252-0x0;var _0x1af329=_0xba6e[_0x3b1252];return _0x1af329;};'use strict';var Sequelize=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xeba6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index f51b163..cf53e00 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 _0x6b38=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','keys','filters','model','query','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','fields','include','find','create','body','update','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir'];(function(_0x3a5c8a,_0x1b6464){var _0x7b7582=function(_0x89d6){while(--_0x89d6){_0x3a5c8a['push'](_0x3a5c8a['shift']());}};_0x7b7582(++_0x1b6464);}(_0x6b38,0xc6));var _0x86b3=function(_0x1941ee,_0x322665){_0x1941ee=_0x1941ee-0x0;var _0x90e30b=_0x6b38[_0x1941ee];return _0x90e30b;};'use strict';var emlformat=require(_0x86b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86b3('0x1'));var jsonpatch=require(_0x86b3('0x2'));var rp=require(_0x86b3('0x3'));var moment=require(_0x86b3('0x4'));var BPromise=require(_0x86b3('0x5'));var Mustache=require(_0x86b3('0x6'));var util=require(_0x86b3('0x7'));var path=require(_0x86b3('0x8'));var sox=require(_0x86b3('0x9'));var csv=require(_0x86b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86b3('0xb'));var squel=require(_0x86b3('0xc'));var crypto=require('crypto');var jsforce=require(_0x86b3('0xd'));var deskjs=require(_0x86b3('0xe'));var toCsv=require(_0x86b3('0xa'));var querystring=require(_0x86b3('0xf'));var Papa=require(_0x86b3('0x10'));var Redis=require(_0x86b3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x86b3('0x12'));var as=require(_0x86b3('0x13'));var hardwareService=require(_0x86b3('0x14'));var logger=require(_0x86b3('0x15'))(_0x86b3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x86b3('0x17'));var db=require('../../mysqldb')['db'];config[_0x86b3('0x18')]=_[_0x86b3('0x19')](config[_0x86b3('0x18')],{'host':_0x86b3('0x1a'),'port':0x18eb});var socket=require(_0x86b3('0x1b'))(new Redis(config[_0x86b3('0x18')]));require(_0x86b3('0x1c'))[_0x86b3('0x1d')](socket);function respondWithStatusCode(_0x5d88a4,_0xc8cf43){_0xc8cf43=_0xc8cf43||0xcc;return function(_0xc14a1f){if(_0xc14a1f){return _0x5d88a4[_0x86b3('0x1e')](_0xc8cf43);}return _0x5d88a4[_0x86b3('0x1f')](_0xc8cf43)[_0x86b3('0x20')]();};}function respondWithResult(_0x5eb517,_0x283aa7){_0x283aa7=_0x283aa7||0xc8;return function(_0x3b28e0){if(_0x3b28e0){return _0x5eb517[_0x86b3('0x1f')](_0x283aa7)[_0x86b3('0x21')](_0x3b28e0);}};}function respondWithFilteredResult(_0x1a080e,_0x1d298d){return function(_0x1d9479){if(_0x1d9479){var _0x126dbe=typeof _0x1d298d[_0x86b3('0x22')]===_0x86b3('0x23')&&typeof _0x1d298d['limit']===_0x86b3('0x23');var _0x51b322=_0x1d9479['count'];var _0x323245=_0x126dbe?0x0:_0x1d298d[_0x86b3('0x22')];var _0x3cadd0=_0x126dbe?_0x1d9479[_0x86b3('0x24')]:_0x1d298d[_0x86b3('0x22')]+_0x1d298d[_0x86b3('0x25')];var _0x12a0c3;if(_0x3cadd0>=_0x51b322){_0x3cadd0=_0x51b322;_0x12a0c3=0xc8;}else{_0x12a0c3=0xce;}_0x1a080e[_0x86b3('0x1f')](_0x12a0c3);return _0x1a080e['set']('Content-Range',_0x323245+'-'+_0x3cadd0+'/'+_0x51b322)[_0x86b3('0x21')](_0x1d9479);}return null;};}function patchUpdates(_0x249d7d){return function(_0x53d570){try{jsonpatch[_0x86b3('0x26')](_0x53d570,_0x249d7d,!![]);}catch(_0x24e0a9){return BPromise[_0x86b3('0x27')](_0x24e0a9);}return _0x53d570[_0x86b3('0x28')]();};}function saveUpdates(_0x4c0f80,_0x5ae87e){return function(_0xce5950){if(_0xce5950){return _0xce5950['update'](_0x4c0f80)[_0x86b3('0x29')](function(_0x140ff1){return _0x140ff1;});}return null;};}function removeEntity(_0x5b934c,_0x4ea9f4){return function(_0x2e579c){if(_0x2e579c){return _0x2e579c['destroy']()['then'](function(){_0x5b934c['status'](0xcc)[_0x86b3('0x20')]();});}};}function handleEntityNotFound(_0x3b3372,_0x3b1a15){return function(_0x172b1e){if(!_0x172b1e){_0x3b3372[_0x86b3('0x1e')](0x194);}return _0x172b1e;};}function handleError(_0x2054e8,_0x5d17ba){_0x5d17ba=_0x5d17ba||0x1f4;return function(_0x3d289){logger[_0x86b3('0x2a')](_0x3d289[_0x86b3('0x2b')]);if(_0x3d289[_0x86b3('0x2c')]){delete _0x3d289[_0x86b3('0x2c')];}_0x2054e8[_0x86b3('0x1f')](_0x5d17ba)[_0x86b3('0x2d')](_0x3d289);};}exports[_0x86b3('0x2e')]=function(_0x5adde2,_0x42a1ea){var _0x158817={},_0x1e1274={},_0x1bb7bf={'count':0x0,'rows':[]};var _0x5ed3d9=_[_0x86b3('0x2f')](db[_0x86b3('0x30')][_0x86b3('0x31')],function(_0x46ffcb){return{'name':_0x46ffcb[_0x86b3('0x32')],'type':_0x46ffcb[_0x86b3('0x33')]['key']};});_0x1e1274['model']=_[_0x86b3('0x2f')](_0x5ed3d9,_0x86b3('0x2c'));_0x1e1274['query']=_[_0x86b3('0x34')](_0x5adde2['query']);_0x1e1274[_0x86b3('0x35')]=_['intersection'](_0x1e1274[_0x86b3('0x36')],_0x1e1274[_0x86b3('0x37')]);_0x158817[_0x86b3('0x38')]=_['intersection'](_0x1e1274[_0x86b3('0x36')],qs['fields'](_0x5adde2['query']['fields']));_0x158817[_0x86b3('0x38')]=_0x158817['attributes'][_0x86b3('0x39')]?_0x158817[_0x86b3('0x38')]:_0x1e1274[_0x86b3('0x36')];if(!_0x5adde2[_0x86b3('0x37')][_0x86b3('0x3a')]('nolimit')){_0x158817['limit']=qs[_0x86b3('0x25')](_0x5adde2['query']['limit']);_0x158817[_0x86b3('0x22')]=qs[_0x86b3('0x22')](_0x5adde2['query'][_0x86b3('0x22')]);}_0x158817[_0x86b3('0x3b')]=qs['sort'](_0x5adde2[_0x86b3('0x37')]['sort']);_0x158817[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x5adde2[_0x86b3('0x37')],_0x1e1274[_0x86b3('0x35')]),_0x5ed3d9);if(_0x5adde2[_0x86b3('0x37')][_0x86b3('0x3e')]){_0x158817[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x158817[_0x86b3('0x3c')],{'$or':_[_0x86b3('0x2f')](_0x5ed3d9,function(_0x2efcb3){if(_0x2efcb3[_0x86b3('0x33')]!==_0x86b3('0x40')){var _0x3ea35f={};_0x3ea35f[_0x2efcb3[_0x86b3('0x2c')]]={'$like':'%'+_0x5adde2[_0x86b3('0x37')]['filter']+'%'};return _0x3ea35f;}})});}_0x158817=_[_0x86b3('0x3f')]({},_0x158817,_0x5adde2[_0x86b3('0x41')]);var _0x482346={'where':_0x158817[_0x86b3('0x3c')]};return db[_0x86b3('0x30')][_0x86b3('0x24')](_0x482346)[_0x86b3('0x29')](function(_0x380336){_0x1bb7bf['count']=_0x380336;if(_0x5adde2[_0x86b3('0x37')][_0x86b3('0x42')]){_0x158817['include']=[{'all':!![]}];}return db[_0x86b3('0x30')][_0x86b3('0x43')](_0x158817);})[_0x86b3('0x29')](function(_0x4ae299){_0x1bb7bf[_0x86b3('0x44')]=_0x4ae299;return _0x1bb7bf;})[_0x86b3('0x29')](respondWithFilteredResult(_0x42a1ea,_0x158817))[_0x86b3('0x45')](handleError(_0x42a1ea,null));};exports[_0x86b3('0x46')]=function(_0x4d823d,_0x119ade){var _0xc8f7c9={'raw':!![],'where':{'id':_0x4d823d[_0x86b3('0x47')]['id']}},_0x4e2b24={};_0x4e2b24['model']=_[_0x86b3('0x34')](db[_0x86b3('0x30')][_0x86b3('0x31')]);_0x4e2b24[_0x86b3('0x37')]=_['keys'](_0x4d823d[_0x86b3('0x37')]);_0x4e2b24[_0x86b3('0x35')]=_[_0x86b3('0x48')](_0x4e2b24[_0x86b3('0x36')],_0x4e2b24['query']);_0xc8f7c9['attributes']=_[_0x86b3('0x48')](_0x4e2b24['model'],qs[_0x86b3('0x49')](_0x4d823d['query'][_0x86b3('0x49')]));_0xc8f7c9[_0x86b3('0x38')]=_0xc8f7c9[_0x86b3('0x38')]['length']?_0xc8f7c9['attributes']:_0x4e2b24['model'];if(_0x4d823d[_0x86b3('0x37')][_0x86b3('0x42')]){_0xc8f7c9[_0x86b3('0x4a')]=[{'all':!![]}];}_0xc8f7c9=_[_0x86b3('0x3f')]({},_0xc8f7c9,_0x4d823d[_0x86b3('0x41')]);return db[_0x86b3('0x30')][_0x86b3('0x4b')](_0xc8f7c9)[_0x86b3('0x29')](handleEntityNotFound(_0x119ade,null))['then'](respondWithResult(_0x119ade,null))['catch'](handleError(_0x119ade,null));};exports['create']=function(_0x3081d6,_0x568e31){return db[_0x86b3('0x30')][_0x86b3('0x4c')](_0x3081d6[_0x86b3('0x4d')],{})[_0x86b3('0x29')](respondWithResult(_0x568e31,0xc9))[_0x86b3('0x45')](handleError(_0x568e31,null));};exports[_0x86b3('0x4e')]=function(_0x46ff3c,_0x1fdedc){if(_0x46ff3c[_0x86b3('0x4d')]['id']){delete _0x46ff3c[_0x86b3('0x4d')]['id'];}return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x46ff3c[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x1fdedc,null))[_0x86b3('0x29')](saveUpdates(_0x46ff3c[_0x86b3('0x4d')],null))['then'](respondWithResult(_0x1fdedc,null))[_0x86b3('0x45')](handleError(_0x1fdedc,null));};exports[_0x86b3('0x4f')]=function(_0x1fa6ae,_0x3dddc5){return db['ChatGroup'][_0x86b3('0x4b')]({'where':{'id':_0x1fa6ae[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x3dddc5,null))['then'](removeEntity(_0x3dddc5,null))[_0x86b3('0x45')](handleError(_0x3dddc5,null));};exports[_0x86b3('0x50')]=function(_0x18956e,_0x1b4c53){return db[_0x86b3('0x30')][_0x86b3('0x50')]()[_0x86b3('0x29')](respondWithResult(_0x1b4c53,null))[_0x86b3('0x45')](handleError(_0x1b4c53,null));};exports[_0x86b3('0x51')]=function(_0xd34a27,_0x1dfd35,_0x47a5fc){return db[_0x86b3('0x52')][_0x86b3('0x24')]({'where':{'ChatGroupId':_0xd34a27[_0x86b3('0x47')]['id'],'ToId':_0xd34a27[_0x86b3('0x53')]['id'],'read':![]}})[_0x86b3('0x29')](function(_0x50c88a){return{'id':_[_0x86b3('0x54')](_0xd34a27[_0x86b3('0x47')]['id']),'count':_0x50c88a};})['then'](respondWithResult(_0x1dfd35,null))[_0x86b3('0x45')](handleError(_0x1dfd35,null));};exports['addMembers']=function(_0x277e32,_0x4ad543,_0x577f3c){return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x277e32[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x4ad543,null))[_0x86b3('0x29')](function(_0x42e5ee){if(_0x42e5ee){return _0x42e5ee[_0x86b3('0x55')](_0x277e32[_0x86b3('0x4d')][_0x86b3('0x56')],_[_0x86b3('0x57')](_0x277e32[_0x86b3('0x4d')],[_0x86b3('0x56'),'id'])||{});}})[_0x86b3('0x29')](respondWithResult(_0x4ad543,null))[_0x86b3('0x45')](handleError(_0x4ad543,null));};exports[_0x86b3('0x58')]=function(_0x138147,_0x274f00,_0x1d1b8b){var _0x1def00={};var _0xa466b={};var _0x20b430;var _0x2a6318;return db['ChatGroup'][_0x86b3('0x59')]({'where':{'id':_0x138147[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x274f00,null))[_0x86b3('0x29')](function(_0x4319b8){if(_0x4319b8){_0x20b430=_0x4319b8;_0xa466b[_0x86b3('0x36')]=_['keys'](db[_0x86b3('0x5a')]['rawAttributes']);_0xa466b[_0x86b3('0x37')]=_[_0x86b3('0x34')](_0x138147['query']);_0xa466b['filters']=_['intersection'](_0xa466b[_0x86b3('0x36')],_0xa466b['query']);_0x1def00['attributes']=_[_0x86b3('0x48')](_0xa466b[_0x86b3('0x36')],qs[_0x86b3('0x49')](_0x138147['query']['fields']));_0x1def00[_0x86b3('0x38')]=_0x1def00[_0x86b3('0x38')][_0x86b3('0x39')]?_0x1def00[_0x86b3('0x38')]:_0xa466b[_0x86b3('0x36')];_0x1def00[_0x86b3('0x3b')]=qs[_0x86b3('0x5b')](_0x138147['query'][_0x86b3('0x5b')]);_0x1def00[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x138147['query'],_0xa466b[_0x86b3('0x35')]));if(_0x138147[_0x86b3('0x37')]['filter']){_0x1def00[_0x86b3('0x3c')]=_['merge'](_0x1def00[_0x86b3('0x3c')],{'$or':_['map'](_0x1def00[_0x86b3('0x38')],function(_0x5cd582){var _0xb79fd2={};_0xb79fd2[_0x5cd582]={'$like':'%'+_0x138147[_0x86b3('0x37')][_0x86b3('0x3e')]+'%'};return _0xb79fd2;})});}_0x1def00=_['merge']({},_0x1def00,_0x138147[_0x86b3('0x41')]);return _0x20b430[_0x86b3('0x58')](_0x1def00);}})[_0x86b3('0x29')](function(_0x28fe97){if(_0x28fe97){_0x2a6318=_0x28fe97[_0x86b3('0x39')];if(!_0x138147['query'][_0x86b3('0x3a')](_0x86b3('0x5c'))){_0x1def00[_0x86b3('0x25')]=qs['limit'](_0x138147[_0x86b3('0x37')][_0x86b3('0x25')]);_0x1def00['offset']=qs['offset'](_0x138147[_0x86b3('0x37')][_0x86b3('0x22')]);}return _0x20b430[_0x86b3('0x58')](_0x1def00);}})['then'](function(_0x432868){if(_0x432868){return _0x432868?{'count':_0x2a6318,'rows':_0x432868}:null;}})[_0x86b3('0x29')](respondWithResult(_0x274f00,null))['catch'](handleError(_0x274f00,null));};exports['removeMembers']=function(_0x233e5f,_0xc68493,_0x2738f0){return db['ChatGroup']['find']({'where':{'id':_0x233e5f[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0xc68493,null))[_0x86b3('0x29')](function(_0x4c6e25){if(_0x4c6e25){return _0x4c6e25[_0x86b3('0x5d')](_0x233e5f['query'][_0x86b3('0x56')]);}})[_0x86b3('0x29')](respondWithStatusCode(_0xc68493,null))[_0x86b3('0x45')](handleError(_0xc68493,null));};exports[_0x86b3('0x5e')]=function(_0x1f4091,_0x15d762,_0x5d7730){if(_0x1f4091['body']['id']){delete _0x1f4091[_0x86b3('0x4d')]['id'];}return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x1f4091[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x15d762,null))[_0x86b3('0x29')](function(_0x412c17){if(_0x412c17){_0x1f4091['body'][_0x86b3('0x5f')]=_0x412c17['id'];return db['ChatInternalMessage']['create'](_0x1f4091['body']);}})[_0x86b3('0x29')](respondWithResult(_0x15d762,null))[_0x86b3('0x45')](handleError(_0x15d762,null));};exports[_0x86b3('0x60')]=function(_0x62c383,_0x42da31,_0x13ed18){var _0x5745a0={};var _0x7a7daa={};var _0x31c1b5;var _0x5b4b85;return db['ChatGroup'][_0x86b3('0x59')]({'where':{'id':_0x62c383['params']['id']}})['then'](handleEntityNotFound(_0x42da31,null))[_0x86b3('0x29')](function(_0x8c25d6){if(_0x8c25d6){_0x31c1b5=_0x8c25d6;_0x7a7daa[_0x86b3('0x36')]=_[_0x86b3('0x34')](db[_0x86b3('0x52')][_0x86b3('0x31')]);_0x7a7daa[_0x86b3('0x37')]=_[_0x86b3('0x34')](_0x62c383[_0x86b3('0x37')]);_0x7a7daa[_0x86b3('0x35')]=_[_0x86b3('0x48')](_0x7a7daa[_0x86b3('0x36')],_0x7a7daa[_0x86b3('0x37')]);_0x5745a0[_0x86b3('0x38')]=_[_0x86b3('0x48')](_0x7a7daa[_0x86b3('0x36')],qs[_0x86b3('0x49')](_0x62c383[_0x86b3('0x37')][_0x86b3('0x49')]));_0x5745a0[_0x86b3('0x38')]=_0x5745a0[_0x86b3('0x38')][_0x86b3('0x39')]?_0x5745a0[_0x86b3('0x38')]:_0x7a7daa[_0x86b3('0x36')];_0x5745a0['order']=qs[_0x86b3('0x5b')](_0x62c383[_0x86b3('0x37')][_0x86b3('0x5b')]);_0x5745a0[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x62c383[_0x86b3('0x37')],_0x7a7daa[_0x86b3('0x35')]));if(_0x62c383[_0x86b3('0x37')][_0x86b3('0x3e')]){_0x5745a0[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x5745a0[_0x86b3('0x3c')],{'$or':_['map'](_0x5745a0[_0x86b3('0x38')],function(_0x545083){var _0x26baf8={};_0x26baf8[_0x545083]={'$like':'%'+_0x62c383[_0x86b3('0x37')][_0x86b3('0x3e')]+'%'};return _0x26baf8;})});}if(_0x62c383[_0x86b3('0x37')]['$gte']){var _0x866703=_0x62c383[_0x86b3('0x37')][_0x86b3('0x61')]['split'](',');var _0x4098e4={};_0x4098e4[_0x866703[0x0]]={'$gte':moment(_0x866703[0x1])[_0x86b3('0x62')](_0x86b3('0x63'))};_0x5745a0[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x5745a0['where'],_0x4098e4);}_0x5745a0=_[_0x86b3('0x3f')]({},_0x5745a0,_0x62c383[_0x86b3('0x41')]);return _0x31c1b5[_0x86b3('0x60')](_0x5745a0);}})[_0x86b3('0x29')](function(_0x45e58c){if(_0x45e58c){_0x5b4b85=_0x45e58c[_0x86b3('0x39')];if(!_0x62c383[_0x86b3('0x37')][_0x86b3('0x3a')](_0x86b3('0x5c'))){_0x5745a0[_0x86b3('0x25')]=qs[_0x86b3('0x25')](_0x62c383[_0x86b3('0x37')]['limit']);_0x5745a0['offset']=qs['offset'](_0x62c383[_0x86b3('0x37')][_0x86b3('0x22')]);}return _0x31c1b5[_0x86b3('0x60')](_0x5745a0);}})[_0x86b3('0x29')](function(_0x57bfdc){if(_0x57bfdc){return _0x57bfdc?{'count':_0x5b4b85,'rows':_0x57bfdc}:null;}})[_0x86b3('0x29')](respondWithResult(_0x42da31,null))[_0x86b3('0x45')](handleError(_0x42da31,null));};
\ No newline at end of file
+var _0x46b9=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','order','removeMembers','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x435eac,_0x459918){var _0x436f53=function(_0x450946){while(--_0x450946){_0x435eac['push'](_0x435eac['shift']());}};_0x436f53(++_0x459918);}(_0x46b9,0x90));var _0x946b=function(_0x5c4273,_0x46315e){_0x5c4273=_0x5c4273-0x0;var _0x4a0173=_0x46b9[_0x5c4273];return _0x4a0173;};'use strict';var emlformat=require(_0x946b('0x0'));var rimraf=require(_0x946b('0x1'));var zipdir=require(_0x946b('0x2'));var jsonpatch=require(_0x946b('0x3'));var rp=require(_0x946b('0x4'));var moment=require(_0x946b('0x5'));var BPromise=require(_0x946b('0x6'));var Mustache=require(_0x946b('0x7'));var util=require(_0x946b('0x8'));var path=require('path');var sox=require(_0x946b('0x9'));var csv=require(_0x946b('0xa'));var ejs=require(_0x946b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x946b('0xc'));var squel=require('squel');var crypto=require(_0x946b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x946b('0xe'));var toCsv=require(_0x946b('0xa'));var querystring=require(_0x946b('0xf'));var Papa=require('papaparse');var Redis=require(_0x946b('0x10'));var authService=require(_0x946b('0x11'));var qs=require(_0x946b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x946b('0x13'));var logger=require(_0x946b('0x14'))('api');var utils=require(_0x946b('0x15'));var config=require(_0x946b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x946b('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x946b('0x18'),'port':0x18eb});var socket=require(_0x946b('0x19'))(new Redis(config['redis']));require(_0x946b('0x1a'))[_0x946b('0x1b')](socket);function respondWithStatusCode(_0x34e3dd,_0x35424d){_0x35424d=_0x35424d||0xcc;return function(_0x101e8e){if(_0x101e8e){return _0x34e3dd[_0x946b('0x1c')](_0x35424d);}return _0x34e3dd[_0x946b('0x1d')](_0x35424d)[_0x946b('0x1e')]();};}function respondWithResult(_0x68854d,_0x27e07d){_0x27e07d=_0x27e07d||0xc8;return function(_0x16a27e){if(_0x16a27e){return _0x68854d['status'](_0x27e07d)[_0x946b('0x1f')](_0x16a27e);}};}function respondWithFilteredResult(_0x44e54d,_0x59d005){return function(_0x5e8742){if(_0x5e8742){var _0x248af4=typeof _0x59d005[_0x946b('0x20')]===_0x946b('0x21')&&typeof _0x59d005['limit']===_0x946b('0x21');var _0x38f4fc=_0x5e8742[_0x946b('0x22')];var _0x2dc652=_0x248af4?0x0:_0x59d005[_0x946b('0x20')];var _0x1965ad=_0x248af4?_0x5e8742[_0x946b('0x22')]:_0x59d005[_0x946b('0x20')]+_0x59d005[_0x946b('0x23')];var _0x16134b;if(_0x1965ad>=_0x38f4fc){_0x1965ad=_0x38f4fc;_0x16134b=0xc8;}else{_0x16134b=0xce;}_0x44e54d[_0x946b('0x1d')](_0x16134b);return _0x44e54d[_0x946b('0x24')](_0x946b('0x25'),_0x2dc652+'-'+_0x1965ad+'/'+_0x38f4fc)[_0x946b('0x1f')](_0x5e8742);}return null;};}function patchUpdates(_0x240f88){return function(_0x40d956){try{jsonpatch[_0x946b('0x26')](_0x40d956,_0x240f88,!![]);}catch(_0xe80bd9){return BPromise[_0x946b('0x27')](_0xe80bd9);}return _0x40d956[_0x946b('0x28')]();};}function saveUpdates(_0x401c92,_0x9e3d69){return function(_0x22db9d){if(_0x22db9d){return _0x22db9d[_0x946b('0x29')](_0x401c92)['then'](function(_0x3ed6aa){return _0x3ed6aa;});}return null;};}function removeEntity(_0xceee59,_0x33e298){return function(_0x205237){if(_0x205237){return _0x205237['destroy']()[_0x946b('0x2a')](function(){_0xceee59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f91da,_0x296646){return function(_0x583897){if(!_0x583897){_0x1f91da[_0x946b('0x1c')](0x194);}return _0x583897;};}function handleError(_0x3f0ddb,_0x564817){_0x564817=_0x564817||0x1f4;return function(_0x5c01db){logger[_0x946b('0x2b')](_0x5c01db[_0x946b('0x2c')]);if(_0x5c01db[_0x946b('0x2d')]){delete _0x5c01db['name'];}_0x3f0ddb[_0x946b('0x1d')](_0x564817)[_0x946b('0x2e')](_0x5c01db);};}exports[_0x946b('0x2f')]=function(_0x3f5318,_0x52cb74){var _0x1b0a8a={},_0x39bdb7={},_0x4debd9={'count':0x0,'rows':[]};var _0x14c88f=_[_0x946b('0x30')](db['ChatGroup']['rawAttributes'],function(_0x53b2aa){return{'name':_0x53b2aa[_0x946b('0x31')],'type':_0x53b2aa[_0x946b('0x32')][_0x946b('0x33')]};});_0x39bdb7[_0x946b('0x34')]=_[_0x946b('0x30')](_0x14c88f,_0x946b('0x2d'));_0x39bdb7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x3f5318[_0x946b('0x35')]);_0x39bdb7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x39bdb7['model'],_0x39bdb7[_0x946b('0x35')]);_0x1b0a8a[_0x946b('0x39')]=_[_0x946b('0x38')](_0x39bdb7['model'],qs[_0x946b('0x3a')](_0x3f5318['query'][_0x946b('0x3a')]));_0x1b0a8a[_0x946b('0x39')]=_0x1b0a8a[_0x946b('0x39')][_0x946b('0x3b')]?_0x1b0a8a[_0x946b('0x39')]:_0x39bdb7[_0x946b('0x34')];if(!_0x3f5318[_0x946b('0x35')][_0x946b('0x3c')](_0x946b('0x3d'))){_0x1b0a8a[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x3f5318['query']['limit']);_0x1b0a8a[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x3f5318[_0x946b('0x35')][_0x946b('0x20')]);}_0x1b0a8a['order']=qs[_0x946b('0x3e')](_0x3f5318[_0x946b('0x35')][_0x946b('0x3e')]);_0x1b0a8a['where']=qs['filters'](_[_0x946b('0x3f')](_0x3f5318[_0x946b('0x35')],_0x39bdb7[_0x946b('0x37')]),_0x14c88f);if(_0x3f5318[_0x946b('0x35')][_0x946b('0x40')]){_0x1b0a8a[_0x946b('0x41')]=_[_0x946b('0x42')](_0x1b0a8a[_0x946b('0x41')],{'$or':_[_0x946b('0x30')](_0x14c88f,function(_0x7e24da){if(_0x7e24da[_0x946b('0x32')]!==_0x946b('0x43')){var _0x3e4489={};_0x3e4489[_0x7e24da[_0x946b('0x2d')]]={'$like':'%'+_0x3f5318['query'][_0x946b('0x40')]+'%'};return _0x3e4489;}})});}_0x1b0a8a=_[_0x946b('0x42')]({},_0x1b0a8a,_0x3f5318[_0x946b('0x44')]);var _0x1fffd5={'where':_0x1b0a8a[_0x946b('0x41')]};return db[_0x946b('0x45')][_0x946b('0x22')](_0x1fffd5)[_0x946b('0x2a')](function(_0x261eb4){_0x4debd9['count']=_0x261eb4;if(_0x3f5318[_0x946b('0x35')][_0x946b('0x46')]){_0x1b0a8a[_0x946b('0x47')]=[{'all':!![]}];}return db[_0x946b('0x45')]['findAll'](_0x1b0a8a);})['then'](function(_0x3a44ab){_0x4debd9[_0x946b('0x48')]=_0x3a44ab;return _0x4debd9;})[_0x946b('0x2a')](respondWithFilteredResult(_0x52cb74,_0x1b0a8a))['catch'](handleError(_0x52cb74,null));};exports[_0x946b('0x49')]=function(_0xd2c78f,_0x4afcc2){var _0xe8cc82={'raw':!![],'where':{'id':_0xd2c78f[_0x946b('0x4a')]['id']}},_0x4a9749={};_0x4a9749[_0x946b('0x34')]=_[_0x946b('0x36')](db['ChatGroup'][_0x946b('0x4b')]);_0x4a9749[_0x946b('0x35')]=_[_0x946b('0x36')](_0xd2c78f[_0x946b('0x35')]);_0x4a9749[_0x946b('0x37')]=_['intersection'](_0x4a9749[_0x946b('0x34')],_0x4a9749['query']);_0xe8cc82[_0x946b('0x39')]=_[_0x946b('0x38')](_0x4a9749[_0x946b('0x34')],qs[_0x946b('0x3a')](_0xd2c78f[_0x946b('0x35')][_0x946b('0x3a')]));_0xe8cc82[_0x946b('0x39')]=_0xe8cc82[_0x946b('0x39')]['length']?_0xe8cc82[_0x946b('0x39')]:_0x4a9749[_0x946b('0x34')];if(_0xd2c78f[_0x946b('0x35')][_0x946b('0x46')]){_0xe8cc82[_0x946b('0x47')]=[{'all':!![]}];}_0xe8cc82=_[_0x946b('0x42')]({},_0xe8cc82,_0xd2c78f[_0x946b('0x44')]);return db['ChatGroup'][_0x946b('0x4c')](_0xe8cc82)[_0x946b('0x2a')](handleEntityNotFound(_0x4afcc2,null))['then'](respondWithResult(_0x4afcc2,null))[_0x946b('0x4d')](handleError(_0x4afcc2,null));};exports['create']=function(_0x56f56e,_0x167d80){return db['ChatGroup'][_0x946b('0x4e')](_0x56f56e[_0x946b('0x4f')],{})[_0x946b('0x2a')](respondWithResult(_0x167d80,0xc9))[_0x946b('0x4d')](handleError(_0x167d80,null));};exports[_0x946b('0x29')]=function(_0x138646,_0x3b3ce7){if(_0x138646[_0x946b('0x4f')]['id']){delete _0x138646[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x138646[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x3b3ce7,null))[_0x946b('0x2a')](saveUpdates(_0x138646[_0x946b('0x4f')],null))['then'](respondWithResult(_0x3b3ce7,null))[_0x946b('0x4d')](handleError(_0x3b3ce7,null));};exports['destroy']=function(_0x5bda76,_0x493c06){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x5bda76[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x493c06,null))[_0x946b('0x2a')](removeEntity(_0x493c06,null))[_0x946b('0x4d')](handleError(_0x493c06,null));};exports[_0x946b('0x50')]=function(_0x44979c,_0x1df06a){return db[_0x946b('0x45')][_0x946b('0x50')]()[_0x946b('0x2a')](respondWithResult(_0x1df06a,null))[_0x946b('0x4d')](handleError(_0x1df06a,null));};exports['getUnread']=function(_0x88f55c,_0x2060e2,_0xce24fe){return db[_0x946b('0x51')][_0x946b('0x22')]({'where':{'ChatGroupId':_0x88f55c[_0x946b('0x4a')]['id'],'ToId':_0x88f55c[_0x946b('0x52')]['id'],'read':![]}})[_0x946b('0x2a')](function(_0x4bcfc5){return{'id':_[_0x946b('0x53')](_0x88f55c[_0x946b('0x4a')]['id']),'count':_0x4bcfc5};})[_0x946b('0x2a')](respondWithResult(_0x2060e2,null))['catch'](handleError(_0x2060e2,null));};exports[_0x946b('0x54')]=function(_0x284d9f,_0xaec05,_0x1cbcf5){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x284d9f[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0xaec05,null))[_0x946b('0x2a')](function(_0x4112a4){if(_0x4112a4){return _0x4112a4[_0x946b('0x54')](_0x284d9f['body'][_0x946b('0x55')],_[_0x946b('0x56')](_0x284d9f[_0x946b('0x4f')],[_0x946b('0x55'),'id'])||{});}})[_0x946b('0x2a')](respondWithResult(_0xaec05,null))[_0x946b('0x4d')](handleError(_0xaec05,null));};exports[_0x946b('0x57')]=function(_0x5c6c66,_0x49c926,_0x4b84dd){var _0x3553c6={};var _0x269a7={};var _0x592793;var _0x201f78;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x5c6c66[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49c926,null))[_0x946b('0x2a')](function(_0x3b0008){if(_0x3b0008){_0x592793=_0x3b0008;_0x269a7[_0x946b('0x34')]=_['keys'](db['User']['rawAttributes']);_0x269a7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x5c6c66[_0x946b('0x35')]);_0x269a7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],_0x269a7[_0x946b('0x35')]);_0x3553c6['attributes']=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3a')]));_0x3553c6[_0x946b('0x39')]=_0x3553c6[_0x946b('0x39')][_0x946b('0x3b')]?_0x3553c6['attributes']:_0x269a7[_0x946b('0x34')];_0x3553c6[_0x946b('0x59')]=qs['sort'](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3e')]);_0x3553c6['where']=qs['filters'](_[_0x946b('0x3f')](_0x5c6c66['query'],_0x269a7['filters']));if(_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]){_0x3553c6['where']=_['merge'](_0x3553c6[_0x946b('0x41')],{'$or':_['map'](_0x3553c6[_0x946b('0x39')],function(_0x5d402f){var _0x5e8ea4={};_0x5e8ea4[_0x5d402f]={'$like':'%'+_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x5e8ea4;})});}_0x3553c6=_[_0x946b('0x42')]({},_0x3553c6,_0x5c6c66[_0x946b('0x44')]);return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x4b45eb){if(_0x4b45eb){_0x201f78=_0x4b45eb[_0x946b('0x3b')];if(!_0x5c6c66['query'][_0x946b('0x3c')](_0x946b('0x3d'))){_0x3553c6[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x5c6c66['query']['limit']);_0x3553c6['offset']=qs[_0x946b('0x20')](_0x5c6c66['query'][_0x946b('0x20')]);}return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x41dd58){if(_0x41dd58){return _0x41dd58?{'count':_0x201f78,'rows':_0x41dd58}:null;}})[_0x946b('0x2a')](respondWithResult(_0x49c926,null))[_0x946b('0x4d')](handleError(_0x49c926,null));};exports[_0x946b('0x5a')]=function(_0x1e8b58,_0x26ef7e,_0xe0f6c8){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x1e8b58['params']['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x26ef7e,null))['then'](function(_0x257400){if(_0x257400){return _0x257400[_0x946b('0x5a')](_0x1e8b58['query'][_0x946b('0x55')]);}})[_0x946b('0x2a')](respondWithStatusCode(_0x26ef7e,null))['catch'](handleError(_0x26ef7e,null));};exports['addMessage']=function(_0x46479f,_0x2b6c98,_0x2e6790){if(_0x46479f[_0x946b('0x4f')]['id']){delete _0x46479f[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x46479f[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x2b6c98,null))[_0x946b('0x2a')](function(_0x3ed570){if(_0x3ed570){_0x46479f[_0x946b('0x4f')][_0x946b('0x5b')]=_0x3ed570['id'];return db[_0x946b('0x51')][_0x946b('0x4e')](_0x46479f[_0x946b('0x4f')]);}})[_0x946b('0x2a')](respondWithResult(_0x2b6c98,null))[_0x946b('0x4d')](handleError(_0x2b6c98,null));};exports[_0x946b('0x5c')]=function(_0x468e60,_0x4973b7,_0x1eccda){var _0x3a1cb1={};var _0x3190ed={};var _0x190b95;var _0xd15be3;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x468e60[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x4973b7,null))[_0x946b('0x2a')](function(_0x66f599){if(_0x66f599){_0x190b95=_0x66f599;_0x3190ed[_0x946b('0x34')]=_[_0x946b('0x36')](db[_0x946b('0x51')]['rawAttributes']);_0x3190ed[_0x946b('0x35')]=_['keys'](_0x468e60['query']);_0x3190ed[_0x946b('0x37')]=_['intersection'](_0x3190ed[_0x946b('0x34')],_0x3190ed[_0x946b('0x35')]);_0x3a1cb1[_0x946b('0x39')]=_['intersection'](_0x3190ed[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x468e60[_0x946b('0x35')]['fields']));_0x3a1cb1[_0x946b('0x39')]=_0x3a1cb1[_0x946b('0x39')][_0x946b('0x3b')]?_0x3a1cb1[_0x946b('0x39')]:_0x3190ed[_0x946b('0x34')];_0x3a1cb1[_0x946b('0x59')]=qs[_0x946b('0x3e')](_0x468e60['query'][_0x946b('0x3e')]);_0x3a1cb1[_0x946b('0x41')]=qs[_0x946b('0x37')](_[_0x946b('0x3f')](_0x468e60[_0x946b('0x35')],_0x3190ed[_0x946b('0x37')]));if(_0x468e60['query'][_0x946b('0x40')]){_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],{'$or':_['map'](_0x3a1cb1[_0x946b('0x39')],function(_0xb96e5b){var _0x42b899={};_0x42b899[_0xb96e5b]={'$like':'%'+_0x468e60[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x42b899;})});}if(_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]){var _0x3ab846=_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]['split'](',');var _0x447b87={};_0x447b87[_0x3ab846[0x0]]={'$gte':moment(_0x3ab846[0x1])[_0x946b('0x5e')](_0x946b('0x5f'))};_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],_0x447b87);}_0x3a1cb1=_[_0x946b('0x42')]({},_0x3a1cb1,_0x468e60[_0x946b('0x44')]);return _0x190b95['getMessages'](_0x3a1cb1);}})[_0x946b('0x2a')](function(_0x33f872){if(_0x33f872){_0xd15be3=_0x33f872[_0x946b('0x3b')];if(!_0x468e60[_0x946b('0x35')][_0x946b('0x3c')]('nolimit')){_0x3a1cb1[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x468e60[_0x946b('0x35')]['limit']);_0x3a1cb1[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x468e60[_0x946b('0x35')][_0x946b('0x20')]);}return _0x190b95[_0x946b('0x5c')](_0x3a1cb1);}})['then'](function(_0x2fb860){if(_0x2fb860){return _0x2fb860?{'count':_0xd15be3,'rows':_0x2fb860}:null;}})[_0x946b('0x2a')](respondWithResult(_0x4973b7,null))['catch'](handleError(_0x4973b7,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 292d23d..6849f7b 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 _0xf777=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1765dc,_0x17d194){var _0x5e7800=function(_0x6d8197){while(--_0x6d8197){_0x1765dc['push'](_0x1765dc['shift']());}};_0x5e7800(++_0x17d194);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7f77('0x0'));var ChatGroup=require(_0x7f77('0x1'))['db'][_0x7f77('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7f77('0x3')](0x0);var events={'afterCreate':_0x7f77('0x4'),'afterUpdate':_0x7f77('0x5'),'afterDestroy':_0x7f77('0x6')};function emitEvent(_0x1c10a0){return function(_0x3899ba,_0x5941a2,_0x411b63){ChatGroupEvents[_0x7f77('0x7')](_0x1c10a0+':'+_0x3899ba['id'],_0x3899ba);ChatGroupEvents['emit'](_0x1c10a0,_0x3899ba);_0x411b63(null);};}for(var e in events){if(events[_0x7f77('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7f77('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe3cf=['hasOwnProperty','hook','exports','events','ChatGroup','remove','emit'];(function(_0x53cf1c,_0x2c2b16){var _0x27221a=function(_0x104d7c){while(--_0x104d7c){_0x53cf1c['push'](_0x53cf1c['shift']());}};_0x27221a(++_0x2c2b16);}(_0xe3cf,0x16f));var _0xfe3c=function(_0x112df4,_0x14bb3d){_0x112df4=_0x112df4-0x0;var _0x4c2a76=_0xe3cf[_0x112df4];return _0x4c2a76;};'use strict';var EventEmitter=require(_0xfe3c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfe3c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfe3c('0x2')};function emitEvent(_0x2fc7c5){return function(_0x1e474a,_0x32bb6b,_0x1ced6d){ChatGroupEvents[_0xfe3c('0x3')](_0x2fc7c5+':'+_0x1e474a['id'],_0x1e474a);ChatGroupEvents['emit'](_0x2fc7c5,_0x1e474a);_0x1ced6d(null);};}for(var e in events){if(events[_0xfe3c('0x4')](e)){var event=events[e];ChatGroup[_0xfe3c('0x5')](e,emitEvent(event));}}module[_0xfe3c('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 8a61c9f..fd0a534 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 _0x7a53=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','path','./chatGroup.attributes'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7a53,0x1cf));var _0x37a5=function(_0x94de9c,_0x255ae5){_0x94de9c=_0x94de9c-0x0;var _0x250ae7=_0x7a53[_0x94de9c];return _0x250ae7;};'use strict';var _=require(_0x37a5('0x0'));var util=require(_0x37a5('0x1'));var logger=require(_0x37a5('0x2'))('api');var moment=require(_0x37a5('0x3'));var BPromise=require(_0x37a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x37a5('0x6'));module['exports']=function(_0x3005f1,_0x27ad8c){return _0x3005f1[_0x37a5('0x7')](_0x37a5('0x8'),attributes,{'tableName':_0x37a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d5e=['request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1bbb91,_0xc65ae3){var _0x46053a=function(_0x3e174e){while(--_0x3e174e){_0x1bbb91['push'](_0x1bbb91['shift']());}};_0x46053a(++_0xc65ae3);}(_0x6d5e,0x190));var _0xe6d5=function(_0x4f8196,_0x6ce644){_0x4f8196=_0x4f8196-0x0;var _0x1d62b3=_0x6d5e[_0x4f8196];return _0x1d62b3;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var logger=require(_0xe6d5('0x2'))(_0xe6d5('0x3'));var moment=require(_0xe6d5('0x4'));var BPromise=require(_0xe6d5('0x5'));var rp=require(_0xe6d5('0x6'));var fs=require('fs');var path=require(_0xe6d5('0x7'));var rimraf=require(_0xe6d5('0x8'));var config=require('../../config/environment');var attributes=require(_0xe6d5('0x9'));module[_0xe6d5('0xa')]=function(_0x42afed,_0x10206e){return _0x42afed[_0xe6d5('0xb')](_0xe6d5('0xc'),attributes,{'tableName':_0xe6d5('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 8fa488b..a4ffe8e 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 _0x3b75=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','lodash'];(function(_0x33f0fc,_0x1c85fe){var _0x12323e=function(_0xde99aa){while(--_0xde99aa){_0x33f0fc['push'](_0x33f0fc['shift']());}};_0x12323e(++_0x1c85fe);}(_0x3b75,0x144));var _0x53b7=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x3b75[_0x562faf];return _0x22c1f6;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require(_0x53b7('0x5'));var db=require(_0x53b7('0x6'))['db'];var utils=require(_0x53b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x53b7('0x8'));var jayson=require(_0x53b7('0x9'));var client=jayson[_0x53b7('0xa')][_0x53b7('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x53b7('0xc')],{'host':_0x53b7('0xd'),'port':0x18eb});var socket=require(_0x53b7('0xe'))(new Redis(config[_0x53b7('0xc')]));require(_0x53b7('0xf'))['register'](socket);function respondWithRpcPromise(_0x958344,_0x41afe3,_0x7ac56b){return new BPromise(function(_0x39708d,_0x308e6a){return client[_0x53b7('0x10')](_0x958344,_0x7ac56b)['then'](function(_0x54b69e){logger[_0x53b7('0x11')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x53b7('0x12'));logger['debug'](_0x53b7('0x13'),_0x41afe3,_0x53b7('0x12'),JSON[_0x53b7('0x14')](_0x54b69e));if(_0x54b69e['error']){if(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);return _0x308e6a(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);}logger[_0x53b7('0x15')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);return _0x39708d(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);}else{logger[_0x53b7('0x11')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x53b7('0x12'));_0x39708d(_0x54b69e['result']['message']);}})['catch'](function(_0x11eff0){logger[_0x53b7('0x15')](_0x53b7('0x18'),_0x41afe3,_0x11eff0);_0x308e6a(_0x11eff0);});});}
\ No newline at end of file
+var _0xa37e=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','moment','bluebird','randomstring'];(function(_0x45961f,_0x40c9ba){var _0x57d209=function(_0x2f0c03){while(--_0x2f0c03){_0x45961f['push'](_0x45961f['shift']());}};_0x57d209(++_0x40c9ba);}(_0xa37e,0x97));var _0xea37=function(_0x5723f9,_0x294319){_0x5723f9=_0x5723f9-0x0;var _0x1c021c=_0xa37e[_0x5723f9];return _0x1c021c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xea37('0x8')]=_['defaults'](config['redis'],{'host':_0xea37('0x9'),'port':0x18eb});var socket=require(_0xea37('0xa'))(new Redis(config[_0xea37('0x8')]));require(_0xea37('0xb'))['register'](socket);function respondWithRpcPromise(_0x315e5f,_0x37ca45,_0x8371a){return new BPromise(function(_0x55d4de,_0x5060cd){return client[_0xea37('0xc')](_0x315e5f,_0x8371a)[_0xea37('0xd')](function(_0x3cd18b){logger['info'](_0xea37('0xe'),_0x37ca45,_0xea37('0xf'));logger[_0xea37('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x37ca45,_0xea37('0xf'),JSON[_0xea37('0x11')](_0x3cd18b));if(_0x3cd18b['error']){if(_0x3cd18b[_0xea37('0x12')]['code']===0x1f4){logger[_0xea37('0x12')]('ChatGroup,\x20%s,\x20%s',_0x37ca45,_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);return _0x5060cd(_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);}logger['error'](_0xea37('0xe'),_0x37ca45,_0x3cd18b['error']['message']);return _0x55d4de(_0x3cd18b[_0xea37('0x12')]['message']);}else{logger[_0xea37('0x14')](_0xea37('0xe'),_0x37ca45,'request\x20sent');_0x55d4de(_0x3cd18b[_0xea37('0x15')][_0xea37('0x13')]);}})['catch'](function(_0x786ee5){logger[_0xea37('0x12')](_0xea37('0xe'),_0x37ca45,_0x786ee5);_0x5060cd(_0x786ee5);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7f376fa..e1ce1a9 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 _0x4011=['update','emit','removeListener','register','length','chatGroup:','remove'];(function(_0xcb56d2,_0x18c194){var _0x57bed4=function(_0x194ed8){while(--_0x194ed8){_0xcb56d2['push'](_0xcb56d2['shift']());}};_0x57bed4(++_0x18c194);}(_0x4011,0x109));var _0x1401=function(_0x5c2577,_0x48f6c1){_0x5c2577=_0x5c2577-0x0;var _0x1d50da=_0x4011[_0x5c2577];return _0x1d50da;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x1401('0x0'),_0x1401('0x1')];function createListener(_0x6e2b08,_0x38f44d){return function(_0x2b6407){_0x38f44d[_0x1401('0x2')](_0x6e2b08,_0x2b6407);};}function removeListener(_0x2bf9fc,_0x13075d){return function(){ChatGroupEvents[_0x1401('0x3')](_0x2bf9fc,_0x13075d);};}exports[_0x1401('0x4')]=function(_0x47d33e){for(var _0x1815fe=0x0,_0x196f67=events[_0x1401('0x5')];_0x1815fe<_0x196f67;_0x1815fe++){var _0x397a44=events[_0x1815fe];var _0x472ae0=createListener(_0x1401('0x6')+_0x397a44,_0x47d33e);ChatGroupEvents['on'](_0x397a44,_0x472ae0);}};
\ No newline at end of file
+var _0x577c=['register','length','./chatGroup.events','save','remove','update','removeListener'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x577c,0x9c));var _0xc577=function(_0x1d5ff0,_0x251781){_0x1d5ff0=_0x1d5ff0-0x0;var _0x9003ac=_0x577c[_0x1d5ff0];return _0x9003ac;};'use strict';var ChatGroupEvents=require(_0xc577('0x0'));var events=[_0xc577('0x1'),_0xc577('0x2'),_0xc577('0x3')];function createListener(_0x2c1dbe,_0x370e17){return function(_0x2e0e2a){_0x370e17['emit'](_0x2c1dbe,_0x2e0e2a);};}function removeListener(_0x47f25c,_0x5c6f7a){return function(){ChatGroupEvents[_0xc577('0x4')](_0x47f25c,_0x5c6f7a);};}exports[_0xc577('0x5')]=function(_0x4627b4){for(var _0x4fdcbd=0x0,_0x1c31d3=events[_0xc577('0x6')];_0x4fdcbd<_0x1c31d3;_0x4fdcbd++){var _0x258d69=events[_0x4fdcbd];var _0x7be767=createListener('chatGroup:'+_0x258d69,_0x4627b4);ChatGroupEvents['on'](_0x258d69,_0x7be767);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 47eea1f..8bad05b 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 _0x94c4=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','/:id/messages','addMessage','/:id','update','delete'];(function(_0x3c0595,_0x41a6a9){var _0x1d8f61=function(_0x3e7b61){while(--_0x3e7b61){_0x3c0595['push'](_0x3c0595['shift']());}};_0x1d8f61(++_0x41a6a9);}(_0x94c4,0x7f));var _0x494c=function(_0x3a40a3,_0x1e52d4){_0x3a40a3=_0x3a40a3-0x0;var _0x2d07b9=_0x94c4[_0x3a40a3];return _0x2d07b9;};'use strict';var multer=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var path=require(_0x494c('0x2'));var timeout=require(_0x494c('0x3'));var express=require(_0x494c('0x4'));var router=express[_0x494c('0x5')]();var fs_extra=require(_0x494c('0x6'));var auth=require(_0x494c('0x7'));var interaction=require(_0x494c('0x8'));var config=require(_0x494c('0x9'));var controller=require(_0x494c('0xa'));router[_0x494c('0xb')]('/',auth[_0x494c('0xc')](),controller[_0x494c('0xd')]);router['get'](_0x494c('0xe'),auth[_0x494c('0xc')](),controller[_0x494c('0xf')]);router[_0x494c('0xb')]('/:id',auth[_0x494c('0xc')](),controller[_0x494c('0x10')]);router['get'](_0x494c('0x11'),auth[_0x494c('0xc')](),controller[_0x494c('0x12')]);router[_0x494c('0xb')](_0x494c('0x13'),auth[_0x494c('0xc')](),controller[_0x494c('0x14')]);router[_0x494c('0xb')]('/:id/messages',auth[_0x494c('0xc')](),controller[_0x494c('0x15')]);router[_0x494c('0x16')]('/',auth[_0x494c('0xc')](),controller['create']);router[_0x494c('0x16')]('/:id/members',auth[_0x494c('0xc')](),controller['addMembers']);router[_0x494c('0x16')](_0x494c('0x17'),auth[_0x494c('0xc')](),controller[_0x494c('0x18')]);router['put'](_0x494c('0x19'),auth[_0x494c('0xc')](),controller[_0x494c('0x1a')]);router[_0x494c('0x1b')](_0x494c('0x19'),auth[_0x494c('0xc')](),controller[_0x494c('0x1c')]);router['delete'](_0x494c('0x13'),auth[_0x494c('0xc')](),controller[_0x494c('0x1d')]);module[_0x494c('0x1e')]=router;
\ No newline at end of file
+var _0x5a3b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMessage','put','update'];(function(_0x427127,_0x3a4a16){var _0x22d8e7=function(_0x210c9f){while(--_0x210c9f){_0x427127['push'](_0x427127['shift']());}};_0x22d8e7(++_0x3a4a16);}(_0x5a3b,0x1bd));var _0xb5a3=function(_0x4682eb,_0x2bfc64){_0x4682eb=_0x4682eb-0x0;var _0x25ee36=_0x5a3b[_0x4682eb];return _0x25ee36;};'use strict';var multer=require(_0xb5a3('0x0'));var util=require(_0xb5a3('0x1'));var path=require(_0xb5a3('0x2'));var timeout=require(_0xb5a3('0x3'));var express=require(_0xb5a3('0x4'));var router=express[_0xb5a3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5a3('0x6'));var controller=require('./chatGroup.controller');router[_0xb5a3('0x7')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x9')]);router[_0xb5a3('0x7')]('/describe',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xa')]);router['get'](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0xc')]);router[_0xb5a3('0x7')](_0xb5a3('0xd'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xe')]);router[_0xb5a3('0x7')](_0xb5a3('0xf'),auth[_0xb5a3('0x8')](),controller['getMembers']);router[_0xb5a3('0x7')](_0xb5a3('0x10'),auth['isAuthenticated'](),controller[_0xb5a3('0x11')]);router[_0xb5a3('0x12')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x13')]);router[_0xb5a3('0x12')]('/:id/members',auth[_0xb5a3('0x8')](),controller['addMembers']);router[_0xb5a3('0x12')](_0xb5a3('0x10'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x14')]);router[_0xb5a3('0x15')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x16')]);router[_0xb5a3('0x17')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x18')]);router[_0xb5a3('0x17')]('/:id/members',auth[_0xb5a3('0x8')](),controller['removeMembers']);module[_0xb5a3('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 8d367a4..f44714a 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 _0x7269=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7269,0x76));var _0x9726=function(_0x170148,_0x402a07){_0x170148=_0x170148-0x0;var _0x2f00a7=_0x7269[_0x170148];return _0x2f00a7;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'closed':{'type':Sequelize[_0x9726('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x9726('0x3'),_0x9726('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9726('0x5')]},'pathTranscript':{'type':Sequelize[_0x9726('0x5')]},'mailTranscript':{'type':Sequelize[_0x9726('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9726('0x7')]},'disposition':{'type':Sequelize[_0x9726('0x6')]},'secondDisposition':{'type':Sequelize[_0x9726('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9726('0x6')]},'note':{'type':Sequelize[_0x9726('0x6')]},'browserName':{'type':Sequelize[_0x9726('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9726('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9726('0x6')]},'deviceVendor':{'type':Sequelize[_0x9726('0x6')]},'deviceType':{'type':Sequelize[_0x9726('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9726('0x6')]},'formData':{'type':Sequelize[_0x9726('0x5')](_0x9726('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9726('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9726('0x9')]('in',_0x9726('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9726('0x6')]},'customerPort':{'type':Sequelize[_0x9726('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9e6b=['star','TEXT','DATE','STRING','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','thumb'];(function(_0x4472b6,_0x3768b6){var _0x153531=function(_0x517b02){while(--_0x517b02){_0x4472b6['push'](_0x4472b6['shift']());}};_0x153531(++_0x3768b6);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb9e6('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xb9e6('0x3')),'defaultValue':_0xb9e6('0x4')},'ratingMessage':{'type':Sequelize[_0xb9e6('0x5')]},'pathTranscript':{'type':Sequelize[_0xb9e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb9e6('0x6')]},'disposition':{'type':Sequelize[_0xb9e6('0x7')]},'secondDisposition':{'type':Sequelize[_0xb9e6('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9e6('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xb9e6('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xb9e6('0x7')]},'deviceType':{'type':Sequelize[_0xb9e6('0x7')]},'referer':{'type':Sequelize[_0xb9e6('0x5')]},'customerIp':{'type':Sequelize[_0xb9e6('0x7')]},'formData':{'type':Sequelize[_0xb9e6('0x5')](_0xb9e6('0x8'))},'read1stAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xb9e6('0x9')]('in',_0xb9e6('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb9e6('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb9e6('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xb9e6('0xb')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ef8ea5a..a678ab4 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 _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x315638,_0x3e3d45){var _0x3d27cd=function(_0x59c9b4){while(--_0x59c9b4){_0x315638['push'](_0x315638['shift']());}};_0x3d27cd(++_0x3e3d45);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));};
\ No newline at end of file
+var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4772f7,_0x7ca703){var _0x13c46d=function(_0x3342b6){while(--_0x3342b6){_0x4772f7['push'](_0x4772f7['shift']());}};_0x13c46d(++_0x7ca703);}(_0x66fa,0x117));var _0xa66f=function(_0x55cf68,_0x49959b){_0x55cf68=_0x55cf68-0x0;var _0x1c5151=_0x66fa[_0x55cf68];return _0x1c5151;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2b2eeb7..243fce2 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 _0xe892=['ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe892,0x14e));var _0x2e89=function(_0x54931b,_0x1764a8){_0x54931b=_0x54931b-0x0;var _0x430239=_0xe892[_0x54931b];return _0x430239;};'use strict';var EventEmitter=require(_0x2e89('0x0'));var ChatInteraction=require(_0x2e89('0x1'))['db'][_0x2e89('0x2')];var ChatMessage=require(_0x2e89('0x1'))['db'][_0x2e89('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e89('0x4')](0x0);var events={'afterCreate':_0x2e89('0x5'),'afterUpdate':_0x2e89('0x6'),'afterDestroy':'remove'};function emitEvent(_0xfdd3){return function(_0x2227c0,_0x4f7400,_0x520fc2){_0x2227c0[_0x2e89('0x7')]({'attributes':['id'],'raw':!![]})[_0x2e89('0x8')](function(_0x210981){_0x2227c0['setDataValue'](_0x2e89('0x9'),_0x210981[_0x2e89('0xa')](function(_0x262b0b){return{'id':_0x262b0b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2227c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e89('0x8')](function(_0x3fabd7){_0x2227c0['setDataValue'](_0x2e89('0xb'),_0x3fabd7['length']);ChatInteractionEvents[_0x2e89('0xc')](_0xfdd3+':'+_0x2227c0['id'],_0x2227c0);ChatInteractionEvents['emit'](_0xfdd3,_0x2227c0);_0x520fc2(null);})['catch'](_0x520fc2(null));};}for(var e in events){if(events[_0x2e89('0xd')](e)){var event=events[e];ChatInteraction[_0x2e89('0xe')](e,emitEvent(event));}}module[_0x2e89('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xca31=['save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners'];(function(_0x56f552,_0x374061){var _0x21a33a=function(_0x38a83d){while(--_0x38a83d){_0x56f552['push'](_0x56f552['shift']());}};_0x21a33a(++_0x374061);}(_0xca31,0xd5));var _0x1ca3=function(_0x129259,_0x3c39ec){_0x129259=_0x129259-0x0;var _0x110f34=_0xca31[_0x129259];return _0x110f34;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x1ca3('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1ca3('0x2')](0x0);var events={'afterCreate':_0x1ca3('0x3'),'afterUpdate':_0x1ca3('0x4'),'afterDestroy':_0x1ca3('0x5')};function emitEvent(_0x75f7a3){return function(_0x341fae,_0x4e3bbc,_0x4df219){_0x341fae[_0x1ca3('0x6')]({'attributes':['id'],'raw':!![]})[_0x1ca3('0x7')](function(_0x4f131e){_0x341fae[_0x1ca3('0x8')]('Users',_0x4f131e[_0x1ca3('0x9')](function(_0x158da0){return{'id':_0x158da0['id']};}));return ChatMessage[_0x1ca3('0xa')]({'where':{'ChatInteractionId':_0x341fae['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1ca3('0x7')](function(_0x39469b){_0x341fae[_0x1ca3('0x8')](_0x1ca3('0xb'),_0x39469b[_0x1ca3('0xc')]);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3+':'+_0x341fae['id'],_0x341fae);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3,_0x341fae);_0x4df219(null);})[_0x1ca3('0xe')](_0x4df219(null));};}for(var e in events){if(events[_0x1ca3('0xf')](e)){var event=events[e];ChatInteraction[_0x1ca3('0x10')](e,emitEvent(event));}}module[_0x1ca3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c827f7d..ac984a7 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 _0xa8b2=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x1743bf,_0x15cf86){var _0x9cfb15=function(_0x261bb9){while(--_0x261bb9){_0x1743bf['push'](_0x1743bf['shift']());}};_0x9cfb15(++_0x15cf86);}(_0xa8b2,0x6a));var _0x2a8b=function(_0x4028eb,_0x33ee6a){_0x4028eb=_0x4028eb-0x0;var _0x4edcac=_0xa8b2[_0x4028eb];return _0x4edcac;};'use strict';var _=require(_0x2a8b('0x0'));var util=require(_0x2a8b('0x1'));var logger=require(_0x2a8b('0x2'))(_0x2a8b('0x3'));var moment=require(_0x2a8b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a8b('0x6'));var config=require(_0x2a8b('0x7'));var attributes=require(_0x2a8b('0x8'));module[_0x2a8b('0x9')]=function(_0x448d28,_0x295cc7){return _0x448d28[_0x2a8b('0xa')](_0x2a8b('0xb'),attributes,{'tableName':_0x2a8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39b69a,_0x2758a8,_0x5f1cd5){if(_0x39b69a[_0x2a8b('0xd')](_0x2a8b('0xe'))){_0x39b69a[_0x2a8b('0xf')]=moment()[_0x2a8b('0x10')](_0x2a8b('0x11'));}_0x5f1cd5(null,_0x39b69a);}},'charset':_0x2a8b('0x12'),'collate':_0x2a8b('0x13')});};
\ No newline at end of file
+var _0xec4f=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x1962a7,_0x14784d){var _0x2a7571=function(_0x278c1d){while(--_0x278c1d){_0x1962a7['push'](_0x1962a7['shift']());}};_0x2a7571(++_0x14784d);}(_0xec4f,0x1cc));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfec4('0x0'));var util=require(_0xfec4('0x1'));var logger=require(_0xfec4('0x2'))('api');var moment=require(_0xfec4('0x3'));var BPromise=require(_0xfec4('0x4'));var rp=require(_0xfec4('0x5'));var fs=require('fs');var path=require(_0xfec4('0x6'));var rimraf=require(_0xfec4('0x7'));var config=require(_0xfec4('0x8'));var attributes=require(_0xfec4('0x9'));module[_0xfec4('0xa')]=function(_0xc2a126,_0x256c15){return _0xc2a126[_0xfec4('0xb')](_0xfec4('0xc'),attributes,{'tableName':_0xfec4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5fea63,_0x404b37,_0x162402){if(_0x5fea63['changed'](_0xfec4('0xe'))){_0x5fea63[_0xfec4('0xf')]=moment()[_0xfec4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x162402(null,_0x5fea63);}},'charset':_0xfec4('0x11'),'collate':_0xfec4('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index fce71a3..8570ef2 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 _0x7b01=['./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','body','options','raw','attributes','limit','UpdateChatInteraction','find','where','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x58850c,_0x510e14){var _0x1e098f=function(_0x146958){while(--_0x146958){_0x58850c['push'](_0x58850c['shift']());}};_0x1e098f(++_0x510e14);}(_0x7b01,0x1e7));var _0x17b0=function(_0xd71937,_0x4cfdae){_0xd71937=_0xd71937-0x0;var _0x37bf48=_0x7b01[_0xd71937];return _0x37bf48;};'use strict';var _=require(_0x17b0('0x0'));var util=require(_0x17b0('0x1'));var moment=require(_0x17b0('0x2'));var BPromise=require(_0x17b0('0x3'));var rs=require(_0x17b0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17b0('0x5'))['db'];var utils=require(_0x17b0('0x6'));var logger=require(_0x17b0('0x7'))(_0x17b0('0x8'));var config=require(_0x17b0('0x9'));var jayson=require(_0x17b0('0xa'));var client=jayson[_0x17b0('0xb')][_0x17b0('0xc')]({'port':0x232a});config[_0x17b0('0xd')]=_[_0x17b0('0xe')](config[_0x17b0('0xd')],{'host':_0x17b0('0xf'),'port':0x18eb});var socket=require(_0x17b0('0x10'))(new Redis(config[_0x17b0('0xd')]));require(_0x17b0('0x11'))['register'](socket);function respondWithRpcPromise(_0x5188e1,_0x3a6499,_0x2c07d3){return new BPromise(function(_0x521e97,_0x4db91a){return client['request'](_0x5188e1,_0x2c07d3)[_0x17b0('0x12')](function(_0x1ac9dd){logger[_0x17b0('0x13')](_0x17b0('0x14'),_0x3a6499,_0x17b0('0x15'));logger[_0x17b0('0x16')](_0x17b0('0x17'),_0x3a6499,_0x17b0('0x15'),JSON[_0x17b0('0x18')](_0x1ac9dd));if(_0x1ac9dd[_0x17b0('0x19')]){if(_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1a')]===0x1f4){logger[_0x17b0('0x19')](_0x17b0('0x14'),_0x3a6499,_0x1ac9dd[_0x17b0('0x19')]['message']);return _0x4db91a(_0x1ac9dd['error'][_0x17b0('0x1b')]);}logger[_0x17b0('0x19')](_0x17b0('0x14'),_0x3a6499,_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1b')]);return _0x521e97(_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1b')]);}else{logger[_0x17b0('0x13')](_0x17b0('0x14'),_0x3a6499,'request\x20sent');_0x521e97(_0x1ac9dd['result']['message']);}})[_0x17b0('0x1c')](function(_0x2384c2){logger[_0x17b0('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x3a6499,_0x2384c2);_0x4db91a(_0x2384c2);});});}exports['UpdateChatInteraction']=function(_0x39ad1c){var _0x589d30=this;return new Promise(function(_0x1831a5,_0x17ab3a){return db[_0x17b0('0x1d')]['update'](_0x39ad1c[_0x17b0('0x1e')],{'raw':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')][_0x17b0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')]['where']||null:null,'attributes':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')][_0x17b0('0x21')]||null:null,'limit':_0x39ad1c['options']?_0x39ad1c['options'][_0x17b0('0x22')]||null:null})[_0x17b0('0x12')](function(_0x5174fe){logger['info'](_0x17b0('0x23'),_0x39ad1c);logger['debug'](_0x17b0('0x23'),_0x39ad1c,JSON['stringify'](_0x5174fe));_0x1831a5(_0x5174fe);})[_0x17b0('0x1c')](function(_0x2c86af){logger['error'](_0x17b0('0x23'),_0x2c86af[_0x17b0('0x1b')],_0x39ad1c);_0x17ab3a(_0x589d30[_0x17b0('0x19')](0x1f4,_0x2c86af[_0x17b0('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x230e51){return new Promise(function(_0x42e2ab,_0x540b7c){return db[_0x17b0('0x1d')][_0x17b0('0x24')]({'where':_0x230e51[_0x17b0('0x1f')]?_0x230e51[_0x17b0('0x1f')][_0x17b0('0x25')]||null:null})['then'](function(_0x187cb1){if(_0x187cb1){return _0x187cb1['addTags'](_0x230e51['body'][_0x17b0('0x26')],_[_0x17b0('0x27')](_0x230e51['body'],[_0x17b0('0x26'),'id'])||{});}})[_0x17b0('0x28')](function(_0x52fa56){logger[_0x17b0('0x13')]('AddTags',_0x230e51);logger['debug'](_0x17b0('0x29'),_0x230e51,JSON[_0x17b0('0x18')](_0x52fa56));_0x42e2ab(_0x52fa56);})[_0x17b0('0x1c')](function(_0x4e5930){logger[_0x17b0('0x19')](_0x17b0('0x29'),_0x4e5930[_0x17b0('0x1b')],_0x230e51);_0x540b7c(_this['error'](0x1f4,_0x4e5930[_0x17b0('0x1b')]));});});};
\ No newline at end of file
+var _0xc8f8=['find','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','AddTagsToChatInteraction'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc8f8,0xcf));var _0x8c8f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc8f8[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x8c8f('0x0'));var util=require('util');var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require(_0x8c8f('0x4'));var db=require(_0x8c8f('0x5'))['db'];var utils=require(_0x8c8f('0x6'));var logger=require(_0x8c8f('0x7'))(_0x8c8f('0x8'));var config=require(_0x8c8f('0x9'));var jayson=require(_0x8c8f('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8c8f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c8f('0xc'))(new Redis(config[_0x8c8f('0xd')]));require('./chatInteraction.socket')[_0x8c8f('0xe')](socket);function respondWithRpcPromise(_0x36e20a,_0x4c35e4,_0x1b1391){return new BPromise(function(_0x20eca8,_0x279527){return client[_0x8c8f('0xf')](_0x36e20a,_0x1b1391)['then'](function(_0xbf8cad){logger[_0x8c8f('0x10')](_0x8c8f('0x11'),_0x4c35e4,'request\x20sent');logger[_0x8c8f('0x12')](_0x8c8f('0x13'),_0x4c35e4,'request\x20sent',JSON[_0x8c8f('0x14')](_0xbf8cad));if(_0xbf8cad['error']){if(_0xbf8cad[_0x8c8f('0x15')]['code']===0x1f4){logger['error'](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad['error'][_0x8c8f('0x16')]);return _0x279527(_0xbf8cad['error'][_0x8c8f('0x16')]);}logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);return _0x20eca8(_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);}else{logger['info'](_0x8c8f('0x11'),_0x4c35e4,_0x8c8f('0x17'));_0x20eca8(_0xbf8cad['result'][_0x8c8f('0x16')]);}})[_0x8c8f('0x18')](function(_0x2903fc){logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0x2903fc);_0x279527(_0x2903fc);});});}exports[_0x8c8f('0x19')]=function(_0x2f09fd){var _0x131d06=this;return new Promise(function(_0x6afd41,_0x36bb19){return db[_0x8c8f('0x1a')][_0x8c8f('0x1b')](_0x2f09fd[_0x8c8f('0x1c')],{'raw':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options'][_0x8c8f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null,'attributes':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')]['attributes']||null:null,'limit':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options']['limit']||null:null})['then'](function(_0x274e25){logger[_0x8c8f('0x10')](_0x8c8f('0x19'),_0x2f09fd);logger[_0x8c8f('0x12')]('UpdateChatInteraction',_0x2f09fd,JSON[_0x8c8f('0x14')](_0x274e25));_0x6afd41(_0x274e25);})[_0x8c8f('0x18')](function(_0x2270f9){logger[_0x8c8f('0x15')](_0x8c8f('0x19'),_0x2270f9['message'],_0x2f09fd);_0x36bb19(_0x131d06[_0x8c8f('0x15')](0x1f4,_0x2270f9['message']));});});};exports[_0x8c8f('0x20')]=function(_0x41e386){return new Promise(function(_0xc5bed1,_0x321144){return db[_0x8c8f('0x1a')][_0x8c8f('0x21')]({'where':_0x41e386[_0x8c8f('0x1d')]?_0x41e386[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null})[_0x8c8f('0x22')](function(_0x1f8cd8){if(_0x1f8cd8){return _0x1f8cd8[_0x8c8f('0x23')](_0x41e386[_0x8c8f('0x1c')][_0x8c8f('0x24')],_[_0x8c8f('0x25')](_0x41e386[_0x8c8f('0x1c')],[_0x8c8f('0x24'),'id'])||{});}})[_0x8c8f('0x26')](function(_0x2f825b){logger[_0x8c8f('0x10')](_0x8c8f('0x27'),_0x41e386);logger[_0x8c8f('0x12')](_0x8c8f('0x27'),_0x41e386,JSON[_0x8c8f('0x14')](_0x2f825b));_0xc5bed1(_0x2f825b);})['catch'](function(_0x2c8630){logger[_0x8c8f('0x15')](_0x8c8f('0x27'),_0x2c8630[_0x8c8f('0x16')],_0x41e386);_0x321144(_this[_0x8c8f('0x15')](0x1f4,_0x2c8630[_0x8c8f('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 5d3a3c8..41b253a 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 _0x0c3d=['update','emit','register','length','chatInteraction:'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x0c3d,0x1a9));var _0xd0c3=function(_0x46fc6c,_0x297637){_0x46fc6c=_0x46fc6c-0x0;var _0x18694f=_0x0c3d[_0x46fc6c];return _0x18694f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xd0c3('0x0')];function createListener(_0x44b970,_0x9a6a5d){return function(_0x442cbb){_0x9a6a5d[_0xd0c3('0x1')](_0x44b970,_0x442cbb);};}function removeListener(_0x449ee8,_0x4b2dc8){return function(){ChatInteractionEvents['removeListener'](_0x449ee8,_0x4b2dc8);};}exports[_0xd0c3('0x2')]=function(_0x500509){for(var _0x26c0b6=0x0,_0x4c03f1=events[_0xd0c3('0x3')];_0x26c0b6<_0x4c03f1;_0x26c0b6++){var _0x151886=events[_0x26c0b6];var _0x34d71e=createListener(_0xd0c3('0x4')+_0x151886,_0x500509);ChatInteractionEvents['on'](_0x151886,_0x34d71e);}};
\ No newline at end of file
+var _0x9daa=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9daa,0x146));var _0xa9da=function(_0x28430d,_0x45523a){_0x28430d=_0x28430d-0x0;var _0x5cae1b=_0x9daa[_0x28430d];return _0x5cae1b;};'use strict';var ChatInteractionEvents=require(_0xa9da('0x0'));var events=[_0xa9da('0x1'),_0xa9da('0x2'),_0xa9da('0x3')];function createListener(_0x54105a,_0xa817d9){return function(_0x112851){_0xa817d9[_0xa9da('0x4')](_0x54105a,_0x112851);};}function removeListener(_0xee9072,_0x347ed7){return function(){ChatInteractionEvents[_0xa9da('0x5')](_0xee9072,_0x347ed7);};}exports[_0xa9da('0x6')]=function(_0x56a8fc){for(var _0x4dbf12=0x0,_0x4ef8e6=events['length'];_0x4dbf12<_0x4ef8e6;_0x4dbf12++){var _0x2840df=events[_0x4dbf12];var _0x5e588c=createListener(_0xa9da('0x7')+_0x2840df,_0x56a8fc);ChatInteractionEvents['on'](_0x2840df,_0x5e588c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 007bfa2..bae2273 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 _0x415c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','describe','get','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','post','/:id/attachment_upload','single','file','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x415c,0x1c2));var _0xc415=function(_0x4a7f7c,_0x345029){_0x4a7f7c=_0x4a7f7c-0x0;var _0x66e958=_0x415c[_0x4a7f7c];return _0x66e958;};'use strict';var multer=require(_0xc415('0x0'));var util=require(_0xc415('0x1'));var path=require(_0xc415('0x2'));var timeout=require(_0xc415('0x3'));var express=require(_0xc415('0x4'));var router=express[_0xc415('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc415('0x6'));var interaction=require(_0xc415('0x7'));var config=require(_0xc415('0x8'));var controller=require(_0xc415('0x9'));router['get']('/',auth[_0xc415('0xa')](),controller['index']);router['get']('/describe',auth[_0xc415('0xa')](),controller[_0xc415('0xb')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0xc415('0xc')](_0xc415('0xd'),auth[_0xc415('0xe')](),controller['attachmentDownload']);router[_0xc415('0xc')](_0xc415('0xf'),auth[_0xc415('0xa')](),controller[_0xc415('0x10')]);router[_0xc415('0xc')](_0xc415('0x11'),auth[_0xc415('0xe')](),controller[_0xc415('0x12')]);router['get'](_0xc415('0x13'),auth[_0xc415('0xa')](),controller[_0xc415('0x14')]);router['post']('/',auth[_0xc415('0xa')](),controller[_0xc415('0x15')]);router['post']('/:id/vidaoo',auth[_0xc415('0xa')](),controller[_0xc415('0x16')]);var upload=multer({'storage':multer[_0xc415('0x17')]({'destination':function(_0x2b4e14,_0x19b7e8,_0x3e67e9){_0x3e67e9(null,path['join'](config['root'],_0xc415('0x18')));},'filename':function(_0x5b0729,_0x2d44d8,_0x15c815){_0x15c815(null,util[_0xc415('0x19')](_0xc415('0x1a'),Date[_0xc415('0x1b')](),_0x2d44d8[_0xc415('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc415('0x1d')](_0xc415('0x1e'),upload[_0xc415('0x1f')](_0xc415('0x20')),controller[_0xc415('0x21')]);router['post'](_0xc415('0xf'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xc415('0x22')]('chat',_0xc415('0x23')),controller[_0xc415('0x24')]);router[_0xc415('0x25')](_0xc415('0x26'),auth[_0xc415('0xa')](),interaction['tracked'](_0xc415('0x27'),_0xc415('0x28')),controller['update']);router[_0xc415('0x25')]('/:id/custom_update',controller['customUpdate']);router['put'](_0xc415('0x29'),auth[_0xc415('0xe')](),controller['abandon']);router[_0xc415('0x25')](_0xc415('0x2a'),controller[_0xc415('0x2b')]);router[_0xc415('0x2c')](_0xc415('0x26'),auth[_0xc415('0xa')](),interaction['tracked'](_0xc415('0x27'),_0xc415('0x2d')),controller[_0xc415('0x2e')]);router[_0xc415('0x2c')](_0xc415('0x2f'),auth[_0xc415('0xa')](),controller[_0xc415('0x30')]);module[_0xc415('0x31')]=router;
\ No newline at end of file
+var _0x0fbc=['post','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','delete','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','isAuthenticated','createVidaooSession','diskStorage','join','server/files/attachments/','format','now'];(function(_0x37835e,_0x3c2095){var _0x46e6f2=function(_0x3956ea){while(--_0x3956ea){_0x37835e['push'](_0x37835e['shift']());}};_0x46e6f2(++_0x3c2095);}(_0x0fbc,0x99));var _0xc0fb=function(_0x350360,_0x36b354){_0x350360=_0x350360-0x0;var _0x4f755c=_0x0fbc[_0x350360];return _0x4f755c;};'use strict';var multer=require(_0xc0fb('0x0'));var util=require(_0xc0fb('0x1'));var path=require('path');var timeout=require(_0xc0fb('0x2'));var express=require(_0xc0fb('0x3'));var router=express[_0xc0fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc0fb('0x5'));var interaction=require(_0xc0fb('0x6'));var config=require('../../config/environment');var controller=require(_0xc0fb('0x7'));router[_0xc0fb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc0fb('0x8')](_0xc0fb('0x9'),auth['isAuthenticated'](),controller[_0xc0fb('0xa')]);router['get'](_0xc0fb('0xb'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xd')]);router[_0xc0fb('0x8')](_0xc0fb('0xe'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xf')]);router[_0xc0fb('0x8')](_0xc0fb('0x10'),auth['isAuthenticated'](),controller[_0xc0fb('0x11')]);router[_0xc0fb('0x8')](_0xc0fb('0x12'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x13')]);router['get']('/:id/download',auth[_0xc0fb('0x14')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xc0fb('0x15')]);var upload=multer({'storage':multer[_0xc0fb('0x16')]({'destination':function(_0x4143fb,_0x236e5d,_0x71a10a){_0x71a10a(null,path[_0xc0fb('0x17')](config['root'],_0xc0fb('0x18')));},'filename':function(_0x10cc2a,_0x37fc76,_0x12b20a){_0x12b20a(null,util[_0xc0fb('0x19')]('%s-%s',Date[_0xc0fb('0x1a')](),_0x37fc76['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc0fb('0x1b')]('/:id/attachment_upload',upload[_0xc0fb('0x1c')]('file'),controller[_0xc0fb('0x1d')]);router[_0xc0fb('0x1b')](_0xc0fb('0x10'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x1e')]);router[_0xc0fb('0x1b')](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),_0xc0fb('0x22')),controller[_0xc0fb('0x23')]);router[_0xc0fb('0x24')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction['tracked'](_0xc0fb('0x21'),_0xc0fb('0x25')),controller[_0xc0fb('0x26')]);router[_0xc0fb('0x24')](_0xc0fb('0x27'),controller['customUpdate']);router['put']('/:id/abandon',auth[_0xc0fb('0xc')](),controller['abandon']);router['put'](_0xc0fb('0x28'),controller[_0xc0fb('0x29')]);router[_0xc0fb('0x2a')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),'chatinteraction:destroy'),controller[_0xc0fb('0x2b')]);router['delete'](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),controller[_0xc0fb('0x2c')]);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 263a2ce..4086d50 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 _0x6322=['sequelize','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x342fd5,_0x5dca3c){var _0x2823d5=function(_0x4c9e96){while(--_0x4c9e96){_0x342fd5['push'](_0x342fd5['shift']());}};_0x2823d5(++_0x5dca3c);}(_0x6322,0xd2));var _0x2632=function(_0x5ee50d,_0x4b6e70){_0x5ee50d=_0x5ee50d-0x0;var _0x451fd8=_0x6322[_0x5ee50d];return _0x451fd8;};'use strict';var Sequelize=require(_0x2632('0x0'));module['exports']={'body':{'type':Sequelize[_0x2632('0x1')](_0x2632('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2632('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2632('0x4')]}};
\ No newline at end of file
+var _0xbf04=['exports','TEXT','sequelize'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0xbf04,0x158));var _0x4bf0=function(_0xde1348,_0x5205b6){_0xde1348=_0xde1348-0x0;var _0x32c5e0=_0xbf04[_0xde1348];return _0x32c5e0;};'use strict';var Sequelize=require(_0x4bf0('0x0'));module[_0x4bf0('0x1')]={'body':{'type':Sequelize[_0x4bf0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ca9d146..9b5210b 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 _0x243a=['User','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','-createdAt','all','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers'];(function(_0x3dfb51,_0x142a65){var _0x3f1b03=function(_0x1f9134){while(--_0x1f9134){_0x3dfb51['push'](_0x3dfb51['shift']());}};_0x3f1b03(++_0x142a65);}(_0x243a,0x86));var _0xa243=function(_0x2b8189,_0x46de6b){_0x2b8189=_0x2b8189-0x0;var _0x96ccfa=_0x243a[_0x2b8189];return _0x96ccfa;};'use strict';var emlformat=require(_0xa243('0x0'));var rimraf=require(_0xa243('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa243('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa243('0x3'));var util=require(_0xa243('0x4'));var path=require(_0xa243('0x5'));var sox=require(_0xa243('0x6'));var csv=require(_0xa243('0x7'));var ejs=require(_0xa243('0x8'));var fs=require('fs');var fs_extra=require(_0xa243('0x9'));var _=require(_0xa243('0xa'));var squel=require(_0xa243('0xb'));var crypto=require(_0xa243('0xc'));var jsforce=require(_0xa243('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa243('0x7'));var querystring=require('querystring');var Papa=require(_0xa243('0xe'));var Redis=require('ioredis');var authService=require(_0xa243('0xf'));var qs=require(_0xa243('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa243('0x11'));var logger=require(_0xa243('0x12'))(_0xa243('0x13'));var utils=require(_0xa243('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa243('0x15'));var db=require(_0xa243('0x16'))['db'];config[_0xa243('0x17')]=_[_0xa243('0x18')](config['redis'],{'host':_0xa243('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa243('0x17')]));require('./chatInternalMessage.socket')[_0xa243('0x1a')](socket);function respondWithStatusCode(_0x58ec8a,_0x5b4643){_0x5b4643=_0x5b4643||0xcc;return function(_0x561089){if(_0x561089){return _0x58ec8a[_0xa243('0x1b')](_0x5b4643);}return _0x58ec8a['status'](_0x5b4643)[_0xa243('0x1c')]();};}function respondWithResult(_0x222cff,_0x238e3a){_0x238e3a=_0x238e3a||0xc8;return function(_0x509fa8){if(_0x509fa8){return _0x222cff[_0xa243('0x1d')](_0x238e3a)[_0xa243('0x1e')](_0x509fa8);}};}function respondWithFilteredResult(_0x54f3e5,_0x391bbc){return function(_0x397941){if(_0x397941){var _0x102eaf=typeof _0x391bbc['offset']===_0xa243('0x1f')&&typeof _0x391bbc[_0xa243('0x20')]===_0xa243('0x1f');var _0x4b778e=_0x397941[_0xa243('0x21')];var _0xadee09=_0x102eaf?0x0:_0x391bbc[_0xa243('0x22')];var _0x393b48=_0x102eaf?_0x397941['count']:_0x391bbc[_0xa243('0x22')]+_0x391bbc[_0xa243('0x20')];var _0xcc07c1;if(_0x393b48>=_0x4b778e){_0x393b48=_0x4b778e;_0xcc07c1=0xc8;}else{_0xcc07c1=0xce;}_0x54f3e5[_0xa243('0x1d')](_0xcc07c1);return _0x54f3e5[_0xa243('0x23')](_0xa243('0x24'),_0xadee09+'-'+_0x393b48+'/'+_0x4b778e)['json'](_0x397941);}return null;};}function patchUpdates(_0x427de1){return function(_0x44de51){try{jsonpatch['apply'](_0x44de51,_0x427de1,!![]);}catch(_0x5b848b){return BPromise['reject'](_0x5b848b);}return _0x44de51[_0xa243('0x25')]();};}function saveUpdates(_0x33fbdb,_0x53ce45){return function(_0x2b81e3){if(_0x2b81e3){return _0x2b81e3['update'](_0x33fbdb)['then'](function(_0x189e57){return _0x189e57;});}return null;};}function removeEntity(_0x2e00c5,_0x302171){return function(_0x51df04){if(_0x51df04){return _0x51df04[_0xa243('0x26')]()['then'](function(){_0x2e00c5[_0xa243('0x1d')](0xcc)[_0xa243('0x1c')]();});}};}function handleEntityNotFound(_0x1b19b3,_0x341204){return function(_0x42c67e){if(!_0x42c67e){_0x1b19b3[_0xa243('0x1b')](0x194);}return _0x42c67e;};}function handleError(_0x16f6d0,_0x265d06){_0x265d06=_0x265d06||0x1f4;return function(_0x146fe7){logger[_0xa243('0x27')](_0x146fe7[_0xa243('0x28')]);if(_0x146fe7[_0xa243('0x29')]){delete _0x146fe7[_0xa243('0x29')];}_0x16f6d0['status'](_0x265d06)[_0xa243('0x2a')](_0x146fe7);};}exports['index']=function(_0x49a25f,_0x24af7d){var _0x531188={},_0x332ce9={},_0x1eefb3={'count':0x0,'rows':[]};var _0x231372=_['map'](db[_0xa243('0x2b')][_0xa243('0x2c')],function(_0x299c8d){return{'name':_0x299c8d[_0xa243('0x2d')],'type':_0x299c8d[_0xa243('0x2e')]['key']};});_0x332ce9[_0xa243('0x2f')]=_['map'](_0x231372,_0xa243('0x29'));_0x332ce9[_0xa243('0x30')]=_['keys'](_0x49a25f['query']);_0x332ce9['filters']=_[_0xa243('0x31')](_0x332ce9[_0xa243('0x2f')],_0x332ce9['query']);_0x531188[_0xa243('0x32')]=_[_0xa243('0x31')](_0x332ce9['model'],qs[_0xa243('0x33')](_0x49a25f[_0xa243('0x30')][_0xa243('0x33')]));_0x531188[_0xa243('0x32')]=_0x531188[_0xa243('0x32')][_0xa243('0x34')]?_0x531188[_0xa243('0x32')]:_0x332ce9[_0xa243('0x2f')];if(!_0x49a25f[_0xa243('0x30')][_0xa243('0x35')](_0xa243('0x36'))){_0x531188[_0xa243('0x20')]=qs[_0xa243('0x20')](_0x49a25f[_0xa243('0x30')][_0xa243('0x20')]);_0x531188['offset']=qs[_0xa243('0x22')](_0x49a25f[_0xa243('0x30')][_0xa243('0x22')]);}_0x531188[_0xa243('0x37')]=qs[_0xa243('0x38')](_0x49a25f[_0xa243('0x30')][_0xa243('0x38')]);_0x531188[_0xa243('0x39')]=qs[_0xa243('0x3a')](_[_0xa243('0x3b')](_0x49a25f[_0xa243('0x30')],_0x332ce9['filters']),_0x231372);if(_0x49a25f[_0xa243('0x30')][_0xa243('0x3c')]){_0x531188['where']=_['merge'](_0x531188[_0xa243('0x39')],{'$or':_['map'](_0x231372,function(_0x10a955){if(_0x10a955[_0xa243('0x2e')]!==_0xa243('0x3d')){var _0x1d1e35={};_0x1d1e35[_0x10a955[_0xa243('0x29')]]={'$like':'%'+_0x49a25f[_0xa243('0x30')][_0xa243('0x3c')]+'%'};return _0x1d1e35;}})});}_0x531188=_[_0xa243('0x3e')]({},_0x531188,_0x49a25f[_0xa243('0x3f')]);var _0x182533={'where':_0x531188[_0xa243('0x39')]};return db[_0xa243('0x2b')][_0xa243('0x21')](_0x182533)[_0xa243('0x40')](function(_0xa40510){_0x1eefb3['count']=_0xa40510;if(_0x49a25f[_0xa243('0x30')][_0xa243('0x41')]){_0x531188[_0xa243('0x42')]=[{'all':!![]}];}return db[_0xa243('0x2b')][_0xa243('0x43')](_0x531188);})[_0xa243('0x40')](function(_0x4244b0){_0x1eefb3[_0xa243('0x44')]=_0x4244b0;return _0x1eefb3;})[_0xa243('0x40')](respondWithFilteredResult(_0x24af7d,_0x531188))[_0xa243('0x45')](handleError(_0x24af7d,null));};exports[_0xa243('0x46')]=function(_0xdbb082,_0x215fc6){var _0x45bcd9={'raw':!![],'where':{'id':_0xdbb082['params']['id']}},_0xecef31={};_0xecef31[_0xa243('0x2f')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0xecef31[_0xa243('0x30')]=_[_0xa243('0x47')](_0xdbb082[_0xa243('0x30')]);_0xecef31['filters']=_[_0xa243('0x31')](_0xecef31[_0xa243('0x2f')],_0xecef31[_0xa243('0x30')]);_0x45bcd9['attributes']=_[_0xa243('0x31')](_0xecef31[_0xa243('0x2f')],qs[_0xa243('0x33')](_0xdbb082['query'][_0xa243('0x33')]));_0x45bcd9['attributes']=_0x45bcd9[_0xa243('0x32')][_0xa243('0x34')]?_0x45bcd9[_0xa243('0x32')]:_0xecef31[_0xa243('0x2f')];if(_0xdbb082[_0xa243('0x30')][_0xa243('0x41')]){_0x45bcd9[_0xa243('0x42')]=[{'all':!![]}];}_0x45bcd9=_[_0xa243('0x3e')]({},_0x45bcd9,_0xdbb082[_0xa243('0x3f')]);return db[_0xa243('0x2b')][_0xa243('0x48')](_0x45bcd9)['then'](handleEntityNotFound(_0x215fc6,null))['then'](respondWithResult(_0x215fc6,null))['catch'](handleError(_0x215fc6,null));};exports['create']=function(_0x48dfb1,_0x524839){return db['ChatInternalMessage'][_0xa243('0x49')](_0x48dfb1[_0xa243('0x4a')],{})[_0xa243('0x40')](respondWithResult(_0x524839,0xc9))[_0xa243('0x45')](handleError(_0x524839,null));};exports[_0xa243('0x4b')]=function(_0x1a57d0,_0x1f51a7){if(_0x1a57d0[_0xa243('0x4a')]['id']){delete _0x1a57d0[_0xa243('0x4a')]['id'];}return db[_0xa243('0x2b')][_0xa243('0x48')]({'where':{'id':_0x1a57d0[_0xa243('0x4c')]['id']}})[_0xa243('0x40')](handleEntityNotFound(_0x1f51a7,null))[_0xa243('0x40')](saveUpdates(_0x1a57d0[_0xa243('0x4a')],null))['then'](respondWithResult(_0x1f51a7,null))[_0xa243('0x45')](handleError(_0x1f51a7,null));};exports[_0xa243('0x26')]=function(_0x16b4cf,_0x287d8f){return db['ChatInternalMessage'][_0xa243('0x48')]({'where':{'id':_0x16b4cf[_0xa243('0x4c')]['id']}})[_0xa243('0x40')](handleEntityNotFound(_0x287d8f,null))[_0xa243('0x40')](removeEntity(_0x287d8f,null))['catch'](handleError(_0x287d8f,null));};exports[_0xa243('0x4d')]=function(_0x51c4f0,_0x5d2497){return db[_0xa243('0x2b')][_0xa243('0x4d')]()[_0xa243('0x40')](respondWithResult(_0x5d2497,null))[_0xa243('0x45')](handleError(_0x5d2497,null));};function wrapUser(_0x59a456){return function(_0x133d25){var _0x55f713=_0x59a456[_0xa243('0x4e')]({'plain':!![]});_0x55f713[_0xa243('0x4f')]=[];if(_0x133d25){_0x55f713[_0xa243('0x50')]=_0x133d25[_0xa243('0x51')];_0x55f713[_0xa243('0x52')]=_0x133d25;}else{_0x55f713['lastMessageAt']=moment(0x0)[_0xa243('0x53')](_0xa243('0x54'));_0x55f713[_0xa243('0x52')]={};}return _0x55f713;};}exports[_0xa243('0x55')]=function(_0x158741,_0x416e34,_0x3f909c){var _0x477fec=[];return db[_0xa243('0x56')][_0xa243('0x43')]({'where':{'role':['agent','admin',_0xa243('0x57')]},'attributes':['id',_0xa243('0x58'),_0xa243('0x29'),_0xa243('0x59'),_0xa243('0x5a'),_0xa243('0x5b'),_0xa243('0x5c'),'lastLoginAt',_0xa243('0x5d'),_0xa243('0x5e')],'order':qs[_0xa243('0x38')](_0xa243('0x5f')),'include':[{'model':db[_0xa243('0x60')],'as':_0xa243('0x61'),'attributes':['id',_0xa243('0x29'),_0xa243('0x2e')],'through':{'attributes':[]}}]})[_0xa243('0x40')](function(_0x4b8301){if(_0x4b8301){var _0x33330f=_0x158741[_0xa243('0x57')]['get']({'plain':!![]});if(!_0x33330f)throw new Error(_0xa243('0x62'));if(_0x33330f[_0xa243('0x59')]===_0xa243('0x57')){return db[_0xa243('0x63')][_0xa243('0x48')]({'where':{'name':_0xa243('0x64'),'userProfileId':_0x33330f[_0xa243('0x65')]},'raw':!![]})['then'](function(_0x5980ca){if(_0x5980ca){if(_0x5980ca[_0xa243('0x66')]===0x0){return db[_0xa243('0x67')][_0xa243('0x43')]({'where':{'sectionId':_0x5980ca['id']},'raw':!![]})[_0xa243('0x40')](function(_0x22f227){var _0x1505a4=[];if(_[_0xa243('0x68')](_0x22f227)){_0x1505a4=_[_0xa243('0x3c')](_0x4b8301,function(_0x1ae142){if(_0x1ae142['role']!==_0xa243('0x69')){return _0x1ae142;}});return _0x1505a4;}else{for(var _0x161518=0x0;_0x161518<_0x4b8301[_0xa243('0x34')];_0x161518++){var _0x1f7c79=_0x4b8301[_0x161518];if(_0x1f7c79[_0xa243('0x59')]===_0xa243('0x69')){var _0x334b55=_['find'](_0x22f227,function(_0x4b1242){return _0x4b1242[_0xa243('0x6a')]===_0x1f7c79['id'];});if(_0x334b55)_0x1505a4[_0xa243('0x6b')](_0x1f7c79);}else{_0x1505a4['push'](_0x1f7c79);}}return _0x1505a4;}});}else{return _0x4b8301;}}else{var _0x1282e1=_[_0xa243('0x3c')](_0x4b8301,function(_0x423d59){if(_0x423d59['role']!==_0xa243('0x69')){return _0x423d59;}});return _0x1282e1;}});}else{return _0x4b8301;}}})['then'](function(_0x254c52){var _0x409759=[];if(_0x254c52){_0x477fec=_0x254c52;for(var _0x46349f=0x0;_0x46349f<_0x254c52[_0xa243('0x34')];_0x46349f+=0x1){_0x477fec[_0x46349f][_0xa243('0x4f')]=[];_0x409759[_0xa243('0x6b')](db[_0xa243('0x2b')][_0xa243('0x48')]({'where':{'FromId':[_0x158741['user']['id'],_0x254c52[_0x46349f]['id']],'ToId':[_0x158741[_0xa243('0x57')]['id'],_0x254c52[_0x46349f]['id']],'ChatGroupId':null},'attributes':['id',_0xa243('0x51'),'FromId','ToId','read',_0xa243('0x4a')],'order':qs[_0xa243('0x38')](_0xa243('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa243('0x40')](wrapUser(_0x254c52[_0x46349f])));}return BPromise[_0xa243('0x6d')](_0x409759);}return[];})['then'](function(_0x4cbf9b){return{'rows':_0x4cbf9b,'count':_0x4cbf9b['length']};})[_0xa243('0x40')](respondWithResult(_0x416e34,null))[_0xa243('0x45')](handleError(_0x416e34,null));};
\ No newline at end of file
+var _0x76ce=['push','createdAt','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','catch','show','fields','includeAll','include','merge','create','body','find','params','describe','messages','lastMessageAt','lastMessage','format','getUsers','User','findAll','agent','admin','user','role','userpic','internal','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','get','UserProfileSection','autoAssociation','isEmpty','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76ce,0x6d));var _0xe76c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x76ce[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xe76c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe76c('0x1'));var jsonpatch=require(_0xe76c('0x2'));var rp=require('request-promise');var moment=require(_0xe76c('0x3'));var BPromise=require(_0xe76c('0x4'));var Mustache=require(_0xe76c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe76c('0x6'));var csv=require(_0xe76c('0x7'));var ejs=require(_0xe76c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe76c('0x9'));var crypto=require(_0xe76c('0xa'));var jsforce=require(_0xe76c('0xb'));var deskjs=require(_0xe76c('0xc'));var toCsv=require(_0xe76c('0x7'));var querystring=require(_0xe76c('0xd'));var Papa=require(_0xe76c('0xe'));var Redis=require(_0xe76c('0xf'));var authService=require(_0xe76c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe76c('0x11'))(_0xe76c('0x12'));var utils=require(_0xe76c('0x13'));var config=require(_0xe76c('0x14'));var licenseUtil=require(_0xe76c('0x15'));var db=require(_0xe76c('0x16'))['db'];config['redis']=_['defaults'](config[_0xe76c('0x17')],{'host':_0xe76c('0x18'),'port':0x18eb});var socket=require(_0xe76c('0x19'))(new Redis(config['redis']));require(_0xe76c('0x1a'))[_0xe76c('0x1b')](socket);function respondWithStatusCode(_0x4ef71c,_0x3f8e3f){_0x3f8e3f=_0x3f8e3f||0xcc;return function(_0x47b2da){if(_0x47b2da){return _0x4ef71c[_0xe76c('0x1c')](_0x3f8e3f);}return _0x4ef71c['status'](_0x3f8e3f)[_0xe76c('0x1d')]();};}function respondWithResult(_0x5f0b99,_0x24bbad){_0x24bbad=_0x24bbad||0xc8;return function(_0x2519f3){if(_0x2519f3){return _0x5f0b99[_0xe76c('0x1e')](_0x24bbad)['json'](_0x2519f3);}};}function respondWithFilteredResult(_0x25b6ef,_0x4ba9fe){return function(_0x5a0bd8){if(_0x5a0bd8){var _0x128ad7=typeof _0x4ba9fe[_0xe76c('0x1f')]===_0xe76c('0x20')&&typeof _0x4ba9fe[_0xe76c('0x21')]===_0xe76c('0x20');var _0x4d2dcb=_0x5a0bd8[_0xe76c('0x22')];var _0xc6c9f8=_0x128ad7?0x0:_0x4ba9fe[_0xe76c('0x1f')];var _0x4f5094=_0x128ad7?_0x5a0bd8[_0xe76c('0x22')]:_0x4ba9fe[_0xe76c('0x1f')]+_0x4ba9fe[_0xe76c('0x21')];var _0x405b2e;if(_0x4f5094>=_0x4d2dcb){_0x4f5094=_0x4d2dcb;_0x405b2e=0xc8;}else{_0x405b2e=0xce;}_0x25b6ef[_0xe76c('0x1e')](_0x405b2e);return _0x25b6ef['set'](_0xe76c('0x23'),_0xc6c9f8+'-'+_0x4f5094+'/'+_0x4d2dcb)[_0xe76c('0x24')](_0x5a0bd8);}return null;};}function patchUpdates(_0x4cadd2){return function(_0x3982c4){try{jsonpatch[_0xe76c('0x25')](_0x3982c4,_0x4cadd2,!![]);}catch(_0x4b24a1){return BPromise[_0xe76c('0x26')](_0x4b24a1);}return _0x3982c4['save']();};}function saveUpdates(_0x5e478c,_0x4e033c){return function(_0x36eb07){if(_0x36eb07){return _0x36eb07[_0xe76c('0x27')](_0x5e478c)[_0xe76c('0x28')](function(_0x29ee32){return _0x29ee32;});}return null;};}function removeEntity(_0x4994f6,_0x26aa6d){return function(_0x15f63a){if(_0x15f63a){return _0x15f63a[_0xe76c('0x29')]()[_0xe76c('0x28')](function(){_0x4994f6[_0xe76c('0x1e')](0xcc)[_0xe76c('0x1d')]();});}};}function handleEntityNotFound(_0xa2bc4f,_0x52605e){return function(_0x1905d1){if(!_0x1905d1){_0xa2bc4f['sendStatus'](0x194);}return _0x1905d1;};}function handleError(_0x54d736,_0x377638){_0x377638=_0x377638||0x1f4;return function(_0x29809d){logger[_0xe76c('0x2a')](_0x29809d[_0xe76c('0x2b')]);if(_0x29809d[_0xe76c('0x2c')]){delete _0x29809d[_0xe76c('0x2c')];}_0x54d736[_0xe76c('0x1e')](_0x377638)[_0xe76c('0x2d')](_0x29809d);};}exports['index']=function(_0x8a5b1c,_0x1c5aa7){var _0x3c1929={},_0x179f9d={},_0x4657cf={'count':0x0,'rows':[]};var _0x4af313=_[_0xe76c('0x2e')](db[_0xe76c('0x2f')]['rawAttributes'],function(_0x24c03b){return{'name':_0x24c03b[_0xe76c('0x30')],'type':_0x24c03b[_0xe76c('0x31')]['key']};});_0x179f9d[_0xe76c('0x32')]=_['map'](_0x4af313,'name');_0x179f9d['query']=_[_0xe76c('0x33')](_0x8a5b1c[_0xe76c('0x34')]);_0x179f9d[_0xe76c('0x35')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],_0x179f9d[_0xe76c('0x34')]);_0x3c1929[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],qs['fields'](_0x8a5b1c[_0xe76c('0x34')]['fields']));_0x3c1929[_0xe76c('0x37')]=_0x3c1929[_0xe76c('0x37')]['length']?_0x3c1929[_0xe76c('0x37')]:_0x179f9d[_0xe76c('0x32')];if(!_0x8a5b1c['query'][_0xe76c('0x38')](_0xe76c('0x39'))){_0x3c1929[_0xe76c('0x21')]=qs[_0xe76c('0x21')](_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x21')]);_0x3c1929[_0xe76c('0x1f')]=qs['offset'](_0x8a5b1c[_0xe76c('0x34')]['offset']);}_0x3c1929['order']=qs[_0xe76c('0x3a')](_0x8a5b1c['query']['sort']);_0x3c1929[_0xe76c('0x3b')]=qs['filters'](_[_0xe76c('0x3c')](_0x8a5b1c[_0xe76c('0x34')],_0x179f9d[_0xe76c('0x35')]),_0x4af313);if(_0x8a5b1c[_0xe76c('0x34')]['filter']){_0x3c1929[_0xe76c('0x3b')]=_['merge'](_0x3c1929[_0xe76c('0x3b')],{'$or':_[_0xe76c('0x2e')](_0x4af313,function(_0x32cf0a){if(_0x32cf0a['type']!==_0xe76c('0x3d')){var _0x26c98d={};_0x26c98d[_0x32cf0a[_0xe76c('0x2c')]]={'$like':'%'+_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x3e')]+'%'};return _0x26c98d;}})});}_0x3c1929=_['merge']({},_0x3c1929,_0x8a5b1c[_0xe76c('0x3f')]);var _0x451ffc={'where':_0x3c1929[_0xe76c('0x3b')]};return db['ChatInternalMessage'][_0xe76c('0x22')](_0x451ffc)[_0xe76c('0x28')](function(_0x2cbf28){_0x4657cf[_0xe76c('0x22')]=_0x2cbf28;if(_0x8a5b1c[_0xe76c('0x34')]['includeAll']){_0x3c1929['include']=[{'all':!![]}];}return db[_0xe76c('0x2f')]['findAll'](_0x3c1929);})[_0xe76c('0x28')](function(_0x5f4e12){_0x4657cf['rows']=_0x5f4e12;return _0x4657cf;})[_0xe76c('0x28')](respondWithFilteredResult(_0x1c5aa7,_0x3c1929))[_0xe76c('0x40')](handleError(_0x1c5aa7,null));};exports[_0xe76c('0x41')]=function(_0x5a254d,_0x31128a){var _0x313115={'raw':!![],'where':{'id':_0x5a254d['params']['id']}},_0x50739a={};_0x50739a[_0xe76c('0x32')]=_['keys'](db[_0xe76c('0x2f')]['rawAttributes']);_0x50739a['query']=_[_0xe76c('0x33')](_0x5a254d[_0xe76c('0x34')]);_0x50739a[_0xe76c('0x35')]=_['intersection'](_0x50739a[_0xe76c('0x32')],_0x50739a[_0xe76c('0x34')]);_0x313115[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x50739a[_0xe76c('0x32')],qs['fields'](_0x5a254d[_0xe76c('0x34')][_0xe76c('0x42')]));_0x313115[_0xe76c('0x37')]=_0x313115[_0xe76c('0x37')]['length']?_0x313115[_0xe76c('0x37')]:_0x50739a[_0xe76c('0x32')];if(_0x5a254d[_0xe76c('0x34')][_0xe76c('0x43')]){_0x313115[_0xe76c('0x44')]=[{'all':!![]}];}_0x313115=_[_0xe76c('0x45')]({},_0x313115,_0x5a254d[_0xe76c('0x3f')]);return db[_0xe76c('0x2f')]['find'](_0x313115)[_0xe76c('0x28')](handleEntityNotFound(_0x31128a,null))[_0xe76c('0x28')](respondWithResult(_0x31128a,null))[_0xe76c('0x40')](handleError(_0x31128a,null));};exports[_0xe76c('0x46')]=function(_0x5f46a0,_0x504daf){return db[_0xe76c('0x2f')][_0xe76c('0x46')](_0x5f46a0['body'],{})[_0xe76c('0x28')](respondWithResult(_0x504daf,0xc9))['catch'](handleError(_0x504daf,null));};exports[_0xe76c('0x27')]=function(_0xdd704f,_0xea772){if(_0xdd704f[_0xe76c('0x47')]['id']){delete _0xdd704f[_0xe76c('0x47')]['id'];}return db['ChatInternalMessage'][_0xe76c('0x48')]({'where':{'id':_0xdd704f[_0xe76c('0x49')]['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0xea772,null))['then'](saveUpdates(_0xdd704f[_0xe76c('0x47')],null))['then'](respondWithResult(_0xea772,null))[_0xe76c('0x40')](handleError(_0xea772,null));};exports[_0xe76c('0x29')]=function(_0x5daee7,_0x3be4ea){return db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'id':_0x5daee7['params']['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0x3be4ea,null))[_0xe76c('0x28')](removeEntity(_0x3be4ea,null))[_0xe76c('0x40')](handleError(_0x3be4ea,null));};exports[_0xe76c('0x4a')]=function(_0x26f5ca,_0x219af1){return db[_0xe76c('0x2f')]['describe']()[_0xe76c('0x28')](respondWithResult(_0x219af1,null))['catch'](handleError(_0x219af1,null));};function wrapUser(_0x30060e){return function(_0x2f2f77){var _0x334204=_0x30060e['get']({'plain':!![]});_0x334204[_0xe76c('0x4b')]=[];if(_0x2f2f77){_0x334204[_0xe76c('0x4c')]=_0x2f2f77['createdAt'];_0x334204[_0xe76c('0x4d')]=_0x2f2f77;}else{_0x334204[_0xe76c('0x4c')]=moment(0x0)[_0xe76c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x334204[_0xe76c('0x4d')]={};}return _0x334204;};}exports[_0xe76c('0x4f')]=function(_0x18953c,_0x296bed,_0x51f9aa){var _0x98fb02=[];return db[_0xe76c('0x50')][_0xe76c('0x51')]({'where':{'role':[_0xe76c('0x52'),_0xe76c('0x53'),_0xe76c('0x54')]},'attributes':['id','fullname',_0xe76c('0x2c'),_0xe76c('0x55'),_0xe76c('0x56'),_0xe76c('0x57'),'online',_0xe76c('0x58'),_0xe76c('0x59'),'showWebBar'],'order':qs[_0xe76c('0x3a')]('-online'),'include':[{'model':db[_0xe76c('0x5a')],'as':_0xe76c('0x5b'),'attributes':['id',_0xe76c('0x2c'),_0xe76c('0x31')],'through':{'attributes':[]}}]})[_0xe76c('0x28')](function(_0x1698b3){if(_0x1698b3){var _0x449d61=_0x18953c[_0xe76c('0x54')][_0xe76c('0x5c')]({'plain':!![]});if(!_0x449d61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x449d61['role']===_0xe76c('0x54')){return db[_0xe76c('0x5d')][_0xe76c('0x48')]({'where':{'name':'Agents','userProfileId':_0x449d61['userProfileId']},'raw':!![]})[_0xe76c('0x28')](function(_0x1c534f){if(_0x1c534f){if(_0x1c534f[_0xe76c('0x5e')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1c534f['id']},'raw':!![]})[_0xe76c('0x28')](function(_0x4238d4){var _0x31cc28=[];if(_[_0xe76c('0x5f')](_0x4238d4)){_0x31cc28=_[_0xe76c('0x3e')](_0x1698b3,function(_0x3ca00d){if(_0x3ca00d[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x3ca00d;}});return _0x31cc28;}else{for(var _0x1b29a5=0x0;_0x1b29a5<_0x1698b3[_0xe76c('0x60')];_0x1b29a5++){var _0xaa41ba=_0x1698b3[_0x1b29a5];if(_0xaa41ba[_0xe76c('0x55')]===_0xe76c('0x52')){var _0x1cc837=_[_0xe76c('0x48')](_0x4238d4,function(_0x1dac22){return _0x1dac22['resourceId']===_0xaa41ba['id'];});if(_0x1cc837)_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}else{_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}}return _0x31cc28;}});}else{return _0x1698b3;}}else{var _0x11825c=_[_0xe76c('0x3e')](_0x1698b3,function(_0x2f52f6){if(_0x2f52f6[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x2f52f6;}});return _0x11825c;}});}else{return _0x1698b3;}}})[_0xe76c('0x28')](function(_0x17bd49){var _0x50fd55=[];if(_0x17bd49){_0x98fb02=_0x17bd49;for(var _0x139a9c=0x0;_0x139a9c<_0x17bd49[_0xe76c('0x60')];_0x139a9c+=0x1){_0x98fb02[_0x139a9c][_0xe76c('0x4b')]=[];_0x50fd55[_0xe76c('0x61')](db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'FromId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ToId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ChatGroupId':null},'attributes':['id',_0xe76c('0x62'),'FromId',_0xe76c('0x63'),_0xe76c('0x64'),'body'],'order':qs['sort'](_0xe76c('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe76c('0x28')](wrapUser(_0x17bd49[_0x139a9c])));}return BPromise[_0xe76c('0x66')](_0x50fd55);}return[];})[_0xe76c('0x28')](function(_0xa4de4d){return{'rows':_0xa4de4d,'count':_0xa4de4d[_0xe76c('0x60')]};})['then'](respondWithResult(_0x296bed,null))['catch'](handleError(_0x296bed,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b509b5a..4750aeb 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 _0x71f0=['update','emit','hook','../../mysqldb','save'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x71f0,0x1b6));var _0x071f=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0x71f0[_0x1a30c7];return _0x3be1e6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x071f('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x071f('0x1'),'afterUpdate':_0x071f('0x2'),'afterDestroy':'remove'};function emitEvent(_0xf4677){return function(_0x2628a0,_0x548da0,_0x2aea5c){ChatInternalMessageEvents[_0x071f('0x3')](_0xf4677+':'+_0x2628a0['id'],_0x2628a0);ChatInternalMessageEvents['emit'](_0xf4677,_0x2628a0);_0x2aea5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x071f('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6356=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4c983b,_0x16d315){var _0x3d0ff0=function(_0x3939ef){while(--_0x3939ef){_0x4c983b['push'](_0x4c983b['shift']());}};_0x3d0ff0(++_0x16d315);}(_0x6356,0xc7));var _0x6635=function(_0x207114,_0x25902e){_0x207114=_0x207114-0x0;var _0x14d3b4=_0x6356[_0x207114];return _0x14d3b4;};'use strict';var EventEmitter=require(_0x6635('0x0'));var ChatInternalMessage=require(_0x6635('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6635('0x2')](0x0);var events={'afterCreate':_0x6635('0x3'),'afterUpdate':_0x6635('0x4'),'afterDestroy':_0x6635('0x5')};function emitEvent(_0x42bf57){return function(_0x521df7,_0x684e9a,_0x44e99e){ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57+':'+_0x521df7['id'],_0x521df7);ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57,_0x521df7);_0x44e99e(null);};}for(var e in events){if(events[_0x6635('0x7')](e)){var event=events[e];ChatInternalMessage[_0x6635('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index f61c028..d2c8d55 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 _0x0377=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','lodash','util','api'];(function(_0x2e7ad7,_0x2972b4){var _0x5c92c7=function(_0x4b5780){while(--_0x4b5780){_0x2e7ad7['push'](_0x2e7ad7['shift']());}};_0x5c92c7(++_0x2972b4);}(_0x0377,0x165));var _0x7037=function(_0x4555b4,_0x4520df){_0x4555b4=_0x4555b4-0x0;var _0x46821c=_0x0377[_0x4555b4];return _0x46821c;};'use strict';var _=require(_0x7037('0x0'));var util=require(_0x7037('0x1'));var logger=require('../../config/logger')(_0x7037('0x2'));var moment=require(_0x7037('0x3'));var BPromise=require(_0x7037('0x4'));var rp=require(_0x7037('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7037('0x6'));var config=require(_0x7037('0x7'));var attributes=require(_0x7037('0x8'));module['exports']=function(_0x59829b,_0x53c7f0){return _0x59829b[_0x7037('0x9')](_0x7037('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7037('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd94e=['request-promise','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0xd94e,0xc8));var _0xed94=function(_0x35559,_0x36ab81){_0x35559=_0x35559-0x0;var _0x368237=_0xd94e[_0x35559];return _0x368237;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed94('0x0'))(_0xed94('0x1'));var moment=require(_0xed94('0x2'));var BPromise=require(_0xed94('0x3'));var rp=require(_0xed94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed94('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xed94('0x6')]=function(_0xa776a3,_0x2740ca){return _0xa776a3[_0xed94('0x7')](_0xed94('0x8'),attributes,{'tableName':_0xed94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed94('0xa'),'collate':_0xed94('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1f2a061..6853b90 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 _0xf149=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x2d446c,_0x5db1e7){var _0x173652=function(_0x38e6b5){while(--_0x38e6b5){_0x2d446c['push'](_0x2d446c['shift']());}};_0x173652(++_0x5db1e7);}(_0xf149,0xda));var _0x9f14=function(_0x256d97,_0x17b56d){_0x256d97=_0x256d97-0x0;var _0x487ee1=_0xf149[_0x256d97];return _0x487ee1;};'use strict';var _=require(_0x9f14('0x0'));var util=require(_0x9f14('0x1'));var moment=require(_0x9f14('0x2'));var BPromise=require(_0x9f14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f14('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f14('0x5'))(_0x9f14('0x6'));var config=require(_0x9f14('0x7'));var jayson=require(_0x9f14('0x8'));var client=jayson[_0x9f14('0x9')][_0x9f14('0xa')]({'port':0x232a});config[_0x9f14('0xb')]=_[_0x9f14('0xc')](config[_0x9f14('0xb')],{'host':_0x9f14('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f14('0xb')]));require('./chatInternalMessage.socket')[_0x9f14('0xe')](socket);function respondWithRpcPromise(_0x447676,_0x316a29,_0x3a6738){return new BPromise(function(_0x2e1730,_0x5d46d7){return client[_0x9f14('0xf')](_0x447676,_0x3a6738)[_0x9f14('0x10')](function(_0x3b3921){logger[_0x9f14('0x11')](_0x9f14('0x12'),_0x316a29,_0x9f14('0x13'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x316a29,_0x9f14('0x13'),JSON[_0x9f14('0x14')](_0x3b3921));if(_0x3b3921[_0x9f14('0x15')]){if(_0x3b3921['error'][_0x9f14('0x16')]===0x1f4){logger[_0x9f14('0x15')](_0x9f14('0x12'),_0x316a29,_0x3b3921[_0x9f14('0x15')]['message']);return _0x5d46d7(_0x3b3921[_0x9f14('0x15')][_0x9f14('0x17')]);}logger[_0x9f14('0x15')](_0x9f14('0x12'),_0x316a29,_0x3b3921[_0x9f14('0x15')]['message']);return _0x2e1730(_0x3b3921[_0x9f14('0x15')]['message']);}else{logger[_0x9f14('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x316a29,'request\x20sent');_0x2e1730(_0x3b3921[_0x9f14('0x18')][_0x9f14('0x17')]);}})['catch'](function(_0x1eabfc){logger[_0x9f14('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x316a29,_0x1eabfc);_0x5d46d7(_0x1eabfc);});});}
\ No newline at end of file
+var _0x83ea=['http','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x5ace3b,_0x5aeac0){var _0x762c23=function(_0x4b66a3){while(--_0x4b66a3){_0x5ace3b['push'](_0x5ace3b['shift']());}};_0x762c23(++_0x5aeac0);}(_0x83ea,0x158));var _0xa83e=function(_0x327bc7,_0x10fcc5){_0x327bc7=_0x327bc7-0x0;var _0x47e71f=_0x83ea[_0x327bc7];return _0x47e71f;};'use strict';var _=require(_0xa83e('0x0'));var util=require(_0xa83e('0x1'));var moment=require('moment');var BPromise=require(_0xa83e('0x2'));var rs=require(_0xa83e('0x3'));var fs=require('fs');var Redis=require(_0xa83e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa83e('0x5'));var logger=require('../../config/logger')(_0xa83e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa83e('0x7')][_0xa83e('0x8')]({'port':0x232a});config[_0xa83e('0x9')]=_['defaults'](config[_0xa83e('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa83e('0x9')]));require(_0xa83e('0xa'))[_0xa83e('0xb')](socket);function respondWithRpcPromise(_0x2b59a1,_0x1b3ae2,_0x47ab2b){return new BPromise(function(_0x2a19a5,_0xea8495){return client[_0xa83e('0xc')](_0x2b59a1,_0x47ab2b)[_0xa83e('0xd')](function(_0x42dfd6){logger['info'](_0xa83e('0xe'),_0x1b3ae2,_0xa83e('0xf'));logger[_0xa83e('0x10')](_0xa83e('0x11'),_0x1b3ae2,'request\x20sent',JSON[_0xa83e('0x12')](_0x42dfd6));if(_0x42dfd6[_0xa83e('0x13')]){if(_0x42dfd6[_0xa83e('0x13')]['code']===0x1f4){logger['error'](_0xa83e('0xe'),_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')]['message']);return _0xea8495(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);return _0x2a19a5(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0xa83e('0xf'));_0x2a19a5(_0x42dfd6['result'][_0xa83e('0x14')]);}})[_0xa83e('0x15')](function(_0x1c7b7f){logger[_0xa83e('0x13')](_0xa83e('0xe'),_0x1b3ae2,_0x1c7b7f);_0xea8495(_0x1c7b7f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 53a30a3..05dcd0c 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 _0x2283=['remove','update','removeListener','register','./chatInternalMessage.events','save'];(function(_0x1f8f66,_0x5dc25a){var _0x3b992d=function(_0x25dadb){while(--_0x25dadb){_0x1f8f66['push'](_0x1f8f66['shift']());}};_0x3b992d(++_0x5dc25a);}(_0x2283,0x1e4));var _0x3228=function(_0x12cf6c,_0xa7928c){_0x12cf6c=_0x12cf6c-0x0;var _0x4431e2=_0x2283[_0x12cf6c];return _0x4431e2;};'use strict';var ChatInternalMessageEvents=require(_0x3228('0x0'));var events=[_0x3228('0x1'),_0x3228('0x2'),_0x3228('0x3')];function createListener(_0x1a055a,_0x49861f){return function(_0xbfd5f4){_0x49861f['emit'](_0x1a055a,_0xbfd5f4);};}function removeListener(_0x133d85,_0x1d8a23){return function(){ChatInternalMessageEvents[_0x3228('0x4')](_0x133d85,_0x1d8a23);};}exports[_0x3228('0x5')]=function(_0x59b525){for(var _0x2a4a0c=0x0,_0x49ef03=events['length'];_0x2a4a0c<_0x49ef03;_0x2a4a0c++){var _0x5c4c5b=events[_0x2a4a0c];var _0x498a51=createListener('chatInternalMessage:'+_0x5c4c5b,_0x59b525);ChatInternalMessageEvents['on'](_0x5c4c5b,_0x498a51);}};
\ No newline at end of file
+var _0x849e=['./chatInternalMessage.events','save','remove','update','length','chatInternalMessage:'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x849e,0xb4));var _0xe849=function(_0x374cbc,_0x37460){_0x374cbc=_0x374cbc-0x0;var _0x45e20b=_0x849e[_0x374cbc];return _0x45e20b;};'use strict';var ChatInternalMessageEvents=require(_0xe849('0x0'));var events=[_0xe849('0x1'),_0xe849('0x2'),_0xe849('0x3')];function createListener(_0x6ce360,_0x1aed09){return function(_0x41f4e4){_0x1aed09['emit'](_0x6ce360,_0x41f4e4);};}function removeListener(_0x5bac9a,_0x5c87ce){return function(){ChatInternalMessageEvents['removeListener'](_0x5bac9a,_0x5c87ce);};}exports['register']=function(_0x3e4ec1){for(var _0x1a5757=0x0,_0x519c27=events[_0xe849('0x4')];_0x1a5757<_0x519c27;_0x1a5757++){var _0x562d16=events[_0x1a5757];var _0x3020ef=createListener(_0xe849('0x5')+_0x562d16,_0x3e4ec1);ChatInternalMessageEvents['on'](_0x562d16,_0x3020ef);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 62bc4ca..44394e1 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 _0x4f79=['create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4f79,0x1d2));var _0x94f7=function(_0x298e9f,_0x157cf8){_0x298e9f=_0x298e9f-0x0;var _0xd15552=_0x4f79[_0x298e9f];return _0xd15552;};'use strict';var multer=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var path=require('path');var timeout=require(_0x94f7('0x2'));var express=require(_0x94f7('0x3'));var router=express[_0x94f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94f7('0x5'));var interaction=require(_0x94f7('0x6'));var config=require(_0x94f7('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x94f7('0x8')]('/',auth[_0x94f7('0x9')](),controller[_0x94f7('0xa')]);router[_0x94f7('0x8')]('/describe',auth[_0x94f7('0x9')](),controller[_0x94f7('0xb')]);router[_0x94f7('0x8')](_0x94f7('0xc'),auth[_0x94f7('0x9')](),controller[_0x94f7('0xd')]);router[_0x94f7('0x8')](_0x94f7('0xe'),auth[_0x94f7('0x9')](),controller[_0x94f7('0xf')]);router[_0x94f7('0x10')]('/',auth['isAuthenticated'](),controller[_0x94f7('0x11')]);router[_0x94f7('0x12')](_0x94f7('0xe'),controller[_0x94f7('0x13')]);router[_0x94f7('0x14')](_0x94f7('0xe'),auth[_0x94f7('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x51e4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x5761b8,_0x27fbf9){var _0x1e7ae0=function(_0xc26727){while(--_0xc26727){_0x5761b8['push'](_0x5761b8['shift']());}};_0x1e7ae0(++_0x27fbf9);}(_0x51e4,0x18b));var _0x451e=function(_0x180fcb,_0x208b94){_0x180fcb=_0x180fcb-0x0;var _0x515f0d=_0x51e4[_0x180fcb];return _0x515f0d;};'use strict';var multer=require(_0x451e('0x0'));var util=require(_0x451e('0x1'));var path=require(_0x451e('0x2'));var timeout=require(_0x451e('0x3'));var express=require(_0x451e('0x4'));var router=express[_0x451e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x451e('0x6'));var interaction=require(_0x451e('0x7'));var config=require(_0x451e('0x8'));var controller=require(_0x451e('0x9'));router[_0x451e('0xa')]('/',auth[_0x451e('0xb')](),controller['index']);router[_0x451e('0xa')](_0x451e('0xc'),auth[_0x451e('0xb')](),controller['describe']);router['get'](_0x451e('0xd'),auth[_0x451e('0xb')](),controller['getUsers']);router[_0x451e('0xa')](_0x451e('0xe'),auth['isAuthenticated'](),controller[_0x451e('0xf')]);router['post']('/',auth[_0x451e('0xb')](),controller['create']);router[_0x451e('0x10')](_0x451e('0xe'),controller[_0x451e('0x11')]);router[_0x451e('0x12')]('/:id',auth[_0x451e('0xb')](),controller[_0x451e('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 0add3bf..6aa23c7 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 _0x5ea2=['ENUM','out','DATE','sequelize','medium','BOOLEAN'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x5ea2,0x99));var _0x25ea=function(_0x366757,_0x4d95f9){_0x366757=_0x366757-0x0;var _0x51f92d=_0x5ea2[_0x366757];return _0x51f92d;};'use strict';var Sequelize=require(_0x25ea('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x25ea('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25ea('0x3')]('in',_0x25ea('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x25ea('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9e5e=['exports','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x3c7cca,_0x3f9621){var _0x5c08cd=function(_0x21a761){while(--_0x21a761){_0x3c7cca['push'](_0x3c7cca['shift']());}};_0x5c08cd(++_0x3f9621);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9e5e[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe9e5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe9e5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe9e5('0x5')]},'providerName':{'type':Sequelize[_0xe9e5('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 38b5d84..11113c9 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x468c29,_0xe23b46){var _0x446837=function(_0x12095a){while(--_0x12095a){_0x468c29['push'](_0x468c29['shift']());}};_0x446837(++_0xe23b46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x5cb7b0,_0x3b5793){var _0x448a44=function(_0x429bee){while(--_0x429bee){_0x5cb7b0['push'](_0x5cb7b0['shift']());}};_0x448a44(++_0x3b5793);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 66e0cb2..7477e9e 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 _0x6b13=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4eb3bb,_0x56bbb9){var _0xb71763=function(_0x123eb5){while(--_0x123eb5){_0x4eb3bb['push'](_0x4eb3bb['shift']());}};_0xb71763(++_0x56bbb9);}(_0x6b13,0x11f));var _0x36b1=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x6b13[_0x83420c];return _0x1057d7;};'use strict';var EventEmitter=require(_0x36b1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x36b1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36b1('0x2')](0x0);var events={'afterCreate':_0x36b1('0x3'),'afterUpdate':'update','afterDestroy':_0x36b1('0x4')};function emitEvent(_0x59a793){return function(_0x253c98,_0x514c6b,_0x18d3e8){ChatMessageEvents[_0x36b1('0x5')](_0x59a793+':'+_0x253c98['id'],_0x253c98);ChatMessageEvents[_0x36b1('0x5')](_0x59a793,_0x253c98);_0x18d3e8(null);};}for(var e in events){if(events[_0x36b1('0x6')](e)){var event=events[e];ChatMessage[_0x36b1('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x1c11=['ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x119ffd,_0x15bd2f){var _0x264e2c=function(_0x5b978f){while(--_0x5b978f){_0x119ffd['push'](_0x119ffd['shift']());}};_0x264e2c(++_0x15bd2f);}(_0x1c11,0xbf));var _0x11c1=function(_0xce923d,_0x1e1168){_0xce923d=_0xce923d-0x0;var _0x10d7a5=_0x1c11[_0xce923d];return _0x10d7a5;};'use strict';var EventEmitter=require(_0x11c1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x11c1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x11c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11c1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cbbd3){return function(_0x217438,_0x362aa5,_0x2f1537){ChatMessageEvents[_0x11c1('0x4')](_0x3cbbd3+':'+_0x217438['id'],_0x217438);ChatMessageEvents['emit'](_0x3cbbd3,_0x217438);_0x2f1537(null);};}for(var e in events){if(events[_0x11c1('0x5')](e)){var event=events[e];ChatMessage[_0x11c1('0x6')](e,emitEvent(event));}}module[_0x11c1('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 77ed924..cc880b8 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 _0xf412=['UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x5ba92a,_0x3d9c45){var _0x2d36b6=function(_0x3806ce){while(--_0x3806ce){_0x5ba92a['push'](_0x5ba92a['shift']());}};_0x2d36b6(++_0x3d9c45);}(_0xf412,0x121));var _0x2f41=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xf412[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0x2f41('0x0'));var util=require(_0x2f41('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2f41('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f41('0x3'));var rimraf=require(_0x2f41('0x4'));var config=require(_0x2f41('0x5'));var attributes=require(_0x2f41('0x6'));module[_0x2f41('0x7')]=function(_0x48e094,_0x16b8b1){return _0x48e094['define'](_0x2f41('0x8'),attributes,{'tableName':_0x2f41('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x2f41('0xa')],'type':_0x2f41('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33e689,_0x324e87,_0x2983f1){var _0x10fcd2=_0x48e094[_0x2f41('0xc')];var _0x24eaee=_0x33e689[_0x2f41('0xd')]({'plain':!![]});if(_0x24eaee[_0x2f41('0xe')][_0x2f41('0xf')]()==='in'||_0x24eaee['direction'][_0x2f41('0xf')]()===_0x2f41('0x10')&&!_0x24eaee[_0x2f41('0x11')]&&!_[_0x2f41('0x12')](_0x24eaee[_0x2f41('0x13')])){_0x10fcd2[_0x2f41('0x14')]['findOne']({'where':{'id':_0x24eaee[_0x2f41('0x15')]}})[_0x2f41('0x16')](function(_0x424164){if(_0x424164){_0x424164[_0x2f41('0x17')]({'lastMsgAt':_0x24eaee[_0x2f41('0x18')],'lastMsgDirection':_0x24eaee['direction'][_0x2f41('0xf')]()});}})[_0x2f41('0x19')](function(_0x31903b){console[_0x2f41('0x1a')](_0x31903b);});}_0x2983f1();}},'charset':'utf8mb4','collate':_0x2f41('0x1b')});};
\ No newline at end of file
+var _0xa8fc=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0xa8fc,0x144));var _0xca8f=function(_0x10cf4e,_0x3290e9){_0x10cf4e=_0x10cf4e-0x0;var _0x238609=_0xa8fc[_0x10cf4e];return _0x238609;};'use strict';var _=require(_0xca8f('0x0'));var util=require(_0xca8f('0x1'));var logger=require(_0xca8f('0x2'))(_0xca8f('0x3'));var moment=require(_0xca8f('0x4'));var BPromise=require(_0xca8f('0x5'));var rp=require(_0xca8f('0x6'));var fs=require('fs');var path=require(_0xca8f('0x7'));var rimraf=require(_0xca8f('0x8'));var config=require(_0xca8f('0x9'));var attributes=require(_0xca8f('0xa'));module['exports']=function(_0x412862,_0x2bef4e){return _0x412862[_0xca8f('0xb')](_0xca8f('0xc'),attributes,{'tableName':_0xca8f('0xd'),'paranoid':![],'indexes':[{'name':_0xca8f('0xe'),'fields':[_0xca8f('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29f6bb,_0x5895a9,_0x40c26d){var _0xc5645d=_0x412862[_0xca8f('0x10')];var _0x5ac313=_0x29f6bb[_0xca8f('0x11')]({'plain':!![]});if(_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()==='in'||_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()===_0xca8f('0x14')&&!_0x5ac313[_0xca8f('0x15')]&&!_[_0xca8f('0x16')](_0x5ac313['UserId'])){_0xc5645d[_0xca8f('0x17')][_0xca8f('0x18')]({'where':{'id':_0x5ac313['ChatInteractionId']}})[_0xca8f('0x19')](function(_0x488d63){if(_0x488d63){_0x488d63[_0xca8f('0x1a')]({'lastMsgAt':_0x5ac313[_0xca8f('0x1b')],'lastMsgDirection':_0x5ac313[_0xca8f('0x12')]['toLowerCase']()});}})[_0xca8f('0x1c')](function(_0x514aec){console[_0xca8f('0x1d')](_0x514aec);});}_0x40c26d();}},'charset':_0xca8f('0x1e'),'collate':_0xca8f('0x1f')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6edad8a..739d018 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 _0xa976=['ChatMessage,\x20%s,\x20%s','CreateChatMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x15f50d,_0x1865c6){var _0x160a8e=function(_0x8b522a){while(--_0x8b522a){_0x15f50d['push'](_0x15f50d['shift']());}};_0x160a8e(++_0x1865c6);}(_0xa976,0xd7));var _0x6a97=function(_0x1b9923,_0x4d76e5){_0x1b9923=_0x1b9923-0x0;var _0x2797c4=_0xa976[_0x1b9923];return _0x2797c4;};'use strict';var _=require(_0x6a97('0x0'));var util=require(_0x6a97('0x1'));var moment=require('moment');var BPromise=require(_0x6a97('0x2'));var rs=require(_0x6a97('0x3'));var fs=require('fs');var Redis=require(_0x6a97('0x4'));var db=require(_0x6a97('0x5'))['db'];var utils=require(_0x6a97('0x6'));var logger=require(_0x6a97('0x7'))('rpc');var config=require(_0x6a97('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a97('0x9')][_0x6a97('0xa')]({'port':0x232a});config[_0x6a97('0xb')]=_['defaults'](config[_0x6a97('0xb')],{'host':_0x6a97('0xc'),'port':0x18eb});var socket=require(_0x6a97('0xd'))(new Redis(config[_0x6a97('0xb')]));require(_0x6a97('0xe'))[_0x6a97('0xf')](socket);function respondWithRpcPromise(_0x4531ec,_0x26712d,_0x538b68){return new BPromise(function(_0x118d67,_0x450bc7){return client['request'](_0x4531ec,_0x538b68)[_0x6a97('0x10')](function(_0x58c92a){logger[_0x6a97('0x11')]('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x6a97('0x12'));logger['debug'](_0x6a97('0x13'),_0x26712d,_0x6a97('0x12'),JSON[_0x6a97('0x14')](_0x58c92a));if(_0x58c92a[_0x6a97('0x15')]){if(_0x58c92a[_0x6a97('0x15')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);return _0x450bc7(_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x58c92a[_0x6a97('0x15')]['message']);return _0x118d67(_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);}else{logger[_0x6a97('0x11')]('ChatMessage,\x20%s,\x20%s',_0x26712d,'request\x20sent');_0x118d67(_0x58c92a[_0x6a97('0x17')]['message']);}})[_0x6a97('0x18')](function(_0x19e490){logger['error'](_0x6a97('0x19'),_0x26712d,_0x19e490);_0x450bc7(_0x19e490);});});}exports[_0x6a97('0x1a')]=function(_0x420caf){var _0x4c8cb1=this;return new Promise(function(_0x40756e,_0x30c1df){return db['ChatMessage'][_0x6a97('0x1b')](_0x420caf['body'],{'raw':_0x420caf[_0x6a97('0x1c')]?_0x420caf[_0x6a97('0x1c')][_0x6a97('0x1d')]===undefined?!![]:![]:!![]})[_0x6a97('0x10')](function(_0x14fa50){logger[_0x6a97('0x11')]('CreateChatMessage',_0x420caf);logger['debug'](_0x6a97('0x1a'),_0x420caf,JSON[_0x6a97('0x14')](_0x14fa50));_0x40756e(_0x14fa50);})['catch'](function(_0x4e6cc8){logger[_0x6a97('0x15')](_0x6a97('0x1a'),_0x4e6cc8['message'],_0x420caf);_0x30c1df(_0x4c8cb1[_0x6a97('0x15')](0x1f4,_0x4e6cc8['message']));});});};
\ No newline at end of file
+var _0x1e8f=['socket.io-emitter','register','request','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','CreateChatMessage','ChatMessage','body','options','then','debug','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x11d326,_0x3d48f6){var _0x304839=function(_0x352267){while(--_0x352267){_0x11d326['push'](_0x11d326['shift']());}};_0x304839(++_0x3d48f6);}(_0x1e8f,0x149));var _0xf1e8=function(_0x31fee1,_0x8d0b5){_0x31fee1=_0x31fee1-0x0;var _0x834e13=_0x1e8f[_0x31fee1];return _0x834e13;};'use strict';var _=require('lodash');var util=require(_0xf1e8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1e8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e8('0x2'))['db'];var utils=require(_0xf1e8('0x3'));var logger=require(_0xf1e8('0x4'))(_0xf1e8('0x5'));var config=require(_0xf1e8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf1e8('0x7')][_0xf1e8('0x8')]({'port':0x232a});config[_0xf1e8('0x9')]=_[_0xf1e8('0xa')](config[_0xf1e8('0x9')],{'host':_0xf1e8('0xb'),'port':0x18eb});var socket=require(_0xf1e8('0xc'))(new Redis(config[_0xf1e8('0x9')]));require('./chatMessage.socket')[_0xf1e8('0xd')](socket);function respondWithRpcPromise(_0x411f33,_0x1251b4,_0x2dfc0d){return new BPromise(function(_0x2b3ee4,_0x42f9fe){return client[_0xf1e8('0xe')](_0x411f33,_0x2dfc0d)['then'](function(_0x582529){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0xf1e8('0xf'));logger['debug'](_0xf1e8('0x10'),_0x1251b4,_0xf1e8('0xf'),JSON['stringify'](_0x582529));if(_0x582529[_0xf1e8('0x11')]){if(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x12')]===0x1f4){logger[_0xf1e8('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);return _0x42f9fe(_0x582529['error']['message']);}logger['error'](_0xf1e8('0x14'),_0x1251b4,_0x582529['error'][_0xf1e8('0x13')]);return _0x2b3ee4(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);}else{logger[_0xf1e8('0x15')](_0xf1e8('0x14'),_0x1251b4,_0xf1e8('0xf'));_0x2b3ee4(_0x582529[_0xf1e8('0x16')][_0xf1e8('0x13')]);}})[_0xf1e8('0x17')](function(_0x27c3e4){logger[_0xf1e8('0x11')](_0xf1e8('0x14'),_0x1251b4,_0x27c3e4);_0x42f9fe(_0x27c3e4);});});}exports[_0xf1e8('0x18')]=function(_0x23051c){var _0x175a7b=this;return new Promise(function(_0x277943,_0x19c91a){return db[_0xf1e8('0x19')]['create'](_0x23051c[_0xf1e8('0x1a')],{'raw':_0x23051c[_0xf1e8('0x1b')]?_0x23051c[_0xf1e8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf1e8('0x1c')](function(_0x2988b7){logger[_0xf1e8('0x15')]('CreateChatMessage',_0x23051c);logger[_0xf1e8('0x1d')]('CreateChatMessage',_0x23051c,JSON[_0xf1e8('0x1e')](_0x2988b7));_0x277943(_0x2988b7);})[_0xf1e8('0x17')](function(_0x2f149d){logger['error'](_0xf1e8('0x18'),_0x2f149d['message'],_0x23051c);_0x19c91a(_0x175a7b['error'](0x1f4,_0x2f149d[_0xf1e8('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 68b71e8..7b6befe 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 _0xec46=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0xfbbae2,_0x119555){var _0x2a2543=function(_0x31376d){while(--_0x31376d){_0xfbbae2['push'](_0xfbbae2['shift']());}};_0x2a2543(++_0x119555);}(_0xec46,0x19c));var _0x6ec4=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0xec46[_0x345a1b];return _0x1b24ec;};'use strict';var ChatMessageEvents=require(_0x6ec4('0x0'));var events=[_0x6ec4('0x1'),_0x6ec4('0x2'),_0x6ec4('0x3')];function createListener(_0x5e854b,_0x5052d2){return function(_0x307c5c){_0x5052d2[_0x6ec4('0x4')](_0x5e854b,_0x307c5c);};}function removeListener(_0x86b9f8,_0x53bbed){return function(){ChatMessageEvents[_0x6ec4('0x5')](_0x86b9f8,_0x53bbed);};}exports[_0x6ec4('0x6')]=function(_0x55b203){for(var _0x533fda=0x0,_0x55d260=events[_0x6ec4('0x7')];_0x533fda<_0x55d260;_0x533fda++){var _0x391ed9=events[_0x533fda];var _0x42b81b=createListener(_0x6ec4('0x8')+_0x391ed9,_0x55b203);ChatMessageEvents['on'](_0x391ed9,_0x42b81b);}};
\ No newline at end of file
+var _0x8c52=['./chatMessage.events','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x4dc46a,_0x47fbd7){var _0x29fbcb=function(_0xeb2ae1){while(--_0xeb2ae1){_0x4dc46a['push'](_0x4dc46a['shift']());}};_0x29fbcb(++_0x47fbd7);}(_0x8c52,0x7e));var _0x28c5=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8c52[_0x3e961c];return _0x474f9c;};'use strict';var ChatMessageEvents=require(_0x28c5('0x0'));var events=['save',_0x28c5('0x1'),_0x28c5('0x2')];function createListener(_0x3d994a,_0x37c10f){return function(_0x398f22){_0x37c10f[_0x28c5('0x3')](_0x3d994a,_0x398f22);};}function removeListener(_0x412a0a,_0x3b6b48){return function(){ChatMessageEvents[_0x28c5('0x4')](_0x412a0a,_0x3b6b48);};}exports[_0x28c5('0x5')]=function(_0x209f3d){for(var _0x3b5c38=0x0,_0x53584d=events['length'];_0x3b5c38<_0x53584d;_0x3b5c38++){var _0x5d9299=events[_0x3b5c38];var _0x5099e8=createListener(_0x28c5('0x6')+_0x5d9299,_0x209f3d);ChatMessageEvents['on'](_0x5d9299,_0x5099e8);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 074cdd9..51a4781 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 _0xa55d=['get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','update','/:id/accept','accept','put','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index'];(function(_0x26e895,_0x4d25e0){var _0x3dfcf1=function(_0x440d25){while(--_0x440d25){_0x26e895['push'](_0x26e895['shift']());}};_0x3dfcf1(++_0x4d25e0);}(_0xa55d,0x16e));var _0xda55=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa55d[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda55('0x0'));var timeout=require(_0xda55('0x1'));var express=require(_0xda55('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xda55('0x3'));var interaction=require(_0xda55('0x4'));var config=require('../../config/environment');var controller=require(_0xda55('0x5'));router['get']('/',auth[_0xda55('0x6')](),controller[_0xda55('0x7')]);router[_0xda55('0x8')](_0xda55('0x9'),auth[_0xda55('0x6')](),controller[_0xda55('0xa')]);router[_0xda55('0x8')](_0xda55('0xb'),auth[_0xda55('0x6')](),controller[_0xda55('0xc')]);router[_0xda55('0xd')]('/',auth['isAuthenticated'](),interaction[_0xda55('0xe')](_0xda55('0xf'),_0xda55('0x10')),controller['create']);router['put'](_0xda55('0xb'),controller[_0xda55('0x11')]);router['put'](_0xda55('0x12'),auth[_0xda55('0x6')](),controller[_0xda55('0x13')]);router[_0xda55('0x14')]('/:id/reject',auth[_0xda55('0x6')](),controller['reject']);router['delete'](_0xda55('0xb'),auth[_0xda55('0x6')](),controller[_0xda55('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x75b7=['/:id','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3ef526,_0x2cb29d){var _0x257f66=function(_0x52f25f){while(--_0x52f25f){_0x3ef526['push'](_0x3ef526['shift']());}};_0x257f66(++_0x2cb29d);}(_0x75b7,0x1cc));var _0x775b=function(_0x5ae3e5,_0x4561e7){_0x5ae3e5=_0x5ae3e5-0x0;var _0x3c93c7=_0x75b7[_0x5ae3e5];return _0x3c93c7;};'use strict';var multer=require(_0x775b('0x0'));var util=require(_0x775b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x775b('0x2')]();var fs_extra=require(_0x775b('0x3'));var auth=require(_0x775b('0x4'));var interaction=require(_0x775b('0x5'));var config=require(_0x775b('0x6'));var controller=require(_0x775b('0x7'));router[_0x775b('0x8')]('/',auth[_0x775b('0x9')](),controller[_0x775b('0xa')]);router[_0x775b('0x8')](_0x775b('0xb'),auth['isAuthenticated'](),controller[_0x775b('0xc')]);router['get']('/:id',auth[_0x775b('0x9')](),controller[_0x775b('0xd')]);router[_0x775b('0xe')]('/',auth[_0x775b('0x9')](),interaction[_0x775b('0xf')](_0x775b('0x10'),_0x775b('0x11')),controller[_0x775b('0x12')]);router[_0x775b('0x13')]('/:id',controller[_0x775b('0x14')]);router[_0x775b('0x13')](_0x775b('0x15'),auth[_0x775b('0x9')](),controller[_0x775b('0x16')]);router['put'](_0x775b('0x17'),auth['isAuthenticated'](),controller[_0x775b('0x18')]);router[_0x775b('0x19')](_0x775b('0x1a'),auth[_0x775b('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 64b6c72..cdd77a8 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 _0x3767=['medium','sequelize'];(function(_0x27fe26,_0x3b8ca7){var _0x4fcb35=function(_0x35e0ae){while(--_0x35e0ae){_0x27fe26['push'](_0x27fe26['shift']());}};_0x4fcb35(++_0x3b8ca7);}(_0x3767,0x1d3));var _0x7376=function(_0x1cfed7,_0x123cf8){_0x1cfed7=_0x1cfed7-0x0;var _0x330ef1=_0x3767[_0x1cfed7];return _0x330ef1;};'use strict';var Sequelize=require(_0x7376('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7376('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xa192=['exports','TEXT'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xa192,0x12e));var _0x2a19=function(_0x45b3ed,_0x192e1a){_0x45b3ed=_0x45b3ed-0x0;var _0x5502a5=_0xa192[_0x45b3ed];return _0x5502a5;};'use strict';var Sequelize=require('sequelize');module[_0x2a19('0x0')]={'body':{'type':Sequelize[_0x2a19('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index f0f7eae..e87ea0f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x7a54,0x106));var _0x47a5=function(_0x5900a,_0x34660f){_0x5900a=_0x5900a-0x0;var _0x316199=_0x7a54[_0x5900a];return _0x316199;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x35cad5,_0x36c77a){var _0x213ddc=function(_0x20dfac){while(--_0x20dfac){_0x35cad5['push'](_0x35cad5['shift']());}};_0x213ddc(++_0x36c77a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3c10fc5..a5799d8 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 _0xd241=['../../config/logger','api','moment','bluebird','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd241,0x1d2));var _0x1d24=function(_0x40ad90,_0x20ae1e){_0x40ad90=_0x40ad90-0x0;var _0x1bec55=_0xd241[_0x40ad90];return _0x1bec55;};'use strict';var _=require(_0x1d24('0x0'));var util=require(_0x1d24('0x1'));var logger=require(_0x1d24('0x2'))(_0x1d24('0x3'));var moment=require(_0x1d24('0x4'));var BPromise=require(_0x1d24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d24('0x6'));var rimraf=require(_0x1d24('0x7'));var config=require('../../config/environment');var attributes=require(_0x1d24('0x8'));module['exports']=function(_0x1aeb61,_0x372c4d){return _0x1aeb61[_0x1d24('0x9')](_0x1d24('0xa'),attributes,{'tableName':_0x1d24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d24('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8690=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','api','bluebird'];(function(_0xe609de,_0x1ef5fc){var _0x5aafbd=function(_0x2510c){while(--_0x2510c){_0xe609de['push'](_0xe609de['shift']());}};_0x5aafbd(++_0x1ef5fc);}(_0x8690,0x1df));var _0x0869=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x8690[_0x334d1e];return _0x3b33ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0869('0x0'));var moment=require('moment');var BPromise=require(_0x0869('0x1'));var rp=require(_0x0869('0x2'));var fs=require('fs');var path=require(_0x0869('0x3'));var rimraf=require(_0x0869('0x4'));var config=require(_0x0869('0x5'));var attributes=require(_0x0869('0x6'));module[_0x0869('0x7')]=function(_0x174c88,_0x53fdb9){return _0x174c88[_0x0869('0x8')](_0x0869('0x9'),attributes,{'tableName':_0x0869('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0869('0xb'),'collate':_0x0869('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index d6fd100..019700a 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 _0x7a1b=['error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3199af,_0x339560){var _0x5aa4d0=function(_0x1cb5f0){while(--_0x1cb5f0){_0x3199af['push'](_0x3199af['shift']());}};_0x5aa4d0(++_0x339560);}(_0x7a1b,0x11c));var _0xb7a1=function(_0x342f86,_0x137b19){_0x342f86=_0x342f86-0x0;var _0x2a3085=_0x7a1b[_0x342f86];return _0x2a3085;};'use strict';var _=require(_0xb7a1('0x0'));var util=require(_0xb7a1('0x1'));var moment=require('moment');var BPromise=require(_0xb7a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7a1('0x3'))['db'];var utils=require(_0xb7a1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb7a1('0x5'));var jayson=require(_0xb7a1('0x6'));var client=jayson[_0xb7a1('0x7')][_0xb7a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d899b,_0x588b6a,_0x584afe){return new BPromise(function(_0xa9e78e,_0x100e99){return client['request'](_0x1d899b,_0x584afe)[_0xb7a1('0x9')](function(_0x3964a4){logger[_0xb7a1('0xa')](_0xb7a1('0xb'),_0x588b6a,'request\x20sent');logger[_0xb7a1('0xc')](_0xb7a1('0xd'),_0x588b6a,_0xb7a1('0xe'),JSON[_0xb7a1('0xf')](_0x3964a4));if(_0x3964a4['error']){if(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x11')]===0x1f4){logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);return _0x100e99(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);}logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x3964a4['error'][_0xb7a1('0x12')]);return _0xa9e78e(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);}else{logger['info'](_0xb7a1('0xb'),_0x588b6a,'request\x20sent');_0xa9e78e(_0x3964a4['result'][_0xb7a1('0x12')]);}})[_0xb7a1('0x13')](function(_0x1f1f7d){logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x1f1f7d);_0x100e99(_0x1f1f7d);});});}
\ No newline at end of file
+var _0xf670=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x221952,_0x55ec08){var _0x51e994=function(_0x323927){while(--_0x323927){_0x221952['push'](_0x221952['shift']());}};_0x51e994(++_0x55ec08);}(_0xf670,0x8d));var _0x0f67=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0xf670[_0x57643b];return _0x53a35b;};'use strict';var _=require('lodash');var util=require(_0x0f67('0x0'));var moment=require(_0x0f67('0x1'));var BPromise=require(_0x0f67('0x2'));var rs=require(_0x0f67('0x3'));var fs=require('fs');var Redis=require(_0x0f67('0x4'));var db=require(_0x0f67('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f67('0x6'))(_0x0f67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f67('0x8')][_0x0f67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd6248b,_0x248449,_0x4fc325){return new BPromise(function(_0x5f2f5d,_0x369cf8){return client[_0x0f67('0xa')](_0xd6248b,_0x4fc325)[_0x0f67('0xb')](function(_0x41cf31){logger[_0x0f67('0xc')](_0x0f67('0xd'),_0x248449,_0x0f67('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'),JSON['stringify'](_0x41cf31));if(_0x41cf31[_0x0f67('0xf')]){if(_0x41cf31['error'][_0x0f67('0x10')]===0x1f4){logger['error'](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x369cf8(_0x41cf31['error'][_0x0f67('0x11')]);}logger[_0x0f67('0xf')](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x5f2f5d(_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);}else{logger[_0x0f67('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'));_0x5f2f5d(_0x41cf31[_0x0f67('0x12')][_0x0f67('0x11')]);}})[_0x0f67('0x13')](function(_0x4f4f9f){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x4f4f9f);_0x369cf8(_0x4f4f9f);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6e398b8..93de6ad 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 _0x871a=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x465465,_0x1d58d2){var _0x278c1e=function(_0x553ff7){while(--_0x553ff7){_0x465465['push'](_0x465465['shift']());}};_0x278c1e(++_0x1d58d2);}(_0x871a,0xd8));var _0xa871=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x871a[_0x139b85];return _0x1e833f;};'use strict';var multer=require(_0xa871('0x0'));var util=require(_0xa871('0x1'));var path=require('path');var timeout=require(_0xa871('0x2'));var express=require(_0xa871('0x3'));var router=express['Router']();var fs_extra=require(_0xa871('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa871('0x5'));var config=require(_0xa871('0x6'));var controller=require(_0xa871('0x7'));router['get']('/',auth[_0xa871('0x8')](),controller[_0xa871('0x9')]);router[_0xa871('0xa')](_0xa871('0xb'),auth[_0xa871('0x8')](),controller[_0xa871('0xc')]);router[_0xa871('0xa')](_0xa871('0xd'),auth[_0xa871('0x8')](),controller[_0xa871('0xe')]);router[_0xa871('0xf')]('/',auth[_0xa871('0x8')](),controller[_0xa871('0x10')]);router[_0xa871('0x11')](_0xa871('0xd'),auth['isAuthenticated'](),controller[_0xa871('0x12')]);router[_0xa871('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa871('0x14')]=router;
\ No newline at end of file
+var _0x7b9d=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7b9d,0x119));var _0xd7b9=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x7b9d[_0x592416];return _0x3005fa;};'use strict';var multer=require(_0xd7b9('0x0'));var util=require(_0xd7b9('0x1'));var path=require(_0xd7b9('0x2'));var timeout=require(_0xd7b9('0x3'));var express=require(_0xd7b9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd7b9('0x5'));var interaction=require(_0xd7b9('0x6'));var config=require(_0xd7b9('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xd7b9('0x8')]('/',auth[_0xd7b9('0x9')](),controller['index']);router[_0xd7b9('0x8')](_0xd7b9('0xa'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xb')]);router['get'](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller['show']);router[_0xd7b9('0xd')]('/',auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xe')]);router[_0xd7b9('0xf')](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0x10')]);router[_0xd7b9('0x11')](_0xd7b9('0xc'),auth['isAuthenticated'](),controller[_0xd7b9('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index e011fe5..95b1a2d 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 _0x4e42=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x486271,_0x3b6c33){var _0x40d073=function(_0x1b5a1d){while(--_0x1b5a1d){_0x486271['push'](_0x486271['shift']());}};_0x40d073(++_0x3b6c33);}(_0x4e42,0xd2));var _0x24e4=function(_0x2d6533,_0x19f68c){_0x2d6533=_0x2d6533-0x0;var _0x26c12f=_0x4e42[_0x2d6533];return _0x26c12f;};'use strict';var Sequelize=require(_0x24e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x24e4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x24e4('0x2')](_0x24e4('0x3'),_0x24e4('0x4')),'defaultValue':_0x24e4('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x24e4('0x5')]}};
\ No newline at end of file
+var _0x405e=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x4afa89,_0x1b9ed3){var _0x151c58=function(_0x406491){while(--_0x406491){_0x4afa89['push'](_0x4afa89['shift']());}};_0x151c58(++_0x1b9ed3);}(_0x405e,0x111));var _0xe405=function(_0x2ebb5c,_0x5efe37){_0x2ebb5c=_0x2ebb5c-0x0;var _0x5d965f=_0x405e[_0x2ebb5c];return _0x5d965f;};'use strict';var Sequelize=require(_0xe405('0x0'));module[_0xe405('0x1')]={'name':{'type':Sequelize[_0xe405('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe405('0x3')](_0xe405('0x4'),_0xe405('0x5')),'defaultValue':_0xe405('0x4')},'selector':{'type':Sequelize[_0xe405('0x2')]},'timeout':{'type':Sequelize[_0xe405('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a77231d..2b60135 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 _0x49fe=['intersection','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x49fe,0x100));var _0xe49f=function(_0xf29ecd,_0x1444e4){_0xf29ecd=_0xf29ecd-0x0;var _0x31f727=_0x49fe[_0xf29ecd];return _0x31f727;};'use strict';var emlformat=require(_0xe49f('0x0'));var rimraf=require(_0xe49f('0x1'));var zipdir=require(_0xe49f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe49f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe49f('0x4'));var util=require(_0xe49f('0x5'));var path=require(_0xe49f('0x6'));var sox=require(_0xe49f('0x7'));var csv=require('to-csv');var ejs=require(_0xe49f('0x8'));var fs=require('fs');var fs_extra=require(_0xe49f('0x9'));var _=require(_0xe49f('0xa'));var squel=require(_0xe49f('0xb'));var crypto=require('crypto');var jsforce=require(_0xe49f('0xc'));var deskjs=require(_0xe49f('0xd'));var toCsv=require(_0xe49f('0xe'));var querystring=require(_0xe49f('0xf'));var Papa=require(_0xe49f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe49f('0x11'));var as=require(_0xe49f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe49f('0x13'));var utils=require(_0xe49f('0x14'));var config=require(_0xe49f('0x15'));var licenseUtil=require(_0xe49f('0x16'));var db=require(_0xe49f('0x17'))['db'];function respondWithStatusCode(_0x1d5ecc,_0x564edb){_0x564edb=_0x564edb||0xcc;return function(_0x5c8b24){if(_0x5c8b24){return _0x1d5ecc[_0xe49f('0x18')](_0x564edb);}return _0x1d5ecc[_0xe49f('0x19')](_0x564edb)[_0xe49f('0x1a')]();};}function respondWithResult(_0x4213f6,_0x1cd9b4){_0x1cd9b4=_0x1cd9b4||0xc8;return function(_0x517e43){if(_0x517e43){return _0x4213f6[_0xe49f('0x19')](_0x1cd9b4)[_0xe49f('0x1b')](_0x517e43);}};}function respondWithFilteredResult(_0x2cff19,_0x575030){return function(_0x1b9291){if(_0x1b9291){var _0x4268b3=typeof _0x575030[_0xe49f('0x1c')]==='undefined'&&typeof _0x575030[_0xe49f('0x1d')]===_0xe49f('0x1e');var _0x37c30f=_0x1b9291[_0xe49f('0x1f')];var _0x3fcfa4=_0x4268b3?0x0:_0x575030[_0xe49f('0x1c')];var _0xdec8d=_0x4268b3?_0x1b9291[_0xe49f('0x1f')]:_0x575030['offset']+_0x575030[_0xe49f('0x1d')];var _0x4b159c;if(_0xdec8d>=_0x37c30f){_0xdec8d=_0x37c30f;_0x4b159c=0xc8;}else{_0x4b159c=0xce;}_0x2cff19[_0xe49f('0x19')](_0x4b159c);return _0x2cff19[_0xe49f('0x20')](_0xe49f('0x21'),_0x3fcfa4+'-'+_0xdec8d+'/'+_0x37c30f)[_0xe49f('0x1b')](_0x1b9291);}return null;};}function patchUpdates(_0x2a054e){return function(_0xfe4d5d){try{jsonpatch['apply'](_0xfe4d5d,_0x2a054e,!![]);}catch(_0x1a21e9){return BPromise[_0xe49f('0x22')](_0x1a21e9);}return _0xfe4d5d[_0xe49f('0x23')]();};}function saveUpdates(_0x128b89,_0x554398){return function(_0x40018d){if(_0x40018d){return _0x40018d['update'](_0x128b89)[_0xe49f('0x24')](function(_0x11f953){return _0x11f953;});}return null;};}function removeEntity(_0xf0ebd,_0x5e8908){return function(_0x3470e1){if(_0x3470e1){return _0x3470e1[_0xe49f('0x25')]()[_0xe49f('0x24')](function(){_0xf0ebd[_0xe49f('0x19')](0xcc)[_0xe49f('0x1a')]();});}};}function handleEntityNotFound(_0x4d8f38,_0x60cdfa){return function(_0x15cbef){if(!_0x15cbef){_0x4d8f38[_0xe49f('0x18')](0x194);}return _0x15cbef;};}function handleError(_0x3e434c,_0x3708ac){_0x3708ac=_0x3708ac||0x1f4;return function(_0x47aee6){logger['error'](_0x47aee6[_0xe49f('0x26')]);if(_0x47aee6[_0xe49f('0x27')]){delete _0x47aee6[_0xe49f('0x27')];}_0x3e434c['status'](_0x3708ac)[_0xe49f('0x28')](_0x47aee6);};}exports[_0xe49f('0x29')]=function(_0x3b31c3,_0x3b7bf0){var _0x276ecd={'raw':!![],'where':{'id':_0x3b31c3[_0xe49f('0x2a')]['id']}},_0x28d6c0={};_0x28d6c0[_0xe49f('0x2b')]=_[_0xe49f('0x2c')](db[_0xe49f('0x2d')][_0xe49f('0x2e')]);_0x28d6c0[_0xe49f('0x2f')]=_[_0xe49f('0x2c')](_0x3b31c3['query']);_0x28d6c0[_0xe49f('0x30')]=_[_0xe49f('0x31')](_0x28d6c0['model'],_0x28d6c0['query']);_0x276ecd[_0xe49f('0x32')]=_['intersection'](_0x28d6c0[_0xe49f('0x2b')],qs[_0xe49f('0x33')](_0x3b31c3[_0xe49f('0x2f')]['fields']));_0x276ecd[_0xe49f('0x32')]=_0x276ecd['attributes'][_0xe49f('0x34')]?_0x276ecd[_0xe49f('0x32')]:_0x28d6c0[_0xe49f('0x2b')];if(_0x3b31c3[_0xe49f('0x2f')][_0xe49f('0x35')]){_0x276ecd[_0xe49f('0x36')]=[{'all':!![]}];}_0x276ecd=_[_0xe49f('0x37')]({},_0x276ecd,_0x3b31c3[_0xe49f('0x38')]);return db[_0xe49f('0x2d')]['find'](_0x276ecd)[_0xe49f('0x24')](handleEntityNotFound(_0x3b7bf0,null))[_0xe49f('0x24')](respondWithResult(_0x3b7bf0,null))[_0xe49f('0x39')](handleError(_0x3b7bf0,null));};exports[_0xe49f('0x3a')]=function(_0x2fb2b7,_0x4ce45c){return db[_0xe49f('0x2d')][_0xe49f('0x3a')](_0x2fb2b7[_0xe49f('0x3b')],{})[_0xe49f('0x24')](respondWithResult(_0x4ce45c,0xc9))['catch'](handleError(_0x4ce45c,null));};exports['update']=function(_0x56b3fc,_0x1dc3e2){if(_0x56b3fc['body']['id']){delete _0x56b3fc[_0xe49f('0x3b')]['id'];}return db['ChatProactiveAction'][_0xe49f('0x3c')]({'where':{'id':_0x56b3fc[_0xe49f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1dc3e2,null))[_0xe49f('0x24')](saveUpdates(_0x56b3fc[_0xe49f('0x3b')],null))[_0xe49f('0x24')](respondWithResult(_0x1dc3e2,null))[_0xe49f('0x39')](handleError(_0x1dc3e2,null));};exports[_0xe49f('0x25')]=function(_0x2c89ee,_0x4f9bea){return db[_0xe49f('0x2d')][_0xe49f('0x3c')]({'where':{'id':_0x2c89ee[_0xe49f('0x2a')]['id']}})[_0xe49f('0x24')](handleEntityNotFound(_0x4f9bea,null))[_0xe49f('0x24')](removeEntity(_0x4f9bea,null))['catch'](handleError(_0x4f9bea,null));};
\ No newline at end of file
+var _0xc0a4=['intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters'];(function(_0x5ca04c,_0x27f8db){var _0x5e227e=function(_0x5d256e){while(--_0x5d256e){_0x5ca04c['push'](_0x5ca04c['shift']());}};_0x5e227e(++_0x27f8db);}(_0xc0a4,0x147));var _0x4c0a=function(_0x4a7cb9,_0x4e0fa2){_0x4a7cb9=_0x4a7cb9-0x0;var _0x4cde3b=_0xc0a4[_0x4a7cb9];return _0x4cde3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c0a('0x0'));var zipdir=require(_0x4c0a('0x1'));var jsonpatch=require(_0x4c0a('0x2'));var rp=require('request-promise');var moment=require(_0x4c0a('0x3'));var BPromise=require(_0x4c0a('0x4'));var Mustache=require(_0x4c0a('0x5'));var util=require(_0x4c0a('0x6'));var path=require(_0x4c0a('0x7'));var sox=require('sox');var csv=require(_0x4c0a('0x8'));var ejs=require(_0x4c0a('0x9'));var fs=require('fs');var fs_extra=require(_0x4c0a('0xa'));var _=require(_0x4c0a('0xb'));var squel=require(_0x4c0a('0xc'));var crypto=require(_0x4c0a('0xd'));var jsforce=require(_0x4c0a('0xe'));var deskjs=require(_0x4c0a('0xf'));var toCsv=require(_0x4c0a('0x8'));var querystring=require('querystring');var Papa=require(_0x4c0a('0x10'));var Redis=require(_0x4c0a('0x11'));var authService=require(_0x4c0a('0x12'));var qs=require(_0x4c0a('0x13'));var as=require(_0x4c0a('0x14'));var hardwareService=require(_0x4c0a('0x15'));var logger=require(_0x4c0a('0x16'))(_0x4c0a('0x17'));var utils=require(_0x4c0a('0x18'));var config=require(_0x4c0a('0x19'));var licenseUtil=require(_0x4c0a('0x1a'));var db=require(_0x4c0a('0x1b'))['db'];function respondWithStatusCode(_0x55b124,_0x1ff4d3){_0x1ff4d3=_0x1ff4d3||0xcc;return function(_0xef01ab){if(_0xef01ab){return _0x55b124[_0x4c0a('0x1c')](_0x1ff4d3);}return _0x55b124[_0x4c0a('0x1d')](_0x1ff4d3)['end']();};}function respondWithResult(_0x437513,_0x223c2a){_0x223c2a=_0x223c2a||0xc8;return function(_0x16d852){if(_0x16d852){return _0x437513[_0x4c0a('0x1d')](_0x223c2a)[_0x4c0a('0x1e')](_0x16d852);}};}function respondWithFilteredResult(_0x8055cc,_0x31e574){return function(_0xe6569b){if(_0xe6569b){var _0x22bc77=typeof _0x31e574[_0x4c0a('0x1f')]===_0x4c0a('0x20')&&typeof _0x31e574[_0x4c0a('0x21')]===_0x4c0a('0x20');var _0x1ebf5e=_0xe6569b[_0x4c0a('0x22')];var _0x7e7d4b=_0x22bc77?0x0:_0x31e574['offset'];var _0x251c7f=_0x22bc77?_0xe6569b['count']:_0x31e574[_0x4c0a('0x1f')]+_0x31e574[_0x4c0a('0x21')];var _0x324469;if(_0x251c7f>=_0x1ebf5e){_0x251c7f=_0x1ebf5e;_0x324469=0xc8;}else{_0x324469=0xce;}_0x8055cc[_0x4c0a('0x1d')](_0x324469);return _0x8055cc[_0x4c0a('0x23')]('Content-Range',_0x7e7d4b+'-'+_0x251c7f+'/'+_0x1ebf5e)[_0x4c0a('0x1e')](_0xe6569b);}return null;};}function patchUpdates(_0x5e7cf1){return function(_0x2cd240){try{jsonpatch[_0x4c0a('0x24')](_0x2cd240,_0x5e7cf1,!![]);}catch(_0x33a3c5){return BPromise[_0x4c0a('0x25')](_0x33a3c5);}return _0x2cd240['save']();};}function saveUpdates(_0x2fef66,_0x19705f){return function(_0x271e58){if(_0x271e58){return _0x271e58[_0x4c0a('0x26')](_0x2fef66)[_0x4c0a('0x27')](function(_0x2cbb8b){return _0x2cbb8b;});}return null;};}function removeEntity(_0x18019d,_0x5bd479){return function(_0x5116ee){if(_0x5116ee){return _0x5116ee[_0x4c0a('0x28')]()['then'](function(){_0x18019d[_0x4c0a('0x1d')](0xcc)[_0x4c0a('0x29')]();});}};}function handleEntityNotFound(_0x22a3ad,_0x319b6f){return function(_0x117ac7){if(!_0x117ac7){_0x22a3ad['sendStatus'](0x194);}return _0x117ac7;};}function handleError(_0x241e91,_0xf239ed){_0xf239ed=_0xf239ed||0x1f4;return function(_0x5b91e2){logger['error'](_0x5b91e2['stack']);if(_0x5b91e2[_0x4c0a('0x2a')]){delete _0x5b91e2['name'];}_0x241e91['status'](_0xf239ed)[_0x4c0a('0x2b')](_0x5b91e2);};}exports['show']=function(_0x23bee2,_0x25a139){var _0x167604={'raw':!![],'where':{'id':_0x23bee2[_0x4c0a('0x2c')]['id']}},_0x5baa4b={};_0x5baa4b[_0x4c0a('0x2d')]=_['keys'](db[_0x4c0a('0x2e')][_0x4c0a('0x2f')]);_0x5baa4b[_0x4c0a('0x30')]=_[_0x4c0a('0x31')](_0x23bee2['query']);_0x5baa4b[_0x4c0a('0x32')]=_[_0x4c0a('0x33')](_0x5baa4b['model'],_0x5baa4b[_0x4c0a('0x30')]);_0x167604[_0x4c0a('0x34')]=_[_0x4c0a('0x33')](_0x5baa4b[_0x4c0a('0x2d')],qs[_0x4c0a('0x35')](_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x35')]));_0x167604['attributes']=_0x167604[_0x4c0a('0x34')][_0x4c0a('0x36')]?_0x167604[_0x4c0a('0x34')]:_0x5baa4b[_0x4c0a('0x2d')];if(_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x37')]){_0x167604[_0x4c0a('0x38')]=[{'all':!![]}];}_0x167604=_[_0x4c0a('0x39')]({},_0x167604,_0x23bee2[_0x4c0a('0x3a')]);return db['ChatProactiveAction'][_0x4c0a('0x3b')](_0x167604)[_0x4c0a('0x27')](handleEntityNotFound(_0x25a139,null))['then'](respondWithResult(_0x25a139,null))['catch'](handleError(_0x25a139,null));};exports[_0x4c0a('0x3c')]=function(_0x48ed41,_0x484d0a){return db[_0x4c0a('0x2e')][_0x4c0a('0x3c')](_0x48ed41[_0x4c0a('0x3d')],{})[_0x4c0a('0x27')](respondWithResult(_0x484d0a,0xc9))[_0x4c0a('0x3e')](handleError(_0x484d0a,null));};exports['update']=function(_0x36bd3c,_0x44887f){if(_0x36bd3c[_0x4c0a('0x3d')]['id']){delete _0x36bd3c[_0x4c0a('0x3d')]['id'];}return db[_0x4c0a('0x2e')]['find']({'where':{'id':_0x36bd3c[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x44887f,null))['then'](saveUpdates(_0x36bd3c[_0x4c0a('0x3d')],null))[_0x4c0a('0x27')](respondWithResult(_0x44887f,null))[_0x4c0a('0x3e')](handleError(_0x44887f,null));};exports[_0x4c0a('0x28')]=function(_0xb03bce,_0x4aa44c){return db[_0x4c0a('0x2e')][_0x4c0a('0x3b')]({'where':{'id':_0xb03bce[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x4aa44c,null))['then'](removeEntity(_0x4aa44c,null))[_0x4c0a('0x3e')](handleError(_0x4aa44c,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ab3eea4..2363a15 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 _0x51d4=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x51d4,0x106));var _0x451d=function(_0x10de0a,_0x39f341){_0x10de0a=_0x10de0a-0x0;var _0x500872=_0x51d4[_0x10de0a];return _0x500872;};'use strict';var _=require(_0x451d('0x0'));var util=require(_0x451d('0x1'));var logger=require(_0x451d('0x2'))(_0x451d('0x3'));var moment=require(_0x451d('0x4'));var BPromise=require(_0x451d('0x5'));var rp=require(_0x451d('0x6'));var fs=require('fs');var path=require(_0x451d('0x7'));var rimraf=require(_0x451d('0x8'));var config=require(_0x451d('0x9'));var attributes=require(_0x451d('0xa'));module[_0x451d('0xb')]=function(_0x492c09,_0x1cd7ac){return _0x492c09[_0x451d('0xc')](_0x451d('0xd'),attributes,{'tableName':_0x451d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4363=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x37db95,_0x4f2cca){var _0x28070c=function(_0x5712b6){while(--_0x5712b6){_0x37db95['push'](_0x37db95['shift']());}};_0x28070c(++_0x4f2cca);}(_0x4363,0x18e));var _0x3436=function(_0x53c37a,_0x5b1dd4){_0x53c37a=_0x53c37a-0x0;var _0x283edf=_0x4363[_0x53c37a];return _0x283edf;};'use strict';var _=require(_0x3436('0x0'));var util=require('util');var logger=require(_0x3436('0x1'))(_0x3436('0x2'));var moment=require(_0x3436('0x3'));var BPromise=require(_0x3436('0x4'));var rp=require(_0x3436('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3436('0x6'));var config=require(_0x3436('0x7'));var attributes=require(_0x3436('0x8'));module['exports']=function(_0x58d084,_0x1a5ab2){return _0x58d084['define'](_0x3436('0x9'),attributes,{'tableName':_0x3436('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 6883780..be05d8f 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 _0xc4a6=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x11a2d8,_0x608ae8){var _0x578e04=function(_0x59a790){while(--_0x59a790){_0x11a2d8['push'](_0x11a2d8['shift']());}};_0x578e04(++_0x608ae8);}(_0xc4a6,0x1c9));var _0x6c4a=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0xc4a6[_0x5ecaab];return _0x3db1a8;};'use strict';var _=require(_0x6c4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c4a('0x1'));var rs=require(_0x6c4a('0x2'));var fs=require('fs');var Redis=require(_0x6c4a('0x3'));var db=require(_0x6c4a('0x4'))['db'];var utils=require(_0x6c4a('0x5'));var logger=require(_0x6c4a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c4a('0x7'));var client=jayson[_0x6c4a('0x8')][_0x6c4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e936e,_0x351ea9,_0xebe3fe){return new BPromise(function(_0x13f74a,_0x459580){return client[_0x6c4a('0xa')](_0x1e936e,_0xebe3fe)[_0x6c4a('0xb')](function(_0x29d2df){logger[_0x6c4a('0xc')](_0x6c4a('0xd'),_0x351ea9,_0x6c4a('0xe'));logger[_0x6c4a('0xf')](_0x6c4a('0x10'),_0x351ea9,_0x6c4a('0xe'),JSON[_0x6c4a('0x11')](_0x29d2df));if(_0x29d2df[_0x6c4a('0x12')]){if(_0x29d2df['error'][_0x6c4a('0x13')]===0x1f4){logger[_0x6c4a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x351ea9,_0x29d2df['error'][_0x6c4a('0x14')]);return _0x459580(_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);}logger[_0x6c4a('0x12')](_0x6c4a('0xd'),_0x351ea9,_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);return _0x13f74a(_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);}else{logger[_0x6c4a('0xc')](_0x6c4a('0xd'),_0x351ea9,_0x6c4a('0xe'));_0x13f74a(_0x29d2df['result'][_0x6c4a('0x14')]);}})[_0x6c4a('0x15')](function(_0x5d4a60){logger[_0x6c4a('0x12')](_0x6c4a('0xd'),_0x351ea9,_0x5d4a60);_0x459580(_0x5d4a60);});});}
\ No newline at end of file
+var _0xc0d8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9996d7,_0x36a17b){var _0x3b0dca=function(_0x510c76){while(--_0x510c76){_0x9996d7['push'](_0x9996d7['shift']());}};_0x3b0dca(++_0x36a17b);}(_0xc0d8,0xa8));var _0x8c0d=function(_0x148670,_0x2b0db3){_0x148670=_0x148670-0x0;var _0x5f52f7=_0xc0d8[_0x148670];return _0x5f52f7;};'use strict';var _=require(_0x8c0d('0x0'));var util=require(_0x8c0d('0x1'));var moment=require(_0x8c0d('0x2'));var BPromise=require(_0x8c0d('0x3'));var rs=require(_0x8c0d('0x4'));var fs=require('fs');var Redis=require(_0x8c0d('0x5'));var db=require(_0x8c0d('0x6'))['db'];var utils=require(_0x8c0d('0x7'));var logger=require(_0x8c0d('0x8'))(_0x8c0d('0x9'));var config=require('../../config/environment');var jayson=require(_0x8c0d('0xa'));var client=jayson[_0x8c0d('0xb')][_0x8c0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x273063,_0x3d3b26,_0x2ae784){return new BPromise(function(_0x34d5de,_0x4f85a8){return client[_0x8c0d('0xd')](_0x273063,_0x2ae784)[_0x8c0d('0xe')](function(_0x32b6a8){logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,'request\x20sent');logger[_0x8c0d('0x11')](_0x8c0d('0x12'),_0x3d3b26,_0x8c0d('0x13'),JSON[_0x8c0d('0x14')](_0x32b6a8));if(_0x32b6a8[_0x8c0d('0x15')]){if(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x16')]===0x1f4){logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x4f85a8(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);}logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x34d5de(_0x32b6a8['error'][_0x8c0d('0x17')]);}else{logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,_0x8c0d('0x13'));_0x34d5de(_0x32b6a8['result'][_0x8c0d('0x17')]);}})[_0x8c0d('0x18')](function(_0x1ded10){logger[_0x8c0d('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x3d3b26,_0x1ded10);_0x4f85a8(_0x1ded10);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 445057f..d93ed59 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 _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x47dcb1,_0x2e7067){var _0x532b9f=function(_0x1f3fb5){while(--_0x1f3fb5){_0x47dcb1['push'](_0x47dcb1['shift']());}};_0x532b9f(++_0x2e7067);}(_0x5d58,0x187));var _0x85d5=function(_0x2e15f3,_0x8a73eb){_0x2e15f3=_0x2e15f3-0x0;var _0x460ecd=_0x5d58[_0x2e15f3];return _0x460ecd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x1b698d,_0x1aae30){var _0x49042b=function(_0xae9203){while(--_0xae9203){_0x1b698d['push'](_0x1b698d['shift']());}};_0x49042b(++_0x1aae30);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0xfdbd[_0x19159d];return _0x35884a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index b595f99..d603629 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 _0x4d16=['roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x4d16,0xe5));var _0x64d1=function(_0x1f90df,_0x566cc8){_0x1f90df=_0x1f90df-0x0;var _0x3d45a7=_0x4d16[_0x1f90df];return _0x3d45a7;};'use strict';var Sequelize=require('sequelize');module[_0x64d1('0x0')]={'name':{'type':Sequelize[_0x64d1('0x1')],'unique':_0x64d1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x64d1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x64d1('0x4'),'beepall',_0x64d1('0x5'))}};
\ No newline at end of file
+var _0x1324=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x1324,0x9d));var _0x4132=function(_0x5a6f32,_0x55b359){_0x5a6f32=_0x5a6f32-0x0;var _0x512785=_0x1324[_0x5a6f32];return _0x512785;};'use strict';var Sequelize=require(_0x4132('0x0'));module['exports']={'name':{'type':Sequelize[_0x4132('0x1')],'unique':_0x4132('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4132('0x1')]},'timeout':{'type':Sequelize[_0x4132('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4132('0x4')](_0x4132('0x5'),_0x4132('0x6'),_0x4132('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index aca4d45..70cc93a 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 _0x500d=['SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','emit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','ChatQueueId','UserChatQueue','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes'];(function(_0x3cad98,_0x3a6539){var _0x53f43c=function(_0x44ff9c){while(--_0x44ff9c){_0x3cad98['push'](_0x3cad98['shift']());}};_0x53f43c(++_0x3a6539);}(_0x500d,0x146));var _0xd500=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x500d[_0x237546];return _0x233e29;};'use strict';var emlformat=require(_0xd500('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd500('0x1'));var jsonpatch=require(_0xd500('0x2'));var rp=require(_0xd500('0x3'));var moment=require(_0xd500('0x4'));var BPromise=require(_0xd500('0x5'));var Mustache=require('mustache');var util=require(_0xd500('0x6'));var path=require(_0xd500('0x7'));var sox=require(_0xd500('0x8'));var csv=require(_0xd500('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd500('0xa'));var _=require(_0xd500('0xb'));var squel=require(_0xd500('0xc'));var crypto=require(_0xd500('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd500('0xe'));var Redis=require(_0xd500('0xf'));var authService=require(_0xd500('0x10'));var qs=require(_0xd500('0x11'));var as=require(_0xd500('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd500('0x13'));var utils=require(_0xd500('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd500('0x15'))['db'];config['redis']=_[_0xd500('0x16')](config[_0xd500('0x17')],{'host':_0xd500('0x18'),'port':0x18eb});var socket=require(_0xd500('0x19'))(new Redis(config['redis']));require(_0xd500('0x1a'))[_0xd500('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd500('0x1c')][_0xd500('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29d80f,_0xd4ae54,_0x12cbc4,_0x522d41){return new BPromise(function(_0x303cee,_0x280b98){var _0x39aea2=_0x522d41||client;return _0x39aea2[_0xd500('0x1e')](_0x29d80f,_0x12cbc4)[_0xd500('0x1f')](function(_0x1e5102){logger[_0xd500('0x20')]('ChatQueue,\x20%s,\x20%s',_0xd4ae54,_0xd500('0x21'));logger[_0xd500('0x22')](_0xd500('0x23'),_0xd4ae54,_0xd500('0x21'),JSON[_0xd500('0x24')](_0x1e5102));if(_0x1e5102['error']){if(_0x1e5102['error'][_0xd500('0x25')]===0x1f4){logger[_0xd500('0x26')](_0xd500('0x27'),_0xd4ae54,_0x1e5102[_0xd500('0x26')]['message']);return _0x280b98(_0x1e5102[_0xd500('0x26')][_0xd500('0x28')]);}logger['error'](_0xd500('0x27'),_0xd4ae54,_0x1e5102['error'][_0xd500('0x28')]);return _0x303cee(_0x1e5102[_0xd500('0x26')][_0xd500('0x28')]);}else{logger['info'](_0xd500('0x27'),_0xd4ae54,_0xd500('0x21'));_0x303cee(_0x1e5102[_0xd500('0x29')]['message']);}})[_0xd500('0x2a')](function(_0x3aa589){logger[_0xd500('0x26')](_0xd500('0x27'),_0xd4ae54,_0x3aa589);_0x280b98(_0x3aa589);});});}function respondWithStatusCode(_0x355ae4,_0x40bd35){_0x40bd35=_0x40bd35||0xcc;return function(_0x4271a8){if(_0x4271a8){return _0x355ae4[_0xd500('0x2b')](_0x40bd35);}return _0x355ae4['status'](_0x40bd35)['end']();};}function respondWithResult(_0x2293ed,_0x4ec701){_0x4ec701=_0x4ec701||0xc8;return function(_0x48a51b){if(_0x48a51b){return _0x2293ed[_0xd500('0x2c')](_0x4ec701)[_0xd500('0x2d')](_0x48a51b);}};}function respondWithFilteredResult(_0x31c43a,_0x199b92){return function(_0x598306){if(_0x598306){var _0x350cc7=typeof _0x199b92[_0xd500('0x2e')]===_0xd500('0x2f')&&typeof _0x199b92[_0xd500('0x30')]===_0xd500('0x2f');var _0x127a9e=_0x598306['count'];var _0x2c5f4b=_0x350cc7?0x0:_0x199b92[_0xd500('0x2e')];var _0x48c667=_0x350cc7?_0x598306[_0xd500('0x31')]:_0x199b92['offset']+_0x199b92['limit'];var _0x3646ee;if(_0x48c667>=_0x127a9e){_0x48c667=_0x127a9e;_0x3646ee=0xc8;}else{_0x3646ee=0xce;}_0x31c43a[_0xd500('0x2c')](_0x3646ee);return _0x31c43a['set'](_0xd500('0x32'),_0x2c5f4b+'-'+_0x48c667+'/'+_0x127a9e)['json'](_0x598306);}return null;};}function patchUpdates(_0x22af97){return function(_0x479661){try{jsonpatch[_0xd500('0x33')](_0x479661,_0x22af97,!![]);}catch(_0x295a8e){return BPromise[_0xd500('0x34')](_0x295a8e);}return _0x479661[_0xd500('0x35')]();};}function saveUpdates(_0x134bd5,_0x46cb3b){return function(_0x48158a){if(_0x48158a){return _0x48158a[_0xd500('0x36')](_0x134bd5)['then'](function(_0x1e4d2f){return _0x1e4d2f;});}return null;};}function removeEntity(_0x344bf6,_0x395608){return function(_0x8f4cd3){if(_0x8f4cd3){return _0x8f4cd3[_0xd500('0x37')]()['then'](function(){var _0x5b0115=_0x8f4cd3[_0xd500('0x38')]({'plain':!![]});var _0x5424e1=_0xd500('0x39');return db[_0xd500('0x3a')]['destroy']({'where':{'type':_0x5424e1,'resourceId':_0x5b0115['id']}})[_0xd500('0x1f')](function(){return _0x8f4cd3;});})[_0xd500('0x1f')](function(){_0x344bf6[_0xd500('0x2c')](0xcc)[_0xd500('0x3b')]();});}};}function handleEntityNotFound(_0x219efc,_0x4af386){return function(_0x4de4db){if(!_0x4de4db){_0x219efc[_0xd500('0x2b')](0x194);}return _0x4de4db;};}function handleError(_0xdbc86b,_0x13bfc1){_0x13bfc1=_0x13bfc1||0x1f4;return function(_0x48483e){logger[_0xd500('0x26')](_0x48483e['stack']);if(_0x48483e[_0xd500('0x3c')]){delete _0x48483e[_0xd500('0x3c')];}_0xdbc86b[_0xd500('0x2c')](_0x13bfc1)[_0xd500('0x3d')](_0x48483e);};}exports[_0xd500('0x3e')]=function(_0xbd2983,_0x43e118){var _0x4a259d={},_0x4d1424={},_0x34ef3f={'count':0x0,'rows':[]};var _0x1b82fe=_['map'](db[_0xd500('0x3f')][_0xd500('0x40')],function(_0x2cc128){return{'name':_0x2cc128[_0xd500('0x41')],'type':_0x2cc128['type'][_0xd500('0x42')]};});_0x4d1424[_0xd500('0x43')]=_[_0xd500('0x44')](_0x1b82fe,_0xd500('0x3c'));_0x4d1424[_0xd500('0x45')]=_[_0xd500('0x46')](_0xbd2983[_0xd500('0x45')]);_0x4d1424[_0xd500('0x47')]=_[_0xd500('0x48')](_0x4d1424[_0xd500('0x43')],_0x4d1424['query']);_0x4a259d[_0xd500('0x49')]=_['intersection'](_0x4d1424[_0xd500('0x43')],qs[_0xd500('0x4a')](_0xbd2983['query'][_0xd500('0x4a')]));_0x4a259d[_0xd500('0x49')]=_0x4a259d[_0xd500('0x49')][_0xd500('0x4b')]?_0x4a259d['attributes']:_0x4d1424[_0xd500('0x43')];if(!_0xbd2983[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x4a259d['limit']=qs[_0xd500('0x30')](_0xbd2983[_0xd500('0x45')][_0xd500('0x30')]);_0x4a259d['offset']=qs[_0xd500('0x2e')](_0xbd2983[_0xd500('0x45')][_0xd500('0x2e')]);}_0x4a259d[_0xd500('0x4e')]=qs[_0xd500('0x4f')](_0xbd2983[_0xd500('0x45')][_0xd500('0x4f')]);_0x4a259d[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0xbd2983[_0xd500('0x45')],_0x4d1424['filters']),_0x1b82fe);if(_0xbd2983[_0xd500('0x45')]['filter']){_0x4a259d[_0xd500('0x50')]=_['merge'](_0x4a259d[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x1b82fe,function(_0x383e66){if(_0x383e66[_0xd500('0x52')]!==_0xd500('0x53')){var _0x3a35ec={};_0x3a35ec[_0x383e66[_0xd500('0x3c')]]={'$like':'%'+_0xbd2983['query'][_0xd500('0x54')]+'%'};return _0x3a35ec;}})});}_0x4a259d=_[_0xd500('0x55')]({},_0x4a259d,_0xbd2983[_0xd500('0x56')]);var _0x3a9938={'where':_0x4a259d['where']};return db[_0xd500('0x3f')]['count'](_0x3a9938)[_0xd500('0x1f')](function(_0xd96122){_0x34ef3f[_0xd500('0x31')]=_0xd96122;if(_0xbd2983[_0xd500('0x45')][_0xd500('0x57')]){_0x4a259d[_0xd500('0x58')]=[{'all':!![]}];}return db['ChatQueue'][_0xd500('0x59')](_0x4a259d);})[_0xd500('0x1f')](function(_0xc2f93b){_0x34ef3f[_0xd500('0x5a')]=_0xc2f93b;return _0x34ef3f;})[_0xd500('0x1f')](respondWithFilteredResult(_0x43e118,_0x4a259d))[_0xd500('0x2a')](handleError(_0x43e118,null));};exports['show']=function(_0x475ee9,_0x53a1fc){var _0x5a9652={'raw':!![],'where':{'id':_0x475ee9[_0xd500('0x5b')]['id']}},_0x30acd8={};_0x30acd8['model']=_['keys'](db['ChatQueue'][_0xd500('0x40')]);_0x30acd8['query']=_[_0xd500('0x46')](_0x475ee9['query']);_0x30acd8[_0xd500('0x47')]=_[_0xd500('0x48')](_0x30acd8['model'],_0x30acd8[_0xd500('0x45')]);_0x5a9652[_0xd500('0x49')]=_[_0xd500('0x48')](_0x30acd8[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x475ee9[_0xd500('0x45')][_0xd500('0x4a')]));_0x5a9652[_0xd500('0x49')]=_0x5a9652[_0xd500('0x49')]['length']?_0x5a9652['attributes']:_0x30acd8[_0xd500('0x43')];if(_0x475ee9[_0xd500('0x45')]['includeAll']){_0x5a9652[_0xd500('0x58')]=[{'all':!![]}];}_0x5a9652=_[_0xd500('0x55')]({},_0x5a9652,_0x475ee9['options']);return db[_0xd500('0x3f')]['find'](_0x5a9652)[_0xd500('0x1f')](handleEntityNotFound(_0x53a1fc,null))[_0xd500('0x1f')](respondWithResult(_0x53a1fc,null))[_0xd500('0x2a')](handleError(_0x53a1fc,null));};exports[_0xd500('0x5c')]=function(_0x52a24c,_0x1db396){return db[_0xd500('0x3f')][_0xd500('0x5c')](_0x52a24c[_0xd500('0x5d')],{})[_0xd500('0x1f')](function(_0x29f464){var _0x444128=_0x52a24c[_0xd500('0x5e')][_0xd500('0x38')]({'plain':!![]});if(!_0x444128)throw new Error(_0xd500('0x5f'));if(_0x444128[_0xd500('0x60')]===_0xd500('0x5e')){var _0x34a355=_0x29f464[_0xd500('0x38')]({'plain':!![]});var _0x375f32='ChatQueues';return db[_0xd500('0x61')][_0xd500('0x62')]({'where':{'name':_0x375f32,'userProfileId':_0x444128[_0xd500('0x63')]},'raw':!![]})[_0xd500('0x1f')](function(_0x5dd5f9){if(_0x5dd5f9&&_0x5dd5f9[_0xd500('0x64')]===0x0){return db[_0xd500('0x3a')]['create']({'name':_0x34a355[_0xd500('0x3c')],'resourceId':_0x34a355['id'],'type':_0x5dd5f9[_0xd500('0x3c')],'sectionId':_0x5dd5f9['id']},{})[_0xd500('0x1f')](function(){return _0x29f464;});}else{return _0x29f464;}})[_0xd500('0x2a')](function(_0x2e8826){logger[_0xd500('0x26')](_0xd500('0x65'),_0x2e8826);throw _0x2e8826;});}return _0x29f464;})[_0xd500('0x1f')](respondWithResult(_0x1db396,0xc9))['catch'](handleError(_0x1db396,null));};exports[_0xd500('0x36')]=function(_0x16a76e,_0x4a272e){if(_0x16a76e[_0xd500('0x5d')]['id']){delete _0x16a76e[_0xd500('0x5d')]['id'];}return db[_0xd500('0x3f')]['find']({'where':{'id':_0x16a76e['params']['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x4a272e,null))[_0xd500('0x1f')](saveUpdates(_0x16a76e[_0xd500('0x5d')],null))['then'](respondWithResult(_0x4a272e,null))[_0xd500('0x2a')](handleError(_0x4a272e,null));};exports[_0xd500('0x37')]=function(_0xe91f58,_0x4b51ad){return db[_0xd500('0x3f')][_0xd500('0x62')]({'where':{'id':_0xe91f58[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x4b51ad,null))[_0xd500('0x1f')](removeEntity(_0x4b51ad,null))[_0xd500('0x2a')](handleError(_0x4b51ad,null));};exports['describe']=function(_0x2c1839,_0x234ac1){return db[_0xd500('0x3f')]['describe']()[_0xd500('0x1f')](respondWithResult(_0x234ac1,null))[_0xd500('0x2a')](handleError(_0x234ac1,null));};exports[_0xd500('0x66')]=function(_0x269f3b,_0x390d88,_0x44e29b){var _0x84e652={'raw':!![],'where':{}},_0xf817a={},_0x5c559d;return db[_0xd500('0x3f')][_0xd500('0x67')]({'where':{'id':_0x269f3b[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x390d88,null))[_0xd500('0x1f')](function(_0x2396bd){if(_0x2396bd){_0x5c559d=_0x2396bd['get']({'plain':!![]});_0xf817a[_0xd500('0x43')]=_[_0xd500('0x46')](db['UserChatQueue'][_0xd500('0x40')]);_0xf817a[_0xd500('0x45')]=_[_0xd500('0x46')](_0x269f3b[_0xd500('0x45')]);_0xf817a[_0xd500('0x47')]=_[_0xd500('0x48')](_0xf817a[_0xd500('0x43')],_0xf817a[_0xd500('0x45')]);_0x84e652[_0xd500('0x49')]=_[_0xd500('0x48')](_0xf817a[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x269f3b['query'][_0xd500('0x4a')]));_0x84e652[_0xd500('0x49')]=_0x84e652[_0xd500('0x49')]['length']?_0x84e652[_0xd500('0x49')]:_0xf817a[_0xd500('0x43')];if(!_0x269f3b['query'][_0xd500('0x4c')](_0xd500('0x4d'))){_0x84e652[_0xd500('0x30')]=qs['limit'](_0x269f3b[_0xd500('0x45')][_0xd500('0x30')]);_0x84e652[_0xd500('0x2e')]=qs[_0xd500('0x2e')](_0x269f3b[_0xd500('0x45')][_0xd500('0x2e')]);}_0x84e652['order']=qs[_0xd500('0x4f')](_0x269f3b[_0xd500('0x45')][_0xd500('0x4f')]);_0x84e652[_0xd500('0x50')]=qs['filters'](_[_0xd500('0x51')](_0x269f3b[_0xd500('0x45')],_0xf817a[_0xd500('0x47')]));_0x84e652[_0xd500('0x50')][_0xd500('0x68')]=_0x2396bd['id'];if(_0x269f3b[_0xd500('0x45')][_0xd500('0x54')]){_0x84e652[_0xd500('0x50')]=_[_0xd500('0x55')](_0x84e652[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x84e652[_0xd500('0x49')],function(_0x295012){var _0xb7b3fd={};_0xb7b3fd[_0x295012]={'$like':'%'+_0x269f3b['query'][_0xd500('0x54')]+'%'};return _0xb7b3fd;})});}_0x84e652=_[_0xd500('0x55')]({},_0x84e652,_0x269f3b['options']);return db[_0xd500('0x69')][_0xd500('0x59')](_0x84e652);}})[_0xd500('0x1f')](function(_0x42ddad){if(_0x42ddad){return db['User']['findAndCountAll']({'where':{'id':_[_0xd500('0x44')](_0x42ddad,_0xd500('0x6a')),'role':_0xd500('0x6b')},'attributes':['id',_0xd500('0x3c'),_0xd500('0x6c'),'updatedAt',_0xd500('0x6d')]});}})['then'](function(_0x53d35f){if(_0x53d35f){return{'count':_0x53d35f['count'],'rows':_[_0xd500('0x44')](_0x53d35f[_0xd500('0x5a')],function(_0x337295){return{'membername':_0x337295[_0xd500('0x3c')],'UserId':_0x337295['id'],'queue_name':_0x5c559d[_0xd500('0x3c')],'ChatQueueId':_0x5c559d['id'],'interface':util[_0xd500('0x6e')](_0xd500('0x6f'),_0xd500('0x70'),_0x337295[_0xd500('0x3c')]),'penalty':0x0,'paused':_0x337295[_0xd500('0x6c')],'createdAt':_0x337295[_0xd500('0x6d')],'updatedAt':_0x337295['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x390d88,_0x84e652))[_0xd500('0x2a')](handleError(_0x390d88,null));};exports[_0xd500('0x71')]=function(_0x51c6fd,_0x4e83ec,_0x4eddf2){var _0x4aad62={};var _0x10c2e7={};var _0x1ac580;var _0x2af12a;return db['ChatQueue']['findOne']({'where':{'id':_0x51c6fd['params']['id']}})['then'](handleEntityNotFound(_0x4e83ec,null))[_0xd500('0x1f')](function(_0x49c3ba){if(_0x49c3ba){_0x1ac580=_0x49c3ba;_0x10c2e7[_0xd500('0x43')]=_[_0xd500('0x46')](db[_0xd500('0x72')]['rawAttributes']);_0x10c2e7[_0xd500('0x45')]=_[_0xd500('0x46')](_0x51c6fd[_0xd500('0x45')]);_0x10c2e7[_0xd500('0x47')]=_[_0xd500('0x48')](_0x10c2e7['model'],_0x10c2e7[_0xd500('0x45')]);_0x4aad62[_0xd500('0x49')]=_[_0xd500('0x48')](_0x10c2e7[_0xd500('0x43')],qs['fields'](_0x51c6fd[_0xd500('0x45')]['fields']));_0x4aad62[_0xd500('0x49')]=_0x4aad62['attributes'][_0xd500('0x4b')]?_0x4aad62[_0xd500('0x49')]:_0x10c2e7['model'];_0x4aad62[_0xd500('0x4e')]=qs[_0xd500('0x4f')](_0x51c6fd[_0xd500('0x45')]['sort']);_0x4aad62[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0x51c6fd[_0xd500('0x45')],_0x10c2e7['filters']));if(_0x51c6fd[_0xd500('0x45')]['filter']){_0x4aad62[_0xd500('0x50')]=_[_0xd500('0x55')](_0x4aad62['where'],{'$or':_[_0xd500('0x44')](_0x4aad62[_0xd500('0x49')],function(_0x2317c1){var _0x55a01d={};_0x55a01d[_0x2317c1]={'$like':'%'+_0x51c6fd['query'][_0xd500('0x54')]+'%'};return _0x55a01d;})});}_0x4aad62=_[_0xd500('0x55')]({},_0x4aad62,_0x51c6fd[_0xd500('0x56')]);return _0x1ac580[_0xd500('0x71')](_0x4aad62);}})[_0xd500('0x1f')](function(_0x480e2c){if(_0x480e2c){_0x2af12a=_0x480e2c[_0xd500('0x4b')];if(!_0x51c6fd[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x4aad62[_0xd500('0x30')]=qs[_0xd500('0x30')](_0x51c6fd[_0xd500('0x45')]['limit']);_0x4aad62[_0xd500('0x2e')]=qs['offset'](_0x51c6fd[_0xd500('0x45')][_0xd500('0x2e')]);}return _0x1ac580[_0xd500('0x71')](_0x4aad62);}})[_0xd500('0x1f')](function(_0x9b58f9){if(_0x9b58f9){return _0x9b58f9?{'count':_0x2af12a,'rows':_0x9b58f9}:null;}})[_0xd500('0x1f')](respondWithResult(_0x4e83ec,null))[_0xd500('0x2a')](handleError(_0x4e83ec,null));};exports[_0xd500('0x73')]=function(_0x2afb8d,_0x5d9928,_0x2cfd7a){var _0x1bf87a=_0x2afb8d[_0xd500('0x5d')][_0xd500('0x74')];return db[_0xd500('0x72')][_0xd500('0x59')]({'where':{'id':_0x1bf87a},'attributes':['id'],'include':[{'model':db[_0xd500('0x75')],'as':_0xd500('0x76'),'attributes':['id',_0xd500('0x3c'),_0xd500('0x77'),_0xd500('0x78'),'interface'],'raw':!![]}]})[_0xd500('0x1f')](function(_0x383860){if(_0x383860){var _0x1b6dff=_[_0xd500('0x79')](_0x383860,function(_0x3773ae){var _0x21e6be=_0x3773ae[_0xd500('0x38')]({'plain':!![]});return _0x21e6be[_0xd500('0x76')];});return db['ChatQueue']['find']({'where':{'id':_0x2afb8d[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](function(_0x7defce){return db[_0xd500('0x7a')][_0xd500('0x7b')](function(_0x353486){return _0x7defce[_0xd500('0x73')](_0x1bf87a,{'transaction':_0x353486})[_0xd500('0x1f')](function(){return BPromise[_0xd500('0x7c')](_0x1b6dff,function(_0x12db5b){return db[_0xd500('0x69')]['findOrCreate']({'where':{'UserId':_0x12db5b['id'],'ChatQueueId':_0x2afb8d[_0xd500('0x5b')]['id']},'transaction':_0x353486});});})[_0xd500('0x1f')](function(){_0x1b6dff['forEach'](function(_0xf36832){socket['emit'](_0xd500('0x7d'),{'UserId':_0xf36832['id'],'ChatQueueId':_0x7defce['id']});});});});});}})[_0xd500('0x1f')](respondWithStatusCode(_0x5d9928,null))['catch'](handleError(_0x5d9928,null));};exports[_0xd500('0x7e')]=function(_0x46aba1,_0x4883af,_0x5913d4){return db[_0xd500('0x72')][_0xd500('0x59')]({'where':{'id':_0x46aba1[_0xd500('0x45')][_0xd500('0x74')]},'attributes':['id'],'include':[{'model':db[_0xd500('0x75')],'as':_0xd500('0x76'),'attributes':['id'],'raw':!![]}]})[_0xd500('0x1f')](handleEntityNotFound(_0x4883af,null))[_0xd500('0x1f')](function(_0x8fbc3b){var _0x15d369=_['map'](_0x8fbc3b,'id');var _0x486f9f=[];var _0x21c46b=[];var _0x183e9a=squel[_0xd500('0x7f')]();_0x183e9a[_0xd500('0x80')](_0xd500('0x81'))[_0xd500('0x82')](_0xd500('0x83'),'tq')['join'](_0xd500('0x84'),'ut',_0xd500('0x85'))[_0xd500('0x50')](_0xd500('0x86'),_0x46aba1[_0xd500('0x5b')]['id']);for(var _0x419de8=0x0;_0x419de8<_0x8fbc3b[_0xd500('0x4b')];_0x419de8+=0x1){let _0x2df685=_0x8fbc3b[_0x419de8];for(var _0x1e5aec=0x0;_0x1e5aec<_0x2df685[_0xd500('0x76')][_0xd500('0x4b')];_0x1e5aec+=0x1){let _0x214815=_0x2df685[_0xd500('0x76')][_0x1e5aec];var _0x4c9995=_0x183e9a[_0xd500('0x87')]();_0x4c9995[_0xd500('0x50')](_0xd500('0x88'),_0x214815['id']);_0x21c46b[_0xd500('0x89')](db[_0xd500('0x7a')][_0xd500('0x45')](_0x4c9995['toString'](),{'type':db['sequelize'][_0xd500('0x8a')][_0xd500('0x8b')]})['then'](function(_0x4fd34c){if(_0x4fd34c[_0xd500('0x4b')]===0x1){return _0x214815['id'];}else{var _0x4dbf4f=_[_0xd500('0x8c')](_[_0xd500('0x44')](_0x4fd34c,_0xd500('0x8d')),function(_0x315db0){return _[_0xd500('0x8e')](_0x15d369,_0x315db0);});if(_0x4dbf4f){return _0x214815['id'];}}}));}}return BPromise[_0xd500('0x8f')](_0x21c46b)['then'](function(_0x29cb9a){_0x486f9f=_(_0x486f9f)[_0xd500('0x90')](_0x29cb9a)['compact']()[_0xd500('0x91')]();return db['ChatQueue'][_0xd500('0x62')]({'where':{'id':_0x46aba1[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](function(_0x5f05f1){return db['sequelize'][_0xd500('0x7b')](function(_0x5cac74){return _0x5f05f1[_0xd500('0x7e')](_0x46aba1[_0xd500('0x45')][_0xd500('0x74')],{'transaction':_0x5cac74})['then'](function(){if(!_[_0xd500('0x92')](_0x486f9f)){return _0x5f05f1[_0xd500('0x93')](_0x486f9f,{'transaction':_0x5cac74});}})[_0xd500('0x1f')](function(){_0x486f9f[_0xd500('0x94')](function(_0x202ea9){socket['emit'](_0xd500('0x95'),{'UserId':_0x202ea9,'ChatQueueId':_0x5f05f1['id']});});});});});});})[_0xd500('0x1f')](respondWithStatusCode(_0x4883af,null))['catch'](handleError(_0x4883af,null));};exports[_0xd500('0x96')]=function(_0x5e1e6f,_0x2f4bc8,_0x2eb1aa){return db[_0xd500('0x3f')]['find']({'where':{'id':_0x5e1e6f[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x2f4bc8,null))[_0xd500('0x1f')](function(_0x605c56){if(_0x605c56){return _0x605c56[_0xd500('0x96')](_0x5e1e6f[_0xd500('0x5d')][_0xd500('0x74')],_[_0xd500('0x97')](_0x5e1e6f[_0xd500('0x5d')],[_0xd500('0x74'),'id'])||{})['spread'](function(_0x1756b5){for(var _0x4e5b47=0x0;_0x4e5b47<_0x5e1e6f[_0xd500('0x5d')][_0xd500('0x74')][_0xd500('0x4b')];_0x4e5b47+=0x1){socket[_0xd500('0x98')](_0xd500('0x7d'),{'UserId':Number(_0x5e1e6f['body'][_0xd500('0x74')][_0x4e5b47]),'ChatQueueId':Number(_0x5e1e6f[_0xd500('0x5b')]['id'])});}return _0x1756b5;});}})[_0xd500('0x1f')](respondWithResult(_0x2f4bc8,null))[_0xd500('0x2a')](handleError(_0x2f4bc8,null));};exports[_0xd500('0x93')]=function(_0x5c5d36,_0x314055,_0x3b0144){return db[_0xd500('0x3f')]['find']({'where':{'id':_0x5c5d36['params']['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x314055,null))['then'](function(_0xb9b678){if(_0xb9b678){return _0xb9b678[_0xd500('0x93')](_0x5c5d36['query'][_0xd500('0x74')])[_0xd500('0x1f')](function(){if(_[_0xd500('0x99')](_0x5c5d36['query'][_0xd500('0x74')])){for(var _0x4a047a=0x0;_0x4a047a<_0x5c5d36['query'][_0xd500('0x74')][_0xd500('0x4b')];_0x4a047a+=0x1){socket[_0xd500('0x98')](_0xd500('0x95'),{'UserId':Number(_0x5c5d36[_0xd500('0x45')][_0xd500('0x74')][_0x4a047a]),'ChatQueueId':Number(_0x5c5d36['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x5c5d36[_0xd500('0x45')]['ids']),'ChatQueueId':Number(_0x5c5d36['params']['id'])});}});}})['then'](respondWithStatusCode(_0x314055,null))[_0xd500('0x2a')](handleError(_0x314055,null));};exports[_0xd500('0x9a')]=function(_0x2c264b,_0x21f9b8,_0x2b21e7){var _0x36947c={};var _0x1c7ecf={};var _0x47d5c0;var _0x3169d9;return db[_0xd500('0x3f')]['findOne']({'where':{'id':_0x2c264b['params']['id']}})['then'](handleEntityNotFound(_0x21f9b8,null))[_0xd500('0x1f')](function(_0x25811f){if(_0x25811f){_0x47d5c0=_0x25811f;_0x1c7ecf['model']=_[_0xd500('0x46')](db[_0xd500('0x75')][_0xd500('0x40')]);_0x1c7ecf[_0xd500('0x45')]=_[_0xd500('0x46')](_0x2c264b['query']);_0x1c7ecf[_0xd500('0x47')]=_['intersection'](_0x1c7ecf['model'],_0x1c7ecf[_0xd500('0x45')]);_0x36947c[_0xd500('0x49')]=_['intersection'](_0x1c7ecf[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x2c264b[_0xd500('0x45')]['fields']));_0x36947c['attributes']=_0x36947c[_0xd500('0x49')]['length']?_0x36947c['attributes']:_0x1c7ecf[_0xd500('0x43')];_0x36947c['order']=qs[_0xd500('0x4f')](_0x2c264b[_0xd500('0x45')][_0xd500('0x4f')]);_0x36947c[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0x2c264b['query'],_0x1c7ecf[_0xd500('0x47')]));if(_0x2c264b[_0xd500('0x45')]['filter']){_0x36947c[_0xd500('0x50')]=_[_0xd500('0x55')](_0x36947c[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x36947c[_0xd500('0x49')],function(_0x856734){var _0x19859e={};_0x19859e[_0x856734]={'$like':'%'+_0x2c264b[_0xd500('0x45')][_0xd500('0x54')]+'%'};return _0x19859e;})});}_0x36947c=_[_0xd500('0x55')]({},_0x36947c,_0x2c264b[_0xd500('0x56')]);return _0x47d5c0[_0xd500('0x9a')](_0x36947c);}})[_0xd500('0x1f')](function(_0x4884bc){if(_0x4884bc){_0x3169d9=_0x4884bc['length'];if(!_0x2c264b[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x36947c[_0xd500('0x30')]=qs[_0xd500('0x30')](_0x2c264b[_0xd500('0x45')][_0xd500('0x30')]);_0x36947c[_0xd500('0x2e')]=qs[_0xd500('0x2e')](_0x2c264b[_0xd500('0x45')][_0xd500('0x2e')]);}return _0x47d5c0[_0xd500('0x9a')](_0x36947c);}})[_0xd500('0x1f')](function(_0x5e9104){if(_0x5e9104){return _0x5e9104?{'count':_0x3169d9,'rows':_0x5e9104}:null;}})[_0xd500('0x1f')](respondWithResult(_0x21f9b8,null))[_0xd500('0x2a')](handleError(_0x21f9b8,null));};
\ No newline at end of file
+var _0x43f2=['request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','ChatQueues','UserProfileResource','end','stack','name','index','map','ChatQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','ChatQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x43f2,0x97));var _0x243f=function(_0x5aecfb,_0x4a149d){_0x5aecfb=_0x5aecfb-0x0;var _0x34b827=_0x43f2[_0x5aecfb];return _0x34b827;};'use strict';var emlformat=require(_0x243f('0x0'));var rimraf=require(_0x243f('0x1'));var zipdir=require(_0x243f('0x2'));var jsonpatch=require(_0x243f('0x3'));var rp=require(_0x243f('0x4'));var moment=require(_0x243f('0x5'));var BPromise=require(_0x243f('0x6'));var Mustache=require(_0x243f('0x7'));var util=require('util');var path=require(_0x243f('0x8'));var sox=require(_0x243f('0x9'));var csv=require('to-csv');var ejs=require(_0x243f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x243f('0xb'));var crypto=require(_0x243f('0xc'));var jsforce=require(_0x243f('0xd'));var deskjs=require(_0x243f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x243f('0xf'));var Redis=require('ioredis');var authService=require(_0x243f('0x10'));var qs=require(_0x243f('0x11'));var as=require(_0x243f('0x12'));var hardwareService=require(_0x243f('0x13'));var logger=require(_0x243f('0x14'))(_0x243f('0x15'));var utils=require(_0x243f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x243f('0x17'));var db=require(_0x243f('0x18'))['db'];config[_0x243f('0x19')]=_[_0x243f('0x1a')](config[_0x243f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x243f('0x1b'))(new Redis(config[_0x243f('0x19')]));require(_0x243f('0x1c'))[_0x243f('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x243f('0x1e')][_0x243f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xce6dc6,_0x545782,_0x20b5fb,_0x55f3f0){return new BPromise(function(_0x408f22,_0x22a92c){var _0x5de166=_0x55f3f0||client;return _0x5de166['request'](_0xce6dc6,_0x20b5fb)['then'](function(_0x1a115f){logger[_0x243f('0x20')](_0x243f('0x21'),_0x545782,'request\x20sent');logger[_0x243f('0x22')](_0x243f('0x23'),_0x545782,_0x243f('0x24'),JSON[_0x243f('0x25')](_0x1a115f));if(_0x1a115f[_0x243f('0x26')]){if(_0x1a115f[_0x243f('0x26')][_0x243f('0x27')]===0x1f4){logger[_0x243f('0x26')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x22a92c(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x408f22(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}else{logger[_0x243f('0x20')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x243f('0x24'));_0x408f22(_0x1a115f[_0x243f('0x29')]['message']);}})[_0x243f('0x2a')](function(_0x19c4a1){logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x19c4a1);_0x22a92c(_0x19c4a1);});});}function respondWithStatusCode(_0x776b3,_0x548ac0){_0x548ac0=_0x548ac0||0xcc;return function(_0x3bb3de){if(_0x3bb3de){return _0x776b3[_0x243f('0x2b')](_0x548ac0);}return _0x776b3[_0x243f('0x2c')](_0x548ac0)['end']();};}function respondWithResult(_0x305be2,_0x543c57){_0x543c57=_0x543c57||0xc8;return function(_0x19cb67){if(_0x19cb67){return _0x305be2[_0x243f('0x2c')](_0x543c57)[_0x243f('0x2d')](_0x19cb67);}};}function respondWithFilteredResult(_0x2c6aa1,_0x1c889f){return function(_0x4754e1){if(_0x4754e1){var _0x436ade=typeof _0x1c889f['offset']===_0x243f('0x2e')&&typeof _0x1c889f[_0x243f('0x2f')]==='undefined';var _0x4ddd69=_0x4754e1[_0x243f('0x30')];var _0x380146=_0x436ade?0x0:_0x1c889f['offset'];var _0xc43768=_0x436ade?_0x4754e1['count']:_0x1c889f[_0x243f('0x31')]+_0x1c889f[_0x243f('0x2f')];var _0x4bcc98;if(_0xc43768>=_0x4ddd69){_0xc43768=_0x4ddd69;_0x4bcc98=0xc8;}else{_0x4bcc98=0xce;}_0x2c6aa1[_0x243f('0x2c')](_0x4bcc98);return _0x2c6aa1['set'](_0x243f('0x32'),_0x380146+'-'+_0xc43768+'/'+_0x4ddd69)[_0x243f('0x2d')](_0x4754e1);}return null;};}function patchUpdates(_0x124cdc){return function(_0x5c923b){try{jsonpatch[_0x243f('0x33')](_0x5c923b,_0x124cdc,!![]);}catch(_0x162cb2){return BPromise[_0x243f('0x34')](_0x162cb2);}return _0x5c923b[_0x243f('0x35')]();};}function saveUpdates(_0x480d7b,_0x1d3a11){return function(_0x1ee370){if(_0x1ee370){return _0x1ee370[_0x243f('0x36')](_0x480d7b)[_0x243f('0x37')](function(_0x5a1b14){return _0x5a1b14;});}return null;};}function removeEntity(_0x199405,_0x38fe37){return function(_0x1f1f95){if(_0x1f1f95){return _0x1f1f95[_0x243f('0x38')]()['then'](function(){var _0x24b21c=_0x1f1f95['get']({'plain':!![]});var _0x499312=_0x243f('0x39');return db[_0x243f('0x3a')][_0x243f('0x38')]({'where':{'type':_0x499312,'resourceId':_0x24b21c['id']}})[_0x243f('0x37')](function(){return _0x1f1f95;});})['then'](function(){_0x199405['status'](0xcc)[_0x243f('0x3b')]();});}};}function handleEntityNotFound(_0x5856f5,_0x43a848){return function(_0x179f66){if(!_0x179f66){_0x5856f5[_0x243f('0x2b')](0x194);}return _0x179f66;};}function handleError(_0x31f6f5,_0x8eaee0){_0x8eaee0=_0x8eaee0||0x1f4;return function(_0x4be4ad){logger[_0x243f('0x26')](_0x4be4ad[_0x243f('0x3c')]);if(_0x4be4ad[_0x243f('0x3d')]){delete _0x4be4ad[_0x243f('0x3d')];}_0x31f6f5[_0x243f('0x2c')](_0x8eaee0)['send'](_0x4be4ad);};}exports[_0x243f('0x3e')]=function(_0x53985c,_0x4ad269){var _0x4038fd={},_0xd4130a={},_0x517359={'count':0x0,'rows':[]};var _0x2221e3=_[_0x243f('0x3f')](db[_0x243f('0x40')]['rawAttributes'],function(_0x272887){return{'name':_0x272887[_0x243f('0x41')],'type':_0x272887['type'][_0x243f('0x42')]};});_0xd4130a[_0x243f('0x43')]=_['map'](_0x2221e3,_0x243f('0x3d'));_0xd4130a[_0x243f('0x44')]=_['keys'](_0x53985c['query']);_0xd4130a[_0x243f('0x45')]=_[_0x243f('0x46')](_0xd4130a[_0x243f('0x43')],_0xd4130a['query']);_0x4038fd[_0x243f('0x47')]=_['intersection'](_0xd4130a[_0x243f('0x43')],qs[_0x243f('0x48')](_0x53985c['query']['fields']));_0x4038fd[_0x243f('0x47')]=_0x4038fd['attributes'][_0x243f('0x49')]?_0x4038fd[_0x243f('0x47')]:_0xd4130a['model'];if(!_0x53985c['query']['hasOwnProperty'](_0x243f('0x4a'))){_0x4038fd[_0x243f('0x2f')]=qs['limit'](_0x53985c['query'][_0x243f('0x2f')]);_0x4038fd['offset']=qs['offset'](_0x53985c[_0x243f('0x44')]['offset']);}_0x4038fd['order']=qs[_0x243f('0x4b')](_0x53985c[_0x243f('0x44')][_0x243f('0x4b')]);_0x4038fd[_0x243f('0x4c')]=qs['filters'](_['pick'](_0x53985c['query'],_0xd4130a[_0x243f('0x45')]),_0x2221e3);if(_0x53985c['query'][_0x243f('0x4d')]){_0x4038fd[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x4038fd[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x2221e3,function(_0x591466){if(_0x591466[_0x243f('0x4f')]!=='VIRTUAL'){var _0x1ce528={};_0x1ce528[_0x591466['name']]={'$like':'%'+_0x53985c[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x1ce528;}})});}_0x4038fd=_[_0x243f('0x4e')]({},_0x4038fd,_0x53985c[_0x243f('0x50')]);var _0x414d6e={'where':_0x4038fd['where']};return db[_0x243f('0x40')][_0x243f('0x30')](_0x414d6e)[_0x243f('0x37')](function(_0x408023){_0x517359[_0x243f('0x30')]=_0x408023;if(_0x53985c[_0x243f('0x44')][_0x243f('0x51')]){_0x4038fd[_0x243f('0x52')]=[{'all':!![]}];}return db[_0x243f('0x40')][_0x243f('0x53')](_0x4038fd);})[_0x243f('0x37')](function(_0x3ad657){_0x517359[_0x243f('0x54')]=_0x3ad657;return _0x517359;})['then'](respondWithFilteredResult(_0x4ad269,_0x4038fd))['catch'](handleError(_0x4ad269,null));};exports['show']=function(_0x371c55,_0x42d122){var _0x37a288={'raw':!![],'where':{'id':_0x371c55[_0x243f('0x55')]['id']}},_0x4afcc3={};_0x4afcc3[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x40')][_0x243f('0x57')]);_0x4afcc3[_0x243f('0x44')]=_['keys'](_0x371c55[_0x243f('0x44')]);_0x4afcc3[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],_0x4afcc3[_0x243f('0x44')]);_0x37a288[_0x243f('0x47')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],qs[_0x243f('0x48')](_0x371c55[_0x243f('0x44')][_0x243f('0x48')]));_0x37a288[_0x243f('0x47')]=_0x37a288[_0x243f('0x47')]['length']?_0x37a288[_0x243f('0x47')]:_0x4afcc3['model'];if(_0x371c55['query'][_0x243f('0x51')]){_0x37a288[_0x243f('0x52')]=[{'all':!![]}];}_0x37a288=_[_0x243f('0x4e')]({},_0x37a288,_0x371c55[_0x243f('0x50')]);return db['ChatQueue'][_0x243f('0x58')](_0x37a288)[_0x243f('0x37')](handleEntityNotFound(_0x42d122,null))[_0x243f('0x37')](respondWithResult(_0x42d122,null))[_0x243f('0x2a')](handleError(_0x42d122,null));};exports[_0x243f('0x59')]=function(_0x13a02e,_0x38a588){return db['ChatQueue'][_0x243f('0x59')](_0x13a02e['body'],{})['then'](function(_0xb05f7f){var _0x16c148=_0x13a02e[_0x243f('0x5a')][_0x243f('0x5b')]({'plain':!![]});if(!_0x16c148)throw new Error(_0x243f('0x5c'));if(_0x16c148[_0x243f('0x5d')]===_0x243f('0x5a')){var _0x5e8b90=_0xb05f7f[_0x243f('0x5b')]({'plain':!![]});var _0x17f49d=_0x243f('0x39');return db[_0x243f('0x5e')][_0x243f('0x58')]({'where':{'name':_0x17f49d,'userProfileId':_0x16c148[_0x243f('0x5f')]},'raw':!![]})[_0x243f('0x37')](function(_0xc829b3){if(_0xc829b3&&_0xc829b3[_0x243f('0x60')]===0x0){return db['UserProfileResource'][_0x243f('0x59')]({'name':_0x5e8b90[_0x243f('0x3d')],'resourceId':_0x5e8b90['id'],'type':_0xc829b3[_0x243f('0x3d')],'sectionId':_0xc829b3['id']},{})[_0x243f('0x37')](function(){return _0xb05f7f;});}else{return _0xb05f7f;}})[_0x243f('0x2a')](function(_0x152f30){logger[_0x243f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152f30);throw _0x152f30;});}return _0xb05f7f;})[_0x243f('0x37')](respondWithResult(_0x38a588,0xc9))[_0x243f('0x2a')](handleError(_0x38a588,null));};exports[_0x243f('0x36')]=function(_0x5383f2,_0x5b1873){if(_0x5383f2[_0x243f('0x61')]['id']){delete _0x5383f2[_0x243f('0x61')]['id'];}return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5383f2['params']['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x5b1873,null))[_0x243f('0x37')](saveUpdates(_0x5383f2['body'],null))[_0x243f('0x37')](respondWithResult(_0x5b1873,null))[_0x243f('0x2a')](handleError(_0x5b1873,null));};exports[_0x243f('0x38')]=function(_0x4ac4db,_0x1b7a67){return db['ChatQueue']['find']({'where':{'id':_0x4ac4db[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x1b7a67,null))['then'](removeEntity(_0x1b7a67,null))[_0x243f('0x2a')](handleError(_0x1b7a67,null));};exports[_0x243f('0x62')]=function(_0x45d7dc,_0x6f1b59){return db['ChatQueue'][_0x243f('0x62')]()['then'](respondWithResult(_0x6f1b59,null))[_0x243f('0x2a')](handleError(_0x6f1b59,null));};exports[_0x243f('0x63')]=function(_0x56ad7d,_0x3421ef,_0x312e63){var _0xfc36e5={'raw':!![],'where':{}},_0x2221ec={},_0x2764e3;return db['ChatQueue'][_0x243f('0x64')]({'where':{'id':_0x56ad7d[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x3421ef,null))[_0x243f('0x37')](function(_0x54fca3){if(_0x54fca3){_0x2764e3=_0x54fca3['get']({'plain':!![]});_0x2221ec['model']=_[_0x243f('0x56')](db[_0x243f('0x65')][_0x243f('0x57')]);_0x2221ec[_0x243f('0x44')]=_[_0x243f('0x56')](_0x56ad7d[_0x243f('0x44')]);_0x2221ec[_0x243f('0x45')]=_[_0x243f('0x46')](_0x2221ec['model'],_0x2221ec['query']);_0xfc36e5[_0x243f('0x47')]=_[_0x243f('0x46')](_0x2221ec[_0x243f('0x43')],qs['fields'](_0x56ad7d[_0x243f('0x44')]['fields']));_0xfc36e5[_0x243f('0x47')]=_0xfc36e5[_0x243f('0x47')][_0x243f('0x49')]?_0xfc36e5[_0x243f('0x47')]:_0x2221ec['model'];if(!_0x56ad7d[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0xfc36e5[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x56ad7d[_0x243f('0x44')]['limit']);_0xfc36e5['offset']=qs[_0x243f('0x31')](_0x56ad7d[_0x243f('0x44')][_0x243f('0x31')]);}_0xfc36e5[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x56ad7d['query'][_0x243f('0x4b')]);_0xfc36e5[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x56ad7d['query'],_0x2221ec[_0x243f('0x45')]));_0xfc36e5[_0x243f('0x4c')][_0x243f('0x69')]=_0x54fca3['id'];if(_0x56ad7d[_0x243f('0x44')][_0x243f('0x4d')]){_0xfc36e5[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0xfc36e5['where'],{'$or':_[_0x243f('0x3f')](_0xfc36e5['attributes'],function(_0x53948e){var _0x4610df={};_0x4610df[_0x53948e]={'$like':'%'+_0x56ad7d['query']['filter']+'%'};return _0x4610df;})});}_0xfc36e5=_[_0x243f('0x4e')]({},_0xfc36e5,_0x56ad7d[_0x243f('0x50')]);return db[_0x243f('0x65')]['findAll'](_0xfc36e5);}})['then'](function(_0x47d078){if(_0x47d078){return db['User'][_0x243f('0x6a')]({'where':{'id':_[_0x243f('0x3f')](_0x47d078,_0x243f('0x6b')),'role':'agent'},'attributes':['id',_0x243f('0x3d'),'chatPause',_0x243f('0x6c'),_0x243f('0x6d')]});}})['then'](function(_0x419c39){if(_0x419c39){return{'count':_0x419c39[_0x243f('0x30')],'rows':_['map'](_0x419c39[_0x243f('0x54')],function(_0x55acbc){return{'membername':_0x55acbc['name'],'UserId':_0x55acbc['id'],'queue_name':_0x2764e3[_0x243f('0x3d')],'ChatQueueId':_0x2764e3['id'],'interface':util[_0x243f('0x6e')](_0x243f('0x6f'),_0x243f('0x70'),_0x55acbc[_0x243f('0x3d')]),'penalty':0x0,'paused':_0x55acbc['chatPause'],'createdAt':_0x55acbc[_0x243f('0x6d')],'updatedAt':_0x55acbc[_0x243f('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3421ef,_0xfc36e5))[_0x243f('0x2a')](handleError(_0x3421ef,null));};exports[_0x243f('0x71')]=function(_0x825b5f,_0x268be6,_0x330501){var _0x566a56={};var _0x4fcf5f={};var _0xf7520e;var _0x1d4841;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x825b5f[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x268be6,null))[_0x243f('0x37')](function(_0x264188){if(_0x264188){_0xf7520e=_0x264188;_0x4fcf5f['model']=_[_0x243f('0x56')](db[_0x243f('0x72')]['rawAttributes']);_0x4fcf5f[_0x243f('0x44')]=_['keys'](_0x825b5f[_0x243f('0x44')]);_0x4fcf5f[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4fcf5f[_0x243f('0x43')],_0x4fcf5f[_0x243f('0x44')]);_0x566a56['attributes']=_[_0x243f('0x46')](_0x4fcf5f['model'],qs['fields'](_0x825b5f[_0x243f('0x44')][_0x243f('0x48')]));_0x566a56['attributes']=_0x566a56[_0x243f('0x47')]['length']?_0x566a56[_0x243f('0x47')]:_0x4fcf5f['model'];_0x566a56[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x825b5f['query'][_0x243f('0x4b')]);_0x566a56[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x825b5f[_0x243f('0x44')],_0x4fcf5f[_0x243f('0x45')]));if(_0x825b5f[_0x243f('0x44')]['filter']){_0x566a56['where']=_[_0x243f('0x4e')](_0x566a56[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x566a56[_0x243f('0x47')],function(_0x23f59b){var _0x38bfd9={};_0x38bfd9[_0x23f59b]={'$like':'%'+_0x825b5f[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x38bfd9;})});}_0x566a56=_[_0x243f('0x4e')]({},_0x566a56,_0x825b5f['options']);return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x54bdd2){if(_0x54bdd2){_0x1d4841=_0x54bdd2['length'];if(!_0x825b5f[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x566a56[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x825b5f[_0x243f('0x44')]['limit']);_0x566a56['offset']=qs['offset'](_0x825b5f[_0x243f('0x44')]['offset']);}return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x185534){if(_0x185534){return _0x185534?{'count':_0x1d4841,'rows':_0x185534}:null;}})[_0x243f('0x37')](respondWithResult(_0x268be6,null))[_0x243f('0x2a')](handleError(_0x268be6,null));};exports[_0x243f('0x73')]=function(_0x573645,_0x346899,_0x4748b6){var _0x495cbd=_0x573645[_0x243f('0x61')][_0x243f('0x74')];return db[_0x243f('0x72')]['findAll']({'where':{'id':_0x495cbd},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':'Agents','attributes':['id',_0x243f('0x3d'),_0x243f('0x76'),_0x243f('0x77'),_0x243f('0x78')],'raw':!![]}]})[_0x243f('0x37')](function(_0x206a3e){if(_0x206a3e){var _0xd02535=_[_0x243f('0x79')](_0x206a3e,function(_0x3eb9a9){var _0x4bf5be=_0x3eb9a9[_0x243f('0x5b')]({'plain':!![]});return _0x4bf5be[_0x243f('0x7a')];});return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x573645[_0x243f('0x55')]['id']}})[_0x243f('0x37')](function(_0xda7872){return db[_0x243f('0x7b')][_0x243f('0x7c')](function(_0x3fff63){return _0xda7872['addTeams'](_0x495cbd,{'transaction':_0x3fff63})['then'](function(){return BPromise[_0x243f('0x7d')](_0xd02535,function(_0x80a2d9){return db['UserChatQueue'][_0x243f('0x7e')]({'where':{'UserId':_0x80a2d9['id'],'ChatQueueId':_0x573645[_0x243f('0x55')]['id']},'transaction':_0x3fff63});});})[_0x243f('0x37')](function(){_0xd02535[_0x243f('0x7f')](function(_0x46b827){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':_0x46b827['id'],'ChatQueueId':_0xda7872['id']});});});});});}})[_0x243f('0x37')](respondWithStatusCode(_0x346899,null))[_0x243f('0x2a')](handleError(_0x346899,null));};exports[_0x243f('0x82')]=function(_0x5c02cd,_0x162f8d,_0x49942f){return db['Team'][_0x243f('0x53')]({'where':{'id':_0x5c02cd['query'][_0x243f('0x74')]},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':_0x243f('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x162f8d,null))['then'](function(_0x54e46b){var _0x86f2cc=_[_0x243f('0x3f')](_0x54e46b,'id');var _0x184235=[];var _0x383120=[];var _0x556155=squel[_0x243f('0x83')]();_0x556155[_0x243f('0x84')](_0x243f('0x85'))['from'](_0x243f('0x86'),'tq')[_0x243f('0x87')](_0x243f('0x88'),'ut',_0x243f('0x89'))['where']('ChatQueueId\x20=\x20?',_0x5c02cd[_0x243f('0x55')]['id']);for(var _0x5bb5ed=0x0;_0x5bb5ed<_0x54e46b[_0x243f('0x49')];_0x5bb5ed+=0x1){let _0x13e070=_0x54e46b[_0x5bb5ed];for(var _0x443147=0x0;_0x443147<_0x13e070[_0x243f('0x7a')][_0x243f('0x49')];_0x443147+=0x1){let _0x3e117b=_0x13e070['Agents'][_0x443147];var _0x51d2b5=_0x556155['clone']();_0x51d2b5[_0x243f('0x4c')]('ut.UserId\x20=\x20?',_0x3e117b['id']);_0x383120['push'](db['sequelize']['query'](_0x51d2b5[_0x243f('0x8a')](),{'type':db[_0x243f('0x7b')][_0x243f('0x8b')][_0x243f('0x8c')]})[_0x243f('0x37')](function(_0x38ce34){if(_0x38ce34[_0x243f('0x49')]===0x1){return _0x3e117b['id'];}else{var _0x394ff8=_[_0x243f('0x8d')](_['map'](_0x38ce34,_0x243f('0x8e')),function(_0x31709e){return _[_0x243f('0x8f')](_0x86f2cc,_0x31709e);});if(_0x394ff8){return _0x3e117b['id'];}}}));}}return BPromise[_0x243f('0x90')](_0x383120)[_0x243f('0x37')](function(_0x305cf8){_0x184235=_(_0x184235)[_0x243f('0x91')](_0x305cf8)[_0x243f('0x92')]()[_0x243f('0x93')]();return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5c02cd['params']['id']}})[_0x243f('0x37')](function(_0x2e4599){return db['sequelize']['transaction'](function(_0x16a592){return _0x2e4599['removeTeams'](_0x5c02cd['query'][_0x243f('0x74')],{'transaction':_0x16a592})[_0x243f('0x37')](function(){if(!_[_0x243f('0x94')](_0x184235)){return _0x2e4599['removeAgents'](_0x184235,{'transaction':_0x16a592});}})[_0x243f('0x37')](function(){_0x184235['forEach'](function(_0x1eb1c1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':_0x1eb1c1,'ChatQueueId':_0x2e4599['id']});});});});});});})[_0x243f('0x37')](respondWithStatusCode(_0x162f8d,null))[_0x243f('0x2a')](handleError(_0x162f8d,null));};exports[_0x243f('0x96')]=function(_0x30b216,_0x2e9f4a,_0x1c3ec8){return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x30b216['params']['id']}})['then'](handleEntityNotFound(_0x2e9f4a,null))[_0x243f('0x37')](function(_0x244cd5){if(_0x244cd5){return _0x244cd5['addAgents'](_0x30b216['body'][_0x243f('0x74')],_[_0x243f('0x97')](_0x30b216[_0x243f('0x61')],['ids','id'])||{})['spread'](function(_0x58c738){for(var _0x13c11c=0x0;_0x13c11c<_0x30b216[_0x243f('0x61')][_0x243f('0x74')][_0x243f('0x49')];_0x13c11c+=0x1){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':Number(_0x30b216[_0x243f('0x61')]['ids'][_0x13c11c]),'ChatQueueId':Number(_0x30b216['params']['id'])});}return _0x58c738;});}})['then'](respondWithResult(_0x2e9f4a,null))[_0x243f('0x2a')](handleError(_0x2e9f4a,null));};exports[_0x243f('0x98')]=function(_0x4305b6,_0x167eaa,_0x1031bd){return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x4305b6[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x167eaa,null))[_0x243f('0x37')](function(_0x3d0439){if(_0x3d0439){return _0x3d0439[_0x243f('0x98')](_0x4305b6[_0x243f('0x44')]['ids'])['then'](function(){if(_[_0x243f('0x99')](_0x4305b6[_0x243f('0x44')][_0x243f('0x74')])){for(var _0x706e34=0x0;_0x706e34<_0x4305b6[_0x243f('0x44')][_0x243f('0x74')]['length'];_0x706e34+=0x1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6[_0x243f('0x44')][_0x243f('0x74')][_0x706e34]),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}}else{socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6['query']['ids']),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x167eaa,null))[_0x243f('0x2a')](handleError(_0x167eaa,null));};exports['getAgents']=function(_0x432d62,_0x2778bb,_0x3ca30d){var _0x5753eb={};var _0x1b289c={};var _0x51f830;var _0x1c76ce;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x432d62[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x2778bb,null))[_0x243f('0x37')](function(_0x4c5e7e){if(_0x4c5e7e){_0x51f830=_0x4c5e7e;_0x1b289c[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x75')]['rawAttributes']);_0x1b289c['query']=_[_0x243f('0x56')](_0x432d62[_0x243f('0x44')]);_0x1b289c[_0x243f('0x45')]=_['intersection'](_0x1b289c[_0x243f('0x43')],_0x1b289c[_0x243f('0x44')]);_0x5753eb[_0x243f('0x47')]=_['intersection'](_0x1b289c[_0x243f('0x43')],qs[_0x243f('0x48')](_0x432d62[_0x243f('0x44')][_0x243f('0x48')]));_0x5753eb[_0x243f('0x47')]=_0x5753eb[_0x243f('0x47')]['length']?_0x5753eb['attributes']:_0x1b289c['model'];_0x5753eb[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x432d62[_0x243f('0x44')][_0x243f('0x4b')]);_0x5753eb[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x432d62[_0x243f('0x44')],_0x1b289c[_0x243f('0x45')]));if(_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]){_0x5753eb[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x5753eb['where'],{'$or':_[_0x243f('0x3f')](_0x5753eb[_0x243f('0x47')],function(_0x2f0737){var _0x5330ca={};_0x5330ca[_0x2f0737]={'$like':'%'+_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x5330ca;})});}_0x5753eb=_[_0x243f('0x4e')]({},_0x5753eb,_0x432d62['options']);return _0x51f830['getAgents'](_0x5753eb);}})[_0x243f('0x37')](function(_0x2a0607){if(_0x2a0607){_0x1c76ce=_0x2a0607[_0x243f('0x49')];if(!_0x432d62[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x5753eb[_0x243f('0x2f')]=qs['limit'](_0x432d62[_0x243f('0x44')][_0x243f('0x2f')]);_0x5753eb[_0x243f('0x31')]=qs['offset'](_0x432d62[_0x243f('0x44')][_0x243f('0x31')]);}return _0x51f830[_0x243f('0x9a')](_0x5753eb);}})[_0x243f('0x37')](function(_0x5b49fa){if(_0x5b49fa){return _0x5b49fa?{'count':_0x1c76ce,'rows':_0x5b49fa}:null;}})['then'](respondWithResult(_0x2778bb,null))[_0x243f('0x2a')](handleError(_0x2778bb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 996c661..0807f8a 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 _0x441a=['save','update','remove','hasOwnProperty','events','ChatQueue'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x441a,0x7c));var _0xa441=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x441a[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0xa441('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa441('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa441('0x2'),'afterUpdate':_0xa441('0x3'),'afterDestroy':_0xa441('0x4')};function emitEvent(_0xc8e953){return function(_0x4fad7d,_0x573d87,_0x3346aa){ChatQueueEvents['emit'](_0xc8e953+':'+_0x4fad7d['id'],_0x4fad7d);ChatQueueEvents['emit'](_0xc8e953,_0x4fad7d);_0x3346aa(null);};}for(var e in events){if(events[_0xa441('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x1c06=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x20c522,_0x50e1d2){var _0x346df6=function(_0x2ef44c){while(--_0x2ef44c){_0x20c522['push'](_0x20c522['shift']());}};_0x346df6(++_0x50e1d2);}(_0x1c06,0xc0));var _0x61c0=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x1c06[_0x4e90e3];return _0x295e5b;};'use strict';var EventEmitter=require(_0x61c0('0x0'));var ChatQueue=require(_0x61c0('0x1'))['db'][_0x61c0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x61c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61c0('0x4'),'afterDestroy':_0x61c0('0x5')};function emitEvent(_0x5a1865){return function(_0x3ccc01,_0xf4617f,_0x3dfe21){ChatQueueEvents[_0x61c0('0x6')](_0x5a1865+':'+_0x3ccc01['id'],_0x3ccc01);ChatQueueEvents[_0x61c0('0x6')](_0x5a1865,_0x3ccc01);_0x3dfe21(null);};}for(var e in events){if(events[_0x61c0('0x7')](e)){var event=events[e];ChatQueue[_0x61c0('0x8')](e,emitEvent(event));}}module[_0x61c0('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0f0703e..20d9775 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 _0xf596=['ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x47962a,_0x1ac3f4){var _0xaf0a07=function(_0x18f5fd){while(--_0x18f5fd){_0x47962a['push'](_0x47962a['shift']());}};_0xaf0a07(++_0x1ac3f4);}(_0xf596,0x1ca));var _0x6f59=function(_0x421f35,_0x52ba84){_0x421f35=_0x421f35-0x0;var _0x580a22=_0xf596[_0x421f35];return _0x580a22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f59('0x0'))(_0x6f59('0x1'));var moment=require(_0x6f59('0x2'));var BPromise=require(_0x6f59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f59('0x4'));var rimraf=require(_0x6f59('0x5'));var config=require(_0x6f59('0x6'));var attributes=require(_0x6f59('0x7'));module[_0x6f59('0x8')]=function(_0x7edd7,_0x26cb0f){return _0x7edd7[_0x6f59('0x9')](_0x6f59('0xa'),attributes,{'tableName':_0x6f59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe819=['api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xe819,0x17f));var _0x9e81=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe819[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9e81('0x0'));var util=require('util');var logger=require(_0x9e81('0x1'))(_0x9e81('0x2'));var moment=require(_0x9e81('0x3'));var BPromise=require(_0x9e81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e81('0x5'));var rimraf=require(_0x9e81('0x6'));var config=require(_0x9e81('0x7'));var attributes=require(_0x9e81('0x8'));module['exports']=function(_0x1ad12d,_0x30a50b){return _0x1ad12d['define'](_0x9e81('0x9'),attributes,{'tableName':_0x9e81('0xa'),'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 35a813f..acc5c96 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 _0x285b=['http','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','limit','include','map','model','attributes','ShowChatQueue','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xaf2d57,_0x1e904e){var _0x1e2141=function(_0x2bd658){while(--_0x2bd658){_0xaf2d57['push'](_0xaf2d57['shift']());}};_0x1e2141(++_0x1e904e);}(_0x285b,0x171));var _0xb285=function(_0x3a5d2f,_0x3d5590){_0x3a5d2f=_0x3a5d2f-0x0;var _0x107045=_0x285b[_0x3a5d2f];return _0x107045;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var moment=require(_0xb285('0x1'));var BPromise=require(_0xb285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))(_0xb285('0x7'));var config=require(_0xb285('0x8'));var jayson=require(_0xb285('0x9'));var client=jayson[_0xb285('0xa')][_0xb285('0xb')]({'port':0x232a});config[_0xb285('0xc')]=_['defaults'](config[_0xb285('0xc')],{'host':_0xb285('0xd'),'port':0x18eb});var socket=require(_0xb285('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xb285('0xf')](socket);function respondWithRpcPromise(_0x2556dc,_0x133cc7,_0xd138d8){return new BPromise(function(_0x4e5976,_0x3d2a2b){return client['request'](_0x2556dc,_0xd138d8)[_0xb285('0x10')](function(_0x46ef65){logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));logger[_0xb285('0x14')](_0xb285('0x15'),_0x133cc7,_0xb285('0x13'),JSON[_0xb285('0x16')](_0x46ef65));if(_0x46ef65[_0xb285('0x17')]){if(_0x46ef65['error']['code']===0x1f4){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')][_0xb285('0x18')]);return _0x3d2a2b(_0x46ef65['error'][_0xb285('0x18')]);}logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')]['message']);return _0x4e5976(_0x46ef65[_0xb285('0x17')]['message']);}else{logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));_0x4e5976(_0x46ef65['result'][_0xb285('0x18')]);}})[_0xb285('0x19')](function(_0x99b1e6){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x99b1e6);_0x3d2a2b(_0x99b1e6);});});}exports[_0xb285('0x1a')]=function(_0x17ad6f){var _0x378069=this;return new Promise(function(_0x402822,_0x5d77cb){return db[_0xb285('0x1b')][_0xb285('0x1c')]({'raw':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['where']||null:null,'attributes':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['attributes']||null:null,'limit':_0x17ad6f['options']?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1e')]||null:null,'include':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x8d9a16){return{'model':db[_0x8d9a16[_0xb285('0x21')]],'as':_0x8d9a16['as'],'attributes':_0x8d9a16[_0xb285('0x22')],'include':_0x8d9a16['include']?_[_0xb285('0x20')](_0x8d9a16[_0xb285('0x1f')],function(_0x56c81f){return{'model':db[_0x56c81f[_0xb285('0x21')]],'as':_0x56c81f['as'],'attributes':_0x56c81f['attributes'],'include':_0x56c81f[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x56c81f[_0xb285('0x1f')],function(_0x4377aa){return{'model':db[_0x4377aa[_0xb285('0x21')]],'as':_0x4377aa['as'],'attributes':_0x4377aa[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x4a4408){logger[_0xb285('0x11')]('GetChatQueue',_0x17ad6f);logger[_0xb285('0x14')](_0xb285('0x1a'),_0x17ad6f,JSON[_0xb285('0x16')](_0x4a4408));_0x402822(_0x4a4408);})[_0xb285('0x19')](function(_0x3f7139){logger[_0xb285('0x17')](_0xb285('0x1a'),_0x3f7139['message'],_0x17ad6f);_0x5d77cb(_0x378069[_0xb285('0x17')](0x1f4,_0x3f7139[_0xb285('0x18')]));});});};exports[_0xb285('0x23')]=function(_0x2ece08){var _0x152e0d=this;return new Promise(function(_0x521837,_0x4ed2b5){return db[_0xb285('0x1b')][_0xb285('0x24')]({'raw':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x25')]===undefined?!![]:![]:!![],'where':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')]['where']||null:null,'attributes':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x22')]||null:null,'include':_0x2ece08[_0xb285('0x1d')]?_0x2ece08['options'][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2ece08[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x2efbaf){return{'model':db[_0x2efbaf[_0xb285('0x21')]],'as':_0x2efbaf['as'],'attributes':_0x2efbaf['attributes'],'include':_0x2efbaf[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2efbaf['include'],function(_0x420fa8){return{'model':db[_0x420fa8[_0xb285('0x21')]],'as':_0x420fa8['as'],'attributes':_0x420fa8['attributes'],'include':_0x420fa8[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x420fa8['include'],function(_0x14ef0d){return{'model':db[_0x14ef0d[_0xb285('0x21')]],'as':_0x14ef0d['as'],'attributes':_0x14ef0d[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x1afa35){logger[_0xb285('0x11')](_0xb285('0x23'),_0x2ece08);logger[_0xb285('0x14')](_0xb285('0x23'),_0x2ece08,JSON['stringify'](_0x1afa35));_0x521837(_0x1afa35);})[_0xb285('0x19')](function(_0x2346f4){logger[_0xb285('0x17')](_0xb285('0x23'),_0x2346f4[_0xb285('0x18')],_0x2ece08);_0x4ed2b5(_0x152e0d[_0xb285('0x17')](0x1f4,_0x2346f4['message']));});});};
\ No newline at end of file
+var _0x30d6=['ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x5802bb,_0x4bef35){var _0x4b02b7=function(_0x3502a1){while(--_0x3502a1){_0x5802bb['push'](_0x5802bb['shift']());}};_0x4b02b7(++_0x4bef35);}(_0x30d6,0x1b0));var _0x630d=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x30d6[_0x3ee5df];return _0x446d24;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});config[_0x630d('0x9')]=_[_0x630d('0xa')](config[_0x630d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630d('0x9')]));require(_0x630d('0xb'))[_0x630d('0xc')](socket);function respondWithRpcPromise(_0x382760,_0x4d4f13,_0xc5bc63){return new BPromise(function(_0x43ea98,_0x2f88fb){return client[_0x630d('0xd')](_0x382760,_0xc5bc63)[_0x630d('0xe')](function(_0x4294d0){logger[_0x630d('0xf')](_0x630d('0x10'),_0x4d4f13,_0x630d('0x11'));logger[_0x630d('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'),JSON['stringify'](_0x4294d0));if(_0x4294d0[_0x630d('0x13')]){if(_0x4294d0[_0x630d('0x13')]['code']===0x1f4){logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);return _0x2f88fb(_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);}logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0['error'][_0x630d('0x14')]);return _0x43ea98(_0x4294d0['error'][_0x630d('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'));_0x43ea98(_0x4294d0[_0x630d('0x15')]['message']);}})[_0x630d('0x16')](function(_0x18e685){logger['error'](_0x630d('0x10'),_0x4d4f13,_0x18e685);_0x2f88fb(_0x18e685);});});}exports['GetChatQueue']=function(_0x4df27f){var _0x456b07=this;return new Promise(function(_0x53498b,_0x2d960f){return db[_0x630d('0x17')]['findAll']({'raw':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x4df27f[_0x630d('0x18')]?_0x4df27f['options']['where']||null:null,'attributes':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'limit':_0x4df27f['options']?_0x4df27f[_0x630d('0x18')][_0x630d('0x1b')]||null:null,'include':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')]['include']?_[_0x630d('0x1c')](_0x4df27f[_0x630d('0x18')][_0x630d('0x1d')],function(_0x2ba2c9){return{'model':db[_0x2ba2c9[_0x630d('0x1e')]],'as':_0x2ba2c9['as'],'attributes':_0x2ba2c9[_0x630d('0x1a')],'include':_0x2ba2c9[_0x630d('0x1d')]?_['map'](_0x2ba2c9[_0x630d('0x1d')],function(_0x5c5d36){return{'model':db[_0x5c5d36[_0x630d('0x1e')]],'as':_0x5c5d36['as'],'attributes':_0x5c5d36['attributes'],'include':_0x5c5d36['include']?_[_0x630d('0x1c')](_0x5c5d36[_0x630d('0x1d')],function(_0x3d62dd){return{'model':db[_0x3d62dd['model']],'as':_0x3d62dd['as'],'attributes':_0x3d62dd[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bed85){logger[_0x630d('0xf')](_0x630d('0x1f'),_0x4df27f);logger[_0x630d('0x12')](_0x630d('0x1f'),_0x4df27f,JSON[_0x630d('0x20')](_0x2bed85));_0x53498b(_0x2bed85);})[_0x630d('0x16')](function(_0x2d6d26){logger[_0x630d('0x13')](_0x630d('0x1f'),_0x2d6d26['message'],_0x4df27f);_0x2d960f(_0x456b07[_0x630d('0x13')](0x1f4,_0x2d6d26[_0x630d('0x14')]));});});};exports[_0x630d('0x21')]=function(_0x789005){var _0x25cf85=this;return new Promise(function(_0x18c8a2,_0x58e392){return db[_0x630d('0x17')][_0x630d('0x22')]({'raw':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x789005['options']?_0x789005[_0x630d('0x18')]['where']||null:null,'attributes':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'include':_0x789005[_0x630d('0x18')]?_0x789005['options'][_0x630d('0x1d')]?_['map'](_0x789005[_0x630d('0x18')][_0x630d('0x1d')],function(_0x63c194){return{'model':db[_0x63c194[_0x630d('0x1e')]],'as':_0x63c194['as'],'attributes':_0x63c194['attributes'],'include':_0x63c194[_0x630d('0x1d')]?_[_0x630d('0x1c')](_0x63c194['include'],function(_0xa10a79){return{'model':db[_0xa10a79[_0x630d('0x1e')]],'as':_0xa10a79['as'],'attributes':_0xa10a79[_0x630d('0x1a')],'include':_0xa10a79['include']?_[_0x630d('0x1c')](_0xa10a79[_0x630d('0x1d')],function(_0x22ae2c){return{'model':db[_0x22ae2c['model']],'as':_0x22ae2c['as'],'attributes':_0x22ae2c[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x630d('0xe')](function(_0x598a60){logger[_0x630d('0xf')](_0x630d('0x21'),_0x789005);logger[_0x630d('0x12')](_0x630d('0x21'),_0x789005,JSON[_0x630d('0x20')](_0x598a60));_0x18c8a2(_0x598a60);})[_0x630d('0x16')](function(_0x4609ce){logger[_0x630d('0x13')](_0x630d('0x21'),_0x4609ce['message'],_0x789005);_0x58e392(_0x25cf85[_0x630d('0x13')](0x1f4,_0x4609ce['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 1b87555..87a39a7 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 _0x524a=['./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2917cf,_0x223521){var _0xb1335b=function(_0x313d36){while(--_0x313d36){_0x2917cf['push'](_0x2917cf['shift']());}};_0xb1335b(++_0x223521);}(_0x524a,0xf5));var _0xa524=function(_0x520502,_0x4a38cb){_0x520502=_0x520502-0x0;var _0x216ce7=_0x524a[_0x520502];return _0x216ce7;};'use strict';var ChatQueueEvents=require(_0xa524('0x0'));var events=[_0xa524('0x1'),_0xa524('0x2'),_0xa524('0x3')];function createListener(_0x53c48c,_0x4a29b7){return function(_0x2ef77c){_0x4a29b7[_0xa524('0x4')](_0x53c48c,_0x2ef77c);};}function removeListener(_0x56ab08,_0x50ec75){return function(){ChatQueueEvents[_0xa524('0x5')](_0x56ab08,_0x50ec75);};}exports[_0xa524('0x6')]=function(_0x16227b){for(var _0x5f472f=0x0,_0x460738=events['length'];_0x5f472f<_0x460738;_0x5f472f++){var _0x3a2dd6=events[_0x5f472f];var _0x11aa98=createListener('chatQueue:'+_0x3a2dd6,_0x16227b);ChatQueueEvents['on'](_0x3a2dd6,_0x11aa98);}};
\ No newline at end of file
+var _0xe13a=['update','emit','removeListener','register','chatQueue:','save','remove'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0xe13a,0x178));var _0xae13=function(_0x859e7b,_0x560c8a){_0x859e7b=_0x859e7b-0x0;var _0xb9c8a8=_0xe13a[_0x859e7b];return _0xb9c8a8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xae13('0x0'),_0xae13('0x1'),_0xae13('0x2')];function createListener(_0x6066c0,_0x4cf961){return function(_0x3aaf90){_0x4cf961[_0xae13('0x3')](_0x6066c0,_0x3aaf90);};}function removeListener(_0x3ebbfe,_0x10abd7){return function(){ChatQueueEvents[_0xae13('0x4')](_0x3ebbfe,_0x10abd7);};}exports[_0xae13('0x5')]=function(_0x412a07){for(var _0x3379ed=0x0,_0x341ba4=events['length'];_0x3379ed<_0x341ba4;_0x3379ed++){var _0x2f6d10=events[_0x3379ed];var _0x2b2e1f=createListener(_0xae13('0x6')+_0x2f6d10,_0x412a07);ChatQueueEvents['on'](_0x2f6d10,_0x2b2e1f);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 46d14f0..e0f1c57 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x560509,_0x4a1347){var _0xf9b114=function(_0x3b0fe3){while(--_0x3b0fe3){_0x560509['push'](_0x560509['shift']());}};_0xf9b114(++_0x4a1347);}(_0x814b,0x1a2));var _0xb814=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0x814b[_0x6465b0];return _0x4884fe;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x266494,_0x34269f){var _0x446c0d=function(_0x438258){while(--_0x438258){_0x266494['push'](_0x266494['shift']());}};_0x446c0d(++_0x34269f);}(_0xe14b,0x93));var _0xbe14=function(_0x13fe04,_0x261b1c){_0x13fe04=_0x13fe04-0x0;var _0x45867b=_0xe14b[_0x13fe04];return _0x45867b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index bc99a8b..b98935d 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 _0x31f0=['exports','STRING','DATE','moment'];(function(_0x5bc17b,_0xf2a36f){var _0x10a5c0=function(_0x50a8da){while(--_0x50a8da){_0x5bc17b['push'](_0x5bc17b['shift']());}};_0x10a5c0(++_0xf2a36f);}(_0x31f0,0xb7));var _0x031f=function(_0x5db012,_0x156b6f){_0x5db012=_0x5db012-0x0;var _0x127ca8=_0x31f0[_0x5db012];return _0x127ca8;};'use strict';var moment=require(_0x031f('0x0'));var Sequelize=require('sequelize');module[_0x031f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x031f('0x2')]},'joinAt':{'type':Sequelize[_0x031f('0x3')]},'leaveAt':{'type':Sequelize[_0x031f('0x3')]},'acceptAt':{'type':Sequelize[_0x031f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0xee26=['sequelize','exports','STRING','DATE'];(function(_0x5a685a,_0x14937e){var _0x19db1c=function(_0xa06c44){while(--_0xa06c44){_0x5a685a['push'](_0x5a685a['shift']());}};_0x19db1c(++_0x14937e);}(_0xee26,0x9c));var _0x6ee2=function(_0xef338e,_0x22256e){_0xef338e=_0xef338e-0x0;var _0x3a3dde=_0xee26[_0xef338e];return _0x3a3dde;};'use strict';var moment=require('moment');var Sequelize=require(_0x6ee2('0x0'));module[_0x6ee2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6ee2('0x2')]},'joinAt':{'type':Sequelize[_0x6ee2('0x3')]},'leaveAt':{'type':Sequelize[_0x6ee2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6ee2('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 91207c8..9e5a593 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 _0xfb67=['create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','ChatQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','find'];(function(_0x4b01b7,_0x183b04){var _0x2ed185=function(_0x4a1222){while(--_0x4a1222){_0x4b01b7['push'](_0x4b01b7['shift']());}};_0x2ed185(++_0x183b04);}(_0xfb67,0xdd));var _0x7fb6=function(_0x4abeab,_0x5e52b8){_0x4abeab=_0x4abeab-0x0;var _0x3d9932=_0xfb67[_0x4abeab];return _0x3d9932;};'use strict';var emlformat=require(_0x7fb6('0x0'));var rimraf=require(_0x7fb6('0x1'));var zipdir=require(_0x7fb6('0x2'));var jsonpatch=require(_0x7fb6('0x3'));var rp=require(_0x7fb6('0x4'));var moment=require(_0x7fb6('0x5'));var BPromise=require(_0x7fb6('0x6'));var Mustache=require('mustache');var util=require(_0x7fb6('0x7'));var path=require(_0x7fb6('0x8'));var sox=require(_0x7fb6('0x9'));var csv=require(_0x7fb6('0xa'));var ejs=require(_0x7fb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xa'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb6('0x18'))['db'];function respondWithStatusCode(_0x1b6ac7,_0x3c594f){_0x3c594f=_0x3c594f||0xcc;return function(_0x549370){if(_0x549370){return _0x1b6ac7['sendStatus'](_0x3c594f);}return _0x1b6ac7['status'](_0x3c594f)['end']();};}function respondWithResult(_0x4fe18e,_0x59287e){_0x59287e=_0x59287e||0xc8;return function(_0x2e8b7c){if(_0x2e8b7c){return _0x4fe18e[_0x7fb6('0x19')](_0x59287e)['json'](_0x2e8b7c);}};}function respondWithFilteredResult(_0x196700,_0x3e4441){return function(_0x5046e2){if(_0x5046e2){var _0xb4c375=typeof _0x3e4441[_0x7fb6('0x1a')]===_0x7fb6('0x1b')&&typeof _0x3e4441[_0x7fb6('0x1c')]===_0x7fb6('0x1b');var _0x26c3ec=_0x5046e2[_0x7fb6('0x1d')];var _0x3ef701=_0xb4c375?0x0:_0x3e4441[_0x7fb6('0x1a')];var _0x5de506=_0xb4c375?_0x5046e2[_0x7fb6('0x1d')]:_0x3e4441[_0x7fb6('0x1a')]+_0x3e4441[_0x7fb6('0x1c')];var _0x169389;if(_0x5de506>=_0x26c3ec){_0x5de506=_0x26c3ec;_0x169389=0xc8;}else{_0x169389=0xce;}_0x196700[_0x7fb6('0x19')](_0x169389);return _0x196700[_0x7fb6('0x1e')](_0x7fb6('0x1f'),_0x3ef701+'-'+_0x5de506+'/'+_0x26c3ec)['json'](_0x5046e2);}return null;};}function patchUpdates(_0x5e6997){return function(_0x1fa63a){try{jsonpatch[_0x7fb6('0x20')](_0x1fa63a,_0x5e6997,!![]);}catch(_0x293c9d){return BPromise[_0x7fb6('0x21')](_0x293c9d);}return _0x1fa63a['save']();};}function saveUpdates(_0xc44cf5,_0x13ad95){return function(_0x490749){if(_0x490749){return _0x490749[_0x7fb6('0x22')](_0xc44cf5)['then'](function(_0x488cd2){return _0x488cd2;});}return null;};}function removeEntity(_0x34a4d1,_0x4b15e5){return function(_0x51ed55){if(_0x51ed55){return _0x51ed55['destroy']()[_0x7fb6('0x23')](function(){_0x34a4d1['status'](0xcc)[_0x7fb6('0x24')]();});}};}function handleEntityNotFound(_0x4a9866,_0x3566a1){return function(_0xc60290){if(!_0xc60290){_0x4a9866[_0x7fb6('0x25')](0x194);}return _0xc60290;};}function handleError(_0x260e8b,_0x253f23){_0x253f23=_0x253f23||0x1f4;return function(_0x4c9b90){logger[_0x7fb6('0x26')](_0x4c9b90['stack']);if(_0x4c9b90[_0x7fb6('0x27')]){delete _0x4c9b90[_0x7fb6('0x27')];}_0x260e8b['status'](_0x253f23)['send'](_0x4c9b90);};}exports['index']=function(_0x25216a,_0x440a04){var _0x35e18f={},_0x3bf606={},_0x7f3844={'count':0x0,'rows':[]};var _0x2bc3b9=_['map'](db[_0x7fb6('0x28')]['rawAttributes'],function(_0x4221c3){return{'name':_0x4221c3[_0x7fb6('0x29')],'type':_0x4221c3[_0x7fb6('0x2a')][_0x7fb6('0x2b')]};});_0x3bf606[_0x7fb6('0x2c')]=_[_0x7fb6('0x2d')](_0x2bc3b9,_0x7fb6('0x27'));_0x3bf606[_0x7fb6('0x2e')]=_[_0x7fb6('0x2f')](_0x25216a['query']);_0x3bf606[_0x7fb6('0x30')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],_0x3bf606[_0x7fb6('0x2e')]);_0x35e18f[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x25216a[_0x7fb6('0x2e')]['fields']));_0x35e18f[_0x7fb6('0x32')]=_0x35e18f[_0x7fb6('0x32')][_0x7fb6('0x34')]?_0x35e18f[_0x7fb6('0x32')]:_0x3bf606['model'];if(!_0x25216a['query'][_0x7fb6('0x35')](_0x7fb6('0x36'))){_0x35e18f[_0x7fb6('0x1c')]=qs[_0x7fb6('0x1c')](_0x25216a[_0x7fb6('0x2e')]['limit']);_0x35e18f[_0x7fb6('0x1a')]=qs[_0x7fb6('0x1a')](_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x1a')]);}_0x35e18f['order']=qs[_0x7fb6('0x37')](_0x25216a[_0x7fb6('0x2e')]['sort']);_0x35e18f[_0x7fb6('0x38')]=qs['filters'](_[_0x7fb6('0x39')](_0x25216a['query'],_0x3bf606[_0x7fb6('0x30')]),_0x2bc3b9);if(_0x25216a['query'][_0x7fb6('0x3a')]){_0x35e18f[_0x7fb6('0x38')]=_[_0x7fb6('0x3b')](_0x35e18f[_0x7fb6('0x38')],{'$or':_[_0x7fb6('0x2d')](_0x2bc3b9,function(_0x39edfe){if(_0x39edfe['type']!=='VIRTUAL'){var _0x5d237={};_0x5d237[_0x39edfe[_0x7fb6('0x27')]]={'$like':'%'+_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3a')]+'%'};return _0x5d237;}})});}_0x35e18f=_['merge']({},_0x35e18f,_0x25216a['options']);var _0x213e6a={'where':_0x35e18f['where']};return db[_0x7fb6('0x28')][_0x7fb6('0x1d')](_0x213e6a)[_0x7fb6('0x23')](function(_0x33828c){_0x7f3844[_0x7fb6('0x1d')]=_0x33828c;if(_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3c')]){_0x35e18f[_0x7fb6('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x35e18f);})[_0x7fb6('0x23')](function(_0x543de3){_0x7f3844[_0x7fb6('0x3e')]=_0x543de3;return _0x7f3844;})[_0x7fb6('0x23')](respondWithFilteredResult(_0x440a04,_0x35e18f))[_0x7fb6('0x3f')](handleError(_0x440a04,null));};exports[_0x7fb6('0x40')]=function(_0x6fa286,_0x3b77ba){var _0x1dbfb8={'raw':!![],'where':{'id':_0x6fa286['params']['id']}},_0x661d04={};_0x661d04['model']=_[_0x7fb6('0x2f')](db['ChatQueueReport'][_0x7fb6('0x41')]);_0x661d04['query']=_[_0x7fb6('0x2f')](_0x6fa286[_0x7fb6('0x2e')]);_0x661d04['filters']=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],_0x661d04[_0x7fb6('0x2e')]);_0x1dbfb8[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x6fa286[_0x7fb6('0x2e')][_0x7fb6('0x33')]));_0x1dbfb8['attributes']=_0x1dbfb8[_0x7fb6('0x32')]['length']?_0x1dbfb8[_0x7fb6('0x32')]:_0x661d04[_0x7fb6('0x2c')];if(_0x6fa286['query'][_0x7fb6('0x3c')]){_0x1dbfb8[_0x7fb6('0x3d')]=[{'all':!![]}];}_0x1dbfb8=_[_0x7fb6('0x3b')]({},_0x1dbfb8,_0x6fa286['options']);return db[_0x7fb6('0x28')][_0x7fb6('0x42')](_0x1dbfb8)[_0x7fb6('0x23')](handleEntityNotFound(_0x3b77ba,null))[_0x7fb6('0x23')](respondWithResult(_0x3b77ba,null))[_0x7fb6('0x3f')](handleError(_0x3b77ba,null));};exports[_0x7fb6('0x43')]=function(_0x363564,_0x4eac42){return db[_0x7fb6('0x28')][_0x7fb6('0x43')](_0x363564['body'],{})[_0x7fb6('0x23')](respondWithResult(_0x4eac42,0xc9))['catch'](handleError(_0x4eac42,null));};exports[_0x7fb6('0x22')]=function(_0x597eac,_0x2fb8f0){if(_0x597eac['body']['id']){delete _0x597eac[_0x7fb6('0x44')]['id'];}return db[_0x7fb6('0x28')]['find']({'where':{'id':_0x597eac[_0x7fb6('0x45')]['id']}})[_0x7fb6('0x23')](handleEntityNotFound(_0x2fb8f0,null))[_0x7fb6('0x23')](saveUpdates(_0x597eac[_0x7fb6('0x44')],null))[_0x7fb6('0x23')](respondWithResult(_0x2fb8f0,null))[_0x7fb6('0x3f')](handleError(_0x2fb8f0,null));};exports[_0x7fb6('0x46')]=function(_0x164bfd,_0x14993f){return db[_0x7fb6('0x28')][_0x7fb6('0x42')]({'where':{'id':_0x164bfd[_0x7fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x14993f,null))['then'](removeEntity(_0x14993f,null))[_0x7fb6('0x3f')](handleError(_0x14993f,null));};exports['describe']=function(_0x340a96,_0x18aa5f){return db[_0x7fb6('0x28')][_0x7fb6('0x47')]()['then'](respondWithResult(_0x18aa5f,null))[_0x7fb6('0x3f')](handleError(_0x18aa5f,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(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x46cb,0x84));var _0xb46c=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x46cb[_0x1d5a32];return _0x361ca0;};'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 2e22b2b..c60a4a3 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x263b35,_0x421508){var _0x48168e=function(_0x3bb3a6){while(--_0x3bb3a6){_0x263b35['push'](_0x263b35['shift']());}};_0x48168e(++_0x421508);}(_0xb10b,0x12a));var _0xbb10=function(_0x19754a,_0x3050aa){_0x19754a=_0x19754a-0x0;var _0x4f8f3f=_0xb10b[_0x19754a];return _0x4f8f3f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x435b13,_0x43f5b9){var _0x1309a3=function(_0xfe6e8a){while(--_0xfe6e8a){_0x435b13['push'](_0x435b13['shift']());}};_0x1309a3(++_0x43f5b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 4fdf773..1b69600 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 _0xa935=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','ChatQueueReport,\x20%s,\x20%s','error','message','info','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','update','attributes','limit','UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','request\x20sent','debug'];(function(_0x4d4fb3,_0x5b34bd){var _0x1c6a7c=function(_0x4ad730){while(--_0x4ad730){_0x4d4fb3['push'](_0x4d4fb3['shift']());}};_0x1c6a7c(++_0x5b34bd);}(_0xa935,0x13e));var _0x5a93=function(_0x14ddd4,_0x5b527d){_0x14ddd4=_0x14ddd4-0x0;var _0x421616=_0xa935[_0x14ddd4];return _0x421616;};'use strict';var _=require('lodash');var util=require(_0x5a93('0x0'));var moment=require(_0x5a93('0x1'));var BPromise=require(_0x5a93('0x2'));var rs=require(_0x5a93('0x3'));var fs=require('fs');var Redis=require(_0x5a93('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a93('0x5'));var config=require(_0x5a93('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5a93('0x7')][_0x5a93('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8c237b,_0x42ef93,_0x5a9803){return new BPromise(function(_0x4ee1c9,_0x44006c){return client[_0x5a93('0x9')](_0x8c237b,_0x5a9803)['then'](function(_0x2b8c9a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x42ef93,_0x5a93('0xa'));logger[_0x5a93('0xb')](_0x5a93('0xc'),_0x42ef93,_0x5a93('0xa'),JSON[_0x5a93('0xd')](_0x2b8c9a));if(_0x2b8c9a['error']){if(_0x2b8c9a['error'][_0x5a93('0xe')]===0x1f4){logger['error'](_0x5a93('0xf'),_0x42ef93,_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);return _0x44006c(_0x2b8c9a['error'][_0x5a93('0x11')]);}logger[_0x5a93('0x10')](_0x5a93('0xf'),_0x42ef93,_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);return _0x4ee1c9(_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);}else{logger[_0x5a93('0x12')](_0x5a93('0xf'),_0x42ef93,_0x5a93('0xa'));_0x4ee1c9(_0x2b8c9a['result'][_0x5a93('0x11')]);}})[_0x5a93('0x13')](function(_0x290c86){logger[_0x5a93('0x10')](_0x5a93('0xf'),_0x42ef93,_0x290c86);_0x44006c(_0x290c86);});});}exports[_0x5a93('0x14')]=function(_0x36bca7){var _0x52204f=this;return new Promise(function(_0x48ccb0,_0x38a969){return db[_0x5a93('0x15')]['create'](_0x36bca7[_0x5a93('0x16')],{'raw':_0x36bca7['options']?_0x36bca7[_0x5a93('0x17')][_0x5a93('0x18')]===undefined?!![]:![]:!![]})[_0x5a93('0x19')](function(_0x58fa83){logger[_0x5a93('0x12')](_0x5a93('0x14'),_0x36bca7);logger['debug'](_0x5a93('0x14'),_0x36bca7,JSON['stringify'](_0x58fa83));_0x48ccb0(_0x58fa83);})['catch'](function(_0x3c8090){logger['error'](_0x5a93('0x14'),_0x3c8090[_0x5a93('0x11')],_0x36bca7);_0x38a969(_0x52204f['error'](0x1f4,_0x3c8090['message']));});});};exports['UpdateChatQueueReport']=function(_0x1ffdc0){var _0x3d4b0e=this;return new Promise(function(_0x2277e0,_0x53ce2d){return db[_0x5a93('0x15')][_0x5a93('0x1a')](_0x1ffdc0[_0x5a93('0x16')],{'raw':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0['options'][_0x5a93('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ffdc0['options']?_0x1ffdc0[_0x5a93('0x17')]['where']||null:null,'attributes':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0[_0x5a93('0x17')][_0x5a93('0x1b')]||null:null,'limit':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0[_0x5a93('0x17')][_0x5a93('0x1c')]||null:null})[_0x5a93('0x19')](function(_0x54bf8d){logger[_0x5a93('0x12')]('UpdateChatQueueReport',_0x1ffdc0);logger[_0x5a93('0xb')](_0x5a93('0x1d'),_0x1ffdc0,JSON[_0x5a93('0xd')](_0x54bf8d));_0x2277e0(_0x54bf8d);})[_0x5a93('0x13')](function(_0x58229a){logger[_0x5a93('0x10')](_0x5a93('0x1d'),_0x58229a[_0x5a93('0x11')],_0x1ffdc0);_0x53ce2d(_0x3d4b0e[_0x5a93('0x10')](0x1f4,_0x58229a[_0x5a93('0x11')]));});});};
\ No newline at end of file
+var _0x0cce=['message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c81c2,_0x3e18a2){var _0x16a5a4=function(_0x3d60ec){while(--_0x3d60ec){_0x5c81c2['push'](_0x5c81c2['shift']());}};_0x16a5a4(++_0x3e18a2);}(_0x0cce,0xf6));var _0xe0cc=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x0cce[_0x3e0dc4];return _0x586111;};'use strict';var _=require(_0xe0cc('0x0'));var util=require(_0xe0cc('0x1'));var moment=require(_0xe0cc('0x2'));var BPromise=require(_0xe0cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0cc('0x4'));var db=require(_0xe0cc('0x5'))['db'];var utils=require(_0xe0cc('0x6'));var logger=require('../../config/logger')(_0xe0cc('0x7'));var config=require(_0xe0cc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe0cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437d77,_0x2c06bb,_0x2d0a0d){return new BPromise(function(_0x1354e6,_0x1a48ab){return client[_0xe0cc('0xa')](_0x437d77,_0x2d0a0d)[_0xe0cc('0xb')](function(_0x353b76){logger[_0xe0cc('0xc')](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));logger['debug'](_0xe0cc('0xf'),_0x2c06bb,'request\x20sent',JSON[_0xe0cc('0x10')](_0x353b76));if(_0x353b76[_0xe0cc('0x11')]){if(_0x353b76[_0xe0cc('0x11')]['code']===0x1f4){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1a48ab(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}logger['error'](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1354e6(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}else{logger['info'](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));_0x1354e6(_0x353b76[_0xe0cc('0x13')][_0xe0cc('0x12')]);}})['catch'](function(_0x5708be){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x5708be);_0x1a48ab(_0x5708be);});});}exports[_0xe0cc('0x14')]=function(_0x5777e3){var _0x2ea767=this;return new Promise(function(_0x585760,_0x1e2bf9){return db[_0xe0cc('0x15')][_0xe0cc('0x16')](_0x5777e3['body'],{'raw':_0x5777e3[_0xe0cc('0x17')]?_0x5777e3['options'][_0xe0cc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x597136){logger[_0xe0cc('0xc')](_0xe0cc('0x14'),_0x5777e3);logger['debug'](_0xe0cc('0x14'),_0x5777e3,JSON[_0xe0cc('0x10')](_0x597136));_0x585760(_0x597136);})[_0xe0cc('0x19')](function(_0x4aca44){logger[_0xe0cc('0x11')](_0xe0cc('0x14'),_0x4aca44[_0xe0cc('0x12')],_0x5777e3);_0x1e2bf9(_0x2ea767[_0xe0cc('0x11')](0x1f4,_0x4aca44['message']));});});};exports[_0xe0cc('0x1a')]=function(_0x1c45af){var _0x24c006=this;return new Promise(function(_0x5c9382,_0x28b7ac){return db[_0xe0cc('0x15')][_0xe0cc('0x1b')](_0x1c45af[_0xe0cc('0x1c')],{'raw':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c45af['options']?_0x1c45af['options'][_0xe0cc('0x1d')]||null:null,'attributes':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1e')]||null:null,'limit':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1f')]||null:null})['then'](function(_0x5ef449){logger[_0xe0cc('0xc')](_0xe0cc('0x1a'),_0x1c45af);logger[_0xe0cc('0x20')](_0xe0cc('0x1a'),_0x1c45af,JSON[_0xe0cc('0x10')](_0x5ef449));_0x5c9382(_0x5ef449);})['catch'](function(_0x2b8aa9){logger[_0xe0cc('0x11')]('UpdateChatQueueReport',_0x2b8aa9[_0xe0cc('0x12')],_0x1c45af);_0x28b7ac(_0x24c006[_0xe0cc('0x11')](0x1f4,_0x2b8aa9[_0xe0cc('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index de0711e..4300b84 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 _0x59ec=['/:id','show','post','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x1f016c,_0x418c4c){var _0x4f6c97=function(_0x35e128){while(--_0x35e128){_0x1f016c['push'](_0x1f016c['shift']());}};_0x4f6c97(++_0x418c4c);}(_0x59ec,0x110));var _0xc59e=function(_0x3f444e,_0x3400b1){_0x3f444e=_0x3f444e-0x0;var _0xd20cb6=_0x59ec[_0x3f444e];return _0xd20cb6;};'use strict';var multer=require(_0xc59e('0x0'));var util=require(_0xc59e('0x1'));var path=require(_0xc59e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc59e('0x3'));var router=express['Router']();var fs_extra=require(_0xc59e('0x4'));var auth=require(_0xc59e('0x5'));var interaction=require(_0xc59e('0x6'));var config=require(_0xc59e('0x7'));var controller=require(_0xc59e('0x8'));router[_0xc59e('0x9')]('/',auth[_0xc59e('0xa')](),controller[_0xc59e('0xb')]);router[_0xc59e('0x9')]('/describe',auth[_0xc59e('0xa')](),controller[_0xc59e('0xc')]);router[_0xc59e('0x9')](_0xc59e('0xd'),auth[_0xc59e('0xa')](),controller[_0xc59e('0xe')]);router[_0xc59e('0xf')]('/',auth[_0xc59e('0xa')](),controller['create']);router[_0xc59e('0x10')](_0xc59e('0xd'),auth[_0xc59e('0xa')](),controller[_0xc59e('0x11')]);router[_0xc59e('0x12')]('/:id',auth[_0xc59e('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc5df=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','multer'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0xc5df,0x143));var _0xfc5d=function(_0x2d0b33,_0x13b6d3){_0x2d0b33=_0x2d0b33-0x0;var _0x5ceb77=_0xc5df[_0x2d0b33];return _0x5ceb77;};'use strict';var multer=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfc5d('0x2'));var router=express[_0xfc5d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc5d('0x4'));var interaction=require(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var controller=require(_0xfc5d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc5d('0x8')]);router['get'](_0xfc5d('0x9'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xb')]);router['get'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xd')]);router[_0xfc5d('0xe')]('/',auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xf')]);router['put'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0x10')]);router[_0xfc5d('0x11')](_0xfc5d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f2a78ab..253c1f8 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x41ab07,_0x715c14){var _0x53b179=function(_0x26fdc0){while(--_0x26fdc0){_0x41ab07['push'](_0x41ab07['shift']());}};_0x53b179(++_0x715c14);}(_0xe706,0xa3));var _0x6e70=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xe706[_0xaff1bd];return _0x52ad89;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x34e8,0x12c));var _0x834e=function(_0x3528b4,_0x3b1fa1){_0x3528b4=_0x3528b4-0x0;var _0x45462a=_0x34e8[_0x3528b4];return _0x45462a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 0efcfee..7d7e0b2 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 _0x9f59=['fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes'];(function(_0x4f3562,_0x35a031){var _0x394b48=function(_0x3bf0b5){while(--_0x3bf0b5){_0x4f3562['push'](_0x4f3562['shift']());}};_0x394b48(++_0x35a031);}(_0x9f59,0x69));var _0x99f5=function(_0x153f2e,_0x4f8375){_0x153f2e=_0x153f2e-0x0;var _0x4ef8a2=_0x9f59[_0x153f2e];return _0x4ef8a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99f5('0x0'));var zipdir=require(_0x99f5('0x1'));var jsonpatch=require(_0x99f5('0x2'));var rp=require(_0x99f5('0x3'));var moment=require(_0x99f5('0x4'));var BPromise=require(_0x99f5('0x5'));var Mustache=require('mustache');var util=require(_0x99f5('0x6'));var path=require(_0x99f5('0x7'));var sox=require('sox');var csv=require(_0x99f5('0x8'));var ejs=require(_0x99f5('0x9'));var fs=require('fs');var fs_extra=require(_0x99f5('0xa'));var _=require(_0x99f5('0xb'));var squel=require(_0x99f5('0xc'));var crypto=require(_0x99f5('0xd'));var jsforce=require(_0x99f5('0xe'));var deskjs=require(_0x99f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x99f5('0x10'));var Redis=require(_0x99f5('0x11'));var authService=require(_0x99f5('0x12'));var qs=require(_0x99f5('0x13'));var as=require(_0x99f5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f5('0x15'))('api');var utils=require(_0x99f5('0x16'));var config=require(_0x99f5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x99f5('0x18'))['db'];function respondWithStatusCode(_0x1740a6,_0x413a0a){_0x413a0a=_0x413a0a||0xcc;return function(_0xac38f8){if(_0xac38f8){return _0x1740a6[_0x99f5('0x19')](_0x413a0a);}return _0x1740a6[_0x99f5('0x1a')](_0x413a0a)[_0x99f5('0x1b')]();};}function respondWithResult(_0xfd366b,_0x4530e3){_0x4530e3=_0x4530e3||0xc8;return function(_0x2a21dc){if(_0x2a21dc){return _0xfd366b[_0x99f5('0x1a')](_0x4530e3)[_0x99f5('0x1c')](_0x2a21dc);}};}function respondWithFilteredResult(_0xdbe4b9,_0x1ce6b5){return function(_0x21ab39){if(_0x21ab39){var _0x12b22f=typeof _0x1ce6b5[_0x99f5('0x1d')]===_0x99f5('0x1e')&&typeof _0x1ce6b5[_0x99f5('0x1f')]===_0x99f5('0x1e');var _0x2759a3=_0x21ab39[_0x99f5('0x20')];var _0x2735bf=_0x12b22f?0x0:_0x1ce6b5[_0x99f5('0x1d')];var _0x364d1e=_0x12b22f?_0x21ab39[_0x99f5('0x20')]:_0x1ce6b5['offset']+_0x1ce6b5[_0x99f5('0x1f')];var _0x336fd7;if(_0x364d1e>=_0x2759a3){_0x364d1e=_0x2759a3;_0x336fd7=0xc8;}else{_0x336fd7=0xce;}_0xdbe4b9['status'](_0x336fd7);return _0xdbe4b9['set'](_0x99f5('0x21'),_0x2735bf+'-'+_0x364d1e+'/'+_0x2759a3)[_0x99f5('0x1c')](_0x21ab39);}return null;};}function patchUpdates(_0x4969ea){return function(_0x39569e){try{jsonpatch[_0x99f5('0x22')](_0x39569e,_0x4969ea,!![]);}catch(_0x39730a){return BPromise['reject'](_0x39730a);}return _0x39569e[_0x99f5('0x23')]();};}function saveUpdates(_0x195630,_0x56e801){return function(_0x253fc9){if(_0x253fc9){return _0x253fc9[_0x99f5('0x24')](_0x195630)[_0x99f5('0x25')](function(_0x14b73a){return _0x14b73a;});}return null;};}function removeEntity(_0x556096,_0x4cbc04){return function(_0x423592){if(_0x423592){return _0x423592[_0x99f5('0x26')]()[_0x99f5('0x25')](function(){_0x556096['status'](0xcc)[_0x99f5('0x1b')]();});}};}function handleEntityNotFound(_0x55c9e0,_0x1bd5cb){return function(_0x84e858){if(!_0x84e858){_0x55c9e0[_0x99f5('0x19')](0x194);}return _0x84e858;};}function handleError(_0x3592a9,_0x5e4477){_0x5e4477=_0x5e4477||0x1f4;return function(_0x10b18a){logger[_0x99f5('0x27')](_0x10b18a[_0x99f5('0x28')]);if(_0x10b18a[_0x99f5('0x29')]){delete _0x10b18a[_0x99f5('0x29')];}_0x3592a9[_0x99f5('0x1a')](_0x5e4477)[_0x99f5('0x2a')](_0x10b18a);};}exports[_0x99f5('0x2b')]=function(_0x403399,_0x46fbfa){var _0x46024c={},_0x3fd6cd={},_0x21f0fc={'count':0x0,'rows':[]};var _0x1e7e10=_[_0x99f5('0x2c')](db[_0x99f5('0x2d')][_0x99f5('0x2e')],function(_0x522885){return{'name':_0x522885[_0x99f5('0x2f')],'type':_0x522885[_0x99f5('0x30')][_0x99f5('0x31')]};});_0x3fd6cd[_0x99f5('0x32')]=_[_0x99f5('0x2c')](_0x1e7e10,_0x99f5('0x29'));_0x3fd6cd[_0x99f5('0x33')]=_[_0x99f5('0x34')](_0x403399['query']);_0x3fd6cd[_0x99f5('0x35')]=_['intersection'](_0x3fd6cd[_0x99f5('0x32')],_0x3fd6cd[_0x99f5('0x33')]);_0x46024c[_0x99f5('0x36')]=_[_0x99f5('0x37')](_0x3fd6cd[_0x99f5('0x32')],qs[_0x99f5('0x38')](_0x403399[_0x99f5('0x33')][_0x99f5('0x38')]));_0x46024c[_0x99f5('0x36')]=_0x46024c[_0x99f5('0x36')]['length']?_0x46024c['attributes']:_0x3fd6cd['model'];if(!_0x403399[_0x99f5('0x33')]['hasOwnProperty'](_0x99f5('0x39'))){_0x46024c['limit']=qs['limit'](_0x403399[_0x99f5('0x33')][_0x99f5('0x1f')]);_0x46024c['offset']=qs[_0x99f5('0x1d')](_0x403399[_0x99f5('0x33')][_0x99f5('0x1d')]);}_0x46024c[_0x99f5('0x3a')]=qs[_0x99f5('0x3b')](_0x403399[_0x99f5('0x33')]['sort']);_0x46024c['where']=qs[_0x99f5('0x35')](_['pick'](_0x403399[_0x99f5('0x33')],_0x3fd6cd[_0x99f5('0x35')]),_0x1e7e10);if(_0x403399[_0x99f5('0x33')]['filter']){_0x46024c[_0x99f5('0x3c')]=_[_0x99f5('0x3d')](_0x46024c['where'],{'$or':_[_0x99f5('0x2c')](_0x1e7e10,function(_0x3f472e){if(_0x3f472e[_0x99f5('0x30')]!==_0x99f5('0x3e')){var _0x4ec0c0={};_0x4ec0c0[_0x3f472e[_0x99f5('0x29')]]={'$like':'%'+_0x403399['query'][_0x99f5('0x3f')]+'%'};return _0x4ec0c0;}})});}_0x46024c=_[_0x99f5('0x3d')]({},_0x46024c,_0x403399['options']);var _0x4363d4={'where':_0x46024c[_0x99f5('0x3c')]};return db[_0x99f5('0x2d')][_0x99f5('0x20')](_0x4363d4)[_0x99f5('0x25')](function(_0x53c6af){_0x21f0fc[_0x99f5('0x20')]=_0x53c6af;if(_0x403399[_0x99f5('0x33')][_0x99f5('0x40')]){_0x46024c[_0x99f5('0x41')]=[{'all':!![]}];}return db[_0x99f5('0x2d')][_0x99f5('0x42')](_0x46024c);})[_0x99f5('0x25')](function(_0x172745){_0x21f0fc[_0x99f5('0x43')]=_0x172745;return _0x21f0fc;})[_0x99f5('0x25')](respondWithFilteredResult(_0x46fbfa,_0x46024c))[_0x99f5('0x44')](handleError(_0x46fbfa,null));};exports[_0x99f5('0x45')]=function(_0x22fcff,_0x3af615){var _0x47ac37={'raw':!![],'where':{'id':_0x22fcff[_0x99f5('0x46')]['id']}},_0x1e2d2d={};_0x1e2d2d[_0x99f5('0x32')]=_['keys'](db[_0x99f5('0x2d')][_0x99f5('0x2e')]);_0x1e2d2d['query']=_[_0x99f5('0x34')](_0x22fcff[_0x99f5('0x33')]);_0x1e2d2d[_0x99f5('0x35')]=_[_0x99f5('0x37')](_0x1e2d2d[_0x99f5('0x32')],_0x1e2d2d[_0x99f5('0x33')]);_0x47ac37[_0x99f5('0x36')]=_['intersection'](_0x1e2d2d[_0x99f5('0x32')],qs['fields'](_0x22fcff['query'][_0x99f5('0x38')]));_0x47ac37['attributes']=_0x47ac37[_0x99f5('0x36')][_0x99f5('0x47')]?_0x47ac37['attributes']:_0x1e2d2d[_0x99f5('0x32')];if(_0x22fcff[_0x99f5('0x33')][_0x99f5('0x40')]){_0x47ac37[_0x99f5('0x41')]=[{'all':!![]}];}_0x47ac37=_[_0x99f5('0x3d')]({},_0x47ac37,_0x22fcff[_0x99f5('0x48')]);return db[_0x99f5('0x2d')][_0x99f5('0x49')](_0x47ac37)[_0x99f5('0x25')](handleEntityNotFound(_0x3af615,null))['then'](respondWithResult(_0x3af615,null))[_0x99f5('0x44')](handleError(_0x3af615,null));};exports['create']=function(_0x406bcb,_0x23d064){return db['ChatTransferReport']['create'](_0x406bcb[_0x99f5('0x4a')],{})[_0x99f5('0x25')](respondWithResult(_0x23d064,0xc9))[_0x99f5('0x44')](handleError(_0x23d064,null));};exports[_0x99f5('0x24')]=function(_0x4d8a2d,_0x1ee4c0){if(_0x4d8a2d[_0x99f5('0x4a')]['id']){delete _0x4d8a2d[_0x99f5('0x4a')]['id'];}return db[_0x99f5('0x2d')][_0x99f5('0x49')]({'where':{'id':_0x4d8a2d[_0x99f5('0x46')]['id']}})[_0x99f5('0x25')](handleEntityNotFound(_0x1ee4c0,null))['then'](saveUpdates(_0x4d8a2d[_0x99f5('0x4a')],null))[_0x99f5('0x25')](respondWithResult(_0x1ee4c0,null))[_0x99f5('0x44')](handleError(_0x1ee4c0,null));};exports[_0x99f5('0x26')]=function(_0x3f2395,_0x12f231){return db[_0x99f5('0x2d')][_0x99f5('0x49')]({'where':{'id':_0x3f2395[_0x99f5('0x46')]['id']}})[_0x99f5('0x25')](handleEntityNotFound(_0x12f231,null))[_0x99f5('0x25')](removeEntity(_0x12f231,null))[_0x99f5('0x44')](handleError(_0x12f231,null));};exports[_0x99f5('0x4b')]=function(_0x5d3b8d,_0x328779){return db[_0x99f5('0x2d')][_0x99f5('0x4b')]()[_0x99f5('0x25')](respondWithResult(_0x328779,null))[_0x99f5('0x44')](handleError(_0x328779,null));};
\ No newline at end of file
+var _0x5227=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','rows','catch','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','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','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5227,0x113));var _0x7522=function(_0x3ec751,_0x3009cd){_0x3ec751=_0x3ec751-0x0;var _0x252150=_0x5227[_0x3ec751];return _0x252150;};'use strict';var emlformat=require(_0x7522('0x0'));var rimraf=require(_0x7522('0x1'));var zipdir=require(_0x7522('0x2'));var jsonpatch=require(_0x7522('0x3'));var rp=require('request-promise');var moment=require(_0x7522('0x4'));var BPromise=require(_0x7522('0x5'));var Mustache=require(_0x7522('0x6'));var util=require(_0x7522('0x7'));var path=require('path');var sox=require(_0x7522('0x8'));var csv=require(_0x7522('0x9'));var ejs=require(_0x7522('0xa'));var fs=require('fs');var fs_extra=require(_0x7522('0xb'));var _=require(_0x7522('0xc'));var squel=require(_0x7522('0xd'));var crypto=require(_0x7522('0xe'));var jsforce=require(_0x7522('0xf'));var deskjs=require(_0x7522('0x10'));var toCsv=require(_0x7522('0x9'));var querystring=require(_0x7522('0x11'));var Papa=require('papaparse');var Redis=require(_0x7522('0x12'));var authService=require(_0x7522('0x13'));var qs=require(_0x7522('0x14'));var as=require(_0x7522('0x15'));var hardwareService=require(_0x7522('0x16'));var logger=require(_0x7522('0x17'))(_0x7522('0x18'));var utils=require('../../config/utils');var config=require(_0x7522('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7522('0x1a'))['db'];function respondWithStatusCode(_0x826b2e,_0x35597d){_0x35597d=_0x35597d||0xcc;return function(_0x5eaa4d){if(_0x5eaa4d){return _0x826b2e[_0x7522('0x1b')](_0x35597d);}return _0x826b2e[_0x7522('0x1c')](_0x35597d)[_0x7522('0x1d')]();};}function respondWithResult(_0x32ccda,_0x327b52){_0x327b52=_0x327b52||0xc8;return function(_0x51f7c2){if(_0x51f7c2){return _0x32ccda['status'](_0x327b52)['json'](_0x51f7c2);}};}function respondWithFilteredResult(_0x5f51d2,_0x4e1916){return function(_0x271f6c){if(_0x271f6c){var _0x2c4950=typeof _0x4e1916[_0x7522('0x1e')]===_0x7522('0x1f')&&typeof _0x4e1916[_0x7522('0x20')]===_0x7522('0x1f');var _0x33255a=_0x271f6c[_0x7522('0x21')];var _0x78048=_0x2c4950?0x0:_0x4e1916[_0x7522('0x1e')];var _0x132b6c=_0x2c4950?_0x271f6c['count']:_0x4e1916[_0x7522('0x1e')]+_0x4e1916[_0x7522('0x20')];var _0xf50ab0;if(_0x132b6c>=_0x33255a){_0x132b6c=_0x33255a;_0xf50ab0=0xc8;}else{_0xf50ab0=0xce;}_0x5f51d2[_0x7522('0x1c')](_0xf50ab0);return _0x5f51d2['set'](_0x7522('0x22'),_0x78048+'-'+_0x132b6c+'/'+_0x33255a)['json'](_0x271f6c);}return null;};}function patchUpdates(_0x34c76d){return function(_0x3d432e){try{jsonpatch['apply'](_0x3d432e,_0x34c76d,!![]);}catch(_0x4ccbbd){return BPromise[_0x7522('0x23')](_0x4ccbbd);}return _0x3d432e[_0x7522('0x24')]();};}function saveUpdates(_0x4a9cac,_0x29586a){return function(_0x25699f){if(_0x25699f){return _0x25699f[_0x7522('0x25')](_0x4a9cac)[_0x7522('0x26')](function(_0x91311e){return _0x91311e;});}return null;};}function removeEntity(_0x3ece42,_0x1f3a5f){return function(_0x5d1b4e){if(_0x5d1b4e){return _0x5d1b4e[_0x7522('0x27')]()['then'](function(){_0x3ece42['status'](0xcc)[_0x7522('0x1d')]();});}};}function handleEntityNotFound(_0x3ef256,_0x123044){return function(_0x53c8c7){if(!_0x53c8c7){_0x3ef256[_0x7522('0x1b')](0x194);}return _0x53c8c7;};}function handleError(_0xbb4d8c,_0x33afa9){_0x33afa9=_0x33afa9||0x1f4;return function(_0x4af7b0){logger['error'](_0x4af7b0[_0x7522('0x28')]);if(_0x4af7b0['name']){delete _0x4af7b0[_0x7522('0x29')];}_0xbb4d8c['status'](_0x33afa9)['send'](_0x4af7b0);};}exports[_0x7522('0x2a')]=function(_0x36a61d,_0x54154c){var _0x82adfe={},_0x4d64b3={},_0x30c834={'count':0x0,'rows':[]};var _0x5d3611=_[_0x7522('0x2b')](db['ChatTransferReport']['rawAttributes'],function(_0x1c34e8){return{'name':_0x1c34e8[_0x7522('0x2c')],'type':_0x1c34e8[_0x7522('0x2d')][_0x7522('0x2e')]};});_0x4d64b3[_0x7522('0x2f')]=_[_0x7522('0x2b')](_0x5d3611,_0x7522('0x29'));_0x4d64b3[_0x7522('0x30')]=_[_0x7522('0x31')](_0x36a61d[_0x7522('0x30')]);_0x4d64b3[_0x7522('0x32')]=_[_0x7522('0x33')](_0x4d64b3['model'],_0x4d64b3[_0x7522('0x30')]);_0x82adfe[_0x7522('0x34')]=_['intersection'](_0x4d64b3[_0x7522('0x2f')],qs['fields'](_0x36a61d[_0x7522('0x30')][_0x7522('0x35')]));_0x82adfe[_0x7522('0x34')]=_0x82adfe[_0x7522('0x34')][_0x7522('0x36')]?_0x82adfe[_0x7522('0x34')]:_0x4d64b3[_0x7522('0x2f')];if(!_0x36a61d[_0x7522('0x30')]['hasOwnProperty'](_0x7522('0x37'))){_0x82adfe[_0x7522('0x20')]=qs[_0x7522('0x20')](_0x36a61d[_0x7522('0x30')][_0x7522('0x20')]);_0x82adfe['offset']=qs[_0x7522('0x1e')](_0x36a61d['query'][_0x7522('0x1e')]);}_0x82adfe[_0x7522('0x38')]=qs[_0x7522('0x39')](_0x36a61d['query']['sort']);_0x82adfe[_0x7522('0x3a')]=qs[_0x7522('0x32')](_[_0x7522('0x3b')](_0x36a61d[_0x7522('0x30')],_0x4d64b3[_0x7522('0x32')]),_0x5d3611);if(_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]){_0x82adfe[_0x7522('0x3a')]=_[_0x7522('0x3d')](_0x82adfe[_0x7522('0x3a')],{'$or':_['map'](_0x5d3611,function(_0x131eaf){if(_0x131eaf['type']!==_0x7522('0x3e')){var _0x45d82e={};_0x45d82e[_0x131eaf['name']]={'$like':'%'+_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]+'%'};return _0x45d82e;}})});}_0x82adfe=_[_0x7522('0x3d')]({},_0x82adfe,_0x36a61d[_0x7522('0x3f')]);var _0x11367a={'where':_0x82adfe[_0x7522('0x3a')]};return db[_0x7522('0x40')][_0x7522('0x21')](_0x11367a)['then'](function(_0x232822){_0x30c834[_0x7522('0x21')]=_0x232822;if(_0x36a61d['query']['includeAll']){_0x82adfe[_0x7522('0x41')]=[{'all':!![]}];}return db[_0x7522('0x40')]['findAll'](_0x82adfe);})['then'](function(_0xb2c8da){_0x30c834[_0x7522('0x42')]=_0xb2c8da;return _0x30c834;})[_0x7522('0x26')](respondWithFilteredResult(_0x54154c,_0x82adfe))[_0x7522('0x43')](handleError(_0x54154c,null));};exports['show']=function(_0x3e0c7d,_0x564f61){var _0x34a7b2={'raw':!![],'where':{'id':_0x3e0c7d[_0x7522('0x44')]['id']}},_0x2ca2e7={};_0x2ca2e7['model']=_['keys'](db[_0x7522('0x40')][_0x7522('0x45')]);_0x2ca2e7[_0x7522('0x30')]=_['keys'](_0x3e0c7d[_0x7522('0x30')]);_0x2ca2e7['filters']=_['intersection'](_0x2ca2e7['model'],_0x2ca2e7[_0x7522('0x30')]);_0x34a7b2['attributes']=_[_0x7522('0x33')](_0x2ca2e7['model'],qs[_0x7522('0x35')](_0x3e0c7d[_0x7522('0x30')]['fields']));_0x34a7b2[_0x7522('0x34')]=_0x34a7b2[_0x7522('0x34')][_0x7522('0x36')]?_0x34a7b2[_0x7522('0x34')]:_0x2ca2e7[_0x7522('0x2f')];if(_0x3e0c7d[_0x7522('0x30')][_0x7522('0x46')]){_0x34a7b2[_0x7522('0x41')]=[{'all':!![]}];}_0x34a7b2=_['merge']({},_0x34a7b2,_0x3e0c7d['options']);return db[_0x7522('0x40')]['find'](_0x34a7b2)[_0x7522('0x26')](handleEntityNotFound(_0x564f61,null))[_0x7522('0x26')](respondWithResult(_0x564f61,null))[_0x7522('0x43')](handleError(_0x564f61,null));};exports[_0x7522('0x47')]=function(_0xd6c4c2,_0x282df1){return db[_0x7522('0x40')][_0x7522('0x47')](_0xd6c4c2[_0x7522('0x48')],{})[_0x7522('0x26')](respondWithResult(_0x282df1,0xc9))[_0x7522('0x43')](handleError(_0x282df1,null));};exports[_0x7522('0x25')]=function(_0x4a2784,_0xe7d0c5){if(_0x4a2784[_0x7522('0x48')]['id']){delete _0x4a2784['body']['id'];}return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x4a2784['params']['id']}})[_0x7522('0x26')](handleEntityNotFound(_0xe7d0c5,null))[_0x7522('0x26')](saveUpdates(_0x4a2784[_0x7522('0x48')],null))[_0x7522('0x26')](respondWithResult(_0xe7d0c5,null))[_0x7522('0x43')](handleError(_0xe7d0c5,null));};exports['destroy']=function(_0x39775b,_0x57fd8c){return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x39775b[_0x7522('0x44')]['id']}})[_0x7522('0x26')](handleEntityNotFound(_0x57fd8c,null))[_0x7522('0x26')](removeEntity(_0x57fd8c,null))[_0x7522('0x43')](handleError(_0x57fd8c,null));};exports['describe']=function(_0x46673e,_0x1bce7f){return db[_0x7522('0x40')][_0x7522('0x4a')]()[_0x7522('0x26')](respondWithResult(_0x1bce7f,null))[_0x7522('0x43')](handleError(_0x1bce7f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 03c87e2..6602f68 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 _0x554f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','util'];(function(_0x4eac77,_0x1a5c7c){var _0x36655c=function(_0x4dd4d2){while(--_0x4dd4d2){_0x4eac77['push'](_0x4eac77['shift']());}};_0x36655c(++_0x1a5c7c);}(_0x554f,0x14e));var _0xf554=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x554f[_0x307d86];return _0x361745;};'use strict';var _=require(_0xf554('0x0'));var util=require(_0xf554('0x1'));var logger=require(_0xf554('0x2'))(_0xf554('0x3'));var moment=require(_0xf554('0x4'));var BPromise=require(_0xf554('0x5'));var rp=require(_0xf554('0x6'));var fs=require('fs');var path=require(_0xf554('0x7'));var rimraf=require(_0xf554('0x8'));var config=require(_0xf554('0x9'));var attributes=require(_0xf554('0xa'));module['exports']=function(_0x5198d4,_0x36ff04){return _0x5198d4[_0xf554('0xb')]('ChatTransferReport',attributes,{'tableName':_0xf554('0xc'),'paranoid':![],'indexes':[{'name':_0xf554('0xd'),'fields':[_0xf554('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a76=['define','ChatTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0xc17d60,_0x4d3616){var _0x462396=function(_0x23d12e){while(--_0x23d12e){_0xc17d60['push'](_0xc17d60['shift']());}};_0x462396(++_0x4d3616);}(_0x9a76,0x7b));var _0x69a7=function(_0x38d5ee,_0x17438c){_0x38d5ee=_0x38d5ee-0x0;var _0x37c2e4=_0x9a76[_0x38d5ee];return _0x37c2e4;};'use strict';var _=require(_0x69a7('0x0'));var util=require('util');var logger=require(_0x69a7('0x1'))(_0x69a7('0x2'));var moment=require(_0x69a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x69a7('0x4'));var fs=require('fs');var path=require(_0x69a7('0x5'));var rimraf=require(_0x69a7('0x6'));var config=require(_0x69a7('0x7'));var attributes=require(_0x69a7('0x8'));module['exports']=function(_0x36e6fb,_0x9bbfd4){return _0x36e6fb[_0x69a7('0x9')](_0x69a7('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x69a7('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 b4e1560..cc1cd17 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 _0xf4ab=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x51ccc3,_0x42c145){var _0x50d0ae=function(_0x2318e6){while(--_0x2318e6){_0x51ccc3['push'](_0x51ccc3['shift']());}};_0x50d0ae(++_0x42c145);}(_0xf4ab,0x16b));var _0xbf4a=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xf4ab[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0xbf4a('0x0'));var util=require(_0xbf4a('0x1'));var moment=require('moment');var BPromise=require(_0xbf4a('0x2'));var rs=require(_0xbf4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf4a('0x4'))['db'];var utils=require(_0xbf4a('0x5'));var logger=require(_0xbf4a('0x6'))(_0xbf4a('0x7'));var config=require(_0xbf4a('0x8'));var jayson=require(_0xbf4a('0x9'));var client=jayson[_0xbf4a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503ca0,_0x1a516b,_0x16d71f){return new BPromise(function(_0xb71352,_0x2864d4){return client[_0xbf4a('0xb')](_0x503ca0,_0x16d71f)[_0xbf4a('0xc')](function(_0x39456c){logger[_0xbf4a('0xd')](_0xbf4a('0xe'),_0x1a516b,_0xbf4a('0xf'));logger[_0xbf4a('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1a516b,_0xbf4a('0xf'),JSON[_0xbf4a('0x11')](_0x39456c));if(_0x39456c[_0xbf4a('0x12')]){if(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x13')]===0x1f4){logger['error'](_0xbf4a('0xe'),_0x1a516b,_0x39456c[_0xbf4a('0x12')]['message']);return _0x2864d4(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x14')]);}logger[_0xbf4a('0x12')](_0xbf4a('0xe'),_0x1a516b,_0x39456c[_0xbf4a('0x12')]['message']);return _0xb71352(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x14')]);}else{logger[_0xbf4a('0xd')](_0xbf4a('0xe'),_0x1a516b,'request\x20sent');_0xb71352(_0x39456c['result'][_0xbf4a('0x14')]);}})[_0xbf4a('0x15')](function(_0x9cd98e){logger[_0xbf4a('0x12')](_0xbf4a('0xe'),_0x1a516b,_0x9cd98e);_0x2864d4(_0x9cd98e);});});}
\ No newline at end of file
+var _0xbdca=['jayson/promise','client','http','request','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','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35cb5d,_0x2039d9){var _0x1da2db=function(_0x4172d5){while(--_0x4172d5){_0x35cb5d['push'](_0x35cb5d['shift']());}};_0x1da2db(++_0x2039d9);}(_0xbdca,0x177));var _0xabdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbdca[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xabdc('0x0'));var util=require(_0xabdc('0x1'));var moment=require(_0xabdc('0x2'));var BPromise=require(_0xabdc('0x3'));var rs=require(_0xabdc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabdc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabdc('0x6'))(_0xabdc('0x7'));var config=require(_0xabdc('0x8'));var jayson=require(_0xabdc('0x9'));var client=jayson[_0xabdc('0xa')][_0xabdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ab68,_0x20930a,_0x314f7c){return new BPromise(function(_0x297da5,_0x47bf1e){return client[_0xabdc('0xc')](_0x38ab68,_0x314f7c)['then'](function(_0x5d7bc1){logger[_0xabdc('0xd')](_0xabdc('0xe'),_0x20930a,_0xabdc('0xf'));logger[_0xabdc('0x10')](_0xabdc('0x11'),_0x20930a,_0xabdc('0xf'),JSON[_0xabdc('0x12')](_0x5d7bc1));if(_0x5d7bc1[_0xabdc('0x13')]){if(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x14')]===0x1f4){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x47bf1e(_0x5d7bc1['error'][_0xabdc('0x15')]);}logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x297da5(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x20930a,_0xabdc('0xf'));_0x297da5(_0x5d7bc1[_0xabdc('0x16')][_0xabdc('0x15')]);}})[_0xabdc('0x17')](function(_0x1640a5){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x1640a5);_0x47bf1e(_0x1640a5);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 612bac8..2d67c41 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 _0x4159=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','show','create'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0x4159,0x1aa));var _0x9415=function(_0x783c,_0xb7fd0c){_0x783c=_0x783c-0x0;var _0x4199dc=_0x4159[_0x783c];return _0x4199dc;};'use strict';var multer=require(_0x9415('0x0'));var util=require(_0x9415('0x1'));var path=require(_0x9415('0x2'));var timeout=require(_0x9415('0x3'));var express=require('express');var router=express[_0x9415('0x4')]();var fs_extra=require(_0x9415('0x5'));var auth=require(_0x9415('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x9415('0x7')](),controller[_0x9415('0x8')]);router[_0x9415('0x9')](_0x9415('0xa'),auth[_0x9415('0x7')](),controller[_0x9415('0xb')]);router[_0x9415('0x9')]('/:id',auth[_0x9415('0x7')](),controller[_0x9415('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9415('0xd')]);router[_0x9415('0xe')](_0x9415('0xf'),auth[_0x9415('0x7')](),controller[_0x9415('0x10')]);router[_0x9415('0x11')](_0x9415('0xf'),auth[_0x9415('0x7')](),controller[_0x9415('0x12')]);module[_0x9415('0x13')]=router;
\ No newline at end of file
+var _0xbdbb=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x5aba30,_0x41a5e0){var _0x227541=function(_0x3a0a52){while(--_0x3a0a52){_0x5aba30['push'](_0x5aba30['shift']());}};_0x227541(++_0x41a5e0);}(_0xbdbb,0x17c));var _0xbbdb=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0xbdbb[_0x26371f];return _0x7bf77f;};'use strict';var multer=require(_0xbbdb('0x0'));var util=require(_0xbbdb('0x1'));var path=require(_0xbbdb('0x2'));var timeout=require(_0xbbdb('0x3'));var express=require(_0xbbdb('0x4'));var router=express[_0xbbdb('0x5')]();var fs_extra=require(_0xbbdb('0x6'));var auth=require(_0xbbdb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbbdb('0x8'));var controller=require(_0xbbdb('0x9'));router[_0xbbdb('0xa')]('/',auth[_0xbbdb('0xb')](),controller[_0xbbdb('0xc')]);router['get'](_0xbbdb('0xd'),auth['isAuthenticated'](),controller[_0xbbdb('0xe')]);router['get'](_0xbbdb('0xf'),auth['isAuthenticated'](),controller[_0xbbdb('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbdb('0x11')]);router[_0xbbdb('0x12')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x13')]);router[_0xbbdb('0x14')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x15')]);module[_0xbbdb('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 72aa190..a98382f 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 _0xa6de=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','text','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x1dc632,_0x411634){var _0x309164=function(_0x40f5b2){while(--_0x40f5b2){_0x1dc632['push'](_0x1dc632['shift']());}};_0x309164(++_0x411634);}(_0xa6de,0x162));var _0xea6d=function(_0x56bb63,_0x3e165b){_0x56bb63=_0x56bb63-0x0;var _0x56a7ec=_0xa6de[_0x56bb63];return _0x56a7ec;};'use strict';var Sequelize=require(_0xea6d('0x0'));var rs=require(_0xea6d('0x1'));module[_0xea6d('0x2')]={'name':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'unique':_0xea6d('0x4')},'description':{'type':Sequelize[_0xea6d('0x3')]},'mapKey':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x5')},'mapKeyOffline':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xea6d('0x3')]},'animation':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xea6d('0xa')](_0xea6d('0xb'),'squared'),'defaultValue':_0xea6d('0xb')},'header_online':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0xd')},'offline_chat_button':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'header_offline':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xf')},'download_transcript':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xea6d('0x11')]},'closingQuestion':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x13')},'placeholderMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x14')},'closingMessageButton':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x15')},'conditionAgreement':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x16')},'ratingType':{'type':Sequelize[_0xea6d('0xa')](_0xea6d('0x17'),_0xea6d('0x18')),'defaultValue':_0xea6d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xea6d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xea6d('0x19'),'type':_0xea6d('0x1a'),'required':!![]},'props':{'title':_0xea6d('0x19'),'helpText':''}},{'type':_0xea6d('0x1b'),'props':{'title':_0xea6d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xea6d('0x5'),'type':_0xea6d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xea6d('0x1c')](_0xea6d('0x1d'))?JSON[_0xea6d('0x1e')](this[_0xea6d('0x1c')](_0xea6d('0x1d'))):{};},'set':function(_0x493d6b){return this[_0xea6d('0x1f')](_0xea6d('0x1d'),JSON[_0xea6d('0x20')](_0x493d6b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xea6d('0x20')]({'items':[{'type':_0xea6d('0x1b'),'props':{'title':_0xea6d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xea6d('0x5'),'type':'email'},'variable':null},{'type':_0xea6d('0x21'),'config':{'placeholder':_0xea6d('0x22')},'props':{'title':_0xea6d('0x22'),'helpText':_0xea6d('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xea6d('0x1c')]('offlineForm')?JSON[_0xea6d('0x1e')](this[_0xea6d('0x1c')](_0xea6d('0x24'))):{};},'set':function(_0x25cf31){return this[_0xea6d('0x1f')](_0xea6d('0x24'),JSON['stringify'](_0x25cf31));}},'token':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xea6d('0x3')]},'waitingTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x25')},'waitingMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x28')},'skipUnmanaged':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x15')},'sendUnmanaged':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xea6d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xea6d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xea6d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x2a')},'verticalAlignment':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xea6d('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xea6d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xea6d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xea6d('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![],'comment':_0xea6d('0x2d'),'set':function(_0x11b866){if(!_0x11b866)this[_0xea6d('0x1f')]('mandatoryDispositionPauseId',null);this[_0xea6d('0x1f')](_0xea6d('0x2e'),_0x11b866);}},'vidaooEscalation':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xea6d('0x3')]},'vidaooTopic':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x2f')},'vidaooNote':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':function(){return _0xea6d('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xea6d('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x583b=['Skip','Feedback','ENUM','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x51f47b,_0x597006){var _0x35718c=function(_0x151950){while(--_0x151950){_0x51f47b['push'](_0x51f47b['shift']());}};_0x35718c(++_0x597006);}(_0x583b,0xe5));var _0xb583=function(_0x209403,_0x27d3d7){_0x209403=_0x209403-0x0;var _0x2fd163=_0x583b[_0x209403];return _0x2fd163;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb583('0x0'));module[_0xb583('0x1')]={'name':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'unique':_0xb583('0x3')},'description':{'type':Sequelize[_0xb583('0x2')]},'mapKey':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'key':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb583('0x2')]},'animation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb583('0x9'),_0xb583('0xa')),'defaultValue':_0xb583('0x9')},'header_online':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xb')},'start_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xc')},'offline_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'header_offline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xe')},'download_transcript':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb583('0x10')]},'closingQuestion':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x15')},'conditionAgreement':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x16')},'ratingType':{'type':Sequelize[_0xb583('0x17')](_0xb583('0x18'),_0xb583('0x19')),'defaultValue':_0xb583('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':_0xb583('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xb583('0x1c'),'required':!![]},'props':{'title':_0xb583('0x1d'),'helpText':''}},{'type':_0xb583('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x1f'))?JSON[_0xb583('0x20')](this[_0xb583('0x1e')](_0xb583('0x1f'))):{};},'set':function(_0x5040fa){return this[_0xb583('0x21')]('onlineForm',JSON[_0xb583('0x1a')](_0x5040fa));}},'offlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':'input','props':{'title':_0xb583('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null},{'type':_0xb583('0x22'),'config':{'placeholder':_0xb583('0x23')},'props':{'title':_0xb583('0x23'),'helpText':_0xb583('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x25'))?JSON['parse'](this[_0xb583('0x1e')]('offlineForm')):{};},'set':function(_0x573452){return this[_0xb583('0x21')](_0xb583('0x25'),JSON['stringify'](_0x573452));}},'token':{'type':Sequelize[_0xb583('0x2')],'defaultValue':function(){return rs[_0xb583('0x26')]();}},'autoclose':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb583('0x2')]},'forwardOffline':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb583('0x2')]},'waitingTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x27')},'waitingMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb583('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return _0xb583('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2c')},'verticalAlignment':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2d')},'defaultTitle':{'type':Sequelize[_0xb583('0x2')]},'customerAvatar':{'type':Sequelize[_0xb583('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2e')},'systemAvatar':{'type':Sequelize[_0xb583('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb583('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51ae5f){if(!_0x51ae5f)this[_0xb583('0x21')](_0xb583('0x2f'),null);this[_0xb583('0x21')]('mandatoryDisposition',_0x51ae5f);}},'vidaooEscalation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb583('0x2')]},'vidaooTopic':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb583('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xb583('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb583('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 736e22b..cb252af 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 _0x8f00=['virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','name','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','fields','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','addDisposition','ChatWebsiteId','Disposition','findOne','includeAll','removeDispositions','CannedAnswer','getAnswers','findAll','removeAnswers','ids','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','applications','Applications','list','orderBy','asc','defaults','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId','created','autoclose','push','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','MailAccountId','toPairsIn','mapValues','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f00,0x15d));var _0x08f0=function(_0x2f171c,_0x48c9b9){_0x2f171c=_0x2f171c-0x0;var _0x4d8e28=_0x8f00[_0x2f171c];return _0x4d8e28;};'use strict';var emlformat=require(_0x08f0('0x0'));var rimraf=require(_0x08f0('0x1'));var zipdir=require(_0x08f0('0x2'));var jsonpatch=require(_0x08f0('0x3'));var rp=require(_0x08f0('0x4'));var moment=require(_0x08f0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x08f0('0x6'));var util=require(_0x08f0('0x7'));var path=require(_0x08f0('0x8'));var sox=require(_0x08f0('0x9'));var csv=require(_0x08f0('0xa'));var ejs=require(_0x08f0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08f0('0xc'));var squel=require(_0x08f0('0xd'));var crypto=require(_0x08f0('0xe'));var jsforce=require(_0x08f0('0xf'));var deskjs=require(_0x08f0('0x10'));var toCsv=require(_0x08f0('0xa'));var querystring=require(_0x08f0('0x11'));var Papa=require(_0x08f0('0x12'));var Redis=require('ioredis');var authService=require(_0x08f0('0x13'));var qs=require(_0x08f0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08f0('0x15'));var logger=require(_0x08f0('0x16'))(_0x08f0('0x17'));var utils=require(_0x08f0('0x18'));var config=require(_0x08f0('0x19'));var licenseUtil=require(_0x08f0('0x1a'));var db=require('../../mysqldb')['db'];config[_0x08f0('0x1b')]=_['defaults'](config['redis'],{'host':_0x08f0('0x1c'),'port':0x18eb});var socket=require(_0x08f0('0x1d'))(new Redis(config[_0x08f0('0x1b')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x08f0('0x1e'));var client=jayson[_0x08f0('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x08f0('0x20')]({'port':0x232a});var client9003=jayson['client'][_0x08f0('0x20')]({'port':0x232b});var client9001=jayson[_0x08f0('0x1f')][_0x08f0('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x2fb401,_0x296e70,_0x2e1c38,_0x306ee7){return new BPromise(function(_0x405ad6,_0x27b9c6){var _0x1d11e1=_0x306ee7||client;return _0x1d11e1['request'](_0x2fb401,_0x2e1c38)[_0x08f0('0x21')](function(_0x3e4dde){logger[_0x08f0('0x22')](_0x08f0('0x23'),_0x296e70,_0x08f0('0x24'));logger[_0x08f0('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x296e70,_0x08f0('0x24'),JSON[_0x08f0('0x26')](_0x3e4dde));if(_0x3e4dde[_0x08f0('0x27')]){if(_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x28')]===0x1f4){logger['error'](_0x08f0('0x23'),_0x296e70,_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x29')]);return _0x27b9c6(_0x3e4dde[_0x08f0('0x27')]['message']);}logger[_0x08f0('0x27')](_0x08f0('0x23'),_0x296e70,_0x3e4dde['error']['message']);return _0x405ad6(_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x29')]);}else{logger[_0x08f0('0x22')](_0x08f0('0x23'),_0x296e70,_0x08f0('0x24'));_0x405ad6(_0x3e4dde[_0x08f0('0x2a')]['message']);}})[_0x08f0('0x2b')](function(_0x36d626){logger['error'](_0x08f0('0x23'),_0x296e70,_0x36d626);_0x27b9c6(_0x36d626);});});}function respondWithStatusCode(_0x5d94e4,_0x55838d){_0x55838d=_0x55838d||0xcc;return function(_0x236c08){if(_0x236c08){return _0x5d94e4[_0x08f0('0x2c')](_0x55838d);}return _0x5d94e4['status'](_0x55838d)[_0x08f0('0x2d')]();};}function respondWithResult(_0xc32fb9,_0x24018e){_0x24018e=_0x24018e||0xc8;return function(_0x23ab47){if(_0x23ab47){return _0xc32fb9[_0x08f0('0x2e')](_0x24018e)[_0x08f0('0x2f')](_0x23ab47);}};}function respondWithFilteredResult(_0x26b1db,_0x40e218){return function(_0x3cdbf1){if(_0x3cdbf1){var _0x2d2dc5=typeof _0x40e218[_0x08f0('0x30')]===_0x08f0('0x31')&&typeof _0x40e218[_0x08f0('0x32')]==='undefined';var _0x37f448=_0x3cdbf1['count'];var _0x6dd800=_0x2d2dc5?0x0:_0x40e218[_0x08f0('0x30')];var _0x5123f4=_0x2d2dc5?_0x3cdbf1[_0x08f0('0x33')]:_0x40e218[_0x08f0('0x30')]+_0x40e218[_0x08f0('0x32')];var _0x5ab435;if(_0x5123f4>=_0x37f448){_0x5123f4=_0x37f448;_0x5ab435=0xc8;}else{_0x5ab435=0xce;}_0x26b1db[_0x08f0('0x2e')](_0x5ab435);return _0x26b1db['set'](_0x08f0('0x34'),_0x6dd800+'-'+_0x5123f4+'/'+_0x37f448)[_0x08f0('0x2f')](_0x3cdbf1);}return null;};}function patchUpdates(_0x30e90f){return function(_0x39fce1){try{jsonpatch['apply'](_0x39fce1,_0x30e90f,!![]);}catch(_0x2980c1){return BPromise[_0x08f0('0x35')](_0x2980c1);}return _0x39fce1[_0x08f0('0x36')]();};}function saveUpdates(_0x2fde3d,_0x3e1d72){return function(_0x4881f2){if(_0x4881f2){return _0x4881f2[_0x08f0('0x37')](_0x2fde3d)[_0x08f0('0x21')](function(_0x7b8434){return _0x7b8434;});}return null;};}function removeEntity(_0x544b25,_0x525910){return function(_0x54bbaa){if(_0x54bbaa){return _0x54bbaa[_0x08f0('0x38')]()['then'](function(){var _0x18ef50=_0x54bbaa[_0x08f0('0x39')]({'plain':!![]});var _0x1ba823=_0x08f0('0x3a');return db[_0x08f0('0x3b')]['destroy']({'where':{'type':_0x1ba823,'resourceId':_0x18ef50['id']}})['then'](function(){return _0x54bbaa;});})[_0x08f0('0x21')](function(){_0x544b25[_0x08f0('0x2e')](0xcc)[_0x08f0('0x2d')]();});}};}function handleEntityNotFound(_0x5ac8bf,_0x55210d){return function(_0x100ad5){if(!_0x100ad5){_0x5ac8bf[_0x08f0('0x2c')](0x194);}return _0x100ad5;};}function handleError(_0x135010,_0x1e4135){_0x1e4135=_0x1e4135||0x1f4;return function(_0x2d782d){logger['error'](_0x2d782d[_0x08f0('0x3c')]);if(_0x2d782d['name']){delete _0x2d782d['name'];}_0x135010[_0x08f0('0x2e')](_0x1e4135)[_0x08f0('0x3d')](_0x2d782d);};}exports[_0x08f0('0x3e')]=function(_0x547a9e,_0x5b77b9){var _0x207ad8={'include':[{'model':db[_0x08f0('0x3f')],'as':_0x08f0('0x40')}]},_0x230e86={},_0x330f2c={'count':0x0,'rows':[]};var _0x4e79ab=_[_0x08f0('0x41')](db[_0x08f0('0x42')][_0x08f0('0x43')],function(_0x4ffeed){return{'name':_0x4ffeed[_0x08f0('0x44')],'type':_0x4ffeed[_0x08f0('0x45')][_0x08f0('0x46')]};});_0x230e86['model']=_[_0x08f0('0x41')](_0x4e79ab,_0x08f0('0x47'));_0x230e86['query']=_[_0x08f0('0x48')](_0x547a9e[_0x08f0('0x49')]);_0x230e86['filters']=_[_0x08f0('0x4a')](_0x230e86['model'],_0x230e86[_0x08f0('0x49')]);_0x207ad8[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x230e86[_0x08f0('0x4c')],qs['fields'](_0x547a9e['query']['fields']));_0x207ad8[_0x08f0('0x4b')]=_0x207ad8[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x207ad8['attributes']:_0x230e86[_0x08f0('0x4c')];if(!_0x547a9e['query'][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x207ad8[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x547a9e[_0x08f0('0x49')][_0x08f0('0x32')]);_0x207ad8[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x547a9e[_0x08f0('0x49')][_0x08f0('0x30')]);}_0x207ad8[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x547a9e['query']['sort']);_0x207ad8[_0x08f0('0x52')]=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x547a9e[_0x08f0('0x49')],_0x230e86[_0x08f0('0x53')]),_0x4e79ab);if(_0x547a9e['query'][_0x08f0('0x55')]){_0x207ad8[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x207ad8[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x4e79ab,function(_0x4b1322){if(_0x4b1322[_0x08f0('0x45')]!==_0x08f0('0x57')){var _0x137a02={};_0x137a02[_0x4b1322[_0x08f0('0x47')]]={'$like':'%'+_0x547a9e[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0x137a02;}})});}_0x207ad8=_['merge']({},_0x207ad8,_0x547a9e[_0x08f0('0x58')]);var _0x1a89cc={'where':_0x207ad8['where']};return db[_0x08f0('0x42')][_0x08f0('0x33')](_0x1a89cc)[_0x08f0('0x21')](function(_0xa4ef3f){_0x330f2c[_0x08f0('0x33')]=_0xa4ef3f;if(_0x547a9e[_0x08f0('0x49')]['includeAll']){_0x207ad8[_0x08f0('0x59')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x207ad8);})['then'](function(_0x2ca406){_0x330f2c[_0x08f0('0x5a')]=_0x2ca406;return _0x330f2c;})[_0x08f0('0x21')](respondWithFilteredResult(_0x5b77b9,_0x207ad8))[_0x08f0('0x2b')](handleError(_0x5b77b9,null));};exports[_0x08f0('0x5b')]=function(_0x4d3800,_0x29b695){var _0x5da5c0={'raw':![],'where':{'id':_0x4d3800['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5aca14={};_0x5aca14[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x42')]['rawAttributes']);_0x5aca14['query']=_[_0x08f0('0x48')](_0x4d3800[_0x08f0('0x49')]);_0x5aca14[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x5aca14[_0x08f0('0x4c')],_0x5aca14[_0x08f0('0x49')]);_0x5da5c0[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x5aca14[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x4d3800[_0x08f0('0x49')][_0x08f0('0x5c')]));_0x5da5c0[_0x08f0('0x4b')]=_0x5da5c0[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x5da5c0[_0x08f0('0x4b')]:_0x5aca14[_0x08f0('0x4c')];if(_0x4d3800[_0x08f0('0x49')]['includeAll']){_0x5da5c0[_0x08f0('0x59')]=[{'all':!![]}];}_0x5da5c0=_[_0x08f0('0x56')]({},_0x5da5c0,_0x4d3800[_0x08f0('0x58')]);return db['ChatWebsite']['find'](_0x5da5c0)[_0x08f0('0x21')](handleEntityNotFound(_0x29b695,null))[_0x08f0('0x21')](respondWithResult(_0x29b695,null))['catch'](handleError(_0x29b695,null));};exports[_0x08f0('0x5d')]=function(_0x4891b0,_0x98cb10){return db[_0x08f0('0x42')][_0x08f0('0x5d')](_0x4891b0[_0x08f0('0x5e')],{})[_0x08f0('0x21')](function(_0x2a0509){var _0x24a962=_0x4891b0[_0x08f0('0x5f')][_0x08f0('0x39')]({'plain':!![]});if(!_0x24a962)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24a962[_0x08f0('0x60')]==='user'){var _0x2d84f0=_0x2a0509['get']({'plain':!![]});var _0x2a487b=_0x08f0('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x2a487b,'userProfileId':_0x24a962[_0x08f0('0x61')]},'raw':!![]})['then'](function(_0x17e6ca){if(_0x17e6ca&&_0x17e6ca[_0x08f0('0x62')]===0x0){return db[_0x08f0('0x3b')][_0x08f0('0x5d')]({'name':_0x2d84f0[_0x08f0('0x47')],'resourceId':_0x2d84f0['id'],'type':_0x17e6ca['name'],'sectionId':_0x17e6ca['id']},{})['then'](function(){return _0x2a0509;});}else{return _0x2a0509;}})[_0x08f0('0x2b')](function(_0x2ac006){logger[_0x08f0('0x27')](_0x08f0('0x63'),_0x2ac006);throw _0x2ac006;});}return _0x2a0509;})['then'](respondWithResult(_0x98cb10,0xc9))['catch'](handleError(_0x98cb10,null));};exports[_0x08f0('0x37')]=function(_0x318188,_0x368129){if(_0x318188[_0x08f0('0x5e')]['id']){delete _0x318188[_0x08f0('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x318188[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x3f')],'as':_0x08f0('0x40')}]})[_0x08f0('0x21')](handleEntityNotFound(_0x368129,null))[_0x08f0('0x21')](saveUpdates(_0x318188[_0x08f0('0x5e')],null))['then'](respondWithResult(_0x368129,null))[_0x08f0('0x2b')](handleError(_0x368129,null));};exports[_0x08f0('0x38')]=function(_0x4268b2,_0x12e4f9){return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x4268b2[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x12e4f9,null))[_0x08f0('0x21')](removeEntity(_0x12e4f9,null))[_0x08f0('0x2b')](handleError(_0x12e4f9,null));};exports[_0x08f0('0x66')]=function(_0x14710b,_0x22dc18){return db[_0x08f0('0x42')][_0x08f0('0x66')]()['then'](respondWithResult(_0x22dc18,null))[_0x08f0('0x2b')](handleError(_0x22dc18,null));};exports[_0x08f0('0x67')]=function(_0x32b704,_0x52c24d,_0x3abc94){if(_0x32b704[_0x08f0('0x5e')]['id']){delete _0x32b704[_0x08f0('0x5e')]['id'];}return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x32b704[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x52c24d,null))[_0x08f0('0x21')](function(_0x422753){if(_0x422753){_0x32b704[_0x08f0('0x5e')][_0x08f0('0x68')]=_0x422753['id'];return db[_0x08f0('0x69')][_0x08f0('0x5d')](_0x32b704[_0x08f0('0x5e')]);}})[_0x08f0('0x21')](respondWithResult(_0x52c24d,null))[_0x08f0('0x2b')](handleError(_0x52c24d,null));};exports['getDispositions']=function(_0x12db6d,_0x33ef2c,_0x3d2bc6){var _0xb6267={'raw':![],'where':{}};var _0x55f8c6={};var _0x5027e1={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x12db6d[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x33ef2c,null))[_0x08f0('0x21')](function(_0x3b935b){if(_0x3b935b){_0x55f8c6[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db['Disposition'][_0x08f0('0x43')]);_0x55f8c6[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x12db6d[_0x08f0('0x49')]);_0x55f8c6[_0x08f0('0x53')]=_['intersection'](_0x55f8c6[_0x08f0('0x4c')],_0x55f8c6[_0x08f0('0x49')]);_0xb6267[_0x08f0('0x4b')]=_['intersection'](_0x55f8c6[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x12db6d['query'][_0x08f0('0x5c')]));_0xb6267[_0x08f0('0x4b')]=_0xb6267[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0xb6267[_0x08f0('0x4b')]:_0x55f8c6[_0x08f0('0x4c')];if(!_0x12db6d[_0x08f0('0x49')]['hasOwnProperty'](_0x08f0('0x4f'))){_0xb6267[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x12db6d[_0x08f0('0x49')][_0x08f0('0x32')]);_0xb6267[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x12db6d[_0x08f0('0x49')][_0x08f0('0x30')]);}_0xb6267[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x12db6d['query'][_0x08f0('0x51')]);_0xb6267[_0x08f0('0x52')]=qs['filters'](_['pick'](_0x12db6d[_0x08f0('0x49')],_0x55f8c6[_0x08f0('0x53')]));_0xb6267[_0x08f0('0x52')]['ChatWebsiteId']=_0x3b935b['id'];if(_0x12db6d['query'][_0x08f0('0x55')]){_0xb6267[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0xb6267['where'],{'$or':_[_0x08f0('0x41')](_0xb6267['attributes'],function(_0x199617){var _0xb1cfc7={};_0xb1cfc7[_0x199617]={'$like':'%'+_0x12db6d[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0xb1cfc7;})});}_0xb6267=_[_0x08f0('0x56')]({},_0xb6267,_0x12db6d[_0x08f0('0x58')]);return db[_0x08f0('0x69')][_0x08f0('0x33')]({'where':_0xb6267[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x22f3c1){_0x5027e1[_0x08f0('0x33')]=_0x22f3c1;if(_0x12db6d[_0x08f0('0x49')][_0x08f0('0x6b')]){_0xb6267[_0x08f0('0x59')]=[{'all':!![]}];}return db[_0x08f0('0x69')]['findAll'](_0xb6267);})[_0x08f0('0x21')](function(_0x54d5a1){_0x5027e1[_0x08f0('0x5a')]=_0x54d5a1;return _0x5027e1;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x33ef2c,_0xb6267))[_0x08f0('0x2b')](handleError(_0x33ef2c,null));};exports[_0x08f0('0x6c')]=function(_0x408022,_0x534ccb,_0x4d4b14){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x408022[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x534ccb,null))['then'](function(_0x43e1f2){if(_0x43e1f2){return _0x43e1f2[_0x08f0('0x6c')](_0x408022[_0x08f0('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x534ccb,null))[_0x08f0('0x2b')](handleError(_0x534ccb,null));};exports['addAnswer']=function(_0x4c6469,_0x136444,_0x166396){if(_0x4c6469[_0x08f0('0x5e')]['id']){delete _0x4c6469[_0x08f0('0x5e')]['id'];}return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x4c6469['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x136444,null))[_0x08f0('0x21')](function(_0x323981){if(_0x323981){_0x4c6469[_0x08f0('0x5e')][_0x08f0('0x68')]=_0x323981['id'];return db[_0x08f0('0x6d')][_0x08f0('0x5d')](_0x4c6469[_0x08f0('0x5e')]);}})[_0x08f0('0x21')](respondWithResult(_0x136444,null))[_0x08f0('0x2b')](handleError(_0x136444,null));};exports[_0x08f0('0x6e')]=function(_0x38ef0c,_0x249c69,_0x5e0c36){var _0x49dca2={'raw':![],'where':{}};var _0x28fe9b={};var _0x43de35={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x08f0('0x6a')]({'where':{'id':_0x38ef0c['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x249c69,null))[_0x08f0('0x21')](function(_0x66f30b){if(_0x66f30b){_0x28fe9b[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x6d')][_0x08f0('0x43')]);_0x28fe9b[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x38ef0c[_0x08f0('0x49')]);_0x28fe9b['filters']=_['intersection'](_0x28fe9b['model'],_0x28fe9b[_0x08f0('0x49')]);_0x49dca2[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x28fe9b[_0x08f0('0x4c')],qs['fields'](_0x38ef0c['query'][_0x08f0('0x5c')]));_0x49dca2[_0x08f0('0x4b')]=_0x49dca2[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x49dca2[_0x08f0('0x4b')]:_0x28fe9b[_0x08f0('0x4c')];if(!_0x38ef0c['query']['hasOwnProperty']('nolimit')){_0x49dca2[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x38ef0c[_0x08f0('0x49')]['limit']);_0x49dca2[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x38ef0c[_0x08f0('0x49')]['offset']);}_0x49dca2[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x38ef0c[_0x08f0('0x49')]['sort']);_0x49dca2[_0x08f0('0x52')]=qs['filters'](_[_0x08f0('0x54')](_0x38ef0c[_0x08f0('0x49')],_0x28fe9b[_0x08f0('0x53')]));_0x49dca2['where'][_0x08f0('0x68')]=_0x66f30b['id'];if(_0x38ef0c[_0x08f0('0x49')]['filter']){_0x49dca2[_0x08f0('0x52')]=_['merge'](_0x49dca2[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x49dca2[_0x08f0('0x4b')],function(_0x3296b3){var _0x3b43d6={};_0x3b43d6[_0x3296b3]={'$like':'%'+_0x38ef0c['query'][_0x08f0('0x55')]+'%'};return _0x3b43d6;})});}_0x49dca2=_[_0x08f0('0x56')]({},_0x49dca2,_0x38ef0c[_0x08f0('0x58')]);return db['CannedAnswer'][_0x08f0('0x33')]({'where':_0x49dca2[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x44886f){_0x43de35[_0x08f0('0x33')]=_0x44886f;if(_0x38ef0c['query'][_0x08f0('0x6b')]){_0x49dca2[_0x08f0('0x59')]=[{'all':!![]}];}return db[_0x08f0('0x6d')][_0x08f0('0x6f')](_0x49dca2);})[_0x08f0('0x21')](function(_0x26106b){_0x43de35['rows']=_0x26106b;return _0x43de35;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x249c69,_0x49dca2))[_0x08f0('0x2b')](handleError(_0x249c69,null));};exports[_0x08f0('0x70')]=function(_0x2d2ae6,_0x403c9f,_0x3ace08){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x2d2ae6['params']['id']}})['then'](handleEntityNotFound(_0x403c9f,null))[_0x08f0('0x21')](function(_0x30f348){if(_0x30f348){return _0x30f348[_0x08f0('0x70')](_0x2d2ae6['query'][_0x08f0('0x71')]);}})['then'](respondWithStatusCode(_0x403c9f,null))[_0x08f0('0x2b')](handleError(_0x403c9f,null));};exports['addLogo']=function(_0x4ba0d8,_0x3ffe62,_0x5ed270){_0x4ba0d8[_0x08f0('0x5e')]['sitepic']=_0x4ba0d8[_0x08f0('0x72')][_0x08f0('0x73')];return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x4ba0d8[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x3ffe62,null))['then'](saveUpdates(_0x4ba0d8[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x3ffe62,null))[_0x08f0('0x2b')](handleError(_0x3ffe62,null));};exports['addAvatar']=function(_0x4db671,_0x5b4570,_0x350481){_0x4db671['body'][_0x08f0('0x74')]=_0x4db671['file'][_0x08f0('0x73')];return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x4db671[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x5b4570,null))[_0x08f0('0x21')](saveUpdates(_0x4db671[_0x08f0('0x5e')],null))['then'](respondWithResult(_0x5b4570,null))['catch'](handleError(_0x5b4570,null));};exports[_0x08f0('0x75')]=function(_0x2e81d0,_0x1c4b98,_0x401439){_0x2e81d0[_0x08f0('0x5e')][_0x08f0('0x76')]=_0x2e81d0[_0x08f0('0x72')][_0x08f0('0x73')];return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x2e81d0[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x1c4b98,null))[_0x08f0('0x21')](saveUpdates(_0x2e81d0[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x1c4b98,null))['catch'](handleError(_0x1c4b98,null));};exports[_0x08f0('0x77')]=function(_0x425f43,_0x315293,_0x124e5a){_0x425f43[_0x08f0('0x5e')][_0x08f0('0x78')]=_0x425f43[_0x08f0('0x72')][_0x08f0('0x73')];return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x425f43[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x315293,null))[_0x08f0('0x21')](saveUpdates(_0x425f43[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x315293,null))[_0x08f0('0x2b')](handleError(_0x315293,null));};exports[_0x08f0('0x79')]=function(_0x2f85e3,_0x30a96c,_0x5f1c69){var _0xce3cf4=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x7c'));var _0x1fea0a={'where':{'id':_0x2f85e3[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x7d')],'raw':!![]};var _0xbf7ea=![];return require('../../config/license/util')[_0x08f0('0x7e')]()[_0x08f0('0x21')](function(_0x3af0ce){if(_0x3af0ce){_0xbf7ea=_0x3af0ce['custom'];}})['then'](function(){return db[_0x08f0('0x42')]['find'](_0x1fea0a);})['then'](handleEntityNotFound(_0x30a96c,null))['then'](function(_0x105c39){if(_0x105c39){if(!_[_0x08f0('0x7f')](_0x105c39[_0x08f0('0x7d')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x81'),_0x105c39[_0x08f0('0x7d')]))&&_0xbf7ea){_0xce3cf4=path[_0x08f0('0x7a')](config['root'],_0x08f0('0x81'),_0x105c39['sitepic']);}}return _0x30a96c[_0x08f0('0x82')](_0xce3cf4);}})[_0x08f0('0x2b')](handleError(_0x30a96c,null));};exports[_0x08f0('0x83')]=function(_0x313d5c,_0x265c51,_0x55ae54){var _0x388391=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x84'));var _0x40416e={'where':{'id':_0x313d5c[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x74')],'raw':!![]};return db[_0x08f0('0x42')][_0x08f0('0x65')](_0x40416e)[_0x08f0('0x21')](handleEntityNotFound(_0x265c51,null))[_0x08f0('0x21')](function(_0x3c29ee){if(_0x3c29ee){if(!_['isNil'](_0x3c29ee['agentAvatar'])){if(fs['existsSync'](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x3c29ee['agentAvatar']))){_0x388391=path['join'](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x3c29ee[_0x08f0('0x74')]);}}return _0x265c51['download'](_0x388391);}})[_0x08f0('0x2b')](handleError(_0x265c51,null));};exports['getCustomerAvatar']=function(_0x256f87,_0x5f4bf7,_0x2cd607){var _0x4378e7=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x86'));var _0x2bc5b6={'where':{'id':_0x256f87[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x76'),'showCustomerAvatar'],'raw':!![]};return db[_0x08f0('0x42')][_0x08f0('0x65')](_0x2bc5b6)['then'](handleEntityNotFound(_0x5f4bf7,null))[_0x08f0('0x21')](function(_0x2c2225){if(_0x2c2225){if(!_[_0x08f0('0x7f')](_0x2c2225[_0x08f0('0x76')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x2c2225[_0x08f0('0x76')]))&&_0x2c2225[_0x08f0('0x87')]){_0x4378e7=path['join'](config['root'],_0x08f0('0x85'),_0x2c2225[_0x08f0('0x76')]);}}return _0x5f4bf7['download'](_0x4378e7);}})[_0x08f0('0x2b')](handleError(_0x5f4bf7,null));};exports[_0x08f0('0x88')]=function(_0xd3c2e7,_0x57c52f,_0x51c371){var _0xca10e0=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x89'));var _0x456177={'where':{'id':_0xd3c2e7[_0x08f0('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x08f0('0x42')]['find'](_0x456177)[_0x08f0('0x21')](handleEntityNotFound(_0x57c52f,null))[_0x08f0('0x21')](function(_0x333e2c){if(_0x333e2c){if(!_[_0x08f0('0x7f')](_0x333e2c[_0x08f0('0x78')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x333e2c[_0x08f0('0x78')]))){_0xca10e0=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],'server/files/images/avatars/',_0x333e2c['systemAvatar']);}}return _0x57c52f[_0x08f0('0x82')](_0xca10e0);}})[_0x08f0('0x2b')](handleError(_0x57c52f,null));};exports[_0x08f0('0x8a')]=function(_0x55338b,_0x4d24e0,_0x4e36ad){var _0x2d950c=require(_0x08f0('0x8b'));var _0x3e1605=new _0x2d950c();var _0x190e07=_0x3e1605[_0x08f0('0x8c')](_0x55338b['headers'][_0x08f0('0x8d')])[_0x08f0('0x8e')]();var _0x4e2288={'body':_0x55338b['body'],'channel':_0x08f0('0x8f')};var _0x446b9c=[];var _0x4e8dd1=[];var _0x46ac8c={};var _0x207d59=![];return db[_0x08f0('0x90')][_0x08f0('0x66')]()[_0x08f0('0x21')](function(_0x5e6258){if(!_0x5e6258){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('no\x20available\x20attributes');}_0x446b9c=_[_0x08f0('0x93')](_[_0x08f0('0x48')](_0x5e6258),[_0x08f0('0x94'),_0x08f0('0x95')]);_0x4e8dd1=_['difference'](_[_0x08f0('0x48')](_0x5e6258),[_0x08f0('0x94'),_0x08f0('0x95'),'CompanyId',_0x08f0('0x96')]);if(_0x55338b[_0x08f0('0x5e')]['id']){delete _0x55338b[_0x08f0('0x5e')]['id'];}if(_['isNil'](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x98'));}if(_[_0x08f0('0x7f')](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x5e')])||_0x55338b[_0x08f0('0x5e')][_0x08f0('0x5e')]===''){throw new db['Sequelize'][(_0x08f0('0x92'))](_0x08f0('0x99'));}if(_['isNil'](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x9b')+_0x4e8dd1);}if(!_['includes'](_0x4e8dd1,_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e8dd1);}_0x46ac8c[_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')]]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')];})[_0x08f0('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x55338b[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x9c')],'as':_0x08f0('0x9d'),'include':[{'model':db['CmContact'],'as':_0x08f0('0x9e'),'where':_0x46ac8c,'limit':0x1,'order':[[_0x08f0('0x95'),'DESC']]}]},{'model':db[_0x08f0('0x9f')],'as':'Applications'}]});})[_0x08f0('0x21')](handleEntityNotFound(_0x4d24e0,null))[_0x08f0('0x21')](function(_0x29fc98){if(_0x29fc98&&_0x29fc98[_0x08f0('0x9d')]){_0x4e2288[_0x08f0('0xa0')]=_0x29fc98;_0x4e2288[_0x08f0('0xa1')]=_0x29fc98[_0x08f0('0xa2')];_0x4e2288[_0x08f0('0xa3')]=_0x29fc98['List'];_0x4e2288['applications']=_[_0x08f0('0xa4')](_0x4e2288[_0x08f0('0xa1')],['priority'],[_0x08f0('0xa5')]);if(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xa2')]){delete _0x4e2288[_0x08f0('0xa0')]['Applications'];}if(_0x4e2288['account'][_0x08f0('0x9d')]&&_0x4e2288[_0x08f0('0xa0')][_0x08f0('0x9d')][_0x08f0('0x9e')]['length']){return _0x4e2288[_0x08f0('0xa0')][_0x08f0('0x9d')][_0x08f0('0x9e')][0x0];}var _0x322cc6=_[_0x08f0('0xa6')](_0x55338b[_0x08f0('0x5e')],{'firstName':_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')],'ListId':_0x29fc98['ListId']});_0x322cc6[_0x55338b['body'][_0x08f0('0x9a')]]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')];return db[_0x08f0('0x90')][_0x08f0('0x5d')](_0x322cc6,{'fields':_0x446b9c,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d24e0,null))[_0x08f0('0x21')](function(_0x296cc4){_0x4e2288['contact']=_0x296cc4;var _0x1856a3=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xa7')];if(_0x55338b[_0x08f0('0xa8')][_0x08f0('0xa9')]){_0x1856a3=_0x55338b['headers'][_0x08f0('0xa9')];}else if(_0x55338b[_0x08f0('0xa8')][_0x08f0('0xaa')]){_0x1856a3=_[_0x08f0('0xab')](_0x55338b[_0x08f0('0xa8')][_0x08f0('0xaa')][_0x08f0('0xac')](','));}if(_0x296cc4){var _0xd19d03={'ContactId':_0x296cc4['id'],'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'from':(_0x296cc4['firstName']||'')+'\x20'+(_0x296cc4['lastName']||''),'customerIp':_0x1856a3,'customerPort':_0x55338b['headers'][_0x08f0('0xad')]?_0x55338b[_0x08f0('0xa8')]['x-real-port']:null,'referer':_0x55338b['body'][_0x08f0('0xae')],'browserName':_0x190e07[_0x08f0('0xaf')][_0x08f0('0x47')]&&_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]?util[_0x08f0('0xb1')]('%s\x20%s',_0x190e07['browser']['name'],_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]):_0x08f0('0xb2'),'browserVersion':_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]||_0x08f0('0xb2'),'osName':util['format'](_0x08f0('0xb3'),_0x190e07['os'][_0x08f0('0x47')],_0x190e07['os'][_0x08f0('0xb0')]),'osVersion':_0x190e07['os']['version'],'deviceModel':_0x190e07[_0x08f0('0xb4')][_0x08f0('0x4c')]&&_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')]?util[_0x08f0('0xb1')](_0x08f0('0xb6'),_0x190e07['device']['model'],_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')],_0x190e07['device']['type']):null,'deviceVendor':_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')],'deviceType':_0x190e07[_0x08f0('0xb4')]['type'],'formData':JSON[_0x08f0('0x26')](_0x55338b['body'])};var _0x2829d4={'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'closed':![]};if(_0x55338b['body'][_0x08f0('0xb7')]){_0x2829d4['threadId']=_0x55338b[_0x08f0('0x5e')]['threadId'];return db[_0x08f0('0xb8')][_0x08f0('0x65')]({'where':_0x2829d4})[_0x08f0('0x21')](function(_0x242eef){if(_0x242eef){return[_0x242eef,![]];}_0xd19d03[_0x08f0('0xb7')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xb7')];_0xd19d03[_0x08f0('0xb9')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xb9')];return db[_0x08f0('0xb8')][_0x08f0('0x5d')](_0xd19d03)[_0x08f0('0x21')](function(_0x2b5c6b){return[_0x2b5c6b,!![]];});});}_0x2829d4[_0x08f0('0xba')]=_0x296cc4['id'];if(_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbb')]&&_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbb')]['id']){_0x2829d4['id']=_0x55338b[_0x08f0('0x5e')]['interaction']['id'];return db['ChatInteraction'][_0x08f0('0x65')]({'where':_0x2829d4})[_0x08f0('0x21')](function(_0x549227){if(_0x549227){return[_0x549227,![]];}return db['ChatInteraction'][_0x08f0('0x5d')](_0xd19d03)[_0x08f0('0x21')](function(_0x3043da){return[_0x3043da,!![]];});});}return db[_0x08f0('0xb8')]['create'](_0xd19d03)[_0x08f0('0x21')](function(_0x3db0ef){return[_0x3db0ef,!![]];});}})['spread'](function(_0x30d6a3,_0x2c8fe5){if(_0x30d6a3){_0x207d59=_0x2c8fe5;if(!_0x2c8fe5){var _0x143b34={'from':(_0x4e2288[_0x08f0('0xbc')][_0x08f0('0xbd')]||'')+'\x20'+(_0x4e2288[_0x08f0('0xbc')]['lastName']||'')};if(_0x55338b['body'][_0x08f0('0xb7')]&&_0x55338b[_0x08f0('0x5e')]['messageId']&&_0x55338b[_0x08f0('0x5e')]['threadId']!=_0x55338b['body'][_0x08f0('0xbe')]){_0x143b34[_0x08f0('0xb7')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbe')];}return _0x30d6a3[_0x08f0('0x37')](_0x143b34);}else{return _0x30d6a3;}}})[_0x08f0('0x21')](function(_0x10164a){_0x4e2288[_0x08f0('0xbb')]=_0x10164a[_0x08f0('0x39')]({'plain':!![]});_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xbf')]=_0x207d59;if(_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xbf')]){if(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xc0')]){_0x4e2288['applications'][_0x08f0('0xc1')]({'id':0x0,'priority':_0x4e2288[_0x08f0('0xa1')][_0x08f0('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x08f0('0xc2')});}}return db[_0x08f0('0xc3')][_0x08f0('0x5d')]({'body':_0x55338b['body']['body'],'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'ChatInteractionId':_0x10164a['id'],'direction':'in','ContactId':_0x4e2288['contact']['id'],'AttachmentId':_0x55338b[_0x08f0('0x5e')][_0x08f0('0xc4')]});})[_0x08f0('0x21')](function(_0x2cffe3){_0x4e2288['message']=_0x2cffe3;if(_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xc5')]){return db[_0x08f0('0xc6')][_0x08f0('0x65')]({'attributes':['id',_0x08f0('0x47')],'where':{'id':_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xc5')]}})['then'](function(_0x2b5685){if(_0x2b5685){_0x4e2288['applications'][_0x08f0('0xc7')]({'id':0x0,'priority':0x0,'app':_0x08f0('0xc8'),'appdata':_0x2b5685[_0x08f0('0x47')]+','+(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xc9')]||0xa),'interval':_0x08f0('0xc2')});_0x4e2288[_0x08f0('0xca')]=!![];}return respondWithRpcPromise(_0x08f0('0xcb'),_0x08f0('0xcc'),_0x4e2288);});}return respondWithRpcPromise(_0x08f0('0xcb'),'startRouting',_0x4e2288);})[_0x08f0('0x21')](function(_0x1a5752){respondWithRpcPromise('EventManager',_0x08f0('0xcd'),{'event':_0x08f0('0x8a'),'message':_0x1a5752},client9002);return _0x1a5752;})[_0x08f0('0x21')](respondWithResult(_0x4d24e0,null))[_0x08f0('0x2b')](handleError(_0x4d24e0,null));};exports[_0x08f0('0xce')]=function(_0xf2ce9e,_0x47680c,_0x1b8dc3){var _0x224563,_0x5deb81,_0x525a1c;var _0x56a946=[];var _0xfbf183=[];var _0xe95793={};var _0x303532=_0xf2ce9e[_0x08f0('0xcf')]||[];var _0xd5b04e=[];var _0x468d71;return db['CmContact'][_0x08f0('0x66')]()[_0x08f0('0x21')](function(_0x4a74e8){if(!_0x4a74e8){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0xd0'));}_0xfbf183=_[_0x08f0('0x93')](_[_0x08f0('0x48')](_0x4a74e8),[_0x08f0('0x94'),_0x08f0('0x95')]);_0x56a946=_['difference'](_['keys'](_0x4a74e8),[_0x08f0('0x94'),_0x08f0('0x95'),'CompanyId',_0x08f0('0x96')]);if(_0xf2ce9e[_0x08f0('0x5e')]['id']){delete _0xf2ce9e[_0x08f0('0x5e')]['id'];}if(_[_0x08f0('0x7f')](_0xf2ce9e['body'][_0x08f0('0x97')])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)['send'](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0xf2ce9e['body']['body'])||_0xf2ce9e['body'][_0x08f0('0x5e')]===''){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x99')));}if(_[_0x08f0('0x7f')](_0xf2ce9e[_0x08f0('0x5e')]['mapKeyOffline'])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))]['ValidationError'](_0x08f0('0xd1')+_0x56a946));}if(!_[_0x08f0('0xd2')](_0x56a946,_0xf2ce9e['body'][_0x08f0('0xd3')])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0xd4')+_0x56a946));}_0xe95793[_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0xd3')]]=_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')];})[_0x08f0('0x21')](function(){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0xf2ce9e[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x9c')],'as':'List'},{'model':db[_0x08f0('0xd5')],'as':'MailAccount'}]});})[_0x08f0('0x21')](handleEntityNotFound(_0x47680c,null))[_0x08f0('0x21')](function(_0x514acc){if(_0x514acc&&_0x514acc[_0x08f0('0x9d')]){_0x5deb81=_0x514acc;var _0x4c3f03=_[_0x08f0('0xa6')](_0xf2ce9e[_0x08f0('0x5e')],{'firstName':_0xf2ce9e[_0x08f0('0x5e')]['from'],'phone':_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')],'ListId':_0x514acc['ListId']});_0x4c3f03[_0xf2ce9e[_0x08f0('0x5e')]['mapKeyOffline']]=_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')];return db[_0x08f0('0x90')][_0x08f0('0xd6')]({'where':_0xe95793,'defaults':_0x4c3f03});}})[_0x08f0('0xd7')](function(_0x570e3a){if(_0x570e3a){_0x525a1c=_0x570e3a;var _0x3ad43b=fs[_0x08f0('0xd8')](path['join'](config[_0x08f0('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0x08f0('0xd9'));var _0x14b029=ejs['render'](_0x3ad43b,{'body':_['toPairs'](_0xf2ce9e['body'][_0x08f0('0x5e')]),'bodyTitle':_0x5deb81[_0x08f0('0xda')]});return db[_0x08f0('0xdb')][_0x08f0('0x5d')]({'body':_0x14b029,'ContactId':_0x570e3a['id'],'ChatWebsiteId':_0x5deb81['id']});}})[_0x08f0('0x21')](function(_0x2ee567){_0x468d71=_0x2ee567;if(_0x303532[_0x08f0('0x4d')]){var _0x5165d6=_0x303532[_0x08f0('0x41')](function(_0x37c190){return{'name':_0x37c190[_0x08f0('0xdc')],'basename':_0x37c190[_0x08f0('0x73')],'type':_0x37c190[_0x08f0('0xdd')],'ChatOfflineMessageId':_0x2ee567['id']};});_0xd5b04e=_0x5165d6[_0x08f0('0x41')](_0xb5e998=>{var _0x169c28={'filename':_0xb5e998['name'],'path':path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],'server',_0x08f0('0xcf'),_0x08f0('0xde'),'offline-chat',_0xb5e998[_0x08f0('0xdf')])};return _0x169c28;});if(!_0x5deb81[_0x08f0('0xe0')]){return db[_0x08f0('0xe1')][_0x08f0('0xe2')](function(_0x23fe4b){return db[_0x08f0('0xe3')]['bulkCreate'](_0x5165d6,{'transaction':_0x23fe4b});});}}})[_0x08f0('0x21')](function(){if(_0x468d71){_0x224563=_0x468d71;return db[_0x08f0('0xd5')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x08f0('0xe4')],'as':'Smtp','raw':!![]}]});}})[_0x08f0('0x21')](function(_0x31de15){if(_0x31de15&&_0x31de15[_0x08f0('0xe5')]&&_0x5deb81['forwardOffline']&&_0x5deb81[_0x08f0('0xe6')]){var _0x30a22d={'tls':{'rejectUnauthorized':![]}};if(_0x31de15[_0x08f0('0xe5')]['service']){_0x30a22d[_0x08f0('0xe7')]=_0x31de15[_0x08f0('0xe5')][_0x08f0('0xe7')];}else{_0x30a22d['host']=_0x31de15['Smtp'][_0x08f0('0xe8')];_0x30a22d[_0x08f0('0xe9')]=_0x31de15['Smtp']['port'];_0x30a22d['secure']=_0x31de15[_0x08f0('0xe5')][_0x08f0('0xea')];}if(_0x31de15[_0x08f0('0xe5')][_0x08f0('0xeb')]){_0x30a22d[_0x08f0('0xec')]={'user':_0x31de15[_0x08f0('0xe5')][_0x08f0('0x5f')],'pass':_0x31de15[_0x08f0('0xe5')][_0x08f0('0xed')]};}return respondWithRpcPromise(_0x08f0('0xee'),'sendMail',{'account':_0x30a22d,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x31de15['name'],_0x31de15['email']||_0x31de15[_0x08f0('0xe5')][_0x08f0('0x5f')]),'to':_0x5deb81['forwardOfflineAddress'],'subject':_0x5deb81['offlineMessageSubject'],'html':_0x224563[_0x08f0('0x5e')],'attachments':_0xd5b04e}},client9003)[_0x08f0('0x21')](function(){return _0x224563;})['catch'](function(_0xf74233){console[_0x08f0('0x27')](_0xf74233);});}})['then'](function(){if(_0x5deb81&&_0x5deb81[_0x08f0('0xe0')]&&_0x5deb81[_0x08f0('0xef')]){var _0x266631=[];if(_0x303532[_0x08f0('0x4d')]){_0x266631=_0x303532[_0x08f0('0x41')](function(_0x186278){return{'name':_0x186278[_0x08f0('0xdc')],'basename':_0x186278['filename'],'type':_0x186278[_0x08f0('0xdd')],'ChatOfflineMessageId':_0x468d71['id']};});}var _0xe306c6;if(!_[_0x08f0('0x7f')](_0x5deb81['subjectOffline'])){var _0x22e74d=_[_0x08f0('0x41')](_0xf2ce9e[_0x08f0('0x5e')],function(_0x1b1332){return _0x1b1332;});var _0x358910=_[_0x08f0('0xf0')](_0x22e74d)[0x0];var _0x2e2f42=_[_0x08f0('0xf1')](_0x358910,function(_0xab0e39){return _0xab0e39;});_0xe306c6=_0x2e2f42[0x1][_0x5deb81[_0x08f0('0xf2')]];}var _0x14e84e={'from':_0x525a1c[_0x08f0('0xf3')],'firstName':_0x525a1c[_0x08f0('0xbd')],'lastName':_0x525a1c['lastName'],'mapKey':_0x08f0('0xf3'),'message':{'from':_0x525a1c[_0x08f0('0xf3')],'to':_0x5deb81[_0x08f0('0xd5')][_0x08f0('0xf3')],'cc':'','subject':_[_0x08f0('0x7f')](_0xe306c6)?_0x5deb81[_0x08f0('0xf4')]:_0xe306c6,'messageId':'','sentAt':new Date(),'attach':_0x266631[_0x08f0('0x4d')],'attachments':_0x266631,'originChannel':_0x08f0('0xf5'),'ChatWebsiteId':_0x5deb81['id'],'ChatOfflineMessageId':_0x224563['id'],'originTo':_0x5deb81[_0x08f0('0xd5')][_0x08f0('0xf3')]},'body':_0x224563[_0x08f0('0x5e')]};var _0x4b8bea={'account':{'id':_0x5deb81['MailAccountId']},'body':_0x14e84e,'log':_0x08f0('0xf6')};return respondWithRpcPromise(_0x08f0('0xf6'),_0x08f0('0xf7'),_0x4b8bea,client9001)['then'](function(){return _0x224563;})[_0x08f0('0x2b')](function(_0x7a9015){console[_0x08f0('0x27')](_0x7a9015);});}return;})['then'](function(){if(_0x224563){return _0x224563;}})[_0x08f0('0x21')](respondWithResult(_0x47680c,null))[_0x08f0('0x2b')](function(_0x1ea3fc){console[_0x08f0('0x27')](_0x08f0('0x2b'),_0x1ea3fc);for(var _0x53bc15 of _0x303532){var _0x197ecb=path[_0x08f0('0x7a')](config['root'],_0x08f0('0xf8'),_0x08f0('0xcf'),_0x08f0('0xde'),'offline-chat',_0x53bc15[_0x08f0('0x73')]);fs_extra['remove'](_0x197ecb)[_0x08f0('0x2b')](function(_0x21e6a3){console[_0x08f0('0x27')](_0x08f0('0xf9'),_0x197ecb,_0x21e6a3);});}});};exports['addInteraction']=function(_0x174777,_0xdcef0,_0x2ea229){return db[_0x08f0('0xb8')][_0x08f0('0x65')]({'where':{'id':_0x174777[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0xdcef0,null))[_0x08f0('0x21')](function(_0x31f839){if(_0x31f839){return _0x31f839['addInteraction'](_0x174777[_0x08f0('0x5e')][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x174777['body'],[_0x08f0('0x71'),'id'])||{});}})['then'](respondWithResult(_0xdcef0,null))[_0x08f0('0x2b')](handleError(_0xdcef0,null));};exports[_0x08f0('0xfb')]=function(_0x3ac299,_0x12defc,_0x51b033){var _0x394ef3={'raw':![],'where':{}};var _0x1ac665={};var _0x49b94b={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x3ac299[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x12defc,null))[_0x08f0('0x21')](function(_0x4ff617){if(_0x4ff617){_0x1ac665[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0xb8')][_0x08f0('0x43')]);_0x1ac665[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x3ac299[_0x08f0('0x49')]);_0x1ac665['filters']=_[_0x08f0('0x4a')](_0x1ac665['model'],_0x1ac665[_0x08f0('0x49')]);_0x394ef3['attributes']=_[_0x08f0('0x4a')](_0x1ac665[_0x08f0('0x4c')],qs['fields'](_0x3ac299['query'][_0x08f0('0x5c')]));_0x394ef3[_0x08f0('0x4b')]=_0x394ef3['attributes'][_0x08f0('0x4d')]?_0x394ef3[_0x08f0('0x4b')]:_0x1ac665[_0x08f0('0x4c')];if(!_0x3ac299[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x394ef3[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x32')]);_0x394ef3[_0x08f0('0x30')]=qs['offset'](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x30')]);}_0x394ef3[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x51')]);_0x394ef3['where']=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x3ac299['query'],_0x1ac665[_0x08f0('0x53')]));_0x394ef3[_0x08f0('0x52')][_0x08f0('0x68')]=_0x4ff617['id'];if(_0x3ac299[_0x08f0('0x49')][_0x08f0('0x55')]){_0x394ef3[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x394ef3[_0x08f0('0x52')],{'$or':_['map'](_0x394ef3[_0x08f0('0x4b')],function(_0x56dee7){var _0xf2139={};_0xf2139[_0x56dee7]={'$like':'%'+_0x3ac299['query'][_0x08f0('0x55')]+'%'};return _0xf2139;})});}_0x394ef3=_[_0x08f0('0x56')]({},_0x394ef3,_0x3ac299[_0x08f0('0x58')]);return db[_0x08f0('0xb8')]['count']({'where':_0x394ef3['where']})[_0x08f0('0x21')](function(_0x5ca733){_0x49b94b[_0x08f0('0x33')]=_0x5ca733;if(_0x3ac299[_0x08f0('0x49')]['includeAll']){_0x394ef3[_0x08f0('0x59')]=[{'model':db[_0x08f0('0x90')],'as':_0x08f0('0xfc'),'required':![]},{'model':db[_0x08f0('0xc6')],'as':_0x08f0('0xfd'),'attributes':[_0x08f0('0x47'),_0x08f0('0xfe'),_0x08f0('0xff')],'required':![]},{'model':db['Tag'],'as':_0x08f0('0x100'),'attributes':['id',_0x08f0('0x47'),_0x08f0('0x101')],'where':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]?{'id':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]}:undefined,'required':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]?!![]:![]}];}return db[_0x08f0('0xb8')][_0x08f0('0x6f')](_0x394ef3);})['then'](function(_0x46a63c){_0x49b94b['rows']=_0x46a63c;return _0x49b94b;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x12defc,_0x394ef3))[_0x08f0('0x2b')](handleError(_0x12defc,null));};function iftimePromise(_0x3dd505,_0x454f83){return respondWithRpcPromise('Command',_0x08f0('0x103'),{'command':_0x454f83[_0x08f0('0x104')]?util[_0x08f0('0xb1')]('iftime\x20%s,%s',_0x3dd505[_0x08f0('0x105')],_0x454f83[_0x08f0('0x104')]):util[_0x08f0('0xb1')]('iftime\x20%s',_0x3dd505[_0x08f0('0x105')])},client9002)['then'](function(_0xc900e0){var _0xb795cd=_0xc900e0&&_0xc900e0['indexOf'](_0x08f0('0x106'))>=0x0?!![]:![];logger[_0x08f0('0x22')](_0x08f0('0x107'),_0x454f83['id'],_0x3dd505['id'],_0x3dd505[_0x08f0('0x105')],_0xb795cd?'ONLINE':_0x08f0('0x108'),_0x454f83[_0x08f0('0x104')]?_0x454f83[_0x08f0('0x104')]:_0x08f0('0x109'));return _0xb795cd;})[_0x08f0('0x2b')](function(_0x5e79cc){logger['error'](_0x08f0('0x107'),_0x454f83['id'],_0x3dd505['id'],_0x3dd505[_0x08f0('0x105')],util[_0x08f0('0x10a')](_0x5e79cc,{'showHidden':![],'depth':null}),_0x454f83[_0x08f0('0x104')]?_0x454f83['timezone']:_0x08f0('0x109'));return![];});}exports[_0x08f0('0x103')]=function(_0x38185c,_0x310364,_0x273a22){var _0x3be30c=0x0;var _0x3a0efc=0x0;var _0x2e7964=![];var _0x479153;var _0x3eb03c;return db['ChatWebsite']['find']({'where':{'id':_0x38185c[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x10b')],'as':_0x08f0('0x10b'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x08f0('0x105')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x310364,null))[_0x08f0('0x21')](function(_0x47336b){if(_0x47336b){_0x479153=_0x47336b;return _0x47336b[_0x08f0('0x10c')]({'raw':!![]});}})[_0x08f0('0x21')](function(_0x300944){if(_0x479153){if(_0x300944){_0x3eb03c=_0x300944;}}return require(_0x08f0('0x1a'))[_0x08f0('0x7e')]();})[_0x08f0('0x21')](function(_0x244723){if(_0x244723){_0x3a0efc=_0x244723[_0x08f0('0x10d')];_0x2e7964=_0x244723[_0x08f0('0x10e')];}})['then'](function(){return db['ChatInteraction'][_0x08f0('0x33')]({'where':{'closed':![]}});})['then'](function(_0x13a735){_0x3be30c=_0x13a735;if(_0x3a0efc&&_0x13a735>_0x3a0efc){return db[_0x08f0('0x10f')][_0x08f0('0x6a')]({'where':{'id':0x1}})[_0x08f0('0x21')](function(_0x3f8f17){if(_0x3f8f17){_0x3f8f17[_0x08f0('0x110')](_0x08f0('0x111'));}});}})[_0x08f0('0x21')](function(){if(_0x479153['Interval']&&_0x479153[_0x08f0('0x10b')]['Intervals']){var _0x5b2af1=[];for(var _0x1b82ad=0x0;_0x1b82ad<_0x479153[_0x08f0('0x10b')][_0x08f0('0x112')][_0x08f0('0x4d')];_0x1b82ad++){var _0x5281f6=_0x479153['Interval'][_0x08f0('0x112')][_0x1b82ad][_0x08f0('0x39')]({'plain':!![]});_0x5b2af1[_0x08f0('0xc1')](iftimePromise(_0x5281f6,_0x479153));}return BPromise[_0x08f0('0x113')](_0x5b2af1)[_0x08f0('0x21')](function(_0x1feb5b){return _[_0x08f0('0x114')](_0x1feb5b);});}else{return!![];}})[_0x08f0('0x21')](function(_0x442bd8){var _0x1b409a=fs['readFileSync'](path['join'](config[_0x08f0('0x7b')],_0x08f0('0x115')),'utf8');var _0x3eb8a3={'remote':_0x479153[_0x08f0('0x116')],'query':querystring['stringify'](_[_0x08f0('0x56')](_0x479153['get']({'plain':!![]}),{'customerIp':_0x38185c[_0x08f0('0xa8')][_0x08f0('0xaa')]||_0x38185c[_0x08f0('0xa8')][_0x08f0('0x117')]||_0x38185c[_0x08f0('0x118')][_0x08f0('0x119')]||_0x38185c['ip'],'referer':_0x38185c[_0x08f0('0xa8')][_0x08f0('0xae')],'openedInteractions':_0x3be30c,'maxInteractions':_0x3a0efc,'virtual':_0x2e7964[_0x08f0('0x10d')],'online':_0x442bd8,'custom':_0x2e7964}))['replace'](/'/g,'\x5c\x27')};_0x310364[_0x08f0('0x3d')](ejs[_0x08f0('0x11a')](Mustache[_0x08f0('0x11a')](_0x1b409a,_0x3eb8a3),{'proactiveActions':_0x3eb03c,'alignment':_0x479153[_0x08f0('0x11b')],'verticalAlignment':_0x479153[_0x08f0('0x11c')],'div_color':_0x479153[_0x08f0('0x101')],'text_color':_0x479153[_0x08f0('0x11d')],'button_color':_0x479153[_0x08f0('0x11e')],'background_color':_0x479153[_0x08f0('0x11f')]}));})[_0x08f0('0x2b')](handleError(_0x310364,null));};exports['addApplications']=function(_0x5c3fd1,_0x3583a7,_0x5adf94){return db['ChatWebsite']['findOne']({'where':{'id':_0x5c3fd1[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x3583a7,null))[_0x08f0('0x21')](function(_0x98e192){if(_0x98e192){return db[_0x08f0('0xe1')][_0x08f0('0xe2')](function(_0x4237a1){return db[_0x08f0('0x9f')]['destroy']({'where':{'ChatWebsiteId':_0x5c3fd1[_0x08f0('0x64')]['id']},'transaction':_0x4237a1})[_0x08f0('0x21')](function(_0x4b11a0){var _0x29fa9d=_[_0x08f0('0x41')](_0x5c3fd1[_0x08f0('0x5e')],function(_0x1587bf){_0x1587bf[_0x08f0('0x68')]=_0x5c3fd1[_0x08f0('0x64')]['id'];return _0x1587bf;});return db[_0x08f0('0x9f')]['bulkCreate'](_0x29fa9d,{'transaction':_0x4237a1});});})[_0x08f0('0x21')](function(){return db[_0x08f0('0x9f')][_0x08f0('0x120')]({'where':{'ChatWebsiteId':_0x5c3fd1[_0x08f0('0x64')]['id']},'order':_0x08f0('0x121')});});}})[_0x08f0('0x21')](respondWithResult(_0x3583a7,null))['catch'](handleError(_0x3583a7,null));};exports['getApplications']=function(_0x1fbce6,_0x18b9a6,_0x386344){var _0x121198={};var _0x3ca093={};var _0x5c2001;var _0x265cee;return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x1fbce6['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x18b9a6,null))[_0x08f0('0x21')](function(_0x52a3d7){if(_0x52a3d7){_0x5c2001=_0x52a3d7;_0x3ca093[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db['ChatApplication'][_0x08f0('0x43')]);_0x3ca093[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x1fbce6[_0x08f0('0x49')]);_0x3ca093['filters']=_[_0x08f0('0x4a')](_0x3ca093[_0x08f0('0x4c')],_0x3ca093['query']);_0x121198[_0x08f0('0x4b')]=_['intersection'](_0x3ca093[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x1fbce6[_0x08f0('0x49')]['fields']));_0x121198[_0x08f0('0x4b')]=_0x121198[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x121198[_0x08f0('0x4b')]:_0x3ca093[_0x08f0('0x4c')];_0x121198[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x51')]);_0x121198['where']=qs['filters'](_[_0x08f0('0x54')](_0x1fbce6[_0x08f0('0x49')],_0x3ca093[_0x08f0('0x53')]));if(_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x55')]){_0x121198[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x121198[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x121198[_0x08f0('0x4b')],function(_0x1917ce){var _0x6cf3ff={};_0x6cf3ff[_0x1917ce]={'$like':'%'+_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0x6cf3ff;})});}_0x121198=_['merge']({},_0x121198,_0x1fbce6[_0x08f0('0x58')]);return _0x5c2001[_0x08f0('0x122')](_0x121198);}})[_0x08f0('0x21')](function(_0x494431){if(_0x494431){_0x265cee=_0x494431[_0x08f0('0x4d')];if(!_0x1fbce6[_0x08f0('0x49')]['hasOwnProperty'](_0x08f0('0x4f'))){_0x121198[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x32')]);_0x121198[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x30')]);}return _0x5c2001['getApplications'](_0x121198);}})[_0x08f0('0x21')](function(_0x4e61ad){if(_0x4e61ad){return _0x4e61ad?{'count':_0x265cee,'rows':_0x4e61ad}:null;}})[_0x08f0('0x21')](respondWithResult(_0x18b9a6,null))[_0x08f0('0x2b')](handleError(_0x18b9a6,null));};exports[_0x08f0('0x123')]=function(_0x210d45,_0x2822b3,_0x16decd){return db['chatProactiveAction'][_0x08f0('0x65')]({'where':{'id':_0x210d45[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x2822b3,null))[_0x08f0('0x21')](function(_0x4120b7){if(_0x4120b7){return _0x4120b7[_0x08f0('0x123')](_0x210d45['body'][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x210d45[_0x08f0('0x5e')],[_0x08f0('0x71'),'id'])||{});}})[_0x08f0('0x21')](respondWithResult(_0x2822b3,null))[_0x08f0('0x2b')](handleError(_0x2822b3,null));};exports[_0x08f0('0x10c')]=function(_0x24b701,_0x57285c,_0xd2c8c2){var _0x3d544a={};var _0x52789f={};var _0x1f8200;var _0x56d504;return db['ChatWebsite'][_0x08f0('0x6a')]({'where':{'id':_0x24b701['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x57285c,null))[_0x08f0('0x21')](function(_0x28ae9b){if(_0x28ae9b){_0x1f8200=_0x28ae9b;_0x52789f[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x124')][_0x08f0('0x43')]);_0x52789f['query']=_[_0x08f0('0x48')](_0x24b701['query']);_0x52789f[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x52789f[_0x08f0('0x4c')],_0x52789f['query']);_0x3d544a['attributes']=_['intersection'](_0x52789f[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x5c')]));_0x3d544a['attributes']=_0x3d544a[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x3d544a[_0x08f0('0x4b')]:_0x52789f[_0x08f0('0x4c')];_0x3d544a[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x51')]);_0x3d544a[_0x08f0('0x52')]=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x24b701[_0x08f0('0x49')],_0x52789f[_0x08f0('0x53')]));if(_0x24b701['query']['filter']){_0x3d544a[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x3d544a[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x3d544a[_0x08f0('0x4b')],function(_0x53f42c){var _0x5db5d7={};_0x5db5d7[_0x53f42c]={'$like':'%'+_0x24b701[_0x08f0('0x49')]['filter']+'%'};return _0x5db5d7;})});}_0x3d544a=_[_0x08f0('0x56')]({},_0x3d544a,_0x24b701[_0x08f0('0x58')]);return _0x1f8200[_0x08f0('0x10c')](_0x3d544a);}})[_0x08f0('0x21')](function(_0x4b4ff0){if(_0x4b4ff0){_0x56d504=_0x4b4ff0['length'];if(!_0x24b701[_0x08f0('0x49')]['hasOwnProperty']('nolimit')){_0x3d544a[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x32')]);_0x3d544a['offset']=qs[_0x08f0('0x30')](_0x24b701[_0x08f0('0x49')]['offset']);}return _0x1f8200[_0x08f0('0x10c')](_0x3d544a);}})[_0x08f0('0x21')](function(_0x2a549c){if(_0x2a549c){return _0x2a549c?{'count':_0x56d504,'rows':_0x2a549c}:null;}})['then'](respondWithResult(_0x57285c,null))['catch'](handleError(_0x57285c,null));};exports[_0x08f0('0x125')]=function(_0x138d64,_0xd0df30,_0x59c533){var _0x2f145a=_0x138d64[_0x08f0('0x49')][_0x08f0('0x126')]===_0x08f0('0x127')?_0x08f0('0x128'):_0x08f0('0x129');return db[_0x08f0('0x42')][_0x08f0('0x65')]({'attributes':['id',_0x2f145a],'where':{'id':_0x138d64['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0xd0df30,null))[_0x08f0('0x21')](function(_0x18d31e){if(_0x18d31e){var _0x3dcb33=_0x18d31e[_0x2f145a];var _0x2f714a=_0x3dcb33&&_0x3dcb33[_0x08f0('0x12a')]?_0x3dcb33[_0x08f0('0x12a')]:[];_0xd0df30[_0x08f0('0x3d')]({'fromKey':_[_0x08f0('0x7f')](_0x3dcb33[_0x08f0('0x12b')])?undefined:_0x3dcb33[_0x08f0('0x12b')],'count':_0x2f714a[_0x08f0('0x4d')],'rows':_0x2f714a});}})[_0x08f0('0x2b')](handleError(_0xd0df30,null));};exports[_0x08f0('0x12c')]=function(_0x3f0068,_0x5c1236,_0x3ed5d5){var _0x433289={'raw':![],'where':{}};var _0x97a19e={};var _0x3c6018={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x3f0068[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x5c1236,null))[_0x08f0('0x21')](function(_0x2884cf){if(_0x2884cf){_0x97a19e['model']=_['keys'](db[_0x08f0('0xdb')]['rawAttributes']);_0x97a19e[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x3f0068[_0x08f0('0x49')]);_0x97a19e[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x97a19e['model'],_0x97a19e[_0x08f0('0x49')]);_0x433289[_0x08f0('0x4b')]=_['intersection'](_0x97a19e[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x3f0068[_0x08f0('0x49')]['fields']));_0x433289['attributes']=_0x433289['attributes'][_0x08f0('0x4d')]?_0x433289[_0x08f0('0x4b')]:_0x97a19e[_0x08f0('0x4c')];if(!_0x3f0068[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x433289['limit']=qs['limit'](_0x3f0068[_0x08f0('0x49')][_0x08f0('0x32')]);_0x433289[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x3f0068['query'][_0x08f0('0x30')]);}_0x433289[_0x08f0('0x50')]=qs['sort'](_0x3f0068[_0x08f0('0x49')][_0x08f0('0x51')]);_0x433289['where']=qs[_0x08f0('0x53')](_['pick'](_0x3f0068[_0x08f0('0x49')],_0x97a19e[_0x08f0('0x53')]));_0x433289[_0x08f0('0x52')]['ChatWebsiteId']=_0x2884cf['id'];if(_0x3f0068[_0x08f0('0x49')][_0x08f0('0x55')]){_0x433289[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x433289['where'],{'$or':_[_0x08f0('0x41')](_0x433289[_0x08f0('0x4b')],function(_0x23e258){var _0x1043c7={};_0x1043c7[_0x23e258]={'$like':'%'+_0x3f0068['query'][_0x08f0('0x55')]+'%'};return _0x1043c7;})});}_0x433289=_[_0x08f0('0x56')]({},_0x433289,_0x3f0068[_0x08f0('0x58')]);return db['ChatOfflineMessage'][_0x08f0('0x33')]({'where':_0x433289[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x50d652){_0x3c6018[_0x08f0('0x33')]=_0x50d652;if(_0x3f0068['query'][_0x08f0('0x6b')]){_0x433289['include']=[{'all':!![]}];}else{_0x433289[_0x08f0('0x59')]=[{'model':db[_0x08f0('0x90')],'as':'Contact','required':![]},{'model':db[_0x08f0('0xe3')],'as':_0x08f0('0x12d'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x433289);})['then'](function(_0x35ad5e){_0x3c6018[_0x08f0('0x5a')]=_0x35ad5e;return _0x3c6018;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x5c1236,_0x433289))[_0x08f0('0x2b')](handleError(_0x5c1236,null));};exports[_0x08f0('0x12e')]=function(_0x6b1700,_0x42f1db,_0x57f331){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x6b1700[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x42f1db,null))[_0x08f0('0x21')](function(_0x5b96ef){if(_0x5b96ef){return _0x5b96ef['addAgents'](_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x6b1700[_0x08f0('0x5e')],[_0x08f0('0x71'),'id'])||{})[_0x08f0('0xd7')](function(_0x2390e2){for(var _0x58f663=0x0;_0x58f663<_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')][_0x08f0('0x4d')];_0x58f663+=0x1){socket[_0x08f0('0x12f')](_0x08f0('0x130'),{'UserId':Number(_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')][_0x58f663]),'ChatWebsiteId':Number(_0x6b1700[_0x08f0('0x64')]['id'])});}return _0x2390e2;});}})[_0x08f0('0x21')](respondWithResult(_0x42f1db,null))[_0x08f0('0x2b')](handleError(_0x42f1db,null));};exports['removeAgents']=function(_0xd6db7e,_0x38b80d,_0x9e2e5c){return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0xd6db7e['params']['id']}})['then'](handleEntityNotFound(_0x38b80d,null))[_0x08f0('0x21')](function(_0x175dd5){if(_0x175dd5){return _0x175dd5[_0x08f0('0x131')](_0xd6db7e['query'][_0x08f0('0x71')])[_0x08f0('0x21')](function(){if(_[_0x08f0('0x132')](_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')])){for(var _0x181cb2=0x0;_0x181cb2<_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')]['length'];_0x181cb2+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')][_0x181cb2]),'ChatWebsiteId':Number(_0xd6db7e['params']['id'])});}}else{socket[_0x08f0('0x12f')](_0x08f0('0x133'),{'UserId':Number(_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')]),'ChatWebsiteId':Number(_0xd6db7e[_0x08f0('0x64')]['id'])});}});}})[_0x08f0('0x21')](respondWithStatusCode(_0x38b80d,null))[_0x08f0('0x2b')](handleError(_0x38b80d,null));};exports[_0x08f0('0x134')]=function(_0x1e751e,_0x2449a9,_0x4d4ec6){var _0x29028e={};var _0x2f4bfe={};var _0x44c960;var _0x32b34f;return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x1e751e[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x2449a9,null))['then'](function(_0x5809ba){if(_0x5809ba){_0x44c960=_0x5809ba;_0x2f4bfe[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0xc6')][_0x08f0('0x43')]);_0x2f4bfe[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x1e751e[_0x08f0('0x49')]);_0x2f4bfe['filters']=_[_0x08f0('0x4a')](_0x2f4bfe[_0x08f0('0x4c')],_0x2f4bfe[_0x08f0('0x49')]);_0x29028e[_0x08f0('0x4b')]=_['intersection'](_0x2f4bfe[_0x08f0('0x4c')],qs['fields'](_0x1e751e['query'][_0x08f0('0x5c')]));_0x29028e[_0x08f0('0x4b')]=_0x29028e['attributes'][_0x08f0('0x4d')]?_0x29028e['attributes']:_0x2f4bfe[_0x08f0('0x4c')];_0x29028e[_0x08f0('0x50')]=qs['sort'](_0x1e751e[_0x08f0('0x49')][_0x08f0('0x51')]);_0x29028e['where']=qs['filters'](_['pick'](_0x1e751e[_0x08f0('0x49')],_0x2f4bfe[_0x08f0('0x53')]));if(_0x1e751e[_0x08f0('0x49')][_0x08f0('0x55')]){_0x29028e[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x29028e[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x29028e['attributes'],function(_0x22a2d2){var _0x2271c1={};_0x2271c1[_0x22a2d2]={'$like':'%'+_0x1e751e['query']['filter']+'%'};return _0x2271c1;})});}_0x29028e=_[_0x08f0('0x56')]({},_0x29028e,_0x1e751e[_0x08f0('0x58')]);return _0x44c960['getAgents'](_0x29028e);}})[_0x08f0('0x21')](function(_0x404304){if(_0x404304){_0x32b34f=_0x404304[_0x08f0('0x4d')];if(!_0x1e751e[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x29028e['limit']=qs[_0x08f0('0x32')](_0x1e751e['query'][_0x08f0('0x32')]);_0x29028e[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x1e751e[_0x08f0('0x49')][_0x08f0('0x30')]);}return _0x44c960[_0x08f0('0x134')](_0x29028e);}})[_0x08f0('0x21')](function(_0x2e7478){if(_0x2e7478){return _0x2e7478?{'count':_0x32b34f,'rows':_0x2e7478}:null;}})[_0x08f0('0x21')](respondWithResult(_0x2449a9,null))[_0x08f0('0x2b')](handleError(_0x2449a9,null));};
\ No newline at end of file
+var _0xfe33=['waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','transaction','Attachment','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','findAll','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','getLicense','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','virtual','render','verticalAlignment','textColor','color_button','backgroundColor','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','omit','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfe33,0x6e));var _0x3fe3=function(_0x1d32ac,_0x16f800){_0x1d32ac=_0x1d32ac-0x0;var _0x2e15e4=_0xfe33[_0x1d32ac];return _0x2e15e4;};'use strict';var emlformat=require(_0x3fe3('0x0'));var rimraf=require(_0x3fe3('0x1'));var zipdir=require(_0x3fe3('0x2'));var jsonpatch=require(_0x3fe3('0x3'));var rp=require(_0x3fe3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fe3('0x5'));var csv=require(_0x3fe3('0x6'));var ejs=require(_0x3fe3('0x7'));var fs=require('fs');var fs_extra=require(_0x3fe3('0x8'));var _=require('lodash');var squel=require(_0x3fe3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3fe3('0xa'));var toCsv=require(_0x3fe3('0x6'));var querystring=require('querystring');var Papa=require(_0x3fe3('0xb'));var Redis=require('ioredis');var authService=require(_0x3fe3('0xc'));var qs=require(_0x3fe3('0xd'));var as=require(_0x3fe3('0xe'));var hardwareService=require(_0x3fe3('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x3fe3('0x10'));var config=require(_0x3fe3('0x11'));var licenseUtil=require(_0x3fe3('0x12'));var db=require(_0x3fe3('0x13'))['db'];config['redis']=_[_0x3fe3('0x14')](config[_0x3fe3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fe3('0x16'))(new Redis(config['redis']));require(_0x3fe3('0x17'))['register'](socket);var jayson=require(_0x3fe3('0x18'));var client=jayson[_0x3fe3('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232a});var client9003=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232b});var client9001=jayson['client'][_0x3fe3('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x32765f,_0x341524,_0x28478d,_0x5d5526){return new BPromise(function(_0x589f2a,_0xdc2fe3){var _0x36af23=_0x5d5526||client;return _0x36af23[_0x3fe3('0x1b')](_0x32765f,_0x28478d)[_0x3fe3('0x1c')](function(_0x57a784){logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,_0x3fe3('0x1f'));logger[_0x3fe3('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x341524,_0x3fe3('0x1f'),JSON['stringify'](_0x57a784));if(_0x57a784[_0x3fe3('0x21')]){if(_0x57a784['error'][_0x3fe3('0x22')]===0x1f4){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error']['message']);return _0xdc2fe3(_0x57a784[_0x3fe3('0x21')][_0x3fe3('0x23')]);}logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error'][_0x3fe3('0x23')]);return _0x589f2a(_0x57a784[_0x3fe3('0x21')]['message']);}else{logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,'request\x20sent');_0x589f2a(_0x57a784[_0x3fe3('0x24')][_0x3fe3('0x23')]);}})[_0x3fe3('0x25')](function(_0x1c731d){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x1c731d);_0xdc2fe3(_0x1c731d);});});}function respondWithStatusCode(_0x2b5e33,_0xf9a689){_0xf9a689=_0xf9a689||0xcc;return function(_0x9bf9ed){if(_0x9bf9ed){return _0x2b5e33[_0x3fe3('0x26')](_0xf9a689);}return _0x2b5e33[_0x3fe3('0x27')](_0xf9a689)[_0x3fe3('0x28')]();};}function respondWithResult(_0x4aef2e,_0x1e243c){_0x1e243c=_0x1e243c||0xc8;return function(_0x48e7f7){if(_0x48e7f7){return _0x4aef2e[_0x3fe3('0x27')](_0x1e243c)[_0x3fe3('0x29')](_0x48e7f7);}};}function respondWithFilteredResult(_0x3db9b3,_0x3ec7f5){return function(_0x59e27d){if(_0x59e27d){var _0x242701=typeof _0x3ec7f5[_0x3fe3('0x2a')]===_0x3fe3('0x2b')&&typeof _0x3ec7f5[_0x3fe3('0x2c')]===_0x3fe3('0x2b');var _0x54934a=_0x59e27d[_0x3fe3('0x2d')];var _0xa423bd=_0x242701?0x0:_0x3ec7f5[_0x3fe3('0x2a')];var _0xe68adb=_0x242701?_0x59e27d[_0x3fe3('0x2d')]:_0x3ec7f5['offset']+_0x3ec7f5[_0x3fe3('0x2c')];var _0xfea885;if(_0xe68adb>=_0x54934a){_0xe68adb=_0x54934a;_0xfea885=0xc8;}else{_0xfea885=0xce;}_0x3db9b3[_0x3fe3('0x27')](_0xfea885);return _0x3db9b3[_0x3fe3('0x2e')](_0x3fe3('0x2f'),_0xa423bd+'-'+_0xe68adb+'/'+_0x54934a)[_0x3fe3('0x29')](_0x59e27d);}return null;};}function patchUpdates(_0x13b9e3){return function(_0xf5da50){try{jsonpatch[_0x3fe3('0x30')](_0xf5da50,_0x13b9e3,!![]);}catch(_0x40dc5d){return BPromise['reject'](_0x40dc5d);}return _0xf5da50['save']();};}function saveUpdates(_0x45828c,_0x3f8f49){return function(_0x5e8b03){if(_0x5e8b03){return _0x5e8b03[_0x3fe3('0x31')](_0x45828c)[_0x3fe3('0x1c')](function(_0xe03238){return _0xe03238;});}return null;};}function removeEntity(_0x379a4b,_0x520ea9){return function(_0x58b018){if(_0x58b018){return _0x58b018[_0x3fe3('0x32')]()[_0x3fe3('0x1c')](function(){var _0xb46c34=_0x58b018[_0x3fe3('0x33')]({'plain':!![]});var _0xcafc68=_0x3fe3('0x34');return db[_0x3fe3('0x35')][_0x3fe3('0x32')]({'where':{'type':_0xcafc68,'resourceId':_0xb46c34['id']}})[_0x3fe3('0x1c')](function(){return _0x58b018;});})['then'](function(){_0x379a4b[_0x3fe3('0x27')](0xcc)[_0x3fe3('0x28')]();});}};}function handleEntityNotFound(_0x3e2f64,_0x4f9f85){return function(_0x302f18){if(!_0x302f18){_0x3e2f64['sendStatus'](0x194);}return _0x302f18;};}function handleError(_0x2e2738,_0x4b3f30){_0x4b3f30=_0x4b3f30||0x1f4;return function(_0x4c05ca){logger['error'](_0x4c05ca[_0x3fe3('0x36')]);if(_0x4c05ca[_0x3fe3('0x37')]){delete _0x4c05ca['name'];}_0x2e2738[_0x3fe3('0x27')](_0x4b3f30)[_0x3fe3('0x38')](_0x4c05ca);};}exports[_0x3fe3('0x39')]=function(_0x4946b3,_0x1fbb55){var _0x242037={'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]},_0x3f15af={},_0xb447d3={'count':0x0,'rows':[]};var _0x5a4593=_['map'](db[_0x3fe3('0x3c')][_0x3fe3('0x3d')],function(_0x3e6f7d){return{'name':_0x3e6f7d[_0x3fe3('0x3e')],'type':_0x3e6f7d[_0x3fe3('0x3f')][_0x3fe3('0x40')]};});_0x3f15af[_0x3fe3('0x41')]=_[_0x3fe3('0x42')](_0x5a4593,_0x3fe3('0x37'));_0x3f15af[_0x3fe3('0x43')]=_['keys'](_0x4946b3[_0x3fe3('0x43')]);_0x3f15af[_0x3fe3('0x44')]=_['intersection'](_0x3f15af['model'],_0x3f15af[_0x3fe3('0x43')]);_0x242037['attributes']=_[_0x3fe3('0x45')](_0x3f15af['model'],qs[_0x3fe3('0x46')](_0x4946b3['query'][_0x3fe3('0x46')]));_0x242037['attributes']=_0x242037[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x242037['attributes']:_0x3f15af['model'];if(!_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x242037[_0x3fe3('0x2c')]=qs['limit'](_0x4946b3['query'][_0x3fe3('0x2c')]);_0x242037['offset']=qs[_0x3fe3('0x2a')](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x242037[_0x3fe3('0x4b')]=qs['sort'](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x242037[_0x3fe3('0x4d')]=qs['filters'](_[_0x3fe3('0x4e')](_0x4946b3[_0x3fe3('0x43')],_0x3f15af[_0x3fe3('0x44')]),_0x5a4593);if(_0x4946b3['query'][_0x3fe3('0x4f')]){_0x242037[_0x3fe3('0x4d')]=_['merge'](_0x242037[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x5a4593,function(_0x45d719){if(_0x45d719[_0x3fe3('0x3f')]!==_0x3fe3('0x50')){var _0xc960f6={};_0xc960f6[_0x45d719[_0x3fe3('0x37')]]={'$like':'%'+_0x4946b3[_0x3fe3('0x43')]['filter']+'%'};return _0xc960f6;}})});}_0x242037=_['merge']({},_0x242037,_0x4946b3[_0x3fe3('0x51')]);var _0x38443d={'where':_0x242037['where']};return db[_0x3fe3('0x3c')][_0x3fe3('0x2d')](_0x38443d)[_0x3fe3('0x1c')](function(_0x1130d7){_0xb447d3['count']=_0x1130d7;if(_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x242037[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x3c')]['findAll'](_0x242037);})[_0x3fe3('0x1c')](function(_0x57d9e6){_0xb447d3[_0x3fe3('0x54')]=_0x57d9e6;return _0xb447d3;})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x1fbb55,_0x242037))[_0x3fe3('0x25')](handleError(_0x1fbb55,null));};exports[_0x3fe3('0x55')]=function(_0xe70851,_0x16937a){var _0x2c990f={'raw':![],'where':{'id':_0xe70851[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':'mandatoryDispositionPause'}]},_0x58ff4b={};_0x58ff4b[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x3c')]['rawAttributes']);_0x58ff4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xe70851[_0x3fe3('0x43')]);_0x58ff4b[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],_0x58ff4b[_0x3fe3('0x43')]);_0x2c990f['attributes']=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],qs['fields'](_0xe70851[_0x3fe3('0x43')]['fields']));_0x2c990f[_0x3fe3('0x47')]=_0x2c990f['attributes'][_0x3fe3('0x48')]?_0x2c990f[_0x3fe3('0x47')]:_0x58ff4b['model'];if(_0xe70851[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x2c990f[_0x3fe3('0x53')]=[{'all':!![]}];}_0x2c990f=_[_0x3fe3('0x58')]({},_0x2c990f,_0xe70851[_0x3fe3('0x51')]);return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2c990f)[_0x3fe3('0x1c')](handleEntityNotFound(_0x16937a,null))[_0x3fe3('0x1c')](respondWithResult(_0x16937a,null))[_0x3fe3('0x25')](handleError(_0x16937a,null));};exports[_0x3fe3('0x5a')]=function(_0x5724e8,_0xba56e){return db[_0x3fe3('0x3c')][_0x3fe3('0x5a')](_0x5724e8['body'],{})[_0x3fe3('0x1c')](function(_0x421ffb){var _0x33b1e4=_0x5724e8[_0x3fe3('0x5b')][_0x3fe3('0x33')]({'plain':!![]});if(!_0x33b1e4)throw new Error(_0x3fe3('0x5c'));if(_0x33b1e4['role']===_0x3fe3('0x5b')){var _0x285c8b=_0x421ffb['get']({'plain':!![]});var _0x508b57='ChatWebsites';return db[_0x3fe3('0x5d')]['find']({'where':{'name':_0x508b57,'userProfileId':_0x33b1e4[_0x3fe3('0x5e')]},'raw':!![]})['then'](function(_0x1cdcad){if(_0x1cdcad&&_0x1cdcad[_0x3fe3('0x5f')]===0x0){return db[_0x3fe3('0x35')][_0x3fe3('0x5a')]({'name':_0x285c8b[_0x3fe3('0x37')],'resourceId':_0x285c8b['id'],'type':_0x1cdcad[_0x3fe3('0x37')],'sectionId':_0x1cdcad['id']},{})[_0x3fe3('0x1c')](function(){return _0x421ffb;});}else{return _0x421ffb;}})['catch'](function(_0x56e3b9){logger[_0x3fe3('0x21')](_0x3fe3('0x60'),_0x56e3b9);throw _0x56e3b9;});}return _0x421ffb;})[_0x3fe3('0x1c')](respondWithResult(_0xba56e,0xc9))[_0x3fe3('0x25')](handleError(_0xba56e,null));};exports['update']=function(_0x22ab38,_0x496a77){if(_0x22ab38['body']['id']){delete _0x22ab38[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x22ab38[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0x496a77,null))[_0x3fe3('0x1c')](saveUpdates(_0x22ab38[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x496a77,null))[_0x3fe3('0x25')](handleError(_0x496a77,null));};exports[_0x3fe3('0x32')]=function(_0x4ff239,_0x2b1fa0){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x4ff239[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b1fa0,null))['then'](removeEntity(_0x2b1fa0,null))[_0x3fe3('0x25')](handleError(_0x2b1fa0,null));};exports[_0x3fe3('0x62')]=function(_0x3007e6,_0x39a557){return db[_0x3fe3('0x3c')]['describe']()[_0x3fe3('0x1c')](respondWithResult(_0x39a557,null))[_0x3fe3('0x25')](handleError(_0x39a557,null));};exports[_0x3fe3('0x63')]=function(_0x469d06,_0x229132,_0x5f3e18){if(_0x469d06['body']['id']){delete _0x469d06[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x469d06['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x229132,null))[_0x3fe3('0x1c')](function(_0x11bbdd){if(_0x11bbdd){_0x469d06[_0x3fe3('0x61')]['ChatWebsiteId']=_0x11bbdd['id'];return db[_0x3fe3('0x64')][_0x3fe3('0x5a')](_0x469d06[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x229132,null))[_0x3fe3('0x25')](handleError(_0x229132,null));};exports[_0x3fe3('0x65')]=function(_0x35ecc7,_0x58b242,_0x695b26){var _0x44d88f={'raw':![],'where':{}};var _0x27646a={};var _0x22785d={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x35ecc7['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x58b242,null))['then'](function(_0x5d8e6b){if(_0x5d8e6b){_0x27646a[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x64')][_0x3fe3('0x3d')]);_0x27646a[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x35ecc7[_0x3fe3('0x43')]);_0x27646a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],_0x27646a[_0x3fe3('0x43')]);_0x44d88f[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x35ecc7['query']['fields']));_0x44d88f[_0x3fe3('0x47')]=_0x44d88f[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x44d88f[_0x3fe3('0x47')]:_0x27646a[_0x3fe3('0x41')];if(!_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x44d88f[_0x3fe3('0x2c')]=qs['limit'](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x44d88f[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x44d88f[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x35ecc7['query'][_0x3fe3('0x4c')]);_0x44d88f[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x35ecc7[_0x3fe3('0x43')],_0x27646a['filters']));_0x44d88f['where'][_0x3fe3('0x67')]=_0x5d8e6b['id'];if(_0x35ecc7['query']['filter']){_0x44d88f[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x44d88f[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x44d88f[_0x3fe3('0x47')],function(_0x1ae1a5){var _0x4b917e={};_0x4b917e[_0x1ae1a5]={'$like':'%'+_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x4b917e;})});}_0x44d88f=_['merge']({},_0x44d88f,_0x35ecc7[_0x3fe3('0x51')]);return db['Disposition'][_0x3fe3('0x2d')]({'where':_0x44d88f[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x3ceb8b){_0x22785d[_0x3fe3('0x2d')]=_0x3ceb8b;if(_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x44d88f['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x44d88f);})[_0x3fe3('0x1c')](function(_0x3f77bb){_0x22785d['rows']=_0x3f77bb;return _0x22785d;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x58b242,_0x44d88f))[_0x3fe3('0x25')](handleError(_0x58b242,null));};exports[_0x3fe3('0x68')]=function(_0x57643f,_0x29b240,_0x1c11c7){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x57643f['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x29b240,null))[_0x3fe3('0x1c')](function(_0x122247){if(_0x122247){return _0x122247[_0x3fe3('0x68')](_0x57643f['query'][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x29b240,null))['catch'](handleError(_0x29b240,null));};exports[_0x3fe3('0x6a')]=function(_0xabb2fc,_0x16a922,_0x15c379){if(_0xabb2fc['body']['id']){delete _0xabb2fc[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0xabb2fc['params']['id']}})['then'](handleEntityNotFound(_0x16a922,null))[_0x3fe3('0x1c')](function(_0x4f1c8d){if(_0x4f1c8d){_0xabb2fc[_0x3fe3('0x61')][_0x3fe3('0x67')]=_0x4f1c8d['id'];return db['CannedAnswer'][_0x3fe3('0x5a')](_0xabb2fc[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x16a922,null))['catch'](handleError(_0x16a922,null));};exports[_0x3fe3('0x6b')]=function(_0xf0bca4,_0x1e4df7,_0x53c7ca){var _0x865f4b={'raw':![],'where':{}};var _0x111b45={};var _0x3f0cf2={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0xf0bca4[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1e4df7,null))[_0x3fe3('0x1c')](function(_0x103c3f){if(_0x103c3f){_0x111b45[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x6c')][_0x3fe3('0x3d')]);_0x111b45[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xf0bca4['query']);_0x111b45['filters']=_[_0x3fe3('0x45')](_0x111b45['model'],_0x111b45[_0x3fe3('0x43')]);_0x865f4b['attributes']=_[_0x3fe3('0x45')](_0x111b45[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x865f4b[_0x3fe3('0x47')]=_0x865f4b[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x865f4b[_0x3fe3('0x47')]:_0x111b45[_0x3fe3('0x41')];if(!_0xf0bca4['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x865f4b[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0xf0bca4['query'][_0x3fe3('0x2c')]);_0x865f4b['offset']=qs[_0x3fe3('0x2a')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x865f4b[_0x3fe3('0x4b')]=qs['sort'](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x865f4b['where']=qs[_0x3fe3('0x44')](_['pick'](_0xf0bca4[_0x3fe3('0x43')],_0x111b45['filters']));_0x865f4b['where'][_0x3fe3('0x67')]=_0x103c3f['id'];if(_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x865f4b[_0x3fe3('0x4d')]=_['merge'](_0x865f4b[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x865f4b[_0x3fe3('0x47')],function(_0x3b5d8d){var _0x3ec497={};_0x3ec497[_0x3b5d8d]={'$like':'%'+_0xf0bca4['query'][_0x3fe3('0x4f')]+'%'};return _0x3ec497;})});}_0x865f4b=_[_0x3fe3('0x58')]({},_0x865f4b,_0xf0bca4['options']);return db[_0x3fe3('0x6c')][_0x3fe3('0x2d')]({'where':_0x865f4b[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4a438e){_0x3f0cf2[_0x3fe3('0x2d')]=_0x4a438e;if(_0xf0bca4['query']['includeAll']){_0x865f4b[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x6c')]['findAll'](_0x865f4b);})[_0x3fe3('0x1c')](function(_0x365ec9){_0x3f0cf2[_0x3fe3('0x54')]=_0x365ec9;return _0x3f0cf2;});}})['then'](respondWithFilteredResult(_0x1e4df7,_0x865f4b))[_0x3fe3('0x25')](handleError(_0x1e4df7,null));};exports[_0x3fe3('0x6d')]=function(_0x4b61ea,_0x4c3f4f,_0x6a99eb){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x4b61ea['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4c3f4f,null))[_0x3fe3('0x1c')](function(_0x378fea){if(_0x378fea){return _0x378fea['removeAnswers'](_0x4b61ea[_0x3fe3('0x43')][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x4c3f4f,null))[_0x3fe3('0x25')](handleError(_0x4c3f4f,null));};exports[_0x3fe3('0x6e')]=function(_0x5d8e3b,_0x3448e6,_0x4bb9d3){_0x5d8e3b['body'][_0x3fe3('0x6f')]=_0x5d8e3b[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x5d8e3b[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x3448e6,null))[_0x3fe3('0x1c')](saveUpdates(_0x5d8e3b[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x3448e6,null))['catch'](handleError(_0x3448e6,null));};exports[_0x3fe3('0x71')]=function(_0x28bcb8,_0x33a892,_0x321a32){_0x28bcb8[_0x3fe3('0x61')][_0x3fe3('0x72')]=_0x28bcb8[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x28bcb8[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x33a892,null))[_0x3fe3('0x1c')](saveUpdates(_0x28bcb8[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x33a892,null))[_0x3fe3('0x25')](handleError(_0x33a892,null));};exports['addCustomerAvatar']=function(_0x1845dd,_0x15408b,_0x219cb9){_0x1845dd[_0x3fe3('0x61')][_0x3fe3('0x73')]=_0x1845dd['file'][_0x3fe3('0x74')];return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x1845dd[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x15408b,null))['then'](saveUpdates(_0x1845dd[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x15408b,null))['catch'](handleError(_0x15408b,null));};exports['addSystemAvatar']=function(_0x57ac0f,_0x4eb740,_0x56f0ae){_0x57ac0f[_0x3fe3('0x61')][_0x3fe3('0x75')]=_0x57ac0f['file'][_0x3fe3('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x57ac0f[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x4eb740,null))[_0x3fe3('0x1c')](saveUpdates(_0x57ac0f[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x4eb740,null))[_0x3fe3('0x25')](handleError(_0x4eb740,null));};exports[_0x3fe3('0x76')]=function(_0x6245cd,_0x44c754,_0x2a2cca){var _0x8eae21=path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x78'));var _0x250101={'where':{'id':_0x6245cd[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x6f')],'raw':!![]};var _0x4c59c5=![];return require(_0x3fe3('0x12'))['getLicense']()['then'](function(_0x573578){if(_0x573578){_0x4c59c5=_0x573578[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x250101);})[_0x3fe3('0x1c')](handleEntityNotFound(_0x44c754,null))[_0x3fe3('0x1c')](function(_0x5e590b){if(_0x5e590b){if(!_[_0x3fe3('0x7a')](_0x5e590b['sitepic'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]))&&_0x4c59c5){_0x8eae21=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]);}}return _0x44c754[_0x3fe3('0x7e')](_0x8eae21);}})[_0x3fe3('0x25')](handleError(_0x44c754,null));};exports['getAvatar']=function(_0x203f60,_0x5581d7,_0x6284f9){var _0x3c71d5=path['join'](config['root'],_0x3fe3('0x7f'));var _0x2b86e8={'where':{'id':_0x203f60[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x72')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2b86e8)[_0x3fe3('0x1c')](handleEntityNotFound(_0x5581d7,null))[_0x3fe3('0x1c')](function(_0x19f25e){if(_0x19f25e){if(!_['isNil'](_0x19f25e['agentAvatar'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e['agentAvatar']))){_0x3c71d5=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e[_0x3fe3('0x72')]);}}return _0x5581d7[_0x3fe3('0x7e')](_0x3c71d5);}})[_0x3fe3('0x25')](handleError(_0x5581d7,null));};exports[_0x3fe3('0x81')]=function(_0x46bb9d,_0x15b981,_0x27803d){var _0x3bf029=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x82'));var _0x1a0a6d={'where':{'id':_0x46bb9d[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x1a0a6d)[_0x3fe3('0x1c')](handleEntityNotFound(_0x15b981,null))[_0x3fe3('0x1c')](function(_0x35d384){if(_0x35d384){if(!_[_0x3fe3('0x7a')](_0x35d384[_0x3fe3('0x73')])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x80'),_0x35d384['customerAvatar']))&&_0x35d384[_0x3fe3('0x83')]){_0x3bf029=path['join'](config[_0x3fe3('0x77')],'server/files/images/avatars/',_0x35d384[_0x3fe3('0x73')]);}}return _0x15b981[_0x3fe3('0x7e')](_0x3bf029);}})[_0x3fe3('0x25')](handleError(_0x15b981,null));};exports[_0x3fe3('0x84')]=function(_0x2b8eb8,_0x2bf28f,_0x24f160){var _0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x85'));var _0x53c285={'where':{'id':_0x2b8eb8[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x75')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x53c285)[_0x3fe3('0x1c')](handleEntityNotFound(_0x2bf28f,null))[_0x3fe3('0x1c')](function(_0x1c81cf){if(_0x1c81cf){if(!_[_0x3fe3('0x7a')](_0x1c81cf['systemAvatar'])){if(fs[_0x3fe3('0x7b')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]))){_0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]);}}return _0x2bf28f['download'](_0x512d61);}})[_0x3fe3('0x25')](handleError(_0x2bf28f,null));};exports['notify']=function(_0x50743b,_0x217f32,_0x2026c4){var _0x17d825=require(_0x3fe3('0x86'));var _0x50500d=new _0x17d825();var _0x344c85=_0x50500d[_0x3fe3('0x87')](_0x50743b[_0x3fe3('0x88')]['user-agent'])[_0x3fe3('0x89')]();var _0x4dfd69={'body':_0x50743b['body'],'channel':_0x3fe3('0x8a')};var _0x4c2c21=[];var _0x4daecd=[];var _0x411d13={};var _0x1e9122=![];return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()['then'](function(_0xa4fcfd){if(!_0xa4fcfd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x4c2c21=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f')]);_0x4daecd=_['difference'](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f'),_0x3fe3('0x90'),_0x3fe3('0x91')]);if(_0x50743b['body']['id']){delete _0x50743b[_0x3fe3('0x61')]['id'];}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['from'])){throw new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0x93'));}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['body'])||_0x50743b['body'][_0x3fe3('0x61')]===''){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94'));}if(_['isNil'](_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4daecd);}if(!_['includes'](_0x4daecd,_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x96')+_0x4daecd);}_0x411d13[_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')]]=_0x50743b['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x50743b[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':_0x3fe3('0x99'),'include':[{'model':db[_0x3fe3('0x8b')],'as':_0x3fe3('0x9a'),'where':_0x411d13,'limit':0x1,'order':[[_0x3fe3('0x8f'),_0x3fe3('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0x59b703){if(_0x59b703&&_0x59b703[_0x3fe3('0x99')]){_0x4dfd69[_0x3fe3('0x9c')]=_0x59b703;_0x4dfd69[_0x3fe3('0x9d')]=_0x59b703[_0x3fe3('0x9e')];_0x4dfd69[_0x3fe3('0x9f')]=_0x59b703[_0x3fe3('0x99')];_0x4dfd69[_0x3fe3('0x9d')]=_[_0x3fe3('0xa0')](_0x4dfd69[_0x3fe3('0x9d')],[_0x3fe3('0xa1')],[_0x3fe3('0xa2')]);if(_0x4dfd69[_0x3fe3('0x9c')]['Applications']){delete _0x4dfd69['account'][_0x3fe3('0x9e')];}if(_0x4dfd69['account'][_0x3fe3('0x99')]&&_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0x99')][_0x3fe3('0x9a')][_0x3fe3('0x48')]){return _0x4dfd69['account']['List'][_0x3fe3('0x9a')][0x0];}var _0xb252ec=_['defaults'](_0x50743b['body'],{'firstName':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')],'ListId':_0x59b703[_0x3fe3('0x91')]});_0xb252ec[_0x50743b['body']['mapKey']]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')];return db['CmContact'][_0x3fe3('0x5a')](_0xb252ec,{'fields':_0x4c2c21,'raw':!![]});}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0xd17ec2){_0x4dfd69[_0x3fe3('0xa3')]=_0xd17ec2;var _0x1f9b5c=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xa4')];if(_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa5')]){_0x1f9b5c=_0x50743b[_0x3fe3('0x88')]['cf-connecting-ip'];}else if(_0x50743b['headers'][_0x3fe3('0xa6')]){_0x1f9b5c=_[_0x3fe3('0xa7')](_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa6')][_0x3fe3('0xa8')](','));}if(_0xd17ec2){var _0x1c9f96={'ContactId':_0xd17ec2['id'],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'from':(_0xd17ec2[_0x3fe3('0xa9')]||'')+'\x20'+(_0xd17ec2['lastName']||''),'customerIp':_0x1f9b5c,'customerPort':_0x50743b[_0x3fe3('0x88')]['x-real-port']?_0x50743b['headers']['x-real-port']:null,'referer':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xaa')],'browserName':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')]&&_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]?util[_0x3fe3('0xad')](_0x3fe3('0xae'),_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')],_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]):_0x3fe3('0xaf'),'browserVersion':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]||_0x3fe3('0xaf'),'osName':util['format']('%s\x20%s',_0x344c85['os'][_0x3fe3('0x37')],_0x344c85['os'][_0x3fe3('0xac')]),'osVersion':_0x344c85['os'][_0x3fe3('0xac')],'deviceModel':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')]&&_0x344c85[_0x3fe3('0xb0')]['vendor']?util[_0x3fe3('0xad')]('%s\x20%s\x20%s',_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')],_0x344c85[_0x3fe3('0xb0')]['vendor'],_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')]):null,'deviceVendor':_0x344c85['device'][_0x3fe3('0xb1')],'deviceType':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')],'formData':JSON[_0x3fe3('0xb2')](_0x50743b[_0x3fe3('0x61')])};var _0x511746={'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'closed':![]};if(_0x50743b['body'][_0x3fe3('0xb3')]){_0x511746['threadId']=_0x50743b['body']['threadId'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})[_0x3fe3('0x1c')](function(_0xd158f1){if(_0xd158f1){return[_0xd158f1,![]];}_0x1c9f96[_0x3fe3('0xb3')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')];_0x1c9f96[_0x3fe3('0xb4')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb4')];return db[_0x3fe3('0xb5')]['create'](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x138561){return[_0x138561,!![]];});});}_0x511746[_0x3fe3('0xb6')]=_0xd17ec2['id'];if(_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]&&_0x50743b[_0x3fe3('0x61')]['interaction']['id']){_0x511746['id']=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]['id'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})['then'](function(_0x4b8ca1){if(_0x4b8ca1){return[_0x4b8ca1,![]];}return db['ChatInteraction'][_0x3fe3('0x5a')](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x562264){return[_0x562264,!![]];});});}return db[_0x3fe3('0xb5')][_0x3fe3('0x5a')](_0x1c9f96)['then'](function(_0x305b67){return[_0x305b67,!![]];});}})[_0x3fe3('0xb8')](function(_0x2befc8,_0x59e5c7){if(_0x2befc8){_0x1e9122=_0x59e5c7;if(!_0x59e5c7){var _0x3467e1={'from':(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xa9')]||'')+'\x20'+(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xb9')]||'')};if(_0x50743b[_0x3fe3('0x61')]['threadId']&&_0x50743b['body'][_0x3fe3('0xba')]&&_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')]!=_0x50743b[_0x3fe3('0x61')]['messageId']){_0x3467e1['threadId']=_0x50743b[_0x3fe3('0x61')]['messageId'];}return _0x2befc8[_0x3fe3('0x31')](_0x3467e1);}else{return _0x2befc8;}}})[_0x3fe3('0x1c')](function(_0x474e26){_0x4dfd69['interaction']=_0x474e26[_0x3fe3('0x33')]({'plain':!![]});_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xbb')]=_0x1e9122;if(_0x4dfd69[_0x3fe3('0xb7')]['created']){if(_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0xbc')]){_0x4dfd69['applications']['push']({'id':0x0,'priority':_0x4dfd69[_0x3fe3('0x9d')]['length']+0x1,'app':_0x3fe3('0xbd'),'appdata':_0x3fe3('0xbe'),'interval':_0x3fe3('0xbf')});}}return db[_0x3fe3('0xc0')]['create']({'body':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x61')],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'ChatInteractionId':_0x474e26['id'],'direction':'in','ContactId':_0x4dfd69[_0x3fe3('0xa3')]['id'],'AttachmentId':_0x50743b['body'][_0x3fe3('0xc1')]});})[_0x3fe3('0x1c')](function(_0x369912){_0x4dfd69[_0x3fe3('0x23')]=_0x369912;if(_0x4dfd69['interaction']['UserId']){return db[_0x3fe3('0xc2')][_0x3fe3('0x59')]({'attributes':['id',_0x3fe3('0x37')],'where':{'id':_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xc3')]}})[_0x3fe3('0x1c')](function(_0x403f02){if(_0x403f02){_0x4dfd69[_0x3fe3('0x9d')][_0x3fe3('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x403f02[_0x3fe3('0x37')]+','+(_0x4dfd69['account'][_0x3fe3('0xc5')]||0xa),'interval':_0x3fe3('0xbf')});_0x4dfd69[_0x3fe3('0xc6')]=!![];}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);});}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);})[_0x3fe3('0x1c')](function(_0x444fe9){respondWithRpcPromise('EventManager',_0x3fe3('0xc8'),{'event':_0x3fe3('0xc9'),'message':_0x444fe9},client9002);return _0x444fe9;})[_0x3fe3('0x1c')](respondWithResult(_0x217f32,null))[_0x3fe3('0x25')](handleError(_0x217f32,null));};exports[_0x3fe3('0xca')]=function(_0x399100,_0x3857c6,_0x56d3d3){var _0x2215e2,_0x2e075a,_0x2d3a89;var _0x8cddf4=[];var _0x5b04a0=[];var _0x158444={};var _0x2bd590=_0x399100[_0x3fe3('0xcb')]||[];var _0x314763=[];var _0x501707;return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()[_0x3fe3('0x1c')](function(_0x1357cd){if(!_0x1357cd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x5b04a0=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),_0x3fe3('0x8f')]);_0x8cddf4=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),'updatedAt','CompanyId','ListId']);if(_0x399100['body']['id']){delete _0x399100['body']['id'];}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0x97')])){throw _0x3857c6['status'](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x93')));}if(_[_0x3fe3('0x7a')](_0x399100['body'][_0x3fe3('0x61')])||_0x399100[_0x3fe3('0x61')][_0x3fe3('0x61')]===''){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94')));}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0xce')+_0x8cddf4));}if(!_[_0x3fe3('0xcf')](_0x8cddf4,_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0xd0')+_0x8cddf4));}_0x158444[_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')]]=_0x399100['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x399100[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3857c6,null))['then'](function(_0x1b4f47){if(_0x1b4f47&&_0x1b4f47[_0x3fe3('0x99')]){_0x2e075a=_0x1b4f47;var _0xe3f278=_['defaults'](_0x399100[_0x3fe3('0x61')],{'firstName':_0x399100[_0x3fe3('0x61')]['from'],'phone':_0x399100['body'][_0x3fe3('0x97')],'ListId':_0x1b4f47[_0x3fe3('0x91')]});_0xe3f278[_0x399100[_0x3fe3('0x61')]['mapKeyOffline']]=_0x399100['body'][_0x3fe3('0x97')];return db[_0x3fe3('0x8b')]['findOrCreate']({'where':_0x158444,'defaults':_0xe3f278});}})[_0x3fe3('0xb8')](function(_0x363519){if(_0x363519){_0x2d3a89=_0x363519;var _0x5a1d14=fs[_0x3fe3('0xd1')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0xd2')),_0x3fe3('0xd3'));var _0x304d96=ejs['render'](_0x5a1d14,{'body':_[_0x3fe3('0xd4')](_0x399100['body']['body']),'bodyTitle':_0x2e075a['offlineMessageBody']});return db[_0x3fe3('0xd5')]['create']({'body':_0x304d96,'ContactId':_0x363519['id'],'ChatWebsiteId':_0x2e075a['id']});}})[_0x3fe3('0x1c')](function(_0x46ba1f){_0x501707=_0x46ba1f;if(_0x2bd590['length']){var _0x1de25f=_0x2bd590[_0x3fe3('0x42')](function(_0x2e89b1){return{'name':_0x2e89b1[_0x3fe3('0xd6')],'basename':_0x2e89b1['filename'],'type':_0x2e89b1[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x46ba1f['id']};});_0x314763=_0x1de25f[_0x3fe3('0x42')](_0x1a1e31=>{var _0x2e93e3={'filename':_0x1a1e31[_0x3fe3('0x37')],'path':path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0xd8'),'files',_0x3fe3('0xd9'),_0x3fe3('0xda'),_0x1a1e31[_0x3fe3('0xdb')])};return _0x2e93e3;});if(!_0x2e075a['openNewInteraction']){return db['sequelize'][_0x3fe3('0xdc')](function(_0x1a9e1a){return db[_0x3fe3('0xdd')]['bulkCreate'](_0x1de25f,{'transaction':_0x1a9e1a});});}}})[_0x3fe3('0x1c')](function(){if(_0x501707){_0x2215e2=_0x501707;return db[_0x3fe3('0xde')][_0x3fe3('0x66')]({'where':{'active':!![]},'include':[{'model':db[_0x3fe3('0xdf')],'as':_0x3fe3('0xe0'),'raw':!![]}]});}})[_0x3fe3('0x1c')](function(_0x119488){if(_0x119488&&_0x119488[_0x3fe3('0xe0')]&&_0x2e075a[_0x3fe3('0xe1')]&&_0x2e075a[_0x3fe3('0xe2')]){var _0x19abf5={'tls':{'rejectUnauthorized':![]}};if(_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')]){_0x19abf5[_0x3fe3('0xe3')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')];}else{_0x19abf5[_0x3fe3('0xe4')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe4')];_0x19abf5['port']=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe5')];_0x19abf5[_0x3fe3('0xe6')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe6')];}if(_0x119488[_0x3fe3('0xe0')]['authentication']){_0x19abf5[_0x3fe3('0xe7')]={'user':_0x119488['Smtp'][_0x3fe3('0x5b')],'pass':_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe8')]};}return respondWithRpcPromise(_0x3fe3('0xe9'),_0x3fe3('0xea'),{'account':_0x19abf5,'message':{'from':util['format'](_0x3fe3('0xeb'),_0x119488[_0x3fe3('0x37')],_0x119488[_0x3fe3('0xec')]||_0x119488[_0x3fe3('0xe0')][_0x3fe3('0x5b')]),'to':_0x2e075a[_0x3fe3('0xe2')],'subject':_0x2e075a[_0x3fe3('0xed')],'html':_0x2215e2[_0x3fe3('0x61')],'attachments':_0x314763}},client9003)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x508de8){console['error'](_0x508de8);});}})['then'](function(){if(_0x2e075a&&_0x2e075a[_0x3fe3('0xee')]&&_0x2e075a[_0x3fe3('0xef')]){var _0x54c642=[];if(_0x2bd590[_0x3fe3('0x48')]){_0x54c642=_0x2bd590[_0x3fe3('0x42')](function(_0x47b509){return{'name':_0x47b509[_0x3fe3('0xd6')],'basename':_0x47b509['filename'],'type':_0x47b509[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x501707['id']};});}var _0x90f0ad;if(!_[_0x3fe3('0x7a')](_0x2e075a['subjectOffline'])){var _0x397af7=_[_0x3fe3('0x42')](_0x399100[_0x3fe3('0x61')],function(_0x2de4fa){return _0x2de4fa;});var _0x3cb069=_[_0x3fe3('0xf0')](_0x397af7)[0x0];var _0x73c122=_[_0x3fe3('0xf1')](_0x3cb069,function(_0x70272){return _0x70272;});_0x90f0ad=_0x73c122[0x1][_0x2e075a[_0x3fe3('0xf2')]];}var _0x52d2b4={'from':_0x2d3a89['email'],'firstName':_0x2d3a89[_0x3fe3('0xa9')],'lastName':_0x2d3a89[_0x3fe3('0xb9')],'mapKey':'email','message':{'from':_0x2d3a89[_0x3fe3('0xec')],'to':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')],'cc':'','subject':_['isNil'](_0x90f0ad)?_0x2e075a[_0x3fe3('0xed')]:_0x90f0ad,'messageId':'','sentAt':new Date(),'attach':_0x54c642[_0x3fe3('0x48')],'attachments':_0x54c642,'originChannel':_0x3fe3('0xf3'),'ChatWebsiteId':_0x2e075a['id'],'ChatOfflineMessageId':_0x2215e2['id'],'originTo':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')]},'body':_0x2215e2[_0x3fe3('0x61')]};var _0x424ca3={'account':{'id':_0x2e075a[_0x3fe3('0xef')]},'body':_0x52d2b4,'log':_0x3fe3('0xf4')};return respondWithRpcPromise(_0x3fe3('0xf4'),_0x3fe3('0xf5'),_0x424ca3,client9001)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x15e907){console[_0x3fe3('0x21')](_0x15e907);});}return;})[_0x3fe3('0x1c')](function(){if(_0x2215e2){return _0x2215e2;}})[_0x3fe3('0x1c')](respondWithResult(_0x3857c6,null))['catch'](function(_0x135ef3){console['error'](_0x3fe3('0x25'),_0x135ef3);for(var _0x37f2ce of _0x2bd590){var _0x5acbb7=path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0xd8'),_0x3fe3('0xcb'),'attachments',_0x3fe3('0xda'),_0x37f2ce[_0x3fe3('0x74')]);fs_extra[_0x3fe3('0xf6')](_0x5acbb7)[_0x3fe3('0x25')](function(_0x36e0f8){console[_0x3fe3('0x21')](_0x3fe3('0xf7'),_0x5acbb7,_0x36e0f8);});}});};exports[_0x3fe3('0xf8')]=function(_0x24c859,_0x2e74cf,_0x406d54){return db['ChatInteraction'][_0x3fe3('0x59')]({'where':{'id':_0x24c859[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2e74cf,null))[_0x3fe3('0x1c')](function(_0x851102){if(_0x851102){return _0x851102[_0x3fe3('0xf8')](_0x24c859[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x24c859[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})[_0x3fe3('0x1c')](respondWithResult(_0x2e74cf,null))[_0x3fe3('0x25')](handleError(_0x2e74cf,null));};exports[_0x3fe3('0xf9')]=function(_0x68e6e5,_0x45c71e,_0x2b6aa9){var _0xab4aac={'raw':![],'where':{}};var _0x511bcf={};var _0x1bc35e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x68e6e5[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x45c71e,null))[_0x3fe3('0x1c')](function(_0x4700d2){if(_0x4700d2){_0x511bcf[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db['ChatInteraction'][_0x3fe3('0x3d')]);_0x511bcf[_0x3fe3('0x43')]=_['keys'](_0x68e6e5[_0x3fe3('0x43')]);_0x511bcf[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],_0x511bcf[_0x3fe3('0x43')]);_0xab4aac[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],qs['fields'](_0x68e6e5['query'][_0x3fe3('0x46')]));_0xab4aac[_0x3fe3('0x47')]=_0xab4aac[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0xab4aac['attributes']:_0x511bcf[_0x3fe3('0x41')];if(!_0x68e6e5['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0xab4aac[_0x3fe3('0x2c')]=qs['limit'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0xab4aac[_0x3fe3('0x2a')]=qs['offset'](_0x68e6e5['query'][_0x3fe3('0x2a')]);}_0xab4aac[_0x3fe3('0x4b')]=qs['sort'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0xab4aac[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x68e6e5[_0x3fe3('0x43')],_0x511bcf['filters']));_0xab4aac[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x4700d2['id'];if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0xab4aac['where']=_[_0x3fe3('0x58')](_0xab4aac[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0xab4aac['attributes'],function(_0x48377b){var _0x128ebd={};_0x128ebd[_0x48377b]={'$like':'%'+_0x68e6e5['query'][_0x3fe3('0x4f')]+'%'};return _0x128ebd;})});}_0xab4aac=_[_0x3fe3('0x58')]({},_0xab4aac,_0x68e6e5['options']);return db[_0x3fe3('0xb5')][_0x3fe3('0x2d')]({'where':_0xab4aac[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4f9c27){_0x1bc35e[_0x3fe3('0x2d')]=_0x4f9c27;if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0xab4aac[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':_0x3fe3('0xfa'),'required':![]},{'model':db[_0x3fe3('0xc2')],'as':_0x3fe3('0xfb'),'attributes':[_0x3fe3('0x37'),_0x3fe3('0xfc'),_0x3fe3('0xfd')],'required':![]},{'model':db['Tag'],'as':_0x3fe3('0xfe'),'attributes':['id','name',_0x3fe3('0xff')],'where':_0x68e6e5[_0x3fe3('0x43')]['tag']?{'id':_0x68e6e5[_0x3fe3('0x43')]['tag']}:undefined,'required':_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x100')]?!![]:![]}];}return db['ChatInteraction'][_0x3fe3('0x101')](_0xab4aac);})[_0x3fe3('0x1c')](function(_0x576d9e){_0x1bc35e[_0x3fe3('0x54')]=_0x576d9e;return _0x1bc35e;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x45c71e,_0xab4aac))[_0x3fe3('0x25')](handleError(_0x45c71e,null));};function iftimePromise(_0x42f9ae,_0x1f5dd1){return respondWithRpcPromise('Command',_0x3fe3('0x102'),{'command':_0x1f5dd1[_0x3fe3('0x103')]?util[_0x3fe3('0xad')](_0x3fe3('0x104'),_0x42f9ae[_0x3fe3('0x105')],_0x1f5dd1[_0x3fe3('0x103')]):util[_0x3fe3('0xad')](_0x3fe3('0x106'),_0x42f9ae[_0x3fe3('0x105')])},client9002)[_0x3fe3('0x1c')](function(_0x2b6d88){var _0x4028dc=_0x2b6d88&&_0x2b6d88['indexOf']('true')>=0x0?!![]:![];logger[_0x3fe3('0x1d')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],_0x4028dc?_0x3fe3('0x108'):_0x3fe3('0x109'),_0x1f5dd1[_0x3fe3('0x103')]?_0x1f5dd1[_0x3fe3('0x103')]:'No\x20timezone');return _0x4028dc;})[_0x3fe3('0x25')](function(_0xa5746c){logger[_0x3fe3('0x21')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],util[_0x3fe3('0x10a')](_0xa5746c,{'showHidden':![],'depth':null}),_0x1f5dd1['timezone']?_0x1f5dd1['timezone']:'No\x20timezone');return![];});}exports[_0x3fe3('0x102')]=function(_0x3a28f8,_0xbc6d2a,_0x1e1622){var _0x34ba1a=0x0;var _0x31179d=0x0;var _0x2dc4e1=![];var _0x4325b2;var _0x4c2a77;return db['ChatWebsite']['find']({'where':{'id':_0x3a28f8[_0x3fe3('0x56')]['id']},'include':[{'model':db['Interval'],'as':_0x3fe3('0x10b'),'include':[{'model':db['Interval'],'as':_0x3fe3('0x10c'),'attributes':['id',_0x3fe3('0x105')],'raw':!![]}]}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0xbc6d2a,null))['then'](function(_0x383efd){if(_0x383efd){_0x4325b2=_0x383efd;return _0x383efd[_0x3fe3('0x10d')]({'raw':!![]});}})['then'](function(_0x360a3e){if(_0x4325b2){if(_0x360a3e){_0x4c2a77=_0x360a3e;}}return require(_0x3fe3('0x12'))[_0x3fe3('0x10e')]();})[_0x3fe3('0x1c')](function(_0x453891){if(_0x453891){_0x31179d=_0x453891['virtual'];_0x2dc4e1=_0x453891[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db['ChatInteraction'][_0x3fe3('0x2d')]({'where':{'closed':![]}});})[_0x3fe3('0x1c')](function(_0x5f5de4){_0x34ba1a=_0x5f5de4;if(_0x31179d&&_0x5f5de4>_0x31179d){return db[_0x3fe3('0x10f')][_0x3fe3('0x66')]({'where':{'id':0x1}})['then'](function(_0x18ceef){if(_0x18ceef){_0x18ceef['increment'](_0x3fe3('0x110'));}});}})['then'](function(){if(_0x4325b2['Interval']&&_0x4325b2[_0x3fe3('0x10b')]['Intervals']){var _0x43fe11=[];for(var _0x4744db=0x0;_0x4744db<_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x3fe3('0x48')];_0x4744db++){var _0x2cccb6=_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x4744db][_0x3fe3('0x33')]({'plain':!![]});_0x43fe11[_0x3fe3('0x111')](iftimePromise(_0x2cccb6,_0x4325b2));}return BPromise[_0x3fe3('0x112')](_0x43fe11)[_0x3fe3('0x1c')](function(_0x4af8a2){return _[_0x3fe3('0x113')](_0x4af8a2);});}else{return!![];}})['then'](function(_0x411e42){var _0x4e7aad=fs[_0x3fe3('0xd1')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x114')),'utf8');var _0xfbbab8={'remote':_0x4325b2[_0x3fe3('0x115')],'query':querystring['stringify'](_['merge'](_0x4325b2[_0x3fe3('0x33')]({'plain':!![]}),{'customerIp':_0x3a28f8[_0x3fe3('0x88')]['x-forwarded-for']||_0x3a28f8[_0x3fe3('0x88')]['x-real-ip']||_0x3a28f8[_0x3fe3('0x116')][_0x3fe3('0x117')]||_0x3a28f8['ip'],'referer':_0x3a28f8['headers'][_0x3fe3('0xaa')],'openedInteractions':_0x34ba1a,'maxInteractions':_0x31179d,'virtual':_0x2dc4e1[_0x3fe3('0x118')],'online':_0x411e42,'custom':_0x2dc4e1}))['replace'](/'/g,'\x5c\x27')};_0xbc6d2a['send'](ejs[_0x3fe3('0x119')](Mustache[_0x3fe3('0x119')](_0x4e7aad,_0xfbbab8),{'proactiveActions':_0x4c2a77,'alignment':_0x4325b2['alignment'],'verticalAlignment':_0x4325b2[_0x3fe3('0x11a')],'div_color':_0x4325b2[_0x3fe3('0xff')],'text_color':_0x4325b2[_0x3fe3('0x11b')],'button_color':_0x4325b2[_0x3fe3('0x11c')],'background_color':_0x4325b2[_0x3fe3('0x11d')]}));})[_0x3fe3('0x25')](handleError(_0xbc6d2a,null));};exports['addApplications']=function(_0x5237c0,_0x1dd617,_0x327a1d){return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5237c0[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1dd617,null))[_0x3fe3('0x1c')](function(_0x4f7b09){if(_0x4f7b09){return db[_0x3fe3('0x11e')][_0x3fe3('0xdc')](function(_0x1a903a){return db['ChatApplication'][_0x3fe3('0x32')]({'where':{'ChatWebsiteId':_0x5237c0[_0x3fe3('0x56')]['id']},'transaction':_0x1a903a})[_0x3fe3('0x1c')](function(_0x1dfe0a){var _0x32957c=_['map'](_0x5237c0[_0x3fe3('0x61')],function(_0x4be523){_0x4be523[_0x3fe3('0x67')]=_0x5237c0[_0x3fe3('0x56')]['id'];return _0x4be523;});return db[_0x3fe3('0x11f')][_0x3fe3('0x120')](_0x32957c,{'transaction':_0x1a903a});});})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x11f')][_0x3fe3('0x121')]({'where':{'ChatWebsiteId':_0x5237c0['params']['id']},'order':_0x3fe3('0xa1')});});}})[_0x3fe3('0x1c')](respondWithResult(_0x1dd617,null))[_0x3fe3('0x25')](handleError(_0x1dd617,null));};exports['getApplications']=function(_0x51ef55,_0x4dde8b,_0x232f07){var _0x1ecd85={};var _0x204396={};var _0x3e7f07;var _0x25349;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x51ef55[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4dde8b,null))[_0x3fe3('0x1c')](function(_0x4dcbda){if(_0x4dcbda){_0x3e7f07=_0x4dcbda;_0x204396[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x11f')][_0x3fe3('0x3d')]);_0x204396[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x51ef55[_0x3fe3('0x43')]);_0x204396[_0x3fe3('0x44')]=_['intersection'](_0x204396[_0x3fe3('0x41')],_0x204396[_0x3fe3('0x43')]);_0x1ecd85[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x204396[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x51ef55['query'][_0x3fe3('0x46')]));_0x1ecd85[_0x3fe3('0x47')]=_0x1ecd85['attributes'][_0x3fe3('0x48')]?_0x1ecd85[_0x3fe3('0x47')]:_0x204396[_0x3fe3('0x41')];_0x1ecd85[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x1ecd85[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x51ef55[_0x3fe3('0x43')],_0x204396[_0x3fe3('0x44')]));if(_0x51ef55[_0x3fe3('0x43')]['filter']){_0x1ecd85[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x1ecd85[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x1ecd85[_0x3fe3('0x47')],function(_0x5bf79f){var _0x1976ba={};_0x1976ba[_0x5bf79f]={'$like':'%'+_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x1976ba;})});}_0x1ecd85=_[_0x3fe3('0x58')]({},_0x1ecd85,_0x51ef55['options']);return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x4ff7d3){if(_0x4ff7d3){_0x25349=_0x4ff7d3['length'];if(!_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x49')]('nolimit')){_0x1ecd85[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x1ecd85[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x51ef55['query']['offset']);}return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x189e49){if(_0x189e49){return _0x189e49?{'count':_0x25349,'rows':_0x189e49}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x4dde8b,null))['catch'](handleError(_0x4dde8b,null));};exports['addProactiveActions']=function(_0x459192,_0x3789a2,_0x3c1083){return db[_0x3fe3('0x123')]['find']({'where':{'id':_0x459192[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3789a2,null))[_0x3fe3('0x1c')](function(_0x1a15e9){if(_0x1a15e9){return _0x1a15e9[_0x3fe3('0x124')](_0x459192[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x459192[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})['then'](respondWithResult(_0x3789a2,null))['catch'](handleError(_0x3789a2,null));};exports[_0x3fe3('0x10d')]=function(_0x5d29e3,_0x2240d9,_0x286186){var _0x24182d={};var _0x4e1422={};var _0x3ba0b1;var _0x3c7898;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5d29e3[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2240d9,null))[_0x3fe3('0x1c')](function(_0x2eec8a){if(_0x2eec8a){_0x3ba0b1=_0x2eec8a;_0x4e1422[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x125')][_0x3fe3('0x3d')]);_0x4e1422[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x5d29e3['query']);_0x4e1422['filters']=_[_0x3fe3('0x45')](_0x4e1422[_0x3fe3('0x41')],_0x4e1422[_0x3fe3('0x43')]);_0x24182d[_0x3fe3('0x47')]=_['intersection'](_0x4e1422[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x24182d[_0x3fe3('0x47')]=_0x24182d[_0x3fe3('0x47')]['length']?_0x24182d[_0x3fe3('0x47')]:_0x4e1422['model'];_0x24182d['order']=qs['sort'](_0x5d29e3['query'][_0x3fe3('0x4c')]);_0x24182d[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x5d29e3[_0x3fe3('0x43')],_0x4e1422[_0x3fe3('0x44')]));if(_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x24182d[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x24182d[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x24182d[_0x3fe3('0x47')],function(_0x472bd9){var _0x1340f4={};_0x1340f4[_0x472bd9]={'$like':'%'+_0x5d29e3[_0x3fe3('0x43')]['filter']+'%'};return _0x1340f4;})});}_0x24182d=_[_0x3fe3('0x58')]({},_0x24182d,_0x5d29e3[_0x3fe3('0x51')]);return _0x3ba0b1['getProactiveActions'](_0x24182d);}})[_0x3fe3('0x1c')](function(_0x556f86){if(_0x556f86){_0x3c7898=_0x556f86[_0x3fe3('0x48')];if(!_0x5d29e3['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x24182d[_0x3fe3('0x2c')]=qs['limit'](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x24182d['offset']=qs[_0x3fe3('0x2a')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x3ba0b1[_0x3fe3('0x10d')](_0x24182d);}})['then'](function(_0x514d53){if(_0x514d53){return _0x514d53?{'count':_0x3c7898,'rows':_0x514d53}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x2240d9,null))['catch'](handleError(_0x2240d9,null));};exports[_0x3fe3('0x126')]=function(_0x513053,_0x258fc9,_0x1a0d4e){var _0xdfd02b=_0x513053[_0x3fe3('0x43')][_0x3fe3('0x127')]===_0x3fe3('0x128')?'offlineForm':_0x3fe3('0x129');return db['ChatWebsite']['find']({'attributes':['id',_0xdfd02b],'where':{'id':_0x513053['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x258fc9,null))[_0x3fe3('0x1c')](function(_0x575e34){if(_0x575e34){var _0x2d7c82=_0x575e34[_0xdfd02b];var _0x205777=_0x2d7c82&&_0x2d7c82[_0x3fe3('0x12a')]?_0x2d7c82['items']:[];_0x258fc9[_0x3fe3('0x38')]({'fromKey':_['isNil'](_0x2d7c82[_0x3fe3('0x12b')])?undefined:_0x2d7c82[_0x3fe3('0x12b')],'count':_0x205777[_0x3fe3('0x48')],'rows':_0x205777});}})['catch'](handleError(_0x258fc9,null));};exports['getOfflineMessages']=function(_0x4a4992,_0xbafff3,_0x171396){var _0x130569={'raw':![],'where':{}};var _0x7c1b4b={};var _0x2e0754={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x4a4992[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0xbafff3,null))[_0x3fe3('0x1c')](function(_0x33af9d){if(_0x33af9d){_0x7c1b4b[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xd5')]['rawAttributes']);_0x7c1b4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x4a4992[_0x3fe3('0x43')]);_0x7c1b4b['filters']=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],_0x7c1b4b[_0x3fe3('0x43')]);_0x130569[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x130569[_0x3fe3('0x47')]=_0x130569['attributes'][_0x3fe3('0x48')]?_0x130569[_0x3fe3('0x47')]:_0x7c1b4b[_0x3fe3('0x41')];if(!_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x130569[_0x3fe3('0x2c')]=qs['limit'](_0x4a4992[_0x3fe3('0x43')]['limit']);_0x130569[_0x3fe3('0x2a')]=qs['offset'](_0x4a4992['query'][_0x3fe3('0x2a')]);}_0x130569[_0x3fe3('0x4b')]=qs['sort'](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x130569['where']=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x4a4992[_0x3fe3('0x43')],_0x7c1b4b[_0x3fe3('0x44')]));_0x130569[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x33af9d['id'];if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x130569['where']=_[_0x3fe3('0x58')](_0x130569[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x130569[_0x3fe3('0x47')],function(_0xfbcf0f){var _0x4eb31c={};_0x4eb31c[_0xfbcf0f]={'$like':'%'+_0x4a4992['query'][_0x3fe3('0x4f')]+'%'};return _0x4eb31c;})});}_0x130569=_['merge']({},_0x130569,_0x4a4992[_0x3fe3('0x51')]);return db['ChatOfflineMessage']['count']({'where':_0x130569['where']})['then'](function(_0x2a0886){_0x2e0754[_0x3fe3('0x2d')]=_0x2a0886;if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x130569[_0x3fe3('0x53')]=[{'all':!![]}];}else{_0x130569[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3fe3('0xdd')],'as':_0x3fe3('0x12c'),'required':![]}];}return db[_0x3fe3('0xd5')][_0x3fe3('0x101')](_0x130569);})[_0x3fe3('0x1c')](function(_0x3f7516){_0x2e0754[_0x3fe3('0x54')]=_0x3f7516;return _0x2e0754;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0xbafff3,_0x130569))['catch'](handleError(_0xbafff3,null));};exports[_0x3fe3('0x12d')]=function(_0x55aa16,_0x118c4a,_0x365910){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x55aa16[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x118c4a,null))['then'](function(_0x19db34){if(_0x19db34){return _0x19db34[_0x3fe3('0x12d')](_0x55aa16['body'][_0x3fe3('0x69')],_[_0x3fe3('0x12e')](_0x55aa16['body'],[_0x3fe3('0x69'),'id'])||{})[_0x3fe3('0xb8')](function(_0x817a2){for(var _0x316431=0x0;_0x316431<_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x316431+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:save',{'UserId':Number(_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x316431]),'ChatWebsiteId':Number(_0x55aa16[_0x3fe3('0x56')]['id'])});}return _0x817a2;});}})[_0x3fe3('0x1c')](respondWithResult(_0x118c4a,null))[_0x3fe3('0x25')](handleError(_0x118c4a,null));};exports[_0x3fe3('0x130')]=function(_0x2417ee,_0x5902ec,_0x51c2c6){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x2417ee[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x5902ec,null))['then'](function(_0x55dbb7){if(_0x55dbb7){return _0x55dbb7['removeAgents'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])[_0x3fe3('0x1c')](function(){if(_['isArray'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])){for(var _0x46801b=0x0;_0x46801b<_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x46801b+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x46801b]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}}else{socket[_0x3fe3('0x12f')](_0x3fe3('0x131'),{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}});}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x5902ec,null))[_0x3fe3('0x25')](handleError(_0x5902ec,null));};exports[_0x3fe3('0x132')]=function(_0x44ffae,_0x1715bb,_0x2a9f08){var _0x210c63={};var _0x43740a={};var _0x287142;var _0x3275b2;return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x44ffae[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1715bb,null))['then'](function(_0x968c98){if(_0x968c98){_0x287142=_0x968c98;_0x43740a[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xc2')]['rawAttributes']);_0x43740a['query']=_['keys'](_0x44ffae[_0x3fe3('0x43')]);_0x43740a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x43740a['model'],_0x43740a[_0x3fe3('0x43')]);_0x210c63[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x43740a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x210c63[_0x3fe3('0x47')]=_0x210c63[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x210c63[_0x3fe3('0x47')]:_0x43740a[_0x3fe3('0x41')];_0x210c63[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x44ffae[_0x3fe3('0x43')]['sort']);_0x210c63[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x44ffae[_0x3fe3('0x43')],_0x43740a['filters']));if(_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x210c63[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x210c63[_0x3fe3('0x4d')],{'$or':_['map'](_0x210c63['attributes'],function(_0x1ef9c5){var _0x3255db={};_0x3255db[_0x1ef9c5]={'$like':'%'+_0x44ffae['query'][_0x3fe3('0x4f')]+'%'};return _0x3255db;})});}_0x210c63=_[_0x3fe3('0x58')]({},_0x210c63,_0x44ffae[_0x3fe3('0x51')]);return _0x287142['getAgents'](_0x210c63);}})[_0x3fe3('0x1c')](function(_0x327e06){if(_0x327e06){_0x3275b2=_0x327e06['length'];if(!_0x44ffae[_0x3fe3('0x43')]['hasOwnProperty'](_0x3fe3('0x4a'))){_0x210c63[_0x3fe3('0x2c')]=qs['limit'](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x210c63['offset']=qs[_0x3fe3('0x2a')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x287142[_0x3fe3('0x132')](_0x210c63);}})['then'](function(_0x14c517){if(_0x14c517){return _0x14c517?{'count':_0x3275b2,'rows':_0x14c517}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x1715bb,null))[_0x3fe3('0x25')](handleError(_0x1715bb,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e9eb1d5..16940c4 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 _0x3663=['../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','hook','events'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0x3663,0x1cf));var _0x3366=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0x3663[_0x3de4f8];return _0x3d81fc;};'use strict';var EventEmitter=require(_0x3366('0x0'));var ChatWebsite=require(_0x3366('0x1'))['db'][_0x3366('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3366('0x3'),'afterUpdate':_0x3366('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2daeb7){return function(_0x206d65,_0x2c87e1,_0x16593e){ChatWebsiteEvents[_0x3366('0x5')](_0x2daeb7+':'+_0x206d65['id'],_0x206d65);ChatWebsiteEvents['emit'](_0x2daeb7,_0x206d65);_0x16593e(null);};}for(var e in events){if(events[_0x3366('0x6')](e)){var event=events[e];ChatWebsite[_0x3366('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x757f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0x7ddf5a,_0x3e0253){var _0x2c8abd=function(_0x15cc34){while(--_0x15cc34){_0x7ddf5a['push'](_0x7ddf5a['shift']());}};_0x2c8abd(++_0x3e0253);}(_0x757f,0xee));var _0xf757=function(_0x2fbb8c,_0x15bc93){_0x2fbb8c=_0x2fbb8c-0x0;var _0x1005b4=_0x757f[_0x2fbb8c];return _0x1005b4;};'use strict';var EventEmitter=require(_0xf757('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xf757('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf757('0x2')](0x0);var events={'afterCreate':_0xf757('0x3'),'afterUpdate':_0xf757('0x4'),'afterDestroy':_0xf757('0x5')};function emitEvent(_0x44ebcf){return function(_0x26a38a,_0x302fba,_0x958ba7){ChatWebsiteEvents['emit'](_0x44ebcf+':'+_0x26a38a['id'],_0x26a38a);ChatWebsiteEvents[_0xf757('0x6')](_0x44ebcf,_0x26a38a);_0x958ba7(null);};}for(var e in events){if(events[_0xf757('0x7')](e)){var event=events[e];ChatWebsite[_0xf757('0x8')](e,emitEvent(event));}}module[_0xf757('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 846c287..ab4102a 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 _0x676e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x1aa2a2,_0x570bb3){var _0x596b90=function(_0x3c6c5e){while(--_0x3c6c5e){_0x1aa2a2['push'](_0x1aa2a2['shift']());}};_0x596b90(++_0x570bb3);}(_0x676e,0x1c7));var _0xe676=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x676e[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));var logger=require(_0xe676('0x2'))(_0xe676('0x3'));var moment=require(_0xe676('0x4'));var BPromise=require(_0xe676('0x5'));var rp=require(_0xe676('0x6'));var fs=require('fs');var path=require(_0xe676('0x7'));var rimraf=require(_0xe676('0x8'));var config=require(_0xe676('0x9'));var attributes=require(_0xe676('0xa'));module['exports']=function(_0x1318b7,_0x300a78){return _0x1318b7[_0xe676('0xb')](_0xe676('0xc'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x424f=['chat_websites','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','ChatWebsite'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0x424f,0x76));var _0xf424=function(_0x4fce1e,_0x5e9dfe){_0x4fce1e=_0x4fce1e-0x0;var _0x27ea1c=_0x424f[_0x4fce1e];return _0x27ea1c;};'use strict';var _=require(_0xf424('0x0'));var util=require('util');var logger=require(_0xf424('0x1'))(_0xf424('0x2'));var moment=require(_0xf424('0x3'));var BPromise=require(_0xf424('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf424('0x5'));var config=require(_0xf424('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x1ef4d0,_0x11250c){return _0x1ef4d0['define'](_0xf424('0x7'),attributes,{'tableName':_0xf424('0x8'),'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 a2d712f..5ac06ce 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 _0x97fe=['defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97fe,0x1ac));var _0xe97f=function(_0x1bc084,_0x204724){_0x1bc084=_0x1bc084-0x0;var _0x50e8a0=_0x97fe[_0x1bc084];return _0x50e8a0;};'use strict';var _=require(_0xe97f('0x0'));var util=require(_0xe97f('0x1'));var moment=require(_0xe97f('0x2'));var BPromise=require(_0xe97f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97f('0x4'));var db=require(_0xe97f('0x5'))['db'];var utils=require(_0xe97f('0x6'));var logger=require(_0xe97f('0x7'))(_0xe97f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe97f('0x9')](config[_0xe97f('0xa')],{'host':_0xe97f('0xb'),'port':0x18eb});var socket=require(_0xe97f('0xc'))(new Redis(config[_0xe97f('0xa')]));require(_0xe97f('0xd'))['register'](socket);function respondWithRpcPromise(_0x9abcf2,_0x10a08a,_0x5302fc){return new BPromise(function(_0x51bb90,_0x431749){return client[_0xe97f('0xe')](_0x9abcf2,_0x5302fc)[_0xe97f('0xf')](function(_0x201b00){logger[_0xe97f('0x10')](_0xe97f('0x11'),_0x10a08a,_0xe97f('0x12'));logger[_0xe97f('0x13')](_0xe97f('0x14'),_0x10a08a,_0xe97f('0x12'),JSON['stringify'](_0x201b00));if(_0x201b00[_0xe97f('0x15')]){if(_0x201b00[_0xe97f('0x15')]['code']===0x1f4){logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x201b00[_0xe97f('0x15')]['message']);return _0x431749(_0x201b00[_0xe97f('0x15')][_0xe97f('0x16')]);}logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x201b00['error'][_0xe97f('0x16')]);return _0x51bb90(_0x201b00[_0xe97f('0x15')]['message']);}else{logger['info'](_0xe97f('0x11'),_0x10a08a,'request\x20sent');_0x51bb90(_0x201b00['result'][_0xe97f('0x16')]);}})['catch'](function(_0x467838){logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x467838);_0x431749(_0x467838);});});}
\ No newline at end of file
+var _0x0ba3=['redis','defaults','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x45b976,_0x3ac0e3){var _0x42c656=function(_0x8025da){while(--_0x8025da){_0x45b976['push'](_0x45b976['shift']());}};_0x42c656(++_0x3ac0e3);}(_0x0ba3,0x70));var _0x30ba=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0ba3[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x30ba('0x0'));var util=require(_0x30ba('0x1'));var moment=require(_0x30ba('0x2'));var BPromise=require(_0x30ba('0x3'));var rs=require(_0x30ba('0x4'));var fs=require('fs');var Redis=require(_0x30ba('0x5'));var db=require(_0x30ba('0x6'))['db'];var utils=require(_0x30ba('0x7'));var logger=require(_0x30ba('0x8'))(_0x30ba('0x9'));var config=require('../../config/environment');var jayson=require(_0x30ba('0xa'));var client=jayson[_0x30ba('0xb')][_0x30ba('0xc')]({'port':0x232a});config[_0x30ba('0xd')]=_[_0x30ba('0xe')](config[_0x30ba('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x30ba('0xf'))(new Redis(config['redis']));require(_0x30ba('0x10'))['register'](socket);function respondWithRpcPromise(_0x13359a,_0x11e2a2,_0xd77125){return new BPromise(function(_0x3b04f1,_0x166e04){return client['request'](_0x13359a,_0xd77125)['then'](function(_0x4a6634){logger[_0x30ba('0x11')](_0x30ba('0x12'),_0x11e2a2,_0x30ba('0x13'));logger[_0x30ba('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x11e2a2,_0x30ba('0x13'),JSON['stringify'](_0x4a6634));if(_0x4a6634[_0x30ba('0x15')]){if(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x16')]===0x1f4){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x166e04(_0x4a6634['error'][_0x30ba('0x17')]);}logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x3b04f1(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x17')]);}else{logger['info'](_0x30ba('0x12'),_0x11e2a2,'request\x20sent');_0x3b04f1(_0x4a6634[_0x30ba('0x18')][_0x30ba('0x17')]);}})['catch'](function(_0x1ae53d){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x1ae53d);_0x166e04(_0x1ae53d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3d27332..7022856 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 _0x6111=['./chatWebsite.events','save','update','emit','removeListener'];(function(_0x248ae0,_0x33ba9b){var _0xa8500d=function(_0x17de2e){while(--_0x17de2e){_0x248ae0['push'](_0x248ae0['shift']());}};_0xa8500d(++_0x33ba9b);}(_0x6111,0x64));var _0x1611=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6111[_0x502c7d];return _0x30b7ed;};'use strict';var ChatWebsiteEvents=require(_0x1611('0x0'));var events=[_0x1611('0x1'),'remove',_0x1611('0x2')];function createListener(_0x199fc0,_0x418f7b){return function(_0x522246){_0x418f7b[_0x1611('0x3')](_0x199fc0,_0x522246);};}function removeListener(_0x36745f,_0x43b078){return function(){ChatWebsiteEvents[_0x1611('0x4')](_0x36745f,_0x43b078);};}exports['register']=function(_0x591cb2){for(var _0xbbbf61=0x0,_0x148989=events['length'];_0xbbbf61<_0x148989;_0xbbbf61++){var _0x5b5960=events[_0xbbbf61];var _0x3b52a1=createListener('chatWebsite:'+_0x5b5960,_0x591cb2);ChatWebsiteEvents['on'](_0x5b5960,_0x3b52a1);}};
\ No newline at end of file
+var _0xf65a=['./chatWebsite.events','remove','update','emit','removeListener','register','chatWebsite:'];(function(_0x505dcb,_0x3d3646){var _0x3f1944=function(_0x22dfa1){while(--_0x22dfa1){_0x505dcb['push'](_0x505dcb['shift']());}};_0x3f1944(++_0x3d3646);}(_0xf65a,0x10a));var _0xaf65=function(_0x2b2641,_0x28312b){_0x2b2641=_0x2b2641-0x0;var _0x36d9f4=_0xf65a[_0x2b2641];return _0x36d9f4;};'use strict';var ChatWebsiteEvents=require(_0xaf65('0x0'));var events=['save',_0xaf65('0x1'),_0xaf65('0x2')];function createListener(_0x52f995,_0x3b40ec){return function(_0x1e017e){_0x3b40ec[_0xaf65('0x3')](_0x52f995,_0x1e017e);};}function removeListener(_0x30026c,_0x2de4ae){return function(){ChatWebsiteEvents[_0xaf65('0x4')](_0x30026c,_0x2de4ae);};}exports[_0xaf65('0x5')]=function(_0x1ba358){for(var _0x63857f=0x0,_0x284cfa=events['length'];_0x63857f<_0x284cfa;_0x63857f++){var _0x2c2a48=events[_0x63857f];var _0x37bf1f=createListener(_0xaf65('0x6')+_0x2c2a48,_0x1ba358);ChatWebsiteEvents['on'](_0x2c2a48,_0x37bf1f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2891eca..7ed7c47 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 _0x4531=['removeDispositions','removeAnswers','delete','removeAgents','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','server/files/images/avatars/','single','file','addAvatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','ensureDir','replace','any','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','destroy'];(function(_0x340a30,_0x23aa69){var _0x4a54ba=function(_0x4e4064){while(--_0x4e4064){_0x340a30['push'](_0x340a30['shift']());}};_0x4a54ba(++_0x23aa69);}(_0x4531,0x13f));var _0x1453=function(_0x4c8076,_0x332091){_0x4c8076=_0x4c8076-0x0;var _0x50ee21=_0x4531[_0x4c8076];return _0x50ee21;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1453('0x0'));var express=require('express');var router=express[_0x1453('0x1')]();var fs_extra=require(_0x1453('0x2'));var auth=require(_0x1453('0x3'));var interaction=require(_0x1453('0x4'));var config=require('../../config/environment');var controller=require(_0x1453('0x5'));router['get']('/',auth[_0x1453('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1453('0x7')]);router[_0x1453('0x8')]('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x9')]);router[_0x1453('0x8')](_0x1453('0xa'),auth[_0x1453('0x6')](),controller[_0x1453('0xb')]);router[_0x1453('0x8')](_0x1453('0xc'),auth['isAuthenticated'](),controller[_0x1453('0xd')]);router[_0x1453('0x8')](_0x1453('0xe'),controller[_0x1453('0xf')]);router[_0x1453('0x8')](_0x1453('0x10'),controller[_0x1453('0x11')]);router[_0x1453('0x8')](_0x1453('0x12'),controller[_0x1453('0x13')]);router[_0x1453('0x8')]('/:id/system_avatar',controller[_0x1453('0x14')]);router[_0x1453('0x8')](_0x1453('0x15'),auth[_0x1453('0x6')](),controller[_0x1453('0x16')]);router[_0x1453('0x8')]('/:id/snippet',controller[_0x1453('0x17')]);router['get']('/:id/applications',auth[_0x1453('0x6')](),controller['getApplications']);router['get'](_0x1453('0x18'),auth[_0x1453('0x6')](),controller[_0x1453('0x19')]);router[_0x1453('0x8')](_0x1453('0x1a'),controller[_0x1453('0x1b')]);router['get'](_0x1453('0x1c'),auth[_0x1453('0x6')](),controller[_0x1453('0x1d')]);router[_0x1453('0x8')](_0x1453('0x1e'),auth[_0x1453('0x6')](),controller[_0x1453('0x1f')]);router[_0x1453('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1453('0x20')](_0x1453('0xa'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x1453('0xc'),auth[_0x1453('0x6')](),controller[_0x1453('0x21')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x4e2b18,_0x4020d3,_0x133482){_0x133482(null,path[_0x1453('0x23')](config[_0x1453('0x24')],'server/files/images/logos/'));},'filename':function(_0x13c1ef,_0x292144,_0x189249){_0x189249(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x292144[_0x1453('0x28')]));}})});router[_0x1453('0x20')]('/:id/logo',upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x5d89d3,_0x3965c1,_0x204c99){_0x204c99(null,path[_0x1453('0x23')](config['root'],_0x1453('0x29')));},'filename':function(_0x598811,_0x53c77d,_0x2e9eaf){_0x2e9eaf(null,util[_0x1453('0x25')]('%s-%s',Date['now'](),_0x53c77d[_0x1453('0x28')]));}})});router['post'](_0x1453('0x10'),upload[_0x1453('0x2a')](_0x1453('0x2b')),controller[_0x1453('0x2c')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x4d2faf,_0x3ad949,_0x456270){_0x456270(null,path[_0x1453('0x23')](config['root'],_0x1453('0x29')));},'filename':function(_0x5ee0b6,_0x144e1e,_0x130b29){_0x130b29(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x144e1e[_0x1453('0x28')]));}})});router[_0x1453('0x20')](_0x1453('0x12'),upload[_0x1453('0x2a')](_0x1453('0x2b')),controller[_0x1453('0x2d')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x3ea81a,_0x276190,_0x3ce4ce){_0x3ce4ce(null,path[_0x1453('0x23')](config[_0x1453('0x24')],_0x1453('0x29')));},'filename':function(_0x73a10a,_0x140eaa,_0x4784fb){_0x4784fb(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x140eaa[_0x1453('0x28')]));}})});router[_0x1453('0x20')]('/:id/system_avatar',upload['single'](_0x1453('0x2b')),controller[_0x1453('0x2e')]);router[_0x1453('0x20')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x21e15c,_0x5942a7,_0x3b8559){const _0x7af293=path[_0x1453('0x23')](config[_0x1453('0x24')],_0x1453('0x2f'),_0x1453('0x30'),'offline-chat');fs_extra[_0x1453('0x31')](_0x7af293,function(){_0x3b8559(null,_0x7af293);});},'filename':function(_0x9c5f,_0x30667b,_0x55223c){const _0x33f876=_0x30667b[_0x1453('0x28')][_0x1453('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e08ad=path['extname'](_0x33f876);const _0x34647c=Date[_0x1453('0x27')]()+'-'+_0x33f876[_0x1453('0x32')](_0x1e08ad,'')+_0x1e08ad;_0x55223c(null,_0x34647c);}})});router[_0x1453('0x20')]('/:id/offline',offlineUploadMulter[_0x1453('0x33')](),controller['offline']);router['post'](_0x1453('0x15'),auth['isAuthenticated'](),controller[_0x1453('0x34')]);router[_0x1453('0x20')](_0x1453('0x35'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x1453('0x18'),auth[_0x1453('0x6')](),controller[_0x1453('0x36')]);router[_0x1453('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x1453('0x37')]);router[_0x1453('0x38')]('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x39')]);router['delete']('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x3a')]);router['delete'](_0x1453('0xa'),auth['isAuthenticated'](),controller[_0x1453('0x3b')]);router['delete'](_0x1453('0xc'),auth[_0x1453('0x6')](),controller[_0x1453('0x3c')]);router[_0x1453('0x3d')]('/:id/users',auth['isAuthenticated'](),controller[_0x1453('0x3e')]);module['exports']=router;
\ No newline at end of file
+var _0xcc60=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','single','addLogo','join','server/files/images/avatars/','originalname','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','extname','/:id/offline','any','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x2e2c52,_0x7e90fb){var _0x5918c5=function(_0x3f99a7){while(--_0x3f99a7){_0x2e2c52['push'](_0x2e2c52['shift']());}};_0x5918c5(++_0x7e90fb);}(_0xcc60,0x94));var _0x0cc6=function(_0xb38540,_0x1fc920){_0xb38540=_0xb38540-0x0;var _0x27fa72=_0xcc60[_0xb38540];return _0x27fa72;};'use strict';var multer=require(_0x0cc6('0x0'));var util=require(_0x0cc6('0x1'));var path=require(_0x0cc6('0x2'));var timeout=require(_0x0cc6('0x3'));var express=require(_0x0cc6('0x4'));var router=express[_0x0cc6('0x5')]();var fs_extra=require(_0x0cc6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cc6('0x7'));var controller=require(_0x0cc6('0x8'));router['get']('/',auth[_0x0cc6('0x9')](),controller['index']);router['get'](_0x0cc6('0xa'),auth[_0x0cc6('0x9')](),controller['describe']);router[_0x0cc6('0xb')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xc')]);router[_0x0cc6('0xb')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xe')]);router['get'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x10')]);router[_0x0cc6('0xb')](_0x0cc6('0x11'),controller[_0x0cc6('0x12')]);router[_0x0cc6('0xb')](_0x0cc6('0x13'),controller[_0x0cc6('0x14')]);router['get']('/:id/customer_avatar',controller[_0x0cc6('0x15')]);router[_0x0cc6('0xb')](_0x0cc6('0x16'),controller['getSystemAvatar']);router[_0x0cc6('0xb')](_0x0cc6('0x17'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x18')]);router[_0x0cc6('0xb')]('/:id/snippet',controller[_0x0cc6('0x19')]);router[_0x0cc6('0xb')](_0x0cc6('0x1a'),auth[_0x0cc6('0x9')](),controller['getApplications']);router[_0x0cc6('0xb')]('/:id/proactive_actions',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1b')]);router[_0x0cc6('0xb')](_0x0cc6('0x1c'),controller[_0x0cc6('0x1d')]);router[_0x0cc6('0xb')](_0x0cc6('0x1e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1f')]);router[_0x0cc6('0xb')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller['getAgents']);router[_0x0cc6('0x21')]('/',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x22')]);router[_0x0cc6('0x21')](_0x0cc6('0xd'),auth['isAuthenticated'](),controller[_0x0cc6('0x23')]);router['post'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x24')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x42c430,_0x56dbf9,_0x4cac90){_0x4cac90(null,path['join'](config[_0x0cc6('0x26')],'server/files/images/logos/'));},'filename':function(_0x14b259,_0x5d6a39,_0x15afa8){_0x15afa8(null,util[_0x0cc6('0x27')](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x5d6a39['originalname']));}})});router[_0x0cc6('0x21')](_0x0cc6('0x11'),upload[_0x0cc6('0x2a')]('file'),controller[_0x0cc6('0x2b')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x5affc4,_0x2090c8,_0x20d982){_0x20d982(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x882ef3,_0x3b603e,_0x24728e){_0x24728e(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x3b603e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x13'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x30')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x67d9f8,_0x344ec6,_0x1392fb){_0x1392fb(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],'server/files/images/avatars/'));},'filename':function(_0x47cfd3,_0x1448a9,_0x30a663){_0x30a663(null,util['format'](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x1448a9[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x31'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x32')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x2b5517,_0x9fba4e,_0x342ee4){_0x342ee4(null,path['join'](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x570efa,_0x42a49e,_0x3facf5){_0x3facf5(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x42a49e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x16'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x33')]);router[_0x0cc6('0x21')](_0x0cc6('0x34'),controller[_0x0cc6('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x9fabb1,_0x1b88b7,_0x226bb8){const _0x5920d1=path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x36'),_0x0cc6('0x37'),'offline-chat');fs_extra[_0x0cc6('0x38')](_0x5920d1,function(){_0x226bb8(null,_0x5920d1);});},'filename':function(_0x4d1257,_0x5add92,_0x12e22b){const _0xf281b=_0x5add92['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1c065d=path[_0x0cc6('0x39')](_0xf281b);const _0x5d3a7b=Date[_0x0cc6('0x29')]()+'-'+_0xf281b['replace'](_0x1c065d,'')+_0x1c065d;_0x12e22b(null,_0x5d3a7b);}})});router['post'](_0x0cc6('0x3a'),offlineUploadMulter[_0x0cc6('0x3b')](),controller['offline']);router[_0x0cc6('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0cc6('0x3c')]);router['post'](_0x0cc6('0x1a'),auth['isAuthenticated'](),controller[_0x0cc6('0x3d')]);router[_0x0cc6('0x21')](_0x0cc6('0x3e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x3f')]);router[_0x0cc6('0x21')](_0x0cc6('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0cc6('0x40')](_0x0cc6('0x41'),auth['isAuthenticated'](),controller[_0x0cc6('0x42')]);router[_0x0cc6('0x43')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x44')]);router[_0x0cc6('0x43')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x45')]);router[_0x0cc6('0x43')](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x46')]);router[_0x0cc6('0x43')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x47')]);module[_0x0cc6('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e808847..c387ff2 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 _0xd072=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x3cc1ca,_0x42e033){var _0x4007ff=function(_0x2608a2){while(--_0x2608a2){_0x3cc1ca['push'](_0x3cc1ca['shift']());}};_0x4007ff(++_0x42e033);}(_0xd072,0x132));var _0x2d07=function(_0x142b70,_0x910f9b){_0x142b70=_0x142b70-0x0;var _0x49222a=_0xd072[_0x142b70];return _0x49222a;};'use strict';var Sequelize=require(_0x2d07('0x0'));module[_0x2d07('0x1')]={'name':{'type':Sequelize[_0x2d07('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2d07('0x3')](_0x2d07('0x4'),_0x2d07('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2d07('0x2')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0763=['STRING','ENUM','Google','sequelize'];(function(_0x52c51a,_0x31478a){var _0x20089c=function(_0x5b163c){while(--_0x5b163c){_0x52c51a['push'](_0x52c51a['shift']());}};_0x20089c(++_0x31478a);}(_0x0763,0x87));var _0x3076=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x0763[_0xa45395];return _0x3c83d2;};'use strict';var Sequelize=require(_0x3076('0x0'));module['exports']={'name':{'type':Sequelize[_0x3076('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3076('0x2')]('AmazonAWS',_0x3076('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3076('0x1')]},'data2':{'type':Sequelize[_0x3076('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 249d164..af5fe45 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x490cf7,_0x21e01){var _0x26b65e=function(_0x2f9ec9){while(--_0x2f9ec9){_0x490cf7['push'](_0x490cf7['shift']());}};_0x26b65e(++_0x21e01);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x41dc41,_0x11b458){var _0x3a112f=function(_0x42e7c1){while(--_0x42e7c1){_0x41dc41['push'](_0x41dc41['shift']());}};_0x3a112f(++_0x11b458);}(_0x2032,0xd9));var _0x2203=function(_0x277f49,_0x4717d1){_0x277f49=_0x277f49-0x0;var _0x1bb801=_0x2032[_0x277f49];return _0x1bb801;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index dba386d..9c87f26 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 _0x433f=['moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x329c21,_0x1d1548){var _0x353b8f=function(_0x33af04){while(--_0x33af04){_0x329c21['push'](_0x329c21['shift']());}};_0x353b8f(++_0x1d1548);}(_0x433f,0x8b));var _0xf433=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x433f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xf433('0x0'));var util=require(_0xf433('0x1'));var logger=require(_0xf433('0x2'))(_0xf433('0x3'));var moment=require(_0xf433('0x4'));var BPromise=require(_0xf433('0x5'));var rp=require(_0xf433('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf433('0x7'));var attributes=require(_0xf433('0x8'));module[_0xf433('0x9')]=function(_0x42c584,_0x3cc9e0){return _0x42c584[_0xf433('0xa')](_0xf433('0xb'),attributes,{'tableName':_0xf433('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f3d=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x3f3d,0x1ac));var _0xd3f3=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x3f3d[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xd3f3('0x0'));var util=require('util');var logger=require(_0xd3f3('0x1'))(_0xd3f3('0x2'));var moment=require(_0xd3f3('0x3'));var BPromise=require(_0xd3f3('0x4'));var rp=require(_0xd3f3('0x5'));var fs=require('fs');var path=require(_0xd3f3('0x6'));var rimraf=require(_0xd3f3('0x7'));var config=require(_0xd3f3('0x8'));var attributes=require(_0xd3f3('0x9'));module[_0xd3f3('0xa')]=function(_0xe78eba,_0x13a2a1){return _0xe78eba[_0xd3f3('0xb')](_0xd3f3('0xc'),attributes,{'tableName':_0xd3f3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 12dd469..104d31c 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 _0xab00=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','stringify'];(function(_0x36a3a6,_0x23112c){var _0x111157=function(_0x5683f8){while(--_0x5683f8){_0x36a3a6['push'](_0x36a3a6['shift']());}};_0x111157(++_0x23112c);}(_0xab00,0x1b9));var _0x0ab0=function(_0x3601ba,_0x1671cd){_0x3601ba=_0x3601ba-0x0;var _0x58fe09=_0xab00[_0x3601ba];return _0x58fe09;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var moment=require(_0x0ab0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab0('0x3'));var fs=require('fs');var Redis=require(_0x0ab0('0x4'));var db=require(_0x0ab0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ab0('0x6'))('rpc');var config=require(_0x0ab0('0x7'));var jayson=require(_0x0ab0('0x8'));var client=jayson[_0x0ab0('0x9')][_0x0ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363359,_0x25742b,_0x59fb03){return new BPromise(function(_0x3e934d,_0x2cbb53){return client['request'](_0x363359,_0x59fb03)[_0x0ab0('0xb')](function(_0x4f4a28){logger[_0x0ab0('0xc')](_0x0ab0('0xd'),_0x25742b,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x25742b,'request\x20sent',JSON[_0x0ab0('0xe')](_0x4f4a28));if(_0x4f4a28['error']){if(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x10')]===0x1f4){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x2cbb53(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}logger[_0x0ab0('0xf')](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x3e934d(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}else{logger[_0x0ab0('0xc')]('CloudProvider,\x20%s,\x20%s',_0x25742b,'request\x20sent');_0x3e934d(_0x4f4a28['result'][_0x0ab0('0x11')]);}})[_0x0ab0('0x12')](function(_0x2f594b){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x2f594b);_0x2cbb53(_0x2f594b);});});}
\ No newline at end of file
+var _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2cd969,_0x35dcd4){var _0x10d32f=function(_0xa86b97){while(--_0xa86b97){_0x2cd969['push'](_0x2cd969['shift']());}};_0x10d32f(++_0x35dcd4);}(_0xd786,0x1dc));var _0x6d78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd786[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index aa77f14..a20c43c 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 _0x9613=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','index','get','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x54b4a8,_0x3abef0){var _0x4c7a5f=function(_0x50e054){while(--_0x50e054){_0x54b4a8['push'](_0x54b4a8['shift']());}};_0x4c7a5f(++_0x3abef0);}(_0x9613,0x1c9));var _0x3961=function(_0xe9c9a8,_0x3e4574){_0xe9c9a8=_0xe9c9a8-0x0;var _0xd60a75=_0x9613[_0xe9c9a8];return _0xd60a75;};'use strict';var multer=require(_0x3961('0x0'));var util=require(_0x3961('0x1'));var path=require(_0x3961('0x2'));var timeout=require(_0x3961('0x3'));var express=require('express');var router=express[_0x3961('0x4')]();var fs_extra=require(_0x3961('0x5'));var auth=require(_0x3961('0x6'));var interaction=require(_0x3961('0x7'));var config=require('../../config/environment');var controller=require(_0x3961('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3961('0x9')]);router[_0x3961('0xa')](_0x3961('0xb'),auth['isAuthenticated'](),controller[_0x3961('0xc')]);router['post']('/',auth[_0x3961('0xd')](),controller[_0x3961('0xe')]);router[_0x3961('0xf')](_0x3961('0xb'),auth['isAuthenticated'](),controller[_0x3961('0x10')]);router[_0x3961('0x11')]('/:id',auth[_0x3961('0xd')](),controller[_0x3961('0x12')]);module[_0x3961('0x13')]=router;
\ No newline at end of file
+var _0xa03d=['show','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','isAuthenticated','index','get'];(function(_0x334292,_0xa12527){var _0x3af4a9=function(_0x26e948){while(--_0x26e948){_0x334292['push'](_0x334292['shift']());}};_0x3af4a9(++_0xa12527);}(_0xa03d,0x15b));var _0xda03=function(_0xa45300,_0x12b025){_0xa45300=_0xa45300-0x0;var _0x4b9521=_0xa03d[_0xa45300];return _0x4b9521;};'use strict';var multer=require(_0xda03('0x0'));var util=require(_0xda03('0x1'));var path=require('path');var timeout=require(_0xda03('0x2'));var express=require('express');var router=express[_0xda03('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda03('0x4'));var interaction=require(_0xda03('0x5'));var config=require('../../config/environment');var controller=require(_0xda03('0x6'));router['get']('/',auth[_0xda03('0x7')](),controller[_0xda03('0x8')]);router[_0xda03('0x9')]('/:id',auth[_0xda03('0x7')](),controller[_0xda03('0xa')]);router[_0xda03('0xb')]('/',auth[_0xda03('0x7')](),controller['create']);router['put'](_0xda03('0xc'),auth[_0xda03('0x7')](),controller[_0xda03('0xd')]);router[_0xda03('0xe')](_0xda03('0xc'),auth['isAuthenticated'](),controller[_0xda03('0xf')]);module[_0xda03('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 1c0aef9..c43b7d2 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 _0x9bfc=['name','STRING','sequelize'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x9bfc,0x173));var _0xc9bf=function(_0x11cd67,_0x5402e2){_0x11cd67=_0x11cd67-0x0;var _0x4f1f3b=_0x9bfc[_0x11cd67];return _0x4f1f3b;};'use strict';var Sequelize=require(_0xc9bf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc9bf('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc9bf('0x2')]},'companyId':{'type':Sequelize[_0xc9bf('0x2')]},'website':{'type':Sequelize[_0xc9bf('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc9bf('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc9bf('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc9bf('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc9bf('0x2')]},'sStreet':{'type':Sequelize[_0xc9bf('0x2')]},'sPostalCode':{'type':Sequelize[_0xc9bf('0x2')]},'sCity':{'type':Sequelize[_0xc9bf('0x2')]},'sCountry':{'type':Sequelize[_0xc9bf('0x2')]},'description':{'type':Sequelize[_0xc9bf('0x2')]}};
\ No newline at end of file
+var _0x357f=['name','sequelize','exports','STRING'];(function(_0xa20571,_0x49a4b9){var _0x16beae=function(_0x402d7d){while(--_0x402d7d){_0xa20571['push'](_0xa20571['shift']());}};_0x16beae(++_0x49a4b9);}(_0x357f,0x99));var _0xf357=function(_0x386297,_0x5bfc15){_0x386297=_0x386297-0x0;var _0x4c051e=_0x357f[_0x386297];return _0x4c051e;};'use strict';var Sequelize=require(_0xf357('0x0'));module[_0xf357('0x1')]={'name':{'type':Sequelize[_0xf357('0x2')],'unique':_0xf357('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf357('0x2')]},'companyId':{'type':Sequelize[_0xf357('0x2')]},'website':{'type':Sequelize[_0xf357('0x2')]},'phone':{'type':Sequelize[_0xf357('0x2')]},'fax':{'type':Sequelize[_0xf357('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf357('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf357('0x2')]},'country':{'type':Sequelize[_0xf357('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf357('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xf357('0x2')]},'sCountry':{'type':Sequelize[_0xf357('0x2')]},'description':{'type':Sequelize[_0xf357('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5ae559a..e34bd98 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 _0x29b6=['includeAll','include','findAll','rows','catch','params','merge','find','create','body','role','user','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','map','options','CmCompany','count'];(function(_0x5a4f3b,_0x344159){var _0x33e973=function(_0x2ff5b0){while(--_0x2ff5b0){_0x5a4f3b['push'](_0x5a4f3b['shift']());}};_0x33e973(++_0x344159);}(_0x29b6,0xb8));var _0x629b=function(_0x153f98,_0x2ee426){_0x153f98=_0x153f98-0x0;var _0xf7b9ba=_0x29b6[_0x153f98];return _0xf7b9ba;};'use strict';var emlformat=require(_0x629b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x629b('0x1'));var jsonpatch=require(_0x629b('0x2'));var rp=require(_0x629b('0x3'));var moment=require(_0x629b('0x4'));var BPromise=require(_0x629b('0x5'));var Mustache=require(_0x629b('0x6'));var util=require('util');var path=require(_0x629b('0x7'));var sox=require(_0x629b('0x8'));var csv=require('to-csv');var ejs=require(_0x629b('0x9'));var fs=require('fs');var fs_extra=require(_0x629b('0xa'));var _=require(_0x629b('0xb'));var squel=require('squel');var crypto=require(_0x629b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x629b('0xd'));var toCsv=require(_0x629b('0xe'));var querystring=require(_0x629b('0xf'));var Papa=require(_0x629b('0x10'));var Redis=require('ioredis');var authService=require(_0x629b('0x11'));var qs=require(_0x629b('0x12'));var as=require(_0x629b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x629b('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x629b('0x15'));var db=require(_0x629b('0x16'))['db'];function respondWithStatusCode(_0x1ba07e,_0x28cbe6){_0x28cbe6=_0x28cbe6||0xcc;return function(_0x3aa807){if(_0x3aa807){return _0x1ba07e[_0x629b('0x17')](_0x28cbe6);}return _0x1ba07e['status'](_0x28cbe6)[_0x629b('0x18')]();};}function respondWithResult(_0x4cfa07,_0x4f5c6f){_0x4f5c6f=_0x4f5c6f||0xc8;return function(_0x10bf14){if(_0x10bf14){return _0x4cfa07[_0x629b('0x19')](_0x4f5c6f)[_0x629b('0x1a')](_0x10bf14);}};}function respondWithFilteredResult(_0x535d18,_0x96ffe8){return function(_0x4c244a){if(_0x4c244a){var _0x32200a=typeof _0x96ffe8['offset']===_0x629b('0x1b')&&typeof _0x96ffe8['limit']===_0x629b('0x1b');var _0x3e42aa=_0x4c244a['count'];var _0x3d3b83=_0x32200a?0x0:_0x96ffe8['offset'];var _0x47260c=_0x32200a?_0x4c244a['count']:_0x96ffe8[_0x629b('0x1c')]+_0x96ffe8[_0x629b('0x1d')];var _0x40afdc;if(_0x47260c>=_0x3e42aa){_0x47260c=_0x3e42aa;_0x40afdc=0xc8;}else{_0x40afdc=0xce;}_0x535d18[_0x629b('0x19')](_0x40afdc);return _0x535d18[_0x629b('0x1e')](_0x629b('0x1f'),_0x3d3b83+'-'+_0x47260c+'/'+_0x3e42aa)['json'](_0x4c244a);}return null;};}function patchUpdates(_0x21eb5e){return function(_0x3a7fbc){try{jsonpatch[_0x629b('0x20')](_0x3a7fbc,_0x21eb5e,!![]);}catch(_0x3b5ba4){return BPromise[_0x629b('0x21')](_0x3b5ba4);}return _0x3a7fbc[_0x629b('0x22')]();};}function saveUpdates(_0x1dd9b2,_0x294b1c){return function(_0xa33289){if(_0xa33289){return _0xa33289[_0x629b('0x23')](_0x1dd9b2)[_0x629b('0x24')](function(_0x3f0ad4){return _0x3f0ad4;});}return null;};}function removeEntity(_0x5956d4,_0x2e1211){return function(_0x3e4ad1){if(_0x3e4ad1){return _0x3e4ad1['destroy']()['then'](function(){var _0x511d9b=_0x3e4ad1[_0x629b('0x25')]({'plain':!![]});var _0x170f50='Companies';return db['UserProfileResource'][_0x629b('0x26')]({'where':{'type':_0x170f50,'resourceId':_0x511d9b['id']}})[_0x629b('0x24')](function(){return _0x3e4ad1;});})[_0x629b('0x24')](function(){_0x5956d4[_0x629b('0x19')](0xcc)[_0x629b('0x18')]();});}};}function handleEntityNotFound(_0x2c0711,_0x400191){return function(_0x3cadae){if(!_0x3cadae){_0x2c0711[_0x629b('0x17')](0x194);}return _0x3cadae;};}function handleError(_0x3ff78e,_0x3e6e34){_0x3e6e34=_0x3e6e34||0x1f4;return function(_0x3087c5){logger['error'](_0x3087c5['stack']);if(_0x3087c5['name']){delete _0x3087c5['name'];}_0x3ff78e[_0x629b('0x19')](_0x3e6e34)[_0x629b('0x27')](_0x3087c5);};}exports[_0x629b('0x28')]=function(_0x578472,_0x1b0270){var _0x387253={},_0x4444ad={},_0x2abd8e={'count':0x0,'rows':[]};return db['CmCompany'][_0x629b('0x29')]()[_0x629b('0x24')](function(_0x57f3a6){_0x4444ad[_0x629b('0x2a')]=_[_0x629b('0x2b')](_0x57f3a6);_0x4444ad[_0x629b('0x2c')]=_[_0x629b('0x2b')](_0x578472[_0x629b('0x2c')]);_0x4444ad[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x4444ad[_0x629b('0x2a')],_0x4444ad['query']);_0x387253['attributes']=_['intersection'](_0x4444ad[_0x629b('0x2a')],qs[_0x629b('0x2f')](_0x578472['query'][_0x629b('0x2f')]));_0x387253[_0x629b('0x30')]=_0x387253[_0x629b('0x30')][_0x629b('0x31')]?_0x387253[_0x629b('0x30')]:_0x4444ad[_0x629b('0x2a')];if(!_0x578472[_0x629b('0x2c')][_0x629b('0x32')](_0x629b('0x33'))){_0x387253['limit']=qs[_0x629b('0x1d')](_0x578472[_0x629b('0x2c')]['limit']);_0x387253['offset']=qs[_0x629b('0x1c')](_0x578472[_0x629b('0x2c')][_0x629b('0x1c')]);}_0x387253['order']=qs[_0x629b('0x34')](_0x578472[_0x629b('0x2c')]['sort']);_0x387253[_0x629b('0x35')]=qs[_0x629b('0x2d')](_['pick'](_0x578472[_0x629b('0x2c')],_0x4444ad['filters']),_0x57f3a6);if(_0x578472[_0x629b('0x2c')][_0x629b('0x36')]){_0x387253[_0x629b('0x35')]=_['merge'](_0x387253[_0x629b('0x35')],{'$or':_[_0x629b('0x37')](_0x387253[_0x629b('0x30')],function(_0x5248e5){var _0x34adb2={};_0x34adb2[_0x5248e5]={'$like':'%'+_0x578472[_0x629b('0x2c')][_0x629b('0x36')]+'%'};return _0x34adb2;})});}_0x387253=_['merge']({},_0x387253,_0x578472[_0x629b('0x38')]);var _0x403ee1={'where':_0x387253['where']};return db[_0x629b('0x39')][_0x629b('0x3a')](_0x403ee1)[_0x629b('0x24')](function(_0x1808a3){_0x2abd8e[_0x629b('0x3a')]=_0x1808a3;if(_0x578472[_0x629b('0x2c')][_0x629b('0x3b')]){_0x387253[_0x629b('0x3c')]=[{'all':!![]}];}return db[_0x629b('0x39')][_0x629b('0x3d')](_0x387253);})['then'](function(_0x39d15e){_0x2abd8e[_0x629b('0x3e')]=_0x39d15e;return _0x2abd8e;})[_0x629b('0x24')](respondWithFilteredResult(_0x1b0270,_0x387253))['catch'](handleError(_0x1b0270,null));})[_0x629b('0x3f')](handleError(_0x1b0270,null));};exports['show']=function(_0x21ca96,_0x226058){var _0x401569={'raw':![],'where':{'id':_0x21ca96[_0x629b('0x40')]['id']}},_0x2bc27e={};_0x2bc27e[_0x629b('0x2a')]=_[_0x629b('0x2b')](db[_0x629b('0x39')]['rawAttributes']);_0x2bc27e[_0x629b('0x2c')]=_['keys'](_0x21ca96['query']);_0x2bc27e[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x2bc27e[_0x629b('0x2a')],_0x2bc27e[_0x629b('0x2c')]);_0x401569['attributes']=_[_0x629b('0x2e')](_0x2bc27e['model'],qs[_0x629b('0x2f')](_0x21ca96[_0x629b('0x2c')][_0x629b('0x2f')]));_0x401569[_0x629b('0x30')]=_0x401569['attributes'][_0x629b('0x31')]?_0x401569[_0x629b('0x30')]:_0x2bc27e[_0x629b('0x2a')];if(_0x21ca96[_0x629b('0x2c')][_0x629b('0x3b')]){_0x401569['include']=[{'all':!![]}];}_0x401569=_[_0x629b('0x41')]({},_0x401569,_0x21ca96['options']);return db[_0x629b('0x39')][_0x629b('0x42')](_0x401569)[_0x629b('0x24')](handleEntityNotFound(_0x226058,null))[_0x629b('0x24')](respondWithResult(_0x226058,null))[_0x629b('0x3f')](handleError(_0x226058,null));};exports[_0x629b('0x43')]=function(_0x1236a2,_0x2ddf0b){return db[_0x629b('0x39')][_0x629b('0x43')](_0x1236a2[_0x629b('0x44')],{})[_0x629b('0x24')](function(_0x56db61){var _0xbede8c=_0x1236a2['user'][_0x629b('0x25')]({'plain':!![]});if(!_0xbede8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbede8c[_0x629b('0x45')]===_0x629b('0x46')){var _0x5b428b=_0x56db61['get']({'plain':!![]});var _0x3230fc='Companies';return db['UserProfileSection'][_0x629b('0x42')]({'where':{'name':_0x3230fc,'userProfileId':_0xbede8c['userProfileId']},'raw':!![]})[_0x629b('0x24')](function(_0x3b1195){if(_0x3b1195&&_0x3b1195[_0x629b('0x47')]===0x0){return db['UserProfileResource'][_0x629b('0x43')]({'name':_0x5b428b[_0x629b('0x48')],'resourceId':_0x5b428b['id'],'type':_0x3b1195[_0x629b('0x48')],'sectionId':_0x3b1195['id']},{})[_0x629b('0x24')](function(){return _0x56db61;});}else{return _0x56db61;}})[_0x629b('0x3f')](function(_0x4a859e){logger[_0x629b('0x49')](_0x629b('0x4a'),_0x4a859e);throw _0x4a859e;});}return _0x56db61;})[_0x629b('0x24')](respondWithResult(_0x2ddf0b,0xc9))['catch'](handleError(_0x2ddf0b,null));};exports[_0x629b('0x23')]=function(_0x32a1e9,_0x356b19){if(_0x32a1e9[_0x629b('0x44')]['id']){delete _0x32a1e9[_0x629b('0x44')]['id'];}return db[_0x629b('0x39')][_0x629b('0x42')]({'where':{'id':_0x32a1e9[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x356b19,null))[_0x629b('0x24')](saveUpdates(_0x32a1e9[_0x629b('0x44')],null))[_0x629b('0x24')](respondWithResult(_0x356b19,null))[_0x629b('0x3f')](handleError(_0x356b19,null));};exports[_0x629b('0x26')]=function(_0x1669c6,_0x20c318){return db[_0x629b('0x39')][_0x629b('0x42')]({'where':{'id':_0x1669c6['params']['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x20c318,null))[_0x629b('0x24')](removeEntity(_0x20c318,null))['catch'](handleError(_0x20c318,null));};exports[_0x629b('0x29')]=function(_0x43875a,_0x33677d){return db[_0x629b('0x39')]['describe']()[_0x629b('0x24')](respondWithResult(_0x33677d,null))[_0x629b('0x3f')](handleError(_0x33677d,null));};exports[_0x629b('0x4b')]=function(_0x43645c,_0x4de89b,_0x233dd7){return db[_0x629b('0x4c')][_0x629b('0x42')]({'where':{'id':_0x43645c[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x4de89b,null))['then'](function(_0x1f94e2){if(_0x1f94e2){return _0x1f94e2['addContacts'](_0x43645c['body'][_0x629b('0x4d')],_[_0x629b('0x4e')](_0x43645c[_0x629b('0x44')],['ids','id'])||{});}})[_0x629b('0x24')](respondWithResult(_0x4de89b,null))[_0x629b('0x3f')](handleError(_0x4de89b,null));};exports[_0x629b('0x4f')]=function(_0x26a293,_0x27c4ff,_0x4b301){var _0x4db000={};var _0x2ce013={};var _0x4da3b0;var _0x41842c;return db['CmCompany'][_0x629b('0x50')]({'where':{'id':_0x26a293[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x27c4ff,null))[_0x629b('0x24')](function(_0x536bef){if(_0x536bef){_0x4da3b0=_0x536bef;_0x2ce013['model']=_[_0x629b('0x2b')](db[_0x629b('0x4c')]['rawAttributes']);_0x2ce013[_0x629b('0x2c')]=_['keys'](_0x26a293['query']);_0x2ce013[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x2ce013[_0x629b('0x2a')],_0x2ce013[_0x629b('0x2c')]);_0x4db000[_0x629b('0x30')]=_['intersection'](_0x2ce013[_0x629b('0x2a')],qs['fields'](_0x26a293[_0x629b('0x2c')][_0x629b('0x2f')]));_0x4db000[_0x629b('0x30')]=_0x4db000[_0x629b('0x30')][_0x629b('0x31')]?_0x4db000[_0x629b('0x30')]:_0x2ce013[_0x629b('0x2a')];_0x4db000['order']=qs[_0x629b('0x34')](_0x26a293[_0x629b('0x2c')][_0x629b('0x34')]);_0x4db000['where']=qs[_0x629b('0x2d')](_['pick'](_0x26a293[_0x629b('0x2c')],_0x2ce013['filters']));if(_0x26a293[_0x629b('0x2c')][_0x629b('0x36')]){_0x4db000[_0x629b('0x35')]=_[_0x629b('0x41')](_0x4db000['where'],{'$or':_[_0x629b('0x37')](_0x4db000[_0x629b('0x30')],function(_0xcc1c8){var _0x23fc70={};_0x23fc70[_0xcc1c8]={'$like':'%'+_0x26a293['query']['filter']+'%'};return _0x23fc70;})});}_0x4db000=_[_0x629b('0x41')]({},_0x4db000,_0x26a293[_0x629b('0x38')]);return _0x4da3b0[_0x629b('0x4f')](_0x4db000);}})[_0x629b('0x24')](function(_0x4f8721){if(_0x4f8721){_0x41842c=_0x4f8721[_0x629b('0x31')];if(!_0x26a293[_0x629b('0x2c')][_0x629b('0x32')](_0x629b('0x33'))){_0x4db000[_0x629b('0x1d')]=qs[_0x629b('0x1d')](_0x26a293[_0x629b('0x2c')]['limit']);_0x4db000[_0x629b('0x1c')]=qs['offset'](_0x26a293['query'][_0x629b('0x1c')]);}return _0x4da3b0[_0x629b('0x4f')](_0x4db000);}})[_0x629b('0x24')](function(_0x144699){if(_0x144699){return _0x144699?{'count':_0x41842c,'rows':_0x144699}:null;}})[_0x629b('0x24')](respondWithResult(_0x27c4ff,null))[_0x629b('0x3f')](handleError(_0x27c4ff,null));};
\ No newline at end of file
+var _0xfa3a=['end','json','limit','offset','set','Content-Range','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','findOne','CmContact','length','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xfa3a,0x145));var _0xafa3=function(_0x32e59e,_0x252469){_0x32e59e=_0x32e59e-0x0;var _0x4a621d=_0xfa3a[_0x32e59e];return _0x4a621d;};'use strict';var emlformat=require(_0xafa3('0x0'));var rimraf=require(_0xafa3('0x1'));var zipdir=require(_0xafa3('0x2'));var jsonpatch=require(_0xafa3('0x3'));var rp=require(_0xafa3('0x4'));var moment=require(_0xafa3('0x5'));var BPromise=require(_0xafa3('0x6'));var Mustache=require(_0xafa3('0x7'));var util=require('util');var path=require(_0xafa3('0x8'));var sox=require(_0xafa3('0x9'));var csv=require('to-csv');var ejs=require(_0xafa3('0xa'));var fs=require('fs');var fs_extra=require(_0xafa3('0xb'));var _=require(_0xafa3('0xc'));var squel=require(_0xafa3('0xd'));var crypto=require('crypto');var jsforce=require(_0xafa3('0xe'));var deskjs=require(_0xafa3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafa3('0x10'));var Redis=require(_0xafa3('0x11'));var authService=require(_0xafa3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafa3('0x13'));var hardwareService=require(_0xafa3('0x14'));var logger=require(_0xafa3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xafa3('0x16'));var licenseUtil=require(_0xafa3('0x17'));var db=require(_0xafa3('0x18'))['db'];function respondWithStatusCode(_0x33fc81,_0x3c9324){_0x3c9324=_0x3c9324||0xcc;return function(_0x2b4ec4){if(_0x2b4ec4){return _0x33fc81[_0xafa3('0x19')](_0x3c9324);}return _0x33fc81[_0xafa3('0x1a')](_0x3c9324)[_0xafa3('0x1b')]();};}function respondWithResult(_0x5ed5bd,_0x168d69){_0x168d69=_0x168d69||0xc8;return function(_0xae981f){if(_0xae981f){return _0x5ed5bd[_0xafa3('0x1a')](_0x168d69)[_0xafa3('0x1c')](_0xae981f);}};}function respondWithFilteredResult(_0x40feef,_0x1d0377){return function(_0x2c8f4f){if(_0x2c8f4f){var _0x4b823f=typeof _0x1d0377['offset']==='undefined'&&typeof _0x1d0377[_0xafa3('0x1d')]==='undefined';var _0x4628b7=_0x2c8f4f['count'];var _0x413e6b=_0x4b823f?0x0:_0x1d0377[_0xafa3('0x1e')];var _0x58a450=_0x4b823f?_0x2c8f4f['count']:_0x1d0377[_0xafa3('0x1e')]+_0x1d0377['limit'];var _0x337dcf;if(_0x58a450>=_0x4628b7){_0x58a450=_0x4628b7;_0x337dcf=0xc8;}else{_0x337dcf=0xce;}_0x40feef[_0xafa3('0x1a')](_0x337dcf);return _0x40feef[_0xafa3('0x1f')](_0xafa3('0x20'),_0x413e6b+'-'+_0x58a450+'/'+_0x4628b7)[_0xafa3('0x1c')](_0x2c8f4f);}return null;};}function patchUpdates(_0x1b0c2c){return function(_0x5bdc4d){try{jsonpatch['apply'](_0x5bdc4d,_0x1b0c2c,!![]);}catch(_0x301d1a){return BPromise[_0xafa3('0x21')](_0x301d1a);}return _0x5bdc4d[_0xafa3('0x22')]();};}function saveUpdates(_0x1f25cf,_0x4ef5e1){return function(_0x3fde81){if(_0x3fde81){return _0x3fde81[_0xafa3('0x23')](_0x1f25cf)['then'](function(_0x21ad2a){return _0x21ad2a;});}return null;};}function removeEntity(_0x5de009,_0x3b80a1){return function(_0x3ed3f1){if(_0x3ed3f1){return _0x3ed3f1[_0xafa3('0x24')]()[_0xafa3('0x25')](function(){var _0x356413=_0x3ed3f1[_0xafa3('0x26')]({'plain':!![]});var _0x4fb2b0=_0xafa3('0x27');return db[_0xafa3('0x28')][_0xafa3('0x24')]({'where':{'type':_0x4fb2b0,'resourceId':_0x356413['id']}})[_0xafa3('0x25')](function(){return _0x3ed3f1;});})['then'](function(){_0x5de009[_0xafa3('0x1a')](0xcc)[_0xafa3('0x1b')]();});}};}function handleEntityNotFound(_0x4b008a,_0x5f41c2){return function(_0x48f2da){if(!_0x48f2da){_0x4b008a[_0xafa3('0x19')](0x194);}return _0x48f2da;};}function handleError(_0x41f9f7,_0xdd4506){_0xdd4506=_0xdd4506||0x1f4;return function(_0x5f2ce2){logger[_0xafa3('0x29')](_0x5f2ce2[_0xafa3('0x2a')]);if(_0x5f2ce2[_0xafa3('0x2b')]){delete _0x5f2ce2['name'];}_0x41f9f7[_0xafa3('0x1a')](_0xdd4506)[_0xafa3('0x2c')](_0x5f2ce2);};}exports[_0xafa3('0x2d')]=function(_0x56d23b,_0x320e6d){var _0x2abd46={},_0x257fa5={},_0x1e9023={'count':0x0,'rows':[]};return db[_0xafa3('0x2e')][_0xafa3('0x2f')]()['then'](function(_0x1b0bb5){_0x257fa5['model']=_[_0xafa3('0x30')](_0x1b0bb5);_0x257fa5[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x56d23b[_0xafa3('0x31')]);_0x257fa5['filters']=_[_0xafa3('0x32')](_0x257fa5[_0xafa3('0x33')],_0x257fa5[_0xafa3('0x31')]);_0x2abd46['attributes']=_[_0xafa3('0x32')](_0x257fa5['model'],qs[_0xafa3('0x34')](_0x56d23b[_0xafa3('0x31')]['fields']));_0x2abd46[_0xafa3('0x35')]=_0x2abd46[_0xafa3('0x35')]['length']?_0x2abd46[_0xafa3('0x35')]:_0x257fa5['model'];if(!_0x56d23b['query'][_0xafa3('0x36')](_0xafa3('0x37'))){_0x2abd46['limit']=qs[_0xafa3('0x1d')](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x2abd46[_0xafa3('0x1e')]=qs['offset'](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1e')]);}_0x2abd46[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x56d23b[_0xafa3('0x31')]['sort']);_0x2abd46[_0xafa3('0x3a')]=qs[_0xafa3('0x3b')](_[_0xafa3('0x3c')](_0x56d23b[_0xafa3('0x31')],_0x257fa5[_0xafa3('0x3b')]),_0x1b0bb5);if(_0x56d23b[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x2abd46['where']=_[_0xafa3('0x3e')](_0x2abd46[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x2abd46[_0xafa3('0x35')],function(_0x5dbce1){var _0x13da20={};_0x13da20[_0x5dbce1]={'$like':'%'+_0x56d23b[_0xafa3('0x31')]['filter']+'%'};return _0x13da20;})});}_0x2abd46=_['merge']({},_0x2abd46,_0x56d23b['options']);var _0x11d101={'where':_0x2abd46[_0xafa3('0x3a')]};return db[_0xafa3('0x2e')]['count'](_0x11d101)[_0xafa3('0x25')](function(_0x47a2bb){_0x1e9023[_0xafa3('0x40')]=_0x47a2bb;if(_0x56d23b['query'][_0xafa3('0x41')]){_0x2abd46[_0xafa3('0x42')]=[{'all':!![]}];}return db[_0xafa3('0x2e')][_0xafa3('0x43')](_0x2abd46);})['then'](function(_0x1f131e){_0x1e9023[_0xafa3('0x44')]=_0x1f131e;return _0x1e9023;})[_0xafa3('0x25')](respondWithFilteredResult(_0x320e6d,_0x2abd46))[_0xafa3('0x45')](handleError(_0x320e6d,null));})[_0xafa3('0x45')](handleError(_0x320e6d,null));};exports['show']=function(_0x4b5959,_0x5315c1){var _0x1a0163={'raw':![],'where':{'id':_0x4b5959[_0xafa3('0x46')]['id']}},_0x2db8a4={};_0x2db8a4[_0xafa3('0x33')]=_[_0xafa3('0x30')](db[_0xafa3('0x2e')][_0xafa3('0x47')]);_0x2db8a4[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x4b5959[_0xafa3('0x31')]);_0x2db8a4[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x2db8a4['model'],_0x2db8a4[_0xafa3('0x31')]);_0x1a0163['attributes']=_[_0xafa3('0x32')](_0x2db8a4[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x4b5959['query'][_0xafa3('0x34')]));_0x1a0163[_0xafa3('0x35')]=_0x1a0163[_0xafa3('0x35')]['length']?_0x1a0163[_0xafa3('0x35')]:_0x2db8a4[_0xafa3('0x33')];if(_0x4b5959[_0xafa3('0x31')][_0xafa3('0x41')]){_0x1a0163[_0xafa3('0x42')]=[{'all':!![]}];}_0x1a0163=_[_0xafa3('0x3e')]({},_0x1a0163,_0x4b5959[_0xafa3('0x48')]);return db[_0xafa3('0x2e')][_0xafa3('0x49')](_0x1a0163)[_0xafa3('0x25')](handleEntityNotFound(_0x5315c1,null))[_0xafa3('0x25')](respondWithResult(_0x5315c1,null))[_0xafa3('0x45')](handleError(_0x5315c1,null));};exports[_0xafa3('0x4a')]=function(_0x4efa80,_0x34fc93){return db[_0xafa3('0x2e')]['create'](_0x4efa80[_0xafa3('0x4b')],{})[_0xafa3('0x25')](function(_0x5a48d4){var _0x49acd8=_0x4efa80['user'][_0xafa3('0x26')]({'plain':!![]});if(!_0x49acd8)throw new Error(_0xafa3('0x4c'));if(_0x49acd8[_0xafa3('0x4d')]===_0xafa3('0x4e')){var _0x3a78a8=_0x5a48d4[_0xafa3('0x26')]({'plain':!![]});var _0x2a94d0=_0xafa3('0x27');return db[_0xafa3('0x4f')]['find']({'where':{'name':_0x2a94d0,'userProfileId':_0x49acd8['userProfileId']},'raw':!![]})['then'](function(_0x2ab1e3){if(_0x2ab1e3&&_0x2ab1e3['autoAssociation']===0x0){return db[_0xafa3('0x28')][_0xafa3('0x4a')]({'name':_0x3a78a8[_0xafa3('0x2b')],'resourceId':_0x3a78a8['id'],'type':_0x2ab1e3[_0xafa3('0x2b')],'sectionId':_0x2ab1e3['id']},{})[_0xafa3('0x25')](function(){return _0x5a48d4;});}else{return _0x5a48d4;}})[_0xafa3('0x45')](function(_0x50c799){logger[_0xafa3('0x29')](_0xafa3('0x50'),_0x50c799);throw _0x50c799;});}return _0x5a48d4;})['then'](respondWithResult(_0x34fc93,0xc9))[_0xafa3('0x45')](handleError(_0x34fc93,null));};exports[_0xafa3('0x23')]=function(_0x73676f,_0x27b457){if(_0x73676f[_0xafa3('0x4b')]['id']){delete _0x73676f[_0xafa3('0x4b')]['id'];}return db['CmCompany'][_0xafa3('0x49')]({'where':{'id':_0x73676f['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x27b457,null))[_0xafa3('0x25')](saveUpdates(_0x73676f['body'],null))[_0xafa3('0x25')](respondWithResult(_0x27b457,null))[_0xafa3('0x45')](handleError(_0x27b457,null));};exports[_0xafa3('0x24')]=function(_0x15cb85,_0x5ef9f6){return db[_0xafa3('0x2e')][_0xafa3('0x49')]({'where':{'id':_0x15cb85[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x5ef9f6,null))[_0xafa3('0x25')](removeEntity(_0x5ef9f6,null))['catch'](handleError(_0x5ef9f6,null));};exports[_0xafa3('0x2f')]=function(_0xe813c5,_0x201e59){return db[_0xafa3('0x2e')]['describe']()[_0xafa3('0x25')](respondWithResult(_0x201e59,null))[_0xafa3('0x45')](handleError(_0x201e59,null));};exports[_0xafa3('0x51')]=function(_0x5c09ad,_0x1af878,_0x23ce5d){return db['CmContact'][_0xafa3('0x49')]({'where':{'id':_0x5c09ad['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1af878,null))[_0xafa3('0x25')](function(_0x13e4e9){if(_0x13e4e9){return _0x13e4e9[_0xafa3('0x51')](_0x5c09ad[_0xafa3('0x4b')]['ids'],_[_0xafa3('0x52')](_0x5c09ad[_0xafa3('0x4b')],[_0xafa3('0x53'),'id'])||{});}})[_0xafa3('0x25')](respondWithResult(_0x1af878,null))[_0xafa3('0x45')](handleError(_0x1af878,null));};exports['getContacts']=function(_0x25e51c,_0x1b8801,_0x3d7144){var _0x247de5={};var _0x483038={};var _0x388328;var _0x4e1ad6;return db[_0xafa3('0x2e')][_0xafa3('0x54')]({'where':{'id':_0x25e51c[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1b8801,null))[_0xafa3('0x25')](function(_0x4fcbee){if(_0x4fcbee){_0x388328=_0x4fcbee;_0x483038[_0xafa3('0x33')]=_['keys'](db[_0xafa3('0x55')][_0xafa3('0x47')]);_0x483038[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x25e51c['query']);_0x483038[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x483038[_0xafa3('0x33')],_0x483038[_0xafa3('0x31')]);_0x247de5[_0xafa3('0x35')]=_['intersection'](_0x483038[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x34')]));_0x247de5[_0xafa3('0x35')]=_0x247de5[_0xafa3('0x35')][_0xafa3('0x56')]?_0x247de5[_0xafa3('0x35')]:_0x483038['model'];_0x247de5[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x25e51c['query'][_0xafa3('0x39')]);_0x247de5['where']=qs['filters'](_['pick'](_0x25e51c[_0xafa3('0x31')],_0x483038[_0xafa3('0x3b')]));if(_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x247de5[_0xafa3('0x3a')]=_[_0xafa3('0x3e')](_0x247de5[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x247de5[_0xafa3('0x35')],function(_0x2e9d4e){var _0x18bc4f={};_0x18bc4f[_0x2e9d4e]={'$like':'%'+_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]+'%'};return _0x18bc4f;})});}_0x247de5=_['merge']({},_0x247de5,_0x25e51c[_0xafa3('0x48')]);return _0x388328['getContacts'](_0x247de5);}})[_0xafa3('0x25')](function(_0x2be164){if(_0x2be164){_0x4e1ad6=_0x2be164[_0xafa3('0x56')];if(!_0x25e51c[_0xafa3('0x31')]['hasOwnProperty'](_0xafa3('0x37'))){_0x247de5[_0xafa3('0x1d')]=qs[_0xafa3('0x1d')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x247de5[_0xafa3('0x1e')]=qs['offset'](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1e')]);}return _0x388328[_0xafa3('0x57')](_0x247de5);}})[_0xafa3('0x25')](function(_0xdeeda6){if(_0xdeeda6){return _0xdeeda6?{'count':_0x4e1ad6,'rows':_0xdeeda6}:null;}})[_0xafa3('0x25')](respondWithResult(_0x1b8801,null))[_0xafa3('0x45')](handleError(_0x1b8801,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 078448e..81dc3b5 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 _0xc84c=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x359397,_0x656f9c){var _0x1d5d68=function(_0x4e6ef2){while(--_0x4e6ef2){_0x359397['push'](_0x359397['shift']());}};_0x1d5d68(++_0x656f9c);}(_0xc84c,0x1e7));var _0xcc84=function(_0x2de4e6,_0x2dbab4){_0x2de4e6=_0x2de4e6-0x0;var _0x156984=_0xc84c[_0x2de4e6];return _0x156984;};'use strict';var _=require(_0xcc84('0x0'));var util=require(_0xcc84('0x1'));var logger=require('../../config/logger')(_0xcc84('0x2'));var moment=require(_0xcc84('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc84('0x4'));var fs=require('fs');var path=require(_0xcc84('0x5'));var rimraf=require(_0xcc84('0x6'));var config=require(_0xcc84('0x7'));var attributes=require(_0xcc84('0x8'));module[_0xcc84('0x9')]=function(_0x4fb891,_0x455976){return _0x4fb891[_0xcc84('0xa')](_0xcc84('0xb'),attributes,{'tableName':_0xcc84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc6d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','lodash','util','../../config/logger'];(function(_0x4b125d,_0x3dc671){var _0x535ead=function(_0x1e9b7e){while(--_0x1e9b7e){_0x4b125d['push'](_0x4b125d['shift']());}};_0x535ead(++_0x3dc671);}(_0xbc6d,0x189));var _0xdbc6=function(_0x5d82d9,_0x3d7694){_0x5d82d9=_0x5d82d9-0x0;var _0x3dfd86=_0xbc6d[_0x5d82d9];return _0x3dfd86;};'use strict';var _=require(_0xdbc6('0x0'));var util=require(_0xdbc6('0x1'));var logger=require(_0xdbc6('0x2'))(_0xdbc6('0x3'));var moment=require(_0xdbc6('0x4'));var BPromise=require(_0xdbc6('0x5'));var rp=require(_0xdbc6('0x6'));var fs=require('fs');var path=require(_0xdbc6('0x7'));var rimraf=require(_0xdbc6('0x8'));var config=require(_0xdbc6('0x9'));var attributes=require(_0xdbc6('0xa'));module['exports']=function(_0x190fdd,_0x3a9ebb){return _0x190fdd[_0xdbc6('0xb')]('CmCompany',attributes,{'tableName':'cm_companies','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 f09eb39..ef7e702 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 _0xdae9=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2b2861,_0x5f4bf5){var _0xb48543=function(_0x40f80e){while(--_0x40f80e){_0x2b2861['push'](_0x2b2861['shift']());}};_0xb48543(++_0x5f4bf5);}(_0xdae9,0x118));var _0x9dae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdae9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9dae('0x0'));var util=require(_0x9dae('0x1'));var moment=require(_0x9dae('0x2'));var BPromise=require('bluebird');var rs=require(_0x9dae('0x3'));var fs=require('fs');var Redis=require(_0x9dae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dae('0x5'));var logger=require(_0x9dae('0x6'))(_0x9dae('0x7'));var config=require(_0x9dae('0x8'));var jayson=require(_0x9dae('0x9'));var client=jayson[_0x9dae('0xa')][_0x9dae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2662cf,_0x17456e,_0x10beed){return new BPromise(function(_0x393e38,_0x9ac464){return client[_0x9dae('0xc')](_0x2662cf,_0x10beed)[_0x9dae('0xd')](function(_0x581980){logger[_0x9dae('0xe')]('CmCompany,\x20%s,\x20%s',_0x17456e,_0x9dae('0xf'));logger[_0x9dae('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x17456e,_0x9dae('0xf'),JSON[_0x9dae('0x11')](_0x581980));if(_0x581980[_0x9dae('0x12')]){if(_0x581980['error'][_0x9dae('0x13')]===0x1f4){logger[_0x9dae('0x12')](_0x9dae('0x14'),_0x17456e,_0x581980['error']['message']);return _0x9ac464(_0x581980[_0x9dae('0x12')][_0x9dae('0x15')]);}logger[_0x9dae('0x12')](_0x9dae('0x14'),_0x17456e,_0x581980[_0x9dae('0x12')][_0x9dae('0x15')]);return _0x393e38(_0x581980['error'][_0x9dae('0x15')]);}else{logger[_0x9dae('0xe')](_0x9dae('0x14'),_0x17456e,_0x9dae('0xf'));_0x393e38(_0x581980[_0x9dae('0x16')][_0x9dae('0x15')]);}})[_0x9dae('0x17')](function(_0x4892ee){logger['error'](_0x9dae('0x14'),_0x17456e,_0x4892ee);_0x9ac464(_0x4892ee);});});}
\ No newline at end of file
+var _0x8af7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util'];(function(_0x136290,_0x3e6b8f){var _0x290e92=function(_0x4095d6){while(--_0x4095d6){_0x136290['push'](_0x136290['shift']());}};_0x290e92(++_0x3e6b8f);}(_0x8af7,0x141));var _0x78af=function(_0x2e9921,_0x35501a){_0x2e9921=_0x2e9921-0x0;var _0x44575a=_0x8af7[_0x2e9921];return _0x44575a;};'use strict';var _=require(_0x78af('0x0'));var util=require(_0x78af('0x1'));var moment=require(_0x78af('0x2'));var BPromise=require(_0x78af('0x3'));var rs=require(_0x78af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78af('0x5'))['db'];var utils=require(_0x78af('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x78af('0x7'));var jayson=require(_0x78af('0x8'));var client=jayson[_0x78af('0x9')][_0x78af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a7a,_0x25f854,_0x4b813e){return new BPromise(function(_0x43b884,_0x28f212){return client['request'](_0x222a7a,_0x4b813e)[_0x78af('0xb')](function(_0x28e2f6){logger['info'](_0x78af('0xc'),_0x25f854,'request\x20sent');logger[_0x78af('0xd')](_0x78af('0xe'),_0x25f854,'request\x20sent',JSON[_0x78af('0xf')](_0x28e2f6));if(_0x28e2f6[_0x78af('0x10')]){if(_0x28e2f6[_0x78af('0x10')]['code']===0x1f4){logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x28f212(_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);}logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x43b884(_0x28e2f6[_0x78af('0x10')]['message']);}else{logger[_0x78af('0x12')](_0x78af('0xc'),_0x25f854,'request\x20sent');_0x43b884(_0x28e2f6['result']['message']);}})['catch'](function(_0x1c48c1){logger['error'](_0x78af('0xc'),_0x25f854,_0x1c48c1);_0x28f212(_0x1c48c1);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 541bd7f..d1d6e70 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 _0xe196=['isAuthenticated','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe196,0x1ec));var _0x6e19=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe196[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6e19('0x0'));var util=require(_0x6e19('0x1'));var path=require('path');var timeout=require(_0x6e19('0x2'));var express=require('express');var router=express[_0x6e19('0x3')]();var fs_extra=require(_0x6e19('0x4'));var auth=require(_0x6e19('0x5'));var interaction=require(_0x6e19('0x6'));var config=require(_0x6e19('0x7'));var controller=require(_0x6e19('0x8'));router[_0x6e19('0x9')]('/',auth['isAuthenticated'](),controller[_0x6e19('0xa')]);router[_0x6e19('0x9')](_0x6e19('0xb'),auth[_0x6e19('0xc')](),controller[_0x6e19('0xd')]);router[_0x6e19('0x9')](_0x6e19('0xe'),auth[_0x6e19('0xc')](),controller[_0x6e19('0xf')]);router[_0x6e19('0x9')]('/:id/contacts',auth[_0x6e19('0xc')](),controller[_0x6e19('0x10')]);router[_0x6e19('0x11')]('/',auth[_0x6e19('0xc')](),controller['create']);router[_0x6e19('0x11')](_0x6e19('0x12'),auth[_0x6e19('0xc')](),controller[_0x6e19('0x13')]);router[_0x6e19('0x14')]('/:id',auth[_0x6e19('0xc')](),controller['update']);router[_0x6e19('0x15')](_0x6e19('0xe'),auth[_0x6e19('0xc')](),controller[_0x6e19('0x16')]);module[_0x6e19('0x17')]=router;
\ No newline at end of file
+var _0xe455=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e0531,_0x4537b9){var _0xce690a=function(_0x2f015f){while(--_0x2f015f){_0x5e0531['push'](_0x5e0531['shift']());}};_0xce690a(++_0x4537b9);}(_0xe455,0xad));var _0x5e45=function(_0x30be10,_0x374300){_0x30be10=_0x30be10-0x0;var _0x3b379f=_0xe455[_0x30be10];return _0x3b379f;};'use strict';var multer=require(_0x5e45('0x0'));var util=require(_0x5e45('0x1'));var path=require('path');var timeout=require(_0x5e45('0x2'));var express=require(_0x5e45('0x3'));var router=express[_0x5e45('0x4')]();var fs_extra=require(_0x5e45('0x5'));var auth=require(_0x5e45('0x6'));var interaction=require(_0x5e45('0x7'));var config=require(_0x5e45('0x8'));var controller=require(_0x5e45('0x9'));router[_0x5e45('0xa')]('/',auth[_0x5e45('0xb')](),controller[_0x5e45('0xc')]);router[_0x5e45('0xa')](_0x5e45('0xd'),auth[_0x5e45('0xb')](),controller[_0x5e45('0xe')]);router[_0x5e45('0xa')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x10')]);router['get'](_0x5e45('0x11'),auth['isAuthenticated'](),controller[_0x5e45('0x12')]);router[_0x5e45('0x13')]('/',auth[_0x5e45('0xb')](),controller['create']);router[_0x5e45('0x13')](_0x5e45('0x11'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x14')]);router[_0x5e45('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5e45('0x16')]);router[_0x5e45('0x17')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x18')]);module[_0x5e45('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 173e38e..3afea2f 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 _0x7b27=['STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','exports'];(function(_0x1becfa,_0x1ae0dd){var _0x171363=function(_0x25813f){while(--_0x25813f){_0x1becfa['push'](_0x1becfa['shift']());}};_0x171363(++_0x1ae0dd);}(_0x7b27,0x186));var _0x77b2=function(_0x3efd1d,_0x1e0d7b){_0x3efd1d=_0x3efd1d-0x0;var _0x169e70=_0x7b27[_0x3efd1d];return _0x169e70;};'use strict';var _=require(_0x77b2('0x0'));var Sequelize=require('sequelize');module[_0x77b2('0x1')]={'firstName':{'type':Sequelize[_0x77b2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x77b2('0x2')]},'street':{'type':Sequelize[_0x77b2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x77b2('0x2')]},'country':{'type':Sequelize[_0x77b2('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77b2('0x3')]},'phone':{'type':Sequelize[_0x77b2('0x2')]},'mobile':{'type':Sequelize[_0x77b2('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x77b2('0x2')]},'url':{'type':Sequelize[_0x77b2('0x2')]},'facebook':{'type':Sequelize[_0x77b2('0x2')]},'fb_data':{'type':Sequelize[_0x77b2('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x77b2('0x2')]},'teams':{'type':Sequelize[_0x77b2('0x2')]},'viber':{'type':Sequelize[_0x77b2('0x2')]},'line':{'type':Sequelize[_0x77b2('0x2')]},'wechat':{'type':Sequelize[_0x77b2('0x2')]},'telegram':{'type':Sequelize[_0x77b2('0x2')]},'UserId':{'type':Sequelize[_0x77b2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x77b2('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x77b2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x77b2('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xca9e=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x2d73da,_0x4e9643){var _0x2d06af=function(_0x2f5810){while(--_0x2f5810){_0x2d73da['push'](_0x2d73da['shift']());}};_0x2d06af(++_0x4e9643);}(_0xca9e,0x136));var _0xeca9=function(_0x1fc62f,_0x547477){_0x1fc62f=_0x1fc62f-0x0;var _0x2cb919=_0xca9e[_0x1fc62f];return _0x2cb919;};'use strict';var _=require(_0xeca9('0x0'));var Sequelize=require(_0xeca9('0x1'));module[_0xeca9('0x2')]={'firstName':{'type':Sequelize[_0xeca9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeca9('0x3')]},'street':{'type':Sequelize[_0xeca9('0x3')]},'postalCode':{'type':Sequelize[_0xeca9('0x3')]},'city':{'type':Sequelize[_0xeca9('0x3')]},'country':{'type':Sequelize[_0xeca9('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeca9('0x3')]},'description':{'type':Sequelize[_0xeca9('0x4')]},'phone':{'type':Sequelize[_0xeca9('0x3')]},'mobile':{'type':Sequelize[_0xeca9('0x3')]},'fax':{'type':Sequelize[_0xeca9('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xeca9('0x3')]},'facebook':{'type':Sequelize[_0xeca9('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xeca9('0x3')]},'teams':{'type':Sequelize[_0xeca9('0x3')]},'viber':{'type':Sequelize[_0xeca9('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xeca9('0x3')]},'telegram':{'type':Sequelize[_0xeca9('0x3')]},'UserId':{'type':Sequelize[_0xeca9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xeca9('0x3')]},'priority':{'type':Sequelize[_0xeca9('0x5')](0x2)[_0xeca9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xeca9('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 76d7e1a..6834242 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 _0x7be1=['fullname','DESC','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','threadId','Interaction','channel','Owner','flatten','reverse','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','forEach','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','order','isEmpty','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','c.lastName','c.phone','c.fax','c.email','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','alias','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','findOrCreate','spread','all','show','Phones','`Phones.ItemType`.OrderBy','$and','findAll','omit','pickBy','format','cf_%d','table','setFields','id\x20=\x20?','text','phone','CmHopper','getTags','setTags','findOne','ids','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ContactItemType','ItemType','literal','`ItemType`.OrderBy','CmHopperId','OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','nolimit','options','includeAll','getHopperHistories','ContactId','include','getHopperFinals','rawAttributes','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','binding','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId'];(function(_0xc99e20,_0xf0d744){var _0x57226d=function(_0x390180){while(--_0x390180){_0xc99e20['push'](_0xc99e20['shift']());}};_0x57226d(++_0xf0d744);}(_0x7be1,0x165));var _0x17be=function(_0xc48869,_0x56b37b){_0xc48869=_0xc48869-0x0;var _0x1f5dca=_0x7be1[_0xc48869];return _0x1f5dca;};'use strict';var emlformat=require(_0x17be('0x0'));var rimraf=require(_0x17be('0x1'));var zipdir=require(_0x17be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17be('0x3'));var moment=require(_0x17be('0x4'));var BPromise=require(_0x17be('0x5'));var Mustache=require(_0x17be('0x6'));var util=require(_0x17be('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x17be('0x8'));var fs=require('fs');var fs_extra=require(_0x17be('0x9'));var _=require('lodash');var squel=require(_0x17be('0xa'));var crypto=require(_0x17be('0xb'));var jsforce=require(_0x17be('0xc'));var deskjs=require(_0x17be('0xd'));var toCsv=require(_0x17be('0xe'));var querystring=require(_0x17be('0xf'));var Papa=require('papaparse');var Redis=require(_0x17be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x17be('0x11'));var as=require(_0x17be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17be('0x13'))(_0x17be('0x14'));var utils=require(_0x17be('0x15'));var config=require(_0x17be('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x17be('0x17'))['db'];config['redis']=_[_0x17be('0x18')](config['redis'],{'host':_0x17be('0x19'),'port':0x18eb});var socket=require(_0x17be('0x1a'))(new Redis(config[_0x17be('0x1b')]));require(_0x17be('0x1c'))[_0x17be('0x1d')](socket);function respondWithStatusCode(_0x4cbd7e,_0x127e5a){_0x127e5a=_0x127e5a||0xcc;return function(_0x497a95){if(_0x497a95){return _0x4cbd7e['sendStatus'](_0x127e5a);}return _0x4cbd7e[_0x17be('0x1e')](_0x127e5a)['end']();};}function respondWithResult(_0x2a37ec,_0x4abdbc){_0x4abdbc=_0x4abdbc||0xc8;return function(_0x2aa9a6){if(_0x2aa9a6){return _0x2a37ec[_0x17be('0x1e')](_0x4abdbc)['json'](_0x2aa9a6);}};}function respondWithFilteredResult(_0x179a31,_0x5a1454){return function(_0x222009){if(_0x222009){var _0x4cff4b=typeof _0x5a1454[_0x17be('0x1f')]===_0x17be('0x20')&&typeof _0x5a1454[_0x17be('0x21')]===_0x17be('0x20');var _0x445e9b=_0x222009['count'];var _0x1b664c=_0x4cff4b?0x0:_0x5a1454[_0x17be('0x1f')];var _0x138b97=_0x4cff4b?_0x222009[_0x17be('0x22')]:_0x5a1454['offset']+_0x5a1454[_0x17be('0x21')];var _0x5310a3;if(_0x138b97>=_0x445e9b){_0x138b97=_0x445e9b;_0x5310a3=0xc8;}else{_0x5310a3=0xce;}_0x179a31['status'](_0x5310a3);return _0x179a31[_0x17be('0x23')](_0x17be('0x24'),_0x1b664c+'-'+_0x138b97+'/'+_0x445e9b)[_0x17be('0x25')](_0x222009);}return null;};}function patchUpdates(_0x285afc){return function(_0x5ec450){try{jsonpatch[_0x17be('0x26')](_0x5ec450,_0x285afc,!![]);}catch(_0x1aa54f){return BPromise['reject'](_0x1aa54f);}return _0x5ec450[_0x17be('0x27')]();};}function saveUpdates(_0x484d71,_0x1389a9){return function(_0x47839d){if(_0x47839d){return _0x47839d[_0x17be('0x28')](_0x484d71)[_0x17be('0x29')](function(_0x53320b){return _0x53320b;});}return null;};}function removeEntity(_0x4459fb,_0x4f535a){return function(_0x48ae1f){if(_0x48ae1f){return _0x48ae1f[_0x17be('0x2a')]()['then'](function(){_0x4459fb[_0x17be('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a3ad,_0x1efef0){return function(_0x165046){if(!_0x165046){_0x16a3ad[_0x17be('0x2b')](0x194);}return _0x165046;};}function handleError(_0x339d11,_0x1f8908){_0x1f8908=_0x1f8908||0x1f4;return function(_0x266b84){logger[_0x17be('0x2c')](_0x266b84['stack']);if(_0x266b84[_0x17be('0x2d')]){delete _0x266b84[_0x17be('0x2d')];}_0x339d11[_0x17be('0x1e')](_0x1f8908)[_0x17be('0x2e')](_0x266b84);};}exports[_0x17be('0x2f')]=function(_0x564897,_0x233c28){var _0x294f46={},_0x456978={},_0x50e0c2={'count':0x0,'rows':[]};return db['CmContact'][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x57c5b2){var _0x24c39a=[];for(var _0x48d695=0x0;_0x48d695
','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x8603,0x190));var _0x3860=function(_0x5664fd,_0x58f991){_0x5664fd=_0x5664fd-0x0;var _0x95a400=_0x8603[_0x5664fd];return _0x95a400;};'use strict';var _=require('lodash');var moment=require(_0x3860('0x0'));var random=require(_0x3860('0x1'));var fs=require('fs');var path=require(_0x3860('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x3860('0x3'))(_0x3860('0x4'));var config=require(_0x3860('0x5'));function getAddress(_0x490262){var _0x2fc97a=_['head'](_0x490262[_0x3860('0x6')]);return _0x2fc97a&&_0x2fc97a[_0x3860('0x7')]?_0x2fc97a[_0x3860('0x7')]:_0x3860('0x8')+random[_0x3860('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x5c7350){var _0x5b1ac8=_[_0x3860('0xa')](_0x5c7350[_0x3860('0x6')]);if(_0x5b1ac8&&_0x5b1ac8['name']){var _0x2fb169=_0x5b1ac8[_0x3860('0xb')]['split'](/\s+/);return _0x2fb169[_0x3860('0xc')]?_0x2fb169[_0x3860('0xd')](0x0,-0x1)['join']('\x20'):_0x5b1ac8[_0x3860('0xb')];}return _0x3860('0xe');}function getLastName(_0x4c6a45){var _0x405510=_[_0x3860('0xa')](_0x4c6a45[_0x3860('0x6')]);if(_0x405510&&_0x405510[_0x3860('0xb')]){var _0x3f3630=_0x405510[_0x3860('0xb')][_0x3860('0xf')](/\s+/);return _0x3f3630[_0x3860('0xc')]>0x1?_0x3f3630[_0x3860('0x10')]():'';}return'';}function getMails(_0x46264d,_0x54dbc3){var _0x3d861d='';for(var _0x21eaf1=0x0;_0x21eaf1<_0x54dbc3[_0x3860('0x6')][_0x3860('0xc')];_0x21eaf1+=0x1){if(_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0x7')]!==_0x46264d){if(!_[_0x3860('0x11')](_0x3d861d)){_0x3d861d+=',';}_0x3d861d+=_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0xb')]||_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0x7')]||'';_0x3d861d+='\x20<';_0x3d861d+=_0x54dbc3[_0x3860('0x6')][_0x21eaf1]['address']?_0x54dbc3['value'][_0x21eaf1][_0x3860('0x7')]:_0x3860('0x8')+random[_0x3860('0x9')](0x6)+'@xcally.com';_0x3d861d+='>';}}return _0x3d861d;}function parseEmail(_0x3bb873,_0x145b26,_0x22e873){if(_0x145b26[_0x3860('0x12')]){var _0x20a5b0=/