From: Andrea Bianco
Date: Thu, 7 Oct 2021 14:16:02 +0000 (+0200)
Subject: Built motion from commit f3da74b7.|2.5.36
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=c27d3a0c42cfaa97e6fbb1044fb5614c78d58a58;p=motion2.git
Built motion from commit f3da74b7.|2.5.36
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 2d0415d..bacf515 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-10-07T13:39:13.056Z",
+ "time": "2021-10-07T14:09:33.697Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0f90386..50b1857 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-07T13:39:13.056Z",
+ "time": "2021-10-07T14:09:33.697Z",
"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 8143684..9a8b957 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 _0x4bf6=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize','VIRTUAL','action','STRING','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x213213,_0x337d60){var _0x204b9b=function(_0x1912c4){while(--_0x1912c4){_0x213213['push'](_0x213213['shift']());}};_0x204b9b(++_0x337d60);}(_0x4bf6,0x1e5));var _0x64bf=function(_0x538be4,_0x2fd1b3){_0x538be4=_0x538be4-0x0;var _0x3fa1ec=_0x4bf6[_0x538be4];return _0x3fa1ec;};'use strict';var Sequelize=require(_0x64bf('0x0'));module['exports']={'name':{'type':Sequelize[_0x64bf('0x1')],'get':function(_0x3e6a5f){return this['getDataValue'](_0x64bf('0x2'));}},'action':{'type':Sequelize[_0x64bf('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x64bf('0x4'),'motionbar',_0x64bf('0x5'),_0x64bf('0x6'),_0x64bf('0x7'),_0x64bf('0x8'),_0x64bf('0x9')]],'msg':_0x64bf('0xa')}},'comment':_0x64bf('0xa')},'data1':{'type':Sequelize[_0x64bf('0x3')](0x1000),'comment':_0x64bf('0xb')},'data2':{'type':Sequelize[_0x64bf('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x64bf('0x3')](0x1000),'comment':_0x64bf('0xc')},'data4':{'type':Sequelize[_0x64bf('0x3')](0x1000),'comments':_0x64bf('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x64bf('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x64bf('0xe')],'comments':_0x64bf('0xf')}};
\ No newline at end of file
+var _0x86d2=['STRING','integration','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue'];(function(_0x37d79b,_0x189596){var _0x387f50=function(_0x3eba8d){while(--_0x3eba8d){_0x37d79b['push'](_0x37d79b['shift']());}};_0x387f50(++_0x189596);}(_0x86d2,0x15d));var _0x286d=function(_0x4c18c9,_0x27a9f0){_0x4c18c9=_0x4c18c9-0x0;var _0x9bdb1c=_0x86d2[_0x4c18c9];return _0x9bdb1c;};'use strict';var Sequelize=require('sequelize');module[_0x286d('0x0')]={'name':{'type':Sequelize[_0x286d('0x1')],'get':function(_0x49f3cf){return this[_0x286d('0x2')]('action');}},'action':{'type':Sequelize[_0x286d('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x286d('0x4'),'motionbar',_0x286d('0x5'),'urlForward','browser',_0x286d('0x6'),_0x286d('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x286d('0x8')},'data1':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0x9')},'data2':{'type':Sequelize[_0x286d('0x3')](0x1000),'comment':_0x286d('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x286d('0xb')},'data4':{'type':Sequelize[_0x286d('0x3')](0x1000),'comments':_0x286d('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x286d('0x3')],'comments':_0x286d('0xd')},'data7':{'type':Sequelize[_0x286d('0xe')],'comments':_0x286d('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 7193b00..72cf740 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 _0x601e=['Content-Range','apply','save','then','destroy','error','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x601e,0x1da));var _0xe601=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x601e[_0x590b63];return _0x3c9380;};'use strict';var emlformat=require(_0xe601('0x0'));var rimraf=require(_0xe601('0x1'));var zipdir=require(_0xe601('0x2'));var jsonpatch=require(_0xe601('0x3'));var rp=require('request-promise');var moment=require(_0xe601('0x4'));var BPromise=require(_0xe601('0x5'));var Mustache=require('mustache');var util=require(_0xe601('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe601('0x7'));var ejs=require(_0xe601('0x8'));var fs=require('fs');var fs_extra=require(_0xe601('0x9'));var _=require(_0xe601('0xa'));var squel=require(_0xe601('0xb'));var crypto=require(_0xe601('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe601('0xd'));var toCsv=require(_0xe601('0x7'));var querystring=require(_0xe601('0xe'));var Papa=require(_0xe601('0xf'));var Redis=require(_0xe601('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe601('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe601('0x12'));var logger=require('../../config/logger')(_0xe601('0x13'));var utils=require(_0xe601('0x14'));var config=require(_0xe601('0x15'));var licenseUtil=require(_0xe601('0x16'));var db=require(_0xe601('0x17'))['db'];function respondWithStatusCode(_0x1d66a9,_0x1b44d1){_0x1b44d1=_0x1b44d1||0xcc;return function(_0x2002d2){if(_0x2002d2){return _0x1d66a9[_0xe601('0x18')](_0x1b44d1);}return _0x1d66a9['status'](_0x1b44d1)[_0xe601('0x19')]();};}function respondWithResult(_0x347f83,_0x34c3f1){_0x34c3f1=_0x34c3f1||0xc8;return function(_0xdfb59f){if(_0xdfb59f){return _0x347f83[_0xe601('0x1a')](_0x34c3f1)[_0xe601('0x1b')](_0xdfb59f);}};}function respondWithFilteredResult(_0x3e5c62,_0x53a79a){return function(_0x2fa510){if(_0x2fa510){var _0x3d5f91=typeof _0x53a79a['offset']==='undefined'&&typeof _0x53a79a[_0xe601('0x1c')]===_0xe601('0x1d');var _0x5c02d3=_0x2fa510[_0xe601('0x1e')];var _0x2667d7=_0x3d5f91?0x0:_0x53a79a[_0xe601('0x1f')];var _0x3df80b=_0x3d5f91?_0x2fa510[_0xe601('0x1e')]:_0x53a79a['offset']+_0x53a79a[_0xe601('0x1c')];var _0x469176;if(_0x3df80b>=_0x5c02d3){_0x3df80b=_0x5c02d3;_0x469176=0xc8;}else{_0x469176=0xce;}_0x3e5c62[_0xe601('0x1a')](_0x469176);return _0x3e5c62['set'](_0xe601('0x20'),_0x2667d7+'-'+_0x3df80b+'/'+_0x5c02d3)[_0xe601('0x1b')](_0x2fa510);}return null;};}function patchUpdates(_0x262ad5){return function(_0x541241){try{jsonpatch[_0xe601('0x21')](_0x541241,_0x262ad5,!![]);}catch(_0x3ed9e6){return BPromise['reject'](_0x3ed9e6);}return _0x541241[_0xe601('0x22')]();};}function saveUpdates(_0x413bb5,_0x31e7d4){return function(_0x415dfd){if(_0x415dfd){return _0x415dfd['update'](_0x413bb5)[_0xe601('0x23')](function(_0x45508d){return _0x45508d;});}return null;};}function removeEntity(_0x55b401,_0x22507b){return function(_0x4c8629){if(_0x4c8629){return _0x4c8629[_0xe601('0x24')]()['then'](function(){_0x55b401[_0xe601('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466d42,_0x1f09f2){return function(_0x5ef6ae){if(!_0x5ef6ae){_0x466d42[_0xe601('0x18')](0x194);}return _0x5ef6ae;};}function handleError(_0x407c35,_0xb5420a){_0xb5420a=_0xb5420a||0x1f4;return function(_0x374e27){logger[_0xe601('0x25')](_0x374e27['stack']);if(_0x374e27[_0xe601('0x26')]){delete _0x374e27[_0xe601('0x26')];}_0x407c35[_0xe601('0x1a')](_0xb5420a)[_0xe601('0x27')](_0x374e27);};}exports[_0xe601('0x28')]=function(_0x2e9c61,_0x54c10a){if(_0x2e9c61[_0xe601('0x29')]['id']){delete _0x2e9c61[_0xe601('0x29')]['id'];}return db[_0xe601('0x2a')][_0xe601('0x2b')]({'where':{'id':_0x2e9c61[_0xe601('0x2c')]['id']}})[_0xe601('0x23')](handleEntityNotFound(_0x54c10a,null))[_0xe601('0x23')](saveUpdates(_0x2e9c61[_0xe601('0x29')],null))[_0xe601('0x23')](respondWithResult(_0x54c10a,null))[_0xe601('0x2d')](handleError(_0x54c10a,null));};exports[_0xe601('0x24')]=function(_0x4145f8,_0x548873){return db[_0xe601('0x2a')][_0xe601('0x2b')]({'where':{'id':_0x4145f8[_0xe601('0x2c')]['id']}})[_0xe601('0x23')](handleEntityNotFound(_0x548873,null))[_0xe601('0x23')](removeEntity(_0x548873,null))[_0xe601('0x2d')](handleError(_0x548873,null));};
\ No newline at end of file
+var _0x81d4=['util','path','sox','ejs','lodash','squel','crypto','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','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x32bdea,_0x5d16ae){var _0x41843a=function(_0x51334c){while(--_0x51334c){_0x32bdea['push'](_0x32bdea['shift']());}};_0x41843a(++_0x5d16ae);}(_0x81d4,0xba));var _0x481d=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x81d4[_0x371b64];return _0x3cf3b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x481d('0x0'));var zipdir=require(_0x481d('0x1'));var jsonpatch=require(_0x481d('0x2'));var rp=require(_0x481d('0x3'));var moment=require('moment');var BPromise=require(_0x481d('0x4'));var Mustache=require(_0x481d('0x5'));var util=require(_0x481d('0x6'));var path=require(_0x481d('0x7'));var sox=require(_0x481d('0x8'));var csv=require('to-csv');var ejs=require(_0x481d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x481d('0xa'));var squel=require(_0x481d('0xb'));var crypto=require(_0x481d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x481d('0xd'));var toCsv=require(_0x481d('0xe'));var querystring=require('querystring');var Papa=require(_0x481d('0xf'));var Redis=require('ioredis');var authService=require(_0x481d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x481d('0x11'));var hardwareService=require(_0x481d('0x12'));var logger=require(_0x481d('0x13'))(_0x481d('0x14'));var utils=require(_0x481d('0x15'));var config=require(_0x481d('0x16'));var licenseUtil=require(_0x481d('0x17'));var db=require(_0x481d('0x18'))['db'];function respondWithStatusCode(_0x543d5b,_0x291b91){_0x291b91=_0x291b91||0xcc;return function(_0x47f060){if(_0x47f060){return _0x543d5b[_0x481d('0x19')](_0x291b91);}return _0x543d5b[_0x481d('0x1a')](_0x291b91)[_0x481d('0x1b')]();};}function respondWithResult(_0x4c3eb1,_0x17f9e7){_0x17f9e7=_0x17f9e7||0xc8;return function(_0x54acb9){if(_0x54acb9){return _0x4c3eb1[_0x481d('0x1a')](_0x17f9e7)[_0x481d('0x1c')](_0x54acb9);}};}function respondWithFilteredResult(_0x3dd471,_0x1d879a){return function(_0x102446){if(_0x102446){var _0x59236f=typeof _0x1d879a[_0x481d('0x1d')]===_0x481d('0x1e')&&typeof _0x1d879a[_0x481d('0x1f')]===_0x481d('0x1e');var _0x5de9ed=_0x102446[_0x481d('0x20')];var _0x355518=_0x59236f?0x0:_0x1d879a['offset'];var _0x5f2739=_0x59236f?_0x102446['count']:_0x1d879a[_0x481d('0x1d')]+_0x1d879a[_0x481d('0x1f')];var _0x3b2540;if(_0x5f2739>=_0x5de9ed){_0x5f2739=_0x5de9ed;_0x3b2540=0xc8;}else{_0x3b2540=0xce;}_0x3dd471[_0x481d('0x1a')](_0x3b2540);return _0x3dd471['set'](_0x481d('0x21'),_0x355518+'-'+_0x5f2739+'/'+_0x5de9ed)[_0x481d('0x1c')](_0x102446);}return null;};}function patchUpdates(_0x421b2a){return function(_0x291d1e){try{jsonpatch[_0x481d('0x22')](_0x291d1e,_0x421b2a,!![]);}catch(_0x54abb8){return BPromise[_0x481d('0x23')](_0x54abb8);}return _0x291d1e[_0x481d('0x24')]();};}function saveUpdates(_0x11fb9b,_0x192329){return function(_0x11a52e){if(_0x11a52e){return _0x11a52e[_0x481d('0x25')](_0x11fb9b)['then'](function(_0x1e346a){return _0x1e346a;});}return null;};}function removeEntity(_0x23583f,_0x5ddcc8){return function(_0x2d77ba){if(_0x2d77ba){return _0x2d77ba['destroy']()[_0x481d('0x26')](function(){_0x23583f[_0x481d('0x1a')](0xcc)[_0x481d('0x1b')]();});}};}function handleEntityNotFound(_0x359bfb,_0x2b3056){return function(_0x5c9dbf){if(!_0x5c9dbf){_0x359bfb[_0x481d('0x19')](0x194);}return _0x5c9dbf;};}function handleError(_0x1825b8,_0x5b856b){_0x5b856b=_0x5b856b||0x1f4;return function(_0x360849){logger[_0x481d('0x27')](_0x360849[_0x481d('0x28')]);if(_0x360849[_0x481d('0x29')]){delete _0x360849['name'];}_0x1825b8['status'](_0x5b856b)[_0x481d('0x2a')](_0x360849);};}exports[_0x481d('0x25')]=function(_0x5efa3c,_0x1bdab8){if(_0x5efa3c[_0x481d('0x2b')]['id']){delete _0x5efa3c['body']['id'];}return db[_0x481d('0x2c')][_0x481d('0x2d')]({'where':{'id':_0x5efa3c[_0x481d('0x2e')]['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1bdab8,null))[_0x481d('0x26')](saveUpdates(_0x5efa3c[_0x481d('0x2b')],null))[_0x481d('0x26')](respondWithResult(_0x1bdab8,null))[_0x481d('0x2f')](handleError(_0x1bdab8,null));};exports['destroy']=function(_0x4fc4e0,_0x1b5d42){return db['Action']['find']({'where':{'id':_0x4fc4e0['params']['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x1b5d42,null))[_0x481d('0x26')](removeEntity(_0x1b5d42,null))[_0x481d('0x2f')](handleError(_0x1b5d42,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d5d3864..49d91f0 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 _0x2dd3=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x384d9c,_0x590275){var _0x4d32da=function(_0x5dab02){while(--_0x5dab02){_0x384d9c['push'](_0x384d9c['shift']());}};_0x4d32da(++_0x590275);}(_0x2dd3,0x99));var _0x32dd=function(_0x447aa2,_0x103d7b){_0x447aa2=_0x447aa2-0x0;var _0x456bb2=_0x2dd3[_0x447aa2];return _0x456bb2;};'use strict';var _=require(_0x32dd('0x0'));var util=require(_0x32dd('0x1'));var logger=require(_0x32dd('0x2'))(_0x32dd('0x3'));var moment=require(_0x32dd('0x4'));var BPromise=require(_0x32dd('0x5'));var rp=require(_0x32dd('0x6'));var fs=require('fs');var path=require(_0x32dd('0x7'));var rimraf=require(_0x32dd('0x8'));var config=require(_0x32dd('0x9'));var attributes=require(_0x32dd('0xa'));module[_0x32dd('0xb')]=function(_0x5ecea6,_0x142edc){return _0x5ecea6[_0x32dd('0xc')](_0x32dd('0xd'),attributes,{'tableName':_0x32dd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2eab=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define'];(function(_0x1213bd,_0x71a10f){var _0x3471d1=function(_0x381d8a){while(--_0x381d8a){_0x1213bd['push'](_0x1213bd['shift']());}};_0x3471d1(++_0x71a10f);}(_0x2eab,0x8d));var _0xb2ea=function(_0x574007,_0x58a36d){_0x574007=_0x574007-0x0;var _0x22be55=_0x2eab[_0x574007];return _0x22be55;};'use strict';var _=require(_0xb2ea('0x0'));var util=require(_0xb2ea('0x1'));var logger=require(_0xb2ea('0x2'))(_0xb2ea('0x3'));var moment=require(_0xb2ea('0x4'));var BPromise=require(_0xb2ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ea('0x6'));var rimraf=require('rimraf');var config=require(_0xb2ea('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x117496,_0x3a6c1e){return _0x117496[_0xb2ea('0x8')]('Action',attributes,{'tableName':_0xb2ea('0x9'),'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 743d61f..3b8e7b4 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x53ec,0x192));var _0xc53e=function(_0x2100d6,_0x55362c){_0x2100d6=_0x2100d6-0x0;var _0x298ddd=_0x53ec[_0x2100d6];return _0x298ddd;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4975,0x86));var _0x5497=function(_0xd47394,_0x42c0d2){_0xd47394=_0xd47394-0x0;var _0x198ac5=_0x4975[_0xd47394];return _0x198ac5;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 04dadbc..22268f9 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 _0x063b=['../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x063b,0x94));var _0xb063=function(_0x490bd6,_0x24bf24){_0x490bd6=_0x490bd6-0x0;var _0x10eddd=_0x063b[_0x490bd6];return _0x10eddd;};'use strict';var multer=require(_0xb063('0x0'));var util=require('util');var path=require(_0xb063('0x1'));var timeout=require(_0xb063('0x2'));var express=require(_0xb063('0x3'));var router=express[_0xb063('0x4')]();var fs_extra=require(_0xb063('0x5'));var auth=require(_0xb063('0x6'));var interaction=require(_0xb063('0x7'));var config=require('../../config/environment');var controller=require(_0xb063('0x8'));router[_0xb063('0x9')](_0xb063('0xa'),auth['isAuthenticated'](),controller[_0xb063('0xb')]);router[_0xb063('0xc')](_0xb063('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb063('0xd')]=router;
\ No newline at end of file
+var _0xd6c5=['put','/:id','delete','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xe13c51,_0x1d5358){var _0x23c04d=function(_0xfc418a){while(--_0xfc418a){_0xe13c51['push'](_0xe13c51['shift']());}};_0x23c04d(++_0x1d5358);}(_0xd6c5,0x9f));var _0x5d6c=function(_0x21a09f,_0x3fce61){_0x21a09f=_0x21a09f-0x0;var _0x3fef3f=_0xd6c5[_0x21a09f];return _0x3fef3f;};'use strict';var multer=require(_0x5d6c('0x0'));var util=require(_0x5d6c('0x1'));var path=require('path');var timeout=require(_0x5d6c('0x2'));var express=require('express');var router=express[_0x5d6c('0x3')]();var fs_extra=require(_0x5d6c('0x4'));var auth=require(_0x5d6c('0x5'));var interaction=require(_0x5d6c('0x6'));var config=require(_0x5d6c('0x7'));var controller=require(_0x5d6c('0x8'));router[_0x5d6c('0x9')](_0x5d6c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5d6c('0xb')](_0x5d6c('0xa'),auth[_0x5d6c('0xc')](),controller['destroy']);module[_0x5d6c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 248c11b..d6e5a02 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x547ed1,_0x35b297){_0x547ed1=_0x547ed1-0x0;var _0x505896=_0xdc97[_0x547ed1];return _0x505896;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x30861a,_0x337deb){var _0xa37ad6=function(_0x4dad90){while(--_0x4dad90){_0x30861a['push'](_0x30861a['shift']());}};_0xa37ad6(++_0x337deb);}(_0xf494,0x1c6));var _0x4f49=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0xf494[_0x1aec02];return _0x10a837;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 0311ca9..5fe14eb 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 _0x1753=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','sequelize','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','fields','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','foreignTable','foreignKey','conditions','group','Limited\x20Query:','toString','QueryTypes','SELECT','SUM(%s)','MAX(%s)','IS\x20NULL','keyBy','metric','order','parentKey','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom'];(function(_0x52a505,_0x5dec98){var _0x1fc95e=function(_0xdc7744){while(--_0xdc7744){_0x52a505['push'](_0x52a505['shift']());}};_0x1fc95e(++_0x5dec98);}(_0x1753,0xb3));var _0x3175=function(_0x4fa46f,_0x5608a3){_0x4fa46f=_0x4fa46f-0x0;var _0x541e74=_0x1753[_0x4fa46f];return _0x541e74;};'use strict';var emlformat=require(_0x3175('0x0'));var rimraf=require(_0x3175('0x1'));var zipdir=require(_0x3175('0x2'));var jsonpatch=require(_0x3175('0x3'));var rp=require(_0x3175('0x4'));var moment=require(_0x3175('0x5'));var BPromise=require(_0x3175('0x6'));var Mustache=require('mustache');var util=require(_0x3175('0x7'));var path=require('path');var sox=require(_0x3175('0x8'));var csv=require(_0x3175('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3175('0xa'));var _=require(_0x3175('0xb'));var squel=require(_0x3175('0xc'));var crypto=require(_0x3175('0xd'));var jsforce=require(_0x3175('0xe'));var deskjs=require(_0x3175('0xf'));var toCsv=require(_0x3175('0x9'));var querystring=require(_0x3175('0x10'));var Papa=require('papaparse');var Redis=require(_0x3175('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3175('0x12'));var as=require(_0x3175('0x13'));var hardwareService=require(_0x3175('0x14'));var logger=require(_0x3175('0x15'))(_0x3175('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3175('0x17'));var db=require(_0x3175('0x18'))['db'];var dbH=require(_0x3175('0x18'))['dbH'];function respondWithStatusCode(_0x4f3f64,_0x41526a){_0x41526a=_0x41526a||0xcc;return function(_0x1f64f4){if(_0x1f64f4){return _0x4f3f64[_0x3175('0x19')](_0x41526a);}return _0x4f3f64['status'](_0x41526a)[_0x3175('0x1a')]();};}function respondWithResult(_0x43b6de,_0x1ee7b1){_0x1ee7b1=_0x1ee7b1||0xc8;return function(_0x1dd2d3){if(_0x1dd2d3){return _0x43b6de[_0x3175('0x1b')](_0x1ee7b1)[_0x3175('0x1c')](_0x1dd2d3);}};}function respondWithFilteredResult(_0x55d0c9,_0x2b388b){return function(_0x4b117b){if(_0x4b117b){var _0x3a9d78=typeof _0x2b388b['offset']===_0x3175('0x1d')&&typeof _0x2b388b[_0x3175('0x1e')]==='undefined';var _0x173889=_0x4b117b[_0x3175('0x1f')];var _0x5033c9=_0x3a9d78?0x0:_0x2b388b[_0x3175('0x20')];var _0x94fd2f=_0x3a9d78?_0x4b117b[_0x3175('0x1f')]:_0x2b388b['offset']+_0x2b388b[_0x3175('0x1e')];var _0x431e57;if(_0x94fd2f>=_0x173889){_0x94fd2f=_0x173889;_0x431e57=0xc8;}else{_0x431e57=0xce;}_0x55d0c9[_0x3175('0x1b')](_0x431e57);return _0x55d0c9['set'](_0x3175('0x21'),_0x5033c9+'-'+_0x94fd2f+'/'+_0x173889)[_0x3175('0x1c')](_0x4b117b);}return null;};}function patchUpdates(_0x5e6f62){return function(_0x5995d3){try{jsonpatch['apply'](_0x5995d3,_0x5e6f62,!![]);}catch(_0x473bb8){return BPromise['reject'](_0x473bb8);}return _0x5995d3[_0x3175('0x22')]();};}function saveUpdates(_0x19ecf0,_0x343346){return function(_0x3d4889){if(_0x3d4889){return _0x3d4889[_0x3175('0x23')](_0x19ecf0)['then'](function(_0xc6d271){return _0xc6d271;});}return null;};}function removeEntity(_0x3bef31,_0x57324b){return function(_0x10e567){if(_0x10e567){return _0x10e567[_0x3175('0x24')]()[_0x3175('0x25')](function(){var _0x33b9ac=_0x10e567[_0x3175('0x26')]({'plain':!![]});var _0x8fae72=_0x3175('0x27');return db[_0x3175('0x28')][_0x3175('0x24')]({'where':{'type':_0x8fae72,'resourceId':_0x33b9ac['id']}})[_0x3175('0x25')](function(){return _0x10e567;});})[_0x3175('0x25')](function(){_0x3bef31[_0x3175('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b62f7,_0x59c169){return function(_0x1c6e6b){if(!_0x1c6e6b){_0x5b62f7['sendStatus'](0x194);}return _0x1c6e6b;};}function handleError(_0x235dba,_0x14f298){_0x14f298=_0x14f298||0x1f4;return function(_0x11ea53){logger[_0x3175('0x29')](_0x11ea53[_0x3175('0x2a')]);if(_0x11ea53[_0x3175('0x2b')]){delete _0x11ea53[_0x3175('0x2b')];}_0x235dba[_0x3175('0x1b')](_0x14f298)[_0x3175('0x2c')](_0x11ea53);};}exports[_0x3175('0x2d')]=function(_0x25e5f9,_0x5471b6){var _0x4c8317={},_0x5a52f9={},_0x37bbd5={'count':0x0,'rows':[]};var _0x5932f7=_[_0x3175('0x2e')](db[_0x3175('0x2f')][_0x3175('0x30')],function(_0x513fa6){return{'name':_0x513fa6[_0x3175('0x31')],'type':_0x513fa6[_0x3175('0x32')]['key']};});_0x5a52f9[_0x3175('0x33')]=_['map'](_0x5932f7,_0x3175('0x2b'));_0x5a52f9[_0x3175('0x34')]=_[_0x3175('0x35')](_0x25e5f9[_0x3175('0x34')]);_0x5a52f9['filters']=_['intersection'](_0x5a52f9[_0x3175('0x33')],_0x5a52f9['query']);_0x4c8317[_0x3175('0x36')]=_[_0x3175('0x37')](_0x5a52f9[_0x3175('0x33')],qs['fields'](_0x25e5f9['query']['fields']));_0x4c8317[_0x3175('0x36')]=_0x4c8317[_0x3175('0x36')]['length']?_0x4c8317['attributes']:_0x5a52f9[_0x3175('0x33')];if(!_0x25e5f9['query'][_0x3175('0x38')](_0x3175('0x39'))){_0x4c8317[_0x3175('0x1e')]=qs[_0x3175('0x1e')](_0x25e5f9[_0x3175('0x34')][_0x3175('0x1e')]);_0x4c8317[_0x3175('0x20')]=qs[_0x3175('0x20')](_0x25e5f9['query'][_0x3175('0x20')]);}_0x4c8317['order']=qs[_0x3175('0x3a')](_0x25e5f9['query'][_0x3175('0x3a')]);_0x4c8317['where']=qs[_0x3175('0x3b')](_[_0x3175('0x3c')](_0x25e5f9[_0x3175('0x34')],_0x5a52f9[_0x3175('0x3b')]),_0x5932f7);if(_0x25e5f9['query'][_0x3175('0x3d')]){_0x4c8317[_0x3175('0x3e')]=_[_0x3175('0x3f')](_0x4c8317['where'],{'$or':_[_0x3175('0x2e')](_0x5932f7,function(_0x352749){if(_0x352749[_0x3175('0x32')]!==_0x3175('0x40')){var _0x54399e={};_0x54399e[_0x352749[_0x3175('0x2b')]]={'$like':'%'+_0x25e5f9[_0x3175('0x34')][_0x3175('0x3d')]+'%'};return _0x54399e;}})});}_0x4c8317=_[_0x3175('0x3f')]({},_0x4c8317,_0x25e5f9['options']);var _0x4f38a5={'where':_0x4c8317[_0x3175('0x3e')]};return db[_0x3175('0x2f')]['count'](_0x4f38a5)[_0x3175('0x25')](function(_0x1a08c1){_0x37bbd5[_0x3175('0x1f')]=_0x1a08c1;if(_0x25e5f9[_0x3175('0x34')]['includeAll']){_0x4c8317[_0x3175('0x41')]=[{'all':!![]}];}return db[_0x3175('0x2f')]['findAll'](_0x4c8317);})[_0x3175('0x25')](function(_0x42758c){_0x37bbd5[_0x3175('0x42')]=_0x42758c;return _0x37bbd5;})[_0x3175('0x25')](respondWithFilteredResult(_0x5471b6,_0x4c8317))[_0x3175('0x43')](handleError(_0x5471b6,null));};exports[_0x3175('0x44')]=function(_0x26a780,_0x26496c){var _0x39663a={'raw':![],'where':{'id':_0x26a780[_0x3175('0x45')]['id']}},_0x4ac1f4={};_0x4ac1f4[_0x3175('0x33')]=_[_0x3175('0x35')](db[_0x3175('0x2f')][_0x3175('0x30')]);_0x4ac1f4[_0x3175('0x34')]=_[_0x3175('0x35')](_0x26a780[_0x3175('0x34')]);_0x4ac1f4[_0x3175('0x3b')]=_[_0x3175('0x37')](_0x4ac1f4['model'],_0x4ac1f4[_0x3175('0x34')]);_0x39663a[_0x3175('0x36')]=_[_0x3175('0x37')](_0x4ac1f4[_0x3175('0x33')],qs[_0x3175('0x46')](_0x26a780[_0x3175('0x34')][_0x3175('0x46')]));_0x39663a[_0x3175('0x36')]=_0x39663a['attributes'][_0x3175('0x47')]?_0x39663a['attributes']:_0x4ac1f4[_0x3175('0x33')];if(_0x26a780['query'][_0x3175('0x48')]){_0x39663a[_0x3175('0x41')]=[{'all':!![]}];}_0x39663a=_['merge']({},_0x39663a,_0x26a780['options']);return db[_0x3175('0x2f')][_0x3175('0x49')](_0x39663a)['then'](handleEntityNotFound(_0x26496c,null))[_0x3175('0x25')](respondWithResult(_0x26496c,null))[_0x3175('0x43')](handleError(_0x26496c,null));};exports[_0x3175('0x4a')]=function(_0x476955,_0x366db2){return db[_0x3175('0x2f')][_0x3175('0x4a')](_0x476955[_0x3175('0x4b')],{})[_0x3175('0x25')](function(_0x435981){var _0x416b73=_0x476955[_0x3175('0x4c')][_0x3175('0x26')]({'plain':!![]});if(!_0x416b73)throw new Error(_0x3175('0x4d'));if(_0x416b73[_0x3175('0x4e')]===_0x3175('0x4c')){var _0x639850=_0x435981[_0x3175('0x26')]({'plain':!![]});var _0xc7cd='Reports';return db[_0x3175('0x4f')][_0x3175('0x49')]({'where':{'name':_0xc7cd,'userProfileId':_0x416b73[_0x3175('0x50')]},'raw':!![]})[_0x3175('0x25')](function(_0x2c0ebc){if(_0x2c0ebc&&_0x2c0ebc[_0x3175('0x51')]===0x0){return db[_0x3175('0x28')][_0x3175('0x4a')]({'name':_0x639850['name'],'resourceId':_0x639850['id'],'type':_0x3175('0x27'),'sectionId':_0x2c0ebc['id']},{})[_0x3175('0x25')](function(){return _0x435981;});}else{return _0x435981;}})[_0x3175('0x43')](function(_0x34429d){logger[_0x3175('0x29')](_0x3175('0x52'),_0x34429d);throw _0x34429d;});}return _0x435981;})[_0x3175('0x25')](respondWithResult(_0x366db2,0xc9))[_0x3175('0x43')](handleError(_0x366db2,null));};exports[_0x3175('0x23')]=function(_0x190ff9,_0x475a42){if(_0x190ff9['body']['id']){delete _0x190ff9[_0x3175('0x4b')]['id'];}return db['AnalyticCustomReport'][_0x3175('0x49')]({'where':{'id':_0x190ff9['params']['id']}})[_0x3175('0x25')](handleEntityNotFound(_0x475a42,null))[_0x3175('0x25')](saveUpdates(_0x190ff9[_0x3175('0x4b')],null))[_0x3175('0x25')](respondWithResult(_0x475a42,null))['catch'](handleError(_0x475a42,null));};exports[_0x3175('0x24')]=function(_0x3572a3,_0x243b7f){return db[_0x3175('0x2f')][_0x3175('0x49')]({'where':{'id':_0x3572a3[_0x3175('0x45')]['id']}})[_0x3175('0x25')](handleEntityNotFound(_0x243b7f,null))[_0x3175('0x25')](removeEntity(_0x243b7f,null))[_0x3175('0x43')](handleError(_0x243b7f,null));};exports[_0x3175('0x53')]=function(_0x4b072c,_0x5295c4){var _0x322abf=0xa;var _0x45a022=[_0x3175('0x54'),_0x3175('0x55'),_0x3175('0x56'),_0x3175('0x57')];var _0x4e537d={'SUM':'SUM(%s)','COUNT':_0x3175('0x58'),'COUNT DISTINCT':_0x3175('0x59'),'MAX':'MAX(%s)','MIN':_0x3175('0x5a'),'AVG':_0x3175('0x5b'),'GROUP_CONCAT':_0x3175('0x5c'),'GROUP_CONCAT ASC':_0x3175('0x5d'),'GROUP_CONCAT DESC':_0x3175('0x5e')};var _0x55931d={'SEC_TO_TIME':_0x3175('0x5f'),'DATE':_0x3175('0x60'),'HOUR':_0x3175('0x61'),'ROUND':_0x3175('0x62'),'UNIX_TIMESTAMP':_0x3175('0x63')};var _0x4c6137=function(_0x201e4d){return!_['includes'](['IS\x20NULL',_0x3175('0x64'),_0x3175('0x65'),_0x3175('0x66')],_0x201e4d);};var _0x3d56f8=function(_0x51c211){if(!_0x51c211||!_0x51c211['rules'][_0x3175('0x47')]){return'';}for(var _0x6eee88='(',_0x339411=0x0;_0x339411<_0x51c211[_0x3175('0x67')][_0x3175('0x47')];_0x339411+=0x1){_0x339411>0x0&&(_0x6eee88+='\x20'+_0x51c211[_0x3175('0x68')]+'\x20');_0x6eee88+=_0x51c211[_0x3175('0x67')][_0x339411]['group']?_0x3d56f8(_0x51c211[_0x3175('0x67')][_0x339411]['group']):_0x51c211[_0x3175('0x67')][_0x339411][_0x3175('0x69')]+'\x20'+_0x51c211['rules'][_0x339411][_0x3175('0x6a')]+(_0x4c6137(_0x51c211['rules'][_0x339411][_0x3175('0x6a')])?'\x20'+_0x51c211[_0x3175('0x67')][_0x339411][_0x3175('0x6b')]:'');}return _0x6eee88+')';};var _0x3c7b70={'where':{'id':_0x4b072c[_0x3175('0x45')]['id']}},_0x4cd059,_0x58a7f3,_0x27d5a1,_0x51a74d,_0x15923f;_0x3c7b70=_[_0x3175('0x3f')]({},_0x3c7b70,_0x4b072c[_0x3175('0x6c')]);return db[_0x3175('0x2f')][_0x3175('0x49')](_0x3c7b70)[_0x3175('0x25')](function(_0xd533f7){if(_0xd533f7){_0x4cd059=_0xd533f7;return _0xd533f7[_0x3175('0x6d')]();}return null;})['then'](function(_0x3cbeb9){if(_0x3cbeb9){if(!_0x3cbeb9['length']){throw new db[(_0x3175('0x6e'))][(_0x3175('0x6f'))](_0x3175('0x70'),0x193);}_0x58a7f3=_0x3cbeb9;return db[_0x3175('0x71')][_0x3175('0x72')]({'raw':!![]});}return null;})['then'](function(_0x5f64b3){if(_0x5f64b3){_0x27d5a1=_['keyBy'](_0x5f64b3,'id');var _0x5dc884;var _0x1137c9=squel[_0x3175('0x73')]();_0x1137c9[_0x3175('0x74')](_0x4cd059[_0x3175('0x75')]);for(var _0x1788b3=0x0;_0x1788b3<_0x58a7f3[_0x3175('0x47')];_0x1788b3+=0x1){_0x5dc884=_0x58a7f3[_0x1788b3][_0x3175('0x76')]?_0x27d5a1[_0x58a7f3[_0x1788b3][_0x3175('0x76')]]['metric']:_0x58a7f3[_0x1788b3][_0x3175('0x69')];_0x5dc884=_0x58a7f3[_0x1788b3][_0x3175('0x77')]?_[_0x3175('0x78')](_0x4e537d[_0x58a7f3[_0x1788b3][_0x3175('0x77')]],'%s',_0x5dc884):_0x5dc884;_0x5dc884=_0x58a7f3[_0x1788b3][_0x3175('0x79')]?_[_0x3175('0x78')](_0x55931d[_0x58a7f3[_0x1788b3]['format']],'%s',_0x5dc884):_0x5dc884;if(_0x58a7f3[_0x1788b3][_0x3175('0x7a')]){_0x1137c9['group'](_0x5dc884);}_0x58a7f3[_0x1788b3][_0x3175('0x7b')]&&_0x1137c9['order'](_0x5dc884,_0x58a7f3[_0x1788b3][_0x3175('0x7b')]===_0x3175('0x7c')?![]:!![]);_0x1137c9['field'](_0x5dc884,_0x58a7f3[_0x1788b3][_0x3175('0x7d')]||_0x5dc884);}if(_0x4cd059[_0x3175('0x7e')]){_0x4cd059['joins']=JSON[_0x3175('0x7f')](_0x4cd059['joins']);for(var _0x371e86=0x0;_0x371e86<_0x4cd059[_0x3175('0x7e')]['length'];_0x371e86+=0x1){if(_0x4cd059[_0x3175('0x7e')][_0x371e86][_0x3175('0x32')]&&_[_0x3175('0x80')](_0x45a022,_0x4cd059['joins'][_0x371e86][_0x3175('0x32')])&&_0x4cd059[_0x3175('0x7e')][_0x371e86]['parentKey']&&_0x4cd059[_0x3175('0x7e')][_0x371e86][_0x3175('0x81')]&&_0x4cd059[_0x3175('0x7e')][_0x371e86]['foreignKey']){_0x1137c9[_0x4cd059[_0x3175('0x7e')][_0x371e86][_0x3175('0x32')]](_0x4cd059[_0x3175('0x7e')][_0x371e86][_0x3175('0x81')],null,util[_0x3175('0x79')]('%s.%s\x20=\x20%s.%s',_0x4cd059[_0x3175('0x75')],_0x4cd059['joins'][_0x371e86]['parentKey'],_0x4cd059[_0x3175('0x7e')][_0x371e86]['foreignTable'],_0x4cd059[_0x3175('0x7e')][_0x371e86][_0x3175('0x82')]));}}}if(_0x4cd059[_0x3175('0x83')]){_0x4cd059[_0x3175('0x83')]=JSON[_0x3175('0x7f')](_0x4cd059[_0x3175('0x83')]);_0x1137c9[_0x3175('0x3e')](_0x3d56f8(_0x4cd059[_0x3175('0x83')][_0x3175('0x84')]));}_0x15923f=_0x1137c9['clone']();_0x1137c9[_0x3175('0x1e')](_0x322abf);_0x1137c9[_0x3175('0x20')](0x0);logger['debug'](_0x3175('0x85'),_0x1137c9[_0x3175('0x86')]());return dbH['sequelize'][_0x3175('0x34')](_0x1137c9[_0x3175('0x86')](),{'type':dbH['sequelize'][_0x3175('0x87')][_0x3175('0x88')]});}})[_0x3175('0x25')](respondWithResult(_0x5295c4,null))[_0x3175('0x43')](handleError(_0x5295c4,null));};function runReport(_0x30b3e3,_0x4ad6be,_0x557f96){var _0x49bc02=_0x4ad6be['name'];var _0x349742=0xa;var _0x3095c5=[_0x3175('0x54'),_0x3175('0x55'),'right_join',_0x3175('0x57')];var _0x57b7e2={'SUM':_0x3175('0x89'),'COUNT':_0x3175('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3175('0x8a'),'MIN':_0x3175('0x5a'),'AVG':_0x3175('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3175('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9adcca={'SEC_TO_TIME':_0x3175('0x5f'),'DATE':_0x3175('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x3175('0x62'),'UNIX_TIMESTAMP':_0x3175('0x63')};var _0x49537c=function(_0x4ff7a0){return!_[_0x3175('0x80')]([_0x3175('0x8b'),_0x3175('0x64'),_0x3175('0x65'),_0x3175('0x66')],_0x4ff7a0);};var _0x300a82=function(_0x2dc0ee){if(!_0x2dc0ee||!_0x2dc0ee[_0x3175('0x67')][_0x3175('0x47')]){return'';}for(var _0x1e54fe='(',_0x2755a4=0x0;_0x2755a4<_0x2dc0ee[_0x3175('0x67')]['length'];_0x2755a4+=0x1){_0x2755a4>0x0&&(_0x1e54fe+='\x20'+_0x2dc0ee['operator']+'\x20');_0x1e54fe+=_0x2dc0ee[_0x3175('0x67')][_0x2755a4]['group']?_0x300a82(_0x2dc0ee[_0x3175('0x67')][_0x2755a4][_0x3175('0x84')]):_0x2dc0ee[_0x3175('0x67')][_0x2755a4][_0x3175('0x69')]+'\x20'+_0x2dc0ee['rules'][_0x2755a4][_0x3175('0x6a')]+(_0x49537c(_0x2dc0ee[_0x3175('0x67')][_0x2755a4][_0x3175('0x6a')])?'\x20'+_0x2dc0ee[_0x3175('0x67')][_0x2755a4][_0x3175('0x6b')]:'');}return _0x1e54fe+')';};var _0x52db26={'where':{'id':_0x30b3e3['id']}},_0x43045f,_0x2b7de9,_0x10a7c6,_0x353016,_0x57e002;_0x52db26=_[_0x3175('0x3f')]({},_0x52db26,_0x557f96);return db['AnalyticCustomReport'][_0x3175('0x49')](_0x52db26)[_0x3175('0x25')](function(_0x39ad9d){if(_0x39ad9d){_0x43045f=_0x39ad9d;return _0x39ad9d[_0x3175('0x6d')]();}return null;})['then'](function(_0x194154){if(_0x194154){if(!_0x194154[_0x3175('0x47')]){throw new db['Sequelize'][(_0x3175('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2b7de9=_0x194154;return db[_0x3175('0x71')][_0x3175('0x72')]({'raw':!![]});}return null;})[_0x3175('0x25')](function(_0x115e2b){if(_0x115e2b){_0x10a7c6=_[_0x3175('0x8c')](_0x115e2b,'id');var _0x2c4570;var _0x47fe85=squel['select']();_0x47fe85[_0x3175('0x74')](_0x43045f['table']);for(var _0x38eb82=0x0;_0x38eb82<_0x2b7de9[_0x3175('0x47')];_0x38eb82+=0x1){_0x2c4570=_0x2b7de9[_0x38eb82][_0x3175('0x76')]?_0x10a7c6[_0x2b7de9[_0x38eb82][_0x3175('0x76')]][_0x3175('0x8d')]:_0x2b7de9[_0x38eb82]['field'];_0x2c4570=_0x2b7de9[_0x38eb82][_0x3175('0x77')]?_[_0x3175('0x78')](_0x57b7e2[_0x2b7de9[_0x38eb82]['function']],'%s',_0x2c4570):_0x2c4570;_0x2c4570=_0x2b7de9[_0x38eb82][_0x3175('0x79')]?_[_0x3175('0x78')](_0x9adcca[_0x2b7de9[_0x38eb82][_0x3175('0x79')]],'%s',_0x2c4570):_0x2c4570;if(_0x2b7de9[_0x38eb82][_0x3175('0x7a')]){_0x47fe85['group'](_0x2c4570);}_0x2b7de9[_0x38eb82][_0x3175('0x7b')]&&_0x47fe85[_0x3175('0x8e')](_0x2c4570,_0x2b7de9[_0x38eb82][_0x3175('0x7b')]===_0x3175('0x7c')?![]:!![]);_0x47fe85[_0x3175('0x69')](_0x2c4570,_0x2b7de9[_0x38eb82][_0x3175('0x7d')]||_0x2c4570);}if(_0x43045f['joins']){_0x43045f[_0x3175('0x7e')]=JSON[_0x3175('0x7f')](_0x43045f[_0x3175('0x7e')]);for(var _0x4bf60c=0x0;_0x4bf60c<_0x43045f[_0x3175('0x7e')][_0x3175('0x47')];_0x4bf60c+=0x1){if(_0x43045f[_0x3175('0x7e')][_0x4bf60c][_0x3175('0x32')]&&_[_0x3175('0x80')](_0x3095c5,_0x43045f[_0x3175('0x7e')][_0x4bf60c][_0x3175('0x32')])&&_0x43045f['joins'][_0x4bf60c][_0x3175('0x8f')]&&_0x43045f[_0x3175('0x7e')][_0x4bf60c]['foreignTable']&&_0x43045f[_0x3175('0x7e')][_0x4bf60c][_0x3175('0x82')]){_0x47fe85[_0x43045f['joins'][_0x4bf60c][_0x3175('0x32')]](_0x43045f['joins'][_0x4bf60c][_0x3175('0x81')],null,util[_0x3175('0x79')](_0x3175('0x90'),_0x43045f[_0x3175('0x75')],_0x43045f[_0x3175('0x7e')][_0x4bf60c]['parentKey'],_0x43045f[_0x3175('0x7e')][_0x4bf60c][_0x3175('0x81')],_0x43045f['joins'][_0x4bf60c][_0x3175('0x82')]));}}}if(_0x43045f[_0x3175('0x83')]){_0x43045f[_0x3175('0x83')]=JSON[_0x3175('0x7f')](_0x43045f[_0x3175('0x83')]);_0x47fe85[_0x3175('0x3e')](_0x300a82(_0x43045f[_0x3175('0x83')][_0x3175('0x84')]));}_0x57e002=_0x47fe85[_0x3175('0x91')]();_0x47fe85[_0x3175('0x1e')](_0x349742);_0x47fe85[_0x3175('0x20')](0x0);return;}})[_0x3175('0x25')](function(){if(_0x4ad6be[_0x3175('0x92')]==='web'){return null;}var _0x536a9e=_[_0x3175('0x3f')](_0x4ad6be,{'name':_0x4ad6be[_0x3175('0x93')]||_0x4ad6be[_0x3175('0x2b')]||_0x43045f[_0x3175('0x2b')],'basename':_0x49bc02,'savename':util[_0x3175('0x79')](_0x3175('0x94'),_0x4ad6be[_0x3175('0x2b')]||_0x43045f[_0x3175('0x2b')],require(_0x3175('0x95'))[_0x3175('0x96')](0x4),_0x4ad6be[_0x3175('0x92')]||_0x3175('0x97')),'reportId':_0x43045f['id'],'reportType':_0x3175('0x98')});return db[_0x3175('0x99')]['create'](_0x536a9e,{'raw':!![]});})[_0x3175('0x25')](function(_0x399d06){if(_0x43045f[_0x3175('0x75')]==='cdr'){_0x57e002[_0x3175('0x3e')](_0x43045f[_0x3175('0x75')]+_0x3175('0x9a'),_0x4ad6be[_0x3175('0x9b')],_0x4ad6be[_0x3175('0x9c')]);}else{_0x57e002[_0x3175('0x3e')](_0x43045f[_0x3175('0x75')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ad6be[_0x3175('0x9b')],_0x4ad6be['endDate']);}if(_0x399d06){logger[_0x3175('0x9d')]('Run\x20Query:',_0x57e002[_0x3175('0x86')]());require(_0x3175('0x9e'))[_0x3175('0x9f')](path[_0x3175('0x54')](__dirname,_0x3175('0xa0'),_0x399d06['output']),[_0x399d06['id'],_0x57e002[_0x3175('0x86')](),path[_0x3175('0x54')](__dirname,_0x3175('0xa1'),_0x399d06['savename']),_0x49bc02]);return _0x399d06;}else{var _0x12773f=squel[_0x3175('0x73')]();_0x12773f[_0x3175('0x74')]('('+_0x57e002['toString']()+')',_0x3175('0xa2'));_0x12773f[_0x3175('0x69')](_0x3175('0xa3'),_0x3175('0x1f'));_0x57e002['limit'](_0x4ad6be[_0x3175('0x1e')]||_0x349742);_0x57e002[_0x3175('0x20')](_0x4ad6be[_0x3175('0x20')]||0x0);return dbH[_0x3175('0xa4')][_0x3175('0x34')](_0x12773f['toString'](),{'type':dbH[_0x3175('0xa4')][_0x3175('0x87')]['SELECT']})['then'](function(_0x3a0ef5){if(!_0x3a0ef5[_0x3175('0x47')]){_0x353016=0x0;}else{_0x353016=_0x3a0ef5[0x0][_0x3175('0x1f')]||0x0;}return dbH[_0x3175('0xa4')]['query'](_0x57e002[_0x3175('0x86')](),{'type':dbH[_0x3175('0xa4')][_0x3175('0x87')][_0x3175('0x88')]});})[_0x3175('0x25')](function(_0x450b4f){return{'rows':_0x450b4f||[],'count':_0x353016};});}});}exports[_0x3175('0xa5')]=function(_0x5d523d,_0x2498e0){return runReport(_0x5d523d[_0x3175('0x45')],_0x5d523d[_0x3175('0x34')],_0x5d523d['options'])['then'](respondWithResult(_0x2498e0,null))[_0x3175('0x43')](handleError(_0x2498e0,null));};exports['runReport']=runReport;exports[_0x3175('0x34')]=function(_0x37d286,_0x30864b){var _0xfaca8d=0xa;var _0x2a3763=[_0x3175('0x54'),_0x3175('0x55'),'right_join',_0x3175('0x57')];var _0x13448d={'SUM':'SUM(%s)','COUNT':_0x3175('0x58'),'COUNT DISTINCT':_0x3175('0x59'),'MAX':_0x3175('0x8a'),'MIN':_0x3175('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3175('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3175('0x5e')};var _0x2121eb={'SEC_TO_TIME':_0x3175('0x5f'),'DATE':_0x3175('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x3175('0x62'),'UNIX_TIMESTAMP':_0x3175('0x63')};var _0x4040e7=function(_0x435cf0){return!_['includes']([_0x3175('0x8b'),'IS\x20NOT\x20NULL',_0x3175('0x65'),'IS\x20NOT\x20EMPTY'],_0x435cf0);};var _0x4ab2e6=function(_0x4b77ba){if(!_0x4b77ba||!_0x4b77ba[_0x3175('0x67')][_0x3175('0x47')]){return'';}for(var _0x56b501='(',_0x10a2e3=0x0;_0x10a2e3<_0x4b77ba[_0x3175('0x67')][_0x3175('0x47')];_0x10a2e3+=0x1){_0x10a2e3>0x0&&(_0x56b501+='\x20'+_0x4b77ba[_0x3175('0x68')]+'\x20');_0x56b501+=_0x4b77ba[_0x3175('0x67')][_0x10a2e3][_0x3175('0x84')]?_0x4ab2e6(_0x4b77ba['rules'][_0x10a2e3]['group']):_0x4b77ba[_0x3175('0x67')][_0x10a2e3][_0x3175('0x69')]+'\x20'+_0x4b77ba['rules'][_0x10a2e3][_0x3175('0x6a')]+(_0x4040e7(_0x4b77ba[_0x3175('0x67')][_0x10a2e3][_0x3175('0x6a')])?'\x20'+_0x4b77ba[_0x3175('0x67')][_0x10a2e3][_0x3175('0x6b')]:'');}return _0x56b501+')';};var _0x3e9f82={'where':{'id':_0x37d286[_0x3175('0x45')]['id']}},_0x8a8463,_0x94b36e,_0x4ac2cc,_0x5f49a3,_0x1aa760;_0x3e9f82=_[_0x3175('0x3f')]({},_0x3e9f82,_0x37d286[_0x3175('0x6c')]);return db['AnalyticCustomReport'][_0x3175('0x49')](_0x3e9f82)[_0x3175('0x25')](function(_0x36a536){if(_0x36a536){_0x8a8463=_0x36a536;return _0x36a536['getFields']();}return null;})[_0x3175('0x25')](function(_0xd5b0a3){if(_0xd5b0a3){if(!_0xd5b0a3[_0x3175('0x47')]){throw new db[(_0x3175('0x6e'))][(_0x3175('0x6f'))](_0x3175('0x70'),0x193);}_0x94b36e=_0xd5b0a3;return db[_0x3175('0x71')]['findAll']({'raw':!![]});}return null;})[_0x3175('0x25')](function(_0x42d1f6){if(_0x42d1f6){_0x4ac2cc=_[_0x3175('0x8c')](_0x42d1f6,'id');var _0x4c6ad4;var _0x2517af=squel[_0x3175('0x73')]();_0x2517af[_0x3175('0x74')](_0x8a8463[_0x3175('0x75')]);for(var _0x4257ac=0x0;_0x4257ac<_0x94b36e[_0x3175('0x47')];_0x4257ac+=0x1){_0x4c6ad4=_0x94b36e[_0x4257ac][_0x3175('0x76')]?_0x4ac2cc[_0x94b36e[_0x4257ac][_0x3175('0x76')]]['metric']:_0x94b36e[_0x4257ac][_0x3175('0x69')];_0x4c6ad4=_0x94b36e[_0x4257ac][_0x3175('0x77')]?_[_0x3175('0x78')](_0x13448d[_0x94b36e[_0x4257ac]['function']],'%s',_0x4c6ad4):_0x4c6ad4;_0x4c6ad4=_0x94b36e[_0x4257ac][_0x3175('0x79')]?_['replace'](_0x2121eb[_0x94b36e[_0x4257ac][_0x3175('0x79')]],'%s',_0x4c6ad4):_0x4c6ad4;if(_0x94b36e[_0x4257ac]['groupBy']){_0x2517af[_0x3175('0x84')](_0x4c6ad4);}_0x94b36e[_0x4257ac][_0x3175('0x7b')]&&_0x2517af[_0x3175('0x8e')](_0x4c6ad4,_0x94b36e[_0x4257ac][_0x3175('0x7b')]===_0x3175('0x7c')?![]:!![]);_0x2517af[_0x3175('0x69')](_0x4c6ad4,_0x94b36e[_0x4257ac][_0x3175('0x7d')]||_0x4c6ad4);}if(_0x8a8463[_0x3175('0x7e')]){_0x8a8463[_0x3175('0x7e')]=JSON['parse'](_0x8a8463['joins']);for(var _0x3872b0=0x0;_0x3872b0<_0x8a8463[_0x3175('0x7e')][_0x3175('0x47')];_0x3872b0+=0x1){if(_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x32')]&&_[_0x3175('0x80')](_0x2a3763,_0x8a8463[_0x3175('0x7e')][_0x3872b0]['type'])&&_0x8a8463[_0x3175('0x7e')][_0x3872b0]['parentKey']&&_0x8a8463['joins'][_0x3872b0][_0x3175('0x81')]&&_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x82')]){_0x2517af[_0x8a8463['joins'][_0x3872b0][_0x3175('0x32')]](_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x81')],null,util[_0x3175('0x79')](_0x3175('0x90'),_0x8a8463[_0x3175('0x75')],_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x8f')],_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x81')],_0x8a8463[_0x3175('0x7e')][_0x3872b0][_0x3175('0x82')]));}}}if(_0x8a8463[_0x3175('0x83')]){_0x8a8463['conditions']=JSON[_0x3175('0x7f')](_0x8a8463[_0x3175('0x83')]);_0x2517af[_0x3175('0x3e')](_0x4ab2e6(_0x8a8463['conditions']['group']));}_0x1aa760=_0x2517af[_0x3175('0x91')]();_0x2517af['limit'](_0xfaca8d);_0x2517af[_0x3175('0x20')](0x0);logger['debug'](_0x3175('0x85'),_0x2517af[_0x3175('0x86')]());return dbH[_0x3175('0xa4')][_0x3175('0x34')](_0x2517af[_0x3175('0x86')](),{'type':dbH[_0x3175('0xa4')][_0x3175('0x87')]['SELECT']});}})[_0x3175('0x25')](function(){return{'sql':_0x1aa760[_0x3175('0x86')]()};})[_0x3175('0x25')](respondWithResult(_0x30864b,null))['catch'](handleError(_0x30864b,null));};
\ No newline at end of file
+var _0xf2d9=['joins','parentKey','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NOT\x20NULL','value','AnalyticMetric','DESC','foreignTable','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','reject','then','destroy','get','CustomReports','error','stack','send','index','AnalyticCustomReport','fieldName','key','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','include','findAll','rows','show','params','rawAttributes','filters','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','alias'];(function(_0x39b7b6,_0x14bcf4){var _0x5e4e75=function(_0x4daadb){while(--_0x4daadb){_0x39b7b6['push'](_0x39b7b6['shift']());}};_0x5e4e75(++_0x14bcf4);}(_0xf2d9,0xd2));var _0x9f2d=function(_0x4da2a6,_0x261779){_0x4da2a6=_0x4da2a6-0x0;var _0x2a9788=_0xf2d9[_0x4da2a6];return _0x2a9788;};'use strict';var emlformat=require(_0x9f2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f2d('0x1'));var jsonpatch=require(_0x9f2d('0x2'));var rp=require(_0x9f2d('0x3'));var moment=require(_0x9f2d('0x4'));var BPromise=require(_0x9f2d('0x5'));var Mustache=require(_0x9f2d('0x6'));var util=require(_0x9f2d('0x7'));var path=require(_0x9f2d('0x8'));var sox=require(_0x9f2d('0x9'));var csv=require(_0x9f2d('0xa'));var ejs=require(_0x9f2d('0xb'));var fs=require('fs');var fs_extra=require(_0x9f2d('0xc'));var _=require('lodash');var squel=require(_0x9f2d('0xd'));var crypto=require(_0x9f2d('0xe'));var jsforce=require(_0x9f2d('0xf'));var deskjs=require(_0x9f2d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f2d('0x12'));var as=require(_0x9f2d('0x13'));var hardwareService=require(_0x9f2d('0x14'));var logger=require(_0x9f2d('0x15'))(_0x9f2d('0x16'));var utils=require(_0x9f2d('0x17'));var config=require(_0x9f2d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f2d('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x14f6ae,_0x184ce6){_0x184ce6=_0x184ce6||0xcc;return function(_0x13fc99){if(_0x13fc99){return _0x14f6ae[_0x9f2d('0x1a')](_0x184ce6);}return _0x14f6ae['status'](_0x184ce6)[_0x9f2d('0x1b')]();};}function respondWithResult(_0x1e6b4f,_0xbded3d){_0xbded3d=_0xbded3d||0xc8;return function(_0x486293){if(_0x486293){return _0x1e6b4f[_0x9f2d('0x1c')](_0xbded3d)[_0x9f2d('0x1d')](_0x486293);}};}function respondWithFilteredResult(_0x4a4a5d,_0x591878){return function(_0x22f7f4){if(_0x22f7f4){var _0x50f762=typeof _0x591878[_0x9f2d('0x1e')]==='undefined'&&typeof _0x591878['limit']==='undefined';var _0xa249bd=_0x22f7f4[_0x9f2d('0x1f')];var _0x100ef5=_0x50f762?0x0:_0x591878['offset'];var _0x45cd72=_0x50f762?_0x22f7f4['count']:_0x591878[_0x9f2d('0x1e')]+_0x591878[_0x9f2d('0x20')];var _0x124145;if(_0x45cd72>=_0xa249bd){_0x45cd72=_0xa249bd;_0x124145=0xc8;}else{_0x124145=0xce;}_0x4a4a5d[_0x9f2d('0x1c')](_0x124145);return _0x4a4a5d[_0x9f2d('0x21')]('Content-Range',_0x100ef5+'-'+_0x45cd72+'/'+_0xa249bd)[_0x9f2d('0x1d')](_0x22f7f4);}return null;};}function patchUpdates(_0x40e6a5){return function(_0x930309){try{jsonpatch['apply'](_0x930309,_0x40e6a5,!![]);}catch(_0x7dda0f){return BPromise[_0x9f2d('0x22')](_0x7dda0f);}return _0x930309['save']();};}function saveUpdates(_0x26ea93,_0x2c6dc5){return function(_0x520cdf){if(_0x520cdf){return _0x520cdf['update'](_0x26ea93)[_0x9f2d('0x23')](function(_0x175465){return _0x175465;});}return null;};}function removeEntity(_0x1026d2,_0x3a7d4e){return function(_0x3444f0){if(_0x3444f0){return _0x3444f0[_0x9f2d('0x24')]()[_0x9f2d('0x23')](function(){var _0x39f84b=_0x3444f0[_0x9f2d('0x25')]({'plain':!![]});var _0x2ae19d=_0x9f2d('0x26');return db['UserProfileResource'][_0x9f2d('0x24')]({'where':{'type':_0x2ae19d,'resourceId':_0x39f84b['id']}})['then'](function(){return _0x3444f0;});})[_0x9f2d('0x23')](function(){_0x1026d2[_0x9f2d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37190a,_0x1c18c1){return function(_0x106ed8){if(!_0x106ed8){_0x37190a[_0x9f2d('0x1a')](0x194);}return _0x106ed8;};}function handleError(_0x1b3c02,_0xa4219e){_0xa4219e=_0xa4219e||0x1f4;return function(_0x1f8270){logger[_0x9f2d('0x27')](_0x1f8270[_0x9f2d('0x28')]);if(_0x1f8270['name']){delete _0x1f8270['name'];}_0x1b3c02[_0x9f2d('0x1c')](_0xa4219e)[_0x9f2d('0x29')](_0x1f8270);};}exports[_0x9f2d('0x2a')]=function(_0x205d96,_0x29006b){var _0x27f6e3={},_0x20a827={},_0x36ad06={'count':0x0,'rows':[]};var _0x5a3ac6=_['map'](db[_0x9f2d('0x2b')]['rawAttributes'],function(_0xd7190f){return{'name':_0xd7190f[_0x9f2d('0x2c')],'type':_0xd7190f['type'][_0x9f2d('0x2d')]};});_0x20a827['model']=_['map'](_0x5a3ac6,'name');_0x20a827['query']=_[_0x9f2d('0x2e')](_0x205d96['query']);_0x20a827['filters']=_['intersection'](_0x20a827[_0x9f2d('0x2f')],_0x20a827[_0x9f2d('0x30')]);_0x27f6e3[_0x9f2d('0x31')]=_[_0x9f2d('0x32')](_0x20a827[_0x9f2d('0x2f')],qs[_0x9f2d('0x33')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x27f6e3[_0x9f2d('0x31')]=_0x27f6e3[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x27f6e3[_0x9f2d('0x31')]:_0x20a827['model'];if(!_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x35')](_0x9f2d('0x36'))){_0x27f6e3['limit']=qs[_0x9f2d('0x20')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x20')]);_0x27f6e3[_0x9f2d('0x1e')]=qs[_0x9f2d('0x1e')](_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x1e')]);}_0x27f6e3['order']=qs[_0x9f2d('0x37')](_0x205d96['query'][_0x9f2d('0x37')]);_0x27f6e3[_0x9f2d('0x38')]=qs['filters'](_[_0x9f2d('0x39')](_0x205d96['query'],_0x20a827['filters']),_0x5a3ac6);if(_0x205d96[_0x9f2d('0x30')][_0x9f2d('0x3a')]){_0x27f6e3[_0x9f2d('0x38')]=_[_0x9f2d('0x3b')](_0x27f6e3[_0x9f2d('0x38')],{'$or':_['map'](_0x5a3ac6,function(_0x51921e){if(_0x51921e[_0x9f2d('0x3c')]!==_0x9f2d('0x3d')){var _0x2b08e8={};_0x2b08e8[_0x51921e[_0x9f2d('0x3e')]]={'$like':'%'+_0x205d96['query']['filter']+'%'};return _0x2b08e8;}})});}_0x27f6e3=_['merge']({},_0x27f6e3,_0x205d96['options']);var _0x204628={'where':_0x27f6e3[_0x9f2d('0x38')]};return db[_0x9f2d('0x2b')]['count'](_0x204628)[_0x9f2d('0x23')](function(_0x17e5e3){_0x36ad06[_0x9f2d('0x1f')]=_0x17e5e3;if(_0x205d96[_0x9f2d('0x30')]['includeAll']){_0x27f6e3[_0x9f2d('0x3f')]=[{'all':!![]}];}return db[_0x9f2d('0x2b')][_0x9f2d('0x40')](_0x27f6e3);})[_0x9f2d('0x23')](function(_0x529b3b){_0x36ad06[_0x9f2d('0x41')]=_0x529b3b;return _0x36ad06;})[_0x9f2d('0x23')](respondWithFilteredResult(_0x29006b,_0x27f6e3))['catch'](handleError(_0x29006b,null));};exports[_0x9f2d('0x42')]=function(_0x2668b3,_0x439a6b){var _0x5c261e={'raw':![],'where':{'id':_0x2668b3[_0x9f2d('0x43')]['id']}},_0x6b82d5={};_0x6b82d5[_0x9f2d('0x2f')]=_['keys'](db[_0x9f2d('0x2b')][_0x9f2d('0x44')]);_0x6b82d5[_0x9f2d('0x30')]=_[_0x9f2d('0x2e')](_0x2668b3[_0x9f2d('0x30')]);_0x6b82d5[_0x9f2d('0x45')]=_[_0x9f2d('0x32')](_0x6b82d5['model'],_0x6b82d5[_0x9f2d('0x30')]);_0x5c261e['attributes']=_[_0x9f2d('0x32')](_0x6b82d5['model'],qs[_0x9f2d('0x33')](_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x33')]));_0x5c261e['attributes']=_0x5c261e[_0x9f2d('0x31')][_0x9f2d('0x34')]?_0x5c261e[_0x9f2d('0x31')]:_0x6b82d5[_0x9f2d('0x2f')];if(_0x2668b3[_0x9f2d('0x30')][_0x9f2d('0x46')]){_0x5c261e[_0x9f2d('0x3f')]=[{'all':!![]}];}_0x5c261e=_[_0x9f2d('0x3b')]({},_0x5c261e,_0x2668b3[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x5c261e)[_0x9f2d('0x23')](handleEntityNotFound(_0x439a6b,null))[_0x9f2d('0x23')](respondWithResult(_0x439a6b,null))[_0x9f2d('0x49')](handleError(_0x439a6b,null));};exports[_0x9f2d('0x4a')]=function(_0x3eddd5,_0x3e7996){return db[_0x9f2d('0x2b')]['create'](_0x3eddd5[_0x9f2d('0x4b')],{})[_0x9f2d('0x23')](function(_0x5ec9e5){var _0x5065d1=_0x3eddd5[_0x9f2d('0x4c')]['get']({'plain':!![]});if(!_0x5065d1)throw new Error(_0x9f2d('0x4d'));if(_0x5065d1['role']===_0x9f2d('0x4c')){var _0x3ff324=_0x5ec9e5[_0x9f2d('0x25')]({'plain':!![]});var _0x976b61='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x976b61,'userProfileId':_0x5065d1[_0x9f2d('0x4e')]},'raw':!![]})[_0x9f2d('0x23')](function(_0x25662a){if(_0x25662a&&_0x25662a['autoAssociation']===0x0){return db['UserProfileResource'][_0x9f2d('0x4a')]({'name':_0x3ff324[_0x9f2d('0x3e')],'resourceId':_0x3ff324['id'],'type':_0x9f2d('0x26'),'sectionId':_0x25662a['id']},{})['then'](function(){return _0x5ec9e5;});}else{return _0x5ec9e5;}})[_0x9f2d('0x49')](function(_0x5c0bdb){logger[_0x9f2d('0x27')](_0x9f2d('0x4f'),_0x5c0bdb);throw _0x5c0bdb;});}return _0x5ec9e5;})[_0x9f2d('0x23')](respondWithResult(_0x3e7996,0xc9))[_0x9f2d('0x49')](handleError(_0x3e7996,null));};exports['update']=function(_0x77452e,_0x2bc443){if(_0x77452e['body']['id']){delete _0x77452e['body']['id'];}return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x77452e[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x2bc443,null))['then'](saveUpdates(_0x77452e[_0x9f2d('0x4b')],null))[_0x9f2d('0x23')](respondWithResult(_0x2bc443,null))[_0x9f2d('0x49')](handleError(_0x2bc443,null));};exports[_0x9f2d('0x24')]=function(_0x39c32f,_0x10b4d){return db['AnalyticCustomReport'][_0x9f2d('0x48')]({'where':{'id':_0x39c32f[_0x9f2d('0x43')]['id']}})[_0x9f2d('0x23')](handleEntityNotFound(_0x10b4d,null))[_0x9f2d('0x23')](removeEntity(_0x10b4d,null))['catch'](handleError(_0x10b4d,null));};exports[_0x9f2d('0x50')]=function(_0xbd2d57,_0xd6c755){var _0x55cd0c=0xa;var _0x6578bd=['join','left_join',_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x40b4e0={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x165763={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x20e730=function(_0x5cfa69){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),'IS\x20NOT\x20NULL',_0x9f2d('0x61'),_0x9f2d('0x62')],_0x5cfa69);};var _0x2fd373=function(_0x50397d){if(!_0x50397d||!_0x50397d['rules'][_0x9f2d('0x34')]){return'';}for(var _0x270e5e='(',_0x9fd238=0x0;_0x9fd238<_0x50397d['rules'][_0x9f2d('0x34')];_0x9fd238+=0x1){_0x9fd238>0x0&&(_0x270e5e+='\x20'+_0x50397d[_0x9f2d('0x63')]+'\x20');_0x270e5e+=_0x50397d['rules'][_0x9fd238]['group']?_0x2fd373(_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x65')]):_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x66')]+'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238][_0x9f2d('0x67')]+(_0x20e730(_0x50397d['rules'][_0x9fd238][_0x9f2d('0x67')])?'\x20'+_0x50397d[_0x9f2d('0x64')][_0x9fd238]['value']:'');}return _0x270e5e+')';};var _0x45788b={'where':{'id':_0xbd2d57[_0x9f2d('0x43')]['id']}},_0x2ba2cc,_0x446d8b,_0x48529b,_0x233724,_0x445063;_0x45788b=_[_0x9f2d('0x3b')]({},_0x45788b,_0xbd2d57[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')]['find'](_0x45788b)[_0x9f2d('0x23')](function(_0x970a06){if(_0x970a06){_0x2ba2cc=_0x970a06;return _0x970a06[_0x9f2d('0x68')]();}return null;})[_0x9f2d('0x23')](function(_0x3f0c1f){if(_0x3f0c1f){if(!_0x3f0c1f[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x446d8b=_0x3f0c1f;return db['AnalyticMetric'][_0x9f2d('0x40')]({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x3b2841){if(_0x3b2841){_0x48529b=_[_0x9f2d('0x6b')](_0x3b2841,'id');var _0x5e7e6d;var _0x4c9954=squel[_0x9f2d('0x6c')]();_0x4c9954[_0x9f2d('0x6d')](_0x2ba2cc[_0x9f2d('0x6e')]);for(var _0x47b830=0x0;_0x47b830<_0x446d8b[_0x9f2d('0x34')];_0x47b830+=0x1){_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x6f')]?_0x48529b[_0x446d8b[_0x47b830][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x446d8b[_0x47b830][_0x9f2d('0x66')];_0x5e7e6d=_0x446d8b[_0x47b830]['function']?_[_0x9f2d('0x71')](_0x40b4e0[_0x446d8b[_0x47b830][_0x9f2d('0x72')]],'%s',_0x5e7e6d):_0x5e7e6d;_0x5e7e6d=_0x446d8b[_0x47b830][_0x9f2d('0x73')]?_['replace'](_0x165763[_0x446d8b[_0x47b830][_0x9f2d('0x73')]],'%s',_0x5e7e6d):_0x5e7e6d;if(_0x446d8b[_0x47b830][_0x9f2d('0x74')]){_0x4c9954[_0x9f2d('0x65')](_0x5e7e6d);}_0x446d8b[_0x47b830][_0x9f2d('0x75')]&&_0x4c9954[_0x9f2d('0x76')](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x75')]==='DESC'?![]:!![]);_0x4c9954['field'](_0x5e7e6d,_0x446d8b[_0x47b830][_0x9f2d('0x77')]||_0x5e7e6d);}if(_0x2ba2cc[_0x9f2d('0x78')]){_0x2ba2cc[_0x9f2d('0x78')]=JSON['parse'](_0x2ba2cc[_0x9f2d('0x78')]);for(var _0x5c4e1=0x0;_0x5c4e1<_0x2ba2cc[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x5c4e1+=0x1){if(_0x2ba2cc['joins'][_0x5c4e1][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x6578bd,_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')])&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')]&&_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1]['foreignTable']&&_0x2ba2cc['joins'][_0x5c4e1]['foreignKey']){_0x4c9954[_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x3c')]](_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],null,util['format'](_0x9f2d('0x7a'),_0x2ba2cc[_0x9f2d('0x6e')],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x79')],_0x2ba2cc['joins'][_0x5c4e1]['foreignTable'],_0x2ba2cc[_0x9f2d('0x78')][_0x5c4e1][_0x9f2d('0x7b')]));}}}if(_0x2ba2cc['conditions']){_0x2ba2cc[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x2ba2cc['conditions']);_0x4c9954[_0x9f2d('0x38')](_0x2fd373(_0x2ba2cc[_0x9f2d('0x7c')]['group']));}_0x445063=_0x4c9954['clone']();_0x4c9954['limit'](_0x55cd0c);_0x4c9954[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')](_0x9f2d('0x7f'),_0x4c9954['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x4c9954[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](respondWithResult(_0xd6c755,null))[_0x9f2d('0x49')](handleError(_0xd6c755,null));};function runReport(_0x4b3571,_0x20bd66,_0x37bae9){var _0x11c822=_0x20bd66[_0x9f2d('0x3e')];var _0x2c6181=0xa;var _0x3d2c89=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),_0x9f2d('0x52')];var _0x5b9084={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':_0x9f2d('0x57'),'AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':_0x9f2d('0x86')};var _0x14cfc1={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48b5f0=function(_0x595989){return!_[_0x9f2d('0x5f')]([_0x9f2d('0x60'),_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x595989);};var _0x12b67f=function(_0x5acac6){if(!_0x5acac6||!_0x5acac6[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x2af1d9='(',_0x1ea74d=0x0;_0x1ea74d<_0x5acac6[_0x9f2d('0x64')]['length'];_0x1ea74d+=0x1){_0x1ea74d>0x0&&(_0x2af1d9+='\x20'+_0x5acac6[_0x9f2d('0x63')]+'\x20');_0x2af1d9+=_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x65')]?_0x12b67f(_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x65')]):_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x66')]+'\x20'+_0x5acac6['rules'][_0x1ea74d][_0x9f2d('0x67')]+(_0x48b5f0(_0x5acac6[_0x9f2d('0x64')][_0x1ea74d]['condition'])?'\x20'+_0x5acac6[_0x9f2d('0x64')][_0x1ea74d][_0x9f2d('0x89')]:'');}return _0x2af1d9+')';};var _0x588606={'where':{'id':_0x4b3571['id']}},_0x4f0974,_0x12ab9b,_0x134efa,_0x11a144,_0x35f20a;_0x588606=_['merge']({},_0x588606,_0x37bae9);return db[_0x9f2d('0x2b')]['find'](_0x588606)[_0x9f2d('0x23')](function(_0x289fa0){if(_0x289fa0){_0x4f0974=_0x289fa0;return _0x289fa0[_0x9f2d('0x68')]();}return null;})['then'](function(_0x292aba){if(_0x292aba){if(!_0x292aba[_0x9f2d('0x34')]){throw new db[(_0x9f2d('0x69'))][(_0x9f2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12ab9b=_0x292aba;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})[_0x9f2d('0x23')](function(_0x697931){if(_0x697931){_0x134efa=_[_0x9f2d('0x6b')](_0x697931,'id');var _0x1be640;var _0x59e586=squel[_0x9f2d('0x6c')]();_0x59e586[_0x9f2d('0x6d')](_0x4f0974[_0x9f2d('0x6e')]);for(var _0x5f4046=0x0;_0x5f4046<_0x12ab9b[_0x9f2d('0x34')];_0x5f4046+=0x1){_0x1be640=_0x12ab9b[_0x5f4046]['MetricId']?_0x134efa[_0x12ab9b[_0x5f4046][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x12ab9b[_0x5f4046][_0x9f2d('0x66')];_0x1be640=_0x12ab9b[_0x5f4046]['function']?_[_0x9f2d('0x71')](_0x5b9084[_0x12ab9b[_0x5f4046][_0x9f2d('0x72')]],'%s',_0x1be640):_0x1be640;_0x1be640=_0x12ab9b[_0x5f4046]['format']?_[_0x9f2d('0x71')](_0x14cfc1[_0x12ab9b[_0x5f4046][_0x9f2d('0x73')]],'%s',_0x1be640):_0x1be640;if(_0x12ab9b[_0x5f4046]['groupBy']){_0x59e586[_0x9f2d('0x65')](_0x1be640);}_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]&&_0x59e586[_0x9f2d('0x76')](_0x1be640,_0x12ab9b[_0x5f4046][_0x9f2d('0x75')]===_0x9f2d('0x8b')?![]:!![]);_0x59e586['field'](_0x1be640,_0x12ab9b[_0x5f4046]['alias']||_0x1be640);}if(_0x4f0974[_0x9f2d('0x78')]){_0x4f0974[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x78')]);for(var _0x439b15=0x0;_0x439b15<_0x4f0974['joins'][_0x9f2d('0x34')];_0x439b15+=0x1){if(_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x3d2c89,_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x3c')])&&_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x79')]&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignTable']&&_0x4f0974[_0x9f2d('0x78')][_0x439b15]['foreignKey']){_0x59e586[_0x4f0974['joins'][_0x439b15][_0x9f2d('0x3c')]](_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')]('%s.%s\x20=\x20%s.%s',_0x4f0974[_0x9f2d('0x6e')],_0x4f0974['joins'][_0x439b15][_0x9f2d('0x79')],_0x4f0974[_0x9f2d('0x78')][_0x439b15][_0x9f2d('0x8c')],_0x4f0974['joins'][_0x439b15]['foreignKey']));}}}if(_0x4f0974[_0x9f2d('0x7c')]){_0x4f0974[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x4f0974[_0x9f2d('0x7c')]);_0x59e586[_0x9f2d('0x38')](_0x12b67f(_0x4f0974[_0x9f2d('0x7c')][_0x9f2d('0x65')]));}_0x35f20a=_0x59e586[_0x9f2d('0x8d')]();_0x59e586['limit'](_0x2c6181);_0x59e586[_0x9f2d('0x1e')](0x0);return;}})[_0x9f2d('0x23')](function(){if(_0x20bd66[_0x9f2d('0x8e')]===_0x9f2d('0x8f')){return null;}var _0x3d0265=_['merge'](_0x20bd66,{'name':_0x20bd66[_0x9f2d('0x90')]||_0x20bd66[_0x9f2d('0x3e')]||_0x4f0974[_0x9f2d('0x3e')],'basename':_0x11c822,'savename':util['format'](_0x9f2d('0x91'),_0x20bd66['name']||_0x4f0974[_0x9f2d('0x3e')],require(_0x9f2d('0x92'))[_0x9f2d('0x93')](0x4),_0x20bd66[_0x9f2d('0x8e')]||_0x9f2d('0x94')),'reportId':_0x4f0974['id'],'reportType':_0x9f2d('0x95')});return db[_0x9f2d('0x96')][_0x9f2d('0x4a')](_0x3d0265,{'raw':!![]});})['then'](function(_0x58190e){if(_0x4f0974[_0x9f2d('0x6e')]===_0x9f2d('0x97')){_0x35f20a[_0x9f2d('0x38')](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x98'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66['endDate']);}else{_0x35f20a['where'](_0x4f0974[_0x9f2d('0x6e')]+_0x9f2d('0x9a'),_0x20bd66[_0x9f2d('0x99')],_0x20bd66[_0x9f2d('0x9b')]);}if(_0x58190e){logger[_0x9f2d('0x9c')](_0x9f2d('0x9d'),_0x35f20a[_0x9f2d('0x81')]());require(_0x9f2d('0x9e'))[_0x9f2d('0x9f')](path[_0x9f2d('0x84')](__dirname,_0x9f2d('0xa0'),_0x58190e[_0x9f2d('0x8e')]),[_0x58190e['id'],_0x35f20a[_0x9f2d('0x81')](),path[_0x9f2d('0x84')](__dirname,'../../files/reports',_0x58190e[_0x9f2d('0xa1')]),_0x11c822]);return _0x58190e;}else{var _0x1855e9=squel[_0x9f2d('0x6c')]();_0x1855e9['from']('('+_0x35f20a['toString']()+')',_0x9f2d('0xa2'));_0x1855e9[_0x9f2d('0x66')]('COUNT(*)','count');_0x35f20a[_0x9f2d('0x20')](_0x20bd66[_0x9f2d('0x20')]||_0x2c6181);_0x35f20a[_0x9f2d('0x1e')](_0x20bd66[_0x9f2d('0x1e')]||0x0);return dbH[_0x9f2d('0x80')]['query'](_0x1855e9[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')]['QueryTypes'][_0x9f2d('0x83')]})['then'](function(_0x2f66db){if(!_0x2f66db[_0x9f2d('0x34')]){_0x11a144=0x0;}else{_0x11a144=_0x2f66db[0x0]['count']||0x0;}return dbH[_0x9f2d('0x80')]['query'](_0x35f20a[_0x9f2d('0x81')](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});})[_0x9f2d('0x23')](function(_0x2d5414){return{'rows':_0x2d5414||[],'count':_0x11a144};});}});}exports[_0x9f2d('0xa3')]=function(_0x3d7c40,_0xadd74a){return runReport(_0x3d7c40[_0x9f2d('0x43')],_0x3d7c40[_0x9f2d('0x30')],_0x3d7c40['options'])[_0x9f2d('0x23')](respondWithResult(_0xadd74a,null))[_0x9f2d('0x49')](handleError(_0xadd74a,null));};exports['runReport']=runReport;exports['query']=function(_0x58609a,_0x21bbe3){var _0x54cffe=0xa;var _0x343b3c=[_0x9f2d('0x84'),_0x9f2d('0x85'),_0x9f2d('0x51'),'cross_join'];var _0x406630={'SUM':_0x9f2d('0x53'),'COUNT':_0x9f2d('0x54'),'COUNT DISTINCT':_0x9f2d('0x55'),'MAX':_0x9f2d('0x56'),'MIN':'MIN(%s)','AVG':_0x9f2d('0x58'),'GROUP_CONCAT':_0x9f2d('0x59'),'GROUP_CONCAT ASC':_0x9f2d('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48fa92={'SEC_TO_TIME':_0x9f2d('0x5b'),'DATE':_0x9f2d('0x5c'),'HOUR':_0x9f2d('0x87'),'ROUND':_0x9f2d('0x5d'),'UNIX_TIMESTAMP':_0x9f2d('0x5e')};var _0x2f832d=function(_0x159446){return!_[_0x9f2d('0x5f')](['IS\x20NULL',_0x9f2d('0x88'),_0x9f2d('0x61'),_0x9f2d('0x62')],_0x159446);};var _0x4fcc8c=function(_0x568a0e){if(!_0x568a0e||!_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')]){return'';}for(var _0x40ccfd='(',_0x335a1d=0x0;_0x335a1d<_0x568a0e[_0x9f2d('0x64')][_0x9f2d('0x34')];_0x335a1d+=0x1){_0x335a1d>0x0&&(_0x40ccfd+='\x20'+_0x568a0e[_0x9f2d('0x63')]+'\x20');_0x40ccfd+=_0x568a0e[_0x9f2d('0x64')][_0x335a1d]['group']?_0x4fcc8c(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x65')]):_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x66')]+'\x20'+_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')]+(_0x2f832d(_0x568a0e[_0x9f2d('0x64')][_0x335a1d][_0x9f2d('0x67')])?'\x20'+_0x568a0e['rules'][_0x335a1d][_0x9f2d('0x89')]:'');}return _0x40ccfd+')';};var _0x3657c7={'where':{'id':_0x58609a[_0x9f2d('0x43')]['id']}},_0x284827,_0x474294,_0x4b902b,_0x19aa80,_0x194a37;_0x3657c7=_[_0x9f2d('0x3b')]({},_0x3657c7,_0x58609a[_0x9f2d('0x47')]);return db[_0x9f2d('0x2b')][_0x9f2d('0x48')](_0x3657c7)[_0x9f2d('0x23')](function(_0x22e4e7){if(_0x22e4e7){_0x284827=_0x22e4e7;return _0x22e4e7['getFields']();}return null;})['then'](function(_0x33bc7e){if(_0x33bc7e){if(!_0x33bc7e[_0x9f2d('0x34')]){throw new db['Sequelize'][(_0x9f2d('0x6a'))](_0x9f2d('0xa4'),0x193);}_0x474294=_0x33bc7e;return db[_0x9f2d('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x27376b){if(_0x27376b){_0x4b902b=_[_0x9f2d('0x6b')](_0x27376b,'id');var _0x525bfe;var _0x153496=squel[_0x9f2d('0x6c')]();_0x153496[_0x9f2d('0x6d')](_0x284827[_0x9f2d('0x6e')]);for(var _0x32f8ef=0x0;_0x32f8ef<_0x474294[_0x9f2d('0x34')];_0x32f8ef+=0x1){_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x6f')]?_0x4b902b[_0x474294[_0x32f8ef][_0x9f2d('0x6f')]][_0x9f2d('0x70')]:_0x474294[_0x32f8ef]['field'];_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x72')]?_[_0x9f2d('0x71')](_0x406630[_0x474294[_0x32f8ef][_0x9f2d('0x72')]],'%s',_0x525bfe):_0x525bfe;_0x525bfe=_0x474294[_0x32f8ef][_0x9f2d('0x73')]?_[_0x9f2d('0x71')](_0x48fa92[_0x474294[_0x32f8ef][_0x9f2d('0x73')]],'%s',_0x525bfe):_0x525bfe;if(_0x474294[_0x32f8ef][_0x9f2d('0x74')]){_0x153496[_0x9f2d('0x65')](_0x525bfe);}_0x474294[_0x32f8ef][_0x9f2d('0x75')]&&_0x153496[_0x9f2d('0x76')](_0x525bfe,_0x474294[_0x32f8ef]['orderBy']===_0x9f2d('0x8b')?![]:!![]);_0x153496['field'](_0x525bfe,_0x474294[_0x32f8ef][_0x9f2d('0x77')]||_0x525bfe);}if(_0x284827[_0x9f2d('0x78')]){_0x284827[_0x9f2d('0x78')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x78')]);for(var _0x3abeb4=0x0;_0x3abeb4<_0x284827[_0x9f2d('0x78')][_0x9f2d('0x34')];_0x3abeb4+=0x1){if(_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')]&&_[_0x9f2d('0x5f')](_0x343b3c,_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x3c')])&&_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x79')]&&_0x284827[_0x9f2d('0x78')][_0x3abeb4]['foreignTable']&&_0x284827['joins'][_0x3abeb4]['foreignKey']){_0x153496[_0x284827[_0x9f2d('0x78')][_0x3abeb4]['type']](_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],null,util[_0x9f2d('0x73')](_0x9f2d('0x7a'),_0x284827['table'],_0x284827[_0x9f2d('0x78')][_0x3abeb4]['parentKey'],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x8c')],_0x284827[_0x9f2d('0x78')][_0x3abeb4][_0x9f2d('0x7b')]));}}}if(_0x284827[_0x9f2d('0x7c')]){_0x284827[_0x9f2d('0x7c')]=JSON[_0x9f2d('0x7d')](_0x284827[_0x9f2d('0x7c')]);_0x153496[_0x9f2d('0x38')](_0x4fcc8c(_0x284827[_0x9f2d('0x7c')]['group']));}_0x194a37=_0x153496[_0x9f2d('0x8d')]();_0x153496[_0x9f2d('0x20')](_0x54cffe);_0x153496[_0x9f2d('0x1e')](0x0);logger[_0x9f2d('0x7e')]('Limited\x20Query:',_0x153496['toString']());return dbH[_0x9f2d('0x80')][_0x9f2d('0x30')](_0x153496['toString'](),{'type':dbH[_0x9f2d('0x80')][_0x9f2d('0x82')][_0x9f2d('0x83')]});}})[_0x9f2d('0x23')](function(){return{'sql':_0x194a37[_0x9f2d('0x81')]()};})[_0x9f2d('0x23')](respondWithResult(_0x21bbe3,null))[_0x9f2d('0x49')](handleError(_0x21bbe3,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index f4973d7..42e7dff 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 _0xe854=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment'];(function(_0x1d0ca1,_0x3a4cb2){var _0xc246c7=function(_0x4777cd){while(--_0x4777cd){_0x1d0ca1['push'](_0x1d0ca1['shift']());}};_0xc246c7(++_0x3a4cb2);}(_0xe854,0x105));var _0x4e85=function(_0x47dac5,_0x3edb97){_0x47dac5=_0x47dac5-0x0;var _0x2049ae=_0xe854[_0x47dac5];return _0x2049ae;};'use strict';var _=require(_0x4e85('0x0'));var util=require(_0x4e85('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4e85('0x2'));var BPromise=require(_0x4e85('0x3'));var rp=require(_0x4e85('0x4'));var fs=require('fs');var path=require(_0x4e85('0x5'));var rimraf=require(_0x4e85('0x6'));var config=require(_0x4e85('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x4e85('0x8')]=function(_0x4fcc9a,_0x930878){return _0x4fcc9a[_0x4e85('0x9')](_0x4e85('0xa'),attributes,{'tableName':_0x4e85('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1027=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x1027,0xc1));var _0x7102=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x1027[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x7102('0x0'));var util=require(_0x7102('0x1'));var logger=require(_0x7102('0x2'))(_0x7102('0x3'));var moment=require(_0x7102('0x4'));var BPromise=require(_0x7102('0x5'));var rp=require(_0x7102('0x6'));var fs=require('fs');var path=require(_0x7102('0x7'));var rimraf=require(_0x7102('0x8'));var config=require(_0x7102('0x9'));var attributes=require(_0x7102('0xa'));module[_0x7102('0xb')]=function(_0x373853,_0x35cdd7){return _0x373853[_0x7102('0xc')](_0x7102('0xd'),attributes,{'tableName':_0x7102('0xe'),'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 82fe95d..dea292e 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 _0x0469=['info','request\x20sent','debug','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x0469,0x68));var _0x9046=function(_0x3625ea,_0x437bb6){_0x3625ea=_0x3625ea-0x0;var _0x220dd0=_0x0469[_0x3625ea];return _0x220dd0;};'use strict';var _=require(_0x9046('0x0'));var util=require('util');var moment=require(_0x9046('0x1'));var BPromise=require('bluebird');var rs=require(_0x9046('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9046('0x3'))['db'];var utils=require(_0x9046('0x4'));var logger=require('../../config/logger')(_0x9046('0x5'));var config=require(_0x9046('0x6'));var jayson=require(_0x9046('0x7'));var client=jayson[_0x9046('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22ef57,_0x1c4282,_0x392f59){return new BPromise(function(_0x3e7017,_0xce31bf){return client[_0x9046('0x9')](_0x22ef57,_0x392f59)['then'](function(_0x2f16b7){logger[_0x9046('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1c4282,_0x9046('0xb'));logger[_0x9046('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1c4282,_0x9046('0xb'),JSON['stringify'](_0x2f16b7));if(_0x2f16b7[_0x9046('0xd')]){if(_0x2f16b7[_0x9046('0xd')][_0x9046('0xe')]===0x1f4){logger[_0x9046('0xd')](_0x9046('0xf'),_0x1c4282,_0x2f16b7['error'][_0x9046('0x10')]);return _0xce31bf(_0x2f16b7['error']['message']);}logger[_0x9046('0xd')](_0x9046('0xf'),_0x1c4282,_0x2f16b7[_0x9046('0xd')][_0x9046('0x10')]);return _0x3e7017(_0x2f16b7['error'][_0x9046('0x10')]);}else{logger['info'](_0x9046('0xf'),_0x1c4282,_0x9046('0xb'));_0x3e7017(_0x2f16b7[_0x9046('0x11')][_0x9046('0x10')]);}})[_0x9046('0x12')](function(_0x468ece){logger[_0x9046('0xd')](_0x9046('0xf'),_0x1c4282,_0x468ece);_0xce31bf(_0x468ece);});});}
\ No newline at end of file
+var _0x0ff9=['client','request','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0x0ff9,0x11a));var _0x90ff=function(_0x16ba7f,_0x2928f8){_0x16ba7f=_0x16ba7f-0x0;var _0x3ca577=_0x0ff9[_0x16ba7f];return _0x3ca577;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var moment=require(_0x90ff('0x2'));var BPromise=require(_0x90ff('0x3'));var rs=require(_0x90ff('0x4'));var fs=require('fs');var Redis=require(_0x90ff('0x5'));var db=require(_0x90ff('0x6'))['db'];var utils=require(_0x90ff('0x7'));var logger=require(_0x90ff('0x8'))(_0x90ff('0x9'));var config=require(_0x90ff('0xa'));var jayson=require(_0x90ff('0xb'));var client=jayson[_0x90ff('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23109b,_0x2add9c,_0x320ca1){return new BPromise(function(_0x2b58a7,_0x1747b9){return client[_0x90ff('0xd')](_0x23109b,_0x320ca1)['then'](function(_0xeaab26){logger[_0x90ff('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x90ff('0xf'));logger['debug'](_0x90ff('0x10'),_0x2add9c,_0x90ff('0xf'),JSON['stringify'](_0xeaab26));if(_0xeaab26[_0x90ff('0x11')]){if(_0xeaab26['error'][_0x90ff('0x12')]===0x1f4){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26[_0x90ff('0x11')]['message']);return _0x1747b9(_0xeaab26['error']['message']);}logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0xeaab26['error'][_0x90ff('0x13')]);return _0x2b58a7(_0xeaab26[_0x90ff('0x11')]['message']);}else{logger[_0x90ff('0xe')](_0x90ff('0x14'),_0x2add9c,_0x90ff('0xf'));_0x2b58a7(_0xeaab26['result']['message']);}})['catch'](function(_0x3d179d){logger[_0x90ff('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2add9c,_0x3d179d);_0x1747b9(_0x3d179d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index bce81f5..9adc441 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 _0x8017=['./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','run','/:id/query','query','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4eeb47,_0x5edf4a){var _0x1113f5=function(_0x170ea0){while(--_0x170ea0){_0x4eeb47['push'](_0x4eeb47['shift']());}};_0x1113f5(++_0x5edf4a);}(_0x8017,0xbe));var _0x7801=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x8017[_0x53f897];return _0x6879f8;};'use strict';var multer=require(_0x7801('0x0'));var util=require(_0x7801('0x1'));var path=require(_0x7801('0x2'));var timeout=require(_0x7801('0x3'));var express=require(_0x7801('0x4'));var router=express[_0x7801('0x5')]();var fs_extra=require(_0x7801('0x6'));var auth=require(_0x7801('0x7'));var interaction=require(_0x7801('0x8'));var config=require(_0x7801('0x9'));var controller=require(_0x7801('0xa'));router[_0x7801('0xb')]('/',auth[_0x7801('0xc')](),controller[_0x7801('0xd')]);router[_0x7801('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7801('0xe')]);router['get'](_0x7801('0xf'),auth[_0x7801('0xc')](),controller[_0x7801('0x10')]);router[_0x7801('0xb')]('/:id/run',auth[_0x7801('0xc')](),controller[_0x7801('0x11')]);router[_0x7801('0xb')](_0x7801('0x12'),auth[_0x7801('0xc')](),controller[_0x7801('0x13')]);router[_0x7801('0x14')]('/',auth['isAuthenticated'](),controller[_0x7801('0x15')]);router['put']('/:id',auth[_0x7801('0xc')](),controller['update']);router[_0x7801('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7801('0x17')]);module[_0x7801('0x18')]=router;
\ No newline at end of file
+var _0x6c4f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports','util','path','express','Router','fs-extra'];(function(_0x51ce23,_0x205248){var _0x211944=function(_0x92eae3){while(--_0x92eae3){_0x51ce23['push'](_0x51ce23['shift']());}};_0x211944(++_0x205248);}(_0x6c4f,0x1a4));var _0xf6c4=function(_0x1d8653,_0x5b05e3){_0x1d8653=_0x1d8653-0x0;var _0x59dbc0=_0x6c4f[_0x1d8653];return _0x59dbc0;};'use strict';var multer=require('multer');var util=require(_0xf6c4('0x0'));var path=require(_0xf6c4('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6c4('0x2'));var router=express[_0xf6c4('0x3')]();var fs_extra=require(_0xf6c4('0x4'));var auth=require(_0xf6c4('0x5'));var interaction=require(_0xf6c4('0x6'));var config=require(_0xf6c4('0x7'));var controller=require(_0xf6c4('0x8'));router[_0xf6c4('0x9')]('/',auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xb')]);router[_0xf6c4('0x9')](_0xf6c4('0xc'),auth['isAuthenticated'](),controller[_0xf6c4('0xd')]);router['get'](_0xf6c4('0xe'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0xf')]);router[_0xf6c4('0x9')](_0xf6c4('0x10'),auth['isAuthenticated'](),controller[_0xf6c4('0x11')]);router[_0xf6c4('0x9')](_0xf6c4('0x12'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x13')]);router[_0xf6c4('0x14')]('/',auth[_0xf6c4('0xa')](),controller['create']);router[_0xf6c4('0x15')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller[_0xf6c4('0x16')]);router[_0xf6c4('0x17')](_0xf6c4('0xc'),auth[_0xf6c4('0xa')](),controller['destroy']);module[_0xf6c4('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 707b67e..5ae1c00 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x1d143f,_0x1ac44e){var _0x163e17=function(_0x2e4d56){while(--_0x2e4d56){_0x1d143f['push'](_0x1d143f['shift']());}};_0x163e17(++_0x1ac44e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x474a40,_0x3377aa){var _0x21f947=function(_0xfe8aba){while(--_0xfe8aba){_0x474a40['push'](_0x474a40['shift']());}};_0x21f947(++_0x3377aa);}(_0xda19,0xd5));var _0x9da1=function(_0x4ba81e,_0x406c22){_0x4ba81e=_0x4ba81e-0x0;var _0x1d2886=_0xda19[_0x4ba81e];return _0x1d2886;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 1cb7a80..1fb3bb5 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x5738d7,_0x424f69){var _0x19dd9c=function(_0x451278){while(--_0x451278){_0x5738d7['push'](_0x5738d7['shift']());}};_0x19dd9c(++_0x424f69);}(_0xba34,0x119));var _0x4ba3=function(_0x3d4028,_0x16c16d){_0x3d4028=_0x3d4028-0x0;var _0x1609a1=_0xba34[_0x3d4028];return _0x1609a1;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x59b677,_0xf359aa){var _0x5bb449=function(_0x21cd87){while(--_0x21cd87){_0x59b677['push'](_0x59b677['shift']());}};_0x5bb449(++_0xf359aa);}(_0x814b,0x1a2));var _0xb814=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x814b[_0x1558ab];return _0x53b64a;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a0e1de9..a178562 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 _0x90e4=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1dd0f3,_0xa04175){var _0x4982ed=function(_0x255e25){while(--_0x255e25){_0x1dd0f3['push'](_0x1dd0f3['shift']());}};_0x4982ed(++_0xa04175);}(_0x90e4,0x1d6));var _0x490e=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0x90e4[_0x6148ee];return _0x5afc74;};'use strict';var _=require(_0x490e('0x0'));var util=require(_0x490e('0x1'));var logger=require(_0x490e('0x2'))(_0x490e('0x3'));var moment=require(_0x490e('0x4'));var BPromise=require(_0x490e('0x5'));var rp=require(_0x490e('0x6'));var fs=require('fs');var path=require(_0x490e('0x7'));var rimraf=require(_0x490e('0x8'));var config=require(_0x490e('0x9'));var attributes=require(_0x490e('0xa'));module[_0x490e('0xb')]=function(_0x25091a,_0x4f0532){return _0x25091a[_0x490e('0xc')](_0x490e('0xd'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa12f=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','util','api','moment','bluebird','path'];(function(_0xd0b141,_0x5fa4dc){var _0x3c06b5=function(_0x4b6a3c){while(--_0x4b6a3c){_0xd0b141['push'](_0xd0b141['shift']());}};_0x3c06b5(++_0x5fa4dc);}(_0xa12f,0xaf));var _0xfa12=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa12f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xfa12('0x0'));var logger=require('../../config/logger')(_0xfa12('0x1'));var moment=require(_0xfa12('0x2'));var BPromise=require(_0xfa12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa12('0x4'));var rimraf=require(_0xfa12('0x5'));var config=require(_0xfa12('0x6'));var attributes=require(_0xfa12('0x7'));module[_0xfa12('0x8')]=function(_0x39cd5d,_0x532950){return _0x39cd5d['define']('AnalyticDefaultReport',attributes,{'tableName':_0xfa12('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 59afde2..b28fe58 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 _0x98ae=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x384b7b,_0x5bc322){var _0x19afdb=function(_0x254a6c){while(--_0x254a6c){_0x384b7b['push'](_0x384b7b['shift']());}};_0x19afdb(++_0x5bc322);}(_0x98ae,0x1c1));var _0xe98a=function(_0x2394f7,_0x3c3ed6){_0x2394f7=_0x2394f7-0x0;var _0x121f33=_0x98ae[_0x2394f7];return _0x121f33;};'use strict';var _=require(_0xe98a('0x0'));var util=require(_0xe98a('0x1'));var moment=require(_0xe98a('0x2'));var BPromise=require(_0xe98a('0x3'));var rs=require(_0xe98a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe98a('0x5'))['db'];var utils=require(_0xe98a('0x6'));var logger=require('../../config/logger')(_0xe98a('0x7'));var config=require('../../config/environment');var jayson=require(_0xe98a('0x8'));var client=jayson[_0xe98a('0x9')][_0xe98a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6fefa4,_0xb398d0,_0x5d4f78){return new BPromise(function(_0xe8b40d,_0x51d9d4){return client[_0xe98a('0xb')](_0x6fefa4,_0x5d4f78)[_0xe98a('0xc')](function(_0x5ceeb9){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0xb398d0,_0xe98a('0xd'));logger[_0xe98a('0xe')](_0xe98a('0xf'),_0xb398d0,_0xe98a('0xd'),JSON[_0xe98a('0x10')](_0x5ceeb9));if(_0x5ceeb9[_0xe98a('0x11')]){if(_0x5ceeb9[_0xe98a('0x11')]['code']===0x1f4){logger[_0xe98a('0x11')](_0xe98a('0x12'),_0xb398d0,_0x5ceeb9[_0xe98a('0x11')][_0xe98a('0x13')]);return _0x51d9d4(_0x5ceeb9[_0xe98a('0x11')]['message']);}logger[_0xe98a('0x11')](_0xe98a('0x12'),_0xb398d0,_0x5ceeb9[_0xe98a('0x11')][_0xe98a('0x13')]);return _0xe8b40d(_0x5ceeb9[_0xe98a('0x11')][_0xe98a('0x13')]);}else{logger[_0xe98a('0x14')](_0xe98a('0x12'),_0xb398d0,_0xe98a('0xd'));_0xe8b40d(_0x5ceeb9['result'][_0xe98a('0x13')]);}})[_0xe98a('0x15')](function(_0xa3334a){logger[_0xe98a('0x11')](_0xe98a('0x12'),_0xb398d0,_0xa3334a);_0x51d9d4(_0xa3334a);});});}
\ No newline at end of file
+var _0x2525=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','ioredis'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2525,0xed));var _0x5252=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2525[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x5252('0x0'));var moment=require('moment');var BPromise=require(_0x5252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5252('0x2'));var db=require(_0x5252('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5252('0x4'))('rpc');var config=require(_0x5252('0x5'));var jayson=require(_0x5252('0x6'));var client=jayson[_0x5252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299174,_0x53c4e6,_0x2de5f4){return new BPromise(function(_0x313201,_0x422f55){return client[_0x5252('0x8')](_0x299174,_0x2de5f4)[_0x5252('0x9')](function(_0x5c0469){logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));logger[_0x5252('0xd')](_0x5252('0xe'),_0x53c4e6,_0x5252('0xc'),JSON[_0x5252('0xf')](_0x5c0469));if(_0x5c0469['error']){if(_0x5c0469[_0x5252('0x10')][_0x5252('0x11')]===0x1f4){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x5c0469['error'][_0x5252('0x12')]);return _0x422f55(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}logger[_0x5252('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53c4e6,_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);return _0x313201(_0x5c0469[_0x5252('0x10')][_0x5252('0x12')]);}else{logger[_0x5252('0xa')](_0x5252('0xb'),_0x53c4e6,_0x5252('0xc'));_0x313201(_0x5c0469[_0x5252('0x13')][_0x5252('0x12')]);}})['catch'](function(_0x24db6f){logger[_0x5252('0x10')](_0x5252('0xb'),_0x53c4e6,_0x24db6f);_0x422f55(_0x24db6f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fb10aca..7e906ce 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 _0xe7e0=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','preview','/:id/run','/:id/query','query','post','create'];(function(_0x477df8,_0x9cb2bb){var _0x54de0c=function(_0x3e092c){while(--_0x3e092c){_0x477df8['push'](_0x477df8['shift']());}};_0x54de0c(++_0x9cb2bb);}(_0xe7e0,0xd3));var _0x0e7e=function(_0x36d716,_0x449e9d){_0x36d716=_0x36d716-0x0;var _0x34df69=_0xe7e0[_0x36d716];return _0x34df69;};'use strict';var multer=require(_0x0e7e('0x0'));var util=require(_0x0e7e('0x1'));var path=require(_0x0e7e('0x2'));var timeout=require(_0x0e7e('0x3'));var express=require(_0x0e7e('0x4'));var router=express[_0x0e7e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0e7e('0x6'));var interaction=require(_0x0e7e('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x0e7e('0x8')]('/',auth[_0x0e7e('0x9')](),controller[_0x0e7e('0xa')]);router[_0x0e7e('0x8')](_0x0e7e('0xb'),auth['isAuthenticated'](),controller[_0x0e7e('0xc')]);router[_0x0e7e('0x8')]('/:id/preview',auth[_0x0e7e('0x9')](),controller[_0x0e7e('0xd')]);router[_0x0e7e('0x8')](_0x0e7e('0xe'),auth[_0x0e7e('0x9')](),controller['run']);router[_0x0e7e('0x8')](_0x0e7e('0xf'),auth[_0x0e7e('0x9')](),controller[_0x0e7e('0x10')]);router[_0x0e7e('0x11')]('/',auth[_0x0e7e('0x9')](),controller[_0x0e7e('0x12')]);router[_0x0e7e('0x13')]('/:id',auth[_0x0e7e('0x9')](),controller[_0x0e7e('0x14')]);router[_0x0e7e('0x15')](_0x0e7e('0xb'),auth['isAuthenticated'](),controller[_0x0e7e('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x563f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x18141b,_0x45c769){var _0x474c30=function(_0x7de6d1){while(--_0x7de6d1){_0x18141b['push'](_0x18141b['shift']());}};_0x474c30(++_0x45c769);}(_0x563f,0x158));var _0xf563=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x563f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var path=require(_0xf563('0x2'));var timeout=require('connect-timeout');var express=require(_0xf563('0x3'));var router=express[_0xf563('0x4')]();var fs_extra=require(_0xf563('0x5'));var auth=require(_0xf563('0x6'));var interaction=require(_0xf563('0x7'));var config=require(_0xf563('0x8'));var controller=require(_0xf563('0x9'));router[_0xf563('0xa')]('/',auth[_0xf563('0xb')](),controller[_0xf563('0xc')]);router[_0xf563('0xa')](_0xf563('0xd'),auth[_0xf563('0xb')](),controller['show']);router[_0xf563('0xa')]('/:id/preview',auth[_0xf563('0xb')](),controller[_0xf563('0xe')]);router['get'](_0xf563('0xf'),auth[_0xf563('0xb')](),controller[_0xf563('0x10')]);router[_0xf563('0xa')](_0xf563('0x11'),auth['isAuthenticated'](),controller[_0xf563('0x12')]);router[_0xf563('0x13')]('/',auth['isAuthenticated'](),controller[_0xf563('0x14')]);router[_0xf563('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf563('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf563('0x17')]);module[_0xf563('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8b841ff..efb28f3 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 _0x9290=['ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING'];(function(_0x245307,_0x12cbb9){var _0x4cf712=function(_0x1ee4af){while(--_0x1ee4af){_0x245307['push'](_0x245307['shift']());}};_0x4cf712(++_0x12cbb9);}(_0x9290,0xe1));var _0x0929=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0x9290[_0x340d75];return _0x3f1114;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0929('0x0'));module[_0x0929('0x1')]={'name':{'type':Sequelize[_0x0929('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0929('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0929('0x3')](_0x0929('0x4'),_0x0929('0x5'),_0x0929('0x6')),'allowNull':![],'defaultValue':_0x0929('0x4')},'savename':{'type':Sequelize[_0x0929('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0929('0x7')]},'endDate':{'type':Sequelize[_0x0929('0x7')]},'status':{'type':Sequelize[_0x0929('0x2')],'defaultValue':_0x0929('0x8')},'type':{'type':Sequelize[_0x0929('0x3')](_0x0929('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x0929('0x9')},'reportId':{'type':Sequelize[_0x0929('0xa')](0xb)[_0x0929('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x42d0=['UNSIGNED','moment','exports','STRING','ENUM','csv','xlsx','DATE','manual','INTEGER'];(function(_0x192f58,_0x79b210){var _0x86ebf5=function(_0x1f3046){while(--_0x1f3046){_0x192f58['push'](_0x192f58['shift']());}};_0x86ebf5(++_0x79b210);}(_0x42d0,0x187));var _0x042d=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x42d0[_0x1f239e];return _0x826971;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x042d('0x0'));module[_0x042d('0x1')]={'name':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x042d('0x3')](_0x042d('0x4'),'pdf',_0x042d('0x5')),'allowNull':![],'defaultValue':_0x042d('0x4')},'savename':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x042d('0x6')]},'status':{'type':Sequelize[_0x042d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x042d('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x042d('0x7')},'reportId':{'type':Sequelize[_0x042d('0x8')](0xb)[_0x042d('0x9')]},'reportType':{'type':Sequelize[_0x042d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 6d3ba09..54df10f 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 _0x806e=['get','ExtractedReports','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4a9d82,_0x1195ba){var _0x4b712c=function(_0x46429b){while(--_0x46429b){_0x4a9d82['push'](_0x4a9d82['shift']());}};_0x4b712c(++_0x1195ba);}(_0x806e,0x1c8));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe806('0x0'));var rimraf=require(_0xe806('0x1'));var zipdir=require(_0xe806('0x2'));var jsonpatch=require(_0xe806('0x3'));var rp=require(_0xe806('0x4'));var moment=require(_0xe806('0x5'));var BPromise=require(_0xe806('0x6'));var Mustache=require(_0xe806('0x7'));var util=require(_0xe806('0x8'));var path=require(_0xe806('0x9'));var sox=require(_0xe806('0xa'));var csv=require(_0xe806('0xb'));var ejs=require(_0xe806('0xc'));var fs=require('fs');var fs_extra=require(_0xe806('0xd'));var _=require(_0xe806('0xe'));var squel=require('squel');var crypto=require(_0xe806('0xf'));var jsforce=require(_0xe806('0x10'));var deskjs=require(_0xe806('0x11'));var toCsv=require(_0xe806('0xb'));var querystring=require(_0xe806('0x12'));var Papa=require('papaparse');var Redis=require(_0xe806('0x13'));var authService=require(_0xe806('0x14'));var qs=require(_0xe806('0x15'));var as=require(_0xe806('0x16'));var hardwareService=require(_0xe806('0x17'));var logger=require('../../config/logger')(_0xe806('0x18'));var utils=require(_0xe806('0x19'));var config=require(_0xe806('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe806('0x1b'))['db'];function respondWithStatusCode(_0x5b0194,_0x9a3e29){_0x9a3e29=_0x9a3e29||0xcc;return function(_0x14857c){if(_0x14857c){return _0x5b0194[_0xe806('0x1c')](_0x9a3e29);}return _0x5b0194[_0xe806('0x1d')](_0x9a3e29)[_0xe806('0x1e')]();};}function respondWithResult(_0x1ac4e4,_0x707269){_0x707269=_0x707269||0xc8;return function(_0x1f251f){if(_0x1f251f){return _0x1ac4e4[_0xe806('0x1d')](_0x707269)[_0xe806('0x1f')](_0x1f251f);}};}function respondWithFilteredResult(_0x413777,_0x2124e7){return function(_0x54e41a){if(_0x54e41a){var _0x5c007f=typeof _0x2124e7['offset']===_0xe806('0x20')&&typeof _0x2124e7[_0xe806('0x21')]===_0xe806('0x20');var _0x12d9b1=_0x54e41a[_0xe806('0x22')];var _0x41dbc2=_0x5c007f?0x0:_0x2124e7[_0xe806('0x23')];var _0x454cc9=_0x5c007f?_0x54e41a[_0xe806('0x22')]:_0x2124e7[_0xe806('0x23')]+_0x2124e7['limit'];var _0x4934b7;if(_0x454cc9>=_0x12d9b1){_0x454cc9=_0x12d9b1;_0x4934b7=0xc8;}else{_0x4934b7=0xce;}_0x413777[_0xe806('0x1d')](_0x4934b7);return _0x413777[_0xe806('0x24')](_0xe806('0x25'),_0x41dbc2+'-'+_0x454cc9+'/'+_0x12d9b1)['json'](_0x54e41a);}return null;};}function patchUpdates(_0x2eb601){return function(_0x3ac975){try{jsonpatch[_0xe806('0x26')](_0x3ac975,_0x2eb601,!![]);}catch(_0x469526){return BPromise[_0xe806('0x27')](_0x469526);}return _0x3ac975[_0xe806('0x28')]();};}function saveUpdates(_0xc90c42,_0x207609){return function(_0x37961f){if(_0x37961f){return _0x37961f[_0xe806('0x29')](_0xc90c42)[_0xe806('0x2a')](function(_0x596cb7){return _0x596cb7;});}return null;};}function removeEntity(_0xae85fa,_0x450e7f){return function(_0x3b8003){if(_0x3b8003){return _0x3b8003[_0xe806('0x2b')]()[_0xe806('0x2a')](function(){var _0x5be5fd=_0x3b8003[_0xe806('0x2c')]({'plain':!![]});var _0x310fd2=_0xe806('0x2d');return db[_0xe806('0x2e')]['destroy']({'where':{'type':_0x310fd2,'resourceId':_0x5be5fd['id']}})['then'](function(){return _0x3b8003;});})[_0xe806('0x2a')](function(){_0xae85fa['status'](0xcc)[_0xe806('0x1e')]();});}};}function handleEntityNotFound(_0x183a6b,_0x4dd1df){return function(_0x425572){if(!_0x425572){_0x183a6b[_0xe806('0x1c')](0x194);}return _0x425572;};}function handleError(_0x99f2c4,_0x74cd36){_0x74cd36=_0x74cd36||0x1f4;return function(_0x5ef2de){logger[_0xe806('0x2f')](_0x5ef2de[_0xe806('0x30')]);if(_0x5ef2de['name']){delete _0x5ef2de[_0xe806('0x31')];}_0x99f2c4[_0xe806('0x1d')](_0x74cd36)['send'](_0x5ef2de);};}exports[_0xe806('0x32')]=function(_0x160a0b,_0x6b2fa6){var _0x493d5d={},_0x5089d3={},_0xc2e8ac={'count':0x0,'rows':[]};var _0x50c97d=_['map'](db[_0xe806('0x33')][_0xe806('0x34')],function(_0x1165ab){return{'name':_0x1165ab[_0xe806('0x35')],'type':_0x1165ab[_0xe806('0x36')][_0xe806('0x37')]};});_0x5089d3[_0xe806('0x38')]=_[_0xe806('0x39')](_0x50c97d,_0xe806('0x31'));_0x5089d3[_0xe806('0x3a')]=_[_0xe806('0x3b')](_0x160a0b[_0xe806('0x3a')]);_0x5089d3[_0xe806('0x3c')]=_['intersection'](_0x5089d3[_0xe806('0x38')],_0x5089d3[_0xe806('0x3a')]);_0x493d5d[_0xe806('0x3d')]=_[_0xe806('0x3e')](_0x5089d3[_0xe806('0x38')],qs[_0xe806('0x3f')](_0x160a0b[_0xe806('0x3a')][_0xe806('0x3f')]));_0x493d5d[_0xe806('0x3d')]=_0x493d5d[_0xe806('0x3d')][_0xe806('0x40')]?_0x493d5d[_0xe806('0x3d')]:_0x5089d3[_0xe806('0x38')];if(!_0x160a0b[_0xe806('0x3a')][_0xe806('0x41')](_0xe806('0x42'))){_0x493d5d[_0xe806('0x21')]=qs[_0xe806('0x21')](_0x160a0b[_0xe806('0x3a')][_0xe806('0x21')]);_0x493d5d[_0xe806('0x23')]=qs[_0xe806('0x23')](_0x160a0b['query'][_0xe806('0x23')]);}_0x493d5d[_0xe806('0x43')]=qs[_0xe806('0x44')](_0x160a0b[_0xe806('0x3a')]['sort']);_0x493d5d[_0xe806('0x45')]=qs['filters'](_['pick'](_0x160a0b[_0xe806('0x3a')],_0x5089d3[_0xe806('0x3c')]),_0x50c97d);if(_0x160a0b[_0xe806('0x3a')][_0xe806('0x46')]){_0x493d5d[_0xe806('0x45')]=_[_0xe806('0x47')](_0x493d5d[_0xe806('0x45')],{'$or':_[_0xe806('0x39')](_0x50c97d,function(_0x46530d){if(_0x46530d[_0xe806('0x36')]!==_0xe806('0x48')){var _0x656921={};_0x656921[_0x46530d[_0xe806('0x31')]]={'$like':'%'+_0x160a0b[_0xe806('0x3a')][_0xe806('0x46')]+'%'};return _0x656921;}})});}_0x493d5d=_['merge']({},_0x493d5d,_0x160a0b[_0xe806('0x49')]);var _0x109d3a={'where':_0x493d5d[_0xe806('0x45')]};return db['AnalyticExtractedReport'][_0xe806('0x22')](_0x109d3a)[_0xe806('0x2a')](function(_0x36bc2b){_0xc2e8ac[_0xe806('0x22')]=_0x36bc2b;if(_0x160a0b['query']['includeAll']){_0x493d5d[_0xe806('0x4a')]=[{'all':!![]}];}return db[_0xe806('0x33')][_0xe806('0x4b')](_0x493d5d);})[_0xe806('0x2a')](function(_0x5ed867){_0xc2e8ac['rows']=_0x5ed867;return _0xc2e8ac;})[_0xe806('0x2a')](respondWithFilteredResult(_0x6b2fa6,_0x493d5d))[_0xe806('0x4c')](handleError(_0x6b2fa6,null));};exports[_0xe806('0x4d')]=function(_0x4fae85,_0x3f64d7){var _0x692c33={'raw':!![],'where':{'id':_0x4fae85[_0xe806('0x4e')]['id']}},_0x218f46={};_0x218f46['model']=_['keys'](db[_0xe806('0x33')][_0xe806('0x34')]);_0x218f46['query']=_[_0xe806('0x3b')](_0x4fae85['query']);_0x218f46[_0xe806('0x3c')]=_['intersection'](_0x218f46[_0xe806('0x38')],_0x218f46[_0xe806('0x3a')]);_0x692c33['attributes']=_['intersection'](_0x218f46[_0xe806('0x38')],qs[_0xe806('0x3f')](_0x4fae85['query'][_0xe806('0x3f')]));_0x692c33[_0xe806('0x3d')]=_0x692c33[_0xe806('0x3d')][_0xe806('0x40')]?_0x692c33['attributes']:_0x218f46['model'];if(_0x4fae85[_0xe806('0x3a')][_0xe806('0x4f')]){_0x692c33['include']=[{'all':!![]}];}_0x692c33=_[_0xe806('0x47')]({},_0x692c33,_0x4fae85[_0xe806('0x49')]);return db['AnalyticExtractedReport'][_0xe806('0x50')](_0x692c33)['then'](handleEntityNotFound(_0x3f64d7,null))[_0xe806('0x2a')](respondWithResult(_0x3f64d7,null))['catch'](handleError(_0x3f64d7,null));};exports[_0xe806('0x51')]=function(_0x1e58ac,_0xe4f7cf){return db[_0xe806('0x33')]['create'](_0x1e58ac[_0xe806('0x52')],{})[_0xe806('0x2a')](function(_0x361de7){var _0x1bf821=_0x1e58ac[_0xe806('0x53')][_0xe806('0x2c')]({'plain':!![]});if(!_0x1bf821)throw new Error(_0xe806('0x54'));if(_0x1bf821[_0xe806('0x55')]===_0xe806('0x53')){var _0xc0d8c7=_0x361de7['get']({'plain':!![]});var _0x1e1064='ExtractedReports';return db[_0xe806('0x56')]['find']({'where':{'name':_0x1e1064,'userProfileId':_0x1bf821['userProfileId']},'raw':!![]})['then'](function(_0x6d12d1){if(_0x6d12d1&&_0x6d12d1['autoAssociation']===0x0){return db[_0xe806('0x2e')]['create']({'name':_0xc0d8c7[_0xe806('0x31')],'resourceId':_0xc0d8c7['id'],'type':_0x6d12d1[_0xe806('0x31')],'sectionId':_0x6d12d1['id']},{})['then'](function(){return _0x361de7;});}else{return _0x361de7;}})[_0xe806('0x4c')](function(_0x44265e){logger['error'](_0xe806('0x57'),_0x44265e);throw _0x44265e;});}return _0x361de7;})[_0xe806('0x2a')](respondWithResult(_0xe4f7cf,0xc9))[_0xe806('0x4c')](handleError(_0xe4f7cf,null));};exports[_0xe806('0x29')]=function(_0x45b5a7,_0x26cd34){if(_0x45b5a7[_0xe806('0x52')]['id']){delete _0x45b5a7[_0xe806('0x52')]['id'];}return db[_0xe806('0x33')]['find']({'where':{'id':_0x45b5a7[_0xe806('0x4e')]['id']}})[_0xe806('0x2a')](handleEntityNotFound(_0x26cd34,null))[_0xe806('0x2a')](saveUpdates(_0x45b5a7[_0xe806('0x52')],null))['then'](respondWithResult(_0x26cd34,null))[_0xe806('0x4c')](handleError(_0x26cd34,null));};exports[_0xe806('0x2b')]=function(_0x24458f,_0x56aba2){return db['AnalyticExtractedReport'][_0xe806('0x50')]({'where':{'id':_0x24458f[_0xe806('0x4e')]['id']}})[_0xe806('0x2a')](handleEntityNotFound(_0x56aba2,null))[_0xe806('0x2a')](removeEntity(_0x56aba2,null))['catch'](handleError(_0x56aba2,null));};exports[_0xe806('0x58')]=function(_0xd0faa7,_0x2831b8,_0x58b212){return db[_0xe806('0x33')][_0xe806('0x50')]({'where':{'id':_0xd0faa7[_0xe806('0x4e')]['id']},'attributes':[_0xe806('0x31'),_0xe806('0x59'),_0xe806('0x5a'),_0xe806('0x5b')],'raw':!![]})['then'](handleEntityNotFound(_0x2831b8,null))[_0xe806('0x2a')](function(_0x1268a9){if(_0x1268a9){if(!fs['existsSync'](path['join'](config[_0xe806('0x5c')],_0xe806('0x5d'),_0x1268a9[_0xe806('0x5a')]))){throw new db[(_0xe806('0x5e'))]['ValidationError'](_0xe806('0x5f'));}if(_0xd0faa7[_0xe806('0x3a')]['exists']){return _0x2831b8['sendStatus'](0xc8);}return _0x2831b8[_0xe806('0x58')](path[_0xe806('0x60')](config[_0xe806('0x5c')],_0xe806('0x5d'),_0x1268a9['savename']),util[_0xe806('0x61')](_0xe806('0x62'),_0x1268a9['basename']||_0x1268a9[_0xe806('0x31')],_0x1268a9[_0xe806('0x5b')][_0xe806('0x63')]()));}})[_0xe806('0x4c')](handleError(_0x2831b8,null));};
\ No newline at end of file
+var _0x4f95=['options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x26e864,_0x213b9d){var _0x5e0a65=function(_0x817b4){while(--_0x817b4){_0x26e864['push'](_0x26e864['shift']());}};_0x5e0a65(++_0x213b9d);}(_0x4f95,0xd8));var _0x54f9=function(_0x380165,_0x312a04){_0x380165=_0x380165-0x0;var _0x5ce714=_0x4f95[_0x380165];return _0x5ce714;};'use strict';var emlformat=require(_0x54f9('0x0'));var rimraf=require(_0x54f9('0x1'));var zipdir=require(_0x54f9('0x2'));var jsonpatch=require(_0x54f9('0x3'));var rp=require('request-promise');var moment=require(_0x54f9('0x4'));var BPromise=require(_0x54f9('0x5'));var Mustache=require(_0x54f9('0x6'));var util=require(_0x54f9('0x7'));var path=require(_0x54f9('0x8'));var sox=require(_0x54f9('0x9'));var csv=require(_0x54f9('0xa'));var ejs=require(_0x54f9('0xb'));var fs=require('fs');var fs_extra=require(_0x54f9('0xc'));var _=require(_0x54f9('0xd'));var squel=require(_0x54f9('0xe'));var crypto=require('crypto');var jsforce=require(_0x54f9('0xf'));var deskjs=require(_0x54f9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x54f9('0x11'));var Papa=require(_0x54f9('0x12'));var Redis=require('ioredis');var authService=require(_0x54f9('0x13'));var qs=require(_0x54f9('0x14'));var as=require(_0x54f9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54f9('0x16'))('api');var utils=require(_0x54f9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x54f9('0x18'));var db=require(_0x54f9('0x19'))['db'];function respondWithStatusCode(_0x130bb7,_0x2c6191){_0x2c6191=_0x2c6191||0xcc;return function(_0x245ef9){if(_0x245ef9){return _0x130bb7[_0x54f9('0x1a')](_0x2c6191);}return _0x130bb7[_0x54f9('0x1b')](_0x2c6191)['end']();};}function respondWithResult(_0x37fe29,_0x3edb06){_0x3edb06=_0x3edb06||0xc8;return function(_0x165bfa){if(_0x165bfa){return _0x37fe29['status'](_0x3edb06)[_0x54f9('0x1c')](_0x165bfa);}};}function respondWithFilteredResult(_0x506d77,_0x2c6d6e){return function(_0x4df12f){if(_0x4df12f){var _0x3f3e82=typeof _0x2c6d6e[_0x54f9('0x1d')]===_0x54f9('0x1e')&&typeof _0x2c6d6e[_0x54f9('0x1f')]===_0x54f9('0x1e');var _0x3d56ce=_0x4df12f[_0x54f9('0x20')];var _0x4f07ac=_0x3f3e82?0x0:_0x2c6d6e[_0x54f9('0x1d')];var _0x38a96b=_0x3f3e82?_0x4df12f[_0x54f9('0x20')]:_0x2c6d6e[_0x54f9('0x1d')]+_0x2c6d6e['limit'];var _0x2e63bf;if(_0x38a96b>=_0x3d56ce){_0x38a96b=_0x3d56ce;_0x2e63bf=0xc8;}else{_0x2e63bf=0xce;}_0x506d77[_0x54f9('0x1b')](_0x2e63bf);return _0x506d77['set'](_0x54f9('0x21'),_0x4f07ac+'-'+_0x38a96b+'/'+_0x3d56ce)[_0x54f9('0x1c')](_0x4df12f);}return null;};}function patchUpdates(_0xc399ba){return function(_0xf4ebdd){try{jsonpatch[_0x54f9('0x22')](_0xf4ebdd,_0xc399ba,!![]);}catch(_0x67e16c){return BPromise['reject'](_0x67e16c);}return _0xf4ebdd[_0x54f9('0x23')]();};}function saveUpdates(_0x445a3d,_0x4a26c4){return function(_0x255ed7){if(_0x255ed7){return _0x255ed7['update'](_0x445a3d)[_0x54f9('0x24')](function(_0x24aae1){return _0x24aae1;});}return null;};}function removeEntity(_0x3e90bc,_0x14a7aa){return function(_0x2235b7){if(_0x2235b7){return _0x2235b7[_0x54f9('0x25')]()[_0x54f9('0x24')](function(){var _0x3a836e=_0x2235b7[_0x54f9('0x26')]({'plain':!![]});var _0x41fac8=_0x54f9('0x27');return db[_0x54f9('0x28')][_0x54f9('0x25')]({'where':{'type':_0x41fac8,'resourceId':_0x3a836e['id']}})[_0x54f9('0x24')](function(){return _0x2235b7;});})[_0x54f9('0x24')](function(){_0x3e90bc[_0x54f9('0x1b')](0xcc)[_0x54f9('0x29')]();});}};}function handleEntityNotFound(_0xbe0659,_0x425ae6){return function(_0x9fa40c){if(!_0x9fa40c){_0xbe0659[_0x54f9('0x1a')](0x194);}return _0x9fa40c;};}function handleError(_0x14ddff,_0x544742){_0x544742=_0x544742||0x1f4;return function(_0x2d2faf){logger[_0x54f9('0x2a')](_0x2d2faf[_0x54f9('0x2b')]);if(_0x2d2faf[_0x54f9('0x2c')]){delete _0x2d2faf['name'];}_0x14ddff['status'](_0x544742)[_0x54f9('0x2d')](_0x2d2faf);};}exports[_0x54f9('0x2e')]=function(_0xb0927e,_0x6786a8){var _0x2d28a4={},_0xe8772d={},_0x20930b={'count':0x0,'rows':[]};var _0x236ac8=_[_0x54f9('0x2f')](db['AnalyticExtractedReport'][_0x54f9('0x30')],function(_0x53e263){return{'name':_0x53e263[_0x54f9('0x31')],'type':_0x53e263['type'][_0x54f9('0x32')]};});_0xe8772d['model']=_[_0x54f9('0x2f')](_0x236ac8,_0x54f9('0x2c'));_0xe8772d['query']=_[_0x54f9('0x33')](_0xb0927e['query']);_0xe8772d[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0xe8772d[_0x54f9('0x36')],_0xe8772d[_0x54f9('0x37')]);_0x2d28a4[_0x54f9('0x38')]=_['intersection'](_0xe8772d[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x39')]));_0x2d28a4['attributes']=_0x2d28a4['attributes'][_0x54f9('0x3a')]?_0x2d28a4[_0x54f9('0x38')]:_0xe8772d['model'];if(!_0xb0927e['query'][_0x54f9('0x3b')](_0x54f9('0x3c'))){_0x2d28a4[_0x54f9('0x1f')]=qs['limit'](_0xb0927e[_0x54f9('0x37')][_0x54f9('0x1f')]);_0x2d28a4[_0x54f9('0x1d')]=qs[_0x54f9('0x1d')](_0xb0927e['query'][_0x54f9('0x1d')]);}_0x2d28a4['order']=qs[_0x54f9('0x3d')](_0xb0927e[_0x54f9('0x37')]['sort']);_0x2d28a4['where']=qs[_0x54f9('0x34')](_[_0x54f9('0x3e')](_0xb0927e['query'],_0xe8772d[_0x54f9('0x34')]),_0x236ac8);if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x3f')]){_0x2d28a4[_0x54f9('0x40')]=_[_0x54f9('0x41')](_0x2d28a4[_0x54f9('0x40')],{'$or':_[_0x54f9('0x2f')](_0x236ac8,function(_0x105988){if(_0x105988['type']!=='VIRTUAL'){var _0x374b3e={};_0x374b3e[_0x105988[_0x54f9('0x2c')]]={'$like':'%'+_0xb0927e['query'][_0x54f9('0x3f')]+'%'};return _0x374b3e;}})});}_0x2d28a4=_[_0x54f9('0x41')]({},_0x2d28a4,_0xb0927e[_0x54f9('0x42')]);var _0x291a33={'where':_0x2d28a4['where']};return db[_0x54f9('0x43')][_0x54f9('0x20')](_0x291a33)['then'](function(_0x18e160){_0x20930b['count']=_0x18e160;if(_0xb0927e[_0x54f9('0x37')][_0x54f9('0x44')]){_0x2d28a4[_0x54f9('0x45')]=[{'all':!![]}];}return db[_0x54f9('0x43')][_0x54f9('0x46')](_0x2d28a4);})[_0x54f9('0x24')](function(_0x212790){_0x20930b['rows']=_0x212790;return _0x20930b;})[_0x54f9('0x24')](respondWithFilteredResult(_0x6786a8,_0x2d28a4))[_0x54f9('0x47')](handleError(_0x6786a8,null));};exports[_0x54f9('0x48')]=function(_0x4c1c3d,_0x81fd31){var _0x10661f={'raw':!![],'where':{'id':_0x4c1c3d[_0x54f9('0x49')]['id']}},_0x286d96={};_0x286d96[_0x54f9('0x36')]=_[_0x54f9('0x33')](db['AnalyticExtractedReport'][_0x54f9('0x30')]);_0x286d96[_0x54f9('0x37')]=_[_0x54f9('0x33')](_0x4c1c3d['query']);_0x286d96[_0x54f9('0x34')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],_0x286d96['query']);_0x10661f[_0x54f9('0x38')]=_[_0x54f9('0x35')](_0x286d96[_0x54f9('0x36')],qs[_0x54f9('0x39')](_0x4c1c3d['query']['fields']));_0x10661f[_0x54f9('0x38')]=_0x10661f[_0x54f9('0x38')]['length']?_0x10661f[_0x54f9('0x38')]:_0x286d96['model'];if(_0x4c1c3d['query'][_0x54f9('0x44')]){_0x10661f[_0x54f9('0x45')]=[{'all':!![]}];}_0x10661f=_[_0x54f9('0x41')]({},_0x10661f,_0x4c1c3d[_0x54f9('0x42')]);return db['AnalyticExtractedReport'][_0x54f9('0x4a')](_0x10661f)[_0x54f9('0x24')](handleEntityNotFound(_0x81fd31,null))[_0x54f9('0x24')](respondWithResult(_0x81fd31,null))['catch'](handleError(_0x81fd31,null));};exports['create']=function(_0x26027d,_0x12f230){return db[_0x54f9('0x43')]['create'](_0x26027d[_0x54f9('0x4b')],{})['then'](function(_0x4e2e04){var _0x95bd4a=_0x26027d['user']['get']({'plain':!![]});if(!_0x95bd4a)throw new Error(_0x54f9('0x4c'));if(_0x95bd4a[_0x54f9('0x4d')]===_0x54f9('0x4e')){var _0x34b159=_0x4e2e04[_0x54f9('0x26')]({'plain':!![]});var _0x4685cd='ExtractedReports';return db[_0x54f9('0x4f')][_0x54f9('0x4a')]({'where':{'name':_0x4685cd,'userProfileId':_0x95bd4a['userProfileId']},'raw':!![]})['then'](function(_0x4b4159){if(_0x4b4159&&_0x4b4159['autoAssociation']===0x0){return db[_0x54f9('0x28')][_0x54f9('0x50')]({'name':_0x34b159['name'],'resourceId':_0x34b159['id'],'type':_0x4b4159[_0x54f9('0x2c')],'sectionId':_0x4b4159['id']},{})[_0x54f9('0x24')](function(){return _0x4e2e04;});}else{return _0x4e2e04;}})[_0x54f9('0x47')](function(_0x2e6452){logger[_0x54f9('0x2a')](_0x54f9('0x51'),_0x2e6452);throw _0x2e6452;});}return _0x4e2e04;})[_0x54f9('0x24')](respondWithResult(_0x12f230,0xc9))[_0x54f9('0x47')](handleError(_0x12f230,null));};exports[_0x54f9('0x52')]=function(_0x49b64f,_0x30380e){if(_0x49b64f[_0x54f9('0x4b')]['id']){delete _0x49b64f[_0x54f9('0x4b')]['id'];}return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x49b64f[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x30380e,null))[_0x54f9('0x24')](saveUpdates(_0x49b64f[_0x54f9('0x4b')],null))[_0x54f9('0x24')](respondWithResult(_0x30380e,null))['catch'](handleError(_0x30380e,null));};exports['destroy']=function(_0x405f8e,_0x10693b){return db[_0x54f9('0x43')]['find']({'where':{'id':_0x405f8e[_0x54f9('0x49')]['id']}})[_0x54f9('0x24')](handleEntityNotFound(_0x10693b,null))[_0x54f9('0x24')](removeEntity(_0x10693b,null))['catch'](handleError(_0x10693b,null));};exports[_0x54f9('0x53')]=function(_0x4ec5fb,_0x19b7bb,_0x341bbd){return db[_0x54f9('0x43')][_0x54f9('0x4a')]({'where':{'id':_0x4ec5fb[_0x54f9('0x49')]['id']},'attributes':[_0x54f9('0x2c'),_0x54f9('0x54'),_0x54f9('0x55'),'output'],'raw':!![]})[_0x54f9('0x24')](handleEntityNotFound(_0x19b7bb,null))[_0x54f9('0x24')](function(_0x9e8ce5){if(_0x9e8ce5){if(!fs['existsSync'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5['savename']))){throw new db['Sequelize'][(_0x54f9('0x59'))](_0x54f9('0x5a'));}if(_0x4ec5fb[_0x54f9('0x37')][_0x54f9('0x5b')]){return _0x19b7bb[_0x54f9('0x1a')](0xc8);}return _0x19b7bb['download'](path[_0x54f9('0x56')](config[_0x54f9('0x57')],_0x54f9('0x58'),_0x9e8ce5[_0x54f9('0x55')]),util['format']('%s.%s',_0x9e8ce5[_0x54f9('0x54')]||_0x9e8ce5['name'],_0x9e8ce5[_0x54f9('0x5c')][_0x54f9('0x5d')]()));}})[_0x54f9('0x47')](handleError(_0x19b7bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b522e3b..e099ced 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 _0x6cc2=['api','moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cc2,0x1ee));var _0x26cc=function(_0x36fb18,_0x1577ec){_0x36fb18=_0x36fb18-0x0;var _0x281bf8=_0x6cc2[_0x36fb18];return _0x281bf8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x26cc('0x0'))(_0x26cc('0x1'));var moment=require(_0x26cc('0x2'));var BPromise=require('bluebird');var rp=require(_0x26cc('0x3'));var fs=require('fs');var path=require(_0x26cc('0x4'));var rimraf=require('rimraf');var config=require(_0x26cc('0x5'));var attributes=require(_0x26cc('0x6'));module['exports']=function(_0x1321cb,_0x482867){return _0x1321cb['define'](_0x26cc('0x7'),attributes,{'tableName':_0x26cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3709=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3709,0x108));var _0x9370=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3709[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9370('0x0'));var util=require(_0x9370('0x1'));var logger=require(_0x9370('0x2'))('api');var moment=require(_0x9370('0x3'));var BPromise=require(_0x9370('0x4'));var rp=require(_0x9370('0x5'));var fs=require('fs');var path=require(_0x9370('0x6'));var rimraf=require(_0x9370('0x7'));var config=require(_0x9370('0x8'));var attributes=require(_0x9370('0x9'));module[_0x9370('0xa')]=function(_0x9ae5c,_0x4c3bbc){return _0x9ae5c[_0x9370('0xb')](_0x9370('0xc'),attributes,{'tableName':_0x9370('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index a8470f1..af68ea8 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 _0xd01c=['jayson/promise','client','http','request','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd01c,0xfb));var _0xcd01=function(_0xcb6dec,_0x263746){_0xcb6dec=_0xcb6dec-0x0;var _0x196908=_0xd01c[_0xcb6dec];return _0x196908;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var moment=require(_0xcd01('0x2'));var BPromise=require(_0xcd01('0x3'));var rs=require(_0xcd01('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd01('0x5'))['db'];var utils=require(_0xcd01('0x6'));var logger=require(_0xcd01('0x7'))('rpc');var config=require(_0xcd01('0x8'));var jayson=require(_0xcd01('0x9'));var client=jayson[_0xcd01('0xa')][_0xcd01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52bf91,_0x3d8249,_0x19c845){return new BPromise(function(_0x3b9975,_0x422b2f){return client[_0xcd01('0xc')](_0x52bf91,_0x19c845)['then'](function(_0x287988){logger[_0xcd01('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d8249,'request\x20sent');logger[_0xcd01('0xe')](_0xcd01('0xf'),_0x3d8249,_0xcd01('0x10'),JSON['stringify'](_0x287988));if(_0x287988[_0xcd01('0x11')]){if(_0x287988[_0xcd01('0x11')][_0xcd01('0x12')]===0x1f4){logger[_0xcd01('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d8249,_0x287988[_0xcd01('0x11')][_0xcd01('0x13')]);return _0x422b2f(_0x287988[_0xcd01('0x11')][_0xcd01('0x13')]);}logger[_0xcd01('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d8249,_0x287988[_0xcd01('0x11')][_0xcd01('0x13')]);return _0x3b9975(_0x287988['error']['message']);}else{logger[_0xcd01('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d8249,_0xcd01('0x10'));_0x3b9975(_0x287988['result'][_0xcd01('0x13')]);}})['catch'](function(_0x4419b6){logger[_0xcd01('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d8249,_0x4419b6);_0x422b2f(_0x4419b6);});});}
\ No newline at end of file
+var _0x5b92=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5b92,0x1a0));var _0x25b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5b92[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require(_0x25b9('0x2'));var BPromise=require(_0x25b9('0x3'));var rs=require(_0x25b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b9('0x5'))['db'];var utils=require(_0x25b9('0x6'));var logger=require('../../config/logger')(_0x25b9('0x7'));var config=require(_0x25b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25b9('0x9')][_0x25b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ee3c7,_0x3e4833,_0x148570){return new BPromise(function(_0xbea936,_0x452b97){return client[_0x25b9('0xb')](_0x4ee3c7,_0x148570)[_0x25b9('0xc')](function(_0x490e6b){logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));logger[_0x25b9('0x10')](_0x25b9('0x11'),_0x3e4833,'request\x20sent',JSON['stringify'](_0x490e6b));if(_0x490e6b[_0x25b9('0x12')]){if(_0x490e6b[_0x25b9('0x12')][_0x25b9('0x13')]===0x1f4){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x490e6b[_0x25b9('0x12')][_0x25b9('0x14')]);return _0x452b97(_0x490e6b['error'][_0x25b9('0x14')]);}logger[_0x25b9('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e4833,_0x490e6b['error'][_0x25b9('0x14')]);return _0xbea936(_0x490e6b['error']['message']);}else{logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x3e4833,_0x25b9('0xf'));_0xbea936(_0x490e6b[_0x25b9('0x15')][_0x25b9('0x14')]);}})[_0x25b9('0x16')](function(_0x2ac891){logger[_0x25b9('0x12')](_0x25b9('0xe'),_0x3e4833,_0x2ac891);_0x452b97(_0x2ac891);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b2fb7c8..4715193 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 _0xf069=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3cdd66,_0x9e884e){var _0xf87a9=function(_0x2df39b){while(--_0x2df39b){_0x3cdd66['push'](_0x3cdd66['shift']());}};_0xf87a9(++_0x9e884e);}(_0xf069,0x161));var _0x9f06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf069[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9f06('0x0'));var util=require(_0x9f06('0x1'));var path=require(_0x9f06('0x2'));var timeout=require(_0x9f06('0x3'));var express=require('express');var router=express[_0x9f06('0x4')]();var fs_extra=require(_0x9f06('0x5'));var auth=require(_0x9f06('0x6'));var interaction=require(_0x9f06('0x7'));var config=require('../../config/environment');var controller=require(_0x9f06('0x8'));router[_0x9f06('0x9')]('/',auth[_0x9f06('0xa')](),controller['index']);router[_0x9f06('0x9')]('/:id',auth[_0x9f06('0xa')](),controller['show']);router[_0x9f06('0x9')](_0x9f06('0xb'),auth['isAuthenticated'](),controller[_0x9f06('0xc')]);router[_0x9f06('0xd')]('/',auth[_0x9f06('0xa')](),controller[_0x9f06('0xe')]);router[_0x9f06('0xf')](_0x9f06('0x10'),auth['isAuthenticated'](),controller[_0x9f06('0x11')]);router[_0x9f06('0x12')](_0x9f06('0x10'),auth['isAuthenticated'](),controller[_0x9f06('0x13')]);module[_0x9f06('0x14')]=router;
\ No newline at end of file
+var _0x3db6=['../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','/:id','show','/:id/download','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x3db6,0x7c));var _0x63db=function(_0x100b1a,_0x30dd8d){_0x100b1a=_0x100b1a-0x0;var _0x14ac83=_0x3db6[_0x100b1a];return _0x14ac83;};'use strict';var multer=require(_0x63db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63db('0x1'));var express=require('express');var router=express[_0x63db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x63db('0x3'));var interaction=require(_0x63db('0x4'));var config=require('../../config/environment');var controller=require(_0x63db('0x5'));router['get']('/',auth[_0x63db('0x6')](),controller['index']);router['get'](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0x8')]);router['get'](_0x63db('0x9'),auth[_0x63db('0x6')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x63db('0xa')]);router[_0x63db('0xb')](_0x63db('0x7'),auth[_0x63db('0x6')](),controller[_0x63db('0xc')]);router[_0x63db('0xd')]('/:id',auth[_0x63db('0x6')](),controller[_0x63db('0xe')]);module[_0x63db('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6f54f36..647da44 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 _0xc383=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0xc383,0x1e1));var _0x3c38=function(_0x1c53e1,_0x16f552){_0x1c53e1=_0x1c53e1-0x0;var _0x2073f2=_0xc383[_0x1c53e1];return _0x2073f2;};'use strict';var Sequelize=require(_0x3c38('0x0'));module[_0x3c38('0x1')]={'field':{'type':Sequelize[_0x3c38('0x2')]},'alias':{'type':Sequelize[_0x3c38('0x3')]},'function':{'type':Sequelize[_0x3c38('0x3')]},'format':{'type':Sequelize[_0x3c38('0x3')]},'groupBy':{'type':Sequelize[_0x3c38('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3c38('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa6cb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x382f76,_0x46c9e4){var _0x40a66f=function(_0x41d861){while(--_0x41d861){_0x382f76['push'](_0x382f76['shift']());}};_0x40a66f(++_0x46c9e4);}(_0xa6cb,0x123));var _0xba6c=function(_0x1ec498,_0x22a287){_0x1ec498=_0x1ec498-0x0;var _0x5e8fb7=_0xa6cb[_0x1ec498];return _0x5e8fb7;};'use strict';var Sequelize=require('sequelize');module[_0xba6c('0x0')]={'field':{'type':Sequelize[_0xba6c('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xba6c('0x2')]},'format':{'type':Sequelize[_0xba6c('0x2')]},'groupBy':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xba6c('0x2')]},'custom':{'type':Sequelize[_0xba6c('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index d96f10a..49df0a6 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 _0x6214=['reject','save','destroy','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','then','includeAll','include','show','params','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4e907f,_0x5d6a36){var _0x380b56=function(_0xc18ed7){while(--_0xc18ed7){_0x4e907f['push'](_0x4e907f['shift']());}};_0x380b56(++_0x5d6a36);}(_0x6214,0xda));var _0x4621=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x6214[_0x1d87fc];return _0x492b56;};'use strict';var emlformat=require(_0x4621('0x0'));var rimraf=require(_0x4621('0x1'));var zipdir=require(_0x4621('0x2'));var jsonpatch=require(_0x4621('0x3'));var rp=require(_0x4621('0x4'));var moment=require(_0x4621('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4621('0x6'));var util=require(_0x4621('0x7'));var path=require(_0x4621('0x8'));var sox=require(_0x4621('0x9'));var csv=require(_0x4621('0xa'));var ejs=require(_0x4621('0xb'));var fs=require('fs');var fs_extra=require(_0x4621('0xc'));var _=require('lodash');var squel=require(_0x4621('0xd'));var crypto=require(_0x4621('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4621('0xa'));var querystring=require(_0x4621('0xf'));var Papa=require(_0x4621('0x10'));var Redis=require(_0x4621('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4621('0x12'));var hardwareService=require(_0x4621('0x13'));var logger=require(_0x4621('0x14'))(_0x4621('0x15'));var utils=require(_0x4621('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4621('0x17'));var db=require(_0x4621('0x18'))['db'];function respondWithStatusCode(_0x4a92f0,_0x284741){_0x284741=_0x284741||0xcc;return function(_0x295113){if(_0x295113){return _0x4a92f0[_0x4621('0x19')](_0x284741);}return _0x4a92f0[_0x4621('0x1a')](_0x284741)['end']();};}function respondWithResult(_0x5b041e,_0x2a9767){_0x2a9767=_0x2a9767||0xc8;return function(_0x2f033e){if(_0x2f033e){return _0x5b041e[_0x4621('0x1a')](_0x2a9767)[_0x4621('0x1b')](_0x2f033e);}};}function respondWithFilteredResult(_0xdd03f2,_0x1da6f4){return function(_0x2d570d){if(_0x2d570d){var _0x25bd22=typeof _0x1da6f4[_0x4621('0x1c')]===_0x4621('0x1d')&&typeof _0x1da6f4[_0x4621('0x1e')]===_0x4621('0x1d');var _0x23fb9f=_0x2d570d[_0x4621('0x1f')];var _0xa72b04=_0x25bd22?0x0:_0x1da6f4[_0x4621('0x1c')];var _0x16303c=_0x25bd22?_0x2d570d[_0x4621('0x1f')]:_0x1da6f4[_0x4621('0x1c')]+_0x1da6f4['limit'];var _0x2e40bc;if(_0x16303c>=_0x23fb9f){_0x16303c=_0x23fb9f;_0x2e40bc=0xc8;}else{_0x2e40bc=0xce;}_0xdd03f2[_0x4621('0x1a')](_0x2e40bc);return _0xdd03f2[_0x4621('0x20')](_0x4621('0x21'),_0xa72b04+'-'+_0x16303c+'/'+_0x23fb9f)['json'](_0x2d570d);}return null;};}function patchUpdates(_0x2f7606){return function(_0x172f58){try{jsonpatch['apply'](_0x172f58,_0x2f7606,!![]);}catch(_0x27a3ec){return BPromise[_0x4621('0x22')](_0x27a3ec);}return _0x172f58[_0x4621('0x23')]();};}function saveUpdates(_0x1469e8,_0x36077e){return function(_0x4e634a){if(_0x4e634a){return _0x4e634a['update'](_0x1469e8)['then'](function(_0x3763e0){return _0x3763e0;});}return null;};}function removeEntity(_0x12839a,_0x2f2591){return function(_0x553286){if(_0x553286){return _0x553286[_0x4621('0x24')]()['then'](function(){_0x12839a[_0x4621('0x1a')](0xcc)[_0x4621('0x25')]();});}};}function handleEntityNotFound(_0x219cb2,_0x195789){return function(_0x4b54fc){if(!_0x4b54fc){_0x219cb2[_0x4621('0x19')](0x194);}return _0x4b54fc;};}function handleError(_0x51d405,_0x37459d){_0x37459d=_0x37459d||0x1f4;return function(_0x216594){logger[_0x4621('0x26')](_0x216594[_0x4621('0x27')]);if(_0x216594[_0x4621('0x28')]){delete _0x216594['name'];}_0x51d405[_0x4621('0x1a')](_0x37459d)[_0x4621('0x29')](_0x216594);};}exports[_0x4621('0x2a')]=function(_0x35bd7a,_0x1f1bde){var _0x17e3bf={},_0x52bfd6={},_0x41b567={'count':0x0,'rows':[]};var _0x36c392=_['map'](db[_0x4621('0x2b')][_0x4621('0x2c')],function(_0x3f6b4f){return{'name':_0x3f6b4f[_0x4621('0x2d')],'type':_0x3f6b4f[_0x4621('0x2e')]['key']};});_0x52bfd6[_0x4621('0x2f')]=_[_0x4621('0x30')](_0x36c392,_0x4621('0x28'));_0x52bfd6['query']=_[_0x4621('0x31')](_0x35bd7a[_0x4621('0x32')]);_0x52bfd6[_0x4621('0x33')]=_[_0x4621('0x34')](_0x52bfd6[_0x4621('0x2f')],_0x52bfd6['query']);_0x17e3bf['attributes']=_[_0x4621('0x34')](_0x52bfd6[_0x4621('0x2f')],qs[_0x4621('0x35')](_0x35bd7a[_0x4621('0x32')][_0x4621('0x35')]));_0x17e3bf[_0x4621('0x36')]=_0x17e3bf[_0x4621('0x36')][_0x4621('0x37')]?_0x17e3bf[_0x4621('0x36')]:_0x52bfd6[_0x4621('0x2f')];if(!_0x35bd7a['query'][_0x4621('0x38')]('nolimit')){_0x17e3bf['limit']=qs[_0x4621('0x1e')](_0x35bd7a[_0x4621('0x32')][_0x4621('0x1e')]);_0x17e3bf[_0x4621('0x1c')]=qs[_0x4621('0x1c')](_0x35bd7a[_0x4621('0x32')][_0x4621('0x1c')]);}_0x17e3bf[_0x4621('0x39')]=qs[_0x4621('0x3a')](_0x35bd7a[_0x4621('0x32')][_0x4621('0x3a')]);_0x17e3bf['where']=qs['filters'](_[_0x4621('0x3b')](_0x35bd7a[_0x4621('0x32')],_0x52bfd6[_0x4621('0x33')]),_0x36c392);if(_0x35bd7a[_0x4621('0x32')]['filter']){_0x17e3bf[_0x4621('0x3c')]=_[_0x4621('0x3d')](_0x17e3bf[_0x4621('0x3c')],{'$or':_[_0x4621('0x30')](_0x36c392,function(_0x1eb879){if(_0x1eb879[_0x4621('0x2e')]!=='VIRTUAL'){var _0x3e1594={};_0x3e1594[_0x1eb879['name']]={'$like':'%'+_0x35bd7a['query'][_0x4621('0x3e')]+'%'};return _0x3e1594;}})});}_0x17e3bf=_[_0x4621('0x3d')]({},_0x17e3bf,_0x35bd7a[_0x4621('0x3f')]);var _0x52c03f={'where':_0x17e3bf[_0x4621('0x3c')]};return db[_0x4621('0x2b')]['count'](_0x52c03f)[_0x4621('0x40')](function(_0x38dd3e){_0x41b567['count']=_0x38dd3e;if(_0x35bd7a[_0x4621('0x32')][_0x4621('0x41')]){_0x17e3bf[_0x4621('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x17e3bf);})[_0x4621('0x40')](function(_0x22a62f){_0x41b567['rows']=_0x22a62f;return _0x41b567;})[_0x4621('0x40')](respondWithFilteredResult(_0x1f1bde,_0x17e3bf))['catch'](handleError(_0x1f1bde,null));};exports[_0x4621('0x43')]=function(_0x1082c6,_0xb0aa4c){var _0xe80948={'raw':![],'where':{'id':_0x1082c6[_0x4621('0x44')]['id']}},_0x5b3715={};_0x5b3715[_0x4621('0x2f')]=_[_0x4621('0x31')](db[_0x4621('0x2b')][_0x4621('0x2c')]);_0x5b3715['query']=_[_0x4621('0x31')](_0x1082c6[_0x4621('0x32')]);_0x5b3715['filters']=_[_0x4621('0x34')](_0x5b3715[_0x4621('0x2f')],_0x5b3715[_0x4621('0x32')]);_0xe80948[_0x4621('0x36')]=_[_0x4621('0x34')](_0x5b3715[_0x4621('0x2f')],qs['fields'](_0x1082c6[_0x4621('0x32')]['fields']));_0xe80948[_0x4621('0x36')]=_0xe80948[_0x4621('0x36')][_0x4621('0x37')]?_0xe80948[_0x4621('0x36')]:_0x5b3715[_0x4621('0x2f')];if(_0x1082c6[_0x4621('0x32')][_0x4621('0x41')]){_0xe80948['include']=[{'all':!![]}];}_0xe80948=_[_0x4621('0x3d')]({},_0xe80948,_0x1082c6[_0x4621('0x3f')]);return db[_0x4621('0x2b')][_0x4621('0x45')](_0xe80948)[_0x4621('0x40')](handleEntityNotFound(_0xb0aa4c,null))['then'](respondWithResult(_0xb0aa4c,null))[_0x4621('0x46')](handleError(_0xb0aa4c,null));};exports['create']=function(_0xe1cd6c,_0x498b80){return db[_0x4621('0x2b')][_0x4621('0x47')](_0xe1cd6c[_0x4621('0x48')],{})[_0x4621('0x40')](respondWithResult(_0x498b80,0xc9))[_0x4621('0x46')](handleError(_0x498b80,null));};exports[_0x4621('0x49')]=function(_0x3ae63a,_0x5a9d99){return db[_0x4621('0x2b')][_0x4621('0x49')](_0x3ae63a['body'],{'raw':![],'individualHooks':!![]})[_0x4621('0x40')](respondWithResult(_0x5a9d99,0xc9))[_0x4621('0x46')](handleError(_0x5a9d99,null));};exports[_0x4621('0x4a')]=function(_0xf1d93d,_0xed4d11){if(_0xf1d93d[_0x4621('0x48')]['id']){delete _0xf1d93d[_0x4621('0x48')]['id'];}return db[_0x4621('0x2b')]['find']({'where':{'id':_0xf1d93d[_0x4621('0x44')]['id']}})['then'](handleEntityNotFound(_0xed4d11,null))[_0x4621('0x40')](saveUpdates(_0xf1d93d[_0x4621('0x48')],null))[_0x4621('0x40')](respondWithResult(_0xed4d11,null))[_0x4621('0x46')](handleError(_0xed4d11,null));};exports[_0x4621('0x24')]=function(_0x1f68b8,_0x3661d5){return db['AnalyticFieldReport'][_0x4621('0x45')]({'where':{'id':_0x1f68b8['params']['id']}})[_0x4621('0x40')](handleEntityNotFound(_0x3661d5,null))['then'](removeEntity(_0x3661d5,null))[_0x4621('0x46')](handleError(_0x3661d5,null));};exports[_0x4621('0x4b')]=function(_0x27ace0,_0x5a32aa){return db['AnalyticFieldReport'][_0x4621('0x24')]({'where':{'id':_0x27ace0[_0x4621('0x32')][_0x4621('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x4621('0x40')](respondWithResult(_0x5a32aa,0xcc))[_0x4621('0x46')](handleError(_0x5a32aa,null));};exports[_0x4621('0x4d')]=function(_0x1b902d,_0x3c16dd,_0x26cf28){return db[_0x4621('0x4e')][_0x4621('0x4f')]({'where':{'id':_0x1b902d[_0x4621('0x44')]['id']}})[_0x4621('0x40')](handleEntityNotFound(_0x3c16dd,null))[_0x4621('0x40')](function(_0x85fa16){if(_0x85fa16){return db[_0x4621('0x50')][_0x4621('0x51')](function(_0x352261){return db[_0x4621('0x2b')]['destroy']({'where':{'CustomReportId':_0x1b902d[_0x4621('0x44')]['id']},'transaction':_0x352261})['then'](function(_0x748797){var _0x2d66e8=_[_0x4621('0x30')](_0x1b902d[_0x4621('0x48')],function(_0x5348bc){delete _0x5348bc['id'];_0x5348bc[_0x4621('0x52')]=_0x1b902d[_0x4621('0x44')]['id'];return _0x5348bc;});return db['AnalyticFieldReport'][_0x4621('0x49')](_0x2d66e8,{'transaction':_0x352261});});})[_0x4621('0x40')](function(){return db[_0x4621('0x2b')][_0x4621('0x53')]({'where':{'CustomReportId':_0x1b902d[_0x4621('0x44')]['id']}});});}})[_0x4621('0x40')](respondWithResult(_0x3c16dd,null))[_0x4621('0x46')](handleError(_0x3c16dd,null));};
\ No newline at end of file
+var _0xa181=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters'];(function(_0x407844,_0x47eedc){var _0x36f5df=function(_0x31ee6d){while(--_0x31ee6d){_0x407844['push'](_0x407844['shift']());}};_0x36f5df(++_0x47eedc);}(_0xa181,0x10a));var _0x1a18=function(_0x13be3e,_0x10ff28){_0x13be3e=_0x13be3e-0x0;var _0x1fab88=_0xa181[_0x13be3e];return _0x1fab88;};'use strict';var emlformat=require(_0x1a18('0x0'));var rimraf=require(_0x1a18('0x1'));var zipdir=require(_0x1a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a18('0x3'));var moment=require(_0x1a18('0x4'));var BPromise=require(_0x1a18('0x5'));var Mustache=require(_0x1a18('0x6'));var util=require(_0x1a18('0x7'));var path=require(_0x1a18('0x8'));var sox=require('sox');var csv=require(_0x1a18('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a18('0xa'));var _=require(_0x1a18('0xb'));var squel=require(_0x1a18('0xc'));var crypto=require(_0x1a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a18('0xe'));var toCsv=require(_0x1a18('0x9'));var querystring=require(_0x1a18('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a18('0x10'));var authService=require(_0x1a18('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a18('0x12'));var hardwareService=require(_0x1a18('0x13'));var logger=require(_0x1a18('0x14'))(_0x1a18('0x15'));var utils=require(_0x1a18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1a18('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17ae6a,_0x4224d0){_0x4224d0=_0x4224d0||0xcc;return function(_0x4ef94e){if(_0x4ef94e){return _0x17ae6a[_0x1a18('0x18')](_0x4224d0);}return _0x17ae6a['status'](_0x4224d0)[_0x1a18('0x19')]();};}function respondWithResult(_0x15f465,_0x55f592){_0x55f592=_0x55f592||0xc8;return function(_0x1ad393){if(_0x1ad393){return _0x15f465[_0x1a18('0x1a')](_0x55f592)[_0x1a18('0x1b')](_0x1ad393);}};}function respondWithFilteredResult(_0x5da6ce,_0x2785f6){return function(_0x47ac2e){if(_0x47ac2e){var _0x375527=typeof _0x2785f6['offset']===_0x1a18('0x1c')&&typeof _0x2785f6['limit']===_0x1a18('0x1c');var _0x520263=_0x47ac2e[_0x1a18('0x1d')];var _0x301947=_0x375527?0x0:_0x2785f6[_0x1a18('0x1e')];var _0x2a9d04=_0x375527?_0x47ac2e['count']:_0x2785f6['offset']+_0x2785f6['limit'];var _0x464a18;if(_0x2a9d04>=_0x520263){_0x2a9d04=_0x520263;_0x464a18=0xc8;}else{_0x464a18=0xce;}_0x5da6ce[_0x1a18('0x1a')](_0x464a18);return _0x5da6ce[_0x1a18('0x1f')](_0x1a18('0x20'),_0x301947+'-'+_0x2a9d04+'/'+_0x520263)[_0x1a18('0x1b')](_0x47ac2e);}return null;};}function patchUpdates(_0x93a0a7){return function(_0x520018){try{jsonpatch[_0x1a18('0x21')](_0x520018,_0x93a0a7,!![]);}catch(_0x3d86c6){return BPromise[_0x1a18('0x22')](_0x3d86c6);}return _0x520018[_0x1a18('0x23')]();};}function saveUpdates(_0x4d36ca,_0x2f17f6){return function(_0x2007ee){if(_0x2007ee){return _0x2007ee[_0x1a18('0x24')](_0x4d36ca)[_0x1a18('0x25')](function(_0xca4ae9){return _0xca4ae9;});}return null;};}function removeEntity(_0xb4a0b8,_0x3fc2c5){return function(_0x2ac2d7){if(_0x2ac2d7){return _0x2ac2d7[_0x1a18('0x26')]()[_0x1a18('0x25')](function(){_0xb4a0b8[_0x1a18('0x1a')](0xcc)[_0x1a18('0x19')]();});}};}function handleEntityNotFound(_0x5ea7b0,_0x8cebc6){return function(_0x33cef2){if(!_0x33cef2){_0x5ea7b0[_0x1a18('0x18')](0x194);}return _0x33cef2;};}function handleError(_0x397539,_0x3953dd){_0x3953dd=_0x3953dd||0x1f4;return function(_0x1a1d9b){logger['error'](_0x1a1d9b[_0x1a18('0x27')]);if(_0x1a1d9b[_0x1a18('0x28')]){delete _0x1a1d9b[_0x1a18('0x28')];}_0x397539[_0x1a18('0x1a')](_0x3953dd)['send'](_0x1a1d9b);};}exports[_0x1a18('0x29')]=function(_0x4699ab,_0x299277){var _0x17776b={},_0x14c983={},_0x855cca={'count':0x0,'rows':[]};var _0x464a44=_[_0x1a18('0x2a')](db[_0x1a18('0x2b')][_0x1a18('0x2c')],function(_0x3b566e){return{'name':_0x3b566e[_0x1a18('0x2d')],'type':_0x3b566e[_0x1a18('0x2e')][_0x1a18('0x2f')]};});_0x14c983[_0x1a18('0x30')]=_['map'](_0x464a44,_0x1a18('0x28'));_0x14c983['query']=_[_0x1a18('0x31')](_0x4699ab[_0x1a18('0x32')]);_0x14c983['filters']=_['intersection'](_0x14c983['model'],_0x14c983[_0x1a18('0x32')]);_0x17776b[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x14c983[_0x1a18('0x30')],qs[_0x1a18('0x35')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x35')]));_0x17776b[_0x1a18('0x33')]=_0x17776b[_0x1a18('0x33')][_0x1a18('0x36')]?_0x17776b['attributes']:_0x14c983['model'];if(!_0x4699ab[_0x1a18('0x32')][_0x1a18('0x37')](_0x1a18('0x38'))){_0x17776b[_0x1a18('0x39')]=qs[_0x1a18('0x39')](_0x4699ab['query']['limit']);_0x17776b[_0x1a18('0x1e')]=qs[_0x1a18('0x1e')](_0x4699ab[_0x1a18('0x32')][_0x1a18('0x1e')]);}_0x17776b['order']=qs[_0x1a18('0x3a')](_0x4699ab[_0x1a18('0x32')]['sort']);_0x17776b[_0x1a18('0x3b')]=qs['filters'](_[_0x1a18('0x3c')](_0x4699ab[_0x1a18('0x32')],_0x14c983[_0x1a18('0x3d')]),_0x464a44);if(_0x4699ab[_0x1a18('0x32')][_0x1a18('0x3e')]){_0x17776b[_0x1a18('0x3b')]=_[_0x1a18('0x3f')](_0x17776b[_0x1a18('0x3b')],{'$or':_[_0x1a18('0x2a')](_0x464a44,function(_0x40836f){if(_0x40836f[_0x1a18('0x2e')]!==_0x1a18('0x40')){var _0x1d8360={};_0x1d8360[_0x40836f[_0x1a18('0x28')]]={'$like':'%'+_0x4699ab[_0x1a18('0x32')]['filter']+'%'};return _0x1d8360;}})});}_0x17776b=_['merge']({},_0x17776b,_0x4699ab['options']);var _0x85acf0={'where':_0x17776b[_0x1a18('0x3b')]};return db['AnalyticFieldReport']['count'](_0x85acf0)[_0x1a18('0x25')](function(_0xf015b4){_0x855cca[_0x1a18('0x1d')]=_0xf015b4;if(_0x4699ab['query'][_0x1a18('0x41')]){_0x17776b[_0x1a18('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1a18('0x43')](_0x17776b);})['then'](function(_0x31431d){_0x855cca[_0x1a18('0x44')]=_0x31431d;return _0x855cca;})[_0x1a18('0x25')](respondWithFilteredResult(_0x299277,_0x17776b))[_0x1a18('0x45')](handleError(_0x299277,null));};exports[_0x1a18('0x46')]=function(_0x3d127b,_0x30b397){var _0x50fb4e={'raw':![],'where':{'id':_0x3d127b[_0x1a18('0x47')]['id']}},_0x15c0d7={};_0x15c0d7[_0x1a18('0x30')]=_[_0x1a18('0x31')](db[_0x1a18('0x2b')][_0x1a18('0x2c')]);_0x15c0d7['query']=_[_0x1a18('0x31')](_0x3d127b['query']);_0x15c0d7[_0x1a18('0x3d')]=_['intersection'](_0x15c0d7[_0x1a18('0x30')],_0x15c0d7[_0x1a18('0x32')]);_0x50fb4e[_0x1a18('0x33')]=_[_0x1a18('0x34')](_0x15c0d7[_0x1a18('0x30')],qs['fields'](_0x3d127b[_0x1a18('0x32')][_0x1a18('0x35')]));_0x50fb4e[_0x1a18('0x33')]=_0x50fb4e['attributes'][_0x1a18('0x36')]?_0x50fb4e[_0x1a18('0x33')]:_0x15c0d7[_0x1a18('0x30')];if(_0x3d127b[_0x1a18('0x32')]['includeAll']){_0x50fb4e['include']=[{'all':!![]}];}_0x50fb4e=_['merge']({},_0x50fb4e,_0x3d127b['options']);return db[_0x1a18('0x2b')][_0x1a18('0x48')](_0x50fb4e)[_0x1a18('0x25')](handleEntityNotFound(_0x30b397,null))[_0x1a18('0x25')](respondWithResult(_0x30b397,null))[_0x1a18('0x45')](handleError(_0x30b397,null));};exports[_0x1a18('0x49')]=function(_0x377711,_0x45ea4b){return db[_0x1a18('0x2b')][_0x1a18('0x49')](_0x377711[_0x1a18('0x4a')],{})[_0x1a18('0x25')](respondWithResult(_0x45ea4b,0xc9))[_0x1a18('0x45')](handleError(_0x45ea4b,null));};exports[_0x1a18('0x4b')]=function(_0x340660,_0x5434e8){return db[_0x1a18('0x2b')][_0x1a18('0x4b')](_0x340660[_0x1a18('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5434e8,0xc9))[_0x1a18('0x45')](handleError(_0x5434e8,null));};exports['update']=function(_0x15e848,_0x46bdc5){if(_0x15e848[_0x1a18('0x4a')]['id']){delete _0x15e848[_0x1a18('0x4a')]['id'];}return db[_0x1a18('0x2b')][_0x1a18('0x48')]({'where':{'id':_0x15e848[_0x1a18('0x47')]['id']}})['then'](handleEntityNotFound(_0x46bdc5,null))[_0x1a18('0x25')](saveUpdates(_0x15e848[_0x1a18('0x4a')],null))[_0x1a18('0x25')](respondWithResult(_0x46bdc5,null))['catch'](handleError(_0x46bdc5,null));};exports[_0x1a18('0x26')]=function(_0x100830,_0x322487){return db['AnalyticFieldReport'][_0x1a18('0x48')]({'where':{'id':_0x100830[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x322487,null))[_0x1a18('0x25')](removeEntity(_0x322487,null))['catch'](handleError(_0x322487,null));};exports[_0x1a18('0x4c')]=function(_0x35e321,_0x4127e7){return db[_0x1a18('0x2b')]['destroy']({'where':{'id':_0x35e321[_0x1a18('0x32')][_0x1a18('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4127e7,0xcc))[_0x1a18('0x45')](handleError(_0x4127e7,null));};exports['addFields']=function(_0x48642c,_0x3998ac,_0xe42272){return db[_0x1a18('0x4e')]['findOne']({'where':{'id':_0x48642c[_0x1a18('0x47')]['id']}})[_0x1a18('0x25')](handleEntityNotFound(_0x3998ac,null))['then'](function(_0x37aeba){if(_0x37aeba){return db[_0x1a18('0x4f')][_0x1a18('0x50')](function(_0x5e961d){return db[_0x1a18('0x2b')][_0x1a18('0x26')]({'where':{'CustomReportId':_0x48642c[_0x1a18('0x47')]['id']},'transaction':_0x5e961d})['then'](function(_0x323716){var _0x4303cf=_[_0x1a18('0x2a')](_0x48642c[_0x1a18('0x4a')],function(_0x3bfa4c){delete _0x3bfa4c['id'];_0x3bfa4c[_0x1a18('0x51')]=_0x48642c['params']['id'];return _0x3bfa4c;});return db['AnalyticFieldReport']['bulkCreate'](_0x4303cf,{'transaction':_0x5e961d});});})[_0x1a18('0x25')](function(){return db['AnalyticFieldReport'][_0x1a18('0x43')]({'where':{'CustomReportId':_0x48642c['params']['id']}});});}})[_0x1a18('0x25')](respondWithResult(_0x3998ac,null))[_0x1a18('0x45')](handleError(_0x3998ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3b63340..fee67f7 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 _0xd0b0=['api','moment','rimraf','exports','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x5225fe,_0x24e219){var _0x4a7d03=function(_0x3c042b){while(--_0x3c042b){_0x5225fe['push'](_0x5225fe['shift']());}};_0x4a7d03(++_0x24e219);}(_0xd0b0,0x9d));var _0x0d0b=function(_0x2babef,_0x275118){_0x2babef=_0x2babef-0x0;var _0x2274f6=_0xd0b0[_0x2babef];return _0x2274f6;};'use strict';var _=require(_0x0d0b('0x0'));var util=require(_0x0d0b('0x1'));var logger=require(_0x0d0b('0x2'))(_0x0d0b('0x3'));var moment=require(_0x0d0b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0d0b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x0d0b('0x6')]=function(_0x1cffb8,_0x46b38f){return _0x1cffb8['define'](_0x0d0b('0x7'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd472=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd472,0x77));var _0x2d47=function(_0x32b591,_0x83d4fe){_0x32b591=_0x32b591-0x0;var _0x1603f1=_0xd472[_0x32b591];return _0x1603f1;};'use strict';var _=require(_0x2d47('0x0'));var util=require('util');var logger=require(_0x2d47('0x1'))(_0x2d47('0x2'));var moment=require(_0x2d47('0x3'));var BPromise=require(_0x2d47('0x4'));var rp=require(_0x2d47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d47('0x6'));var config=require(_0x2d47('0x7'));var attributes=require(_0x2d47('0x8'));module[_0x2d47('0x9')]=function(_0x4c1c85,_0x5c08a8){return _0x4c1c85[_0x2d47('0xa')](_0x2d47('0xb'),attributes,{'tableName':_0x2d47('0xc'),'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 16caa96..bcc8798 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 _0x4373=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring'];(function(_0x4162b9,_0x4f83c3){var _0x99666b=function(_0x349604){while(--_0x349604){_0x4162b9['push'](_0x4162b9['shift']());}};_0x99666b(++_0x4f83c3);}(_0x4373,0xa5));var _0x3437=function(_0x26341a,_0xc9659d){_0x26341a=_0x26341a-0x0;var _0x56fa8c=_0x4373[_0x26341a];return _0x56fa8c;};'use strict';var _=require(_0x3437('0x0'));var util=require('util');var moment=require(_0x3437('0x1'));var BPromise=require('bluebird');var rs=require(_0x3437('0x2'));var fs=require('fs');var Redis=require(_0x3437('0x3'));var db=require(_0x3437('0x4'))['db'];var utils=require(_0x3437('0x5'));var logger=require(_0x3437('0x6'))(_0x3437('0x7'));var config=require(_0x3437('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3437('0x9')][_0x3437('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36588f,_0x36b915,_0x4b470c){return new BPromise(function(_0x491de3,_0x48ded1){return client['request'](_0x36588f,_0x4b470c)['then'](function(_0x3ef318){logger[_0x3437('0xb')](_0x3437('0xc'),_0x36b915,_0x3437('0xd'));logger[_0x3437('0xe')](_0x3437('0xf'),_0x36b915,_0x3437('0xd'),JSON[_0x3437('0x10')](_0x3ef318));if(_0x3ef318[_0x3437('0x11')]){if(_0x3ef318[_0x3437('0x11')][_0x3437('0x12')]===0x1f4){logger[_0x3437('0x11')](_0x3437('0xc'),_0x36b915,_0x3ef318[_0x3437('0x11')]['message']);return _0x48ded1(_0x3ef318[_0x3437('0x11')][_0x3437('0x13')]);}logger[_0x3437('0x11')](_0x3437('0xc'),_0x36b915,_0x3ef318['error'][_0x3437('0x13')]);return _0x491de3(_0x3ef318[_0x3437('0x11')]['message']);}else{logger[_0x3437('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x36b915,_0x3437('0xd'));_0x491de3(_0x3ef318['result'][_0x3437('0x13')]);}})[_0x3437('0x14')](function(_0x44bbfe){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x36b915,_0x44bbfe);_0x48ded1(_0x44bbfe);});});}
\ No newline at end of file
+var _0x11d2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e78f4,_0x39412d){var _0x41ae6f=function(_0x32ad74){while(--_0x32ad74){_0x3e78f4['push'](_0x3e78f4['shift']());}};_0x41ae6f(++_0x39412d);}(_0x11d2,0x13d));var _0x211d=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x11d2[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x211d('0x0'));var util=require(_0x211d('0x1'));var moment=require(_0x211d('0x2'));var BPromise=require(_0x211d('0x3'));var rs=require(_0x211d('0x4'));var fs=require('fs');var Redis=require(_0x211d('0x5'));var db=require(_0x211d('0x6'))['db'];var utils=require(_0x211d('0x7'));var logger=require(_0x211d('0x8'))(_0x211d('0x9'));var config=require(_0x211d('0xa'));var jayson=require(_0x211d('0xb'));var client=jayson[_0x211d('0xc')][_0x211d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51fdbd,_0x56ce0b,_0x23eb9f){return new BPromise(function(_0x46e85f,_0x144bfd){return client[_0x211d('0xe')](_0x51fdbd,_0x23eb9f)['then'](function(_0x4ae9d8){logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,'request\x20sent');logger[_0x211d('0x11')](_0x211d('0x12'),_0x56ce0b,_0x211d('0x13'),JSON[_0x211d('0x14')](_0x4ae9d8));if(_0x4ae9d8['error']){if(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x16')]===0x1f4){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')]['message']);return _0x144bfd(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);return _0x46e85f(_0x4ae9d8[_0x211d('0x15')][_0x211d('0x17')]);}else{logger[_0x211d('0xf')](_0x211d('0x10'),_0x56ce0b,_0x211d('0x13'));_0x46e85f(_0x4ae9d8[_0x211d('0x18')]['message']);}})['catch'](function(_0x5baa24){logger[_0x211d('0x15')](_0x211d('0x10'),_0x56ce0b,_0x5baa24);_0x144bfd(_0x5baa24);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ab4e5fa..77cdd32 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(_0x5bbc16,_0x23de90){var _0x561b20=function(_0x5d6036){while(--_0x5d6036){_0x5bbc16['push'](_0x5bbc16['shift']());}};_0x561b20(++_0x23de90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x22005d,_0x579a64){var _0x175b8e=function(_0x318fc4){while(--_0x318fc4){_0x22005d['push'](_0x22005d['shift']());}};_0x175b8e(++_0x579a64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 fe8565b..d8252e9 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 _0x477a=['name','TEXT','sequelize','STRING'];(function(_0x2db2db,_0x5cabdf){var _0x4c8811=function(_0x2de564){while(--_0x2de564){_0x2db2db['push'](_0x2db2db['shift']());}};_0x4c8811(++_0x5cabdf);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa477('0x0'));module['exports']={'name':{'type':Sequelize[_0xa477('0x1')],'allowNull':![],'unique':_0xa477('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xa477('0x3')]},'description':{'type':Sequelize[_0xa477('0x1')]}};
\ No newline at end of file
+var _0x9a86=['name','STRING','TEXT','sequelize','exports'];(function(_0x356758,_0x28d328){var _0x44610b=function(_0x105469){while(--_0x105469){_0x356758['push'](_0x356758['shift']());}};_0x44610b(++_0x28d328);}(_0x9a86,0x1ed));var _0x69a8=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x9a86[_0x3932eb];return _0x5316e5;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x69a8('0x2')},'table':{'type':Sequelize[_0x69a8('0x3')]},'metric':{'type':Sequelize[_0x69a8('0x4')]},'description':{'type':Sequelize[_0x69a8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index a30619d..4bc7c66 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x28fd2e,_0x312107){var _0x4c6eb9=function(_0xb3f18a){while(--_0xb3f18a){_0x28fd2e['push'](_0x28fd2e['shift']());}};_0x4c6eb9(++_0x312107);}(_0x7217,0x19e));var _0x7721=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7217[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
+var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7da7,0x10d));var _0x77da=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x7da7[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b99b411..db7d346 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 _0x2086=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1d2adf,_0x8b056f){var _0x431bd7=function(_0x2785a7){while(--_0x2785a7){_0x1d2adf['push'](_0x1d2adf['shift']());}};_0x431bd7(++_0x8b056f);}(_0x2086,0x124));var _0x6208=function(_0x2bfedd,_0x44883f){_0x2bfedd=_0x2bfedd-0x0;var _0x293cd2=_0x2086[_0x2bfedd];return _0x293cd2;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require(_0x6208('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6208('0x6'));var rimraf=require(_0x6208('0x7'));var config=require('../../config/environment');var attributes=require(_0x6208('0x8'));module[_0x6208('0x9')]=function(_0x38bc4d,_0xb3cf2a){return _0x38bc4d[_0x6208('0xa')]('AnalyticMetric',attributes,{'tableName':_0x6208('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_metrics','lodash'];(function(_0x53e3fa,_0xbcabb5){var _0xcb3861=function(_0x1d1196){while(--_0x1d1196){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xcb3861(++_0xbcabb5);}(_0x7da7,0x10d));var _0x77da=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7da7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('AnalyticMetric',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 2df813f..f2b6a20 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 _0xb224=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5ae154,_0x448e92){var _0x2650f5=function(_0x3d11fb){while(--_0x3d11fb){_0x5ae154['push'](_0x5ae154['shift']());}};_0x2650f5(++_0x448e92);}(_0xb224,0x193));var _0x4b22=function(_0x5adcb0,_0x11ecb8){_0x5adcb0=_0x5adcb0-0x0;var _0x90afed=_0xb224[_0x5adcb0];return _0x90afed;};'use strict';var _=require(_0x4b22('0x0'));var util=require(_0x4b22('0x1'));var moment=require('moment');var BPromise=require(_0x4b22('0x2'));var rs=require(_0x4b22('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b22('0x4'))['db'];var utils=require(_0x4b22('0x5'));var logger=require(_0x4b22('0x6'))(_0x4b22('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b22('0x8'));var client=jayson[_0x4b22('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2c20,_0x5b10c2,_0x3df714){return new BPromise(function(_0x3c1ddb,_0x5c853a){return client[_0x4b22('0xa')](_0x4a2c20,_0x3df714)[_0x4b22('0xb')](function(_0x28cef8){logger[_0x4b22('0xc')](_0x4b22('0xd'),_0x5b10c2,'request\x20sent');logger['debug'](_0x4b22('0xe'),_0x5b10c2,_0x4b22('0xf'),JSON[_0x4b22('0x10')](_0x28cef8));if(_0x28cef8[_0x4b22('0x11')]){if(_0x28cef8[_0x4b22('0x11')][_0x4b22('0x12')]===0x1f4){logger[_0x4b22('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x5b10c2,_0x28cef8['error'][_0x4b22('0x13')]);return _0x5c853a(_0x28cef8[_0x4b22('0x11')][_0x4b22('0x13')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5b10c2,_0x28cef8[_0x4b22('0x11')]['message']);return _0x3c1ddb(_0x28cef8[_0x4b22('0x11')][_0x4b22('0x13')]);}else{logger['info'](_0x4b22('0xd'),_0x5b10c2,_0x4b22('0xf'));_0x3c1ddb(_0x28cef8['result'][_0x4b22('0x13')]);}})[_0x4b22('0x14')](function(_0x53d52c){logger[_0x4b22('0x11')](_0x4b22('0xd'),_0x5b10c2,_0x53d52c);_0x5c853a(_0x53d52c);});});}
\ No newline at end of file
+var _0x3c91=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x3c91,0xcc));var _0x13c9=function(_0x473c42,_0x286677){_0x473c42=_0x473c42-0x0;var _0x252886=_0x3c91[_0x473c42];return _0x252886;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require(_0x13c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x4'));var db=require(_0x13c9('0x5'))['db'];var utils=require(_0x13c9('0x6'));var logger=require(_0x13c9('0x7'))(_0x13c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x13c9('0x9'));var client=jayson[_0x13c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25b9fd,_0x1d2715,_0x2613b3){return new BPromise(function(_0x1f5c57,_0x2b5c25){return client[_0x13c9('0xb')](_0x25b9fd,_0x2613b3)[_0x13c9('0xc')](function(_0x4d0c97){logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');logger[_0x13c9('0xe')](_0x13c9('0xf'),_0x1d2715,_0x13c9('0x10'),JSON['stringify'](_0x4d0c97));if(_0x4d0c97[_0x13c9('0x11')]){if(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x12')]===0x1f4){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')]['message']);return _0x2b5c25(_0x4d0c97['error']['message']);}logger['error'](_0x13c9('0xd'),_0x1d2715,_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);return _0x1f5c57(_0x4d0c97[_0x13c9('0x11')][_0x13c9('0x13')]);}else{logger['info'](_0x13c9('0xd'),_0x1d2715,'request\x20sent');_0x1f5c57(_0x4d0c97[_0x13c9('0x14')][_0x13c9('0x13')]);}})[_0x13c9('0x15')](function(_0x5e7d46){logger[_0x13c9('0x11')](_0x13c9('0xd'),_0x1d2715,_0x5e7d46);_0x2b5c25(_0x5e7d46);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a5bba8c..6feccc8 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 _0x4350=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','put','/:id','update','destroy','exports'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4350,0x1d0));var _0x0435=function(_0x4567dd,_0x2c7fc2){_0x4567dd=_0x4567dd-0x0;var _0x3e9cdc=_0x4350[_0x4567dd];return _0x3e9cdc;};'use strict';var multer=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var path=require('path');var timeout=require(_0x0435('0x2'));var express=require('express');var router=express[_0x0435('0x3')]();var fs_extra=require(_0x0435('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0435('0x5'));var config=require(_0x0435('0x6'));var controller=require(_0x0435('0x7'));router[_0x0435('0x8')]('/',auth['isAuthenticated'](),controller[_0x0435('0x9')]);router['get']('/:id',auth[_0x0435('0xa')](),controller['show']);router['post']('/',auth[_0x0435('0xa')](),controller['create']);router[_0x0435('0xb')](_0x0435('0xc'),auth['isAuthenticated'](),controller[_0x0435('0xd')]);router['delete'](_0x0435('0xc'),auth[_0x0435('0xa')](),controller[_0x0435('0xe')]);module[_0x0435('0xf')]=router;
\ No newline at end of file
+var _0xb1a3=['get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x597e39,_0x26f975){var _0x2cfc99=function(_0x5b40a2){while(--_0x5b40a2){_0x597e39['push'](_0x597e39['shift']());}};_0x2cfc99(++_0x26f975);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xb1a3[_0x1034ca];return _0x1a023a;};'use strict';var multer=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var path=require(_0x3b1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b1a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b1a('0x4'));var interaction=require(_0x3b1a('0x5'));var config=require(_0x3b1a('0x6'));var controller=require(_0x3b1a('0x7'));router[_0x3b1a('0x8')]('/',auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xa')]);router['get'](_0x3b1a('0xb'),auth[_0x3b1a('0x9')](),controller[_0x3b1a('0xc')]);router[_0x3b1a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b1a('0xe')](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0xf')]);router['delete'](_0x3b1a('0xb'),auth['isAuthenticated'](),controller[_0x3b1a('0x10')]);module[_0x3b1a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ef74bb3..f105c81 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 _0x3015=['sequelize','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3015,0x132));var _0x5301=function(_0xe5c823,_0x51cc2e){_0xe5c823=_0xe5c823-0x0;var _0x4a04e2=_0x3015[_0xe5c823];return _0x4a04e2;};'use strict';var Sequelize=require(_0x5301('0x0'));module['exports']={'tree':{'type':Sequelize[_0x5301('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8e45=['TEXT'];(function(_0x31fcb1,_0x45f216){var _0x2ea7e6=function(_0x3977e0){while(--_0x3977e0){_0x31fcb1['push'](_0x31fcb1['shift']());}};_0x2ea7e6(++_0x45f216);}(_0x8e45,0x1f2));var _0x58e4=function(_0x45218a,_0xbd1113){_0x45218a=_0x45218a-0x0;var _0x14027a=_0x8e45[_0x45218a];return _0x14027a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x58e4('0x0')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index adb4968..cb709d3 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 _0xe3d8=['map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe3d8,0xff));var _0x8e3d=function(_0x3cad6d,_0x112027){_0x3cad6d=_0x3cad6d-0x0;var _0x5b86fb=_0xe3d8[_0x3cad6d];return _0x5b86fb;};'use strict';var emlformat=require(_0x8e3d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e3d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e3d('0x2'));var moment=require(_0x8e3d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8e3d('0x4'));var util=require('util');var path=require(_0x8e3d('0x5'));var sox=require(_0x8e3d('0x6'));var csv=require('to-csv');var ejs=require(_0x8e3d('0x7'));var fs=require('fs');var fs_extra=require(_0x8e3d('0x8'));var _=require(_0x8e3d('0x9'));var squel=require(_0x8e3d('0xa'));var crypto=require(_0x8e3d('0xb'));var jsforce=require(_0x8e3d('0xc'));var deskjs=require(_0x8e3d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e3d('0xe'));var Papa=require(_0x8e3d('0xf'));var Redis=require(_0x8e3d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8e3d('0x11'));var as=require(_0x8e3d('0x12'));var hardwareService=require(_0x8e3d('0x13'));var logger=require(_0x8e3d('0x14'))(_0x8e3d('0x15'));var utils=require('../../config/utils');var config=require(_0x8e3d('0x16'));var licenseUtil=require(_0x8e3d('0x17'));var db=require(_0x8e3d('0x18'))['db'];function respondWithStatusCode(_0x265204,_0x321e85){_0x321e85=_0x321e85||0xcc;return function(_0x374a80){if(_0x374a80){return _0x265204[_0x8e3d('0x19')](_0x321e85);}return _0x265204['status'](_0x321e85)[_0x8e3d('0x1a')]();};}function respondWithResult(_0xa421b0,_0x3b172e){_0x3b172e=_0x3b172e||0xc8;return function(_0x353508){if(_0x353508){return _0xa421b0[_0x8e3d('0x1b')](_0x3b172e)[_0x8e3d('0x1c')](_0x353508);}};}function respondWithFilteredResult(_0x5c7338,_0x10ab77){return function(_0x7f00ce){if(_0x7f00ce){var _0xba28bb=typeof _0x10ab77[_0x8e3d('0x1d')]==='undefined'&&typeof _0x10ab77[_0x8e3d('0x1e')]===_0x8e3d('0x1f');var _0x8339d9=_0x7f00ce[_0x8e3d('0x20')];var _0x5a2856=_0xba28bb?0x0:_0x10ab77[_0x8e3d('0x1d')];var _0x108b0b=_0xba28bb?_0x7f00ce[_0x8e3d('0x20')]:_0x10ab77[_0x8e3d('0x1d')]+_0x10ab77[_0x8e3d('0x1e')];var _0x1933a0;if(_0x108b0b>=_0x8339d9){_0x108b0b=_0x8339d9;_0x1933a0=0xc8;}else{_0x1933a0=0xce;}_0x5c7338[_0x8e3d('0x1b')](_0x1933a0);return _0x5c7338[_0x8e3d('0x21')]('Content-Range',_0x5a2856+'-'+_0x108b0b+'/'+_0x8339d9)['json'](_0x7f00ce);}return null;};}function patchUpdates(_0x268c06){return function(_0x3df482){try{jsonpatch[_0x8e3d('0x22')](_0x3df482,_0x268c06,!![]);}catch(_0x458d4c){return BPromise[_0x8e3d('0x23')](_0x458d4c);}return _0x3df482[_0x8e3d('0x24')]();};}function saveUpdates(_0x17b100,_0x20610d){return function(_0xf90d06){if(_0xf90d06){return _0xf90d06[_0x8e3d('0x25')](_0x17b100)[_0x8e3d('0x26')](function(_0x561f76){return _0x561f76;});}return null;};}function removeEntity(_0x3190f5,_0x2c52d2){return function(_0x3545fd){if(_0x3545fd){return _0x3545fd[_0x8e3d('0x27')]()[_0x8e3d('0x26')](function(){_0x3190f5[_0x8e3d('0x1b')](0xcc)[_0x8e3d('0x1a')]();});}};}function handleEntityNotFound(_0x15d07e,_0x1bd85c){return function(_0x5b30bc){if(!_0x5b30bc){_0x15d07e['sendStatus'](0x194);}return _0x5b30bc;};}function handleError(_0x1c0cdc,_0x5c7868){_0x5c7868=_0x5c7868||0x1f4;return function(_0x11f821){logger[_0x8e3d('0x28')](_0x11f821[_0x8e3d('0x29')]);if(_0x11f821[_0x8e3d('0x2a')]){delete _0x11f821[_0x8e3d('0x2a')];}_0x1c0cdc[_0x8e3d('0x1b')](_0x5c7868)[_0x8e3d('0x2b')](_0x11f821);};}exports[_0x8e3d('0x2c')]=function(_0x342f16,_0xb4cfe4){var _0x18ebdc={},_0x17db8b={},_0x209cc1={'count':0x0,'rows':[]};var _0x57ef5d=_[_0x8e3d('0x2d')](db[_0x8e3d('0x2e')][_0x8e3d('0x2f')],function(_0x14cb79){return{'name':_0x14cb79[_0x8e3d('0x30')],'type':_0x14cb79[_0x8e3d('0x31')][_0x8e3d('0x32')]};});_0x17db8b[_0x8e3d('0x33')]=_[_0x8e3d('0x2d')](_0x57ef5d,_0x8e3d('0x2a'));_0x17db8b['query']=_[_0x8e3d('0x34')](_0x342f16['query']);_0x17db8b['filters']=_['intersection'](_0x17db8b[_0x8e3d('0x33')],_0x17db8b[_0x8e3d('0x35')]);_0x18ebdc[_0x8e3d('0x36')]=_[_0x8e3d('0x37')](_0x17db8b[_0x8e3d('0x33')],qs[_0x8e3d('0x38')](_0x342f16[_0x8e3d('0x35')]['fields']));_0x18ebdc[_0x8e3d('0x36')]=_0x18ebdc[_0x8e3d('0x36')][_0x8e3d('0x39')]?_0x18ebdc[_0x8e3d('0x36')]:_0x17db8b['model'];if(!_0x342f16[_0x8e3d('0x35')][_0x8e3d('0x3a')](_0x8e3d('0x3b'))){_0x18ebdc['limit']=qs[_0x8e3d('0x1e')](_0x342f16[_0x8e3d('0x35')]['limit']);_0x18ebdc[_0x8e3d('0x1d')]=qs[_0x8e3d('0x1d')](_0x342f16[_0x8e3d('0x35')][_0x8e3d('0x1d')]);}_0x18ebdc[_0x8e3d('0x3c')]=qs[_0x8e3d('0x3d')](_0x342f16[_0x8e3d('0x35')]['sort']);_0x18ebdc[_0x8e3d('0x3e')]=qs[_0x8e3d('0x3f')](_['pick'](_0x342f16[_0x8e3d('0x35')],_0x17db8b['filters']),_0x57ef5d);if(_0x342f16['query'][_0x8e3d('0x40')]){_0x18ebdc['where']=_[_0x8e3d('0x41')](_0x18ebdc[_0x8e3d('0x3e')],{'$or':_[_0x8e3d('0x2d')](_0x57ef5d,function(_0x113e2f){if(_0x113e2f['type']!==_0x8e3d('0x42')){var _0x1f6985={};_0x1f6985[_0x113e2f[_0x8e3d('0x2a')]]={'$like':'%'+_0x342f16[_0x8e3d('0x35')][_0x8e3d('0x40')]+'%'};return _0x1f6985;}})});}_0x18ebdc=_[_0x8e3d('0x41')]({},_0x18ebdc,_0x342f16[_0x8e3d('0x43')]);var _0x5e1edc={'where':_0x18ebdc[_0x8e3d('0x3e')]};return db[_0x8e3d('0x2e')]['count'](_0x5e1edc)[_0x8e3d('0x26')](function(_0x4c6e35){_0x209cc1[_0x8e3d('0x20')]=_0x4c6e35;if(_0x342f16[_0x8e3d('0x35')][_0x8e3d('0x44')]){_0x18ebdc[_0x8e3d('0x45')]=[{'all':!![]}];}return db[_0x8e3d('0x2e')]['findAll'](_0x18ebdc);})[_0x8e3d('0x26')](function(_0x271d9d){_0x209cc1['rows']=_0x271d9d;return _0x209cc1;})[_0x8e3d('0x26')](respondWithFilteredResult(_0xb4cfe4,_0x18ebdc))[_0x8e3d('0x46')](handleError(_0xb4cfe4,null));};exports['show']=function(_0x102de0,_0x10d5b9){var _0x3cfb77={'raw':!![],'where':{'id':_0x102de0[_0x8e3d('0x47')]['id']}},_0x16b81d={};_0x16b81d[_0x8e3d('0x33')]=_[_0x8e3d('0x34')](db['AnalyticTreeReport']['rawAttributes']);_0x16b81d[_0x8e3d('0x35')]=_[_0x8e3d('0x34')](_0x102de0['query']);_0x16b81d[_0x8e3d('0x3f')]=_['intersection'](_0x16b81d[_0x8e3d('0x33')],_0x16b81d['query']);_0x3cfb77[_0x8e3d('0x36')]=_['intersection'](_0x16b81d[_0x8e3d('0x33')],qs[_0x8e3d('0x38')](_0x102de0[_0x8e3d('0x35')][_0x8e3d('0x38')]));_0x3cfb77[_0x8e3d('0x36')]=_0x3cfb77[_0x8e3d('0x36')]['length']?_0x3cfb77[_0x8e3d('0x36')]:_0x16b81d[_0x8e3d('0x33')];if(_0x102de0[_0x8e3d('0x35')][_0x8e3d('0x44')]){_0x3cfb77[_0x8e3d('0x45')]=[{'all':!![]}];}_0x3cfb77=_[_0x8e3d('0x41')]({},_0x3cfb77,_0x102de0[_0x8e3d('0x43')]);return db[_0x8e3d('0x2e')][_0x8e3d('0x48')](_0x3cfb77)[_0x8e3d('0x26')](handleEntityNotFound(_0x10d5b9,null))[_0x8e3d('0x26')](respondWithResult(_0x10d5b9,null))[_0x8e3d('0x46')](handleError(_0x10d5b9,null));};exports[_0x8e3d('0x49')]=function(_0x42f19e,_0x8a0cac){return db[_0x8e3d('0x2e')][_0x8e3d('0x49')](_0x42f19e[_0x8e3d('0x4a')],{})[_0x8e3d('0x26')](respondWithResult(_0x8a0cac,0xc9))[_0x8e3d('0x46')](handleError(_0x8a0cac,null));};exports['update']=function(_0xbd3825,_0x410737){if(_0xbd3825[_0x8e3d('0x4a')]['id']){delete _0xbd3825[_0x8e3d('0x4a')]['id'];}return db[_0x8e3d('0x2e')][_0x8e3d('0x48')]({'where':{'id':_0xbd3825[_0x8e3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x410737,null))[_0x8e3d('0x26')](saveUpdates(_0xbd3825['body'],null))[_0x8e3d('0x26')](respondWithResult(_0x410737,null))[_0x8e3d('0x46')](handleError(_0x410737,null));};exports[_0x8e3d('0x27')]=function(_0x374d37,_0x3e58df){return db[_0x8e3d('0x2e')][_0x8e3d('0x48')]({'where':{'id':_0x374d37[_0x8e3d('0x47')]['id']}})[_0x8e3d('0x26')](handleEntityNotFound(_0x3e58df,null))['then'](removeEntity(_0x3e58df,null))[_0x8e3d('0x46')](handleError(_0x3e58df,null));};
\ No newline at end of file
+var _0x39a8=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','AnalyticTreeReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x35a76f,_0x158af7){var _0x184f62=function(_0xedbd82){while(--_0xedbd82){_0x35a76f['push'](_0x35a76f['shift']());}};_0x184f62(++_0x158af7);}(_0x39a8,0xdc));var _0x839a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39a8[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x839a('0x0'));var zipdir=require(_0x839a('0x1'));var jsonpatch=require(_0x839a('0x2'));var rp=require(_0x839a('0x3'));var moment=require(_0x839a('0x4'));var BPromise=require(_0x839a('0x5'));var Mustache=require(_0x839a('0x6'));var util=require(_0x839a('0x7'));var path=require(_0x839a('0x8'));var sox=require(_0x839a('0x9'));var csv=require(_0x839a('0xa'));var ejs=require(_0x839a('0xb'));var fs=require('fs');var fs_extra=require(_0x839a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x839a('0xd'));var jsforce=require(_0x839a('0xe'));var deskjs=require(_0x839a('0xf'));var toCsv=require(_0x839a('0xa'));var querystring=require(_0x839a('0x10'));var Papa=require(_0x839a('0x11'));var Redis=require(_0x839a('0x12'));var authService=require(_0x839a('0x13'));var qs=require(_0x839a('0x14'));var as=require(_0x839a('0x15'));var hardwareService=require(_0x839a('0x16'));var logger=require(_0x839a('0x17'))(_0x839a('0x18'));var utils=require(_0x839a('0x19'));var config=require(_0x839a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x839a('0x1b'))['db'];function respondWithStatusCode(_0x140f0f,_0x392698){_0x392698=_0x392698||0xcc;return function(_0x138c35){if(_0x138c35){return _0x140f0f[_0x839a('0x1c')](_0x392698);}return _0x140f0f[_0x839a('0x1d')](_0x392698)[_0x839a('0x1e')]();};}function respondWithResult(_0x162209,_0x400aaf){_0x400aaf=_0x400aaf||0xc8;return function(_0x39cef6){if(_0x39cef6){return _0x162209[_0x839a('0x1d')](_0x400aaf)['json'](_0x39cef6);}};}function respondWithFilteredResult(_0x19e7ce,_0x59ba5e){return function(_0xb27002){if(_0xb27002){var _0x17b08b=typeof _0x59ba5e[_0x839a('0x1f')]==='undefined'&&typeof _0x59ba5e[_0x839a('0x20')]===_0x839a('0x21');var _0x14d6aa=_0xb27002['count'];var _0x4e663c=_0x17b08b?0x0:_0x59ba5e[_0x839a('0x1f')];var _0x26ed42=_0x17b08b?_0xb27002[_0x839a('0x22')]:_0x59ba5e[_0x839a('0x1f')]+_0x59ba5e[_0x839a('0x20')];var _0x569966;if(_0x26ed42>=_0x14d6aa){_0x26ed42=_0x14d6aa;_0x569966=0xc8;}else{_0x569966=0xce;}_0x19e7ce[_0x839a('0x1d')](_0x569966);return _0x19e7ce[_0x839a('0x23')](_0x839a('0x24'),_0x4e663c+'-'+_0x26ed42+'/'+_0x14d6aa)[_0x839a('0x25')](_0xb27002);}return null;};}function patchUpdates(_0x4b8ba9){return function(_0xe0e950){try{jsonpatch['apply'](_0xe0e950,_0x4b8ba9,!![]);}catch(_0x3a2839){return BPromise[_0x839a('0x26')](_0x3a2839);}return _0xe0e950['save']();};}function saveUpdates(_0x530a53,_0x579d27){return function(_0x57333b){if(_0x57333b){return _0x57333b[_0x839a('0x27')](_0x530a53)[_0x839a('0x28')](function(_0x2e272e){return _0x2e272e;});}return null;};}function removeEntity(_0x95b44b,_0x369f72){return function(_0x5a819f){if(_0x5a819f){return _0x5a819f[_0x839a('0x29')]()[_0x839a('0x28')](function(){_0x95b44b[_0x839a('0x1d')](0xcc)[_0x839a('0x1e')]();});}};}function handleEntityNotFound(_0x3b2e9e,_0x9fc3af){return function(_0x3d5cd8){if(!_0x3d5cd8){_0x3b2e9e[_0x839a('0x1c')](0x194);}return _0x3d5cd8;};}function handleError(_0x3feec1,_0x1d99eb){_0x1d99eb=_0x1d99eb||0x1f4;return function(_0x2d4207){logger[_0x839a('0x2a')](_0x2d4207['stack']);if(_0x2d4207[_0x839a('0x2b')]){delete _0x2d4207[_0x839a('0x2b')];}_0x3feec1[_0x839a('0x1d')](_0x1d99eb)[_0x839a('0x2c')](_0x2d4207);};}exports[_0x839a('0x2d')]=function(_0x275d20,_0x55846d){var _0x16df8c={},_0x5f3928={},_0x2bc7f0={'count':0x0,'rows':[]};var _0x12a68e=_['map'](db[_0x839a('0x2e')]['rawAttributes'],function(_0x43320f){return{'name':_0x43320f[_0x839a('0x2f')],'type':_0x43320f['type'][_0x839a('0x30')]};});_0x5f3928[_0x839a('0x31')]=_['map'](_0x12a68e,_0x839a('0x2b'));_0x5f3928[_0x839a('0x32')]=_[_0x839a('0x33')](_0x275d20[_0x839a('0x32')]);_0x5f3928[_0x839a('0x34')]=_['intersection'](_0x5f3928['model'],_0x5f3928['query']);_0x16df8c[_0x839a('0x35')]=_[_0x839a('0x36')](_0x5f3928['model'],qs[_0x839a('0x37')](_0x275d20[_0x839a('0x32')][_0x839a('0x37')]));_0x16df8c[_0x839a('0x35')]=_0x16df8c[_0x839a('0x35')][_0x839a('0x38')]?_0x16df8c[_0x839a('0x35')]:_0x5f3928[_0x839a('0x31')];if(!_0x275d20[_0x839a('0x32')][_0x839a('0x39')](_0x839a('0x3a'))){_0x16df8c['limit']=qs[_0x839a('0x20')](_0x275d20['query'][_0x839a('0x20')]);_0x16df8c['offset']=qs['offset'](_0x275d20[_0x839a('0x32')]['offset']);}_0x16df8c[_0x839a('0x3b')]=qs[_0x839a('0x3c')](_0x275d20[_0x839a('0x32')]['sort']);_0x16df8c[_0x839a('0x3d')]=qs['filters'](_['pick'](_0x275d20[_0x839a('0x32')],_0x5f3928[_0x839a('0x34')]),_0x12a68e);if(_0x275d20[_0x839a('0x32')][_0x839a('0x3e')]){_0x16df8c[_0x839a('0x3d')]=_[_0x839a('0x3f')](_0x16df8c[_0x839a('0x3d')],{'$or':_[_0x839a('0x40')](_0x12a68e,function(_0x583681){if(_0x583681[_0x839a('0x41')]!=='VIRTUAL'){var _0x4fbc63={};_0x4fbc63[_0x583681[_0x839a('0x2b')]]={'$like':'%'+_0x275d20['query']['filter']+'%'};return _0x4fbc63;}})});}_0x16df8c=_[_0x839a('0x3f')]({},_0x16df8c,_0x275d20['options']);var _0x4b14d5={'where':_0x16df8c['where']};return db['AnalyticTreeReport'][_0x839a('0x22')](_0x4b14d5)['then'](function(_0x2a15d0){_0x2bc7f0[_0x839a('0x22')]=_0x2a15d0;if(_0x275d20[_0x839a('0x32')][_0x839a('0x42')]){_0x16df8c[_0x839a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x839a('0x44')](_0x16df8c);})[_0x839a('0x28')](function(_0x1b5735){_0x2bc7f0[_0x839a('0x45')]=_0x1b5735;return _0x2bc7f0;})[_0x839a('0x28')](respondWithFilteredResult(_0x55846d,_0x16df8c))[_0x839a('0x46')](handleError(_0x55846d,null));};exports[_0x839a('0x47')]=function(_0x35d98d,_0x26f539){var _0x2aca05={'raw':!![],'where':{'id':_0x35d98d['params']['id']}},_0x5949f8={};_0x5949f8[_0x839a('0x31')]=_['keys'](db[_0x839a('0x2e')][_0x839a('0x48')]);_0x5949f8[_0x839a('0x32')]=_[_0x839a('0x33')](_0x35d98d['query']);_0x5949f8[_0x839a('0x34')]=_['intersection'](_0x5949f8[_0x839a('0x31')],_0x5949f8[_0x839a('0x32')]);_0x2aca05['attributes']=_[_0x839a('0x36')](_0x5949f8[_0x839a('0x31')],qs[_0x839a('0x37')](_0x35d98d[_0x839a('0x32')][_0x839a('0x37')]));_0x2aca05['attributes']=_0x2aca05[_0x839a('0x35')][_0x839a('0x38')]?_0x2aca05[_0x839a('0x35')]:_0x5949f8[_0x839a('0x31')];if(_0x35d98d[_0x839a('0x32')][_0x839a('0x42')]){_0x2aca05[_0x839a('0x43')]=[{'all':!![]}];}_0x2aca05=_[_0x839a('0x3f')]({},_0x2aca05,_0x35d98d['options']);return db[_0x839a('0x2e')][_0x839a('0x49')](_0x2aca05)['then'](handleEntityNotFound(_0x26f539,null))[_0x839a('0x28')](respondWithResult(_0x26f539,null))[_0x839a('0x46')](handleError(_0x26f539,null));};exports[_0x839a('0x4a')]=function(_0x3d6602,_0xa9a62){return db[_0x839a('0x2e')]['create'](_0x3d6602[_0x839a('0x4b')],{})[_0x839a('0x28')](respondWithResult(_0xa9a62,0xc9))[_0x839a('0x46')](handleError(_0xa9a62,null));};exports[_0x839a('0x27')]=function(_0x178b45,_0x1f54dc){if(_0x178b45['body']['id']){delete _0x178b45[_0x839a('0x4b')]['id'];}return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x178b45[_0x839a('0x4c')]['id']}})[_0x839a('0x28')](handleEntityNotFound(_0x1f54dc,null))[_0x839a('0x28')](saveUpdates(_0x178b45['body'],null))[_0x839a('0x28')](respondWithResult(_0x1f54dc,null))[_0x839a('0x46')](handleError(_0x1f54dc,null));};exports['destroy']=function(_0x34c7ae,_0x307c38){return db[_0x839a('0x2e')][_0x839a('0x49')]({'where':{'id':_0x34c7ae[_0x839a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x307c38,null))[_0x839a('0x28')](removeEntity(_0x307c38,null))[_0x839a('0x46')](handleError(_0x307c38,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 602ad29..79f799b 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 _0x4386=['AnalyticTreeReport','analytics_report_trees','util','api','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports','define'];(function(_0x11abf9,_0x1ff7e5){var _0x547878=function(_0x2ac98c){while(--_0x2ac98c){_0x11abf9['push'](_0x11abf9['shift']());}};_0x547878(++_0x1ff7e5);}(_0x4386,0x141));var _0x6438=function(_0x515232,_0x3de920){_0x515232=_0x515232-0x0;var _0x45685c=_0x4386[_0x515232];return _0x45685c;};'use strict';var _=require('lodash');var util=require(_0x6438('0x0'));var logger=require('../../config/logger')(_0x6438('0x1'));var moment=require(_0x6438('0x2'));var BPromise=require(_0x6438('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6438('0x4'));var rimraf=require(_0x6438('0x5'));var config=require('../../config/environment');var attributes=require(_0x6438('0x6'));module[_0x6438('0x7')]=function(_0x531071,_0x3888fe){return _0x531071[_0x6438('0x8')](_0x6438('0x9'),attributes,{'tableName':_0x6438('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe78f=['moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','analytics_report_trees','../../config/logger','api'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xe78f,0x1d2));var _0xfe78=function(_0xf1955f,_0x4b4cdc){_0xf1955f=_0xf1955f-0x0;var _0x185220=_0xe78f[_0xf1955f];return _0x185220;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe78('0x0'))(_0xfe78('0x1'));var moment=require(_0xfe78('0x2'));var BPromise=require('bluebird');var rp=require(_0xfe78('0x3'));var fs=require('fs');var path=require(_0xfe78('0x4'));var rimraf=require(_0xfe78('0x5'));var config=require(_0xfe78('0x6'));var attributes=require(_0xfe78('0x7'));module['exports']=function(_0x24294d,_0x5714ea){return _0x24294d['define']('AnalyticTreeReport',attributes,{'tableName':_0xfe78('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 3aeef4f..d7da79e 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2880f8,_0x1edc7e){var _0x2cedc0=function(_0x17dd17){while(--_0x17dd17){_0x2880f8['push'](_0x2880f8['shift']());}};_0x2cedc0(++_0x1edc7e);}(_0x1261,0x144));var _0x1126=function(_0x458e33,_0x4f8045){_0x458e33=_0x458e33-0x0;var _0x5109b0=_0x1261[_0x458e33];return _0x5109b0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+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(_0x52bd88,_0x52def0){var _0x40c088=function(_0x38036f){while(--_0x38036f){_0x52bd88['push'](_0x52bd88['shift']());}};_0x40c088(++_0x52def0);}(_0xdb28,0x106));var _0x8db2=function(_0x4b7ea5,_0x5b1ffe){_0x4b7ea5=_0x4b7ea5-0x0;var _0x5c744a=_0xdb28[_0x4b7ea5];return _0x5c744a;};'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 a7db003..385428b 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 _0xeaa9=['express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','create','delete','destroy','exports','multer','util'];(function(_0x46cd48,_0xc91635){var _0x25258a=function(_0x249b14){while(--_0x249b14){_0x46cd48['push'](_0x46cd48['shift']());}};_0x25258a(++_0xc91635);}(_0xeaa9,0x19e));var _0x9eaa=function(_0x1fd601,_0x5cfcff){_0x1fd601=_0x1fd601-0x0;var _0x450d9c=_0xeaa9[_0x1fd601];return _0x450d9c;};'use strict';var multer=require(_0x9eaa('0x0'));var util=require(_0x9eaa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9eaa('0x2'));var router=express['Router']();var fs_extra=require(_0x9eaa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9eaa('0x4'));var config=require(_0x9eaa('0x5'));var controller=require(_0x9eaa('0x6'));router['get']('/',auth[_0x9eaa('0x7')](),controller[_0x9eaa('0x8')]);router[_0x9eaa('0x9')](_0x9eaa('0xa'),auth[_0x9eaa('0x7')](),controller[_0x9eaa('0xb')]);router['post']('/',auth[_0x9eaa('0x7')](),controller[_0x9eaa('0xc')]);router['put'](_0x9eaa('0xa'),auth[_0x9eaa('0x7')](),controller['update']);router[_0x9eaa('0xd')](_0x9eaa('0xa'),auth[_0x9eaa('0x7')](),controller[_0x9eaa('0xe')]);module[_0x9eaa('0xf')]=router;
\ No newline at end of file
+var _0xaf49=['../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','path','Router','fs-extra','../../components/auth/service'];(function(_0x1b886e,_0x320e47){var _0x5280ea=function(_0x3cccce){while(--_0x3cccce){_0x1b886e['push'](_0x1b886e['shift']());}};_0x5280ea(++_0x320e47);}(_0xaf49,0xfb));var _0x9af4=function(_0x162d05,_0x22cc23){_0x162d05=_0x162d05-0x0;var _0x45c72d=_0xaf49[_0x162d05];return _0x45c72d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9af4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9af4('0x1')]();var fs_extra=require(_0x9af4('0x2'));var auth=require(_0x9af4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9af4('0x4'));var controller=require('./analyticTreeReport.controller');router[_0x9af4('0x5')]('/',auth[_0x9af4('0x6')](),controller[_0x9af4('0x7')]);router[_0x9af4('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x9af4('0x8')]);router[_0x9af4('0x9')]('/',auth['isAuthenticated'](),controller[_0x9af4('0xa')]);router[_0x9af4('0xb')]('/:id',auth[_0x9af4('0x6')](),controller[_0x9af4('0xc')]);router[_0x9af4('0xd')](_0x9af4('0xe'),auth['isAuthenticated'](),controller[_0x9af4('0xf')]);module[_0x9af4('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1ac5971..97349d6 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 _0xe5d5=['STRING'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe5d5,0x156));var _0x5e5d=function(_0x480ea9,_0x36c5db){_0x480ea9=_0x480ea9-0x0;var _0x9c7327=_0xe5d5[_0x480ea9];return _0x9c7327;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5e5d('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5e5d('0x0')]}};
\ No newline at end of file
+var _0x67a2=['STRING','sequelize','exports'];(function(_0xa74d82,_0x545983){var _0xc5d5ec=function(_0x10aed8){while(--_0x10aed8){_0xa74d82['push'](_0xa74d82['shift']());}};_0xc5d5ec(++_0x545983);}(_0x67a2,0xd3));var _0x267a=function(_0x1d1e50,_0x4ceaad){_0x1d1e50=_0x1d1e50-0x0;var _0xc4f0d0=_0x67a2[_0x1d1e50];return _0xc4f0d0;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x267a('0x2')]},'type':{'type':Sequelize[_0x267a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index dfa044a..d700c48 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 _0x879a=['bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','Attachment','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','rawAttributes','clone','updatedAt','omit','body','createdAt','create','find','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x50a19b,_0x80c4d0){var _0x19b42d=function(_0x15a23f){while(--_0x15a23f){_0x50a19b['push'](_0x50a19b['shift']());}};_0x19b42d(++_0x80c4d0);}(_0x879a,0x103));var _0xa879=function(_0x452a75,_0x4bbff3){_0x452a75=_0x452a75-0x0;var _0x3d9d7e=_0x879a[_0x452a75];return _0x3d9d7e;};'use strict';var emlformat=require(_0xa879('0x0'));var rimraf=require(_0xa879('0x1'));var zipdir=require(_0xa879('0x2'));var jsonpatch=require(_0xa879('0x3'));var rp=require(_0xa879('0x4'));var moment=require('moment');var BPromise=require(_0xa879('0x5'));var Mustache=require(_0xa879('0x6'));var util=require('util');var path=require(_0xa879('0x7'));var sox=require(_0xa879('0x8'));var csv=require(_0xa879('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa879('0xa'));var _=require(_0xa879('0xb'));var squel=require(_0xa879('0xc'));var crypto=require('crypto');var jsforce=require(_0xa879('0xd'));var deskjs=require(_0xa879('0xe'));var toCsv=require(_0xa879('0x9'));var querystring=require(_0xa879('0xf'));var Papa=require(_0xa879('0x10'));var Redis=require(_0xa879('0x11'));var authService=require(_0xa879('0x12'));var qs=require(_0xa879('0x13'));var as=require(_0xa879('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa879('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa879('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa879('0x17'))['db'];function respondWithStatusCode(_0x42faf2,_0x1bcfca){_0x1bcfca=_0x1bcfca||0xcc;return function(_0x6f9755){if(_0x6f9755){return _0x42faf2['sendStatus'](_0x1bcfca);}return _0x42faf2[_0xa879('0x18')](_0x1bcfca)['end']();};}function respondWithResult(_0xdf133c,_0x590ad2){_0x590ad2=_0x590ad2||0xc8;return function(_0x4a27f6){if(_0x4a27f6){return _0xdf133c[_0xa879('0x18')](_0x590ad2)[_0xa879('0x19')](_0x4a27f6);}};}function respondWithFilteredResult(_0x1c5b83,_0xbb8546){return function(_0x7e8385){if(_0x7e8385){var _0x370523=typeof _0xbb8546['offset']==='undefined'&&typeof _0xbb8546[_0xa879('0x1a')]===_0xa879('0x1b');var _0x36f3ac=_0x7e8385[_0xa879('0x1c')];var _0x158f9e=_0x370523?0x0:_0xbb8546[_0xa879('0x1d')];var _0xf73e59=_0x370523?_0x7e8385['count']:_0xbb8546[_0xa879('0x1d')]+_0xbb8546[_0xa879('0x1a')];var _0x336480;if(_0xf73e59>=_0x36f3ac){_0xf73e59=_0x36f3ac;_0x336480=0xc8;}else{_0x336480=0xce;}_0x1c5b83[_0xa879('0x18')](_0x336480);return _0x1c5b83[_0xa879('0x1e')](_0xa879('0x1f'),_0x158f9e+'-'+_0xf73e59+'/'+_0x36f3ac)[_0xa879('0x19')](_0x7e8385);}return null;};}function patchUpdates(_0x43cf70){return function(_0x11a745){try{jsonpatch['apply'](_0x11a745,_0x43cf70,!![]);}catch(_0x28f102){return BPromise[_0xa879('0x20')](_0x28f102);}return _0x11a745[_0xa879('0x21')]();};}function saveUpdates(_0x3c813b,_0x5f2f36){return function(_0x2bc614){if(_0x2bc614){return _0x2bc614[_0xa879('0x22')](_0x3c813b)[_0xa879('0x23')](function(_0x4b0ad6){return _0x4b0ad6;});}return null;};}function removeEntity(_0x3db5e2,_0x15511a){return function(_0x594c8b){if(_0x594c8b){return _0x594c8b[_0xa879('0x24')]()[_0xa879('0x23')](function(){_0x3db5e2['status'](0xcc)[_0xa879('0x25')]();});}};}function handleEntityNotFound(_0x16d1f0,_0x338838){return function(_0x23bd90){if(!_0x23bd90){_0x16d1f0[_0xa879('0x26')](0x194);}return _0x23bd90;};}function handleError(_0xa419e,_0xc4f62d){_0xc4f62d=_0xc4f62d||0x1f4;return function(_0x36873b){logger[_0xa879('0x27')](_0x36873b['stack']);if(_0x36873b['name']){delete _0x36873b[_0xa879('0x28')];}_0xa419e['status'](_0xc4f62d)[_0xa879('0x29')](_0x36873b);};}exports[_0xa879('0x2a')]=function(_0x5a2341,_0x2f897e){var _0x5bfe13={},_0x1c7ab3={},_0x1172c4={'count':0x0,'rows':[]};var _0x5bc4cb=_[_0xa879('0x2b')](db[_0xa879('0x2c')]['rawAttributes'],function(_0x48da0a){return{'name':_0x48da0a[_0xa879('0x2d')],'type':_0x48da0a[_0xa879('0x2e')][_0xa879('0x2f')]};});_0x1c7ab3[_0xa879('0x30')]=_['map'](_0x5bc4cb,_0xa879('0x28'));_0x1c7ab3[_0xa879('0x31')]=_[_0xa879('0x32')](_0x5a2341[_0xa879('0x31')]);_0x1c7ab3['filters']=_[_0xa879('0x33')](_0x1c7ab3[_0xa879('0x30')],_0x1c7ab3[_0xa879('0x31')]);_0x5bfe13[_0xa879('0x34')]=_['intersection'](_0x1c7ab3[_0xa879('0x30')],qs[_0xa879('0x35')](_0x5a2341[_0xa879('0x31')][_0xa879('0x35')]));_0x5bfe13[_0xa879('0x34')]=_0x5bfe13[_0xa879('0x34')][_0xa879('0x36')]?_0x5bfe13['attributes']:_0x1c7ab3[_0xa879('0x30')];if(!_0x5a2341[_0xa879('0x31')]['hasOwnProperty'](_0xa879('0x37'))){_0x5bfe13['limit']=qs[_0xa879('0x1a')](_0x5a2341[_0xa879('0x31')][_0xa879('0x1a')]);_0x5bfe13['offset']=qs[_0xa879('0x1d')](_0x5a2341[_0xa879('0x31')][_0xa879('0x1d')]);}_0x5bfe13['order']=qs[_0xa879('0x38')](_0x5a2341[_0xa879('0x31')][_0xa879('0x38')]);_0x5bfe13[_0xa879('0x39')]=qs[_0xa879('0x3a')](_[_0xa879('0x3b')](_0x5a2341[_0xa879('0x31')],_0x1c7ab3[_0xa879('0x3a')]),_0x5bc4cb);if(_0x5a2341[_0xa879('0x31')][_0xa879('0x3c')]){_0x5bfe13[_0xa879('0x39')]=_['merge'](_0x5bfe13['where'],{'$or':_[_0xa879('0x2b')](_0x5bc4cb,function(_0xe49d74){if(_0xe49d74['type']!==_0xa879('0x3d')){var _0x43647f={};_0x43647f[_0xe49d74['name']]={'$like':'%'+_0x5a2341['query']['filter']+'%'};return _0x43647f;}})});}_0x5bfe13=_[_0xa879('0x3e')]({},_0x5bfe13,_0x5a2341[_0xa879('0x3f')]);var _0x5ab6eb={'where':_0x5bfe13[_0xa879('0x39')]};return db[_0xa879('0x2c')][_0xa879('0x1c')](_0x5ab6eb)[_0xa879('0x23')](function(_0x100e41){_0x1172c4[_0xa879('0x1c')]=_0x100e41;if(_0x5a2341['query'][_0xa879('0x40')]){_0x5bfe13[_0xa879('0x41')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x5bfe13);})[_0xa879('0x23')](function(_0x5f58b6){_0x1172c4['rows']=_0x5f58b6;return _0x1172c4;})['then'](respondWithFilteredResult(_0x2f897e,_0x5bfe13))[_0xa879('0x42')](handleError(_0x2f897e,null));};exports[_0xa879('0x43')]=function(_0x394814,_0x3a572f){var _0x1bac5b={'raw':!![],'where':{'id':_0x394814[_0xa879('0x44')]['id']}},_0x515a0d={};_0x515a0d[_0xa879('0x30')]=_[_0xa879('0x32')](db['Attachment'][_0xa879('0x45')]);_0x515a0d[_0xa879('0x31')]=_[_0xa879('0x32')](_0x394814[_0xa879('0x31')]);_0x515a0d['filters']=_['intersection'](_0x515a0d[_0xa879('0x30')],_0x515a0d[_0xa879('0x31')]);_0x1bac5b['attributes']=_[_0xa879('0x33')](_0x515a0d[_0xa879('0x30')],qs[_0xa879('0x35')](_0x394814[_0xa879('0x31')][_0xa879('0x35')]));_0x1bac5b[_0xa879('0x34')]=_0x1bac5b['attributes'][_0xa879('0x36')]?_0x1bac5b[_0xa879('0x34')]:_0x515a0d['model'];if(_0x394814[_0xa879('0x31')]['includeAll']){_0x1bac5b[_0xa879('0x41')]=[{'all':!![]}];}_0x1bac5b=_[_0xa879('0x3e')]({},_0x1bac5b,_0x394814['options']);return db[_0xa879('0x2c')]['find'](_0x1bac5b)[_0xa879('0x23')](handleEntityNotFound(_0x3a572f,null))[_0xa879('0x23')](respondWithResult(_0x3a572f,null))[_0xa879('0x42')](handleError(_0x3a572f,null));};exports[_0xa879('0x46')]=function(_0x5416c0,_0x1c676d){var _0x519b09={'where':{'id':_0x5416c0[_0xa879('0x44')]['id']}},_0x367ffc={};_0x367ffc[_0xa879('0x30')]=_[_0xa879('0x32')](db['Attachment'][_0xa879('0x45')]);_0x519b09[_0xa879('0x34')]=_[_0xa879('0x33')](_0x367ffc[_0xa879('0x30')],qs[_0xa879('0x35')](_0x5416c0[_0xa879('0x31')][_0xa879('0x35')]));_0x519b09[_0xa879('0x34')]=_0x519b09[_0xa879('0x34')][_0xa879('0x36')]?_0x519b09[_0xa879('0x34')]:_0x367ffc[_0xa879('0x30')];if(_0x5416c0[_0xa879('0x31')][_0xa879('0x40')]){_0x519b09[_0xa879('0x41')]=[{'all':!![]}];}_0x519b09=_[_0xa879('0x3e')]({},_0x519b09,_0x5416c0[_0xa879('0x3f')]);return db[_0xa879('0x2c')]['find'](_0x519b09)[_0xa879('0x23')](handleEntityNotFound(_0x1c676d,null))['then'](function(_0x169944){if(_0x169944){var _0x2da688=_0x169944['get']({'plain':!![]});_0x2da688=qs['omit'](_0x2da688,['id','createdAt',_0xa879('0x47')]);_0x5416c0['body']=_[_0xa879('0x48')](_0x5416c0[_0xa879('0x49')],['id',_0xa879('0x4a'),'updatedAt']);return db[_0xa879('0x2c')][_0xa879('0x4b')](_[_0xa879('0x3e')](_0x2da688,_0x5416c0[_0xa879('0x49')]),{'include':_0x5416c0['query'][_0xa879('0x40')]?[{'all':!![]}]:undefined});}})[_0xa879('0x23')](respondWithResult(_0x1c676d,0xc9))[_0xa879('0x42')](handleError(_0x1c676d,null));};exports['update']=function(_0x4ccec5,_0x48b2e8){if(_0x4ccec5['body']['id']){delete _0x4ccec5[_0xa879('0x49')]['id'];}return db[_0xa879('0x2c')][_0xa879('0x4c')]({'where':{'id':_0x4ccec5[_0xa879('0x44')]['id']}})[_0xa879('0x23')](handleEntityNotFound(_0x48b2e8,null))['then'](saveUpdates(_0x4ccec5[_0xa879('0x49')],null))[_0xa879('0x23')](respondWithResult(_0x48b2e8,null))['catch'](handleError(_0x48b2e8,null));};exports[_0xa879('0x24')]=function(_0x3d3972,_0x4cb284){return db[_0xa879('0x2c')][_0xa879('0x4c')]({'where':{'id':_0x3d3972['params']['id']}})[_0xa879('0x23')](handleEntityNotFound(_0x4cb284,null))['then'](removeEntity(_0x4cb284,null))['catch'](handleError(_0x4cb284,null));};exports[_0xa879('0x4b')]=function(_0x5b62a8,_0x51c737,_0x36ac0c){_0x5b62a8[_0xa879('0x49')][_0xa879('0x28')]=_0x5b62a8[_0xa879('0x4d')][_0xa879('0x4e')];_0x5b62a8[_0xa879('0x49')][_0xa879('0x4f')]=_0x5b62a8[_0xa879('0x4d')][_0xa879('0x50')];_0x5b62a8[_0xa879('0x49')][_0xa879('0x2e')]=_0x5b62a8[_0xa879('0x4d')][_0xa879('0x51')];return db[_0xa879('0x2c')][_0xa879('0x4b')](_0x5b62a8[_0xa879('0x49')])[_0xa879('0x23')](respondWithResult(_0x51c737,0xc9))[_0xa879('0x42')](handleError(_0x51c737,null));};exports[_0xa879('0x52')]=function(_0x4aee7c,_0x5b03e1,_0x492765){return db[_0xa879('0x2c')][_0xa879('0x53')]({'where':{'id':_0x4aee7c['params']['id']},'raw':!![]})[_0xa879('0x23')](handleEntityNotFound(_0x5b03e1,null))[_0xa879('0x23')](function(_0x3e1d33){if(_0x3e1d33){var _0x26ec16=_0x3e1d33['ChatOfflineMessageId']!==null;var _0xc14fb9=path[_0xa879('0x54')](config[_0xa879('0x55')],_0xa879('0x56'));if(_0x26ec16){_0xc14fb9=path[_0xa879('0x54')](_0xc14fb9,_0xa879('0x57'));}var _0x1560c4=path['join'](_0xc14fb9,_0x3e1d33['basename']);return _0x5b03e1[_0xa879('0x52')](_0x1560c4);}})[_0xa879('0x42')](handleError(_0x5b03e1,null));};
\ No newline at end of file
+var _0x07c4=['count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Attachment','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit'];(function(_0x55f6d7,_0x5bd984){var _0x2153cc=function(_0x11ff8b){while(--_0x11ff8b){_0x55f6d7['push'](_0x55f6d7['shift']());}};_0x2153cc(++_0x5bd984);}(_0x07c4,0xee));var _0x407c=function(_0x3ebc22,_0x23c72c){_0x3ebc22=_0x3ebc22-0x0;var _0xb676b7=_0x07c4[_0x3ebc22];return _0xb676b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x407c('0x0'));var rp=require(_0x407c('0x1'));var moment=require(_0x407c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x407c('0x3'));var util=require(_0x407c('0x4'));var path=require(_0x407c('0x5'));var sox=require(_0x407c('0x6'));var csv=require('to-csv');var ejs=require(_0x407c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x407c('0x8'));var squel=require(_0x407c('0x9'));var crypto=require(_0x407c('0xa'));var jsforce=require(_0x407c('0xb'));var deskjs=require(_0x407c('0xc'));var toCsv=require(_0x407c('0xd'));var querystring=require(_0x407c('0xe'));var Papa=require(_0x407c('0xf'));var Redis=require(_0x407c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x407c('0x11'));var hardwareService=require(_0x407c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x407c('0x13'));var config=require(_0x407c('0x14'));var licenseUtil=require(_0x407c('0x15'));var db=require(_0x407c('0x16'))['db'];function respondWithStatusCode(_0x107c9f,_0x3c5dcf){_0x3c5dcf=_0x3c5dcf||0xcc;return function(_0x5248e6){if(_0x5248e6){return _0x107c9f['sendStatus'](_0x3c5dcf);}return _0x107c9f[_0x407c('0x17')](_0x3c5dcf)['end']();};}function respondWithResult(_0x27c194,_0x480244){_0x480244=_0x480244||0xc8;return function(_0x488b47){if(_0x488b47){return _0x27c194[_0x407c('0x17')](_0x480244)['json'](_0x488b47);}};}function respondWithFilteredResult(_0x3e2db7,_0x298f9e){return function(_0x4988a7){if(_0x4988a7){var _0x5f2924=typeof _0x298f9e[_0x407c('0x18')]==='undefined'&&typeof _0x298f9e[_0x407c('0x19')]==='undefined';var _0xa74f67=_0x4988a7[_0x407c('0x1a')];var _0x308275=_0x5f2924?0x0:_0x298f9e[_0x407c('0x18')];var _0x166bc5=_0x5f2924?_0x4988a7[_0x407c('0x1a')]:_0x298f9e[_0x407c('0x18')]+_0x298f9e['limit'];var _0x3beafe;if(_0x166bc5>=_0xa74f67){_0x166bc5=_0xa74f67;_0x3beafe=0xc8;}else{_0x3beafe=0xce;}_0x3e2db7[_0x407c('0x17')](_0x3beafe);return _0x3e2db7[_0x407c('0x1b')](_0x407c('0x1c'),_0x308275+'-'+_0x166bc5+'/'+_0xa74f67)['json'](_0x4988a7);}return null;};}function patchUpdates(_0x4c0427){return function(_0x422208){try{jsonpatch[_0x407c('0x1d')](_0x422208,_0x4c0427,!![]);}catch(_0x415242){return BPromise[_0x407c('0x1e')](_0x415242);}return _0x422208[_0x407c('0x1f')]();};}function saveUpdates(_0x108580,_0x31fb2c){return function(_0x4e28e8){if(_0x4e28e8){return _0x4e28e8[_0x407c('0x20')](_0x108580)[_0x407c('0x21')](function(_0x270af4){return _0x270af4;});}return null;};}function removeEntity(_0x212afa,_0x21a3da){return function(_0xd2fcc0){if(_0xd2fcc0){return _0xd2fcc0[_0x407c('0x22')]()[_0x407c('0x21')](function(){_0x212afa['status'](0xcc)[_0x407c('0x23')]();});}};}function handleEntityNotFound(_0x1d4f13,_0x47ca0e){return function(_0x32f515){if(!_0x32f515){_0x1d4f13[_0x407c('0x24')](0x194);}return _0x32f515;};}function handleError(_0x3fecbd,_0x33c6cf){_0x33c6cf=_0x33c6cf||0x1f4;return function(_0x20c734){logger[_0x407c('0x25')](_0x20c734[_0x407c('0x26')]);if(_0x20c734[_0x407c('0x27')]){delete _0x20c734['name'];}_0x3fecbd[_0x407c('0x17')](_0x33c6cf)[_0x407c('0x28')](_0x20c734);};}exports[_0x407c('0x29')]=function(_0x59ef01,_0x6636e4){var _0x11ad5a={},_0x1ac680={},_0x3cba0e={'count':0x0,'rows':[]};var _0x3adacf=_[_0x407c('0x2a')](db[_0x407c('0x2b')]['rawAttributes'],function(_0x33f2d2){return{'name':_0x33f2d2['fieldName'],'type':_0x33f2d2[_0x407c('0x2c')][_0x407c('0x2d')]};});_0x1ac680[_0x407c('0x2e')]=_[_0x407c('0x2a')](_0x3adacf,'name');_0x1ac680['query']=_[_0x407c('0x2f')](_0x59ef01['query']);_0x1ac680[_0x407c('0x30')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],_0x1ac680[_0x407c('0x32')]);_0x11ad5a[_0x407c('0x33')]=_[_0x407c('0x31')](_0x1ac680[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x59ef01[_0x407c('0x32')][_0x407c('0x34')]));_0x11ad5a['attributes']=_0x11ad5a[_0x407c('0x33')]['length']?_0x11ad5a[_0x407c('0x33')]:_0x1ac680[_0x407c('0x2e')];if(!_0x59ef01[_0x407c('0x32')][_0x407c('0x35')]('nolimit')){_0x11ad5a['limit']=qs['limit'](_0x59ef01[_0x407c('0x32')]['limit']);_0x11ad5a[_0x407c('0x18')]=qs['offset'](_0x59ef01['query'][_0x407c('0x18')]);}_0x11ad5a[_0x407c('0x36')]=qs[_0x407c('0x37')](_0x59ef01[_0x407c('0x32')][_0x407c('0x37')]);_0x11ad5a[_0x407c('0x38')]=qs[_0x407c('0x30')](_[_0x407c('0x39')](_0x59ef01[_0x407c('0x32')],_0x1ac680['filters']),_0x3adacf);if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3a')]){_0x11ad5a[_0x407c('0x38')]=_['merge'](_0x11ad5a[_0x407c('0x38')],{'$or':_['map'](_0x3adacf,function(_0x13f8d7){if(_0x13f8d7[_0x407c('0x2c')]!=='VIRTUAL'){var _0x1bcfaf={};_0x1bcfaf[_0x13f8d7['name']]={'$like':'%'+_0x59ef01[_0x407c('0x32')]['filter']+'%'};return _0x1bcfaf;}})});}_0x11ad5a=_[_0x407c('0x3b')]({},_0x11ad5a,_0x59ef01[_0x407c('0x3c')]);var _0x4e9188={'where':_0x11ad5a[_0x407c('0x38')]};return db[_0x407c('0x2b')][_0x407c('0x1a')](_0x4e9188)[_0x407c('0x21')](function(_0x1060a3){_0x3cba0e[_0x407c('0x1a')]=_0x1060a3;if(_0x59ef01[_0x407c('0x32')][_0x407c('0x3d')]){_0x11ad5a[_0x407c('0x3e')]=[{'all':!![]}];}return db[_0x407c('0x2b')]['findAll'](_0x11ad5a);})[_0x407c('0x21')](function(_0x546475){_0x3cba0e['rows']=_0x546475;return _0x3cba0e;})[_0x407c('0x21')](respondWithFilteredResult(_0x6636e4,_0x11ad5a))[_0x407c('0x3f')](handleError(_0x6636e4,null));};exports[_0x407c('0x40')]=function(_0x155426,_0x34bf99){var _0x1ba512={'raw':!![],'where':{'id':_0x155426[_0x407c('0x41')]['id']}},_0x160501={};_0x160501['model']=_[_0x407c('0x2f')](db[_0x407c('0x2b')][_0x407c('0x42')]);_0x160501[_0x407c('0x32')]=_[_0x407c('0x2f')](_0x155426[_0x407c('0x32')]);_0x160501[_0x407c('0x30')]=_['intersection'](_0x160501[_0x407c('0x2e')],_0x160501[_0x407c('0x32')]);_0x1ba512['attributes']=_['intersection'](_0x160501[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x155426[_0x407c('0x32')][_0x407c('0x34')]));_0x1ba512[_0x407c('0x33')]=_0x1ba512[_0x407c('0x33')]['length']?_0x1ba512[_0x407c('0x33')]:_0x160501[_0x407c('0x2e')];if(_0x155426[_0x407c('0x32')][_0x407c('0x3d')]){_0x1ba512[_0x407c('0x3e')]=[{'all':!![]}];}_0x1ba512=_[_0x407c('0x3b')]({},_0x1ba512,_0x155426['options']);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x1ba512)[_0x407c('0x21')](handleEntityNotFound(_0x34bf99,null))[_0x407c('0x21')](respondWithResult(_0x34bf99,null))[_0x407c('0x3f')](handleError(_0x34bf99,null));};exports[_0x407c('0x44')]=function(_0x2f1666,_0x1c38e9){var _0x2a9fd0={'where':{'id':_0x2f1666['params']['id']}},_0x3d9b15={};_0x3d9b15[_0x407c('0x2e')]=_[_0x407c('0x2f')](db['Attachment'][_0x407c('0x42')]);_0x2a9fd0[_0x407c('0x33')]=_[_0x407c('0x31')](_0x3d9b15[_0x407c('0x2e')],qs[_0x407c('0x34')](_0x2f1666['query'][_0x407c('0x34')]));_0x2a9fd0[_0x407c('0x33')]=_0x2a9fd0[_0x407c('0x33')][_0x407c('0x45')]?_0x2a9fd0['attributes']:_0x3d9b15[_0x407c('0x2e')];if(_0x2f1666[_0x407c('0x32')][_0x407c('0x3d')]){_0x2a9fd0[_0x407c('0x3e')]=[{'all':!![]}];}_0x2a9fd0=_['merge']({},_0x2a9fd0,_0x2f1666[_0x407c('0x3c')]);return db[_0x407c('0x2b')][_0x407c('0x43')](_0x2a9fd0)[_0x407c('0x21')](handleEntityNotFound(_0x1c38e9,null))['then'](function(_0x4b44c8){if(_0x4b44c8){var _0x1bd66a=_0x4b44c8[_0x407c('0x46')]({'plain':!![]});_0x1bd66a=qs[_0x407c('0x47')](_0x1bd66a,['id',_0x407c('0x48'),_0x407c('0x49')]);_0x2f1666[_0x407c('0x4a')]=_['omit'](_0x2f1666[_0x407c('0x4a')],['id',_0x407c('0x48'),'updatedAt']);return db[_0x407c('0x2b')][_0x407c('0x4b')](_[_0x407c('0x3b')](_0x1bd66a,_0x2f1666[_0x407c('0x4a')]),{'include':_0x2f1666[_0x407c('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x407c('0x21')](respondWithResult(_0x1c38e9,0xc9))[_0x407c('0x3f')](handleError(_0x1c38e9,null));};exports[_0x407c('0x20')]=function(_0x474d01,_0x52f050){if(_0x474d01[_0x407c('0x4a')]['id']){delete _0x474d01['body']['id'];}return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x474d01['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x52f050,null))[_0x407c('0x21')](saveUpdates(_0x474d01['body'],null))[_0x407c('0x21')](respondWithResult(_0x52f050,null))['catch'](handleError(_0x52f050,null));};exports[_0x407c('0x22')]=function(_0x368dc6,_0x13c72){return db[_0x407c('0x2b')][_0x407c('0x43')]({'where':{'id':_0x368dc6['params']['id']}})[_0x407c('0x21')](handleEntityNotFound(_0x13c72,null))['then'](removeEntity(_0x13c72,null))[_0x407c('0x3f')](handleError(_0x13c72,null));};exports['create']=function(_0x188bf5,_0x556260,_0x4dc048){_0x188bf5[_0x407c('0x4a')][_0x407c('0x27')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4d')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x4e')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x4f')];_0x188bf5[_0x407c('0x4a')][_0x407c('0x2c')]=_0x188bf5[_0x407c('0x4c')][_0x407c('0x50')];return db[_0x407c('0x2b')][_0x407c('0x4b')](_0x188bf5[_0x407c('0x4a')])[_0x407c('0x21')](respondWithResult(_0x556260,0xc9))['catch'](handleError(_0x556260,null));};exports[_0x407c('0x51')]=function(_0x26f05e,_0x109b19,_0x4a6608){return db[_0x407c('0x2b')][_0x407c('0x52')]({'where':{'id':_0x26f05e['params']['id']},'raw':!![]})[_0x407c('0x21')](handleEntityNotFound(_0x109b19,null))[_0x407c('0x21')](function(_0x450416){if(_0x450416){var _0x339260=_0x450416[_0x407c('0x53')]!==null;var _0x5ed0b9=path[_0x407c('0x54')](config[_0x407c('0x55')],_0x407c('0x56'));if(_0x339260){_0x5ed0b9=path[_0x407c('0x54')](_0x5ed0b9,_0x407c('0x57'));}var _0x503de8=path[_0x407c('0x54')](_0x5ed0b9,_0x450416[_0x407c('0x4e')]);return _0x109b19[_0x407c('0x51')](_0x503de8);}})[_0x407c('0x3f')](handleError(_0x109b19,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 519440a..e496daa 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 _0xd114=['../../config/logger','moment','request-promise','path','rimraf','exports','attachments','lodash','util'];(function(_0x548db3,_0x9b9ee){var _0x3cc38c=function(_0x17d0e8){while(--_0x17d0e8){_0x548db3['push'](_0x548db3['shift']());}};_0x3cc38c(++_0x9b9ee);}(_0xd114,0x15d));var _0x4d11=function(_0x3be555,_0x3be8f7){_0x3be555=_0x3be555-0x0;var _0xd631ce=_0xd114[_0x3be555];return _0xd631ce;};'use strict';var _=require(_0x4d11('0x0'));var util=require(_0x4d11('0x1'));var logger=require(_0x4d11('0x2'))('api');var moment=require(_0x4d11('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d11('0x4'));var fs=require('fs');var path=require(_0x4d11('0x5'));var rimraf=require(_0x4d11('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x4d11('0x7')]=function(_0x15090f,_0x46c915){return _0x15090f['define']('Attachment',attributes,{'tableName':_0x4d11('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1189=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x257fd4,_0x446a74){var _0x3bbcba=function(_0x53549c){while(--_0x53549c){_0x257fd4['push'](_0x257fd4['shift']());}};_0x3bbcba(++_0x446a74);}(_0x1189,0x157));var _0x9118=function(_0x5dacd7,_0x4a0c65){_0x5dacd7=_0x5dacd7-0x0;var _0x566b81=_0x1189[_0x5dacd7];return _0x566b81;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require(_0x9118('0x4'));var BPromise=require(_0x9118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require(_0x9118('0x7'));var config=require(_0x9118('0x8'));var attributes=require('./attachment.attributes');module[_0x9118('0x9')]=function(_0x57e0c1,_0x59546a){return _0x57e0c1[_0x9118('0xa')]('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 718ee66..c95246a 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 _0x37dc=['error','code','message','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','ioredis','../../config/utils','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6003d7,_0x4ecf4d){var _0x27cb94=function(_0x18bc74){while(--_0x18bc74){_0x6003d7['push'](_0x6003d7['shift']());}};_0x27cb94(++_0x4ecf4d);}(_0x37dc,0x1e9));var _0xc37d=function(_0xf60cfb,_0x3bb1f2){_0xf60cfb=_0xf60cfb-0x0;var _0x5eb02d=_0x37dc[_0xf60cfb];return _0x5eb02d;};'use strict';var _=require(_0xc37d('0x0'));var util=require(_0xc37d('0x1'));var moment=require(_0xc37d('0x2'));var BPromise=require(_0xc37d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc37d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc37d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc37d('0x6')][_0xc37d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11fe31,_0x368c3b,_0x1d6e8b){return new BPromise(function(_0x2076b3,_0x79252d){return client[_0xc37d('0x8')](_0x11fe31,_0x1d6e8b)[_0xc37d('0x9')](function(_0x5a0a61){logger[_0xc37d('0xa')](_0xc37d('0xb'),_0x368c3b,'request\x20sent');logger[_0xc37d('0xc')](_0xc37d('0xd'),_0x368c3b,'request\x20sent',JSON[_0xc37d('0xe')](_0x5a0a61));if(_0x5a0a61[_0xc37d('0xf')]){if(_0x5a0a61['error'][_0xc37d('0x10')]===0x1f4){logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x79252d(_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);}logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x2076b3(_0x5a0a61[_0xc37d('0xf')]['message']);}else{logger['info'](_0xc37d('0xb'),_0x368c3b,'request\x20sent');_0x2076b3(_0x5a0a61['result'][_0xc37d('0x11')]);}})[_0xc37d('0x12')](function(_0x5b204f){logger[_0xc37d('0xf')]('Attachment,\x20%s,\x20%s',_0x368c3b,_0x5b204f);_0x79252d(_0x5b204f);});});}exports['CreateAttachment']=function(_0xcd23a5){var _0x1816f4=this;return new Promise(function(_0xfefa40,_0x36ee50){return db[_0xc37d('0x13')][_0xc37d('0x14')](_0xcd23a5['body'],{'raw':_0xcd23a5['options']?_0xcd23a5[_0xc37d('0x15')][_0xc37d('0x16')]===undefined?!![]:![]:!![]})[_0xc37d('0x9')](function(_0x526ae1){logger[_0xc37d('0xa')](_0xc37d('0x17'),_0xcd23a5);logger['debug'](_0xc37d('0x17'),_0xcd23a5,JSON['stringify'](_0x526ae1));_0xfefa40(_0x526ae1);})[_0xc37d('0x12')](function(_0x3db21b){logger[_0xc37d('0xf')](_0xc37d('0x17'),_0x3db21b[_0xc37d('0x11')],_0xcd23a5);_0x36ee50(_0x1816f4[_0xc37d('0xf')](0x1f4,_0x3db21b[_0xc37d('0x11')]));});});};
\ No newline at end of file
+var _0x3299=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateAttachment','create','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd48545,_0x856e08){var _0x18094f=function(_0x528b05){while(--_0x528b05){_0xd48545['push'](_0xd48545['shift']());}};_0x18094f(++_0x856e08);}(_0x3299,0x1bc));var _0x9329=function(_0x3f906b,_0x42a1b5){_0x3f906b=_0x3f906b-0x0;var _0x5ce241=_0x3299[_0x3f906b];return _0x5ce241;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Attachment,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Attachment'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 0bb6338..6172c4b 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1a6690,_0x42c6b8){var _0x595682=function(_0x4d739c){while(--_0x4d739c){_0x1a6690['push'](_0x1a6690['shift']());}};_0x595682(++_0x42c6b8);}(_0x2032,0xd9));var _0x2203=function(_0x1bf306,_0x1fc986){_0x1bf306=_0x1bf306-0x0;var _0x572e11=_0x2032[_0x1bf306];return _0x572e11;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _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(_0x3c89bc,_0x210d5a){var _0x3dba77=function(_0x214dff){while(--_0x214dff){_0x3c89bc['push'](_0x3c89bc['shift']());}};_0x3dba77(++_0x210d5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d8884,_0x2b6633){_0x4d8884=_0x4d8884-0x0;var _0x49300c=_0x5f2f[_0x4d8884];return _0x49300c;};'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 d0eb30a..037826b 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 _0x4f83=['../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','getLicense','catch','Strategy','../../config/environment','../../components/auth/service','signToken'];(function(_0x9247d1,_0x567354){var _0x41b09d=function(_0x4c7b6f){while(--_0x4c7b6f){_0x9247d1['push'](_0x9247d1['shift']());}};_0x41b09d(++_0x567354);}(_0x4f83,0x65));var _0x34f8=function(_0x2225ca,_0x46ea1a){_0x2225ca=_0x2225ca-0x0;var _0x35a4c7=_0x4f83[_0x2225ca];return _0x35a4c7;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x34f8('0x0')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x34f8('0x1'));var signToken=require(_0x34f8('0x2'))[_0x34f8('0x3')];var utils=require(_0x34f8('0x4'));exports[_0x34f8('0x5')]=passport[_0x34f8('0x6')](_0x34f8('0x7'),{'failureRedirect':_0x34f8('0x8'),'scope':[_0x34f8('0x9'),_0x34f8('0xa')],'session':![]});exports[_0x34f8('0xb')]=passport[_0x34f8('0x6')]('google',{'failureRedirect':_0x34f8('0x8'),'session':![]});passport[_0x34f8('0xc')](new GoogleStrategy({'clientID':config[_0x34f8('0x7')]?config[_0x34f8('0x7')][_0x34f8('0xd')]:'id','clientSecret':config[_0x34f8('0x7')]?config['google']['clientSecret']:_0x34f8('0xe'),'callbackURL':config['google']?config[_0x34f8('0x7')][_0x34f8('0xf')]:''},function(_0x20f3da,_0x1668fb,_0x2313de,_0x32282b){var _0x58a091,_0x171e8a;return db[_0x34f8('0x10')][_0x34f8('0x11')]({'where':{'id':0x1},'attributes':[_0x34f8('0x12'),_0x34f8('0x13')],'raw':!![]})[_0x34f8('0x14')](function(_0x4f8330){_0x58a091=_0x4f8330;return db[_0x34f8('0x15')]['find']({'where':{'email':_[_0x34f8('0x16')](_0x2313de[_0x34f8('0x17')],_0x34f8('0x18')),'role':{'$or':[_0x34f8('0x19'),_0x34f8('0x1a'),_0x34f8('0x1b')]}}});})['then'](function(_0x4003ab){_0x171e8a=_0x4003ab;if(_0x171e8a){if(_0x171e8a[_0x34f8('0x1c')]){return _0x32282b(_0x34f8('0x1d'));}else if(_0x58a091[_0x34f8('0x13')]>0x0){if(_0x171e8a['blocked']){if(moment(_0x171e8a[_0x34f8('0x1e')])[_0x34f8('0x1f')](_0x58a091[_0x34f8('0x13')],'minutes')>moment()){return _0x32282b(_0x34f8('0x1d'));}else{return utils[_0x34f8('0x20')](_0x171e8a,0x0,![],null)[_0x34f8('0x14')](function(){return utils[_0x34f8('0x21')](_0x171e8a);})[_0x34f8('0x14')](function(){return _0x32282b(null,_0x171e8a);});}}else{return utils[_0x34f8('0x21')](_0x171e8a)[_0x34f8('0x14')](function(){return _0x32282b(null,_0x171e8a);});}}else{return utils[_0x34f8('0x21')](_0x171e8a)[_0x34f8('0x14')](function(){return _0x32282b(null,_0x171e8a);});}}return _0x32282b(_0x34f8('0x1d'));})[_0x34f8('0x22')](function(_0x56f6ef){_0x32282b(_0x56f6ef);});}));
\ No newline at end of file
+var _0x233c=['lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','/login','profile','email','callback','google','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','disabled','blocked','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x233c,0x130));var _0xc233=function(_0x4348cf,_0x3c5e31){_0x4348cf=_0x4348cf-0x0;var _0xa33ff3=_0x233c[_0x4348cf];return _0xa33ff3;};'use strict';var _=require(_0xc233('0x0'));var passport=require(_0xc233('0x1'));var GoogleStrategy=require(_0xc233('0x2'))[_0xc233('0x3')];var moment=require('moment');var db=require(_0xc233('0x4'))['db'];var config=require(_0xc233('0x5'));var signToken=require(_0xc233('0x6'))[_0xc233('0x7')];var utils=require('../../config/utils');exports[_0xc233('0x8')]=passport[_0xc233('0x9')]('google',{'failureRedirect':_0xc233('0xa'),'scope':[_0xc233('0xb'),_0xc233('0xc')],'session':![]});exports[_0xc233('0xd')]=passport[_0xc233('0x9')](_0xc233('0xe'),{'failureRedirect':'/login','session':![]});passport[_0xc233('0xf')](new GoogleStrategy({'clientID':config[_0xc233('0xe')]?config['google']['clientID']:'id','clientSecret':config[_0xc233('0xe')]?config['google'][_0xc233('0x10')]:_0xc233('0x11'),'callbackURL':config[_0xc233('0xe')]?config[_0xc233('0xe')][_0xc233('0x12')]:''},function(_0x505ed3,_0x1bf040,_0x3a6592,_0xf83721){var _0x1c1a97,_0x4da362;return db[_0xc233('0x13')][_0xc233('0x14')]({'where':{'id':0x1},'attributes':[_0xc233('0x15'),_0xc233('0x16')],'raw':!![]})[_0xc233('0x17')](function(_0x574695){_0x1c1a97=_0x574695;return db[_0xc233('0x18')][_0xc233('0x19')]({'where':{'email':_[_0xc233('0x1a')](_0x3a6592['emails'],_0xc233('0x1b')),'role':{'$or':[_0xc233('0x1c'),_0xc233('0x1d'),_0xc233('0x1e')]}}});})[_0xc233('0x17')](function(_0x1b22d2){_0x4da362=_0x1b22d2;if(_0x4da362){if(_0x4da362[_0xc233('0x1f')]){return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1c1a97['blockDuration']>0x0){if(_0x4da362[_0xc233('0x20')]){if(moment(_0x4da362['blockedAt'])[_0xc233('0x21')](_0x1c1a97[_0xc233('0x16')],'minutes')>moment()){return _0xf83721(_0xc233('0x22'));}else{return utils[_0xc233('0x23')](_0x4da362,0x0,![],null)[_0xc233('0x17')](function(){return utils[_0xc233('0x24')](_0x4da362);})['then'](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}else{return utils[_0xc233('0x24')](_0x4da362)[_0xc233('0x17')](function(){return _0xf83721(null,_0x4da362);});}}return _0xf83721('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc233('0x25')](function(_0x3455bc){_0xf83721(_0x3455bc);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 00ab633..fe98fee 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 _0xc52f=['callback','isMiddleware','exports','express','passport','../../components/auth/service','get','login'];(function(_0x1d74aa,_0x5709ab){var _0x26b038=function(_0x2e9b60){while(--_0x2e9b60){_0x1d74aa['push'](_0x1d74aa['shift']());}};_0x26b038(++_0x5709ab);}(_0xc52f,0x1e3));var _0xfc52=function(_0x407c08,_0x1ab7fb){_0x407c08=_0x407c08-0x0;var _0x4995b0=_0xc52f[_0x407c08];return _0x4995b0;};'use strict';var express=require(_0xfc52('0x0'));var passport=require(_0xfc52('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xfc52('0x2'));router[_0xfc52('0x3')]('/',controller[_0xfc52('0x4')]);router['get']('/callback',controller[_0xfc52('0x5')],authService[_0xfc52('0x6')],userController[_0xfc52('0x4')],authService['setTokenCookie']);module[_0xfc52('0x7')]=router;
\ No newline at end of file
+var _0x1666=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x4f9e17,_0x58a581){var _0x514a97=function(_0x1c48e1){while(--_0x1c48e1){_0x4f9e17['push'](_0x4f9e17['shift']());}};_0x514a97(++_0x58a581);}(_0x1666,0x75));var _0x6166=function(_0x3c73f3,_0x231858){_0x3c73f3=_0x3c73f3-0x0;var _0x435c58=_0x1666[_0x3c73f3];return _0x435c58;};'use strict';var express=require(_0x6166('0x0'));var passport=require(_0x6166('0x1'));var router=express['Router']();var controller=require(_0x6166('0x2'));var userController=require(_0x6166('0x3'));var authService=require(_0x6166('0x4'));router[_0x6166('0x5')]('/',controller[_0x6166('0x6')]);router[_0x6166('0x5')](_0x6166('0x7'),controller[_0x6166('0x8')],authService['isMiddleware'],userController[_0x6166('0x6')],authService[_0x6166('0x9')]);module[_0x6166('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 fa865f3..ab51c6f 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 _0x1307=['blocked','blockedAt','admin','loginAttempts','disabled','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','catch','getLicense','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','user','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','authenticate','local','signToken','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','Strategy','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role'];(function(_0x5374a0,_0x2e1984){var _0x356501=function(_0xa3a652){while(--_0xa3a652){_0x5374a0['push'](_0x5374a0['shift']());}};_0x356501(++_0x2e1984);}(_0x1307,0xa1));var _0x7130=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x1307[_0xb24a3e];return _0x4038d7;};'use strict';var util=require(_0x7130('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x7130('0x1')];var jayson=require('jayson/promise');var _=require(_0x7130('0x2'));var rs=require(_0x7130('0x3'));var moment=require(_0x7130('0x4'));var db=require(_0x7130('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x7130('0x6'));var client=jayson[_0x7130('0x7')][_0x7130('0x8')]({'port':0x232b});function localAuthenticate(_0x45af94,_0x5014af,_0x58b3d9,_0x397267){var _0x42d16d,_0x235871;return db[_0x7130('0x9')][_0x7130('0xa')]({'where':{'id':0x1},'attributes':[_0x7130('0xb'),_0x7130('0xc')],'raw':!![]})[_0x7130('0xd')](function(_0x3d48be){_0x42d16d=_0x3d48be;return _0x45af94[_0x7130('0xa')]({'attributes':['id',_0x7130('0xe'),'password',_0x7130('0xf'),_0x7130('0x10'),'disabled',_0x7130('0x11'),_0x7130('0x12'),'loginAttempts'],'where':{'name':_0x5014af,'role':{'$or':[_0x7130('0x13'),'user','agent']}}});})[_0x7130('0xd')](function(_0xf53a62){if(!_0xf53a62||_0xf53a62&&_0xf53a62['name']!==_0x5014af){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x235871=_0xf53a62;return _0x235871;}})[_0x7130('0xd')](function(){_0x235871['authenticate'](_0x58b3d9,function(_0x67471a,_0x57d1b2){var _0xc948b6=_0x235871[_0x7130('0x14')]+0x1;if(_0x67471a){return _0x397267(_0x67471a);}else if(!_0x57d1b2){if(_0x235871[_0x7130('0x15')]){return _0x397267(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x42d16d[_0x7130('0xb')]>0x0){if(_0x235871['blocked']){if(_0x42d16d[_0x7130('0xc')]>0x0){if(moment(_0x235871[_0x7130('0x12')])[_0x7130('0x16')](_0x42d16d['blockDuration'],_0x7130('0x17'))>moment()){return _0x397267(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x235871,_0xc948b6,![],null)[_0x7130('0xd')](function(){return _0x397267(null,![],{'message':_0x7130('0x18')});});}}else{return _0x397267(null,![],{'message':_0x7130('0x18')});}}else{if(_0xc948b6>=_0x42d16d[_0x7130('0xb')]){return utils['clearBlockUser'](_0x235871,0x0,!![],moment())['then'](function(){return _0x397267(null,![],{'message':_0x7130('0x18')});});}else{return utils['clearBlockUser'](_0x235871,_0xc948b6,![],null)[_0x7130('0xd')](function(){return _0x397267(null,![],{'message':_0x7130('0x18')});});}}}else{return _0x397267(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x235871['disabled']){return _0x397267(null,![],{'message':_0x7130('0x18')});}else if(_0x42d16d['allowedLoginAttempts']>0x0){if(_0x235871[_0x7130('0x11')]){if(_0x42d16d[_0x7130('0xc')]>0x0){if(moment(_0x235871['blockedAt'])['add'](_0x42d16d['blockDuration'],_0x7130('0x17'))>moment()){return _0x397267(null,![],{'message':_0x7130('0x18')});}else{return utils['clearBlockUser'](_0x235871,0x0,![],null)[_0x7130('0xd')](function(){return utils['getLicense'](_0x235871);})[_0x7130('0xd')](function(){return _0x397267(null,_0x235871);});}}else{return _0x397267(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7130('0x19')](_0x235871,0x0,![],null)[_0x7130('0xd')](function(){return utils['getLicense'](_0x235871);})[_0x7130('0xd')](function(){return _0x397267(null,_0x235871);})[_0x7130('0x1a')](function(_0xe3d5e5){return _0x397267(null,![],_0xe3d5e5);});}}else{if(_0x235871[_0x7130('0x11')]){return _0x397267(null,![],{'message':_0x7130('0x18')});}else{return utils[_0x7130('0x1b')](_0x235871)[_0x7130('0xd')](function(){return _0x397267(null,_0x235871);});}}}});})[_0x7130('0x1a')](function(_0x33cbf3){return _0x397267(null,![],_0x33cbf3);});}function sendServiceMail(_0xf62d9b){return db[_0x7130('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0x7130('0xe'),_0x7130('0x1d')],'include':[{'model':db[_0x7130('0x1e')],'as':'Smtp'}]})[_0x7130('0xd')](function(_0x2f5199){if(!_0x2f5199){throw new Error(_0x7130('0x1f'));}var _0x359cf4={'tls':{'rejectUnauthorized':![]}};if(_0x2f5199[_0x7130('0x20')][_0x7130('0x21')]){_0x359cf4['service']=_0x2f5199[_0x7130('0x20')]['service'];}else{_0x359cf4[_0x7130('0x22')]=_0x2f5199[_0x7130('0x20')]['host'];_0x359cf4[_0x7130('0x23')]=_0x2f5199[_0x7130('0x20')]['port'];_0x359cf4['secure']=_0x2f5199['Smtp'][_0x7130('0x24')];}if(_0x2f5199[_0x7130('0x20')][_0x7130('0x25')]){_0x359cf4[_0x7130('0x26')]={'user':_0x2f5199[_0x7130('0x20')][_0x7130('0x27')],'pass':_0x2f5199['Smtp']['pass']};}var _0x66bd0a={'account':_0x359cf4,'message':_[_0x7130('0x28')]({'from':util[_0x7130('0x29')](_0x7130('0x2a'),_0x2f5199[_0x7130('0xe')],_0x2f5199[_0x7130('0x1d')]||_0x2f5199[_0x7130('0x20')][_0x7130('0x27')])},_0xf62d9b)};return client[_0x7130('0x2b')]('SendMail',_0x66bd0a);})[_0x7130('0xd')](function(_0x5d2859){if(_0x5d2859[_0x7130('0x2c')]){throw new Error(util['format'](_0x7130('0x2d'),_0x5d2859['error'][_0x7130('0x2e')]||JSON[_0x7130('0x2f')](_0x5d2859[_0x7130('0x2c')])));}return!![];});}function handleError(_0x22e1ec,_0x3b20bc,_0x575842){return _0x22e1ec[_0x7130('0x30')](_0x3b20bc||0x1f4)['send']({'message':_0x575842?_0x575842['message']||_0x575842:''});}exports[_0x7130('0x31')]=function(_0xeb87be,_0x462aff,_0xefdb15){passport[_0x7130('0x32')](_0x7130('0x33'),function(_0x8a1473,_0x483a02,_0x4875b3){var _0x4eee5a=_0x8a1473||_0x4875b3;if(_0x4eee5a){return handleError(_0x462aff,0x191,_0x4eee5a);}if(!_0x483a02){return handleError(_0x462aff,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2a5752={'payload':{'id':_0x483a02['id'],'role':_0x483a02[_0x7130('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x7130('0x34')](_0x2a5752)[_0x7130('0xd')](function(_0x2f4223){_0x462aff['json']({'id':_0x483a02['id'],'token':_0x2f4223,'statusCall':'','isAlreadyLogged':_0x483a02[_0x7130('0x35')]});});}})(_0xeb87be,_0x462aff,_0xefdb15);};exports['forgot']=function(_0xaea3da,_0x1b3ccc,_0x2db9f8){if(!_0xaea3da['body'][_0x7130('0x1d')]){return handleError(_0x1b3ccc,0x1f4,{'message':_0x7130('0x36')});}var _0x4c88d7=rs[_0x7130('0x37')]();_0xaea3da['body']['email']=_0xaea3da[_0x7130('0x38')][_0x7130('0x1d')][_0x7130('0x39')]()[_0x7130('0x3a')]();var _0x52f162;return db['Setting'][_0x7130('0xa')]({'where':{'id':0x1},'attributes':[_0x7130('0xb'),_0x7130('0xc')],'raw':!![]})[_0x7130('0xd')](function(_0x318f17){_0x52f162=_0x318f17;return db[_0x7130('0x3b')][_0x7130('0x3c')]({'where':{'email':_0xaea3da['body'][_0x7130('0x1d')]}});})['then'](function(_0x5aef4a){if(!_0x5aef4a){throw new Error(_0x7130('0x3d'));}if(_0x5aef4a[_0x7130('0x15')]){throw new Error(_0x7130('0x3e'));}if(_0x5aef4a[_0x7130('0x11')]){if(moment(_0x5aef4a[_0x7130('0x12')])[_0x7130('0x16')](_0x52f162['blockDuration'],_0x7130('0x17'))>moment()){throw new Error(_0x7130('0x3f'));}else{_0x5aef4a[_0x7130('0x11')]=![];_0x5aef4a[_0x7130('0x12')]=null;}}_0x5aef4a[_0x7130('0x40')]=_0x4c88d7;_0x5aef4a[_0x7130('0x41')]=Date[_0x7130('0x42')]()+0x36ee80;return _0x5aef4a[_0x7130('0x43')]();})[_0x7130('0xd')](function(){return sendServiceMail({'to':_0xaea3da[_0x7130('0x38')][_0x7130('0x1d')],'subject':_0x7130('0x44'),'text':_0x7130('0x45')+_0x7130('0x46')+_0x7130('0x47')+_0xaea3da[_0x7130('0x48')]['host']+_0x7130('0x49')+_0x4c88d7+'\x0a\x0a'+_0x7130('0x4a')});})[_0x7130('0xd')](function(){_0x1b3ccc[_0x7130('0x30')](0xc8)[_0x7130('0x4b')]({'message':_0x7130('0x4c')});})[_0x7130('0x1a')](function(_0x494ecc){return handleError(_0x1b3ccc,0x1f4,_0x494ecc);});};exports[_0x7130('0x4d')]=function(_0x2df55b,_0x1f7abe,_0x3daf07){return db[_0x7130('0x3b')][_0x7130('0x3c')]({'where':{'resetPasswordToken':_0x2df55b[_0x7130('0x4e')][_0x7130('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x7130('0x42')]()}}})[_0x7130('0xd')](function(_0x3f138d){if(!_0x3f138d){throw new Error(_0x7130('0x50'));}return db[_0x7130('0x9')][_0x7130('0xa')]({'attributes':['id',_0x7130('0x51'),_0x7130('0x52'),_0x7130('0x53')]})[_0x7130('0xd')](function(_0x5e7362){if(_0x5e7362[_0x7130('0x51')])authService[_0x7130('0x54')](_0x2df55b[_0x7130('0x38')][_0x7130('0x55')]);if(!_0x5e7362[_0x7130('0x52')]||!_0x3f138d[_0x7130('0x56')])return _0x3f138d;authService[_0x7130('0x57')](_0x2df55b[_0x7130('0x38')][_0x7130('0x55')],_0x3f138d[_0x7130('0x56')],_0x5e7362[_0x7130('0x53')]);return _0x3f138d;})['then'](function(){_0x3f138d[_0x7130('0x55')]=_0x2df55b['body'][_0x7130('0x55')];_0x3f138d[_0x7130('0x40')]=null;_0x3f138d['resetPasswordExpires']=null;return _0x3f138d[_0x7130('0x43')]();});})['then'](function(){_0x1f7abe[_0x7130('0x30')](0xc8)['send']({'message':_0x7130('0x58')});})['catch'](function(_0x23c6b7){return handleError(_0x1f7abe,0x1f4,_0x23c6b7);});};passport['use'](new LocalStrategy({'usernameField':_0x7130('0xe'),'passwordField':'password'},function(_0x592624,_0x22f374,_0x26e061){return localAuthenticate(db[_0x7130('0x3b')],_0x592624,_0x22f374,_0x26e061);}));
\ No newline at end of file
+var _0x24cf=['body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','email','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot'];(function(_0x1c31f4,_0x8e8aeb){var _0x5a3f66=function(_0x3ff723){while(--_0x3ff723){_0x1c31f4['push'](_0x1c31f4['shift']());}};_0x5a3f66(++_0x8e8aeb);}(_0x24cf,0x1d5));var _0xf24c=function(_0x3a497b,_0x4c5cb7){_0x3a497b=_0x3a497b-0x0;var _0x2cfdb3=_0x24cf[_0x3a497b];return _0x2cfdb3;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xf24c('0x0'))[_0xf24c('0x1')];var jayson=require(_0xf24c('0x2'));var _=require(_0xf24c('0x3'));var rs=require(_0xf24c('0x4'));var moment=require('moment');var db=require(_0xf24c('0x5'))['db'];var authService=require(_0xf24c('0x6'));var utils=require(_0xf24c('0x7'));var client=jayson[_0xf24c('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4983e2,_0x5104bd,_0x272d25,_0x596e81){var _0x3b7cf1,_0x13163e;return db[_0xf24c('0x9')][_0xf24c('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x260dfd){_0x3b7cf1=_0x260dfd;return _0x4983e2[_0xf24c('0xa')]({'attributes':['id',_0xf24c('0xd'),_0xf24c('0xe'),'salt',_0xf24c('0xf'),_0xf24c('0x10'),_0xf24c('0x11'),'blockedAt',_0xf24c('0x12')],'where':{'name':_0x5104bd,'role':{'$or':[_0xf24c('0x13'),'user','agent']}}});})[_0xf24c('0xc')](function(_0x479b01){if(!_0x479b01||_0x479b01&&_0x479b01[_0xf24c('0xd')]!==_0x5104bd){throw new Error(_0xf24c('0x14'));}else{_0x13163e=_0x479b01;return _0x13163e;}})['then'](function(){_0x13163e[_0xf24c('0x15')](_0x272d25,function(_0x302daf,_0x1efef1){var _0x263c49=_0x13163e[_0xf24c('0x12')]+0x1;if(_0x302daf){return _0x596e81(_0x302daf);}else if(!_0x1efef1){if(_0x13163e['disabled']){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b7cf1[_0xf24c('0x16')]>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1[_0xf24c('0xb')],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':_0xf24c('0x14')});});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x263c49>=_0x3b7cf1[_0xf24c('0x16')]){return utils[_0xf24c('0x1a')](_0x13163e,0x0,!![],moment())[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf24c('0x1a')](_0x13163e,_0x263c49,![],null)[_0xf24c('0xc')](function(){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{if(_0x13163e[_0xf24c('0x10')]){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else if(_0x3b7cf1['allowedLoginAttempts']>0x0){if(_0x13163e[_0xf24c('0x11')]){if(_0x3b7cf1['blockDuration']>0x0){if(moment(_0x13163e[_0xf24c('0x17')])[_0xf24c('0x18')](_0x3b7cf1['blockDuration'],_0xf24c('0x19'))>moment()){return _0x596e81(null,![],{'message':_0xf24c('0x14')});}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}else{return _0x596e81(null,![],{'message':_0xf24c('0x14')});}}else{return utils[_0xf24c('0x1a')](_0x13163e,0x0,![],null)[_0xf24c('0xc')](function(){return utils[_0xf24c('0x1b')](_0x13163e);})[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);})['catch'](function(_0x4b21f5){return _0x596e81(null,![],_0x4b21f5);});}}else{if(_0x13163e[_0xf24c('0x11')]){return _0x596e81(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x13163e)[_0xf24c('0xc')](function(){return _0x596e81(null,_0x13163e);});}}}});})['catch'](function(_0x191c46){return _0x596e81(null,![],_0x191c46);});}function sendServiceMail(_0x379f9a){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0xf24c('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0xf24c('0x1d')}]})[_0xf24c('0xc')](function(_0x2ee712){if(!_0x2ee712){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2033a8={'tls':{'rejectUnauthorized':![]}};if(_0x2ee712['Smtp']['service']){_0x2033a8[_0xf24c('0x1e')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x1e')];}else{_0x2033a8[_0xf24c('0x1f')]=_0x2ee712['Smtp'][_0xf24c('0x1f')];_0x2033a8[_0xf24c('0x20')]=_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x20')];_0x2033a8[_0xf24c('0x21')]=_0x2ee712[_0xf24c('0x1d')]['secure'];}if(_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x22')]){_0x2033a8[_0xf24c('0x23')]={'user':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x24')],'pass':_0x2ee712[_0xf24c('0x1d')][_0xf24c('0x25')]};}var _0x5c8f4a={'account':_0x2033a8,'message':_[_0xf24c('0x26')]({'from':util['format'](_0xf24c('0x27'),_0x2ee712[_0xf24c('0xd')],_0x2ee712['email']||_0x2ee712[_0xf24c('0x1d')]['user'])},_0x379f9a)};return client[_0xf24c('0x28')](_0xf24c('0x29'),_0x5c8f4a);})[_0xf24c('0xc')](function(_0x47f733){if(_0x47f733[_0xf24c('0x2a')]){throw new Error(util['format'](_0xf24c('0x2b'),_0x47f733['error']['message']||JSON['stringify'](_0x47f733[_0xf24c('0x2a')])));}return!![];});}function handleError(_0x2bd44c,_0x447761,_0x3334b3){return _0x2bd44c[_0xf24c('0x2c')](_0x447761||0x1f4)[_0xf24c('0x2d')]({'message':_0x3334b3?_0x3334b3[_0xf24c('0x2e')]||_0x3334b3:''});}exports['login']=function(_0x19b372,_0x39b928,_0x2332e6){passport[_0xf24c('0x15')](_0xf24c('0x2f'),function(_0x484b7f,_0x177c02,_0x571075){var _0x3e027f=_0x484b7f||_0x571075;if(_0x3e027f){return handleError(_0x39b928,0x191,_0x3e027f);}if(!_0x177c02){return handleError(_0x39b928,0x194,{'message':_0xf24c('0x30')});}else{var _0x303ad4={'payload':{'id':_0x177c02['id'],'role':_0x177c02[_0xf24c('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf24c('0x31')](_0x303ad4)[_0xf24c('0xc')](function(_0x3e5d78){_0x39b928[_0xf24c('0x32')]({'id':_0x177c02['id'],'token':_0x3e5d78,'statusCall':'','isAlreadyLogged':_0x177c02[_0xf24c('0x33')]});});}})(_0x19b372,_0x39b928,_0x2332e6);};exports[_0xf24c('0x34')]=function(_0x232688,_0x5d5ac1,_0x5d55f0){if(!_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]){return handleError(_0x5d5ac1,0x1f4,{'message':_0xf24c('0x36')});}var _0x11a9ca=rs[_0xf24c('0x37')]();_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]=_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')][_0xf24c('0x38')]()[_0xf24c('0x39')]();var _0x5002a1;return db[_0xf24c('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xf24c('0x16'),_0xf24c('0xb')],'raw':!![]})[_0xf24c('0xc')](function(_0x2bd052){_0x5002a1=_0x2bd052;return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'email':_0x232688[_0xf24c('0x35')][_0xf24c('0x1c')]}});})[_0xf24c('0xc')](function(_0x2638f6){if(!_0x2638f6){throw new Error(_0xf24c('0x3c'));}if(_0x2638f6[_0xf24c('0x10')]){throw new Error(_0xf24c('0x3d'));}if(_0x2638f6[_0xf24c('0x11')]){if(moment(_0x2638f6[_0xf24c('0x17')])['add'](_0x5002a1['blockDuration'],_0xf24c('0x19'))>moment()){throw new Error(_0xf24c('0x3e'));}else{_0x2638f6[_0xf24c('0x11')]=![];_0x2638f6[_0xf24c('0x17')]=null;}}_0x2638f6[_0xf24c('0x3f')]=_0x11a9ca;_0x2638f6['resetPasswordExpires']=Date[_0xf24c('0x40')]()+0x36ee80;return _0x2638f6[_0xf24c('0x41')]();})[_0xf24c('0xc')](function(){return sendServiceMail({'to':_0x232688[_0xf24c('0x35')]['email'],'subject':_0xf24c('0x42'),'text':_0xf24c('0x43')+_0xf24c('0x44')+_0xf24c('0x45')+_0x232688[_0xf24c('0x46')][_0xf24c('0x1f')]+_0xf24c('0x47')+_0x11a9ca+'\x0a\x0a'+_0xf24c('0x48')});})[_0xf24c('0xc')](function(){_0x5d5ac1[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x49')});})[_0xf24c('0x4a')](function(_0x2b99f1){return handleError(_0x5d5ac1,0x1f4,_0x2b99f1);});};exports[_0xf24c('0x4b')]=function(_0x340552,_0x296252,_0x4ab953){return db[_0xf24c('0x3a')][_0xf24c('0x3b')]({'where':{'resetPasswordToken':_0x340552[_0xf24c('0x4c')][_0xf24c('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xf24c('0x40')]()}}})[_0xf24c('0xc')](function(_0x86dc69){if(!_0x86dc69){throw new Error(_0xf24c('0x4e'));}return db[_0xf24c('0x9')][_0xf24c('0xa')]({'attributes':['id','securePassword',_0xf24c('0x4f'),_0xf24c('0x50')]})['then'](function(_0x517dbf){if(_0x517dbf[_0xf24c('0x51')])authService[_0xf24c('0x52')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')]);if(!_0x517dbf[_0xf24c('0x4f')]||!_0x86dc69[_0xf24c('0x53')])return _0x86dc69;authService[_0xf24c('0x54')](_0x340552[_0xf24c('0x35')][_0xf24c('0xe')],_0x86dc69['previousPasswords'],_0x517dbf[_0xf24c('0x50')]);return _0x86dc69;})['then'](function(){_0x86dc69['password']=_0x340552[_0xf24c('0x35')][_0xf24c('0xe')];_0x86dc69[_0xf24c('0x3f')]=null;_0x86dc69[_0xf24c('0x55')]=null;return _0x86dc69[_0xf24c('0x41')]();});})[_0xf24c('0xc')](function(){_0x296252[_0xf24c('0x2c')](0xc8)[_0xf24c('0x2d')]({'message':_0xf24c('0x56')});})[_0xf24c('0x4a')](function(_0x5793f2){return handleError(_0x296252,0x1f4,_0x5793f2);});};passport['use'](new LocalStrategy({'usernameField':_0xf24c('0xd'),'passwordField':'password'},function(_0x2b9b2d,_0x35a63a,_0x18012b){return localAuthenticate(db[_0xf24c('0x3a')],_0x2b9b2d,_0x35a63a,_0x18012b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index ac8a327..e7bcaba 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 _0x8bfb=['login','forgot','exports','express','Router','./authLocal.controller','post'];(function(_0x20d7e8,_0x24eaf0){var _0x36c98c=function(_0x178b3b){while(--_0x178b3b){_0x20d7e8['push'](_0x20d7e8['shift']());}};_0x36c98c(++_0x24eaf0);}(_0x8bfb,0x168));var _0xb8bf=function(_0x2d5f5f,_0x5d111f){_0x2d5f5f=_0x2d5f5f-0x0;var _0x2daff6=_0x8bfb[_0x2d5f5f];return _0x2daff6;};'use strict';var express=require(_0xb8bf('0x0'));var router=express[_0xb8bf('0x1')]();var controller=require(_0xb8bf('0x2'));router[_0xb8bf('0x3')]('/',controller[_0xb8bf('0x4')]);router[_0xb8bf('0x3')]('/forgot',controller[_0xb8bf('0x5')]);router[_0xb8bf('0x3')]('/reset/:token',controller['reset']);module[_0xb8bf('0x6')]=router;
\ No newline at end of file
+var _0x00e1=['forgot','Router','./authLocal.controller','post','login','/forgot'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x00e1,0xeb));var _0x100e=function(_0x1618b8,_0x50b4c1){_0x1618b8=_0x1618b8-0x0;var _0x5b0cfc=_0x00e1[_0x1618b8];return _0x5b0cfc;};'use strict';var express=require('express');var router=express[_0x100e('0x0')]();var controller=require(_0x100e('0x1'));router[_0x100e('0x2')]('/',controller[_0x100e('0x3')]);router['post'](_0x100e('0x4'),controller[_0x100e('0x5')]);router[_0x100e('0x2')]('/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 ef59731..6194764 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 _0xd788=['STRING','BOOLEAN'];(function(_0x47dc64,_0x30683d){var _0x2875d2=function(_0x592c64){while(--_0x592c64){_0x47dc64['push'](_0x47dc64['shift']());}};_0x2875d2(++_0x30683d);}(_0xd788,0x15a));var _0x8d78=function(_0x33af27,_0x473159){_0x33af27=_0x33af27-0x0;var _0x330cf7=_0xd788[_0x33af27];return _0x330cf7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x8d78('0x0')]},'description':{'type':Sequelize[_0x8d78('0x0')]},'status':{'type':Sequelize[_0x8d78('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xcc54=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x5a418a,_0x21bb20){var _0x41a70e=function(_0x39eb2c){while(--_0x39eb2c){_0x5a418a['push'](_0x5a418a['shift']());}};_0x41a70e(++_0x21bb20);}(_0xcc54,0xe1));var _0x4cc5=function(_0x24b170,_0x35ef06){_0x24b170=_0x24b170-0x0;var _0x2bdf9f=_0xcc54[_0x24b170];return _0x2bdf9f;};'use strict';var Sequelize=require(_0x4cc5('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cc5('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4cc5('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4cc5('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4cc5('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 9c90da5..056ed16 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 _0x5c90=['save','then','destroy','stack','name','send','Automation','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','addConditions','Condition','omit','ids','getConditions','findOne','addActions','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x511331,_0x5b41c1){var _0x577cfc=function(_0x5ad5cc){while(--_0x5ad5cc){_0x511331['push'](_0x511331['shift']());}};_0x577cfc(++_0x5b41c1);}(_0x5c90,0x178));var _0x05c9=function(_0x4616cf,_0x3eacda){_0x4616cf=_0x4616cf-0x0;var _0x1d9abd=_0x5c90[_0x4616cf];return _0x1d9abd;};'use strict';var emlformat=require(_0x05c9('0x0'));var rimraf=require(_0x05c9('0x1'));var zipdir=require(_0x05c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c9('0x3'));var moment=require(_0x05c9('0x4'));var BPromise=require(_0x05c9('0x5'));var Mustache=require(_0x05c9('0x6'));var util=require(_0x05c9('0x7'));var path=require(_0x05c9('0x8'));var sox=require('sox');var csv=require(_0x05c9('0x9'));var ejs=require(_0x05c9('0xa'));var fs=require('fs');var fs_extra=require(_0x05c9('0xb'));var _=require(_0x05c9('0xc'));var squel=require('squel');var crypto=require(_0x05c9('0xd'));var jsforce=require(_0x05c9('0xe'));var deskjs=require(_0x05c9('0xf'));var toCsv=require(_0x05c9('0x9'));var querystring=require(_0x05c9('0x10'));var Papa=require(_0x05c9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x05c9('0x12'));var as=require(_0x05c9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05c9('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x05c9('0x15'));var licenseUtil=require(_0x05c9('0x16'));var db=require(_0x05c9('0x17'))['db'];function respondWithStatusCode(_0xd429b5,_0x21a720){_0x21a720=_0x21a720||0xcc;return function(_0x4ff0c9){if(_0x4ff0c9){return _0xd429b5[_0x05c9('0x18')](_0x21a720);}return _0xd429b5[_0x05c9('0x19')](_0x21a720)[_0x05c9('0x1a')]();};}function respondWithResult(_0x44f5b6,_0x1612a9){_0x1612a9=_0x1612a9||0xc8;return function(_0x58ef0f){if(_0x58ef0f){return _0x44f5b6[_0x05c9('0x19')](_0x1612a9)['json'](_0x58ef0f);}};}function respondWithFilteredResult(_0x21ac5e,_0x3051cf){return function(_0x9233ea){if(_0x9233ea){var _0x597ded=typeof _0x3051cf[_0x05c9('0x1b')]===_0x05c9('0x1c')&&typeof _0x3051cf['limit']==='undefined';var _0x1cac00=_0x9233ea[_0x05c9('0x1d')];var _0x94c0c9=_0x597ded?0x0:_0x3051cf[_0x05c9('0x1b')];var _0x1e71b6=_0x597ded?_0x9233ea['count']:_0x3051cf[_0x05c9('0x1b')]+_0x3051cf['limit'];var _0x13f6aa;if(_0x1e71b6>=_0x1cac00){_0x1e71b6=_0x1cac00;_0x13f6aa=0xc8;}else{_0x13f6aa=0xce;}_0x21ac5e[_0x05c9('0x19')](_0x13f6aa);return _0x21ac5e[_0x05c9('0x1e')](_0x05c9('0x1f'),_0x94c0c9+'-'+_0x1e71b6+'/'+_0x1cac00)['json'](_0x9233ea);}return null;};}function patchUpdates(_0x5d2f8b){return function(_0x46ea46){try{jsonpatch[_0x05c9('0x20')](_0x46ea46,_0x5d2f8b,!![]);}catch(_0x150e1a){return BPromise[_0x05c9('0x21')](_0x150e1a);}return _0x46ea46[_0x05c9('0x22')]();};}function saveUpdates(_0x18d4ae,_0x575c12){return function(_0x3ca364){if(_0x3ca364){return _0x3ca364['update'](_0x18d4ae)[_0x05c9('0x23')](function(_0xe767a5){return _0xe767a5;});}return null;};}function removeEntity(_0xd0b67f,_0x24a84a){return function(_0x28573f){if(_0x28573f){return _0x28573f[_0x05c9('0x24')]()[_0x05c9('0x23')](function(){_0xd0b67f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2716,_0x39593c){return function(_0x3cb179){if(!_0x3cb179){_0x4b2716[_0x05c9('0x18')](0x194);}return _0x3cb179;};}function handleError(_0x534718,_0x5794a7){_0x5794a7=_0x5794a7||0x1f4;return function(_0x3efc66){logger['error'](_0x3efc66[_0x05c9('0x25')]);if(_0x3efc66[_0x05c9('0x26')]){delete _0x3efc66[_0x05c9('0x26')];}_0x534718[_0x05c9('0x19')](_0x5794a7)[_0x05c9('0x27')](_0x3efc66);};}exports['index']=function(_0x265ee9,_0x330f89){var _0x3af4fa={},_0x57779e={},_0x30b7a5={'count':0x0,'rows':[]};var _0x347f77=_['map'](db[_0x05c9('0x28')][_0x05c9('0x29')],function(_0x25f683){return{'name':_0x25f683[_0x05c9('0x2a')],'type':_0x25f683[_0x05c9('0x2b')]['key']};});_0x57779e[_0x05c9('0x2c')]=_[_0x05c9('0x2d')](_0x347f77,_0x05c9('0x26'));_0x57779e[_0x05c9('0x2e')]=_[_0x05c9('0x2f')](_0x265ee9[_0x05c9('0x2e')]);_0x57779e['filters']=_[_0x05c9('0x30')](_0x57779e[_0x05c9('0x2c')],_0x57779e['query']);_0x3af4fa[_0x05c9('0x31')]=_[_0x05c9('0x30')](_0x57779e[_0x05c9('0x2c')],qs[_0x05c9('0x32')](_0x265ee9[_0x05c9('0x2e')][_0x05c9('0x32')]));_0x3af4fa['attributes']=_0x3af4fa[_0x05c9('0x31')][_0x05c9('0x33')]?_0x3af4fa[_0x05c9('0x31')]:_0x57779e[_0x05c9('0x2c')];if(!_0x265ee9[_0x05c9('0x2e')][_0x05c9('0x34')](_0x05c9('0x35'))){_0x3af4fa[_0x05c9('0x36')]=qs[_0x05c9('0x36')](_0x265ee9[_0x05c9('0x2e')]['limit']);_0x3af4fa['offset']=qs['offset'](_0x265ee9['query'][_0x05c9('0x1b')]);}_0x3af4fa[_0x05c9('0x37')]=qs[_0x05c9('0x38')](_0x265ee9[_0x05c9('0x2e')]['sort']);_0x3af4fa[_0x05c9('0x39')]=qs[_0x05c9('0x3a')](_[_0x05c9('0x3b')](_0x265ee9[_0x05c9('0x2e')],_0x57779e[_0x05c9('0x3a')]),_0x347f77);if(_0x265ee9['query']['filter']){_0x3af4fa[_0x05c9('0x39')]=_[_0x05c9('0x3c')](_0x3af4fa[_0x05c9('0x39')],{'$or':_[_0x05c9('0x2d')](_0x347f77,function(_0x42b290){if(_0x42b290[_0x05c9('0x2b')]!=='VIRTUAL'){var _0x5eb458={};_0x5eb458[_0x42b290[_0x05c9('0x26')]]={'$like':'%'+_0x265ee9[_0x05c9('0x2e')][_0x05c9('0x3d')]+'%'};return _0x5eb458;}})});}_0x3af4fa=_[_0x05c9('0x3c')]({},_0x3af4fa,_0x265ee9[_0x05c9('0x3e')]);var _0x5d1652={'where':_0x3af4fa[_0x05c9('0x39')]};return db[_0x05c9('0x28')]['count'](_0x5d1652)['then'](function(_0x2094bf){_0x30b7a5[_0x05c9('0x1d')]=_0x2094bf;if(_0x265ee9[_0x05c9('0x2e')][_0x05c9('0x3f')]){_0x3af4fa[_0x05c9('0x40')]=[{'all':!![]}];}return db[_0x05c9('0x28')][_0x05c9('0x41')](_0x3af4fa);})[_0x05c9('0x23')](function(_0x5e6cfc){_0x30b7a5['rows']=_0x5e6cfc;return _0x30b7a5;})[_0x05c9('0x23')](respondWithFilteredResult(_0x330f89,_0x3af4fa))[_0x05c9('0x42')](handleError(_0x330f89,null));};exports[_0x05c9('0x43')]=function(_0xd8d6f3,_0x5746c9){var _0x35c46a={'raw':![],'where':{'id':_0xd8d6f3[_0x05c9('0x44')]['id']}},_0x136597={};_0x136597[_0x05c9('0x2c')]=_[_0x05c9('0x2f')](db[_0x05c9('0x28')][_0x05c9('0x29')]);_0x136597['query']=_['keys'](_0xd8d6f3[_0x05c9('0x2e')]);_0x136597[_0x05c9('0x3a')]=_[_0x05c9('0x30')](_0x136597[_0x05c9('0x2c')],_0x136597['query']);_0x35c46a[_0x05c9('0x31')]=_[_0x05c9('0x30')](_0x136597[_0x05c9('0x2c')],qs[_0x05c9('0x32')](_0xd8d6f3[_0x05c9('0x2e')]['fields']));_0x35c46a['attributes']=_0x35c46a['attributes'][_0x05c9('0x33')]?_0x35c46a[_0x05c9('0x31')]:_0x136597[_0x05c9('0x2c')];if(_0xd8d6f3[_0x05c9('0x2e')][_0x05c9('0x3f')]){_0x35c46a[_0x05c9('0x40')]=[{'all':!![]}];}_0x35c46a=_[_0x05c9('0x3c')]({},_0x35c46a,_0xd8d6f3[_0x05c9('0x3e')]);return db['Automation'][_0x05c9('0x45')](_0x35c46a)['then'](handleEntityNotFound(_0x5746c9,null))['then'](respondWithResult(_0x5746c9,null))[_0x05c9('0x42')](handleError(_0x5746c9,null));};exports[_0x05c9('0x46')]=function(_0x1cb44f,_0x506281){return db['Automation']['create'](_0x1cb44f[_0x05c9('0x47')],{})['then'](respondWithResult(_0x506281,0xc9))[_0x05c9('0x42')](handleError(_0x506281,null));};exports[_0x05c9('0x48')]=function(_0x1deab7,_0x987380){if(_0x1deab7[_0x05c9('0x47')]['id']){delete _0x1deab7[_0x05c9('0x47')]['id'];}return db[_0x05c9('0x28')][_0x05c9('0x45')]({'where':{'id':_0x1deab7[_0x05c9('0x44')]['id']}})[_0x05c9('0x23')](handleEntityNotFound(_0x987380,null))[_0x05c9('0x23')](saveUpdates(_0x1deab7[_0x05c9('0x47')],null))['then'](respondWithResult(_0x987380,null))[_0x05c9('0x42')](handleError(_0x987380,null));};exports[_0x05c9('0x24')]=function(_0x92a0f9,_0x7e94dc){return db['Automation']['find']({'where':{'id':_0x92a0f9['params']['id']}})[_0x05c9('0x23')](handleEntityNotFound(_0x7e94dc,null))[_0x05c9('0x23')](removeEntity(_0x7e94dc,null))[_0x05c9('0x42')](handleError(_0x7e94dc,null));};exports[_0x05c9('0x49')]=function(_0x85853b,_0x6681f8,_0x105c7e){return db[_0x05c9('0x4a')][_0x05c9('0x45')]({'where':{'id':_0x85853b[_0x05c9('0x44')]['id']}})[_0x05c9('0x23')](handleEntityNotFound(_0x6681f8,null))[_0x05c9('0x23')](function(_0x8e9268){if(_0x8e9268){return _0x8e9268['addConditions'](_0x85853b[_0x05c9('0x47')]['ids'],_[_0x05c9('0x4b')](_0x85853b['body'],[_0x05c9('0x4c'),'id'])||{});}})[_0x05c9('0x23')](respondWithResult(_0x6681f8,null))[_0x05c9('0x42')](handleError(_0x6681f8,null));};exports[_0x05c9('0x4d')]=function(_0x14aa10,_0x4851d1,_0x23f19f){var _0x3c51c4={};var _0x48a4d1={};var _0x25547c;var _0xdd54b1;return db['Automation'][_0x05c9('0x4e')]({'where':{'id':_0x14aa10[_0x05c9('0x44')]['id']}})[_0x05c9('0x23')](handleEntityNotFound(_0x4851d1,null))[_0x05c9('0x23')](function(_0x4792a7){if(_0x4792a7){_0x25547c=_0x4792a7;_0x48a4d1[_0x05c9('0x2c')]=_[_0x05c9('0x2f')](db[_0x05c9('0x4a')]['rawAttributes']);_0x48a4d1[_0x05c9('0x2e')]=_['keys'](_0x14aa10['query']);_0x48a4d1[_0x05c9('0x3a')]=_[_0x05c9('0x30')](_0x48a4d1[_0x05c9('0x2c')],_0x48a4d1[_0x05c9('0x2e')]);_0x3c51c4[_0x05c9('0x31')]=_[_0x05c9('0x30')](_0x48a4d1['model'],qs[_0x05c9('0x32')](_0x14aa10['query'][_0x05c9('0x32')]));_0x3c51c4[_0x05c9('0x31')]=_0x3c51c4[_0x05c9('0x31')]['length']?_0x3c51c4[_0x05c9('0x31')]:_0x48a4d1[_0x05c9('0x2c')];_0x3c51c4[_0x05c9('0x37')]=qs[_0x05c9('0x38')](_0x14aa10['query'][_0x05c9('0x38')]);_0x3c51c4[_0x05c9('0x39')]=qs[_0x05c9('0x3a')](_[_0x05c9('0x3b')](_0x14aa10[_0x05c9('0x2e')],_0x48a4d1[_0x05c9('0x3a')]));if(_0x14aa10[_0x05c9('0x2e')][_0x05c9('0x3d')]){_0x3c51c4[_0x05c9('0x39')]=_[_0x05c9('0x3c')](_0x3c51c4['where'],{'$or':_[_0x05c9('0x2d')](_0x3c51c4[_0x05c9('0x31')],function(_0x1c95d3){var _0x3305e6={};_0x3305e6[_0x1c95d3]={'$like':'%'+_0x14aa10[_0x05c9('0x2e')][_0x05c9('0x3d')]+'%'};return _0x3305e6;})});}_0x3c51c4=_[_0x05c9('0x3c')]({},_0x3c51c4,_0x14aa10[_0x05c9('0x3e')]);return _0x25547c[_0x05c9('0x4d')](_0x3c51c4);}})[_0x05c9('0x23')](function(_0x10acba){if(_0x10acba){_0xdd54b1=_0x10acba[_0x05c9('0x33')];if(!_0x14aa10[_0x05c9('0x2e')][_0x05c9('0x34')]('nolimit')){_0x3c51c4[_0x05c9('0x36')]=qs['limit'](_0x14aa10[_0x05c9('0x2e')][_0x05c9('0x36')]);_0x3c51c4[_0x05c9('0x1b')]=qs['offset'](_0x14aa10[_0x05c9('0x2e')][_0x05c9('0x1b')]);}return _0x25547c[_0x05c9('0x4d')](_0x3c51c4);}})[_0x05c9('0x23')](function(_0x3f90e9){if(_0x3f90e9){return _0x3f90e9?{'count':_0xdd54b1,'rows':_0x3f90e9}:null;}})[_0x05c9('0x23')](respondWithResult(_0x4851d1,null))[_0x05c9('0x42')](handleError(_0x4851d1,null));};exports[_0x05c9('0x4f')]=function(_0x29ba78,_0x30bf7c,_0x82da55){return db['Action'][_0x05c9('0x45')]({'where':{'id':_0x29ba78['params']['id']}})['then'](handleEntityNotFound(_0x30bf7c,null))[_0x05c9('0x23')](function(_0x5b330b){if(_0x5b330b){return _0x5b330b['addActions'](_0x29ba78[_0x05c9('0x47')][_0x05c9('0x4c')],_[_0x05c9('0x4b')](_0x29ba78[_0x05c9('0x47')],['ids','id'])||{});}})[_0x05c9('0x23')](respondWithResult(_0x30bf7c,null))['catch'](handleError(_0x30bf7c,null));};exports[_0x05c9('0x50')]=function(_0x43bc54,_0x14161a,_0x40745f){var _0x360cad={};var _0x4fa426={};var _0x147a0b;var _0x2814e3;return db[_0x05c9('0x28')][_0x05c9('0x4e')]({'where':{'id':_0x43bc54[_0x05c9('0x44')]['id']}})[_0x05c9('0x23')](handleEntityNotFound(_0x14161a,null))[_0x05c9('0x23')](function(_0x5269eb){if(_0x5269eb){_0x147a0b=_0x5269eb;_0x4fa426[_0x05c9('0x2c')]=_[_0x05c9('0x2f')](db[_0x05c9('0x51')]['rawAttributes']);_0x4fa426[_0x05c9('0x2e')]=_[_0x05c9('0x2f')](_0x43bc54[_0x05c9('0x2e')]);_0x4fa426[_0x05c9('0x3a')]=_['intersection'](_0x4fa426[_0x05c9('0x2c')],_0x4fa426[_0x05c9('0x2e')]);_0x360cad[_0x05c9('0x31')]=_['intersection'](_0x4fa426[_0x05c9('0x2c')],qs[_0x05c9('0x32')](_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x32')]));_0x360cad['attributes']=_0x360cad[_0x05c9('0x31')][_0x05c9('0x33')]?_0x360cad[_0x05c9('0x31')]:_0x4fa426[_0x05c9('0x2c')];_0x360cad[_0x05c9('0x37')]=qs['sort'](_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x38')]);_0x360cad['where']=qs[_0x05c9('0x3a')](_['pick'](_0x43bc54[_0x05c9('0x2e')],_0x4fa426[_0x05c9('0x3a')]));if(_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x3d')]){_0x360cad['where']=_['merge'](_0x360cad[_0x05c9('0x39')],{'$or':_['map'](_0x360cad[_0x05c9('0x31')],function(_0x4738d3){var _0x1170ce={};_0x1170ce[_0x4738d3]={'$like':'%'+_0x43bc54['query']['filter']+'%'};return _0x1170ce;})});}_0x360cad=_[_0x05c9('0x3c')]({},_0x360cad,_0x43bc54[_0x05c9('0x3e')]);return _0x147a0b['getActions'](_0x360cad);}})['then'](function(_0x1244e0){if(_0x1244e0){_0x2814e3=_0x1244e0[_0x05c9('0x33')];if(!_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x34')](_0x05c9('0x35'))){_0x360cad['limit']=qs[_0x05c9('0x36')](_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x36')]);_0x360cad[_0x05c9('0x1b')]=qs['offset'](_0x43bc54[_0x05c9('0x2e')][_0x05c9('0x1b')]);}return _0x147a0b[_0x05c9('0x50')](_0x360cad);}})[_0x05c9('0x23')](function(_0x47f2d8){if(_0x47f2d8){return _0x47f2d8?{'count':_0x2814e3,'rows':_0x47f2d8}:null;}})[_0x05c9('0x23')](respondWithResult(_0x14161a,null))[_0x05c9('0x42')](handleError(_0x14161a,null));};
\ No newline at end of file
+var _0x9656=['name','send','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','Automation','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','addConditions','Condition','ids','getConditions','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','update','then','destroy','error'];(function(_0x3bf789,_0x52c120){var _0x880b25=function(_0x19844e){while(--_0x19844e){_0x3bf789['push'](_0x3bf789['shift']());}};_0x880b25(++_0x52c120);}(_0x9656,0x1d0));var _0x6965=function(_0xf61041,_0x40f594){_0xf61041=_0xf61041-0x0;var _0x5ece16=_0x9656[_0xf61041];return _0x5ece16;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require(_0x6965('0x1'));var zipdir=require(_0x6965('0x2'));var jsonpatch=require(_0x6965('0x3'));var rp=require(_0x6965('0x4'));var moment=require(_0x6965('0x5'));var BPromise=require(_0x6965('0x6'));var Mustache=require('mustache');var util=require(_0x6965('0x7'));var path=require('path');var sox=require(_0x6965('0x8'));var csv=require('to-csv');var ejs=require(_0x6965('0x9'));var fs=require('fs');var fs_extra=require(_0x6965('0xa'));var _=require(_0x6965('0xb'));var squel=require('squel');var crypto=require(_0x6965('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6965('0xd'));var toCsv=require(_0x6965('0xe'));var querystring=require(_0x6965('0xf'));var Papa=require(_0x6965('0x10'));var Redis=require(_0x6965('0x11'));var authService=require(_0x6965('0x12'));var qs=require(_0x6965('0x13'));var as=require(_0x6965('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6965('0x15'))(_0x6965('0x16'));var utils=require(_0x6965('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6965('0x18'));var db=require(_0x6965('0x19'))['db'];function respondWithStatusCode(_0x2e0109,_0x15169e){_0x15169e=_0x15169e||0xcc;return function(_0x4f8f48){if(_0x4f8f48){return _0x2e0109[_0x6965('0x1a')](_0x15169e);}return _0x2e0109[_0x6965('0x1b')](_0x15169e)['end']();};}function respondWithResult(_0x223318,_0x52f385){_0x52f385=_0x52f385||0xc8;return function(_0x534fee){if(_0x534fee){return _0x223318['status'](_0x52f385)[_0x6965('0x1c')](_0x534fee);}};}function respondWithFilteredResult(_0x2bfd97,_0x2ec07d){return function(_0x4b0342){if(_0x4b0342){var _0x3a14cf=typeof _0x2ec07d['offset']==='undefined'&&typeof _0x2ec07d[_0x6965('0x1d')]===_0x6965('0x1e');var _0x58aab6=_0x4b0342['count'];var _0x2c3ceb=_0x3a14cf?0x0:_0x2ec07d[_0x6965('0x1f')];var _0x2157a9=_0x3a14cf?_0x4b0342['count']:_0x2ec07d[_0x6965('0x1f')]+_0x2ec07d[_0x6965('0x1d')];var _0x1c4f77;if(_0x2157a9>=_0x58aab6){_0x2157a9=_0x58aab6;_0x1c4f77=0xc8;}else{_0x1c4f77=0xce;}_0x2bfd97[_0x6965('0x1b')](_0x1c4f77);return _0x2bfd97[_0x6965('0x20')](_0x6965('0x21'),_0x2c3ceb+'-'+_0x2157a9+'/'+_0x58aab6)[_0x6965('0x1c')](_0x4b0342);}return null;};}function patchUpdates(_0x2d9b10){return function(_0xdd7083){try{jsonpatch['apply'](_0xdd7083,_0x2d9b10,!![]);}catch(_0x10d7a1){return BPromise[_0x6965('0x22')](_0x10d7a1);}return _0xdd7083[_0x6965('0x23')]();};}function saveUpdates(_0x338c37,_0x569710){return function(_0x419c0e){if(_0x419c0e){return _0x419c0e[_0x6965('0x24')](_0x338c37)[_0x6965('0x25')](function(_0x356f1b){return _0x356f1b;});}return null;};}function removeEntity(_0x31a726,_0x3b9555){return function(_0x1d1afd){if(_0x1d1afd){return _0x1d1afd[_0x6965('0x26')]()[_0x6965('0x25')](function(){_0x31a726[_0x6965('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c253b,_0x21a8f2){return function(_0x298346){if(!_0x298346){_0x4c253b[_0x6965('0x1a')](0x194);}return _0x298346;};}function handleError(_0x1c46a4,_0x402c5e){_0x402c5e=_0x402c5e||0x1f4;return function(_0x19ea80){logger[_0x6965('0x27')](_0x19ea80['stack']);if(_0x19ea80['name']){delete _0x19ea80[_0x6965('0x28')];}_0x1c46a4[_0x6965('0x1b')](_0x402c5e)[_0x6965('0x29')](_0x19ea80);};}exports['index']=function(_0x3e4378,_0x267d60){var _0x57c4ce={},_0x4882cb={},_0x2620e1={'count':0x0,'rows':[]};var _0x2d5bcb=_[_0x6965('0x2a')](db['Automation']['rawAttributes'],function(_0x59b7f7){return{'name':_0x59b7f7[_0x6965('0x2b')],'type':_0x59b7f7[_0x6965('0x2c')][_0x6965('0x2d')]};});_0x4882cb['model']=_[_0x6965('0x2a')](_0x2d5bcb,_0x6965('0x28'));_0x4882cb[_0x6965('0x2e')]=_['keys'](_0x3e4378[_0x6965('0x2e')]);_0x4882cb[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],_0x4882cb[_0x6965('0x2e')]);_0x57c4ce[_0x6965('0x32')]=_[_0x6965('0x30')](_0x4882cb[_0x6965('0x31')],qs[_0x6965('0x33')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x33')]));_0x57c4ce['attributes']=_0x57c4ce[_0x6965('0x32')][_0x6965('0x34')]?_0x57c4ce[_0x6965('0x32')]:_0x4882cb['model'];if(!_0x3e4378['query'][_0x6965('0x35')](_0x6965('0x36'))){_0x57c4ce[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x1d')]);_0x57c4ce[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x3e4378[_0x6965('0x2e')]['offset']);}_0x57c4ce[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x3e4378[_0x6965('0x2e')][_0x6965('0x38')]);_0x57c4ce[_0x6965('0x39')]=qs['filters'](_[_0x6965('0x3a')](_0x3e4378[_0x6965('0x2e')],_0x4882cb[_0x6965('0x2f')]),_0x2d5bcb);if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]){_0x57c4ce[_0x6965('0x39')]=_['merge'](_0x57c4ce['where'],{'$or':_['map'](_0x2d5bcb,function(_0x10abbc){if(_0x10abbc[_0x6965('0x2c')]!=='VIRTUAL'){var _0x4f4bab={};_0x4f4bab[_0x10abbc['name']]={'$like':'%'+_0x3e4378[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x4f4bab;}})});}_0x57c4ce=_[_0x6965('0x3c')]({},_0x57c4ce,_0x3e4378[_0x6965('0x3d')]);var _0x235e94={'where':_0x57c4ce['where']};return db['Automation'][_0x6965('0x3e')](_0x235e94)['then'](function(_0x6ff23f){_0x2620e1[_0x6965('0x3e')]=_0x6ff23f;if(_0x3e4378[_0x6965('0x2e')][_0x6965('0x3f')]){_0x57c4ce[_0x6965('0x40')]=[{'all':!![]}];}return db[_0x6965('0x41')][_0x6965('0x42')](_0x57c4ce);})['then'](function(_0x448751){_0x2620e1[_0x6965('0x43')]=_0x448751;return _0x2620e1;})[_0x6965('0x25')](respondWithFilteredResult(_0x267d60,_0x57c4ce))[_0x6965('0x44')](handleError(_0x267d60,null));};exports[_0x6965('0x45')]=function(_0x9810f4,_0x24e8d2){var _0x279934={'raw':![],'where':{'id':_0x9810f4[_0x6965('0x46')]['id']}},_0x250353={};_0x250353['model']=_[_0x6965('0x47')](db[_0x6965('0x41')][_0x6965('0x48')]);_0x250353[_0x6965('0x2e')]=_[_0x6965('0x47')](_0x9810f4[_0x6965('0x2e')]);_0x250353[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],_0x250353[_0x6965('0x2e')]);_0x279934['attributes']=_[_0x6965('0x30')](_0x250353[_0x6965('0x31')],qs['fields'](_0x9810f4['query'][_0x6965('0x33')]));_0x279934[_0x6965('0x32')]=_0x279934[_0x6965('0x32')][_0x6965('0x34')]?_0x279934['attributes']:_0x250353[_0x6965('0x31')];if(_0x9810f4[_0x6965('0x2e')]['includeAll']){_0x279934[_0x6965('0x40')]=[{'all':!![]}];}_0x279934=_[_0x6965('0x3c')]({},_0x279934,_0x9810f4[_0x6965('0x3d')]);return db[_0x6965('0x41')][_0x6965('0x49')](_0x279934)[_0x6965('0x25')](handleEntityNotFound(_0x24e8d2,null))[_0x6965('0x25')](respondWithResult(_0x24e8d2,null))[_0x6965('0x44')](handleError(_0x24e8d2,null));};exports['create']=function(_0x26fc68,_0x3fd941){return db['Automation'][_0x6965('0x4a')](_0x26fc68[_0x6965('0x4b')],{})[_0x6965('0x25')](respondWithResult(_0x3fd941,0xc9))['catch'](handleError(_0x3fd941,null));};exports[_0x6965('0x24')]=function(_0x6935d1,_0x57b382){if(_0x6935d1[_0x6965('0x4b')]['id']){delete _0x6935d1[_0x6965('0x4b')]['id'];}return db['Automation']['find']({'where':{'id':_0x6935d1[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x57b382,null))['then'](saveUpdates(_0x6935d1[_0x6965('0x4b')],null))[_0x6965('0x25')](respondWithResult(_0x57b382,null))[_0x6965('0x44')](handleError(_0x57b382,null));};exports[_0x6965('0x26')]=function(_0x5032d7,_0x13a433){return db[_0x6965('0x41')][_0x6965('0x49')]({'where':{'id':_0x5032d7[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x13a433,null))[_0x6965('0x25')](removeEntity(_0x13a433,null))['catch'](handleError(_0x13a433,null));};exports[_0x6965('0x4c')]=function(_0x166602,_0x22fc11,_0x37a265){return db[_0x6965('0x4d')]['find']({'where':{'id':_0x166602[_0x6965('0x46')]['id']}})['then'](handleEntityNotFound(_0x22fc11,null))['then'](function(_0x419072){if(_0x419072){return _0x419072['addConditions'](_0x166602[_0x6965('0x4b')]['ids'],_['omit'](_0x166602[_0x6965('0x4b')],[_0x6965('0x4e'),'id'])||{});}})[_0x6965('0x25')](respondWithResult(_0x22fc11,null))[_0x6965('0x44')](handleError(_0x22fc11,null));};exports['getConditions']=function(_0x14e4a6,_0x99c157,_0x1bafa0){var _0x293b0b={};var _0x55d865={};var _0x472a92;var _0x905251;return db[_0x6965('0x41')]['findOne']({'where':{'id':_0x14e4a6[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x99c157,null))[_0x6965('0x25')](function(_0x19e797){if(_0x19e797){_0x472a92=_0x19e797;_0x55d865[_0x6965('0x31')]=_[_0x6965('0x47')](db[_0x6965('0x4d')][_0x6965('0x48')]);_0x55d865['query']=_['keys'](_0x14e4a6[_0x6965('0x2e')]);_0x55d865[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x55d865[_0x6965('0x31')],_0x55d865[_0x6965('0x2e')]);_0x293b0b['attributes']=_['intersection'](_0x55d865['model'],qs[_0x6965('0x33')](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x33')]));_0x293b0b[_0x6965('0x32')]=_0x293b0b['attributes']['length']?_0x293b0b[_0x6965('0x32')]:_0x55d865[_0x6965('0x31')];_0x293b0b['order']=qs[_0x6965('0x38')](_0x14e4a6['query'][_0x6965('0x38')]);_0x293b0b['where']=qs[_0x6965('0x2f')](_['pick'](_0x14e4a6[_0x6965('0x2e')],_0x55d865[_0x6965('0x2f')]));if(_0x14e4a6[_0x6965('0x2e')][_0x6965('0x3b')]){_0x293b0b['where']=_[_0x6965('0x3c')](_0x293b0b[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x293b0b[_0x6965('0x32')],function(_0x127bae){var _0x6ecab8={};_0x6ecab8[_0x127bae]={'$like':'%'+_0x14e4a6[_0x6965('0x2e')]['filter']+'%'};return _0x6ecab8;})});}_0x293b0b=_[_0x6965('0x3c')]({},_0x293b0b,_0x14e4a6['options']);return _0x472a92['getConditions'](_0x293b0b);}})[_0x6965('0x25')](function(_0xe63f63){if(_0xe63f63){_0x905251=_0xe63f63[_0x6965('0x34')];if(!_0x14e4a6[_0x6965('0x2e')]['hasOwnProperty']('nolimit')){_0x293b0b[_0x6965('0x1d')]=qs['limit'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1d')]);_0x293b0b[_0x6965('0x1f')]=qs['offset'](_0x14e4a6[_0x6965('0x2e')][_0x6965('0x1f')]);}return _0x472a92[_0x6965('0x4f')](_0x293b0b);}})[_0x6965('0x25')](function(_0x2198e2){if(_0x2198e2){return _0x2198e2?{'count':_0x905251,'rows':_0x2198e2}:null;}})['then'](respondWithResult(_0x99c157,null))[_0x6965('0x44')](handleError(_0x99c157,null));};exports['addActions']=function(_0x2ab3be,_0x28de18,_0x4f03be){return db[_0x6965('0x50')]['find']({'where':{'id':_0x2ab3be['params']['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x28de18,null))[_0x6965('0x25')](function(_0x167733){if(_0x167733){return _0x167733[_0x6965('0x51')](_0x2ab3be[_0x6965('0x4b')][_0x6965('0x4e')],_['omit'](_0x2ab3be[_0x6965('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x28de18,null))[_0x6965('0x44')](handleError(_0x28de18,null));};exports[_0x6965('0x52')]=function(_0x2100c9,_0x536fe8,_0x3dd64c){var _0x422f91={};var _0x27722c={};var _0x4f720e;var _0x10075a;return db['Automation'][_0x6965('0x53')]({'where':{'id':_0x2100c9[_0x6965('0x46')]['id']}})[_0x6965('0x25')](handleEntityNotFound(_0x536fe8,null))['then'](function(_0x5a88ff){if(_0x5a88ff){_0x4f720e=_0x5a88ff;_0x27722c[_0x6965('0x31')]=_[_0x6965('0x47')](db['Action']['rawAttributes']);_0x27722c['query']=_[_0x6965('0x47')](_0x2100c9['query']);_0x27722c[_0x6965('0x2f')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],_0x27722c['query']);_0x422f91[_0x6965('0x32')]=_[_0x6965('0x30')](_0x27722c[_0x6965('0x31')],qs[_0x6965('0x33')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x33')]));_0x422f91[_0x6965('0x32')]=_0x422f91[_0x6965('0x32')][_0x6965('0x34')]?_0x422f91[_0x6965('0x32')]:_0x27722c[_0x6965('0x31')];_0x422f91[_0x6965('0x37')]=qs[_0x6965('0x38')](_0x2100c9[_0x6965('0x2e')][_0x6965('0x38')]);_0x422f91[_0x6965('0x39')]=qs[_0x6965('0x2f')](_[_0x6965('0x3a')](_0x2100c9[_0x6965('0x2e')],_0x27722c['filters']));if(_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]){_0x422f91['where']=_[_0x6965('0x3c')](_0x422f91[_0x6965('0x39')],{'$or':_[_0x6965('0x2a')](_0x422f91[_0x6965('0x32')],function(_0x49b8db){var _0x43bd8f={};_0x43bd8f[_0x49b8db]={'$like':'%'+_0x2100c9[_0x6965('0x2e')][_0x6965('0x3b')]+'%'};return _0x43bd8f;})});}_0x422f91=_['merge']({},_0x422f91,_0x2100c9[_0x6965('0x3d')]);return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x5a2de7){if(_0x5a2de7){_0x10075a=_0x5a2de7['length'];if(!_0x2100c9[_0x6965('0x2e')][_0x6965('0x35')](_0x6965('0x36'))){_0x422f91[_0x6965('0x1d')]=qs[_0x6965('0x1d')](_0x2100c9[_0x6965('0x2e')]['limit']);_0x422f91[_0x6965('0x1f')]=qs[_0x6965('0x1f')](_0x2100c9['query'][_0x6965('0x1f')]);}return _0x4f720e[_0x6965('0x52')](_0x422f91);}})[_0x6965('0x25')](function(_0x30246f){if(_0x30246f){return _0x30246f?{'count':_0x10075a,'rows':_0x30246f}:null;}})[_0x6965('0x25')](respondWithResult(_0x536fe8,null))['catch'](handleError(_0x536fe8,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index d28b1c5..12968a7 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 _0x07a3=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x130dfb,_0x5ab467){var _0x120281=function(_0x139952){while(--_0x139952){_0x130dfb['push'](_0x130dfb['shift']());}};_0x120281(++_0x5ab467);}(_0x07a3,0x1ea));var _0x307a=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x07a3[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x307a('0x0'));var util=require('util');var logger=require(_0x307a('0x1'))(_0x307a('0x2'));var moment=require(_0x307a('0x3'));var BPromise=require(_0x307a('0x4'));var rp=require(_0x307a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x307a('0x6'));var config=require(_0x307a('0x7'));var attributes=require(_0x307a('0x8'));module[_0x307a('0x9')]=function(_0x18a12c,_0x54740e){return _0x18a12c['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2b1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb2b1,0xcf));var _0x1b2b=function(_0x24ee4d,_0x346b64){_0x24ee4d=_0x24ee4d-0x0;var _0x305b6d=_0xb2b1[_0x24ee4d];return _0x305b6d;};'use strict';var _=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var logger=require(_0x1b2b('0x2'))(_0x1b2b('0x3'));var moment=require(_0x1b2b('0x4'));var BPromise=require(_0x1b2b('0x5'));var rp=require(_0x1b2b('0x6'));var fs=require('fs');var path=require(_0x1b2b('0x7'));var rimraf=require(_0x1b2b('0x8'));var config=require(_0x1b2b('0x9'));var attributes=require(_0x1b2b('0xa'));module[_0x1b2b('0xb')]=function(_0x4d3467,_0x18e7b4){return _0x4d3467[_0x1b2b('0xc')](_0x1b2b('0xd'),attributes,{'tableName':_0x1b2b('0xe'),'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 e319ed6..92b2776 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 _0x45d8=['../../config/utils','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1fcc7d,_0x4eb620){var _0x3daa39=function(_0x2b90f9){while(--_0x2b90f9){_0x1fcc7d['push'](_0x1fcc7d['shift']());}};_0x3daa39(++_0x4eb620);}(_0x45d8,0x174));var _0x845d=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x45d8[_0x2a453b];return _0x132f79;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a59a2,_0x33c493,_0x94a7f5){return new BPromise(function(_0x34a0bf,_0xc26c7d){return client[_0x845d('0xa')](_0x4a59a2,_0x94a7f5)[_0x845d('0xb')](function(_0x5a9113){logger[_0x845d('0xc')](_0x845d('0xd'),_0x33c493,'request\x20sent');logger['debug'](_0x845d('0xe'),_0x33c493,_0x845d('0xf'),JSON[_0x845d('0x10')](_0x5a9113));if(_0x5a9113[_0x845d('0x11')]){if(_0x5a9113[_0x845d('0x11')]['code']===0x1f4){logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')][_0x845d('0x12')]);return _0xc26c7d(_0x5a9113['error']['message']);}logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')]['message']);return _0x34a0bf(_0x5a9113[_0x845d('0x11')]['message']);}else{logger[_0x845d('0xc')]('Automation,\x20%s,\x20%s',_0x33c493,_0x845d('0xf'));_0x34a0bf(_0x5a9113[_0x845d('0x13')][_0x845d('0x12')]);}})[_0x845d('0x14')](function(_0x2a592){logger['error']('Automation,\x20%s,\x20%s',_0x33c493,_0x2a592);_0xc26c7d(_0x2a592);});});}
\ No newline at end of file
+var _0x5236=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b9d76,_0x1051ec){var _0x404112=function(_0xe695cd){while(--_0xe695cd){_0x2b9d76['push'](_0x2b9d76['shift']());}};_0x404112(++_0x1051ec);}(_0x5236,0x109));var _0x6523=function(_0x2e177f,_0x277cd4){_0x2e177f=_0x2e177f-0x0;var _0x148734=_0x5236[_0x2e177f];return _0x148734;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8977b89..6711d7b 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 _0x7f42=['index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x1ca829,_0x36ee42){var _0x46b52a=function(_0x313bd4){while(--_0x313bd4){_0x1ca829['push'](_0x1ca829['shift']());}};_0x46b52a(++_0x36ee42);}(_0x7f42,0x1dd));var _0x27f4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f42[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x27f4('0x0'));var util=require('util');var path=require(_0x27f4('0x1'));var timeout=require(_0x27f4('0x2'));var express=require('express');var router=express[_0x27f4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x27f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x27f4('0x5'));var controller=require('./automation.controller');router[_0x27f4('0x6')]('/',auth['isAuthenticated'](),controller[_0x27f4('0x7')]);router[_0x27f4('0x6')](_0x27f4('0x8'),auth[_0x27f4('0x9')](),controller[_0x27f4('0xa')]);router[_0x27f4('0x6')](_0x27f4('0xb'),auth[_0x27f4('0x9')](),controller[_0x27f4('0xc')]);router[_0x27f4('0x6')](_0x27f4('0xd'),auth[_0x27f4('0x9')](),controller[_0x27f4('0xe')]);router[_0x27f4('0xf')]('/',auth[_0x27f4('0x9')](),controller[_0x27f4('0x10')]);router[_0x27f4('0xf')](_0x27f4('0xb'),auth['isAuthenticated'](),controller['addConditions']);router[_0x27f4('0xf')](_0x27f4('0xd'),auth[_0x27f4('0x9')](),controller[_0x27f4('0x11')]);router[_0x27f4('0x12')](_0x27f4('0x8'),auth[_0x27f4('0x9')](),controller[_0x27f4('0x13')]);router['delete']('/:id',auth[_0x27f4('0x9')](),controller[_0x27f4('0x14')]);module[_0x27f4('0x15')]=router;
\ No newline at end of file
+var _0x524a=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addActions','/:id','update'];(function(_0x365309,_0x31275a){var _0x197b05=function(_0x1666fc){while(--_0x1666fc){_0x365309['push'](_0x365309['shift']());}};_0x197b05(++_0x31275a);}(_0x524a,0xf5));var _0xa524=function(_0x267ea4,_0x4e191e){_0x267ea4=_0x267ea4-0x0;var _0x113e83=_0x524a[_0x267ea4];return _0x113e83;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['get'](_0xa524('0xb'),auth[_0xa524('0x9')](),controller[_0xa524('0xc')]);router[_0xa524('0x8')](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0xe')]);router[_0xa524('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa524('0xf')](_0xa524('0xb'),auth[_0xa524('0x9')](),controller['addConditions']);router['post'](_0xa524('0xd'),auth['isAuthenticated'](),controller[_0xa524('0x10')]);router['put'](_0xa524('0x11'),auth['isAuthenticated'](),controller[_0xa524('0x12')]);router[_0xa524('0x13')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x14')]);module[_0xa524('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5159d4b..a5316ea 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 _0xa292=['never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x4e4e2e,_0x383975){var _0x5eb19e=function(_0xa5839d){while(--_0xa5839d){_0x4e4e2e['push'](_0x4e4e2e['shift']());}};_0x5eb19e(++_0x383975);}(_0xa292,0x156));var _0x2a29=function(_0x5257bf,_0xf39844){_0x5257bf=_0x5257bf-0x0;var _0x30f32b=_0xa292[_0x5257bf];return _0x30f32b;};'use strict';var Sequelize=require(_0x2a29('0x0'));module[_0x2a29('0x1')]={'name':{'type':Sequelize[_0x2a29('0x2')],'unique':_0x2a29('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a29('0x4')](_0x2a29('0x5')),'allowNull':![],'defaultValue':_0x2a29('0x5')},'description':{'type':Sequelize[_0x2a29('0x2')]},'active':{'type':Sequelize[_0x2a29('0x6')],'defaultValue':0x0,'comment':_0x2a29('0x7')},'limitCalls':{'type':Sequelize[_0x2a29('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2a29('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a29('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2a29('0x8')](0x3)[_0x2a29('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a29('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2a29('0x8')](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'comment':_0x2a29('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a29('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2a29('0xf')},'dialTimezone':{'type':Sequelize[_0x2a29('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2a29('0x2')],'defaultValue':_0x2a29('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x2a29('0x11'),_0x2a29('0x12'),'onlyIfOpen'),'defaultValue':_0x2a29('0x11')},'dialAMDActive':{'type':Sequelize[_0x2a29('0x6')],'defaultValue':0x0,'comment':_0x2a29('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2a29('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a29('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a29('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a29('0x8')](0x9)[_0x2a29('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a29('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a29('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2a29('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a29('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a29('0x4')](_0x2a29('0x19'),_0x2a29('0x1a')),'defaultValue':_0x2a29('0x19')},'dialPrefix':{'type':Sequelize[_0x2a29('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x2a29('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a29('0x1b')},'dialCutDigit':{'type':Sequelize[_0x2a29('0x8')](0x3)[_0x2a29('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a29('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2a29('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a29('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2a29('0x8')](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a29('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2a29('0x8')](0x3)[_0x2a29('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a29('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2a29('0x8')](0x5)[_0x2a29('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a29('0x23')}};
\ No newline at end of file
+var _0x071f=['Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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)','STRING','ENUM','ivr','BOOLEAN'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0x071f,0xab));var _0xf071=function(_0x98432f,_0x277eee){_0x98432f=_0x98432f-0x0;var _0x2f1051=_0x071f[_0x98432f];return _0x2f1051;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf071('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf071('0x0')]},'active':{'type':Sequelize[_0xf071('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf071('0x4')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf071('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf071('0xc')},'dialTimezone':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf071('0x0')],'defaultValue':_0xf071('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xf071('0x1')](_0xf071('0xe'),_0xf071('0xf'),_0xf071('0x10')),'defaultValue':_0xf071('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf071('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf071('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf071('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf071('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf071('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf071('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf071('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf071('0x7')](0x9)[_0xf071('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf071('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf071('0x1')](_0xf071('0x18'),_0xf071('0x19')),'defaultValue':_0xf071('0x18')},'dialPrefix':{'type':Sequelize[_0xf071('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf071('0x7')](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf071('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf071('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf071('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf071('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf071('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 65df3f7..220a306 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 _0x0794=['UserProfileResource','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','Campaign','rows','params','fields','create','body','user','role','UserProfileSection','find','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','destroy','getHoppers','CmHopper','hasOwnProperty','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','include','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get'];(function(_0x2835b1,_0xfb2d8c){var _0x2bd661=function(_0x2f24f0){while(--_0x2f24f0){_0x2835b1['push'](_0x2835b1['shift']());}};_0x2bd661(++_0xfb2d8c);}(_0x0794,0x168));var _0x4079=function(_0x53bbe0,_0x3ca06d){_0x53bbe0=_0x53bbe0-0x0;var _0x4cd8bd=_0x0794[_0x53bbe0];return _0x4cd8bd;};'use strict';var emlformat=require(_0x4079('0x0'));var rimraf=require(_0x4079('0x1'));var zipdir=require(_0x4079('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4079('0x3'));var Mustache=require(_0x4079('0x4'));var util=require(_0x4079('0x5'));var path=require(_0x4079('0x6'));var sox=require(_0x4079('0x7'));var csv=require(_0x4079('0x8'));var ejs=require(_0x4079('0x9'));var fs=require('fs');var fs_extra=require(_0x4079('0xa'));var _=require(_0x4079('0xb'));var squel=require(_0x4079('0xc'));var crypto=require(_0x4079('0xd'));var jsforce=require(_0x4079('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4079('0x8'));var querystring=require(_0x4079('0xf'));var Papa=require(_0x4079('0x10'));var Redis=require('ioredis');var authService=require(_0x4079('0x11'));var qs=require(_0x4079('0x12'));var as=require(_0x4079('0x13'));var hardwareService=require(_0x4079('0x14'));var logger=require(_0x4079('0x15'))(_0x4079('0x16'));var utils=require(_0x4079('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f376b,_0x24e85d){_0x24e85d=_0x24e85d||0xcc;return function(_0x3166ad){if(_0x3166ad){return _0x1f376b[_0x4079('0x18')](_0x24e85d);}return _0x1f376b[_0x4079('0x19')](_0x24e85d)[_0x4079('0x1a')]();};}function respondWithResult(_0x5b9c91,_0x5078cb){_0x5078cb=_0x5078cb||0xc8;return function(_0xb4a1f9){if(_0xb4a1f9){return _0x5b9c91[_0x4079('0x19')](_0x5078cb)[_0x4079('0x1b')](_0xb4a1f9);}};}function respondWithFilteredResult(_0xd23c66,_0x2fdf3b){return function(_0x2c4712){if(_0x2c4712){var _0x4e025b=typeof _0x2fdf3b['offset']===_0x4079('0x1c')&&typeof _0x2fdf3b[_0x4079('0x1d')]===_0x4079('0x1c');var _0x242eee=_0x2c4712[_0x4079('0x1e')];var _0x4429a7=_0x4e025b?0x0:_0x2fdf3b[_0x4079('0x1f')];var _0x113902=_0x4e025b?_0x2c4712[_0x4079('0x1e')]:_0x2fdf3b[_0x4079('0x1f')]+_0x2fdf3b[_0x4079('0x1d')];var _0x5d333f;if(_0x113902>=_0x242eee){_0x113902=_0x242eee;_0x5d333f=0xc8;}else{_0x5d333f=0xce;}_0xd23c66[_0x4079('0x19')](_0x5d333f);return _0xd23c66[_0x4079('0x20')](_0x4079('0x21'),_0x4429a7+'-'+_0x113902+'/'+_0x242eee)[_0x4079('0x1b')](_0x2c4712);}return null;};}function patchUpdates(_0x42feb8){return function(_0x171039){try{jsonpatch['apply'](_0x171039,_0x42feb8,!![]);}catch(_0x383fcf){return BPromise[_0x4079('0x22')](_0x383fcf);}return _0x171039[_0x4079('0x23')]();};}function saveUpdates(_0x47f78d,_0x44c904){return function(_0x40e428){if(_0x40e428){return _0x40e428[_0x4079('0x24')](_0x47f78d)[_0x4079('0x25')](function(_0x1d6c19){return _0x1d6c19;});}return null;};}function removeEntity(_0x5c2f74,_0x462fbe){return function(_0x1fd362){if(_0x1fd362){return _0x1fd362['destroy']()[_0x4079('0x25')](function(){var _0x1f2d33=_0x1fd362[_0x4079('0x26')]({'plain':!![]});var _0x384584='IvrCampaigns';return db[_0x4079('0x27')]['destroy']({'where':{'type':_0x384584,'resourceId':_0x1f2d33['id']}})[_0x4079('0x25')](function(){return _0x1fd362;});})[_0x4079('0x25')](function(){_0x5c2f74[_0x4079('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49378d,_0x7c1029){return function(_0x5d9a7c){if(!_0x5d9a7c){_0x49378d[_0x4079('0x18')](0x194);}return _0x5d9a7c;};}function handleError(_0x3d80f5,_0x297eae){_0x297eae=_0x297eae||0x1f4;return function(_0x2774a5){logger['error'](_0x2774a5[_0x4079('0x28')]);if(_0x2774a5[_0x4079('0x29')]){delete _0x2774a5[_0x4079('0x29')];}_0x3d80f5[_0x4079('0x19')](_0x297eae)['send'](_0x2774a5);};}exports['index']=function(_0x500b1a,_0x36921a){var _0x22588d={},_0x54a8f2={},_0x3a06b={'count':0x0,'rows':[]};var _0x1e4bd7=_[_0x4079('0x2a')](db['Campaign'][_0x4079('0x2b')],function(_0x1280a4){return{'name':_0x1280a4[_0x4079('0x2c')],'type':_0x1280a4[_0x4079('0x2d')]['key']};});_0x54a8f2[_0x4079('0x2e')]=_[_0x4079('0x2a')](_0x1e4bd7,_0x4079('0x29'));_0x54a8f2[_0x4079('0x2f')]=_[_0x4079('0x30')](_0x500b1a['query']);_0x54a8f2[_0x4079('0x31')]=_[_0x4079('0x32')](_0x54a8f2[_0x4079('0x2e')],_0x54a8f2[_0x4079('0x2f')]);_0x22588d[_0x4079('0x33')]=_[_0x4079('0x32')](_0x54a8f2[_0x4079('0x2e')],qs['fields'](_0x500b1a[_0x4079('0x2f')]['fields']));_0x22588d[_0x4079('0x33')]=_0x22588d['attributes'][_0x4079('0x34')]?_0x22588d[_0x4079('0x33')]:_0x54a8f2['model'];if(!_0x500b1a[_0x4079('0x2f')]['hasOwnProperty'](_0x4079('0x35'))){_0x22588d['limit']=qs['limit'](_0x500b1a[_0x4079('0x2f')][_0x4079('0x1d')]);_0x22588d[_0x4079('0x1f')]=qs[_0x4079('0x1f')](_0x500b1a[_0x4079('0x2f')][_0x4079('0x1f')]);}_0x22588d[_0x4079('0x36')]=qs[_0x4079('0x37')](_0x500b1a['query'][_0x4079('0x37')]);_0x22588d[_0x4079('0x38')]=qs[_0x4079('0x31')](_[_0x4079('0x39')](_0x500b1a['query'],_0x54a8f2['filters']),_0x1e4bd7);if(_0x500b1a[_0x4079('0x2f')]['filter']){_0x22588d[_0x4079('0x38')]=_[_0x4079('0x3a')](_0x22588d[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0x1e4bd7,function(_0x56cc60){if(_0x56cc60[_0x4079('0x2d')]!==_0x4079('0x3b')){var _0x5b29a3={};_0x5b29a3[_0x56cc60[_0x4079('0x29')]]={'$like':'%'+_0x500b1a[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x5b29a3;}})});}_0x22588d=_['merge']({},_0x22588d,_0x500b1a[_0x4079('0x3d')]);var _0x2c694d={'where':_0x22588d[_0x4079('0x38')]};return db['Campaign'][_0x4079('0x1e')](_0x2c694d)[_0x4079('0x25')](function(_0x1d2a95){_0x3a06b['count']=_0x1d2a95;if(_0x500b1a[_0x4079('0x2f')][_0x4079('0x3e')]){_0x22588d['include']=[{'all':!![]}];}return db[_0x4079('0x3f')]['findAll'](_0x22588d);})['then'](function(_0x487f9e){_0x3a06b[_0x4079('0x40')]=_0x487f9e;return _0x3a06b;})['then'](respondWithFilteredResult(_0x36921a,_0x22588d))['catch'](handleError(_0x36921a,null));};exports['show']=function(_0x3a8cc2,_0x5b23af){var _0x36dfa2={'raw':![],'where':{'id':_0x3a8cc2[_0x4079('0x41')]['id']}},_0x52683d={};_0x52683d[_0x4079('0x2e')]=_[_0x4079('0x30')](db[_0x4079('0x3f')][_0x4079('0x2b')]);_0x52683d[_0x4079('0x2f')]=_[_0x4079('0x30')](_0x3a8cc2[_0x4079('0x2f')]);_0x52683d[_0x4079('0x31')]=_['intersection'](_0x52683d['model'],_0x52683d[_0x4079('0x2f')]);_0x36dfa2['attributes']=_['intersection'](_0x52683d[_0x4079('0x2e')],qs[_0x4079('0x42')](_0x3a8cc2['query'][_0x4079('0x42')]));_0x36dfa2['attributes']=_0x36dfa2[_0x4079('0x33')][_0x4079('0x34')]?_0x36dfa2[_0x4079('0x33')]:_0x52683d['model'];if(_0x3a8cc2[_0x4079('0x2f')][_0x4079('0x3e')]){_0x36dfa2['include']=[{'all':!![]}];}_0x36dfa2=_[_0x4079('0x3a')]({},_0x36dfa2,_0x3a8cc2[_0x4079('0x3d')]);return db[_0x4079('0x3f')]['find'](_0x36dfa2)[_0x4079('0x25')](handleEntityNotFound(_0x5b23af,null))['then'](respondWithResult(_0x5b23af,null))['catch'](handleError(_0x5b23af,null));};exports[_0x4079('0x43')]=function(_0x37e99b,_0x126958){return db[_0x4079('0x3f')]['create'](_0x37e99b[_0x4079('0x44')],{})['then'](function(_0x52f16e){var _0x4d2b4d=_0x37e99b[_0x4079('0x45')][_0x4079('0x26')]({'plain':!![]});if(!_0x4d2b4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d2b4d[_0x4079('0x46')]===_0x4079('0x45')){var _0x36d127=_0x52f16e[_0x4079('0x26')]({'plain':!![]});var _0x1896f6='IvrCampaigns';return db[_0x4079('0x47')][_0x4079('0x48')]({'where':{'name':_0x1896f6,'userProfileId':_0x4d2b4d['userProfileId']},'raw':!![]})[_0x4079('0x25')](function(_0x427f3b){if(_0x427f3b&&_0x427f3b[_0x4079('0x49')]===0x0){return db[_0x4079('0x27')][_0x4079('0x43')]({'name':_0x36d127['name'],'resourceId':_0x36d127['id'],'type':_0x427f3b[_0x4079('0x29')],'sectionId':_0x427f3b['id']},{})['then'](function(){return _0x52f16e;});}else{return _0x52f16e;}})[_0x4079('0x4a')](function(_0x214305){logger[_0x4079('0x4b')](_0x4079('0x4c'),_0x214305);throw _0x214305;});}return _0x52f16e;})['then'](respondWithResult(_0x126958,0xc9))['catch'](handleError(_0x126958,null));};exports['clone']=function(_0x275fb3,_0x13f68d){var _0x1bc4b5={'where':{'id':_0x275fb3[_0x4079('0x41')]['id']}},_0x53608e={};_0x53608e['model']=_[_0x4079('0x30')](db['Campaign'][_0x4079('0x2b')]);_0x1bc4b5['attributes']=_['intersection'](_0x53608e[_0x4079('0x2e')],qs[_0x4079('0x42')](_0x275fb3['query'][_0x4079('0x42')]));_0x1bc4b5[_0x4079('0x33')]=_0x1bc4b5['attributes'][_0x4079('0x34')]?_0x1bc4b5[_0x4079('0x33')]:_0x53608e[_0x4079('0x2e')];if(_0x275fb3[_0x4079('0x2f')][_0x4079('0x3e')]){_0x1bc4b5['include']=[{'all':!![]}];}_0x1bc4b5=_[_0x4079('0x3a')]({},_0x1bc4b5,_0x275fb3[_0x4079('0x3d')]);return db['Campaign'][_0x4079('0x48')](_0x1bc4b5)[_0x4079('0x25')](handleEntityNotFound(_0x13f68d,null))['then'](function(_0x15a850){if(_0x15a850){var _0x59fbce=_0x15a850[_0x4079('0x26')]({'plain':!![]});_0x59fbce=qs[_0x4079('0x4d')](_0x59fbce,['id',_0x4079('0x4e'),_0x4079('0x4f')]);_0x275fb3[_0x4079('0x44')]=_['omit'](_0x275fb3[_0x4079('0x44')],['id',_0x4079('0x4e'),'updatedAt']);return db[_0x4079('0x3f')][_0x4079('0x43')](_[_0x4079('0x3a')](_0x59fbce,_0x275fb3[_0x4079('0x44')]),{'include':_0x275fb3[_0x4079('0x2f')][_0x4079('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x30e137){var _0x1b785c=_0x275fb3[_0x4079('0x45')]['get']({'plain':!![]});if(!_0x1b785c)throw new Error(_0x4079('0x50'));if(_0x1b785c[_0x4079('0x46')]===_0x4079('0x45')){var _0x389d5d=_0x30e137['get']({'plain':!![]});var _0x15b78e='IvrCampaigns';return db[_0x4079('0x47')][_0x4079('0x48')]({'where':{'name':_0x15b78e,'userProfileId':_0x1b785c[_0x4079('0x51')]},'raw':!![]})[_0x4079('0x25')](function(_0x1f9108){if(_0x1f9108&&_0x1f9108['autoAssociation']===0x0){return db[_0x4079('0x27')][_0x4079('0x43')]({'name':_0x389d5d['name'],'resourceId':_0x389d5d['id'],'type':_0x1f9108[_0x4079('0x29')],'sectionId':_0x1f9108['id']},{})[_0x4079('0x25')](function(){return _0x30e137;});}else{return _0x30e137;}})[_0x4079('0x4a')](function(_0x40a52d){logger[_0x4079('0x4b')](_0x4079('0x4c'),_0x40a52d);throw _0x40a52d;});}return _0x30e137;});}})[_0x4079('0x25')](respondWithResult(_0x13f68d,0xc9))[_0x4079('0x4a')](handleError(_0x13f68d,null));};exports[_0x4079('0x24')]=function(_0x375aef,_0x2d95ad){if(_0x375aef['body']['id']){delete _0x375aef[_0x4079('0x44')]['id'];}return db[_0x4079('0x3f')][_0x4079('0x48')]({'where':{'id':_0x375aef[_0x4079('0x41')]['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x2d95ad,null))[_0x4079('0x25')](saveUpdates(_0x375aef[_0x4079('0x44')],null))[_0x4079('0x25')](respondWithResult(_0x2d95ad,null))[_0x4079('0x4a')](handleError(_0x2d95ad,null));};exports[_0x4079('0x52')]=function(_0x57d518,_0x44767a){return db[_0x4079('0x3f')][_0x4079('0x48')]({'where':{'id':_0x57d518[_0x4079('0x41')]['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x44767a,null))[_0x4079('0x25')](removeEntity(_0x44767a,null))['catch'](handleError(_0x44767a,null));};exports[_0x4079('0x53')]=function(_0x394a5d,_0x4573a0,_0x1d888e){var _0xb6057b={'raw':!![],'where':{}};var _0x5c113e={};var _0x455a4a={'count':0x0,'rows':[]};return db[_0x4079('0x3f')]['findOne']({'where':{'id':_0x394a5d[_0x4079('0x41')]['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x4573a0,null))[_0x4079('0x25')](function(_0x59236e){if(_0x59236e){_0x5c113e[_0x4079('0x2e')]=_[_0x4079('0x30')](db[_0x4079('0x54')]['rawAttributes']);_0x5c113e[_0x4079('0x2f')]=_[_0x4079('0x30')](_0x394a5d[_0x4079('0x2f')]);_0x5c113e[_0x4079('0x31')]=_['intersection'](_0x5c113e[_0x4079('0x2e')],_0x5c113e[_0x4079('0x2f')]);_0xb6057b[_0x4079('0x33')]=_['intersection'](_0x5c113e[_0x4079('0x2e')],qs['fields'](_0x394a5d[_0x4079('0x2f')][_0x4079('0x42')]));_0xb6057b[_0x4079('0x33')]=_0xb6057b['attributes'][_0x4079('0x34')]?_0xb6057b[_0x4079('0x33')]:_0x5c113e['model'];if(!_0x394a5d['query'][_0x4079('0x55')](_0x4079('0x35'))){_0xb6057b['limit']=qs[_0x4079('0x1d')](_0x394a5d['query'][_0x4079('0x1d')]);_0xb6057b[_0x4079('0x1f')]=qs['offset'](_0x394a5d[_0x4079('0x2f')][_0x4079('0x1f')]);}_0xb6057b[_0x4079('0x36')]=qs[_0x4079('0x37')](_0x394a5d[_0x4079('0x2f')][_0x4079('0x37')]);_0xb6057b[_0x4079('0x38')]=qs[_0x4079('0x31')](_[_0x4079('0x39')](_0x394a5d['query'],_0x5c113e['filters']));_0xb6057b['where'][_0x4079('0x56')]=_0x59236e['id'];if(_0x394a5d['query'][_0x4079('0x3c')]){_0xb6057b[_0x4079('0x38')]=_[_0x4079('0x3a')](_0xb6057b[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0xb6057b[_0x4079('0x33')],function(_0x5c2675){var _0x4f988b={};_0x4f988b[_0x5c2675]={'$like':'%'+_0x394a5d[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x4f988b;})});}_0xb6057b=_['merge']({},_0xb6057b,_0x394a5d[_0x4079('0x3d')]);return db[_0x4079('0x54')][_0x4079('0x1e')]({'where':_0xb6057b[_0x4079('0x38')]})[_0x4079('0x25')](function(_0x5cd1f4){_0x455a4a['count']=_0x5cd1f4;if(_0x394a5d[_0x4079('0x2f')][_0x4079('0x3e')]){_0xb6057b['include']=[{'all':!![]}];}return db['CmHopper'][_0x4079('0x57')](_0xb6057b);})[_0x4079('0x25')](function(_0x47255c){_0x455a4a['rows']=_0x47255c;return _0x455a4a;});}})[_0x4079('0x25')](respondWithFilteredResult(_0x4573a0,_0xb6057b))['catch'](handleError(_0x4573a0,null));};exports[_0x4079('0x58')]=function(_0xe7b9c3,_0x18d2b7,_0x59b891){var _0x1332fa={'raw':!![],'where':{}};var _0x5c6aaf={};var _0x1e67a4={'count':0x0,'rows':[]};return db[_0x4079('0x3f')]['findOne']({'where':{'id':_0xe7b9c3[_0x4079('0x41')]['id']}})['then'](handleEntityNotFound(_0x18d2b7,null))[_0x4079('0x25')](function(_0x2d7b65){if(_0x2d7b65){_0x5c6aaf['model']=_[_0x4079('0x30')](db['CmHopperHistory'][_0x4079('0x2b')]);_0x5c6aaf[_0x4079('0x2f')]=_['keys'](_0xe7b9c3[_0x4079('0x2f')]);_0x5c6aaf['filters']=_[_0x4079('0x32')](_0x5c6aaf[_0x4079('0x2e')],_0x5c6aaf[_0x4079('0x2f')]);_0x1332fa[_0x4079('0x33')]=_[_0x4079('0x32')](_0x5c6aaf['model'],qs[_0x4079('0x42')](_0xe7b9c3['query'][_0x4079('0x42')]));_0x1332fa['attributes']=_0x1332fa[_0x4079('0x33')][_0x4079('0x34')]?_0x1332fa[_0x4079('0x33')]:_0x5c6aaf['model'];if(!_0xe7b9c3[_0x4079('0x2f')]['hasOwnProperty'](_0x4079('0x35'))){_0x1332fa['limit']=qs[_0x4079('0x1d')](_0xe7b9c3['query']['limit']);_0x1332fa['offset']=qs['offset'](_0xe7b9c3[_0x4079('0x2f')][_0x4079('0x1f')]);}_0x1332fa[_0x4079('0x36')]=qs[_0x4079('0x37')](_0xe7b9c3['query'][_0x4079('0x37')]);_0x1332fa[_0x4079('0x38')]=qs[_0x4079('0x31')](_['pick'](_0xe7b9c3[_0x4079('0x2f')],_0x5c6aaf['filters']));_0x1332fa[_0x4079('0x38')][_0x4079('0x56')]=_0x2d7b65['id'];if(_0xe7b9c3[_0x4079('0x2f')]['filter']){_0x1332fa['where']=_[_0x4079('0x3a')](_0x1332fa[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0x1332fa[_0x4079('0x33')],function(_0x1b644e){var _0x3be819={};_0x3be819[_0x1b644e]={'$like':'%'+_0xe7b9c3[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x3be819;})});}_0x1332fa=_['merge']({},_0x1332fa,_0xe7b9c3[_0x4079('0x3d')]);return db[_0x4079('0x59')]['count']({'where':_0x1332fa[_0x4079('0x38')]})[_0x4079('0x25')](function(_0x498a06){_0x1e67a4[_0x4079('0x1e')]=_0x498a06;if(_0xe7b9c3[_0x4079('0x2f')][_0x4079('0x3e')]){_0x1332fa['include']=[{'all':!![]}];}return db[_0x4079('0x59')]['findAll'](_0x1332fa);})['then'](function(_0x37ef69){_0x1e67a4[_0x4079('0x40')]=_0x37ef69;return _0x1e67a4;});}})[_0x4079('0x25')](respondWithFilteredResult(_0x18d2b7,_0x1332fa))[_0x4079('0x4a')](handleError(_0x18d2b7,null));};exports[_0x4079('0x5a')]=function(_0x33e9f9,_0x129142,_0x1de281){var _0x2dac6f={'raw':!![],'where':{}};var _0x1c5b5a={};var _0x55c0bc={'count':0x0,'rows':[]};return db[_0x4079('0x3f')][_0x4079('0x5b')]({'where':{'id':_0x33e9f9[_0x4079('0x41')]['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x129142,null))[_0x4079('0x25')](function(_0x3e2b82){if(_0x3e2b82){_0x1c5b5a[_0x4079('0x2e')]=_[_0x4079('0x30')](db[_0x4079('0x5c')][_0x4079('0x2b')]);_0x1c5b5a[_0x4079('0x2f')]=_['keys'](_0x33e9f9['query']);_0x1c5b5a[_0x4079('0x31')]=_[_0x4079('0x32')](_0x1c5b5a[_0x4079('0x2e')],_0x1c5b5a[_0x4079('0x2f')]);_0x2dac6f[_0x4079('0x33')]=_[_0x4079('0x32')](_0x1c5b5a['model'],qs['fields'](_0x33e9f9[_0x4079('0x2f')][_0x4079('0x42')]));_0x2dac6f[_0x4079('0x33')]=_0x2dac6f[_0x4079('0x33')][_0x4079('0x34')]?_0x2dac6f[_0x4079('0x33')]:_0x1c5b5a[_0x4079('0x2e')];if(!_0x33e9f9[_0x4079('0x2f')][_0x4079('0x55')](_0x4079('0x35'))){_0x2dac6f[_0x4079('0x1d')]=qs[_0x4079('0x1d')](_0x33e9f9[_0x4079('0x2f')][_0x4079('0x1d')]);_0x2dac6f['offset']=qs['offset'](_0x33e9f9['query']['offset']);}_0x2dac6f['order']=qs[_0x4079('0x37')](_0x33e9f9[_0x4079('0x2f')]['sort']);_0x2dac6f[_0x4079('0x38')]=qs[_0x4079('0x31')](_[_0x4079('0x39')](_0x33e9f9[_0x4079('0x2f')],_0x1c5b5a['filters']));_0x2dac6f[_0x4079('0x38')][_0x4079('0x56')]=_0x3e2b82['id'];if(_0x33e9f9[_0x4079('0x2f')][_0x4079('0x3c')]){_0x2dac6f[_0x4079('0x38')]=_[_0x4079('0x3a')](_0x2dac6f[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0x2dac6f[_0x4079('0x33')],function(_0x1f1965){var _0x4149ad={};_0x4149ad[_0x1f1965]={'$like':'%'+_0x33e9f9[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x4149ad;})});}_0x2dac6f=_[_0x4079('0x3a')]({},_0x2dac6f,_0x33e9f9[_0x4079('0x3d')]);return db[_0x4079('0x5c')]['count']({'where':_0x2dac6f[_0x4079('0x38')]})[_0x4079('0x25')](function(_0x133201){_0x55c0bc['count']=_0x133201;if(_0x33e9f9[_0x4079('0x2f')][_0x4079('0x3e')]){_0x2dac6f[_0x4079('0x5d')]=[{'all':!![]}];}return db[_0x4079('0x5c')][_0x4079('0x57')](_0x2dac6f);})['then'](function(_0x3f0bba){_0x55c0bc['rows']=_0x3f0bba;return _0x55c0bc;});}})[_0x4079('0x25')](respondWithFilteredResult(_0x129142,_0x2dac6f))[_0x4079('0x4a')](handleError(_0x129142,null));};exports[_0x4079('0x5e')]=function(_0x3590f4,_0x51cc6c,_0x54fa21){var _0xe633ba={'raw':!![],'where':{}};var _0x36e901={};var _0x4e89c5={'count':0x0,'rows':[]};return db['Campaign'][_0x4079('0x5b')]({'where':{'id':_0x3590f4['params']['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x51cc6c,null))[_0x4079('0x25')](function(_0x418a21){if(_0x418a21){_0x36e901[_0x4079('0x2e')]=_[_0x4079('0x30')](db[_0x4079('0x5f')][_0x4079('0x2b')]);_0x36e901[_0x4079('0x2f')]=_[_0x4079('0x30')](_0x3590f4[_0x4079('0x2f')]);_0x36e901[_0x4079('0x31')]=_[_0x4079('0x32')](_0x36e901[_0x4079('0x2e')],_0x36e901['query']);_0xe633ba[_0x4079('0x33')]=_['intersection'](_0x36e901['model'],qs[_0x4079('0x42')](_0x3590f4[_0x4079('0x2f')]['fields']));_0xe633ba[_0x4079('0x33')]=_0xe633ba[_0x4079('0x33')]['length']?_0xe633ba[_0x4079('0x33')]:_0x36e901[_0x4079('0x2e')];if(!_0x3590f4[_0x4079('0x2f')][_0x4079('0x55')](_0x4079('0x35'))){_0xe633ba[_0x4079('0x1d')]=qs['limit'](_0x3590f4[_0x4079('0x2f')][_0x4079('0x1d')]);_0xe633ba[_0x4079('0x1f')]=qs[_0x4079('0x1f')](_0x3590f4[_0x4079('0x2f')]['offset']);}_0xe633ba[_0x4079('0x36')]=qs[_0x4079('0x37')](_0x3590f4[_0x4079('0x2f')]['sort']);_0xe633ba[_0x4079('0x38')]=qs[_0x4079('0x31')](_[_0x4079('0x39')](_0x3590f4[_0x4079('0x2f')],_0x36e901[_0x4079('0x31')]));_0xe633ba['where'][_0x4079('0x56')]=_0x418a21['id'];if(_0x3590f4['query']['filter']){_0xe633ba[_0x4079('0x38')]=_['merge'](_0xe633ba['where'],{'$or':_[_0x4079('0x2a')](_0xe633ba[_0x4079('0x33')],function(_0x3df065){var _0x4a087f={};_0x4a087f[_0x3df065]={'$like':'%'+_0x3590f4[_0x4079('0x2f')]['filter']+'%'};return _0x4a087f;})});}_0xe633ba=_[_0x4079('0x3a')]({},_0xe633ba,_0x3590f4[_0x4079('0x3d')]);return db['CmHopperBlack'][_0x4079('0x1e')]({'where':_0xe633ba[_0x4079('0x38')]})[_0x4079('0x25')](function(_0x313719){_0x4e89c5[_0x4079('0x1e')]=_0x313719;if(_0x3590f4[_0x4079('0x2f')][_0x4079('0x3e')]){_0xe633ba[_0x4079('0x5d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4079('0x57')](_0xe633ba);})['then'](function(_0x4dc020){_0x4e89c5[_0x4079('0x40')]=_0x4dc020;return _0x4e89c5;});}})[_0x4079('0x25')](respondWithFilteredResult(_0x51cc6c,_0xe633ba))[_0x4079('0x4a')](handleError(_0x51cc6c,null));};exports[_0x4079('0x60')]=function(_0x56a80e,_0x130b1d,_0x1f9486){var _0x32e6f1={};var _0x1e8981={};var _0x32dc74;var _0x13d693;return db[_0x4079('0x3f')]['findOne']({'where':{'id':_0x56a80e[_0x4079('0x41')]['id']}})['then'](handleEntityNotFound(_0x130b1d,null))[_0x4079('0x25')](function(_0x43a453){if(_0x43a453){_0x32dc74=_0x43a453;_0x1e8981[_0x4079('0x2e')]=_[_0x4079('0x30')](db['CmList'][_0x4079('0x2b')]);_0x1e8981['query']=_[_0x4079('0x30')](_0x56a80e[_0x4079('0x2f')]);_0x1e8981['filters']=_[_0x4079('0x32')](_0x1e8981[_0x4079('0x2e')],_0x1e8981[_0x4079('0x2f')]);_0x32e6f1[_0x4079('0x33')]=_['intersection'](_0x1e8981[_0x4079('0x2e')],qs[_0x4079('0x42')](_0x56a80e[_0x4079('0x2f')]['fields']));_0x32e6f1[_0x4079('0x33')]=_0x32e6f1[_0x4079('0x33')][_0x4079('0x34')]?_0x32e6f1[_0x4079('0x33')]:_0x1e8981[_0x4079('0x2e')];_0x32e6f1['order']=qs['sort'](_0x56a80e['query'][_0x4079('0x37')]);_0x32e6f1[_0x4079('0x38')]=qs[_0x4079('0x31')](_[_0x4079('0x39')](_0x56a80e['query'],_0x1e8981[_0x4079('0x31')]));if(_0x56a80e[_0x4079('0x2f')]['filter']){_0x32e6f1[_0x4079('0x38')]=_[_0x4079('0x3a')](_0x32e6f1[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0x32e6f1[_0x4079('0x33')],function(_0x4abcc4){var _0x207832={};_0x207832[_0x4abcc4]={'$like':'%'+_0x56a80e[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x207832;})});}_0x32e6f1=_['merge']({},_0x32e6f1,_0x56a80e[_0x4079('0x3d')]);return _0x32dc74[_0x4079('0x60')](_0x32e6f1);}})[_0x4079('0x25')](function(_0x4282cf){if(_0x4282cf){_0x13d693=_0x4282cf[_0x4079('0x34')];if(!_0x56a80e['query'][_0x4079('0x55')]('nolimit')){_0x32e6f1[_0x4079('0x1d')]=qs[_0x4079('0x1d')](_0x56a80e[_0x4079('0x2f')][_0x4079('0x1d')]);_0x32e6f1[_0x4079('0x1f')]=qs[_0x4079('0x1f')](_0x56a80e['query'][_0x4079('0x1f')]);}return _0x32dc74[_0x4079('0x60')](_0x32e6f1);}})[_0x4079('0x25')](function(_0x4b9e0d){if(_0x4b9e0d){return _0x4b9e0d?{'count':_0x13d693,'rows':_0x4b9e0d}:null;}})[_0x4079('0x25')](respondWithResult(_0x130b1d,null))[_0x4079('0x4a')](handleError(_0x130b1d,null));};exports['addLists']=function(_0x3c809e,_0x45fc15,_0xd2f588){var _0x2120f9,_0xf423cb;return db['Campaign']['find']({'where':{'id':_0x3c809e['params']['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x45fc15,null))[_0x4079('0x25')](function(_0x7b2c79){if(_0x7b2c79){_0xf423cb=_0x7b2c79;return _0x7b2c79[_0x4079('0x61')](_0x3c809e['body'][_0x4079('0x62')],_[_0x4079('0x4d')](_0x3c809e['body'],[_0x4079('0x62'),'id'])||{});}return null;})[_0x4079('0x63')](function(_0x2c0d22){var _0x267ccb;_0x2120f9=_0x2c0d22||[];var _0xd722fe=[];if(_0x2c0d22){for(var _0x553067=0x0;_0x553067<_0x2c0d22['length'];_0x553067+=0x1){var _0x14ac8f=_0x2c0d22[_0x553067]['get']({'plain':!![]});_0xf423cb['dialCheckDuplicateType']=_0x3c809e[_0x4079('0x44')][_0x4079('0x64')]?_0x3c809e[_0x4079('0x44')][_0x4079('0x64')]:_0xf423cb[_0x4079('0x64')];switch(_0xf423cb[_0x4079('0x64')]){case _0x4079('0x65'):_0x267ccb=squel[_0x4079('0x66')]()[_0x4079('0x67')](_0x4079('0x68'))[_0x4079('0x69')]([_0x4079('0x6a'),_0x4079('0x6b'),_0x4079('0x6c'),_0x4079('0x6d'),_0x4079('0x56'),_0x4079('0x4e'),_0x4079('0x4f')],squel[_0x4079('0x6e')]()['field'](_0x4079('0x6a'),_0x4079('0x6a'))[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x6b'))[_0x4079('0x6f')]('id','ContactId')[_0x4079('0x6f')](_0x14ac8f[_0x4079('0x71')]['toString'](),_0x4079('0x6d'))[_0x4079('0x6f')](_0x3c809e['params']['id'][_0x4079('0x72')](),_0x4079('0x56'))[_0x4079('0x6f')]('NOW()',_0x4079('0x4e'))[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x4f'))['from'](_0x4079('0x73'))[_0x4079('0x38')](_0x4079('0x74'))['where']('ListId\x20=\x20?',_0x14ac8f[_0x4079('0x71')][_0x4079('0x72')]())[_0x4079('0x38')](_0x4079('0x75'))[_0x4079('0x38')](_0x4079('0x76'),squel[_0x4079('0x6e')]()[_0x4079('0x6f')](_0x4079('0x77'))['from'](_0x4079('0x78'))['where'](_0x4079('0x79'),_0x3c809e[_0x4079('0x41')]['id']['toString']()))['where'](_0x4079('0x76'),squel['select']()[_0x4079('0x6f')](_0x4079('0x7a'))[_0x4079('0x7b')]('cm_hopper')[_0x4079('0x38')]('CampaignId\x20=\x20?',_0x3c809e['params']['id'][_0x4079('0x72')]())))[_0x4079('0x72')]();break;case'onlyIfOpen':_0x267ccb=squel['insert']()['into'](_0x4079('0x68'))[_0x4079('0x69')]([_0x4079('0x6a'),'scheduledAt',_0x4079('0x6c'),_0x4079('0x6d'),_0x4079('0x56'),_0x4079('0x4e'),'updatedAt'],squel[_0x4079('0x6e')]()[_0x4079('0x6f')](_0x4079('0x6a'),'phone')[_0x4079('0x6f')]('NOW()',_0x4079('0x6b'))[_0x4079('0x6f')]('id','ContactId')[_0x4079('0x6f')](_0x14ac8f[_0x4079('0x71')][_0x4079('0x72')](),'ListId')['field'](_0x3c809e['params']['id']['toString'](),_0x4079('0x56'))['field'](_0x4079('0x70'),_0x4079('0x4e'))['field'](_0x4079('0x70'),_0x4079('0x4f'))[_0x4079('0x7b')](_0x4079('0x73'))[_0x4079('0x38')](_0x4079('0x74'))[_0x4079('0x38')](_0x4079('0x7c'),_0x14ac8f[_0x4079('0x71')]['toString']())[_0x4079('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x4079('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4079('0x6e')]()[_0x4079('0x6f')]('COALESCE(phone,\x27\x27)')[_0x4079('0x7b')](_0x4079('0x68'))[_0x4079('0x38')](_0x4079('0x79'),_0x3c809e[_0x4079('0x41')]['id'][_0x4079('0x72')]())))[_0x4079('0x72')]();break;default:_0x267ccb=squel[_0x4079('0x66')]()[_0x4079('0x67')](_0x4079('0x68'))['fromQuery']([_0x4079('0x6a'),_0x4079('0x6b'),'ContactId',_0x4079('0x6d'),_0x4079('0x56'),_0x4079('0x4e'),_0x4079('0x4f')],squel['select']()['field'](_0x4079('0x6a'),_0x4079('0x6a'))[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x6b'))[_0x4079('0x6f')]('id',_0x4079('0x6c'))[_0x4079('0x6f')](_0x14ac8f[_0x4079('0x71')][_0x4079('0x72')](),_0x4079('0x6d'))[_0x4079('0x6f')](_0x3c809e[_0x4079('0x41')]['id'][_0x4079('0x72')](),'CampaignId')['field'](_0x4079('0x70'),_0x4079('0x4e'))[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x4f'))[_0x4079('0x7b')](_0x4079('0x73'))[_0x4079('0x38')](_0x4079('0x74'))[_0x4079('0x38')](_0x4079('0x7c'),_0x14ac8f[_0x4079('0x71')]['toString']())[_0x4079('0x38')](_0x4079('0x75')))[_0x4079('0x72')]();}_0xd722fe[_0x4079('0x7d')](db[_0x4079('0x7e')][_0x4079('0x2f')](_0x267ccb));}return BPromise[_0x4079('0x7f')](_0xd722fe);}})[_0x4079('0x25')](function(){return _0x2120f9;})['then'](respondWithResult(_0x45fc15,null))[_0x4079('0x4a')](handleError(_0x45fc15,null));};exports[_0x4079('0x80')]=function(_0x52dcd8,_0x116cc0,_0x3c0ef3){return db[_0x4079('0x3f')][_0x4079('0x48')]({'where':{'id':_0x52dcd8['params']['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x116cc0,null))[_0x4079('0x25')](function(_0x2e047c){if(_0x2e047c){return _0x2e047c[_0x4079('0x80')](_0x52dcd8[_0x4079('0x2f')][_0x4079('0x62')]);}})[_0x4079('0x25')](function(_0x9e0e82){if(_0x9e0e82){return db[_0x4079('0x54')]['destroy']({'where':{'ListId':_0x52dcd8[_0x4079('0x2f')][_0x4079('0x62')],'CampaignId':_0x52dcd8[_0x4079('0x41')]['id']}})['then'](function(){return _0x9e0e82;});}})['then'](respondWithStatusCode(_0x116cc0,null))['catch'](handleError(_0x116cc0,null));};exports[_0x4079('0x81')]=function(_0x30d49d,_0x1f3265,_0xe7fe6a){var _0x26b5eb={};var _0x1bb00a={};var _0x452807;var _0x3d97d6;return db['Campaign'][_0x4079('0x5b')]({'where':{'id':_0x30d49d['params']['id']}})[_0x4079('0x25')](handleEntityNotFound(_0x1f3265,null))[_0x4079('0x25')](function(_0x20f07f){if(_0x20f07f){_0x452807=_0x20f07f;_0x1bb00a[_0x4079('0x2e')]=_['keys'](db[_0x4079('0x82')]['rawAttributes']);_0x1bb00a['query']=_[_0x4079('0x30')](_0x30d49d[_0x4079('0x2f')]);_0x1bb00a['filters']=_['intersection'](_0x1bb00a[_0x4079('0x2e')],_0x1bb00a[_0x4079('0x2f')]);_0x26b5eb[_0x4079('0x33')]=_[_0x4079('0x32')](_0x1bb00a[_0x4079('0x2e')],qs[_0x4079('0x42')](_0x30d49d[_0x4079('0x2f')][_0x4079('0x42')]));_0x26b5eb[_0x4079('0x33')]=_0x26b5eb[_0x4079('0x33')][_0x4079('0x34')]?_0x26b5eb[_0x4079('0x33')]:_0x1bb00a[_0x4079('0x2e')];_0x26b5eb[_0x4079('0x36')]=qs[_0x4079('0x37')](_0x30d49d[_0x4079('0x2f')][_0x4079('0x37')]);_0x26b5eb[_0x4079('0x38')]=qs['filters'](_[_0x4079('0x39')](_0x30d49d[_0x4079('0x2f')],_0x1bb00a['filters']));if(_0x30d49d[_0x4079('0x2f')]['filter']){_0x26b5eb[_0x4079('0x38')]=_[_0x4079('0x3a')](_0x26b5eb[_0x4079('0x38')],{'$or':_[_0x4079('0x2a')](_0x26b5eb[_0x4079('0x33')],function(_0x17c7f7){var _0x5a99f4={};_0x5a99f4[_0x17c7f7]={'$like':'%'+_0x30d49d[_0x4079('0x2f')][_0x4079('0x3c')]+'%'};return _0x5a99f4;})});}_0x26b5eb=_['merge']({},_0x26b5eb,_0x30d49d[_0x4079('0x3d')]);return _0x452807[_0x4079('0x81')](_0x26b5eb);}})[_0x4079('0x25')](function(_0x1e9c62){if(_0x1e9c62){_0x3d97d6=_0x1e9c62[_0x4079('0x34')];if(!_0x30d49d['query'][_0x4079('0x55')](_0x4079('0x35'))){_0x26b5eb['limit']=qs['limit'](_0x30d49d[_0x4079('0x2f')][_0x4079('0x1d')]);_0x26b5eb['offset']=qs[_0x4079('0x1f')](_0x30d49d['query'][_0x4079('0x1f')]);}return _0x452807['getBlackLists'](_0x26b5eb);}})['then'](function(_0x5121f6){if(_0x5121f6){return _0x5121f6?{'count':_0x3d97d6,'rows':_0x5121f6}:null;}})[_0x4079('0x25')](respondWithResult(_0x1f3265,null))[_0x4079('0x4a')](handleError(_0x1f3265,null));};exports[_0x4079('0x83')]=function(_0xea2875,_0x457bbc,_0x3dabbc){var _0x5a9b7a,_0x43fedd;return db['Campaign'][_0x4079('0x48')]({'where':{'id':_0xea2875['params']['id']}})['then'](handleEntityNotFound(_0x457bbc,null))[_0x4079('0x25')](function(_0x361958){if(_0x361958){_0x43fedd=_0x361958;return _0x361958[_0x4079('0x83')](_0xea2875['body'][_0x4079('0x62')],_[_0x4079('0x4d')](_0xea2875[_0x4079('0x44')],[_0x4079('0x62'),'id'])||{});}return null;})[_0x4079('0x63')](function(_0x3827d2){var _0xf140e9;_0x5a9b7a=_0x3827d2||[];var _0x29acda=[];if(_0x3827d2){for(var _0x21c12e=0x0;_0x21c12e<_0x3827d2[_0x4079('0x34')];_0x21c12e+=0x1){var _0x13c1c1=_0x3827d2[_0x21c12e][_0x4079('0x26')]({'plain':!![]});_0xf140e9=squel[_0x4079('0x66')]()['into'](_0x4079('0x84'))[_0x4079('0x69')](['phone',_0x4079('0x6c'),'ListId',_0x4079('0x56'),_0x4079('0x4e'),_0x4079('0x4f')],squel[_0x4079('0x6e')]()[_0x4079('0x6f')](_0x4079('0x6a'),'phone')['field']('id',_0x4079('0x6c'))[_0x4079('0x6f')](_0x13c1c1[_0x4079('0x71')]['toString'](),_0x4079('0x6d'))[_0x4079('0x6f')](_0xea2875[_0x4079('0x41')]['id'][_0x4079('0x72')](),'CampaignId')[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x4e'))[_0x4079('0x6f')](_0x4079('0x70'),_0x4079('0x4f'))[_0x4079('0x7b')]('cm_contacts')[_0x4079('0x38')](_0x4079('0x74'))[_0x4079('0x38')](_0x4079('0x7c'),_0x13c1c1[_0x4079('0x71')][_0x4079('0x72')]())['where'](_0x4079('0x75')))[_0x4079('0x72')]();_0x29acda[_0x4079('0x7d')](db['sequelize'][_0x4079('0x2f')](_0xf140e9));}return BPromise[_0x4079('0x7f')](_0x29acda);}})['then'](function(){return _0x5a9b7a;})[_0x4079('0x25')](respondWithResult(_0x457bbc,null))[_0x4079('0x4a')](handleError(_0x457bbc,null));};exports['removeBlackLists']=function(_0x40c943,_0xcb264e,_0x12a706){return db[_0x4079('0x3f')][_0x4079('0x48')]({'where':{'id':_0x40c943[_0x4079('0x41')]['id']}})['then'](handleEntityNotFound(_0xcb264e,null))[_0x4079('0x25')](function(_0x501866){if(_0x501866){return _0x501866['removeBlackLists'](_0x40c943['query'][_0x4079('0x62')]);}})[_0x4079('0x25')](function(_0x1929d2){if(_0x1929d2){return db[_0x4079('0x5f')][_0x4079('0x52')]({'where':{'ListId':_0x40c943['query']['ids'],'CampaignId':_0x40c943[_0x4079('0x41')]['id']}})[_0x4079('0x25')](function(){return _0x1929d2;});}})['then'](respondWithStatusCode(_0xcb264e,null))[_0x4079('0x4a')](handleError(_0xcb264e,null));};
\ No newline at end of file
+var _0xe8ea=['cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','cm_hopper','onlyIfOpen','fromQuery','phone\x20NOT\x20IN\x20(?)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','findOne','pick','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','field','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)'];(function(_0x14fac6,_0x5d0726){var _0x137203=function(_0x389ccd){while(--_0x389ccd){_0x14fac6['push'](_0x14fac6['shift']());}};_0x137203(++_0x5d0726);}(_0xe8ea,0x1aa));var _0xae8e=function(_0x127b5e,_0x4ee9d2){_0x127b5e=_0x127b5e-0x0;var _0x22a0be=_0xe8ea[_0x127b5e];return _0x22a0be;};'use strict';var emlformat=require(_0xae8e('0x0'));var rimraf=require(_0xae8e('0x1'));var zipdir=require(_0xae8e('0x2'));var jsonpatch=require(_0xae8e('0x3'));var rp=require('request-promise');var moment=require(_0xae8e('0x4'));var BPromise=require(_0xae8e('0x5'));var Mustache=require(_0xae8e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xae8e('0x7'));var csv=require(_0xae8e('0x8'));var ejs=require(_0xae8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae8e('0xa'));var squel=require('squel');var crypto=require(_0xae8e('0xb'));var jsforce=require(_0xae8e('0xc'));var deskjs=require(_0xae8e('0xd'));var toCsv=require(_0xae8e('0x8'));var querystring=require(_0xae8e('0xe'));var Papa=require(_0xae8e('0xf'));var Redis=require(_0xae8e('0x10'));var authService=require(_0xae8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae8e('0x12'));var hardwareService=require(_0xae8e('0x13'));var logger=require('../../config/logger')(_0xae8e('0x14'));var utils=require('../../config/utils');var config=require(_0xae8e('0x15'));var licenseUtil=require(_0xae8e('0x16'));var db=require(_0xae8e('0x17'))['db'];function respondWithStatusCode(_0x49ed2a,_0x4796a4){_0x4796a4=_0x4796a4||0xcc;return function(_0x245e6d){if(_0x245e6d){return _0x49ed2a['sendStatus'](_0x4796a4);}return _0x49ed2a[_0xae8e('0x18')](_0x4796a4)['end']();};}function respondWithResult(_0x99047d,_0x42f058){_0x42f058=_0x42f058||0xc8;return function(_0x3c2d06){if(_0x3c2d06){return _0x99047d['status'](_0x42f058)[_0xae8e('0x19')](_0x3c2d06);}};}function respondWithFilteredResult(_0x4f813b,_0x3528a7){return function(_0x13e490){if(_0x13e490){var _0x56ef6a=typeof _0x3528a7[_0xae8e('0x1a')]===_0xae8e('0x1b')&&typeof _0x3528a7[_0xae8e('0x1c')]===_0xae8e('0x1b');var _0x3f585c=_0x13e490[_0xae8e('0x1d')];var _0x58b6d6=_0x56ef6a?0x0:_0x3528a7[_0xae8e('0x1a')];var _0xa6d414=_0x56ef6a?_0x13e490[_0xae8e('0x1d')]:_0x3528a7[_0xae8e('0x1a')]+_0x3528a7[_0xae8e('0x1c')];var _0x155758;if(_0xa6d414>=_0x3f585c){_0xa6d414=_0x3f585c;_0x155758=0xc8;}else{_0x155758=0xce;}_0x4f813b[_0xae8e('0x18')](_0x155758);return _0x4f813b[_0xae8e('0x1e')](_0xae8e('0x1f'),_0x58b6d6+'-'+_0xa6d414+'/'+_0x3f585c)[_0xae8e('0x19')](_0x13e490);}return null;};}function patchUpdates(_0x515a3b){return function(_0x30eb6e){try{jsonpatch[_0xae8e('0x20')](_0x30eb6e,_0x515a3b,!![]);}catch(_0xa3f7b0){return BPromise[_0xae8e('0x21')](_0xa3f7b0);}return _0x30eb6e[_0xae8e('0x22')]();};}function saveUpdates(_0x4e6e14,_0x385e70){return function(_0x113044){if(_0x113044){return _0x113044['update'](_0x4e6e14)[_0xae8e('0x23')](function(_0x33d8a1){return _0x33d8a1;});}return null;};}function removeEntity(_0x260942,_0x3416d8){return function(_0x540b61){if(_0x540b61){return _0x540b61[_0xae8e('0x24')]()[_0xae8e('0x23')](function(){var _0x2bacdc=_0x540b61[_0xae8e('0x25')]({'plain':!![]});var _0x55c4b0='IvrCampaigns';return db[_0xae8e('0x26')][_0xae8e('0x24')]({'where':{'type':_0x55c4b0,'resourceId':_0x2bacdc['id']}})['then'](function(){return _0x540b61;});})[_0xae8e('0x23')](function(){_0x260942[_0xae8e('0x18')](0xcc)[_0xae8e('0x27')]();});}};}function handleEntityNotFound(_0x301f78,_0x5c1204){return function(_0x4db29a){if(!_0x4db29a){_0x301f78[_0xae8e('0x28')](0x194);}return _0x4db29a;};}function handleError(_0x22e563,_0x232501){_0x232501=_0x232501||0x1f4;return function(_0x3a6568){logger[_0xae8e('0x29')](_0x3a6568[_0xae8e('0x2a')]);if(_0x3a6568[_0xae8e('0x2b')]){delete _0x3a6568[_0xae8e('0x2b')];}_0x22e563[_0xae8e('0x18')](_0x232501)[_0xae8e('0x2c')](_0x3a6568);};}exports[_0xae8e('0x2d')]=function(_0x3d0c1f,_0x2f4db7){var _0x416e76={},_0x13c140={},_0x8e5f35={'count':0x0,'rows':[]};var _0x589f8a=_[_0xae8e('0x2e')](db[_0xae8e('0x2f')][_0xae8e('0x30')],function(_0x13a592){return{'name':_0x13a592[_0xae8e('0x31')],'type':_0x13a592['type'][_0xae8e('0x32')]};});_0x13c140[_0xae8e('0x33')]=_[_0xae8e('0x2e')](_0x589f8a,_0xae8e('0x2b'));_0x13c140[_0xae8e('0x34')]=_['keys'](_0x3d0c1f[_0xae8e('0x34')]);_0x13c140['filters']=_[_0xae8e('0x35')](_0x13c140[_0xae8e('0x33')],_0x13c140[_0xae8e('0x34')]);_0x416e76[_0xae8e('0x36')]=_['intersection'](_0x13c140['model'],qs[_0xae8e('0x37')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x37')]));_0x416e76[_0xae8e('0x36')]=_0x416e76[_0xae8e('0x36')][_0xae8e('0x38')]?_0x416e76[_0xae8e('0x36')]:_0x13c140[_0xae8e('0x33')];if(!_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x416e76['limit']=qs[_0xae8e('0x1c')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x416e76[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x416e76[_0xae8e('0x3b')]=qs['sort'](_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x416e76[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x3d0c1f[_0xae8e('0x34')],_0x13c140[_0xae8e('0x3e')]),_0x589f8a);if(_0x3d0c1f[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x416e76[_0xae8e('0x3d')]=_['merge'](_0x416e76[_0xae8e('0x3d')],{'$or':_['map'](_0x589f8a,function(_0x222463){if(_0x222463[_0xae8e('0x40')]!==_0xae8e('0x41')){var _0x558075={};_0x558075[_0x222463[_0xae8e('0x2b')]]={'$like':'%'+_0x3d0c1f['query'][_0xae8e('0x3f')]+'%'};return _0x558075;}})});}_0x416e76=_[_0xae8e('0x42')]({},_0x416e76,_0x3d0c1f[_0xae8e('0x43')]);var _0x32453e={'where':_0x416e76['where']};return db['Campaign'][_0xae8e('0x1d')](_0x32453e)[_0xae8e('0x23')](function(_0x270ef4){_0x8e5f35[_0xae8e('0x1d')]=_0x270ef4;if(_0x3d0c1f[_0xae8e('0x34')]['includeAll']){_0x416e76[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x2f')][_0xae8e('0x45')](_0x416e76);})['then'](function(_0x5300d3){_0x8e5f35[_0xae8e('0x46')]=_0x5300d3;return _0x8e5f35;})[_0xae8e('0x23')](respondWithFilteredResult(_0x2f4db7,_0x416e76))[_0xae8e('0x47')](handleError(_0x2f4db7,null));};exports[_0xae8e('0x48')]=function(_0x288bdd,_0x7a5d7a){var _0x1f8aef={'raw':![],'where':{'id':_0x288bdd['params']['id']}},_0xc6759={};_0xc6759[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0xc6759[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x288bdd[_0xae8e('0x34')]);_0xc6759[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0xc6759[_0xae8e('0x33')],_0xc6759[_0xae8e('0x34')]);_0x1f8aef[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0xc6759['model'],qs[_0xae8e('0x37')](_0x288bdd[_0xae8e('0x34')]['fields']));_0x1f8aef[_0xae8e('0x36')]=_0x1f8aef[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1f8aef[_0xae8e('0x36')]:_0xc6759[_0xae8e('0x33')];if(_0x288bdd[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1f8aef[_0xae8e('0x44')]=[{'all':!![]}];}_0x1f8aef=_[_0xae8e('0x42')]({},_0x1f8aef,_0x288bdd[_0xae8e('0x43')]);return db['Campaign'][_0xae8e('0x4b')](_0x1f8aef)['then'](handleEntityNotFound(_0x7a5d7a,null))[_0xae8e('0x23')](respondWithResult(_0x7a5d7a,null))[_0xae8e('0x47')](handleError(_0x7a5d7a,null));};exports[_0xae8e('0x4c')]=function(_0x269e5b,_0x50a565){return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_0x269e5b['body'],{})[_0xae8e('0x23')](function(_0x32044d){var _0x2c067e=_0x269e5b[_0xae8e('0x4d')]['get']({'plain':!![]});if(!_0x2c067e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c067e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x1bfe59=_0x32044d[_0xae8e('0x25')]({'plain':!![]});var _0x3c4190=_0xae8e('0x4f');return db[_0xae8e('0x50')]['find']({'where':{'name':_0x3c4190,'userProfileId':_0x2c067e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x5505d5){if(_0x5505d5&&_0x5505d5[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x1bfe59[_0xae8e('0x2b')],'resourceId':_0x1bfe59['id'],'type':_0x5505d5[_0xae8e('0x2b')],'sectionId':_0x5505d5['id']},{})['then'](function(){return _0x32044d;});}else{return _0x32044d;}})[_0xae8e('0x47')](function(_0x27207a){logger[_0xae8e('0x29')](_0xae8e('0x53'),_0x27207a);throw _0x27207a;});}return _0x32044d;})[_0xae8e('0x23')](respondWithResult(_0x50a565,0xc9))[_0xae8e('0x47')](handleError(_0x50a565,null));};exports['clone']=function(_0x15c483,_0x4e0e04){var _0x1b48a4={'where':{'id':_0x15c483['params']['id']}},_0x45bdb7={};_0x45bdb7['model']=_[_0xae8e('0x49')](db[_0xae8e('0x2f')][_0xae8e('0x30')]);_0x1b48a4[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x45bdb7['model'],qs[_0xae8e('0x37')](_0x15c483[_0xae8e('0x34')][_0xae8e('0x37')]));_0x1b48a4[_0xae8e('0x36')]=_0x1b48a4[_0xae8e('0x36')][_0xae8e('0x38')]?_0x1b48a4[_0xae8e('0x36')]:_0x45bdb7[_0xae8e('0x33')];if(_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x1b48a4[_0xae8e('0x44')]=[{'all':!![]}];}_0x1b48a4=_[_0xae8e('0x42')]({},_0x1b48a4,_0x15c483['options']);return db['Campaign'][_0xae8e('0x4b')](_0x1b48a4)['then'](handleEntityNotFound(_0x4e0e04,null))['then'](function(_0x1883c0){if(_0x1883c0){var _0x30b4b0=_0x1883c0[_0xae8e('0x25')]({'plain':!![]});_0x30b4b0=qs['omit'](_0x30b4b0,['id',_0xae8e('0x54'),_0xae8e('0x55')]);_0x15c483[_0xae8e('0x56')]=_[_0xae8e('0x57')](_0x15c483[_0xae8e('0x56')],['id',_0xae8e('0x54'),_0xae8e('0x55')]);return db[_0xae8e('0x2f')][_0xae8e('0x4c')](_[_0xae8e('0x42')](_0x30b4b0,_0x15c483[_0xae8e('0x56')]),{'include':_0x15c483[_0xae8e('0x34')][_0xae8e('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b3615){var _0x54521e=_0x15c483['user'][_0xae8e('0x25')]({'plain':!![]});if(!_0x54521e)throw new Error(_0xae8e('0x58'));if(_0x54521e[_0xae8e('0x4e')]===_0xae8e('0x4d')){var _0x4857d2=_0x2b3615['get']({'plain':!![]});var _0x3ee9fb='IvrCampaigns';return db[_0xae8e('0x50')][_0xae8e('0x4b')]({'where':{'name':_0x3ee9fb,'userProfileId':_0x54521e[_0xae8e('0x51')]},'raw':!![]})[_0xae8e('0x23')](function(_0x3ffc18){if(_0x3ffc18&&_0x3ffc18[_0xae8e('0x52')]===0x0){return db[_0xae8e('0x26')][_0xae8e('0x4c')]({'name':_0x4857d2[_0xae8e('0x2b')],'resourceId':_0x4857d2['id'],'type':_0x3ffc18['name'],'sectionId':_0x3ffc18['id']},{})['then'](function(){return _0x2b3615;});}else{return _0x2b3615;}})['catch'](function(_0x2a23ae){logger['error'](_0xae8e('0x53'),_0x2a23ae);throw _0x2a23ae;});}return _0x2b3615;});}})['then'](respondWithResult(_0x4e0e04,0xc9))['catch'](handleError(_0x4e0e04,null));};exports['update']=function(_0x109e5a,_0x325af2){if(_0x109e5a['body']['id']){delete _0x109e5a['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x109e5a[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x325af2,null))[_0xae8e('0x23')](saveUpdates(_0x109e5a['body'],null))['then'](respondWithResult(_0x325af2,null))[_0xae8e('0x47')](handleError(_0x325af2,null));};exports[_0xae8e('0x24')]=function(_0x3cf5d8,_0x401da1){return db['Campaign'][_0xae8e('0x4b')]({'where':{'id':_0x3cf5d8[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x401da1,null))[_0xae8e('0x23')](removeEntity(_0x401da1,null))[_0xae8e('0x47')](handleError(_0x401da1,null));};exports['getHoppers']=function(_0x1a2067,_0x323db3,_0x1dfb5f){var _0x8de537={'raw':!![],'where':{}};var _0x1eca13={};var _0x3adbe4={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x1a2067[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x323db3,null))[_0xae8e('0x23')](function(_0x321204){if(_0x321204){_0x1eca13[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmHopper'][_0xae8e('0x30')]);_0x1eca13['query']=_[_0xae8e('0x49')](_0x1a2067[_0xae8e('0x34')]);_0x1eca13['filters']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],_0x1eca13[_0xae8e('0x34')]);_0x8de537['attributes']=_[_0xae8e('0x35')](_0x1eca13[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x37')]));_0x8de537['attributes']=_0x8de537[_0xae8e('0x36')][_0xae8e('0x38')]?_0x8de537[_0xae8e('0x36')]:_0x1eca13['model'];if(!_0x1a2067[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x8de537[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x8de537[_0xae8e('0x1a')]=qs['offset'](_0x1a2067[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x8de537[_0xae8e('0x3b')]=qs['sort'](_0x1a2067['query'][_0xae8e('0x3c')]);_0x8de537['where']=qs['filters'](_[_0xae8e('0x5b')](_0x1a2067[_0xae8e('0x34')],_0x1eca13[_0xae8e('0x3e')]));_0x8de537[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x321204['id'];if(_0x1a2067[_0xae8e('0x34')]['filter']){_0x8de537[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x8de537[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x8de537[_0xae8e('0x36')],function(_0x3176c0){var _0x31008b={};_0x31008b[_0x3176c0]={'$like':'%'+_0x1a2067['query'][_0xae8e('0x3f')]+'%'};return _0x31008b;})});}_0x8de537=_[_0xae8e('0x42')]({},_0x8de537,_0x1a2067['options']);return db[_0xae8e('0x5d')][_0xae8e('0x1d')]({'where':_0x8de537['where']})['then'](function(_0x1adf27){_0x3adbe4[_0xae8e('0x1d')]=_0x1adf27;if(_0x1a2067['query'][_0xae8e('0x4a')]){_0x8de537[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5d')][_0xae8e('0x45')](_0x8de537);})[_0xae8e('0x23')](function(_0x317cb8){_0x3adbe4[_0xae8e('0x46')]=_0x317cb8;return _0x3adbe4;});}})['then'](respondWithFilteredResult(_0x323db3,_0x8de537))['catch'](handleError(_0x323db3,null));};exports['getHopperHistories']=function(_0xa89c13,_0x40b6ce,_0x551bf9){var _0x38cae9={'raw':!![],'where':{}};var _0x51f2cc={};var _0x39a4ac={'count':0x0,'rows':[]};return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0xa89c13[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x40b6ce,null))['then'](function(_0x541786){if(_0x541786){_0x51f2cc['model']=_[_0xae8e('0x49')](db['CmHopperHistory'][_0xae8e('0x30')]);_0x51f2cc['query']=_[_0xae8e('0x49')](_0xa89c13['query']);_0x51f2cc['filters']=_[_0xae8e('0x35')](_0x51f2cc['model'],_0x51f2cc[_0xae8e('0x34')]);_0x38cae9[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x51f2cc[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x37')]));_0x38cae9[_0xae8e('0x36')]=_0x38cae9[_0xae8e('0x36')]['length']?_0x38cae9[_0xae8e('0x36')]:_0x51f2cc[_0xae8e('0x33')];if(!_0xa89c13[_0xae8e('0x34')][_0xae8e('0x39')]('nolimit')){_0x38cae9[_0xae8e('0x1c')]=qs['limit'](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x38cae9[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0xa89c13['query'][_0xae8e('0x1a')]);}_0x38cae9['order']=qs[_0xae8e('0x3c')](_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x38cae9[_0xae8e('0x3d')]=qs['filters'](_[_0xae8e('0x5b')](_0xa89c13[_0xae8e('0x34')],_0x51f2cc[_0xae8e('0x3e')]));_0x38cae9[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x541786['id'];if(_0xa89c13[_0xae8e('0x34')]['filter']){_0x38cae9[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x38cae9[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x38cae9[_0xae8e('0x36')],function(_0x33877f){var _0x598298={};_0x598298[_0x33877f]={'$like':'%'+_0xa89c13[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x598298;})});}_0x38cae9=_[_0xae8e('0x42')]({},_0x38cae9,_0xa89c13[_0xae8e('0x43')]);return db[_0xae8e('0x5e')][_0xae8e('0x1d')]({'where':_0x38cae9[_0xae8e('0x3d')]})['then'](function(_0x2131ba){_0x39a4ac[_0xae8e('0x1d')]=_0x2131ba;if(_0xa89c13[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x38cae9[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x5e')][_0xae8e('0x45')](_0x38cae9);})[_0xae8e('0x23')](function(_0x1541a5){_0x39a4ac['rows']=_0x1541a5;return _0x39a4ac;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x40b6ce,_0x38cae9))[_0xae8e('0x47')](handleError(_0x40b6ce,null));};exports[_0xae8e('0x5f')]=function(_0x42fa56,_0x46fb40,_0x225e7e){var _0x59845f={'raw':!![],'where':{}};var _0x41b4a4={};var _0x180774={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x42fa56[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x46fb40,null))['then'](function(_0x44169b){if(_0x44169b){_0x41b4a4[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x60')]['rawAttributes']);_0x41b4a4[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x42fa56[_0xae8e('0x34')]);_0x41b4a4[_0xae8e('0x3e')]=_['intersection'](_0x41b4a4[_0xae8e('0x33')],_0x41b4a4[_0xae8e('0x34')]);_0x59845f['attributes']=_[_0xae8e('0x35')](_0x41b4a4[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x37')]));_0x59845f[_0xae8e('0x36')]=_0x59845f[_0xae8e('0x36')][_0xae8e('0x38')]?_0x59845f[_0xae8e('0x36')]:_0x41b4a4[_0xae8e('0x33')];if(!_0x42fa56[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x59845f['limit']=qs[_0xae8e('0x1c')](_0x42fa56[_0xae8e('0x34')]['limit']);_0x59845f[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x1a')]);}_0x59845f['order']=qs[_0xae8e('0x3c')](_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x59845f['where']=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x42fa56[_0xae8e('0x34')],_0x41b4a4[_0xae8e('0x3e')]));_0x59845f[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x44169b['id'];if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x59845f[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x59845f[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x59845f[_0xae8e('0x36')],function(_0x495c35){var _0x367e44={};_0x367e44[_0x495c35]={'$like':'%'+_0x42fa56[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x367e44;})});}_0x59845f=_['merge']({},_0x59845f,_0x42fa56['options']);return db[_0xae8e('0x60')]['count']({'where':_0x59845f[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x542a18){_0x180774['count']=_0x542a18;if(_0x42fa56[_0xae8e('0x34')][_0xae8e('0x4a')]){_0x59845f[_0xae8e('0x44')]=[{'all':!![]}];}return db[_0xae8e('0x60')][_0xae8e('0x45')](_0x59845f);})['then'](function(_0x1b00bb){_0x180774[_0xae8e('0x46')]=_0x1b00bb;return _0x180774;});}})[_0xae8e('0x23')](respondWithFilteredResult(_0x46fb40,_0x59845f))[_0xae8e('0x47')](handleError(_0x46fb40,null));};exports[_0xae8e('0x61')]=function(_0x34090b,_0x292655,_0x256b12){var _0x5606fb={'raw':!![],'where':{}};var _0x31f01e={};var _0x52ae1a={'count':0x0,'rows':[]};return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x34090b[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x292655,null))[_0xae8e('0x23')](function(_0x5547de){if(_0x5547de){_0x31f01e['model']=_[_0xae8e('0x49')](db[_0xae8e('0x62')]['rawAttributes']);_0x31f01e[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x34090b[_0xae8e('0x34')]);_0x31f01e[_0xae8e('0x3e')]=_['intersection'](_0x31f01e[_0xae8e('0x33')],_0x31f01e['query']);_0x5606fb['attributes']=_['intersection'](_0x31f01e['model'],qs[_0xae8e('0x37')](_0x34090b[_0xae8e('0x34')]['fields']));_0x5606fb['attributes']=_0x5606fb[_0xae8e('0x36')][_0xae8e('0x38')]?_0x5606fb[_0xae8e('0x36')]:_0x31f01e[_0xae8e('0x33')];if(!_0x34090b[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x5606fb[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x34090b['query'][_0xae8e('0x1c')]);_0x5606fb['offset']=qs[_0xae8e('0x1a')](_0x34090b[_0xae8e('0x34')]['offset']);}_0x5606fb[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x34090b[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x5606fb[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_[_0xae8e('0x5b')](_0x34090b[_0xae8e('0x34')],_0x31f01e[_0xae8e('0x3e')]));_0x5606fb[_0xae8e('0x3d')][_0xae8e('0x5c')]=_0x5547de['id'];if(_0x34090b[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x5606fb[_0xae8e('0x3d')]=_[_0xae8e('0x42')](_0x5606fb[_0xae8e('0x3d')],{'$or':_['map'](_0x5606fb[_0xae8e('0x36')],function(_0x56bee8){var _0x12c9f0={};_0x12c9f0[_0x56bee8]={'$like':'%'+_0x34090b['query'][_0xae8e('0x3f')]+'%'};return _0x12c9f0;})});}_0x5606fb=_[_0xae8e('0x42')]({},_0x5606fb,_0x34090b[_0xae8e('0x43')]);return db['CmHopperBlack'][_0xae8e('0x1d')]({'where':_0x5606fb[_0xae8e('0x3d')]})[_0xae8e('0x23')](function(_0x18d824){_0x52ae1a[_0xae8e('0x1d')]=_0x18d824;if(_0x34090b['query'][_0xae8e('0x4a')]){_0x5606fb['include']=[{'all':!![]}];}return db[_0xae8e('0x62')]['findAll'](_0x5606fb);})[_0xae8e('0x23')](function(_0x2ccca1){_0x52ae1a[_0xae8e('0x46')]=_0x2ccca1;return _0x52ae1a;});}})['then'](respondWithFilteredResult(_0x292655,_0x5606fb))[_0xae8e('0x47')](handleError(_0x292655,null));};exports[_0xae8e('0x63')]=function(_0x59f20d,_0x10e255,_0x5eafed){var _0x15c92a={};var _0x300ca6={};var _0xaa399a;var _0x95cc;return db[_0xae8e('0x2f')][_0xae8e('0x5a')]({'where':{'id':_0x59f20d[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x10e255,null))[_0xae8e('0x23')](function(_0x561732){if(_0x561732){_0xaa399a=_0x561732;_0x300ca6[_0xae8e('0x33')]=_[_0xae8e('0x49')](db[_0xae8e('0x64')][_0xae8e('0x30')]);_0x300ca6[_0xae8e('0x34')]=_[_0xae8e('0x49')](_0x59f20d[_0xae8e('0x34')]);_0x300ca6[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],_0x300ca6[_0xae8e('0x34')]);_0x15c92a[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x300ca6[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x37')]));_0x15c92a[_0xae8e('0x36')]=_0x15c92a[_0xae8e('0x36')][_0xae8e('0x38')]?_0x15c92a[_0xae8e('0x36')]:_0x300ca6[_0xae8e('0x33')];_0x15c92a[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3c')]);_0x15c92a[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x59f20d[_0xae8e('0x34')],_0x300ca6[_0xae8e('0x3e')]));if(_0x59f20d['query'][_0xae8e('0x3f')]){_0x15c92a['where']=_[_0xae8e('0x42')](_0x15c92a['where'],{'$or':_['map'](_0x15c92a['attributes'],function(_0x3e96c6){var _0x45b015={};_0x45b015[_0x3e96c6]={'$like':'%'+_0x59f20d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x45b015;})});}_0x15c92a=_[_0xae8e('0x42')]({},_0x15c92a,_0x59f20d[_0xae8e('0x43')]);return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})['then'](function(_0x371b39){if(_0x371b39){_0x95cc=_0x371b39['length'];if(!_0x59f20d[_0xae8e('0x34')][_0xae8e('0x39')](_0xae8e('0x3a'))){_0x15c92a[_0xae8e('0x1c')]=qs[_0xae8e('0x1c')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x15c92a[_0xae8e('0x1a')]=qs[_0xae8e('0x1a')](_0x59f20d[_0xae8e('0x34')][_0xae8e('0x1a')]);}return _0xaa399a[_0xae8e('0x63')](_0x15c92a);}})[_0xae8e('0x23')](function(_0x5df525){if(_0x5df525){return _0x5df525?{'count':_0x95cc,'rows':_0x5df525}:null;}})['then'](respondWithResult(_0x10e255,null))['catch'](handleError(_0x10e255,null));};exports[_0xae8e('0x65')]=function(_0x358751,_0x6f7758,_0x39dd4f){var _0xef5e7c,_0x159f79;return db[_0xae8e('0x2f')]['find']({'where':{'id':_0x358751[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x6f7758,null))[_0xae8e('0x23')](function(_0x4dc241){if(_0x4dc241){_0x159f79=_0x4dc241;return _0x4dc241[_0xae8e('0x65')](_0x358751[_0xae8e('0x56')][_0xae8e('0x66')],_['omit'](_0x358751[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})[_0xae8e('0x67')](function(_0x31c7e9){var _0x1fce13;_0xef5e7c=_0x31c7e9||[];var _0x2bc120=[];if(_0x31c7e9){for(var _0x4a8a07=0x0;_0x4a8a07<_0x31c7e9[_0xae8e('0x38')];_0x4a8a07+=0x1){var _0x45b6b4=_0x31c7e9[_0x4a8a07][_0xae8e('0x25')]({'plain':!![]});_0x159f79[_0xae8e('0x68')]=_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]?_0x358751[_0xae8e('0x56')][_0xae8e('0x68')]:_0x159f79['dialCheckDuplicateType'];switch(_0x159f79[_0xae8e('0x68')]){case _0xae8e('0x69'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper')['fromQuery']([_0xae8e('0x6c'),_0xae8e('0x6d'),_0xae8e('0x6e'),_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),'updatedAt'],squel['select']()['field'](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x45b6b4['CmListId'][_0xae8e('0x71')](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),'updatedAt')['from'](_0xae8e('0x73'))[_0xae8e('0x3d')](_0xae8e('0x74'))[_0xae8e('0x3d')](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xae8e('0x78')]()['field'](_0xae8e('0x79'))['from'](_0xae8e('0x7a'))['where'](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]()))[_0xae8e('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))[_0xae8e('0x3d')](_0xae8e('0x7b'),_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;case _0xae8e('0x7f'):_0x1fce13=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')](_0xae8e('0x7e'))[_0xae8e('0x80')](['phone',_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),'scheduledAt')[_0xae8e('0x70')]('id','ContactId')[_0xae8e('0x70')](_0x45b6b4[_0xae8e('0x76')]['toString'](),'ListId')[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),'createdAt')['field'](_0xae8e('0x72'),_0xae8e('0x55'))[_0xae8e('0x7d')]('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())['where'](_0xae8e('0x77'))[_0xae8e('0x3d')](_0xae8e('0x81'),squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x7c'))[_0xae8e('0x7d')](_0xae8e('0x7e'))['where'](_0xae8e('0x7b'),_0x358751['params']['id'][_0xae8e('0x71')]())))[_0xae8e('0x71')]();break;default:_0x1fce13=squel[_0xae8e('0x6a')]()['into'](_0xae8e('0x7e'))[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6d'),'ContactId',_0xae8e('0x6f'),_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x6d'))['field']('id',_0xae8e('0x6e'))['field'](_0x45b6b4['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))[_0xae8e('0x70')](_0x358751[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),_0xae8e('0x5c'))[_0xae8e('0x70')](_0xae8e('0x72'),_0xae8e('0x54'))['field'](_0xae8e('0x72'),_0xae8e('0x55'))['from']('cm_contacts')[_0xae8e('0x3d')](_0xae8e('0x74'))['where'](_0xae8e('0x75'),_0x45b6b4[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))[_0xae8e('0x71')]();}_0x2bc120[_0xae8e('0x82')](db[_0xae8e('0x83')][_0xae8e('0x34')](_0x1fce13));}return BPromise[_0xae8e('0x84')](_0x2bc120);}})[_0xae8e('0x23')](function(){return _0xef5e7c;})[_0xae8e('0x23')](respondWithResult(_0x6f7758,null))[_0xae8e('0x47')](handleError(_0x6f7758,null));};exports[_0xae8e('0x85')]=function(_0xb15d60,_0x2c9502,_0x39fd52){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x2c9502,null))[_0xae8e('0x23')](function(_0x3a41c3){if(_0x3a41c3){return _0x3a41c3[_0xae8e('0x85')](_0xb15d60[_0xae8e('0x34')][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x35f8fa){if(_0x35f8fa){return db[_0xae8e('0x5d')][_0xae8e('0x24')]({'where':{'ListId':_0xb15d60[_0xae8e('0x34')]['ids'],'CampaignId':_0xb15d60[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](function(){return _0x35f8fa;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x2c9502,null))[_0xae8e('0x47')](handleError(_0x2c9502,null));};exports['getBlackLists']=function(_0x289a5d,_0x386aa0,_0x36ab20){var _0x4bfab6={};var _0x10c4f0={};var _0x4f32cd;var _0x2583e3;return db['Campaign'][_0xae8e('0x5a')]({'where':{'id':_0x289a5d['params']['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x386aa0,null))[_0xae8e('0x23')](function(_0x1a194e){if(_0x1a194e){_0x4f32cd=_0x1a194e;_0x10c4f0[_0xae8e('0x33')]=_[_0xae8e('0x49')](db['CmList'][_0xae8e('0x30')]);_0x10c4f0['query']=_['keys'](_0x289a5d['query']);_0x10c4f0[_0xae8e('0x3e')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],_0x10c4f0[_0xae8e('0x34')]);_0x4bfab6[_0xae8e('0x36')]=_[_0xae8e('0x35')](_0x10c4f0[_0xae8e('0x33')],qs[_0xae8e('0x37')](_0x289a5d['query'][_0xae8e('0x37')]));_0x4bfab6[_0xae8e('0x36')]=_0x4bfab6[_0xae8e('0x36')]['length']?_0x4bfab6[_0xae8e('0x36')]:_0x10c4f0[_0xae8e('0x33')];_0x4bfab6[_0xae8e('0x3b')]=qs[_0xae8e('0x3c')](_0x289a5d['query'][_0xae8e('0x3c')]);_0x4bfab6[_0xae8e('0x3d')]=qs[_0xae8e('0x3e')](_['pick'](_0x289a5d[_0xae8e('0x34')],_0x10c4f0[_0xae8e('0x3e')]));if(_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]){_0x4bfab6['where']=_[_0xae8e('0x42')](_0x4bfab6[_0xae8e('0x3d')],{'$or':_[_0xae8e('0x2e')](_0x4bfab6[_0xae8e('0x36')],function(_0x1746be){var _0x58f440={};_0x58f440[_0x1746be]={'$like':'%'+_0x289a5d[_0xae8e('0x34')][_0xae8e('0x3f')]+'%'};return _0x58f440;})});}_0x4bfab6=_[_0xae8e('0x42')]({},_0x4bfab6,_0x289a5d['options']);return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x485cc7){if(_0x485cc7){_0x2583e3=_0x485cc7[_0xae8e('0x38')];if(!_0x289a5d[_0xae8e('0x34')]['hasOwnProperty'](_0xae8e('0x3a'))){_0x4bfab6[_0xae8e('0x1c')]=qs['limit'](_0x289a5d[_0xae8e('0x34')][_0xae8e('0x1c')]);_0x4bfab6[_0xae8e('0x1a')]=qs['offset'](_0x289a5d['query'][_0xae8e('0x1a')]);}return _0x4f32cd[_0xae8e('0x86')](_0x4bfab6);}})[_0xae8e('0x23')](function(_0x2ed6ac){if(_0x2ed6ac){return _0x2ed6ac?{'count':_0x2583e3,'rows':_0x2ed6ac}:null;}})['then'](respondWithResult(_0x386aa0,null))['catch'](handleError(_0x386aa0,null));};exports['addBlackLists']=function(_0xfc6ea4,_0x35add2,_0x15e1b3){var _0x4737db,_0x2f210e;return db[_0xae8e('0x2f')][_0xae8e('0x4b')]({'where':{'id':_0xfc6ea4[_0xae8e('0x59')]['id']}})['then'](handleEntityNotFound(_0x35add2,null))[_0xae8e('0x23')](function(_0x4096c9){if(_0x4096c9){_0x2f210e=_0x4096c9;return _0x4096c9[_0xae8e('0x87')](_0xfc6ea4[_0xae8e('0x56')][_0xae8e('0x66')],_[_0xae8e('0x57')](_0xfc6ea4[_0xae8e('0x56')],[_0xae8e('0x66'),'id'])||{});}return null;})['spread'](function(_0x586f74){var _0xcb9b97;_0x4737db=_0x586f74||[];var _0x566d56=[];if(_0x586f74){for(var _0x1220b8=0x0;_0x1220b8<_0x586f74[_0xae8e('0x38')];_0x1220b8+=0x1){var _0x15eea7=_0x586f74[_0x1220b8][_0xae8e('0x25')]({'plain':!![]});_0xcb9b97=squel[_0xae8e('0x6a')]()[_0xae8e('0x6b')]('cm_hopper_black')[_0xae8e('0x80')]([_0xae8e('0x6c'),_0xae8e('0x6e'),'ListId',_0xae8e('0x5c'),_0xae8e('0x54'),_0xae8e('0x55')],squel[_0xae8e('0x78')]()[_0xae8e('0x70')](_0xae8e('0x6c'),_0xae8e('0x6c'))[_0xae8e('0x70')]('id',_0xae8e('0x6e'))[_0xae8e('0x70')](_0x15eea7['CmListId'][_0xae8e('0x71')](),_0xae8e('0x6f'))['field'](_0xfc6ea4[_0xae8e('0x59')]['id'][_0xae8e('0x71')](),'CampaignId')['field']('NOW()',_0xae8e('0x54'))[_0xae8e('0x70')]('NOW()',_0xae8e('0x55'))[_0xae8e('0x7d')](_0xae8e('0x73'))[_0xae8e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xae8e('0x3d')]('ListId\x20=\x20?',_0x15eea7[_0xae8e('0x76')][_0xae8e('0x71')]())[_0xae8e('0x3d')](_0xae8e('0x77')))['toString']();_0x566d56['push'](db['sequelize'][_0xae8e('0x34')](_0xcb9b97));}return BPromise[_0xae8e('0x84')](_0x566d56);}})[_0xae8e('0x23')](function(){return _0x4737db;})[_0xae8e('0x23')](respondWithResult(_0x35add2,null))[_0xae8e('0x47')](handleError(_0x35add2,null));};exports[_0xae8e('0x88')]=function(_0xc7dfe3,_0x5599b2,_0x1489a4){return db[_0xae8e('0x2f')]['find']({'where':{'id':_0xc7dfe3[_0xae8e('0x59')]['id']}})[_0xae8e('0x23')](handleEntityNotFound(_0x5599b2,null))[_0xae8e('0x23')](function(_0x3f5a5f){if(_0x3f5a5f){return _0x3f5a5f[_0xae8e('0x88')](_0xc7dfe3['query'][_0xae8e('0x66')]);}})[_0xae8e('0x23')](function(_0x9f7f66){if(_0x9f7f66){return db[_0xae8e('0x62')][_0xae8e('0x24')]({'where':{'ListId':_0xc7dfe3[_0xae8e('0x34')][_0xae8e('0x66')],'CampaignId':_0xc7dfe3['params']['id']}})[_0xae8e('0x23')](function(){return _0x9f7f66;});}})[_0xae8e('0x23')](respondWithStatusCode(_0x5599b2,null))[_0xae8e('0x47')](handleError(_0x5599b2,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 89916f1..3fc802b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index e07e5c9..3491506 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 _0x0a34=['model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x5a1522,_0x46e359){var _0x30326c=function(_0x413dbb){while(--_0x413dbb){_0x5a1522['push'](_0x5a1522['shift']());}};_0x30326c(++_0x46e359);}(_0x0a34,0x12a));var _0x40a3=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x0a34[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var moment=require('moment');var BPromise=require(_0x40a3('0x2'));var rs=require(_0x40a3('0x3'));var fs=require('fs');var Redis=require(_0x40a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40a3('0x5'));var logger=require(_0x40a3('0x6'))(_0x40a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x40a3('0x8'));var client=jayson[_0x40a3('0x9')][_0x40a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x394f67,_0x655437,_0x3bf1de){return new BPromise(function(_0x504f01,_0x288c84){return client[_0x40a3('0xb')](_0x394f67,_0x3bf1de)[_0x40a3('0xc')](function(_0x1459bc){logger[_0x40a3('0xd')](_0x40a3('0xe'),_0x655437,'request\x20sent');logger[_0x40a3('0xf')](_0x40a3('0x10'),_0x655437,_0x40a3('0x11'),JSON['stringify'](_0x1459bc));if(_0x1459bc[_0x40a3('0x12')]){if(_0x1459bc[_0x40a3('0x12')]['code']===0x1f4){logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x655437,_0x1459bc['error'][_0x40a3('0x13')]);return _0x288c84(_0x1459bc[_0x40a3('0x12')]['message']);}logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x655437,_0x1459bc[_0x40a3('0x12')][_0x40a3('0x13')]);return _0x504f01(_0x1459bc['error']['message']);}else{logger['info'](_0x40a3('0xe'),_0x655437,_0x40a3('0x11'));_0x504f01(_0x1459bc[_0x40a3('0x14')]['message']);}})[_0x40a3('0x15')](function(_0x8c3d45){logger['error'](_0x40a3('0xe'),_0x655437,_0x8c3d45);_0x288c84(_0x8c3d45);});});}exports[_0x40a3('0x16')]=function(_0x31aef5){var _0x22f31e=this;return new Promise(function(_0x1c5102,_0x4d037a){return db[_0x40a3('0x17')][_0x40a3('0x18')]({'raw':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1a')]===undefined?!![]:![]:!![],'where':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1b')]||null:null,'attributes':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1c')]||null:null,'limit':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1d')]||null:null,'include':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')]['include']?_[_0x40a3('0x1e')](_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1f')],function(_0x1e11fb){return{'model':db[_0x1e11fb[_0x40a3('0x20')]],'as':_0x1e11fb['as'],'attributes':_0x1e11fb[_0x40a3('0x1c')],'include':_0x1e11fb['include']?_[_0x40a3('0x1e')](_0x1e11fb['include'],function(_0x37321a){return{'model':db[_0x37321a[_0x40a3('0x20')]],'as':_0x37321a['as'],'attributes':_0x37321a['attributes'],'include':_0x37321a[_0x40a3('0x1f')]?_[_0x40a3('0x1e')](_0x37321a[_0x40a3('0x1f')],function(_0x599474){return{'model':db[_0x599474[_0x40a3('0x20')]],'as':_0x599474['as'],'attributes':_0x599474[_0x40a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x40a3('0xc')](function(_0x4456f1){logger[_0x40a3('0xd')](_0x40a3('0x16'),_0x31aef5);logger[_0x40a3('0xf')](_0x40a3('0x16'),_0x31aef5,JSON['stringify'](_0x4456f1));_0x1c5102(_0x4456f1);})['catch'](function(_0x355a8f){logger['error']('GetCampaign',_0x355a8f[_0x40a3('0x13')],_0x31aef5);_0x4d037a(_0x22f31e[_0x40a3('0x12')](0x1f4,_0x355a8f[_0x40a3('0x13')]));});});};
\ No newline at end of file
+var _0xf257=['map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x1dc29a,_0x10db83){var _0x547b4f=function(_0x2cd12d){while(--_0x2cd12d){_0x1dc29a['push'](_0x1dc29a['shift']());}};_0x547b4f(++_0x10db83);}(_0xf257,0x82));var _0x7f25=function(_0x378fcb,_0x32e78c){_0x378fcb=_0x378fcb-0x0;var _0x5dfe9b=_0xf257[_0x378fcb];return _0x5dfe9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f25('0x0'));var BPromise=require(_0x7f25('0x1'));var rs=require(_0x7f25('0x2'));var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f25('0x4'));var logger=require(_0x7f25('0x5'))(_0x7f25('0x6'));var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson[_0x7f25('0x9')][_0x7f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x242a3e,_0x369a09,_0x16e278){return new BPromise(function(_0x31a5d8,_0x1ae607){return client[_0x7f25('0xb')](_0x242a3e,_0x16e278)[_0x7f25('0xc')](function(_0x57ba17){logger[_0x7f25('0xd')](_0x7f25('0xe'),_0x369a09,'request\x20sent');logger['debug'](_0x7f25('0xf'),_0x369a09,'request\x20sent',JSON[_0x7f25('0x10')](_0x57ba17));if(_0x57ba17[_0x7f25('0x11')]){if(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x12')]===0x1f4){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')]['message']);return _0x1ae607(_0x57ba17['error'][_0x7f25('0x13')]);}logger['error'](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);return _0x31a5d8(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x369a09,'request\x20sent');_0x31a5d8(_0x57ba17[_0x7f25('0x14')][_0x7f25('0x13')]);}})[_0x7f25('0x15')](function(_0x167363){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x167363);_0x1ae607(_0x167363);});});}exports[_0x7f25('0x16')]=function(_0x26d4aa){var _0x5e0067=this;return new Promise(function(_0x23f30c,_0x1cd6c1){return db[_0x7f25('0x17')][_0x7f25('0x18')]({'raw':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26d4aa['options']?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1a')]||null:null,'attributes':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1b')]||null:null,'limit':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1c')]||null:null,'include':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa['options'][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1d')],function(_0x29039a){return{'model':db[_0x29039a['model']],'as':_0x29039a['as'],'attributes':_0x29039a[_0x7f25('0x1b')],'include':_0x29039a[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x29039a['include'],function(_0x17b38c){return{'model':db[_0x17b38c['model']],'as':_0x17b38c['as'],'attributes':_0x17b38c[_0x7f25('0x1b')],'include':_0x17b38c[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x17b38c[_0x7f25('0x1d')],function(_0x382fd4){return{'model':db[_0x382fd4[_0x7f25('0x1f')]],'as':_0x382fd4['as'],'attributes':_0x382fd4[_0x7f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xc')](function(_0x44116d){logger[_0x7f25('0xd')]('GetCampaign',_0x26d4aa);logger['debug'](_0x7f25('0x16'),_0x26d4aa,JSON[_0x7f25('0x10')](_0x44116d));_0x23f30c(_0x44116d);})['catch'](function(_0xa373ee){logger[_0x7f25('0x11')](_0x7f25('0x16'),_0xa373ee[_0x7f25('0x13')],_0x26d4aa);_0x1cd6c1(_0x5e0067[_0x7f25('0x11')](0x1f4,_0xa373ee[_0x7f25('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 69ee163..62eaf17 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 _0xad9b=['/:id/lists','getLists','getBlackLists','post','create','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','/:id','show','/:id/hoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xad9b,0x10e));var _0xbad9=function(_0xfc9121,_0x38e193){_0xfc9121=_0xfc9121-0x0;var _0x4e9f47=_0xad9b[_0xfc9121];return _0x4e9f47;};'use strict';var multer=require(_0xbad9('0x0'));var util=require('util');var path=require(_0xbad9('0x1'));var timeout=require(_0xbad9('0x2'));var express=require(_0xbad9('0x3'));var router=express[_0xbad9('0x4')]();var fs_extra=require(_0xbad9('0x5'));var auth=require(_0xbad9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbad9('0x7'));router['get']('/',auth[_0xbad9('0x8')](),controller['index']);router['get'](_0xbad9('0x9'),auth[_0xbad9('0x8')](),controller[_0xbad9('0xa')]);router['get'](_0xbad9('0xb'),auth[_0xbad9('0x8')](),controller['getHoppers']);router[_0xbad9('0xc')](_0xbad9('0xd'),auth[_0xbad9('0x8')](),controller[_0xbad9('0xe')]);router[_0xbad9('0xc')](_0xbad9('0xf'),auth[_0xbad9('0x8')](),controller['getHopperFinals']);router[_0xbad9('0xc')](_0xbad9('0x10'),auth[_0xbad9('0x8')](),controller[_0xbad9('0x11')]);router[_0xbad9('0xc')](_0xbad9('0x12'),auth[_0xbad9('0x8')](),controller[_0xbad9('0x13')]);router[_0xbad9('0xc')]('/:id/blacklists',auth[_0xbad9('0x8')](),controller[_0xbad9('0x14')]);router[_0xbad9('0x15')]('/',auth[_0xbad9('0x8')](),controller[_0xbad9('0x16')]);router[_0xbad9('0x15')]('/:id/clone',auth[_0xbad9('0x8')](),controller[_0xbad9('0x17')]);router[_0xbad9('0x15')](_0xbad9('0x12'),auth['isAuthenticated'](),controller['addLists']);router[_0xbad9('0x15')](_0xbad9('0x18'),auth[_0xbad9('0x8')](),controller[_0xbad9('0x19')]);router[_0xbad9('0x1a')](_0xbad9('0x9'),auth[_0xbad9('0x8')](),controller[_0xbad9('0x1b')]);router[_0xbad9('0x1c')](_0xbad9('0x9'),auth[_0xbad9('0x8')](),controller[_0xbad9('0x1d')]);router[_0xbad9('0x1c')](_0xbad9('0x12'),auth[_0xbad9('0x8')](),controller['removeLists']);router['delete'](_0xbad9('0x18'),auth['isAuthenticated'](),controller[_0xbad9('0x1e')]);module[_0xbad9('0x1f')]=router;
\ No newline at end of file
+var _0x2b44=['destroy','removeLists','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','/:id'];(function(_0x3075a6,_0x1c0d29){var _0x19e413=function(_0x5a9deb){while(--_0x5a9deb){_0x3075a6['push'](_0x3075a6['shift']());}};_0x19e413(++_0x1c0d29);}(_0x2b44,0x122));var _0x42b4=function(_0x22244c,_0x16e0be){_0x22244c=_0x22244c-0x0;var _0x16e2d5=_0x2b44[_0x22244c];return _0x16e2d5;};'use strict';var multer=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var path=require(_0x42b4('0x2'));var timeout=require(_0x42b4('0x3'));var express=require(_0x42b4('0x4'));var router=express[_0x42b4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var controller=require(_0x42b4('0x8'));router[_0x42b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x42b4('0xa')]);router[_0x42b4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0xb')]);router[_0x42b4('0x9')](_0x42b4('0xc'),auth[_0x42b4('0xd')](),controller[_0x42b4('0xe')]);router[_0x42b4('0x9')](_0x42b4('0xf'),auth['isAuthenticated'](),controller[_0x42b4('0x10')]);router[_0x42b4('0x9')](_0x42b4('0x11'),auth['isAuthenticated'](),controller[_0x42b4('0x12')]);router[_0x42b4('0x9')](_0x42b4('0x13'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x14')]);router[_0x42b4('0x9')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x42b4('0xd')](),controller[_0x42b4('0x16')]);router[_0x42b4('0x17')]('/',auth[_0x42b4('0xd')](),controller[_0x42b4('0x18')]);router['post'](_0x42b4('0x19'),auth['isAuthenticated'](),controller[_0x42b4('0x1a')]);router[_0x42b4('0x17')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1b')]);router['post'](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x1d')]);router[_0x42b4('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x42b4('0x1f')]);router[_0x42b4('0x20')](_0x42b4('0x21'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x22')]);router[_0x42b4('0x20')](_0x42b4('0x15'),auth[_0x42b4('0xd')](),controller[_0x42b4('0x23')]);router[_0x42b4('0x20')](_0x42b4('0x1c'),auth[_0x42b4('0xd')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 595881e..60aacad 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 _0x020e=['TEXT','VIRTUAL','sequelize','exports','STRING'];(function(_0x402b49,_0x3d425d){var _0x2a0a1e=function(_0x51c7fe){while(--_0x51c7fe){_0x402b49['push'](_0x402b49['shift']());}};_0x2a0a1e(++_0x3d425d);}(_0x020e,0xa7));var _0xe020=function(_0x2bf9d6,_0xa78e64){_0x2bf9d6=_0x2bf9d6-0x0;var _0x3ab768=_0x020e[_0x2bf9d6];return _0x3ab768;};'use strict';var Sequelize=require(_0xe020('0x0'));module[_0xe020('0x1')]={'key':{'type':Sequelize[_0xe020('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe020('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xe020('0x2')]},'name':{'type':Sequelize[_0xe020('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0xff67=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xff67,0x86));var _0x7ff6=function(_0x2b9638,_0x37e81f){_0x2b9638=_0x2b9638-0x0;var _0x58b5d2=_0xff67[_0x2b9638];return _0x58b5d2;};'use strict';var Sequelize=require('sequelize');module[_0x7ff6('0x0')]={'key':{'type':Sequelize[_0x7ff6('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7ff6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7ff6('0x1')]},'name':{'type':Sequelize[_0x7ff6('0x3')],'get':function(){return this[_0x7ff6('0x4')](_0x7ff6('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8899312..7d6f4ef 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 _0x1a1f=['show','params','rawAttributes','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','catch'];(function(_0x39e177,_0x1f09d9){var _0x441aa0=function(_0x533eef){while(--_0x533eef){_0x39e177['push'](_0x39e177['shift']());}};_0x441aa0(++_0x1f09d9);}(_0x1a1f,0x67));var _0xf1a1=function(_0x5f3f26,_0x262c0d){_0x5f3f26=_0x5f3f26-0x0;var _0x20a741=_0x1a1f[_0x5f3f26];return _0x20a741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1a1('0x1'));var rp=require(_0xf1a1('0x2'));var moment=require(_0xf1a1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf1a1('0x4'));var util=require(_0xf1a1('0x5'));var path=require(_0xf1a1('0x6'));var sox=require(_0xf1a1('0x7'));var csv=require(_0xf1a1('0x8'));var ejs=require(_0xf1a1('0x9'));var fs=require('fs');var fs_extra=require(_0xf1a1('0xa'));var _=require(_0xf1a1('0xb'));var squel=require('squel');var crypto=require(_0xf1a1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf1a1('0xd'));var toCsv=require(_0xf1a1('0x8'));var querystring=require(_0xf1a1('0xe'));var Papa=require('papaparse');var Redis=require(_0xf1a1('0xf'));var authService=require(_0xf1a1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf1a1('0x11'));var hardwareService=require(_0xf1a1('0x12'));var logger=require(_0xf1a1('0x13'))(_0xf1a1('0x14'));var utils=require('../../config/utils');var config=require(_0xf1a1('0x15'));var licenseUtil=require(_0xf1a1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d36b,_0x57d9c2){_0x57d9c2=_0x57d9c2||0xcc;return function(_0x59fdcc){if(_0x59fdcc){return _0x12d36b['sendStatus'](_0x57d9c2);}return _0x12d36b['status'](_0x57d9c2)[_0xf1a1('0x17')]();};}function respondWithResult(_0x20cd31,_0x25280a){_0x25280a=_0x25280a||0xc8;return function(_0x2f3671){if(_0x2f3671){return _0x20cd31[_0xf1a1('0x18')](_0x25280a)[_0xf1a1('0x19')](_0x2f3671);}};}function respondWithFilteredResult(_0x1d3b46,_0x457ced){return function(_0xf78b79){if(_0xf78b79){var _0x4f6820=typeof _0x457ced[_0xf1a1('0x1a')]===_0xf1a1('0x1b')&&typeof _0x457ced[_0xf1a1('0x1c')]==='undefined';var _0x57f024=_0xf78b79[_0xf1a1('0x1d')];var _0x201a6f=_0x4f6820?0x0:_0x457ced['offset'];var _0x4fe8e9=_0x4f6820?_0xf78b79[_0xf1a1('0x1d')]:_0x457ced[_0xf1a1('0x1a')]+_0x457ced['limit'];var _0x273f2f;if(_0x4fe8e9>=_0x57f024){_0x4fe8e9=_0x57f024;_0x273f2f=0xc8;}else{_0x273f2f=0xce;}_0x1d3b46['status'](_0x273f2f);return _0x1d3b46[_0xf1a1('0x1e')]('Content-Range',_0x201a6f+'-'+_0x4fe8e9+'/'+_0x57f024)['json'](_0xf78b79);}return null;};}function patchUpdates(_0x4a1989){return function(_0x2d8e5d){try{jsonpatch[_0xf1a1('0x1f')](_0x2d8e5d,_0x4a1989,!![]);}catch(_0x2f4b35){return BPromise[_0xf1a1('0x20')](_0x2f4b35);}return _0x2d8e5d[_0xf1a1('0x21')]();};}function saveUpdates(_0x187dc3,_0x4dbd36){return function(_0x222eb1){if(_0x222eb1){return _0x222eb1[_0xf1a1('0x22')](_0x187dc3)[_0xf1a1('0x23')](function(_0x3be266){return _0x3be266;});}return null;};}function removeEntity(_0x4b3e44,_0x499c9b){return function(_0xf9e90){if(_0xf9e90){return _0xf9e90[_0xf1a1('0x24')]()[_0xf1a1('0x23')](function(){var _0x19a711=_0xf9e90[_0xf1a1('0x25')]({'plain':!![]});var _0x41150c=_0xf1a1('0x26');return db[_0xf1a1('0x27')][_0xf1a1('0x24')]({'where':{'type':_0x41150c,'resourceId':_0x19a711['id']}})[_0xf1a1('0x23')](function(){return _0xf9e90;});})[_0xf1a1('0x23')](function(){_0x4b3e44[_0xf1a1('0x18')](0xcc)[_0xf1a1('0x17')]();});}};}function handleEntityNotFound(_0xff378b,_0x1ce869){return function(_0x7c1911){if(!_0x7c1911){_0xff378b[_0xf1a1('0x28')](0x194);}return _0x7c1911;};}function handleError(_0x2ba274,_0x5ea2d3){_0x5ea2d3=_0x5ea2d3||0x1f4;return function(_0x574fb7){logger[_0xf1a1('0x29')](_0x574fb7['stack']);if(_0x574fb7[_0xf1a1('0x2a')]){delete _0x574fb7[_0xf1a1('0x2a')];}_0x2ba274['status'](_0x5ea2d3)[_0xf1a1('0x2b')](_0x574fb7);};}exports[_0xf1a1('0x2c')]=function(_0x45b8ed,_0x216268){var _0x19c37a={},_0x471de1={},_0x170e4a={'count':0x0,'rows':[]};var _0x59d83e=_[_0xf1a1('0x2d')](db[_0xf1a1('0x2e')]['rawAttributes'],function(_0x4d9dca){return{'name':_0x4d9dca[_0xf1a1('0x2f')],'type':_0x4d9dca['type'][_0xf1a1('0x30')]};});_0x471de1[_0xf1a1('0x31')]=_[_0xf1a1('0x2d')](_0x59d83e,_0xf1a1('0x2a'));_0x471de1['query']=_[_0xf1a1('0x32')](_0x45b8ed[_0xf1a1('0x33')]);_0x471de1[_0xf1a1('0x34')]=_['intersection'](_0x471de1['model'],_0x471de1['query']);_0x19c37a[_0xf1a1('0x35')]=_[_0xf1a1('0x36')](_0x471de1['model'],qs[_0xf1a1('0x37')](_0x45b8ed[_0xf1a1('0x33')][_0xf1a1('0x37')]));_0x19c37a[_0xf1a1('0x35')]=_0x19c37a[_0xf1a1('0x35')][_0xf1a1('0x38')]?_0x19c37a[_0xf1a1('0x35')]:_0x471de1['model'];if(!_0x45b8ed[_0xf1a1('0x33')][_0xf1a1('0x39')](_0xf1a1('0x3a'))){_0x19c37a[_0xf1a1('0x1c')]=qs[_0xf1a1('0x1c')](_0x45b8ed['query']['limit']);_0x19c37a[_0xf1a1('0x1a')]=qs[_0xf1a1('0x1a')](_0x45b8ed['query']['offset']);}_0x19c37a['order']=qs[_0xf1a1('0x3b')](_0x45b8ed['query'][_0xf1a1('0x3b')]);_0x19c37a[_0xf1a1('0x3c')]=qs[_0xf1a1('0x34')](_[_0xf1a1('0x3d')](_0x45b8ed['query'],_0x471de1['filters']),_0x59d83e);if(_0x45b8ed[_0xf1a1('0x33')]['filter']){_0x19c37a[_0xf1a1('0x3c')]=_[_0xf1a1('0x3e')](_0x19c37a['where'],{'$or':[{'key':{'$like':'%'+_0x45b8ed[_0xf1a1('0x33')][_0xf1a1('0x3f')]+'%'}},{'value':{'$like':'%'+_0x45b8ed[_0xf1a1('0x33')]['filter']+'%'}}]});}_0x19c37a=_['merge']({},_0x19c37a,_0x45b8ed[_0xf1a1('0x40')]);var _0x15f269={'where':_0x19c37a['where']};return db[_0xf1a1('0x2e')][_0xf1a1('0x1d')](_0x15f269)[_0xf1a1('0x23')](function(_0x4985ae){_0x170e4a[_0xf1a1('0x1d')]=_0x4985ae;if(_0x45b8ed['query'][_0xf1a1('0x41')]){_0x19c37a[_0xf1a1('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x19c37a);})['then'](function(_0x3343f8){_0x170e4a[_0xf1a1('0x43')]=_0x3343f8;return _0x170e4a;})[_0xf1a1('0x23')](respondWithFilteredResult(_0x216268,_0x19c37a))[_0xf1a1('0x44')](handleError(_0x216268,null));};exports[_0xf1a1('0x45')]=function(_0x21f263,_0x551b9a){var _0x3172ea={'raw':!![],'where':{'id':_0x21f263[_0xf1a1('0x46')]['id']}},_0x479ae7={};_0x479ae7[_0xf1a1('0x31')]=_['keys'](db['CannedAnswer'][_0xf1a1('0x47')]);_0x479ae7[_0xf1a1('0x33')]=_['keys'](_0x21f263[_0xf1a1('0x33')]);_0x479ae7[_0xf1a1('0x34')]=_[_0xf1a1('0x36')](_0x479ae7[_0xf1a1('0x31')],_0x479ae7[_0xf1a1('0x33')]);_0x3172ea[_0xf1a1('0x35')]=_['intersection'](_0x479ae7[_0xf1a1('0x31')],qs[_0xf1a1('0x37')](_0x21f263['query']['fields']));_0x3172ea['attributes']=_0x3172ea[_0xf1a1('0x35')]['length']?_0x3172ea['attributes']:_0x479ae7[_0xf1a1('0x31')];if(_0x21f263['query'][_0xf1a1('0x41')]){_0x3172ea[_0xf1a1('0x42')]=[{'all':!![]}];}_0x3172ea=_[_0xf1a1('0x3e')]({},_0x3172ea,_0x21f263[_0xf1a1('0x40')]);return db['CannedAnswer']['find'](_0x3172ea)[_0xf1a1('0x23')](handleEntityNotFound(_0x551b9a,null))[_0xf1a1('0x23')](respondWithResult(_0x551b9a,null))[_0xf1a1('0x44')](handleError(_0x551b9a,null));};exports['update']=function(_0x358e5f,_0x26151f){if(_0x358e5f[_0xf1a1('0x48')]['id']){delete _0x358e5f[_0xf1a1('0x48')]['id'];}return db[_0xf1a1('0x2e')][_0xf1a1('0x49')]({'where':{'id':_0x358e5f[_0xf1a1('0x46')]['id']}})[_0xf1a1('0x23')](handleEntityNotFound(_0x26151f,null))[_0xf1a1('0x23')](saveUpdates(_0x358e5f['body'],null))[_0xf1a1('0x23')](respondWithResult(_0x26151f,null))[_0xf1a1('0x44')](handleError(_0x26151f,null));};exports['destroy']=function(_0x12444b,_0x4ed892){return db['CannedAnswer'][_0xf1a1('0x49')]({'where':{'id':_0x12444b[_0xf1a1('0x46')]['id']}})[_0xf1a1('0x23')](handleEntityNotFound(_0x4ed892,null))[_0xf1a1('0x23')](removeEntity(_0x4ed892,null))['catch'](handleError(_0x4ed892,null));};exports[_0xf1a1('0x4a')]=function(_0x5417e5,_0x16e7fe){var _0x3e583d={'key':_0x5417e5[_0xf1a1('0x48')]['key']};if(_0x5417e5['body'][_0xf1a1('0x4b')]){_0x3e583d[_0xf1a1('0x4b')]=_0x5417e5[_0xf1a1('0x48')][_0xf1a1('0x4b')];}else if(_0x5417e5[_0xf1a1('0x48')][_0xf1a1('0x4c')]){_0x3e583d[_0xf1a1('0x4c')]=_0x5417e5[_0xf1a1('0x48')]['SmsAccountId'];}else if(_0x5417e5[_0xf1a1('0x48')][_0xf1a1('0x4d')]){_0x3e583d[_0xf1a1('0x4d')]=_0x5417e5['body'][_0xf1a1('0x4d')];}else if(_0x5417e5['body'][_0xf1a1('0x4e')]){_0x3e583d[_0xf1a1('0x4e')]=_0x5417e5[_0xf1a1('0x48')][_0xf1a1('0x4e')];}return db[_0xf1a1('0x2e')][_0xf1a1('0x49')]({'where':_0x3e583d})['then'](function(_0x3a0698){if(_0x3a0698){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf1a1('0x2e')][_0xf1a1('0x4a')](_0x5417e5[_0xf1a1('0x48')]);})[_0xf1a1('0x23')](function(_0x1423d5){var _0x413080=_0x5417e5[_0xf1a1('0x4f')][_0xf1a1('0x25')]({'plain':!![]});if(!_0x413080)throw new Error(_0xf1a1('0x50'));if(_0x413080[_0xf1a1('0x51')]===_0xf1a1('0x4f')){var _0x51aa6c=_0x1423d5['get']({'plain':!![]});return db[_0xf1a1('0x52')]['find']({'where':{'name':_0xf1a1('0x26'),'userProfileId':_0x413080[_0xf1a1('0x53')]},'raw':!![]})[_0xf1a1('0x23')](function(_0x1cc2cd){if(_0x1cc2cd&&_0x1cc2cd[_0xf1a1('0x54')]===0x0){return db[_0xf1a1('0x27')][_0xf1a1('0x4a')]({'name':_0x51aa6c[_0xf1a1('0x2a')],'resourceId':_0x51aa6c['id'],'type':_0x1cc2cd[_0xf1a1('0x2a')],'sectionId':_0x1cc2cd['id']},{})[_0xf1a1('0x23')](function(){return _0x1423d5;});}else{return _0x1423d5;}})[_0xf1a1('0x44')](function(_0x171bec){logger[_0xf1a1('0x29')](_0xf1a1('0x55'),_0x171bec);throw _0x171bec;});}return _0x1423d5;})['then'](respondWithResult(_0x16e7fe,0xc9))[_0xf1a1('0x44')](handleError(_0x16e7fe,null));};
\ No newline at end of file
+var _0xa0b1=['filters','pick','filter','where','options','CannedAnswer','findAll','rows','catch','params','keys','includeAll','include','merge','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa0b1,0x128));var _0x1a0b=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0xa0b1[_0x3394a6];return _0x4a7909;};'use strict';var emlformat=require(_0x1a0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0b('0x2'));var moment=require(_0x1a0b('0x3'));var BPromise=require(_0x1a0b('0x4'));var Mustache=require(_0x1a0b('0x5'));var util=require(_0x1a0b('0x6'));var path=require(_0x1a0b('0x7'));var sox=require('sox');var csv=require(_0x1a0b('0x8'));var ejs=require(_0x1a0b('0x9'));var fs=require('fs');var fs_extra=require(_0x1a0b('0xa'));var _=require(_0x1a0b('0xb'));var squel=require(_0x1a0b('0xc'));var crypto=require(_0x1a0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a0b('0xe'));var toCsv=require(_0x1a0b('0x8'));var querystring=require(_0x1a0b('0xf'));var Papa=require(_0x1a0b('0x10'));var Redis=require(_0x1a0b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1a0b('0x12'));var as=require(_0x1a0b('0x13'));var hardwareService=require(_0x1a0b('0x14'));var logger=require(_0x1a0b('0x15'))(_0x1a0b('0x16'));var utils=require(_0x1a0b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1a0b('0x18'));var db=require(_0x1a0b('0x19'))['db'];function respondWithStatusCode(_0x2b1647,_0x3dc34f){_0x3dc34f=_0x3dc34f||0xcc;return function(_0x524fd1){if(_0x524fd1){return _0x2b1647[_0x1a0b('0x1a')](_0x3dc34f);}return _0x2b1647[_0x1a0b('0x1b')](_0x3dc34f)[_0x1a0b('0x1c')]();};}function respondWithResult(_0x2331be,_0x395202){_0x395202=_0x395202||0xc8;return function(_0x58eaa7){if(_0x58eaa7){return _0x2331be[_0x1a0b('0x1b')](_0x395202)[_0x1a0b('0x1d')](_0x58eaa7);}};}function respondWithFilteredResult(_0x144f49,_0x3bffde){return function(_0x5ad3bd){if(_0x5ad3bd){var _0x15c20e=typeof _0x3bffde[_0x1a0b('0x1e')]===_0x1a0b('0x1f')&&typeof _0x3bffde[_0x1a0b('0x20')]==='undefined';var _0x141858=_0x5ad3bd[_0x1a0b('0x21')];var _0x21f019=_0x15c20e?0x0:_0x3bffde[_0x1a0b('0x1e')];var _0x1447e2=_0x15c20e?_0x5ad3bd[_0x1a0b('0x21')]:_0x3bffde['offset']+_0x3bffde[_0x1a0b('0x20')];var _0x31b8a1;if(_0x1447e2>=_0x141858){_0x1447e2=_0x141858;_0x31b8a1=0xc8;}else{_0x31b8a1=0xce;}_0x144f49[_0x1a0b('0x1b')](_0x31b8a1);return _0x144f49['set'](_0x1a0b('0x22'),_0x21f019+'-'+_0x1447e2+'/'+_0x141858)[_0x1a0b('0x1d')](_0x5ad3bd);}return null;};}function patchUpdates(_0x36623b){return function(_0x22c64b){try{jsonpatch[_0x1a0b('0x23')](_0x22c64b,_0x36623b,!![]);}catch(_0x9c0631){return BPromise[_0x1a0b('0x24')](_0x9c0631);}return _0x22c64b['save']();};}function saveUpdates(_0x2ffd8d,_0x1f0e62){return function(_0x2ea48e){if(_0x2ea48e){return _0x2ea48e[_0x1a0b('0x25')](_0x2ffd8d)['then'](function(_0x39ccdb){return _0x39ccdb;});}return null;};}function removeEntity(_0x2d10ce,_0xc53c5c){return function(_0xb1bc82){if(_0xb1bc82){return _0xb1bc82[_0x1a0b('0x26')]()[_0x1a0b('0x27')](function(){var _0x1d535e=_0xb1bc82[_0x1a0b('0x28')]({'plain':!![]});var _0x5cdd89=_0x1a0b('0x29');return db[_0x1a0b('0x2a')][_0x1a0b('0x26')]({'where':{'type':_0x5cdd89,'resourceId':_0x1d535e['id']}})['then'](function(){return _0xb1bc82;});})[_0x1a0b('0x27')](function(){_0x2d10ce['status'](0xcc)[_0x1a0b('0x1c')]();});}};}function handleEntityNotFound(_0x5572f5,_0x18a68d){return function(_0x309b51){if(!_0x309b51){_0x5572f5[_0x1a0b('0x1a')](0x194);}return _0x309b51;};}function handleError(_0x51e90a,_0x12518e){_0x12518e=_0x12518e||0x1f4;return function(_0x5d7d56){logger[_0x1a0b('0x2b')](_0x5d7d56[_0x1a0b('0x2c')]);if(_0x5d7d56[_0x1a0b('0x2d')]){delete _0x5d7d56[_0x1a0b('0x2d')];}_0x51e90a[_0x1a0b('0x1b')](_0x12518e)['send'](_0x5d7d56);};}exports['index']=function(_0x529013,_0x2df315){var _0x3538d0={},_0x4b9644={},_0x22b8db={'count':0x0,'rows':[]};var _0x2e0e91=_[_0x1a0b('0x2e')](db['CannedAnswer'][_0x1a0b('0x2f')],function(_0x62451d){return{'name':_0x62451d[_0x1a0b('0x30')],'type':_0x62451d['type'][_0x1a0b('0x31')]};});_0x4b9644[_0x1a0b('0x32')]=_[_0x1a0b('0x2e')](_0x2e0e91,_0x1a0b('0x2d'));_0x4b9644['query']=_['keys'](_0x529013[_0x1a0b('0x33')]);_0x4b9644['filters']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],_0x4b9644[_0x1a0b('0x33')]);_0x3538d0['attributes']=_[_0x1a0b('0x34')](_0x4b9644[_0x1a0b('0x32')],qs[_0x1a0b('0x35')](_0x529013[_0x1a0b('0x33')]['fields']));_0x3538d0[_0x1a0b('0x36')]=_0x3538d0['attributes'][_0x1a0b('0x37')]?_0x3538d0[_0x1a0b('0x36')]:_0x4b9644['model'];if(!_0x529013['query'][_0x1a0b('0x38')](_0x1a0b('0x39'))){_0x3538d0[_0x1a0b('0x20')]=qs['limit'](_0x529013[_0x1a0b('0x33')]['limit']);_0x3538d0[_0x1a0b('0x1e')]=qs[_0x1a0b('0x1e')](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x1e')]);}_0x3538d0[_0x1a0b('0x3a')]=qs['sort'](_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3b')]);_0x3538d0['where']=qs[_0x1a0b('0x3c')](_[_0x1a0b('0x3d')](_0x529013[_0x1a0b('0x33')],_0x4b9644[_0x1a0b('0x3c')]),_0x2e0e91);if(_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]){_0x3538d0['where']=_['merge'](_0x3538d0[_0x1a0b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x529013[_0x1a0b('0x33')][_0x1a0b('0x3e')]+'%'}},{'value':{'$like':'%'+_0x529013[_0x1a0b('0x33')]['filter']+'%'}}]});}_0x3538d0=_['merge']({},_0x3538d0,_0x529013[_0x1a0b('0x40')]);var _0x268c51={'where':_0x3538d0[_0x1a0b('0x3f')]};return db[_0x1a0b('0x41')][_0x1a0b('0x21')](_0x268c51)[_0x1a0b('0x27')](function(_0x4a17b0){_0x22b8db[_0x1a0b('0x21')]=_0x4a17b0;if(_0x529013[_0x1a0b('0x33')]['includeAll']){_0x3538d0['include']=[{'all':!![]}];}return db[_0x1a0b('0x41')][_0x1a0b('0x42')](_0x3538d0);})[_0x1a0b('0x27')](function(_0x163e6b){_0x22b8db[_0x1a0b('0x43')]=_0x163e6b;return _0x22b8db;})[_0x1a0b('0x27')](respondWithFilteredResult(_0x2df315,_0x3538d0))[_0x1a0b('0x44')](handleError(_0x2df315,null));};exports['show']=function(_0x44860a,_0x288174){var _0x1e54dc={'raw':!![],'where':{'id':_0x44860a[_0x1a0b('0x45')]['id']}},_0x23ee18={};_0x23ee18[_0x1a0b('0x32')]=_[_0x1a0b('0x46')](db[_0x1a0b('0x41')]['rawAttributes']);_0x23ee18[_0x1a0b('0x33')]=_['keys'](_0x44860a[_0x1a0b('0x33')]);_0x23ee18['filters']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],_0x23ee18[_0x1a0b('0x33')]);_0x1e54dc['attributes']=_[_0x1a0b('0x34')](_0x23ee18[_0x1a0b('0x32')],qs['fields'](_0x44860a[_0x1a0b('0x33')][_0x1a0b('0x35')]));_0x1e54dc[_0x1a0b('0x36')]=_0x1e54dc[_0x1a0b('0x36')][_0x1a0b('0x37')]?_0x1e54dc[_0x1a0b('0x36')]:_0x23ee18[_0x1a0b('0x32')];if(_0x44860a['query'][_0x1a0b('0x47')]){_0x1e54dc[_0x1a0b('0x48')]=[{'all':!![]}];}_0x1e54dc=_[_0x1a0b('0x49')]({},_0x1e54dc,_0x44860a[_0x1a0b('0x40')]);return db['CannedAnswer'][_0x1a0b('0x4a')](_0x1e54dc)[_0x1a0b('0x27')](handleEntityNotFound(_0x288174,null))['then'](respondWithResult(_0x288174,null))[_0x1a0b('0x44')](handleError(_0x288174,null));};exports['update']=function(_0x3a5ff2,_0x5959f5){if(_0x3a5ff2[_0x1a0b('0x4b')]['id']){delete _0x3a5ff2[_0x1a0b('0x4b')]['id'];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x3a5ff2[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x5959f5,null))[_0x1a0b('0x27')](saveUpdates(_0x3a5ff2[_0x1a0b('0x4b')],null))[_0x1a0b('0x27')](respondWithResult(_0x5959f5,null))['catch'](handleError(_0x5959f5,null));};exports[_0x1a0b('0x26')]=function(_0x26d3bb,_0x35c92e){return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':{'id':_0x26d3bb[_0x1a0b('0x45')]['id']}})[_0x1a0b('0x27')](handleEntityNotFound(_0x35c92e,null))[_0x1a0b('0x27')](removeEntity(_0x35c92e,null))[_0x1a0b('0x44')](handleError(_0x35c92e,null));};exports['create']=function(_0x41f977,_0x12f002){var _0x5ad145={'key':_0x41f977['body'][_0x1a0b('0x31')]};if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4c')]){_0x5ad145[_0x1a0b('0x4c')]=_0x41f977[_0x1a0b('0x4b')]['MailAccountId'];}else if(_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')]){_0x5ad145[_0x1a0b('0x4d')]=_0x41f977[_0x1a0b('0x4b')][_0x1a0b('0x4d')];}else if(_0x41f977['body'][_0x1a0b('0x4e')]){_0x5ad145['OpenchannelAccountId']=_0x41f977[_0x1a0b('0x4b')]['OpenchannelAccountId'];}else if(_0x41f977['body'][_0x1a0b('0x4f')]){_0x5ad145[_0x1a0b('0x4f')]=_0x41f977['body'][_0x1a0b('0x4f')];}return db[_0x1a0b('0x41')][_0x1a0b('0x4a')]({'where':_0x5ad145})[_0x1a0b('0x27')](function(_0x40ac6c){if(_0x40ac6c){throw new db['Sequelize'][(_0x1a0b('0x50'))](_0x1a0b('0x51'));}return db['CannedAnswer'][_0x1a0b('0x52')](_0x41f977['body']);})[_0x1a0b('0x27')](function(_0x33b2bd){var _0x2e7b88=_0x41f977[_0x1a0b('0x53')]['get']({'plain':!![]});if(!_0x2e7b88)throw new Error(_0x1a0b('0x54'));if(_0x2e7b88[_0x1a0b('0x55')]===_0x1a0b('0x53')){var _0x3ff29e=_0x33b2bd[_0x1a0b('0x28')]({'plain':!![]});return db[_0x1a0b('0x56')][_0x1a0b('0x4a')]({'where':{'name':_0x1a0b('0x29'),'userProfileId':_0x2e7b88[_0x1a0b('0x57')]},'raw':!![]})['then'](function(_0x3fee5a){if(_0x3fee5a&&_0x3fee5a['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a0b('0x52')]({'name':_0x3ff29e['name'],'resourceId':_0x3ff29e['id'],'type':_0x3fee5a[_0x1a0b('0x2d')],'sectionId':_0x3fee5a['id']},{})[_0x1a0b('0x27')](function(){return _0x33b2bd;});}else{return _0x33b2bd;}})['catch'](function(_0x56e434){logger[_0x1a0b('0x2b')](_0x1a0b('0x58'),_0x56e434);throw _0x56e434;});}return _0x33b2bd;})[_0x1a0b('0x27')](respondWithResult(_0x12f002,0xc9))[_0x1a0b('0x44')](handleError(_0x12f002,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 13924b5..5045c27 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 _0x05f8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x303ea4,_0x2acf5d){var _0x217134=function(_0x25ed99){while(--_0x25ed99){_0x303ea4['push'](_0x303ea4['shift']());}};_0x217134(++_0x2acf5d);}(_0x05f8,0x175));var _0x805f=function(_0x2dd8a1,_0x4add9e){_0x2dd8a1=_0x2dd8a1-0x0;var _0x3aeda=_0x05f8[_0x2dd8a1];return _0x3aeda;};'use strict';var _=require(_0x805f('0x0'));var util=require(_0x805f('0x1'));var logger=require(_0x805f('0x2'))('api');var moment=require(_0x805f('0x3'));var BPromise=require(_0x805f('0x4'));var rp=require(_0x805f('0x5'));var fs=require('fs');var path=require(_0x805f('0x6'));var rimraf=require(_0x805f('0x7'));var config=require(_0x805f('0x8'));var attributes=require(_0x805f('0x9'));module[_0x805f('0xa')]=function(_0x3e594c,_0x2f8466){return _0x3e594c[_0x805f('0xb')](_0x805f('0xc'),attributes,{'tableName':_0x805f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x805f('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8d84=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x8d84,0xfe));var _0x48d8=function(_0x35ff48,_0x50592f){_0x35ff48=_0x35ff48-0x0;var _0x2ab29f=_0x8d84[_0x35ff48];return _0x2ab29f;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x48d8('0x3'));var rp=require(_0x48d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d8('0x5'));var config=require(_0x48d8('0x6'));var attributes=require(_0x48d8('0x7'));module[_0x48d8('0x8')]=function(_0x3f1843,_0x8c1e97){return _0x3f1843[_0x48d8('0x9')](_0x48d8('0xa'),attributes,{'tableName':_0x48d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48d8('0xc'),'collate':_0x48d8('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 5ff9fad..aab88ca 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(_0x1766b2,_0x15827c){var _0x1f2955=function(_0x5dc0c2){while(--_0x5dc0c2){_0x1766b2['push'](_0x1766b2['shift']());}};_0x1f2955(++_0x15827c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x37350a,_0x400d32){var _0x43312a=function(_0x5173ab){while(--_0x5173ab){_0x37350a['push'](_0x37350a['shift']());}};_0x43312a(++_0x400d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 be22847..eab4542 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 _0x58c5=['./cannedAnswer.controller','get','isAuthenticated','index','show','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x122520,_0x57ff93){var _0x176d87=function(_0x333edf){while(--_0x333edf){_0x122520['push'](_0x122520['shift']());}};_0x176d87(++_0x57ff93);}(_0x58c5,0x1a9));var _0x558c=function(_0x4fab00,_0x14076a){_0x4fab00=_0x4fab00-0x0;var _0x4f67b2=_0x58c5[_0x4fab00];return _0x4f67b2;};'use strict';var multer=require(_0x558c('0x0'));var util=require(_0x558c('0x1'));var path=require('path');var timeout=require(_0x558c('0x2'));var express=require(_0x558c('0x3'));var router=express[_0x558c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x558c('0x5'));var interaction=require(_0x558c('0x6'));var config=require('../../config/environment');var controller=require(_0x558c('0x7'));router[_0x558c('0x8')]('/',auth[_0x558c('0x9')](),controller[_0x558c('0xa')]);router[_0x558c('0x8')]('/:id',auth[_0x558c('0x9')](),controller[_0x558c('0xb')]);router['post']('/',auth[_0x558c('0x9')](),controller['create']);router[_0x558c('0xc')](_0x558c('0xd'),auth[_0x558c('0x9')](),controller[_0x558c('0xe')]);router['delete'](_0x558c('0xd'),auth[_0x558c('0x9')](),controller[_0x558c('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0c56=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x25cb0a,_0x549fda){var _0x5483ac=function(_0x32eaa6){while(--_0x32eaa6){_0x25cb0a['push'](_0x25cb0a['shift']());}};_0x5483ac(++_0x549fda);}(_0x0c56,0x12b));var _0x60c5=function(_0x4fa8f2,_0x56d32d){_0x4fa8f2=_0x4fa8f2-0x0;var _0xbf88da=_0x0c56[_0x4fa8f2];return _0xbf88da;};'use strict';var multer=require(_0x60c5('0x0'));var util=require(_0x60c5('0x1'));var path=require('path');var timeout=require(_0x60c5('0x2'));var express=require(_0x60c5('0x3'));var router=express[_0x60c5('0x4')]();var fs_extra=require(_0x60c5('0x5'));var auth=require(_0x60c5('0x6'));var interaction=require(_0x60c5('0x7'));var config=require('../../config/environment');var controller=require(_0x60c5('0x8'));router[_0x60c5('0x9')]('/',auth[_0x60c5('0xa')](),controller[_0x60c5('0xb')]);router['get'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60c5('0xe')]);router[_0x60c5('0xf')](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x10')]);router['delete'](_0x60c5('0xc'),auth[_0x60c5('0xa')](),controller[_0x60c5('0x11')]);module[_0x60c5('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 6277e81..ce9d00e 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 _0x9010=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x9010,0xdf));var _0x0901=function(_0x3daff7,_0x2edcd4){_0x3daff7=_0x3daff7-0x0;var _0x5b4d5b=_0x9010[_0x3daff7];return _0x5b4d5b;};'use strict';var Sequelize=require(_0x0901('0x0'));module[_0x0901('0x1')]={'calldate':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':_0x0901('0x3')},'clid':{'type':Sequelize[_0x0901('0x4')]},'src':{'type':Sequelize[_0x0901('0x4')]},'dst':{'type':Sequelize[_0x0901('0x4')]},'dcontext':{'type':Sequelize[_0x0901('0x4')]},'channel':{'type':Sequelize[_0x0901('0x4')]},'dstchannel':{'type':Sequelize[_0x0901('0x4')]},'lastapp':{'type':Sequelize[_0x0901('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0901('0x4')]},'amaflags':{'type':Sequelize[_0x0901('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0901('0x4')]},'userfield':{'type':Sequelize[_0x0901('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0901('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0901('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x0901('0x4')]}};
\ No newline at end of file
+var _0xffaa=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x1e3c58,_0x4baead){var _0x2cd780=function(_0x2e4fe1){while(--_0x2e4fe1){_0x1e3c58['push'](_0x1e3c58['shift']());}};_0x2cd780(++_0x4baead);}(_0xffaa,0x130));var _0xaffa=function(_0x36510e,_0x148437){_0x36510e=_0x36510e-0x0;var _0xe732fd=_0xffaa[_0x36510e];return _0xe732fd;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'calldate':{'type':Sequelize[_0xaffa('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xaffa('0x3')]},'dst':{'type':Sequelize[_0xaffa('0x3')]},'dcontext':{'type':Sequelize[_0xaffa('0x3')]},'channel':{'type':Sequelize[_0xaffa('0x3')]},'dstchannel':{'type':Sequelize[_0xaffa('0x3')]},'lastapp':{'type':Sequelize[_0xaffa('0x3')]},'lastdata':{'type':Sequelize[_0xaffa('0x3')]},'duration':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaffa('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaffa('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaffa('0x3')]},'userfield':{'type':Sequelize[_0xaffa('0x3')]},'uniqueid':{'type':Sequelize[_0xaffa('0x3')]},'linkedid':{'type':Sequelize[_0xaffa('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xaffa('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xaffa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index a50066b..11e9f66 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 _0x5a5a=['options','where','Cdr','includeAll','include','rows','show','keys','catch','create','body','update','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','error','stack','send','index','map','rawAttributes','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','type'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x4f0f6d,_0x28b6f4){_0x4f0f6d=_0x4f0f6d-0x0;var _0x2b2c98=_0x5a5a[_0x4f0f6d];return _0x2b2c98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a5('0x0'));var zipdir=require(_0xa5a5('0x1'));var jsonpatch=require(_0xa5a5('0x2'));var rp=require(_0xa5a5('0x3'));var moment=require(_0xa5a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5a5('0x5'));var util=require(_0xa5a5('0x6'));var path=require(_0xa5a5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa5a5('0x8'));var fs=require('fs');var fs_extra=require(_0xa5a5('0x9'));var _=require('lodash');var squel=require(_0xa5a5('0xa'));var crypto=require(_0xa5a5('0xb'));var jsforce=require(_0xa5a5('0xc'));var deskjs=require(_0xa5a5('0xd'));var toCsv=require(_0xa5a5('0xe'));var querystring=require('querystring');var Papa=require(_0xa5a5('0xf'));var Redis=require(_0xa5a5('0x10'));var authService=require(_0xa5a5('0x11'));var qs=require(_0xa5a5('0x12'));var as=require(_0xa5a5('0x13'));var hardwareService=require(_0xa5a5('0x14'));var logger=require(_0xa5a5('0x15'))(_0xa5a5('0x16'));var utils=require(_0xa5a5('0x17'));var config=require(_0xa5a5('0x18'));var licenseUtil=require(_0xa5a5('0x19'));var db=require(_0xa5a5('0x1a'))['db'];function respondWithStatusCode(_0x567d9b,_0x245a65){_0x245a65=_0x245a65||0xcc;return function(_0x420b1d){if(_0x420b1d){return _0x567d9b[_0xa5a5('0x1b')](_0x245a65);}return _0x567d9b[_0xa5a5('0x1c')](_0x245a65)[_0xa5a5('0x1d')]();};}function respondWithResult(_0xa81eeb,_0x5d71e4){_0x5d71e4=_0x5d71e4||0xc8;return function(_0x3382c6){if(_0x3382c6){return _0xa81eeb[_0xa5a5('0x1c')](_0x5d71e4)[_0xa5a5('0x1e')](_0x3382c6);}};}function respondWithFilteredResult(_0x15370d,_0x2daae6){return function(_0x38305a){if(_0x38305a){var _0x1464d9=typeof _0x2daae6[_0xa5a5('0x1f')]==='undefined'&&typeof _0x2daae6[_0xa5a5('0x20')]===_0xa5a5('0x21');var _0x4571f5=_0x38305a[_0xa5a5('0x22')];var _0x3c4cae=_0x1464d9?0x0:_0x2daae6[_0xa5a5('0x1f')];var _0x28c89f=_0x1464d9?_0x38305a['count']:_0x2daae6[_0xa5a5('0x1f')]+_0x2daae6[_0xa5a5('0x20')];var _0x21488a;if(_0x28c89f>=_0x4571f5){_0x28c89f=_0x4571f5;_0x21488a=0xc8;}else{_0x21488a=0xce;}_0x15370d[_0xa5a5('0x1c')](_0x21488a);return _0x15370d['set'](_0xa5a5('0x23'),_0x3c4cae+'-'+_0x28c89f+'/'+_0x4571f5)['json'](_0x38305a);}return null;};}function patchUpdates(_0x2554c0){return function(_0x22774d){try{jsonpatch[_0xa5a5('0x24')](_0x22774d,_0x2554c0,!![]);}catch(_0x379f0d){return BPromise['reject'](_0x379f0d);}return _0x22774d['save']();};}function saveUpdates(_0x2001ed,_0x1a258f){return function(_0x417df3){if(_0x417df3){return _0x417df3['update'](_0x2001ed)[_0xa5a5('0x25')](function(_0x4b4613){return _0x4b4613;});}return null;};}function removeEntity(_0x337e52,_0x4996b3){return function(_0x4c0ff2){if(_0x4c0ff2){return _0x4c0ff2[_0xa5a5('0x26')]()[_0xa5a5('0x25')](function(){_0x337e52[_0xa5a5('0x1c')](0xcc)[_0xa5a5('0x1d')]();});}};}function handleEntityNotFound(_0x55ed28,_0x3583b1){return function(_0x54dfdc){if(!_0x54dfdc){_0x55ed28[_0xa5a5('0x1b')](0x194);}return _0x54dfdc;};}function handleError(_0xd37524,_0x516ccf){_0x516ccf=_0x516ccf||0x1f4;return function(_0x5ccc1e){logger[_0xa5a5('0x27')](_0x5ccc1e[_0xa5a5('0x28')]);if(_0x5ccc1e['name']){delete _0x5ccc1e['name'];}_0xd37524[_0xa5a5('0x1c')](_0x516ccf)[_0xa5a5('0x29')](_0x5ccc1e);};}exports[_0xa5a5('0x2a')]=function(_0x4d1201,_0x16fdd4){var _0x3bdd0a={},_0x58dc9e={},_0x122e3f={'count':0x0,'rows':[]};var _0x4d1eef=_[_0xa5a5('0x2b')](db['Cdr'][_0xa5a5('0x2c')],function(_0x190a33){return{'name':_0x190a33['fieldName'],'type':_0x190a33['type']['key']};});_0x58dc9e[_0xa5a5('0x2d')]=_['map'](_0x4d1eef,_0xa5a5('0x2e'));_0x58dc9e[_0xa5a5('0x2f')]=_['keys'](_0x4d1201[_0xa5a5('0x2f')]);_0x58dc9e[_0xa5a5('0x30')]=_['intersection'](_0x58dc9e[_0xa5a5('0x2d')],_0x58dc9e[_0xa5a5('0x2f')]);_0x3bdd0a[_0xa5a5('0x31')]=_[_0xa5a5('0x32')](_0x58dc9e[_0xa5a5('0x2d')],qs[_0xa5a5('0x33')](_0x4d1201[_0xa5a5('0x2f')]['fields']));_0x3bdd0a[_0xa5a5('0x31')]=_0x3bdd0a[_0xa5a5('0x31')][_0xa5a5('0x34')]?_0x3bdd0a[_0xa5a5('0x31')]:_0x58dc9e[_0xa5a5('0x2d')];if(!_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x35')](_0xa5a5('0x36'))){_0x3bdd0a[_0xa5a5('0x20')]=qs[_0xa5a5('0x20')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x20')]);_0x3bdd0a[_0xa5a5('0x1f')]=qs[_0xa5a5('0x1f')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x1f')]);}_0x3bdd0a[_0xa5a5('0x37')]=qs['sort'](_0x4d1201[_0xa5a5('0x2f')]['sort']);_0x3bdd0a['where']=qs['filters'](_[_0xa5a5('0x38')](_0x4d1201['query'],_0x58dc9e[_0xa5a5('0x30')]),_0x4d1eef);if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x39')]){_0x3bdd0a['where']=_[_0xa5a5('0x3a')](_0x3bdd0a['where'],{'$or':_['map'](_0x4d1eef,function(_0x43c2ff){if(_0x43c2ff[_0xa5a5('0x3b')]!=='VIRTUAL'){var _0x421255={};_0x421255[_0x43c2ff['name']]={'$like':'%'+_0x4d1201['query'][_0xa5a5('0x39')]+'%'};return _0x421255;}})});}_0x3bdd0a=_['merge']({},_0x3bdd0a,_0x4d1201[_0xa5a5('0x3c')]);var _0x53fe36={'where':_0x3bdd0a[_0xa5a5('0x3d')]};return db[_0xa5a5('0x3e')][_0xa5a5('0x22')](_0x53fe36)[_0xa5a5('0x25')](function(_0x71fb38){_0x122e3f[_0xa5a5('0x22')]=_0x71fb38;if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x3f')]){_0x3bdd0a[_0xa5a5('0x40')]=[{'all':!![]}];}return db[_0xa5a5('0x3e')]['findAll'](_0x3bdd0a);})[_0xa5a5('0x25')](function(_0x491532){_0x122e3f[_0xa5a5('0x41')]=_0x491532;return _0x122e3f;})[_0xa5a5('0x25')](respondWithFilteredResult(_0x16fdd4,_0x3bdd0a))['catch'](handleError(_0x16fdd4,null));};exports[_0xa5a5('0x42')]=function(_0x2717b3,_0x2373f4){var _0x3a2e7e={'raw':!![],'where':{'id':_0x2717b3['params']['id']}},_0x4780b9={};_0x4780b9[_0xa5a5('0x2d')]=_[_0xa5a5('0x43')](db['Cdr'][_0xa5a5('0x2c')]);_0x4780b9[_0xa5a5('0x2f')]=_[_0xa5a5('0x43')](_0x2717b3[_0xa5a5('0x2f')]);_0x4780b9[_0xa5a5('0x30')]=_[_0xa5a5('0x32')](_0x4780b9[_0xa5a5('0x2d')],_0x4780b9['query']);_0x3a2e7e[_0xa5a5('0x31')]=_['intersection'](_0x4780b9[_0xa5a5('0x2d')],qs['fields'](_0x2717b3['query'][_0xa5a5('0x33')]));_0x3a2e7e[_0xa5a5('0x31')]=_0x3a2e7e[_0xa5a5('0x31')]['length']?_0x3a2e7e[_0xa5a5('0x31')]:_0x4780b9['model'];if(_0x2717b3['query'][_0xa5a5('0x3f')]){_0x3a2e7e[_0xa5a5('0x40')]=[{'all':!![]}];}_0x3a2e7e=_[_0xa5a5('0x3a')]({},_0x3a2e7e,_0x2717b3['options']);return db[_0xa5a5('0x3e')]['find'](_0x3a2e7e)['then'](handleEntityNotFound(_0x2373f4,null))[_0xa5a5('0x25')](respondWithResult(_0x2373f4,null))[_0xa5a5('0x44')](handleError(_0x2373f4,null));};exports[_0xa5a5('0x45')]=function(_0x25091f,_0x268cfb){return db[_0xa5a5('0x3e')][_0xa5a5('0x45')](_0x25091f[_0xa5a5('0x46')],{})['then'](respondWithResult(_0x268cfb,0xc9))[_0xa5a5('0x44')](handleError(_0x268cfb,null));};exports[_0xa5a5('0x47')]=function(_0x2db032,_0x232bc5){if(_0x2db032[_0xa5a5('0x46')]['id']){delete _0x2db032[_0xa5a5('0x46')]['id'];}return db['Cdr'][_0xa5a5('0x48')]({'where':{'id':_0x2db032[_0xa5a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x232bc5,null))[_0xa5a5('0x25')](saveUpdates(_0x2db032[_0xa5a5('0x46')],null))[_0xa5a5('0x25')](respondWithResult(_0x232bc5,null))['catch'](handleError(_0x232bc5,null));};exports[_0xa5a5('0x26')]=function(_0x337949,_0x6ad8c9){return db[_0xa5a5('0x3e')]['find']({'where':{'id':_0x337949['params']['id']}})[_0xa5a5('0x25')](handleEntityNotFound(_0x6ad8c9,null))[_0xa5a5('0x25')](removeEntity(_0x6ad8c9,null))[_0xa5a5('0x44')](handleError(_0x6ad8c9,null));};exports['describe']=function(_0xe2dd58,_0x12d908){return db[_0xa5a5('0x3e')][_0xa5a5('0x4a')]()[_0xa5a5('0x25')](respondWithResult(_0x12d908,null))[_0xa5a5('0x44')](handleError(_0x12d908,null));};
\ No newline at end of file
+var _0x5fd1=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Cdr','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x13ee86,_0x501a7f){var _0x377722=function(_0x20ae4b){while(--_0x20ae4b){_0x13ee86['push'](_0x13ee86['shift']());}};_0x377722(++_0x501a7f);}(_0x5fd1,0x155));var _0x15fd=function(_0x2eff2d,_0x54ad03){_0x2eff2d=_0x2eff2d-0x0;var _0x48e190=_0x5fd1[_0x2eff2d];return _0x48e190;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['map'](_0x4590a1,_0x15fd('0x23'));_0x218034[_0x15fd('0x2b')]=_['keys'](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x218034[_0x15fd('0x2a')],_0x218034[_0x15fd('0x2b')]);_0x6c213b[_0x15fd('0x2e')]=_['intersection'](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x2f')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x2f')]));_0x6c213b['attributes']=_0x6c213b[_0x15fd('0x2e')][_0x15fd('0x30')]?_0x6c213b[_0x15fd('0x2e')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x31')]('nolimit')){_0x6c213b[_0x15fd('0x19')]=qs[_0x15fd('0x19')](_0x27d2c4['query'][_0x15fd('0x19')]);_0x6c213b[_0x15fd('0x1a')]=qs[_0x15fd('0x1a')](_0x27d2c4['query'][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x33')]);_0x6c213b[_0x15fd('0x34')]=qs['filters'](_['pick'](_0x27d2c4['query'],_0x218034[_0x15fd('0x2c')]),_0x4590a1);if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x35')]){_0x6c213b['where']=_['merge'](_0x6c213b[_0x15fd('0x34')],{'$or':_['map'](_0x4590a1,function(_0x4f1c84){if(_0x4f1c84['type']!==_0x15fd('0x36')){var _0x10702c={};_0x10702c[_0x4f1c84[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4['query'][_0x15fd('0x35')]+'%'};return _0x10702c;}})});}_0x6c213b=_[_0x15fd('0x37')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x38')]);var _0x5beb6e={'where':_0x6c213b[_0x15fd('0x34')]};return db[_0x15fd('0x27')][_0x15fd('0x39')](_0x5beb6e)[_0x15fd('0x1f')](function(_0x2e8b0a){_0xe650a3[_0x15fd('0x39')]=_0x2e8b0a;if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x6c213b[_0x15fd('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x15fd('0x3c')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x180433){_0xe650a3[_0x15fd('0x3d')]=_0x180433;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x3e')](handleError(_0x233ed3,null));};exports[_0x15fd('0x3f')]=function(_0xda4ca2,_0x343ce6){var _0x104eef={'raw':!![],'where':{'id':_0xda4ca2[_0x15fd('0x40')]['id']}},_0x2eb6b6={};_0x2eb6b6[_0x15fd('0x2a')]=_[_0x15fd('0x41')](db[_0x15fd('0x27')]['rawAttributes']);_0x2eb6b6[_0x15fd('0x2b')]=_[_0x15fd('0x41')](_0xda4ca2[_0x15fd('0x2b')]);_0x2eb6b6[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x2eb6b6[_0x15fd('0x2a')],_0x2eb6b6[_0x15fd('0x2b')]);_0x104eef[_0x15fd('0x2e')]=_['intersection'](_0x2eb6b6['model'],qs[_0x15fd('0x2f')](_0xda4ca2['query'][_0x15fd('0x2f')]));_0x104eef[_0x15fd('0x2e')]=_0x104eef['attributes'][_0x15fd('0x30')]?_0x104eef[_0x15fd('0x2e')]:_0x2eb6b6[_0x15fd('0x2a')];if(_0xda4ca2[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x104eef[_0x15fd('0x3b')]=[{'all':!![]}];}_0x104eef=_['merge']({},_0x104eef,_0xda4ca2[_0x15fd('0x38')]);return db[_0x15fd('0x27')][_0x15fd('0x42')](_0x104eef)[_0x15fd('0x1f')](handleEntityNotFound(_0x343ce6,null))[_0x15fd('0x1f')](respondWithResult(_0x343ce6,null))[_0x15fd('0x3e')](handleError(_0x343ce6,null));};exports[_0x15fd('0x43')]=function(_0xffc5dc,_0x24cb44){return db[_0x15fd('0x27')][_0x15fd('0x43')](_0xffc5dc[_0x15fd('0x44')],{})['then'](respondWithResult(_0x24cb44,0xc9))[_0x15fd('0x3e')](handleError(_0x24cb44,null));};exports['update']=function(_0x284f51,_0x34c250){if(_0x284f51[_0x15fd('0x44')]['id']){delete _0x284f51['body']['id'];}return db[_0x15fd('0x27')][_0x15fd('0x42')]({'where':{'id':_0x284f51[_0x15fd('0x40')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x34c250,null))['then'](saveUpdates(_0x284f51[_0x15fd('0x44')],null))[_0x15fd('0x1f')](respondWithResult(_0x34c250,null))[_0x15fd('0x3e')](handleError(_0x34c250,null));};exports[_0x15fd('0x20')]=function(_0x4b6827,_0x56c6be){return db[_0x15fd('0x27')]['find']({'where':{'id':_0x4b6827['params']['id']}})['then'](handleEntityNotFound(_0x56c6be,null))[_0x15fd('0x1f')](removeEntity(_0x56c6be,null))[_0x15fd('0x3e')](handleError(_0x56c6be,null));};exports[_0x15fd('0x45')]=function(_0x10cf04,_0x292174){return db[_0x15fd('0x27')]['describe']()[_0x15fd('0x1f')](respondWithResult(_0x292174,null))[_0x15fd('0x3e')](handleError(_0x292174,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b32d40e..3743ec4 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xb0bd2,_0x2621b8){var _0x1347b2=function(_0x7686a2){while(--_0x7686a2){_0xb0bd2['push'](_0xb0bd2['shift']());}};_0x1347b2(++_0x2621b8);}(_0x7a54,0x106));var _0x47a5=function(_0x2d30e6,_0x2e6584){_0x2d30e6=_0x2d30e6-0x0;var _0x2c1182=_0x7a54[_0x2d30e6];return _0x2c1182;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x7e27c6,_0x16811a){var _0x4efe01=function(_0x466a72){while(--_0x466a72){_0x7e27c6['push'](_0x7e27c6['shift']());}};_0x4efe01(++_0x16811a);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 42f771b..f452038 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 _0x25c4=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','util'];(function(_0x33f0df,_0x38da56){var _0x5e10ea=function(_0x16cdad){while(--_0x16cdad){_0x33f0df['push'](_0x33f0df['shift']());}};_0x5e10ea(++_0x38da56);}(_0x25c4,0x1c7));var _0x425c=function(_0x5945d3,_0x42c4a1){_0x5945d3=_0x5945d3-0x0;var _0xe3819a=_0x25c4[_0x5945d3];return _0xe3819a;};'use strict';var _=require('lodash');var util=require(_0x425c('0x0'));var moment=require(_0x425c('0x1'));var BPromise=require(_0x425c('0x2'));var rs=require(_0x425c('0x3'));var fs=require('fs');var Redis=require(_0x425c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x425c('0x5'));var config=require('../../config/environment');var jayson=require(_0x425c('0x6'));var client=jayson[_0x425c('0x7')][_0x425c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51bd0f,_0x10afbf,_0x80d41e){return new BPromise(function(_0x254d36,_0x317548){return client[_0x425c('0x9')](_0x51bd0f,_0x80d41e)[_0x425c('0xa')](function(_0x155912){logger[_0x425c('0xb')](_0x425c('0xc'),_0x10afbf,'request\x20sent');logger[_0x425c('0xd')](_0x425c('0xe'),_0x10afbf,'request\x20sent',JSON['stringify'](_0x155912));if(_0x155912[_0x425c('0xf')]){if(_0x155912[_0x425c('0xf')]['code']===0x1f4){logger[_0x425c('0xf')]('Cdr,\x20%s,\x20%s',_0x10afbf,_0x155912['error']['message']);return _0x317548(_0x155912[_0x425c('0xf')]['message']);}logger[_0x425c('0xf')](_0x425c('0xc'),_0x10afbf,_0x155912['error'][_0x425c('0x10')]);return _0x254d36(_0x155912[_0x425c('0xf')][_0x425c('0x10')]);}else{logger[_0x425c('0xb')](_0x425c('0xc'),_0x10afbf,_0x425c('0x11'));_0x254d36(_0x155912[_0x425c('0x12')]['message']);}})['catch'](function(_0x58d52e){logger['error'](_0x425c('0xc'),_0x10afbf,_0x58d52e);_0x317548(_0x58d52e);});});}
\ No newline at end of file
+var _0x9df4=['jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9df4,0x174));var _0x49df=function(_0x60369b,_0x525315){_0x60369b=_0x60369b-0x0;var _0x3c9e8e=_0x9df4[_0x60369b];return _0x3c9e8e;};'use strict';var _=require(_0x49df('0x0'));var util=require(_0x49df('0x1'));var moment=require(_0x49df('0x2'));var BPromise=require(_0x49df('0x3'));var rs=require(_0x49df('0x4'));var fs=require('fs');var Redis=require(_0x49df('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49df('0x6'))('rpc');var config=require(_0x49df('0x7'));var jayson=require(_0x49df('0x8'));var client=jayson['client'][_0x49df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f54fc,_0x5b9cba,_0x371b9a){return new BPromise(function(_0x183488,_0x2d6324){return client[_0x49df('0xa')](_0x5f54fc,_0x371b9a)[_0x49df('0xb')](function(_0x1a28d7){logger[_0x49df('0xc')]('Cdr,\x20%s,\x20%s',_0x5b9cba,'request\x20sent');logger[_0x49df('0xd')](_0x49df('0xe'),_0x5b9cba,'request\x20sent',JSON['stringify'](_0x1a28d7));if(_0x1a28d7['error']){if(_0x1a28d7[_0x49df('0xf')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7['error'][_0x49df('0x10')]);return _0x2d6324(_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);}logger[_0x49df('0xf')]('Cdr,\x20%s,\x20%s',_0x5b9cba,_0x1a28d7[_0x49df('0xf')][_0x49df('0x10')]);return _0x183488(_0x1a28d7[_0x49df('0xf')]['message']);}else{logger[_0x49df('0xc')](_0x49df('0x11'),_0x5b9cba,'request\x20sent');_0x183488(_0x1a28d7[_0x49df('0x12')][_0x49df('0x10')]);}})[_0x49df('0x13')](function(_0x33abd3){logger[_0x49df('0xf')](_0x49df('0x11'),_0x5b9cba,_0x33abd3);_0x2d6324(_0x33abd3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 7126b4a..30697e4 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x530ddb,_0x3008f8){var _0x4fa295=function(_0x552364){while(--_0x552364){_0x530ddb['push'](_0x530ddb['shift']());}};_0x4fa295(++_0x3008f8);}(_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 b9e1128..e30946c 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 _0x53c7=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0x53c7,0xf2));var _0x753c=function(_0x39106a,_0x5e6163){_0x39106a=_0x39106a-0x0;var _0x4d828a=_0x53c7[_0x39106a];return _0x4d828a;};'use strict';var Sequelize=require(_0x753c('0x0'));module[_0x753c('0x1')]={'priority':{'type':Sequelize[_0x753c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x753c('0x3')],'allowNull':![],'defaultValue':_0x753c('0x4')},'appdata':{'type':Sequelize[_0x753c('0x5')]()},'description':{'type':Sequelize[_0x753c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x9c3f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x9c3f,0xbb));var _0xf9c3=function(_0x1b3e4a,_0x4f5a24){_0x1b3e4a=_0x1b3e4a-0x0;var _0x1d0eed=_0x9c3f[_0x1b3e4a];return _0x1d0eed;};'use strict';var Sequelize=require(_0xf9c3('0x0'));module[_0xf9c3('0x1')]={'priority':{'type':Sequelize[_0xf9c3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf9c3('0x3')],'allowNull':![],'defaultValue':_0xf9c3('0x4')},'appdata':{'type':Sequelize[_0xf9c3('0x5')]()},'description':{'type':Sequelize[_0xf9c3('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index eeaf8a8..492e388 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 _0x0aaf=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','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','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','length','attributes','includeAll','merge','options','find','catch','body'];(function(_0x16875a,_0x2eca82){var _0x377cab=function(_0x338ee1){while(--_0x338ee1){_0x16875a['push'](_0x16875a['shift']());}};_0x377cab(++_0x2eca82);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x0aaf[_0x5774be];return _0x4914b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0aa('0x0'));var jsonpatch=require(_0xf0aa('0x1'));var rp=require(_0xf0aa('0x2'));var moment=require(_0xf0aa('0x3'));var BPromise=require(_0xf0aa('0x4'));var Mustache=require('mustache');var util=require(_0xf0aa('0x5'));var path=require(_0xf0aa('0x6'));var sox=require('sox');var csv=require(_0xf0aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0aa('0x8'));var _=require('lodash');var squel=require(_0xf0aa('0x9'));var crypto=require(_0xf0aa('0xa'));var jsforce=require(_0xf0aa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf0aa('0x7'));var querystring=require(_0xf0aa('0xc'));var Papa=require('papaparse');var Redis=require(_0xf0aa('0xd'));var authService=require(_0xf0aa('0xe'));var qs=require(_0xf0aa('0xf'));var as=require(_0xf0aa('0x10'));var hardwareService=require(_0xf0aa('0x11'));var logger=require(_0xf0aa('0x12'))(_0xf0aa('0x13'));var utils=require(_0xf0aa('0x14'));var config=require(_0xf0aa('0x15'));var licenseUtil=require(_0xf0aa('0x16'));var db=require(_0xf0aa('0x17'))['db'];function respondWithStatusCode(_0x40b5be,_0x47961e){_0x47961e=_0x47961e||0xcc;return function(_0x4f8622){if(_0x4f8622){return _0x40b5be[_0xf0aa('0x18')](_0x47961e);}return _0x40b5be[_0xf0aa('0x19')](_0x47961e)['end']();};}function respondWithResult(_0x4dc456,_0x37a6ac){_0x37a6ac=_0x37a6ac||0xc8;return function(_0x51bb2c){if(_0x51bb2c){return _0x4dc456[_0xf0aa('0x19')](_0x37a6ac)['json'](_0x51bb2c);}};}function respondWithFilteredResult(_0x22bb2e,_0x4b6219){return function(_0x3fb1fe){if(_0x3fb1fe){var _0x114c96=typeof _0x4b6219[_0xf0aa('0x1a')]===_0xf0aa('0x1b')&&typeof _0x4b6219[_0xf0aa('0x1c')]===_0xf0aa('0x1b');var _0x34e6f7=_0x3fb1fe[_0xf0aa('0x1d')];var _0x4e3fe6=_0x114c96?0x0:_0x4b6219[_0xf0aa('0x1a')];var _0x30f055=_0x114c96?_0x3fb1fe['count']:_0x4b6219[_0xf0aa('0x1a')]+_0x4b6219[_0xf0aa('0x1c')];var _0x35f407;if(_0x30f055>=_0x34e6f7){_0x30f055=_0x34e6f7;_0x35f407=0xc8;}else{_0x35f407=0xce;}_0x22bb2e[_0xf0aa('0x19')](_0x35f407);return _0x22bb2e[_0xf0aa('0x1e')](_0xf0aa('0x1f'),_0x4e3fe6+'-'+_0x30f055+'/'+_0x34e6f7)['json'](_0x3fb1fe);}return null;};}function patchUpdates(_0x112980){return function(_0x227cba){try{jsonpatch[_0xf0aa('0x20')](_0x227cba,_0x112980,!![]);}catch(_0x388893){return BPromise[_0xf0aa('0x21')](_0x388893);}return _0x227cba[_0xf0aa('0x22')]();};}function saveUpdates(_0x49e9fc,_0x5e2470){return function(_0x4c6f86){if(_0x4c6f86){return _0x4c6f86[_0xf0aa('0x23')](_0x49e9fc)['then'](function(_0xc4e56c){return _0xc4e56c;});}return null;};}function removeEntity(_0x245e0c,_0x40cbbb){return function(_0x2983ee){if(_0x2983ee){return _0x2983ee[_0xf0aa('0x24')]()[_0xf0aa('0x25')](function(){_0x245e0c[_0xf0aa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169a07,_0x3c21fc){return function(_0x44a7bf){if(!_0x44a7bf){_0x169a07[_0xf0aa('0x18')](0x194);}return _0x44a7bf;};}function handleError(_0x74188d,_0x1dc140){_0x1dc140=_0x1dc140||0x1f4;return function(_0x17b7f6){logger[_0xf0aa('0x26')](_0x17b7f6['stack']);if(_0x17b7f6['name']){delete _0x17b7f6[_0xf0aa('0x27')];}_0x74188d['status'](_0x1dc140)[_0xf0aa('0x28')](_0x17b7f6);};}exports['show']=function(_0x403ac2,_0x381179){var _0x4d2c9b={'raw':!![],'where':{'id':_0x403ac2[_0xf0aa('0x29')]['id']}},_0x56b555={};_0x56b555[_0xf0aa('0x2a')]=_[_0xf0aa('0x2b')](db[_0xf0aa('0x2c')][_0xf0aa('0x2d')]);_0x56b555[_0xf0aa('0x2e')]=_[_0xf0aa('0x2b')](_0x403ac2[_0xf0aa('0x2e')]);_0x56b555['filters']=_[_0xf0aa('0x2f')](_0x56b555[_0xf0aa('0x2a')],_0x56b555['query']);_0x4d2c9b['attributes']=_['intersection'](_0x56b555[_0xf0aa('0x2a')],qs[_0xf0aa('0x30')](_0x403ac2['query'][_0xf0aa('0x30')]));_0x4d2c9b['attributes']=_0x4d2c9b['attributes'][_0xf0aa('0x31')]?_0x4d2c9b[_0xf0aa('0x32')]:_0x56b555['model'];if(_0x403ac2[_0xf0aa('0x2e')][_0xf0aa('0x33')]){_0x4d2c9b['include']=[{'all':!![]}];}_0x4d2c9b=_[_0xf0aa('0x34')]({},_0x4d2c9b,_0x403ac2[_0xf0aa('0x35')]);return db[_0xf0aa('0x2c')][_0xf0aa('0x36')](_0x4d2c9b)[_0xf0aa('0x25')](handleEntityNotFound(_0x381179,null))[_0xf0aa('0x25')](respondWithResult(_0x381179,null))[_0xf0aa('0x37')](handleError(_0x381179,null));};exports['update']=function(_0x1cac5f,_0x5d539b){if(_0x1cac5f[_0xf0aa('0x38')]['id']){delete _0x1cac5f[_0xf0aa('0x38')]['id'];}return db[_0xf0aa('0x2c')][_0xf0aa('0x36')]({'where':{'id':_0x1cac5f['params']['id']}})[_0xf0aa('0x25')](handleEntityNotFound(_0x5d539b,null))['then'](saveUpdates(_0x1cac5f[_0xf0aa('0x38')],null))[_0xf0aa('0x25')](respondWithResult(_0x5d539b,null))[_0xf0aa('0x37')](handleError(_0x5d539b,null));};exports[_0xf0aa('0x24')]=function(_0x113314,_0x80d5cc){return db[_0xf0aa('0x2c')]['find']({'where':{'id':_0x113314[_0xf0aa('0x29')]['id']}})[_0xf0aa('0x25')](handleEntityNotFound(_0x80d5cc,null))[_0xf0aa('0x25')](removeEntity(_0x80d5cc,null))[_0xf0aa('0x37')](handleError(_0x80d5cc,null));};
\ No newline at end of file
+var _0x9649=['show','params','model','keys','query','attributes','fields','include','merge','options','find','catch','update','body','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','error','stack','send'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9649,0x118));var _0x9964=function(_0x4adbbc,_0x2b98ce){_0x4adbbc=_0x4adbbc-0x0;var _0x3b9187=_0x9649[_0x4adbbc];return _0x3b9187;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6ff,_0x4ef5c5){_0x4ef5c5=_0x4ef5c5||0xcc;return function(_0x1b8afa){if(_0x1b8afa){return _0x2bd6ff[_0x9964('0x16')](_0x4ef5c5);}return _0x2bd6ff[_0x9964('0x17')](_0x4ef5c5)[_0x9964('0x18')]();};}function respondWithResult(_0x22f5ce,_0x360a02){_0x360a02=_0x360a02||0xc8;return function(_0x44ce20){if(_0x44ce20){return _0x22f5ce['status'](_0x360a02)['json'](_0x44ce20);}};}function respondWithFilteredResult(_0x37f137,_0x2be683){return function(_0x561571){if(_0x561571){var _0x416340=typeof _0x2be683[_0x9964('0x19')]===_0x9964('0x1a')&&typeof _0x2be683[_0x9964('0x1b')]===_0x9964('0x1a');var _0x2c12f8=_0x561571['count'];var _0x2a7a61=_0x416340?0x0:_0x2be683[_0x9964('0x19')];var _0x58f157=_0x416340?_0x561571['count']:_0x2be683['offset']+_0x2be683[_0x9964('0x1b')];var _0xc4c0fe;if(_0x58f157>=_0x2c12f8){_0x58f157=_0x2c12f8;_0xc4c0fe=0xc8;}else{_0xc4c0fe=0xce;}_0x37f137[_0x9964('0x17')](_0xc4c0fe);return _0x37f137[_0x9964('0x1c')]('Content-Range',_0x2a7a61+'-'+_0x58f157+'/'+_0x2c12f8)[_0x9964('0x1d')](_0x561571);}return null;};}function patchUpdates(_0x5f2bbd){return function(_0x470a8d){try{jsonpatch[_0x9964('0x1e')](_0x470a8d,_0x5f2bbd,!![]);}catch(_0x209929){return BPromise[_0x9964('0x1f')](_0x209929);}return _0x470a8d[_0x9964('0x20')]();};}function saveUpdates(_0xea9fc2,_0x4053ad){return function(_0x341c56){if(_0x341c56){return _0x341c56['update'](_0xea9fc2)[_0x9964('0x21')](function(_0x3069d7){return _0x3069d7;});}return null;};}function removeEntity(_0x1629f9,_0x30ccf7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x9964('0x22')]()[_0x9964('0x21')](function(){_0x1629f9[_0x9964('0x17')](0xcc)[_0x9964('0x18')]();});}};}function handleEntityNotFound(_0x4be822,_0x5d4a5e){return function(_0x3911e0){if(!_0x3911e0){_0x4be822[_0x9964('0x16')](0x194);}return _0x3911e0;};}function handleError(_0x2dafcc,_0x96bee0){_0x96bee0=_0x96bee0||0x1f4;return function(_0xd48c01){logger[_0x9964('0x23')](_0xd48c01[_0x9964('0x24')]);if(_0xd48c01['name']){delete _0xd48c01['name'];}_0x2dafcc[_0x9964('0x17')](_0x96bee0)[_0x9964('0x25')](_0xd48c01);};}exports[_0x9964('0x26')]=function(_0x16ec83,_0x47d0d4){var _0x201656={'raw':!![],'where':{'id':_0x16ec83[_0x9964('0x27')]['id']}},_0x3a59df={};_0x3a59df[_0x9964('0x28')]=_[_0x9964('0x29')](db['ChatApplication']['rawAttributes']);_0x3a59df[_0x9964('0x2a')]=_[_0x9964('0x29')](_0x16ec83['query']);_0x3a59df['filters']=_['intersection'](_0x3a59df[_0x9964('0x28')],_0x3a59df[_0x9964('0x2a')]);_0x201656[_0x9964('0x2b')]=_['intersection'](_0x3a59df[_0x9964('0x28')],qs[_0x9964('0x2c')](_0x16ec83[_0x9964('0x2a')][_0x9964('0x2c')]));_0x201656[_0x9964('0x2b')]=_0x201656[_0x9964('0x2b')]['length']?_0x201656[_0x9964('0x2b')]:_0x3a59df[_0x9964('0x28')];if(_0x16ec83[_0x9964('0x2a')]['includeAll']){_0x201656[_0x9964('0x2d')]=[{'all':!![]}];}_0x201656=_[_0x9964('0x2e')]({},_0x201656,_0x16ec83[_0x9964('0x2f')]);return db['ChatApplication'][_0x9964('0x30')](_0x201656)[_0x9964('0x21')](handleEntityNotFound(_0x47d0d4,null))[_0x9964('0x21')](respondWithResult(_0x47d0d4,null))[_0x9964('0x31')](handleError(_0x47d0d4,null));};exports[_0x9964('0x32')]=function(_0xa1cf0b,_0x113c6b){if(_0xa1cf0b[_0x9964('0x33')]['id']){delete _0xa1cf0b[_0x9964('0x33')]['id'];}return db[_0x9964('0x34')][_0x9964('0x30')]({'where':{'id':_0xa1cf0b[_0x9964('0x27')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x113c6b,null))[_0x9964('0x21')](saveUpdates(_0xa1cf0b[_0x9964('0x33')],null))[_0x9964('0x21')](respondWithResult(_0x113c6b,null))[_0x9964('0x31')](handleError(_0x113c6b,null));};exports[_0x9964('0x22')]=function(_0x539d3d,_0xfe79a3){return db['ChatApplication'][_0x9964('0x30')]({'where':{'id':_0x539d3d[_0x9964('0x27')]['id']}})['then'](handleEntityNotFound(_0xfe79a3,null))[_0x9964('0x21')](removeEntity(_0xfe79a3,null))['catch'](handleError(_0xfe79a3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3161fb4..cd9298b 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 _0xa382=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xa382,0x1cd));var _0x2a38=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa382[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a38('0x0'))(_0x2a38('0x1'));var moment=require('moment');var BPromise=require(_0x2a38('0x2'));var rp=require(_0x2a38('0x3'));var fs=require('fs');var path=require(_0x2a38('0x4'));var rimraf=require(_0x2a38('0x5'));var config=require(_0x2a38('0x6'));var attributes=require(_0x2a38('0x7'));module[_0x2a38('0x8')]=function(_0x5e13d9,_0x308006){return _0x5e13d9[_0x2a38('0x9')](_0x2a38('0xa'),attributes,{'tableName':_0x2a38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a38('0xc'),'collate':_0x2a38('0xd')});};
\ No newline at end of file
+var _0x241d=['chat_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x241d,0x64));var _0xd241=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x241d[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xd241('0x0'));var util=require('util');var logger=require(_0xd241('0x1'))(_0xd241('0x2'));var moment=require(_0xd241('0x3'));var BPromise=require(_0xd241('0x4'));var rp=require(_0xd241('0x5'));var fs=require('fs');var path=require(_0xd241('0x6'));var rimraf=require(_0xd241('0x7'));var config=require(_0xd241('0x8'));var attributes=require(_0xd241('0x9'));module[_0xd241('0xa')]=function(_0x2eb97f,_0x4e6ad3){return _0x2eb97f[_0xd241('0xb')]('ChatApplication',attributes,{'tableName':_0xd241('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd241('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d311b37..d370556 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 _0x3749=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x58ce7f,_0x964681){var _0x21ef99=function(_0x3146eb){while(--_0x3146eb){_0x58ce7f['push'](_0x58ce7f['shift']());}};_0x21ef99(++_0x964681);}(_0x3749,0xf2));var _0x9374=function(_0x58be0a,_0x3472a4){_0x58be0a=_0x58be0a-0x0;var _0x11bfa9=_0x3749[_0x58be0a];return _0x11bfa9;};'use strict';var _=require(_0x9374('0x0'));var util=require('util');var moment=require(_0x9374('0x1'));var BPromise=require(_0x9374('0x2'));var rs=require(_0x9374('0x3'));var fs=require('fs');var Redis=require(_0x9374('0x4'));var db=require(_0x9374('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9374('0x6'))(_0x9374('0x7'));var config=require(_0x9374('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9374('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xff7f80,_0x2f861c,_0xf07c72){return new BPromise(function(_0xd56cca,_0x50951e){return client[_0x9374('0xa')](_0xff7f80,_0xf07c72)['then'](function(_0x221cc1){logger[_0x9374('0xb')](_0x9374('0xc'),_0x2f861c,'request\x20sent');logger[_0x9374('0xd')](_0x9374('0xe'),_0x2f861c,_0x9374('0xf'),JSON[_0x9374('0x10')](_0x221cc1));if(_0x221cc1[_0x9374('0x11')]){if(_0x221cc1['error'][_0x9374('0x12')]===0x1f4){logger[_0x9374('0x11')](_0x9374('0xc'),_0x2f861c,_0x221cc1[_0x9374('0x11')][_0x9374('0x13')]);return _0x50951e(_0x221cc1[_0x9374('0x11')]['message']);}logger[_0x9374('0x11')](_0x9374('0xc'),_0x2f861c,_0x221cc1[_0x9374('0x11')][_0x9374('0x13')]);return _0xd56cca(_0x221cc1[_0x9374('0x11')][_0x9374('0x13')]);}else{logger[_0x9374('0xb')](_0x9374('0xc'),_0x2f861c,_0x9374('0xf'));_0xd56cca(_0x221cc1[_0x9374('0x14')][_0x9374('0x13')]);}})[_0x9374('0x15')](function(_0x1e9235){logger[_0x9374('0x11')](_0x9374('0xc'),_0x2f861c,_0x1e9235);_0x50951e(_0x1e9235);});});}
\ No newline at end of file
+var _0x7be5=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x284d28,_0x327da6){var _0x440af8=function(_0x4550fe){while(--_0x4550fe){_0x284d28['push'](_0x284d28['shift']());}};_0x440af8(++_0x327da6);}(_0x7be5,0x166));var _0x57be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7be5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57be('0x0'));var util=require(_0x57be('0x1'));var moment=require(_0x57be('0x2'));var BPromise=require(_0x57be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57be('0x4'));var db=require(_0x57be('0x5'))['db'];var utils=require(_0x57be('0x6'));var logger=require(_0x57be('0x7'))(_0x57be('0x8'));var config=require(_0x57be('0x9'));var jayson=require(_0x57be('0xa'));var client=jayson[_0x57be('0xb')][_0x57be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45d877,_0x1a798f,_0x2cf4e2){return new BPromise(function(_0x2ba136,_0x255cf3){return client[_0x57be('0xd')](_0x45d877,_0x2cf4e2)[_0x57be('0xe')](function(_0x50d68f){logger[_0x57be('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'));logger[_0x57be('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1a798f,_0x57be('0x10'),JSON[_0x57be('0x12')](_0x50d68f));if(_0x50d68f['error']){if(_0x50d68f[_0x57be('0x13')][_0x57be('0x14')]===0x1f4){logger['error'](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x255cf3(_0x50d68f['error'][_0x57be('0x16')]);}logger[_0x57be('0x13')](_0x57be('0x15'),_0x1a798f,_0x50d68f[_0x57be('0x13')][_0x57be('0x16')]);return _0x2ba136(_0x50d68f[_0x57be('0x13')]['message']);}else{logger[_0x57be('0xf')](_0x57be('0x15'),_0x1a798f,_0x57be('0x10'));_0x2ba136(_0x50d68f['result'][_0x57be('0x16')]);}})[_0x57be('0x17')](function(_0x23614a){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1a798f,_0x23614a);_0x255cf3(_0x23614a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 598f21f..c492f81 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 _0x14dd=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update','delete','destroy','exports'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x14dd,0x165));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd14d('0x0'));var util=require(_0xd14d('0x1'));var path=require('path');var timeout=require(_0xd14d('0x2'));var express=require(_0xd14d('0x3'));var router=express[_0xd14d('0x4')]();var fs_extra=require(_0xd14d('0x5'));var auth=require(_0xd14d('0x6'));var interaction=require(_0xd14d('0x7'));var config=require(_0xd14d('0x8'));var controller=require(_0xd14d('0x9'));router['get'](_0xd14d('0xa'),auth[_0xd14d('0xb')](),controller['show']);router[_0xd14d('0xc')](_0xd14d('0xa'),auth[_0xd14d('0xb')](),controller[_0xd14d('0xd')]);router[_0xd14d('0xe')]('/:id',auth[_0xd14d('0xb')](),controller[_0xd14d('0xf')]);module[_0xd14d('0x10')]=router;
\ No newline at end of file
+var _0x8985=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update','exports','multer','util','connect-timeout'];(function(_0x13107e,_0x35c767){var _0xad7d95=function(_0x330ca8){while(--_0x330ca8){_0x13107e['push'](_0x13107e['shift']());}};_0xad7d95(++_0x35c767);}(_0x8985,0x6d));var _0x5898=function(_0x460133,_0x4cda19){_0x460133=_0x460133-0x0;var _0x523f40=_0x8985[_0x460133];return _0x523f40;};'use strict';var multer=require(_0x5898('0x0'));var util=require(_0x5898('0x1'));var path=require('path');var timeout=require(_0x5898('0x2'));var express=require(_0x5898('0x3'));var router=express[_0x5898('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5898('0x5'));var interaction=require(_0x5898('0x6'));var config=require(_0x5898('0x7'));var controller=require(_0x5898('0x8'));router['get'](_0x5898('0x9'),auth[_0x5898('0xa')](),controller['show']);router[_0x5898('0xb')]('/:id',auth[_0x5898('0xa')](),controller[_0x5898('0xc')]);router['delete'](_0x5898('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5898('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 0c76ed8..800a574 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 _0x4ba1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4ba1,0x159));var _0x14ba=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4ba1[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x14ba('0x0'));module[_0x14ba('0x1')]={'name':{'type':Sequelize[_0x14ba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x14ba('0x2')]},'write':{'type':Sequelize[_0x14ba('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x489e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x489e,0x184));var _0xe489=function(_0x255493,_0x212e2b){_0x255493=_0x255493-0x0;var _0x564f94=_0x489e[_0x255493];return _0x564f94;};'use strict';var Sequelize=require(_0xe489('0x0'));module[_0xe489('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe489('0x2')]},'write':{'type':Sequelize[_0xe489('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index c205cb3..023aa2d 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 _0xc980=['then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','findAll','rows','catch','params','include','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update'];(function(_0x42e3e3,_0x38d01b){var _0x3c14cb=function(_0x5eb64e){while(--_0x5eb64e){_0x42e3e3['push'](_0x42e3e3['shift']());}};_0x3c14cb(++_0x38d01b);}(_0xc980,0x109));var _0x0c98=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xc980[_0x14d896];return _0x28679a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c98('0x0'));var zipdir=require(_0x0c98('0x1'));var jsonpatch=require(_0x0c98('0x2'));var rp=require(_0x0c98('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c98('0x4'));var util=require(_0x0c98('0x5'));var path=require(_0x0c98('0x6'));var sox=require(_0x0c98('0x7'));var csv=require('to-csv');var ejs=require(_0x0c98('0x8'));var fs=require('fs');var fs_extra=require(_0x0c98('0x9'));var _=require(_0x0c98('0xa'));var squel=require(_0x0c98('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c98('0xc'));var deskjs=require(_0x0c98('0xd'));var toCsv=require(_0x0c98('0xe'));var querystring=require(_0x0c98('0xf'));var Papa=require('papaparse');var Redis=require(_0x0c98('0x10'));var authService=require(_0x0c98('0x11'));var qs=require(_0x0c98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c98('0x13'));var logger=require(_0x0c98('0x14'))(_0x0c98('0x15'));var utils=require(_0x0c98('0x16'));var config=require(_0x0c98('0x17'));var licenseUtil=require(_0x0c98('0x18'));var db=require(_0x0c98('0x19'))['db'];config[_0x0c98('0x1a')]=_[_0x0c98('0x1b')](config[_0x0c98('0x1a')],{'host':_0x0c98('0x1c'),'port':0x18eb});var socket=require(_0x0c98('0x1d'))(new Redis(config[_0x0c98('0x1a')]));require(_0x0c98('0x1e'))[_0x0c98('0x1f')](socket);function respondWithStatusCode(_0x2d408e,_0x5905ae){_0x5905ae=_0x5905ae||0xcc;return function(_0x59092b){if(_0x59092b){return _0x2d408e[_0x0c98('0x20')](_0x5905ae);}return _0x2d408e[_0x0c98('0x21')](_0x5905ae)[_0x0c98('0x22')]();};}function respondWithResult(_0x5d0221,_0x1149e8){_0x1149e8=_0x1149e8||0xc8;return function(_0x100db7){if(_0x100db7){return _0x5d0221[_0x0c98('0x21')](_0x1149e8)[_0x0c98('0x23')](_0x100db7);}};}function respondWithFilteredResult(_0x1def10,_0x420ad4){return function(_0x4d52f1){if(_0x4d52f1){var _0x5269f3=typeof _0x420ad4[_0x0c98('0x24')]===_0x0c98('0x25')&&typeof _0x420ad4[_0x0c98('0x26')]===_0x0c98('0x25');var _0x40d35d=_0x4d52f1[_0x0c98('0x27')];var _0x4560fe=_0x5269f3?0x0:_0x420ad4[_0x0c98('0x24')];var _0x356c9a=_0x5269f3?_0x4d52f1[_0x0c98('0x27')]:_0x420ad4[_0x0c98('0x24')]+_0x420ad4[_0x0c98('0x26')];var _0x57c632;if(_0x356c9a>=_0x40d35d){_0x356c9a=_0x40d35d;_0x57c632=0xc8;}else{_0x57c632=0xce;}_0x1def10[_0x0c98('0x21')](_0x57c632);return _0x1def10[_0x0c98('0x28')](_0x0c98('0x29'),_0x4560fe+'-'+_0x356c9a+'/'+_0x40d35d)[_0x0c98('0x23')](_0x4d52f1);}return null;};}function patchUpdates(_0x417d3b){return function(_0x42cda1){try{jsonpatch[_0x0c98('0x2a')](_0x42cda1,_0x417d3b,!![]);}catch(_0x4de711){return BPromise['reject'](_0x4de711);}return _0x42cda1['save']();};}function saveUpdates(_0x16f4a7,_0x165e8d){return function(_0x4e4386){if(_0x4e4386){return _0x4e4386[_0x0c98('0x2b')](_0x16f4a7)[_0x0c98('0x2c')](function(_0x3fe22a){return _0x3fe22a;});}return null;};}function removeEntity(_0x53242f,_0x56b422){return function(_0x5b59ea){if(_0x5b59ea){return _0x5b59ea[_0x0c98('0x2d')]()[_0x0c98('0x2c')](function(){_0x53242f[_0x0c98('0x21')](0xcc)[_0x0c98('0x22')]();});}};}function handleEntityNotFound(_0x52405b,_0x3b5585){return function(_0x5649f6){if(!_0x5649f6){_0x52405b[_0x0c98('0x20')](0x194);}return _0x5649f6;};}function handleError(_0x2e6224,_0x8bd2d4){_0x8bd2d4=_0x8bd2d4||0x1f4;return function(_0x3d1af3){logger[_0x0c98('0x2e')](_0x3d1af3[_0x0c98('0x2f')]);if(_0x3d1af3[_0x0c98('0x30')]){delete _0x3d1af3['name'];}_0x2e6224[_0x0c98('0x21')](_0x8bd2d4)[_0x0c98('0x31')](_0x3d1af3);};}exports[_0x0c98('0x32')]=function(_0x2c38ce,_0x57679d){var _0x15c881={},_0x271eb5={},_0x1989e0={'count':0x0,'rows':[]};var _0x2aa146=_[_0x0c98('0x33')](db['ChatGroup']['rawAttributes'],function(_0x53d2f2){return{'name':_0x53d2f2[_0x0c98('0x34')],'type':_0x53d2f2[_0x0c98('0x35')][_0x0c98('0x36')]};});_0x271eb5[_0x0c98('0x37')]=_[_0x0c98('0x33')](_0x2aa146,_0x0c98('0x30'));_0x271eb5[_0x0c98('0x38')]=_[_0x0c98('0x39')](_0x2c38ce[_0x0c98('0x38')]);_0x271eb5[_0x0c98('0x3a')]=_[_0x0c98('0x3b')](_0x271eb5[_0x0c98('0x37')],_0x271eb5[_0x0c98('0x38')]);_0x15c881[_0x0c98('0x3c')]=_[_0x0c98('0x3b')](_0x271eb5[_0x0c98('0x37')],qs[_0x0c98('0x3d')](_0x2c38ce['query'][_0x0c98('0x3d')]));_0x15c881[_0x0c98('0x3c')]=_0x15c881[_0x0c98('0x3c')][_0x0c98('0x3e')]?_0x15c881[_0x0c98('0x3c')]:_0x271eb5['model'];if(!_0x2c38ce[_0x0c98('0x38')]['hasOwnProperty'](_0x0c98('0x3f'))){_0x15c881[_0x0c98('0x26')]=qs[_0x0c98('0x26')](_0x2c38ce[_0x0c98('0x38')][_0x0c98('0x26')]);_0x15c881[_0x0c98('0x24')]=qs[_0x0c98('0x24')](_0x2c38ce[_0x0c98('0x38')]['offset']);}_0x15c881[_0x0c98('0x40')]=qs['sort'](_0x2c38ce[_0x0c98('0x38')][_0x0c98('0x41')]);_0x15c881[_0x0c98('0x42')]=qs[_0x0c98('0x3a')](_[_0x0c98('0x43')](_0x2c38ce['query'],_0x271eb5[_0x0c98('0x3a')]),_0x2aa146);if(_0x2c38ce[_0x0c98('0x38')][_0x0c98('0x44')]){_0x15c881[_0x0c98('0x42')]=_[_0x0c98('0x45')](_0x15c881[_0x0c98('0x42')],{'$or':_[_0x0c98('0x33')](_0x2aa146,function(_0x2c0293){if(_0x2c0293[_0x0c98('0x35')]!==_0x0c98('0x46')){var _0x51fd56={};_0x51fd56[_0x2c0293[_0x0c98('0x30')]]={'$like':'%'+_0x2c38ce[_0x0c98('0x38')]['filter']+'%'};return _0x51fd56;}})});}_0x15c881=_['merge']({},_0x15c881,_0x2c38ce[_0x0c98('0x47')]);var _0x264b3f={'where':_0x15c881[_0x0c98('0x42')]};return db[_0x0c98('0x48')][_0x0c98('0x27')](_0x264b3f)[_0x0c98('0x2c')](function(_0x21ef3e){_0x1989e0['count']=_0x21ef3e;if(_0x2c38ce[_0x0c98('0x38')][_0x0c98('0x49')]){_0x15c881['include']=[{'all':!![]}];}return db['ChatGroup'][_0x0c98('0x4a')](_0x15c881);})[_0x0c98('0x2c')](function(_0x441edb){_0x1989e0[_0x0c98('0x4b')]=_0x441edb;return _0x1989e0;})[_0x0c98('0x2c')](respondWithFilteredResult(_0x57679d,_0x15c881))[_0x0c98('0x4c')](handleError(_0x57679d,null));};exports['show']=function(_0x328ef9,_0xd5b93e){var _0x4eb0ce={'raw':!![],'where':{'id':_0x328ef9[_0x0c98('0x4d')]['id']}},_0x1a6a67={};_0x1a6a67[_0x0c98('0x37')]=_[_0x0c98('0x39')](db[_0x0c98('0x48')]['rawAttributes']);_0x1a6a67[_0x0c98('0x38')]=_[_0x0c98('0x39')](_0x328ef9['query']);_0x1a6a67[_0x0c98('0x3a')]=_['intersection'](_0x1a6a67['model'],_0x1a6a67[_0x0c98('0x38')]);_0x4eb0ce[_0x0c98('0x3c')]=_[_0x0c98('0x3b')](_0x1a6a67['model'],qs[_0x0c98('0x3d')](_0x328ef9[_0x0c98('0x38')]['fields']));_0x4eb0ce[_0x0c98('0x3c')]=_0x4eb0ce['attributes'][_0x0c98('0x3e')]?_0x4eb0ce['attributes']:_0x1a6a67[_0x0c98('0x37')];if(_0x328ef9[_0x0c98('0x38')]['includeAll']){_0x4eb0ce[_0x0c98('0x4e')]=[{'all':!![]}];}_0x4eb0ce=_['merge']({},_0x4eb0ce,_0x328ef9[_0x0c98('0x47')]);return db[_0x0c98('0x48')][_0x0c98('0x4f')](_0x4eb0ce)[_0x0c98('0x2c')](handleEntityNotFound(_0xd5b93e,null))[_0x0c98('0x2c')](respondWithResult(_0xd5b93e,null))['catch'](handleError(_0xd5b93e,null));};exports['create']=function(_0x5f1c96,_0x62b21c){return db[_0x0c98('0x48')][_0x0c98('0x50')](_0x5f1c96[_0x0c98('0x51')],{})['then'](respondWithResult(_0x62b21c,0xc9))[_0x0c98('0x4c')](handleError(_0x62b21c,null));};exports[_0x0c98('0x2b')]=function(_0x25ffba,_0x57fb96){if(_0x25ffba[_0x0c98('0x51')]['id']){delete _0x25ffba[_0x0c98('0x51')]['id'];}return db[_0x0c98('0x48')][_0x0c98('0x4f')]({'where':{'id':_0x25ffba[_0x0c98('0x4d')]['id']}})[_0x0c98('0x2c')](handleEntityNotFound(_0x57fb96,null))[_0x0c98('0x2c')](saveUpdates(_0x25ffba[_0x0c98('0x51')],null))['then'](respondWithResult(_0x57fb96,null))[_0x0c98('0x4c')](handleError(_0x57fb96,null));};exports['destroy']=function(_0x8595c6,_0x267360){return db[_0x0c98('0x48')][_0x0c98('0x4f')]({'where':{'id':_0x8595c6[_0x0c98('0x4d')]['id']}})[_0x0c98('0x2c')](handleEntityNotFound(_0x267360,null))[_0x0c98('0x2c')](removeEntity(_0x267360,null))[_0x0c98('0x4c')](handleError(_0x267360,null));};exports[_0x0c98('0x52')]=function(_0x422deb,_0x3c209a){return db['ChatGroup'][_0x0c98('0x52')]()[_0x0c98('0x2c')](respondWithResult(_0x3c209a,null))[_0x0c98('0x4c')](handleError(_0x3c209a,null));};exports[_0x0c98('0x53')]=function(_0x128a3d,_0x46a991,_0x218970){return db['ChatInternalMessage'][_0x0c98('0x27')]({'where':{'ChatGroupId':_0x128a3d[_0x0c98('0x4d')]['id'],'ToId':_0x128a3d[_0x0c98('0x54')]['id'],'read':![]}})['then'](function(_0x59cfe3){return{'id':_[_0x0c98('0x55')](_0x128a3d['params']['id']),'count':_0x59cfe3};})[_0x0c98('0x2c')](respondWithResult(_0x46a991,null))[_0x0c98('0x4c')](handleError(_0x46a991,null));};exports[_0x0c98('0x56')]=function(_0x51d482,_0x21ec77,_0x34040d){return db['ChatGroup'][_0x0c98('0x4f')]({'where':{'id':_0x51d482[_0x0c98('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21ec77,null))[_0x0c98('0x2c')](function(_0x38be32){if(_0x38be32){return _0x38be32[_0x0c98('0x56')](_0x51d482[_0x0c98('0x51')][_0x0c98('0x57')],_[_0x0c98('0x58')](_0x51d482['body'],[_0x0c98('0x57'),'id'])||{});}})[_0x0c98('0x2c')](respondWithResult(_0x21ec77,null))[_0x0c98('0x4c')](handleError(_0x21ec77,null));};exports[_0x0c98('0x59')]=function(_0x468f74,_0x28b906,_0x3c3652){var _0x30fb81={};var _0x5c530a={};var _0x3c083f;var _0x469a28;return db[_0x0c98('0x48')][_0x0c98('0x5a')]({'where':{'id':_0x468f74[_0x0c98('0x4d')]['id']}})[_0x0c98('0x2c')](handleEntityNotFound(_0x28b906,null))[_0x0c98('0x2c')](function(_0x185a53){if(_0x185a53){_0x3c083f=_0x185a53;_0x5c530a[_0x0c98('0x37')]=_[_0x0c98('0x39')](db[_0x0c98('0x5b')][_0x0c98('0x5c')]);_0x5c530a[_0x0c98('0x38')]=_[_0x0c98('0x39')](_0x468f74[_0x0c98('0x38')]);_0x5c530a['filters']=_[_0x0c98('0x3b')](_0x5c530a[_0x0c98('0x37')],_0x5c530a[_0x0c98('0x38')]);_0x30fb81[_0x0c98('0x3c')]=_['intersection'](_0x5c530a[_0x0c98('0x37')],qs['fields'](_0x468f74[_0x0c98('0x38')][_0x0c98('0x3d')]));_0x30fb81['attributes']=_0x30fb81[_0x0c98('0x3c')][_0x0c98('0x3e')]?_0x30fb81[_0x0c98('0x3c')]:_0x5c530a[_0x0c98('0x37')];_0x30fb81['order']=qs[_0x0c98('0x41')](_0x468f74['query'][_0x0c98('0x41')]);_0x30fb81[_0x0c98('0x42')]=qs[_0x0c98('0x3a')](_['pick'](_0x468f74['query'],_0x5c530a[_0x0c98('0x3a')]));if(_0x468f74[_0x0c98('0x38')][_0x0c98('0x44')]){_0x30fb81[_0x0c98('0x42')]=_['merge'](_0x30fb81[_0x0c98('0x42')],{'$or':_[_0x0c98('0x33')](_0x30fb81[_0x0c98('0x3c')],function(_0x58be26){var _0x5b2148={};_0x5b2148[_0x58be26]={'$like':'%'+_0x468f74['query'][_0x0c98('0x44')]+'%'};return _0x5b2148;})});}_0x30fb81=_['merge']({},_0x30fb81,_0x468f74['options']);return _0x3c083f[_0x0c98('0x59')](_0x30fb81);}})[_0x0c98('0x2c')](function(_0xcc2228){if(_0xcc2228){_0x469a28=_0xcc2228['length'];if(!_0x468f74[_0x0c98('0x38')][_0x0c98('0x5d')](_0x0c98('0x3f'))){_0x30fb81[_0x0c98('0x26')]=qs[_0x0c98('0x26')](_0x468f74[_0x0c98('0x38')][_0x0c98('0x26')]);_0x30fb81[_0x0c98('0x24')]=qs[_0x0c98('0x24')](_0x468f74[_0x0c98('0x38')]['offset']);}return _0x3c083f[_0x0c98('0x59')](_0x30fb81);}})[_0x0c98('0x2c')](function(_0x1961d8){if(_0x1961d8){return _0x1961d8?{'count':_0x469a28,'rows':_0x1961d8}:null;}})[_0x0c98('0x2c')](respondWithResult(_0x28b906,null))['catch'](handleError(_0x28b906,null));};exports[_0x0c98('0x5e')]=function(_0x33d216,_0x531fd0,_0x584fe0){return db[_0x0c98('0x48')]['find']({'where':{'id':_0x33d216['params']['id']}})[_0x0c98('0x2c')](handleEntityNotFound(_0x531fd0,null))[_0x0c98('0x2c')](function(_0x5329ba){if(_0x5329ba){return _0x5329ba[_0x0c98('0x5e')](_0x33d216[_0x0c98('0x38')][_0x0c98('0x57')]);}})[_0x0c98('0x2c')](respondWithStatusCode(_0x531fd0,null))['catch'](handleError(_0x531fd0,null));};exports[_0x0c98('0x5f')]=function(_0x36de61,_0x4507bb,_0x1ff289){if(_0x36de61['body']['id']){delete _0x36de61[_0x0c98('0x51')]['id'];}return db[_0x0c98('0x48')][_0x0c98('0x4f')]({'where':{'id':_0x36de61[_0x0c98('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4507bb,null))[_0x0c98('0x2c')](function(_0x312bf5){if(_0x312bf5){_0x36de61['body'][_0x0c98('0x60')]=_0x312bf5['id'];return db[_0x0c98('0x61')][_0x0c98('0x50')](_0x36de61[_0x0c98('0x51')]);}})[_0x0c98('0x2c')](respondWithResult(_0x4507bb,null))[_0x0c98('0x4c')](handleError(_0x4507bb,null));};exports[_0x0c98('0x62')]=function(_0x2c14f9,_0x1953c2,_0x4c6118){var _0x5aca80={};var _0x518833={};var _0x38dd8c;var _0x1af01e;return db['ChatGroup']['findOne']({'where':{'id':_0x2c14f9[_0x0c98('0x4d')]['id']}})[_0x0c98('0x2c')](handleEntityNotFound(_0x1953c2,null))[_0x0c98('0x2c')](function(_0x1da619){if(_0x1da619){_0x38dd8c=_0x1da619;_0x518833['model']=_[_0x0c98('0x39')](db[_0x0c98('0x61')][_0x0c98('0x5c')]);_0x518833[_0x0c98('0x38')]=_[_0x0c98('0x39')](_0x2c14f9[_0x0c98('0x38')]);_0x518833['filters']=_[_0x0c98('0x3b')](_0x518833[_0x0c98('0x37')],_0x518833[_0x0c98('0x38')]);_0x5aca80[_0x0c98('0x3c')]=_[_0x0c98('0x3b')](_0x518833[_0x0c98('0x37')],qs[_0x0c98('0x3d')](_0x2c14f9['query'][_0x0c98('0x3d')]));_0x5aca80[_0x0c98('0x3c')]=_0x5aca80[_0x0c98('0x3c')][_0x0c98('0x3e')]?_0x5aca80['attributes']:_0x518833[_0x0c98('0x37')];_0x5aca80['order']=qs['sort'](_0x2c14f9[_0x0c98('0x38')]['sort']);_0x5aca80[_0x0c98('0x42')]=qs[_0x0c98('0x3a')](_[_0x0c98('0x43')](_0x2c14f9[_0x0c98('0x38')],_0x518833[_0x0c98('0x3a')]));if(_0x2c14f9[_0x0c98('0x38')][_0x0c98('0x44')]){_0x5aca80[_0x0c98('0x42')]=_[_0x0c98('0x45')](_0x5aca80[_0x0c98('0x42')],{'$or':_[_0x0c98('0x33')](_0x5aca80[_0x0c98('0x3c')],function(_0x8b1349){var _0x517ee9={};_0x517ee9[_0x8b1349]={'$like':'%'+_0x2c14f9[_0x0c98('0x38')][_0x0c98('0x44')]+'%'};return _0x517ee9;})});}if(_0x2c14f9[_0x0c98('0x38')]['$gte']){var _0x3e13dc=_0x2c14f9['query'][_0x0c98('0x63')][_0x0c98('0x64')](',');var _0x2de5e8={};_0x2de5e8[_0x3e13dc[0x0]]={'$gte':moment(_0x3e13dc[0x1])[_0x0c98('0x65')](_0x0c98('0x66'))};_0x5aca80[_0x0c98('0x42')]=_[_0x0c98('0x45')](_0x5aca80['where'],_0x2de5e8);}_0x5aca80=_['merge']({},_0x5aca80,_0x2c14f9[_0x0c98('0x47')]);return _0x38dd8c[_0x0c98('0x62')](_0x5aca80);}})[_0x0c98('0x2c')](function(_0x5b3445){if(_0x5b3445){_0x1af01e=_0x5b3445[_0x0c98('0x3e')];if(!_0x2c14f9[_0x0c98('0x38')][_0x0c98('0x5d')](_0x0c98('0x3f'))){_0x5aca80[_0x0c98('0x26')]=qs['limit'](_0x2c14f9['query']['limit']);_0x5aca80['offset']=qs[_0x0c98('0x24')](_0x2c14f9['query'][_0x0c98('0x24')]);}return _0x38dd8c[_0x0c98('0x62')](_0x5aca80);}})['then'](function(_0x3ef2ef){if(_0x3ef2ef){return _0x3ef2ef?{'count':_0x1af01e,'rows':_0x3ef2ef}:null;}})[_0x0c98('0x2c')](respondWithResult(_0x1953c2,null))['catch'](handleError(_0x1953c2,null));};
\ No newline at end of file
+var _0x8edf=['defaults','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','map','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0x8edf,0xaa));var _0xf8ed=function(_0x30d249,_0xe500b9){_0x30d249=_0x30d249-0x0;var _0xa668f7=_0x8edf[_0x30d249];return _0xa668f7;};'use strict';var emlformat=require(_0xf8ed('0x0'));var rimraf=require(_0xf8ed('0x1'));var zipdir=require(_0xf8ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8ed('0x3'));var moment=require(_0xf8ed('0x4'));var BPromise=require(_0xf8ed('0x5'));var Mustache=require(_0xf8ed('0x6'));var util=require(_0xf8ed('0x7'));var path=require(_0xf8ed('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8ed('0x9'));var squel=require(_0xf8ed('0xa'));var crypto=require(_0xf8ed('0xb'));var jsforce=require(_0xf8ed('0xc'));var deskjs=require(_0xf8ed('0xd'));var toCsv=require(_0xf8ed('0xe'));var querystring=require('querystring');var Papa=require(_0xf8ed('0xf'));var Redis=require(_0xf8ed('0x10'));var authService=require(_0xf8ed('0x11'));var qs=require(_0xf8ed('0x12'));var as=require(_0xf8ed('0x13'));var hardwareService=require(_0xf8ed('0x14'));var logger=require(_0xf8ed('0x15'))(_0xf8ed('0x16'));var utils=require(_0xf8ed('0x17'));var config=require(_0xf8ed('0x18'));var licenseUtil=require(_0xf8ed('0x19'));var db=require(_0xf8ed('0x1a'))['db'];config[_0xf8ed('0x1b')]=_[_0xf8ed('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8ed('0x1b')]));require(_0xf8ed('0x1d'))[_0xf8ed('0x1e')](socket);function respondWithStatusCode(_0x2f53e2,_0x4465f7){_0x4465f7=_0x4465f7||0xcc;return function(_0x9fdf6b){if(_0x9fdf6b){return _0x2f53e2[_0xf8ed('0x1f')](_0x4465f7);}return _0x2f53e2['status'](_0x4465f7)[_0xf8ed('0x20')]();};}function respondWithResult(_0x4695a3,_0x54e6c0){_0x54e6c0=_0x54e6c0||0xc8;return function(_0x5cd100){if(_0x5cd100){return _0x4695a3[_0xf8ed('0x21')](_0x54e6c0)['json'](_0x5cd100);}};}function respondWithFilteredResult(_0x16fa5a,_0x1750cb){return function(_0x369698){if(_0x369698){var _0x1eb458=typeof _0x1750cb[_0xf8ed('0x22')]===_0xf8ed('0x23')&&typeof _0x1750cb[_0xf8ed('0x24')]===_0xf8ed('0x23');var _0x3a0b4c=_0x369698['count'];var _0x2cffa3=_0x1eb458?0x0:_0x1750cb[_0xf8ed('0x22')];var _0x52d2f7=_0x1eb458?_0x369698[_0xf8ed('0x25')]:_0x1750cb[_0xf8ed('0x22')]+_0x1750cb[_0xf8ed('0x24')];var _0x263af2;if(_0x52d2f7>=_0x3a0b4c){_0x52d2f7=_0x3a0b4c;_0x263af2=0xc8;}else{_0x263af2=0xce;}_0x16fa5a[_0xf8ed('0x21')](_0x263af2);return _0x16fa5a[_0xf8ed('0x26')](_0xf8ed('0x27'),_0x2cffa3+'-'+_0x52d2f7+'/'+_0x3a0b4c)['json'](_0x369698);}return null;};}function patchUpdates(_0x3b8c44){return function(_0x17554b){try{jsonpatch['apply'](_0x17554b,_0x3b8c44,!![]);}catch(_0x2a3e78){return BPromise['reject'](_0x2a3e78);}return _0x17554b[_0xf8ed('0x28')]();};}function saveUpdates(_0x2db572,_0x451508){return function(_0x56dd52){if(_0x56dd52){return _0x56dd52[_0xf8ed('0x29')](_0x2db572)['then'](function(_0x36bf02){return _0x36bf02;});}return null;};}function removeEntity(_0xaf22ea,_0x28f9a8){return function(_0x5764f6){if(_0x5764f6){return _0x5764f6['destroy']()[_0xf8ed('0x2a')](function(){_0xaf22ea[_0xf8ed('0x21')](0xcc)[_0xf8ed('0x20')]();});}};}function handleEntityNotFound(_0xa00f80,_0x3d1b29){return function(_0x251818){if(!_0x251818){_0xa00f80[_0xf8ed('0x1f')](0x194);}return _0x251818;};}function handleError(_0x53e13b,_0x4a5f48){_0x4a5f48=_0x4a5f48||0x1f4;return function(_0x310f53){logger['error'](_0x310f53[_0xf8ed('0x2b')]);if(_0x310f53[_0xf8ed('0x2c')]){delete _0x310f53['name'];}_0x53e13b[_0xf8ed('0x21')](_0x4a5f48)[_0xf8ed('0x2d')](_0x310f53);};}exports[_0xf8ed('0x2e')]=function(_0x2dddcb,_0x4ba844){var _0x1948ba={},_0x49b00d={},_0x2494da={'count':0x0,'rows':[]};var _0x321789=_[_0xf8ed('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x1619bf){return{'name':_0x1619bf['fieldName'],'type':_0x1619bf['type'][_0xf8ed('0x30')]};});_0x49b00d[_0xf8ed('0x31')]=_[_0xf8ed('0x2f')](_0x321789,_0xf8ed('0x2c'));_0x49b00d[_0xf8ed('0x32')]=_['keys'](_0x2dddcb[_0xf8ed('0x32')]);_0x49b00d[_0xf8ed('0x33')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],_0x49b00d[_0xf8ed('0x32')]);_0x1948ba[_0xf8ed('0x34')]=_['intersection'](_0x49b00d[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x1948ba[_0xf8ed('0x34')]=_0x1948ba[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x1948ba[_0xf8ed('0x34')]:_0x49b00d[_0xf8ed('0x31')];if(!_0x2dddcb['query'][_0xf8ed('0x37')]('nolimit')){_0x1948ba[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x1948ba[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x22')]);}_0x1948ba[_0xf8ed('0x38')]=qs[_0xf8ed('0x39')](_0x2dddcb[_0xf8ed('0x32')]['sort']);_0x1948ba[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2dddcb[_0xf8ed('0x32')],_0x49b00d[_0xf8ed('0x33')]),_0x321789);if(_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x1948ba[_0xf8ed('0x3a')]=_[_0xf8ed('0x3d')](_0x1948ba[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x321789,function(_0xb6b855){if(_0xb6b855[_0xf8ed('0x3e')]!==_0xf8ed('0x3f')){var _0x58ba00={};_0x58ba00[_0xb6b855[_0xf8ed('0x2c')]]={'$like':'%'+_0x2dddcb[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x58ba00;}})});}_0x1948ba=_['merge']({},_0x1948ba,_0x2dddcb[_0xf8ed('0x40')]);var _0x3e518d={'where':_0x1948ba[_0xf8ed('0x3a')]};return db[_0xf8ed('0x41')][_0xf8ed('0x25')](_0x3e518d)[_0xf8ed('0x2a')](function(_0x50cdc9){_0x2494da[_0xf8ed('0x25')]=_0x50cdc9;if(_0x2dddcb['query']['includeAll']){_0x1948ba[_0xf8ed('0x42')]=[{'all':!![]}];}return db[_0xf8ed('0x41')][_0xf8ed('0x43')](_0x1948ba);})[_0xf8ed('0x2a')](function(_0x6bff45){_0x2494da[_0xf8ed('0x44')]=_0x6bff45;return _0x2494da;})[_0xf8ed('0x2a')](respondWithFilteredResult(_0x4ba844,_0x1948ba))[_0xf8ed('0x45')](handleError(_0x4ba844,null));};exports[_0xf8ed('0x46')]=function(_0x3dd71d,_0xc97a6){var _0x2a71c3={'raw':!![],'where':{'id':_0x3dd71d[_0xf8ed('0x47')]['id']}},_0x5e0efe={};_0x5e0efe[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db['ChatGroup'][_0xf8ed('0x49')]);_0x5e0efe[_0xf8ed('0x32')]=_['keys'](_0x3dd71d[_0xf8ed('0x32')]);_0x5e0efe[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],_0x5e0efe['query']);_0x2a71c3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x5e0efe[_0xf8ed('0x31')],qs['fields'](_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x2a71c3[_0xf8ed('0x34')]=_0x2a71c3[_0xf8ed('0x34')][_0xf8ed('0x36')]?_0x2a71c3[_0xf8ed('0x34')]:_0x5e0efe[_0xf8ed('0x31')];if(_0x3dd71d[_0xf8ed('0x32')][_0xf8ed('0x4b')]){_0x2a71c3[_0xf8ed('0x42')]=[{'all':!![]}];}_0x2a71c3=_[_0xf8ed('0x3d')]({},_0x2a71c3,_0x3dd71d[_0xf8ed('0x40')]);return db[_0xf8ed('0x41')][_0xf8ed('0x4c')](_0x2a71c3)[_0xf8ed('0x2a')](handleEntityNotFound(_0xc97a6,null))[_0xf8ed('0x2a')](respondWithResult(_0xc97a6,null))[_0xf8ed('0x45')](handleError(_0xc97a6,null));};exports[_0xf8ed('0x4d')]=function(_0x119041,_0x9d59b2){return db[_0xf8ed('0x41')][_0xf8ed('0x4d')](_0x119041[_0xf8ed('0x4e')],{})[_0xf8ed('0x2a')](respondWithResult(_0x9d59b2,0xc9))['catch'](handleError(_0x9d59b2,null));};exports['update']=function(_0x4ab044,_0x1616c6){if(_0x4ab044[_0xf8ed('0x4e')]['id']){delete _0x4ab044['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x4ab044[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1616c6,null))['then'](saveUpdates(_0x4ab044[_0xf8ed('0x4e')],null))[_0xf8ed('0x2a')](respondWithResult(_0x1616c6,null))[_0xf8ed('0x45')](handleError(_0x1616c6,null));};exports[_0xf8ed('0x4f')]=function(_0x3f662f,_0x352cb2){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x3f662f[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x352cb2,null))['then'](removeEntity(_0x352cb2,null))[_0xf8ed('0x45')](handleError(_0x352cb2,null));};exports[_0xf8ed('0x50')]=function(_0x204af2,_0x4ae532){return db[_0xf8ed('0x41')][_0xf8ed('0x50')]()[_0xf8ed('0x2a')](respondWithResult(_0x4ae532,null))['catch'](handleError(_0x4ae532,null));};exports['getUnread']=function(_0x5eef11,_0x258f6f,_0xe68cae){return db[_0xf8ed('0x51')][_0xf8ed('0x25')]({'where':{'ChatGroupId':_0x5eef11[_0xf8ed('0x47')]['id'],'ToId':_0x5eef11[_0xf8ed('0x52')]['id'],'read':![]}})[_0xf8ed('0x2a')](function(_0x5e874c){return{'id':_[_0xf8ed('0x53')](_0x5eef11[_0xf8ed('0x47')]['id']),'count':_0x5e874c};})[_0xf8ed('0x2a')](respondWithResult(_0x258f6f,null))['catch'](handleError(_0x258f6f,null));};exports[_0xf8ed('0x54')]=function(_0x1cb857,_0x1c378d,_0x175b4f){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1cb857['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x1c378d,null))['then'](function(_0x5bf9ad){if(_0x5bf9ad){return _0x5bf9ad[_0xf8ed('0x54')](_0x1cb857[_0xf8ed('0x4e')][_0xf8ed('0x55')],_[_0xf8ed('0x56')](_0x1cb857[_0xf8ed('0x4e')],[_0xf8ed('0x55'),'id'])||{});}})[_0xf8ed('0x2a')](respondWithResult(_0x1c378d,null))[_0xf8ed('0x45')](handleError(_0x1c378d,null));};exports[_0xf8ed('0x57')]=function(_0x3a2226,_0x5acf0c,_0x4a4bde){var _0x57c2d3={};var _0x1f1fec={};var _0x3e5712;var _0x2edb90;return db['ChatGroup'][_0xf8ed('0x58')]({'where':{'id':_0x3a2226[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x5acf0c,null))[_0xf8ed('0x2a')](function(_0x3b7a14){if(_0x3b7a14){_0x3e5712=_0x3b7a14;_0x1f1fec[_0xf8ed('0x31')]=_[_0xf8ed('0x48')](db[_0xf8ed('0x59')][_0xf8ed('0x49')]);_0x1f1fec[_0xf8ed('0x32')]=_[_0xf8ed('0x48')](_0x3a2226[_0xf8ed('0x32')]);_0x1f1fec[_0xf8ed('0x33')]=_['intersection'](_0x1f1fec[_0xf8ed('0x31')],_0x1f1fec['query']);_0x57c2d3[_0xf8ed('0x34')]=_[_0xf8ed('0x4a')](_0x1f1fec[_0xf8ed('0x31')],qs[_0xf8ed('0x35')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x35')]));_0x57c2d3['attributes']=_0x57c2d3['attributes'][_0xf8ed('0x36')]?_0x57c2d3[_0xf8ed('0x34')]:_0x1f1fec[_0xf8ed('0x31')];_0x57c2d3[_0xf8ed('0x38')]=qs['sort'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x57c2d3[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x3a2226[_0xf8ed('0x32')],_0x1f1fec[_0xf8ed('0x33')]));if(_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]){_0x57c2d3['where']=_[_0xf8ed('0x3d')](_0x57c2d3[_0xf8ed('0x3a')],{'$or':_['map'](_0x57c2d3[_0xf8ed('0x34')],function(_0x4ce8f7){var _0x3862b7={};_0x3862b7[_0x4ce8f7]={'$like':'%'+_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x3c')]+'%'};return _0x3862b7;})});}_0x57c2d3=_[_0xf8ed('0x3d')]({},_0x57c2d3,_0x3a2226[_0xf8ed('0x40')]);return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x33acd2){if(_0x33acd2){_0x2edb90=_0x33acd2['length'];if(!_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x57c2d3[_0xf8ed('0x24')]=qs['limit'](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x24')]);_0x57c2d3[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x3a2226[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x3e5712[_0xf8ed('0x57')](_0x57c2d3);}})[_0xf8ed('0x2a')](function(_0x5b7c1b){if(_0x5b7c1b){return _0x5b7c1b?{'count':_0x2edb90,'rows':_0x5b7c1b}:null;}})[_0xf8ed('0x2a')](respondWithResult(_0x5acf0c,null))[_0xf8ed('0x45')](handleError(_0x5acf0c,null));};exports[_0xf8ed('0x5b')]=function(_0x283aef,_0x361f5e,_0x2acd95){return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x283aef[_0xf8ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x361f5e,null))['then'](function(_0x4f9bf5){if(_0x4f9bf5){return _0x4f9bf5[_0xf8ed('0x5b')](_0x283aef['query'][_0xf8ed('0x55')]);}})['then'](respondWithStatusCode(_0x361f5e,null))[_0xf8ed('0x45')](handleError(_0x361f5e,null));};exports[_0xf8ed('0x5c')]=function(_0x1223c7,_0x3f4d0b,_0x3635c1){if(_0x1223c7['body']['id']){delete _0x1223c7['body']['id'];}return db[_0xf8ed('0x41')][_0xf8ed('0x4c')]({'where':{'id':_0x1223c7['params']['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x3f4d0b,null))[_0xf8ed('0x2a')](function(_0x3b46b2){if(_0x3b46b2){_0x1223c7[_0xf8ed('0x4e')][_0xf8ed('0x5d')]=_0x3b46b2['id'];return db['ChatInternalMessage'][_0xf8ed('0x4d')](_0x1223c7[_0xf8ed('0x4e')]);}})[_0xf8ed('0x2a')](respondWithResult(_0x3f4d0b,null))['catch'](handleError(_0x3f4d0b,null));};exports[_0xf8ed('0x5e')]=function(_0x2bf8a4,_0x5b745b,_0x1a21ae){var _0x2263d2={};var _0x3d5f05={};var _0x4e95fe;var _0x52c32b;return db[_0xf8ed('0x41')][_0xf8ed('0x58')]({'where':{'id':_0x2bf8a4[_0xf8ed('0x47')]['id']}})[_0xf8ed('0x2a')](handleEntityNotFound(_0x5b745b,null))[_0xf8ed('0x2a')](function(_0x1aa304){if(_0x1aa304){_0x4e95fe=_0x1aa304;_0x3d5f05['model']=_['keys'](db[_0xf8ed('0x51')]['rawAttributes']);_0x3d5f05['query']=_[_0xf8ed('0x48')](_0x2bf8a4[_0xf8ed('0x32')]);_0x3d5f05[_0xf8ed('0x33')]=_[_0xf8ed('0x4a')](_0x3d5f05['model'],_0x3d5f05[_0xf8ed('0x32')]);_0x2263d2[_0xf8ed('0x34')]=_['intersection'](_0x3d5f05['model'],qs['fields'](_0x2bf8a4['query'][_0xf8ed('0x35')]));_0x2263d2['attributes']=_0x2263d2[_0xf8ed('0x34')]['length']?_0x2263d2[_0xf8ed('0x34')]:_0x3d5f05[_0xf8ed('0x31')];_0x2263d2[_0xf8ed('0x38')]=qs['sort'](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x39')]);_0x2263d2[_0xf8ed('0x3a')]=qs[_0xf8ed('0x33')](_[_0xf8ed('0x3b')](_0x2bf8a4[_0xf8ed('0x32')],_0x3d5f05[_0xf8ed('0x33')]));if(_0x2bf8a4['query'][_0xf8ed('0x3c')]){_0x2263d2['where']=_[_0xf8ed('0x3d')](_0x2263d2[_0xf8ed('0x3a')],{'$or':_[_0xf8ed('0x2f')](_0x2263d2[_0xf8ed('0x34')],function(_0x2d67d0){var _0x4034d6={};_0x4034d6[_0x2d67d0]={'$like':'%'+_0x2bf8a4['query']['filter']+'%'};return _0x4034d6;})});}if(_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x5f')]){var _0x41be3a=_0x2bf8a4[_0xf8ed('0x32')]['$gte'][_0xf8ed('0x60')](',');var _0x447397={};_0x447397[_0x41be3a[0x0]]={'$gte':moment(_0x41be3a[0x1])[_0xf8ed('0x61')](_0xf8ed('0x62'))};_0x2263d2[_0xf8ed('0x3a')]=_['merge'](_0x2263d2[_0xf8ed('0x3a')],_0x447397);}_0x2263d2=_[_0xf8ed('0x3d')]({},_0x2263d2,_0x2bf8a4[_0xf8ed('0x40')]);return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x43a796){if(_0x43a796){_0x52c32b=_0x43a796[_0xf8ed('0x36')];if(!_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x37')](_0xf8ed('0x5a'))){_0x2263d2[_0xf8ed('0x24')]=qs[_0xf8ed('0x24')](_0x2bf8a4['query'][_0xf8ed('0x24')]);_0x2263d2[_0xf8ed('0x22')]=qs[_0xf8ed('0x22')](_0x2bf8a4[_0xf8ed('0x32')][_0xf8ed('0x22')]);}return _0x4e95fe[_0xf8ed('0x5e')](_0x2263d2);}})[_0xf8ed('0x2a')](function(_0x12a9ec){if(_0x12a9ec){return _0x12a9ec?{'count':_0x52c32b,'rows':_0x12a9ec}:null;}})['then'](respondWithResult(_0x5b745b,null))['catch'](handleError(_0x5b745b,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8520498..ab207bd 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 _0x97b2=['../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','exports','events'];(function(_0x17778f,_0xc39f94){var _0x24c184=function(_0x4e6646){while(--_0x4e6646){_0x17778f['push'](_0x17778f['shift']());}};_0x24c184(++_0xc39f94);}(_0x97b2,0x1b7));var _0x297b=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0x97b2[_0x50fda9];return _0x36b92b;};'use strict';var EventEmitter=require(_0x297b('0x0'));var ChatGroup=require(_0x297b('0x1'))['db'][_0x297b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x297b('0x3')](0x0);var events={'afterCreate':_0x297b('0x4'),'afterUpdate':_0x297b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37cce2){return function(_0x171e3f,_0x5bb44a,_0x6f1dc9){ChatGroupEvents[_0x297b('0x6')](_0x37cce2+':'+_0x171e3f['id'],_0x171e3f);ChatGroupEvents['emit'](_0x37cce2,_0x171e3f);_0x6f1dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x297b('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x8185=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8185,0x127));var _0x5818=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8185[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x5818('0x0'));var ChatGroup=require(_0x5818('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5818('0x2')](0x0);var events={'afterCreate':_0x5818('0x3'),'afterUpdate':_0x5818('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59270a){return function(_0x2def2f,_0x45fa9d,_0x3b34d7){ChatGroupEvents[_0x5818('0x5')](_0x59270a+':'+_0x2def2f['id'],_0x2def2f);ChatGroupEvents[_0x5818('0x5')](_0x59270a,_0x2def2f);_0x3b34d7(null);};}for(var e in events){if(events[_0x5818('0x6')](e)){var event=events[e];ChatGroup[_0x5818('0x7')](e,emitEvent(event));}}module[_0x5818('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 7a88783..ced4a1e 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 _0xdc25=['rimraf','./chatGroup.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f4890,_0x5b6afe){var _0x3091c4=function(_0x30e3f1){while(--_0x30e3f1){_0x2f4890['push'](_0x2f4890['shift']());}};_0x3091c4(++_0x5b6afe);}(_0xdc25,0xa4));var _0x5dc2=function(_0x29a89e,_0x47ce46){_0x29a89e=_0x29a89e-0x0;var _0x2246b1=_0xdc25[_0x29a89e];return _0x2246b1;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var logger=require(_0x5dc2('0x2'))(_0x5dc2('0x3'));var moment=require('moment');var BPromise=require(_0x5dc2('0x4'));var rp=require(_0x5dc2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dc2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5dc2('0x7'));module[_0x5dc2('0x8')]=function(_0x45a05b,_0x2cf4dc){return _0x45a05b[_0x5dc2('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ebd=['moment','path','rimraf','exports','define','chat_groups','lodash','util','api'];(function(_0x1978cf,_0x106e44){var _0x7ec3f5=function(_0x5dbc39){while(--_0x5dbc39){_0x1978cf['push'](_0x1978cf['shift']());}};_0x7ec3f5(++_0x106e44);}(_0x2ebd,0xde));var _0xd2eb=function(_0x5ce528,_0x43f173){_0x5ce528=_0x5ce528-0x0;var _0x138c3b=_0x2ebd[_0x5ce528];return _0x138c3b;};'use strict';var _=require(_0xd2eb('0x0'));var util=require(_0xd2eb('0x1'));var logger=require('../../config/logger')(_0xd2eb('0x2'));var moment=require(_0xd2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2eb('0x4'));var rimraf=require(_0xd2eb('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xd2eb('0x6')]=function(_0x1d8e1b,_0x1c6857){return _0x1d8e1b[_0xd2eb('0x7')]('ChatGroup',attributes,{'tableName':_0xd2eb('0x8'),'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 7ef1004..f7ae34f 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 _0x3efa=['client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1e58e0,_0xf3ad3a){var _0x274eea=function(_0x4cbf18){while(--_0x4cbf18){_0x1e58e0['push'](_0x1e58e0['shift']());}};_0x274eea(++_0xf3ad3a);}(_0x3efa,0x147));var _0xa3ef=function(_0x5c8aeb,_0x3ce9a4){_0x5c8aeb=_0x5c8aeb-0x0;var _0x2bf950=_0x3efa[_0x5c8aeb];return _0x2bf950;};'use strict';var _=require('lodash');var util=require(_0xa3ef('0x0'));var moment=require('moment');var BPromise=require(_0xa3ef('0x1'));var rs=require(_0xa3ef('0x2'));var fs=require('fs');var Redis=require(_0xa3ef('0x3'));var db=require(_0xa3ef('0x4'))['db'];var utils=require(_0xa3ef('0x5'));var logger=require(_0xa3ef('0x6'))('rpc');var config=require(_0xa3ef('0x7'));var jayson=require(_0xa3ef('0x8'));var client=jayson[_0xa3ef('0x9')]['http']({'port':0x232a});config[_0xa3ef('0xa')]=_[_0xa3ef('0xb')](config['redis'],{'host':_0xa3ef('0xc'),'port':0x18eb});var socket=require(_0xa3ef('0xd'))(new Redis(config[_0xa3ef('0xa')]));require(_0xa3ef('0xe'))[_0xa3ef('0xf')](socket);function respondWithRpcPromise(_0x24d215,_0xbfbfd1,_0x595d9e){return new BPromise(function(_0x52f6f6,_0x2c71c2){return client[_0xa3ef('0x10')](_0x24d215,_0x595d9e)['then'](function(_0x252764){logger[_0xa3ef('0x11')]('ChatGroup,\x20%s,\x20%s',_0xbfbfd1,_0xa3ef('0x12'));logger[_0xa3ef('0x13')](_0xa3ef('0x14'),_0xbfbfd1,_0xa3ef('0x12'),JSON[_0xa3ef('0x15')](_0x252764));if(_0x252764[_0xa3ef('0x16')]){if(_0x252764['error'][_0xa3ef('0x17')]===0x1f4){logger['error'](_0xa3ef('0x18'),_0xbfbfd1,_0x252764[_0xa3ef('0x16')]['message']);return _0x2c71c2(_0x252764[_0xa3ef('0x16')][_0xa3ef('0x19')]);}logger[_0xa3ef('0x16')](_0xa3ef('0x18'),_0xbfbfd1,_0x252764[_0xa3ef('0x16')]['message']);return _0x52f6f6(_0x252764[_0xa3ef('0x16')][_0xa3ef('0x19')]);}else{logger[_0xa3ef('0x11')](_0xa3ef('0x18'),_0xbfbfd1,_0xa3ef('0x12'));_0x52f6f6(_0x252764[_0xa3ef('0x1a')]['message']);}})[_0xa3ef('0x1b')](function(_0x201937){logger[_0xa3ef('0x16')](_0xa3ef('0x18'),_0xbfbfd1,_0x201937);_0x2c71c2(_0x201937);});});}
\ No newline at end of file
+var _0x3c7e=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x3c7e,0xdb));var _0xe3c7=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x3c7e[_0xa2049b];return _0x2fd615;};'use strict';var _=require('lodash');var util=require(_0xe3c7('0x0'));var moment=require('moment');var BPromise=require(_0xe3c7('0x1'));var rs=require(_0xe3c7('0x2'));var fs=require('fs');var Redis=require(_0xe3c7('0x3'));var db=require(_0xe3c7('0x4'))['db'];var utils=require(_0xe3c7('0x5'));var logger=require(_0xe3c7('0x6'))(_0xe3c7('0x7'));var config=require(_0xe3c7('0x8'));var jayson=require(_0xe3c7('0x9'));var client=jayson[_0xe3c7('0xa')][_0xe3c7('0xb')]({'port':0x232a});config[_0xe3c7('0xc')]=_[_0xe3c7('0xd')](config[_0xe3c7('0xc')],{'host':_0xe3c7('0xe'),'port':0x18eb});var socket=require(_0xe3c7('0xf'))(new Redis(config[_0xe3c7('0xc')]));require(_0xe3c7('0x10'))[_0xe3c7('0x11')](socket);function respondWithRpcPromise(_0x358556,_0x596de9,_0x54a3fb){return new BPromise(function(_0x4fcf72,_0x59becd){return client[_0xe3c7('0x12')](_0x358556,_0x54a3fb)[_0xe3c7('0x13')](function(_0x52cf90){logger['info'](_0xe3c7('0x14'),_0x596de9,_0xe3c7('0x15'));logger[_0xe3c7('0x16')](_0xe3c7('0x17'),_0x596de9,_0xe3c7('0x15'),JSON[_0xe3c7('0x18')](_0x52cf90));if(_0x52cf90[_0xe3c7('0x19')]){if(_0x52cf90['error'][_0xe3c7('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x59becd(_0x52cf90[_0xe3c7('0x19')]['message']);}logger[_0xe3c7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x596de9,_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);return _0x4fcf72(_0x52cf90[_0xe3c7('0x19')][_0xe3c7('0x1b')]);}else{logger[_0xe3c7('0x1c')](_0xe3c7('0x14'),_0x596de9,'request\x20sent');_0x4fcf72(_0x52cf90[_0xe3c7('0x1d')]['message']);}})[_0xe3c7('0x1e')](function(_0x13f5bc){logger[_0xe3c7('0x19')](_0xe3c7('0x14'),_0x596de9,_0x13f5bc);_0x59becd(_0x13f5bc);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ab61c5d..9817b7a 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 _0xff5b=['./chatGroup.events','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x119ecf,_0x3910e0){var _0x59482f=function(_0x4b7c88){while(--_0x4b7c88){_0x119ecf['push'](_0x119ecf['shift']());}};_0x59482f(++_0x3910e0);}(_0xff5b,0xe0));var _0xbff5=function(_0x33f2bf,_0x279402){_0x33f2bf=_0x33f2bf-0x0;var _0x440c71=_0xff5b[_0x33f2bf];return _0x440c71;};'use strict';var ChatGroupEvents=require(_0xbff5('0x0'));var events=['save',_0xbff5('0x1'),_0xbff5('0x2')];function createListener(_0x16d93c,_0xc30d51){return function(_0x352f2c){_0xc30d51[_0xbff5('0x3')](_0x16d93c,_0x352f2c);};}function removeListener(_0x6e7829,_0x19b5cc){return function(){ChatGroupEvents[_0xbff5('0x4')](_0x6e7829,_0x19b5cc);};}exports[_0xbff5('0x5')]=function(_0xa9e6ad){for(var _0x125cf0=0x0,_0x5a829a=events[_0xbff5('0x6')];_0x125cf0<_0x5a829a;_0x125cf0++){var _0x49b335=events[_0x125cf0];var _0x61d13b=createListener(_0xbff5('0x7')+_0x49b335,_0xa9e6ad);ChatGroupEvents['on'](_0x49b335,_0x61d13b);}};
\ No newline at end of file
+var _0x244e=['emit','register','length','chatGroup:','./chatGroup.events','remove','update'];(function(_0x16c2e0,_0x3dc335){var _0x49b690=function(_0x5bb015){while(--_0x5bb015){_0x16c2e0['push'](_0x16c2e0['shift']());}};_0x49b690(++_0x3dc335);}(_0x244e,0x19a));var _0xe244=function(_0x5e3c95,_0x380914){_0x5e3c95=_0x5e3c95-0x0;var _0x1692d8=_0x244e[_0x5e3c95];return _0x1692d8;};'use strict';var ChatGroupEvents=require(_0xe244('0x0'));var events=['save',_0xe244('0x1'),_0xe244('0x2')];function createListener(_0x15452d,_0x3ebe61){return function(_0x181f1d){_0x3ebe61[_0xe244('0x3')](_0x15452d,_0x181f1d);};}function removeListener(_0x4968d4,_0x355301){return function(){ChatGroupEvents['removeListener'](_0x4968d4,_0x355301);};}exports[_0xe244('0x4')]=function(_0x19dc91){for(var _0x4c519f=0x0,_0x2a7d57=events[_0xe244('0x5')];_0x4c519f<_0x2a7d57;_0x4c519f++){var _0x46bbf5=events[_0x4c519f];var _0x4ed2c9=createListener(_0xe244('0x6')+_0x46bbf5,_0x19dc91);ChatGroupEvents['on'](_0x46bbf5,_0x4ed2c9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 4d181eb..caa4cda 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 _0x2bf8=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','getUnread','getMembers','/:id/messages','getMessages','create','/:id/members','post','addMessage','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x2bf8,0x13d));var _0x82bf=function(_0x21864a,_0x6919d3){_0x21864a=_0x21864a-0x0;var _0x2e302a=_0x2bf8[_0x21864a];return _0x2e302a;};'use strict';var multer=require(_0x82bf('0x0'));var util=require(_0x82bf('0x1'));var path=require(_0x82bf('0x2'));var timeout=require(_0x82bf('0x3'));var express=require('express');var router=express[_0x82bf('0x4')]();var fs_extra=require(_0x82bf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x82bf('0x6'));var config=require(_0x82bf('0x7'));var controller=require(_0x82bf('0x8'));router[_0x82bf('0x9')]('/',auth[_0x82bf('0xa')](),controller[_0x82bf('0xb')]);router[_0x82bf('0x9')]('/describe',auth[_0x82bf('0xa')](),controller['describe']);router[_0x82bf('0x9')](_0x82bf('0xc'),auth['isAuthenticated'](),controller[_0x82bf('0xd')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x82bf('0xe')]);router[_0x82bf('0x9')]('/:id/members',auth[_0x82bf('0xa')](),controller[_0x82bf('0xf')]);router[_0x82bf('0x9')](_0x82bf('0x10'),auth[_0x82bf('0xa')](),controller[_0x82bf('0x11')]);router['post']('/',auth[_0x82bf('0xa')](),controller[_0x82bf('0x12')]);router['post'](_0x82bf('0x13'),auth[_0x82bf('0xa')](),controller['addMembers']);router[_0x82bf('0x14')](_0x82bf('0x10'),auth[_0x82bf('0xa')](),controller[_0x82bf('0x15')]);router['put'](_0x82bf('0xc'),auth['isAuthenticated'](),controller[_0x82bf('0x16')]);router['delete']('/:id',auth[_0x82bf('0xa')](),controller[_0x82bf('0x17')]);router[_0x82bf('0x18')]('/:id/members',auth['isAuthenticated'](),controller[_0x82bf('0x19')]);module[_0x82bf('0x1a')]=router;
\ No newline at end of file
+var _0xb59e=['getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages'];(function(_0x1bbbbb,_0x26bf4b){var _0x2b089d=function(_0x12e092){while(--_0x12e092){_0x1bbbbb['push'](_0x1bbbbb['shift']());}};_0x2b089d(++_0x26bf4b);}(_0xb59e,0x76));var _0xeb59=function(_0x16268a,_0x3cc445){_0x16268a=_0x16268a-0x0;var _0x5b4384=_0xb59e[_0x16268a];return _0x5b4384;};'use strict';var multer=require('multer');var util=require(_0xeb59('0x0'));var path=require(_0xeb59('0x1'));var timeout=require('connect-timeout');var express=require(_0xeb59('0x2'));var router=express[_0xeb59('0x3')]();var fs_extra=require(_0xeb59('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb59('0x5'));router[_0xeb59('0x6')]('/',auth['isAuthenticated'](),controller[_0xeb59('0x7')]);router['get'](_0xeb59('0x8'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xa')]);router[_0xeb59('0x6')](_0xeb59('0xb'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xc')]);router[_0xeb59('0x6')](_0xeb59('0xd'),auth[_0xeb59('0x9')](),controller[_0xeb59('0xe')]);router[_0xeb59('0x6')](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['getMembers']);router['get'](_0xeb59('0x10'),auth[_0xeb59('0x9')](),controller[_0xeb59('0x11')]);router[_0xeb59('0x12')]('/',auth[_0xeb59('0x9')](),controller[_0xeb59('0x13')]);router[_0xeb59('0x12')](_0xeb59('0xf'),auth['isAuthenticated'](),controller[_0xeb59('0x14')]);router[_0xeb59('0x12')](_0xeb59('0x10'),auth['isAuthenticated'](),controller[_0xeb59('0x15')]);router[_0xeb59('0x16')]('/:id',auth[_0xeb59('0x9')](),controller[_0xeb59('0x17')]);router[_0xeb59('0x18')](_0xeb59('0xb'),auth['isAuthenticated'](),controller[_0xeb59('0x19')]);router['delete'](_0xeb59('0xf'),auth[_0xeb59('0x9')](),controller['removeMembers']);module[_0xeb59('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index c77bd29..0c89641 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 _0xd547=['DATE','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xd547,0x1c1));var _0x7d54=function(_0x5c7158,_0x40146f){_0x5c7158=_0x5c7158-0x0;var _0x526bc4=_0xd547[_0x5c7158];return _0x526bc4;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x7d54('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7d54('0x1')]},'ratingType':{'type':Sequelize[_0x7d54('0x2')](_0x7d54('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x7d54('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7d54('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7d54('0x5')]},'secondDisposition':{'type':Sequelize[_0x7d54('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7d54('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7d54('0x5')]},'osVersion':{'type':Sequelize[_0x7d54('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7d54('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7d54('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7d54('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x7d54('0x6')]},'lastMsgAt':{'type':Sequelize[_0x7d54('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7d54('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x7d54('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x7d54('0x0')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8b29=['sequelize','BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x2e6bc2,_0x550f2a){var _0x1f3356=function(_0x4953c6){while(--_0x4953c6){_0x2e6bc2['push'](_0x2e6bc2['shift']());}};_0x1f3356(++_0x550f2a);}(_0x8b29,0xbe));var _0x98b2=function(_0x1f9e49,_0x359b05){_0x1f9e49=_0x1f9e49-0x0;var _0x54e24f=_0x8b29[_0x1f9e49];return _0x54e24f;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'closed':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x98b2('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x98b2('0x3')),'defaultValue':_0x98b2('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x98b2('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x98b2('0x6')]},'disposition':{'type':Sequelize[_0x98b2('0x7')]},'secondDisposition':{'type':Sequelize[_0x98b2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x98b2('0x7')]},'note':{'type':Sequelize[_0x98b2('0x7')]},'browserName':{'type':Sequelize[_0x98b2('0x7')]},'browserVersion':{'type':Sequelize[_0x98b2('0x7')]},'osName':{'type':Sequelize[_0x98b2('0x7')]},'osVersion':{'type':Sequelize[_0x98b2('0x7')]},'deviceModel':{'type':Sequelize[_0x98b2('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x98b2('0x5')]},'customerIp':{'type':Sequelize[_0x98b2('0x7')]},'formData':{'type':Sequelize[_0x98b2('0x5')](_0x98b2('0x8'))},'read1stAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgAt':{'type':Sequelize[_0x98b2('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x98b2('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x98b2('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x98b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 14bb1c5..1ae157d 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 _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.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','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x5bc4f9,_0x3913d8){var _0x3e1065=function(_0x4c711a){while(--_0x4c711a){_0x5bc4f9['push'](_0x5bc4f9['shift']());}};_0x3e1065(++_0x3913d8);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2b5709,_0x383a5d){_0x2b5709=_0x2b5709-0x0;var _0x5282df=_0xdd4f[_0x2b5709];return _0x5282df;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));};
\ No newline at end of file
+var _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x59b058,_0x5f4c38){var _0x5cb986=function(_0x54ee4c){while(--_0x54ee4c){_0x59b058['push'](_0x59b058['shift']());}};_0x5cb986(++_0x5f4c38);}(_0xd943,0x15d));var _0x3d94=function(_0x2c98ed,_0x42db72){_0x2c98ed=_0x2c98ed-0x0;var _0x4b5cf7=_0xd943[_0x2c98ed];return _0x4b5cf7;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('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','contactName');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3df42d0..a91e6cf 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 _0xb334=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook'];(function(_0x15aa8b,_0x1e02b2){var _0x24dd4b=function(_0x14e6ad){while(--_0x14e6ad){_0x15aa8b['push'](_0x15aa8b['shift']());}};_0x24dd4b(++_0x1e02b2);}(_0xb334,0x133));var _0x4b33=function(_0x34b111,_0x48e210){_0x34b111=_0x34b111-0x0;var _0x483852=_0xb334[_0x34b111];return _0x483852;};'use strict';var EventEmitter=require(_0x4b33('0x0'));var ChatInteraction=require(_0x4b33('0x1'))['db'][_0x4b33('0x2')];var ChatMessage=require(_0x4b33('0x1'))['db'][_0x4b33('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b33('0x4'),'afterDestroy':_0x4b33('0x5')};function emitEvent(_0x3ce16a){return function(_0x2de3f1,_0x10afb0,_0x45ff5a){_0x2de3f1['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xfa8610){_0x2de3f1[_0x4b33('0x6')](_0x4b33('0x7'),_0xfa8610[_0x4b33('0x8')](function(_0x3bc37f){return{'id':_0x3bc37f['id']};}));return ChatMessage[_0x4b33('0x9')]({'where':{'ChatInteractionId':_0x2de3f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b33('0xa')](function(_0x4e966c){_0x2de3f1[_0x4b33('0x6')]('unreadMessages',_0x4e966c[_0x4b33('0xb')]);ChatInteractionEvents[_0x4b33('0xc')](_0x3ce16a+':'+_0x2de3f1['id'],_0x2de3f1);ChatInteractionEvents['emit'](_0x3ce16a,_0x2de3f1);_0x45ff5a(null);})[_0x4b33('0xd')](_0x45ff5a(null));};}for(var e in events){if(events[_0x4b33('0xe')](e)){var event=events[e];ChatInteraction[_0x4b33('0xf')](e,emitEvent(event));}}module[_0x4b33('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe222=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x28030b,_0x52dbcf){var _0x17582c=function(_0x2a17de){while(--_0x2a17de){_0x28030b['push'](_0x28030b['shift']());}};_0x17582c(++_0x52dbcf);}(_0xe222,0x10e));var _0x2e22=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xe222[_0x38de33];return _0x40f16d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2e22('0x0'))['db'][_0x2e22('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x2e22('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e22('0x3')](0x0);var events={'afterCreate':_0x2e22('0x4'),'afterUpdate':_0x2e22('0x5'),'afterDestroy':_0x2e22('0x6')};function emitEvent(_0x1df2f8){return function(_0x59343a,_0xb040e3,_0x1f6436){_0x59343a[_0x2e22('0x7')]({'attributes':['id'],'raw':!![]})[_0x2e22('0x8')](function(_0x185689){_0x59343a[_0x2e22('0x9')](_0x2e22('0xa'),_0x185689['map'](function(_0xfa1f10){return{'id':_0xfa1f10['id']};}));return ChatMessage[_0x2e22('0xb')]({'where':{'ChatInteractionId':_0x59343a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13545f){_0x59343a[_0x2e22('0x9')](_0x2e22('0xc'),_0x13545f['length']);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8+':'+_0x59343a['id'],_0x59343a);ChatInteractionEvents[_0x2e22('0xd')](_0x1df2f8,_0x59343a);_0x1f6436(null);})[_0x2e22('0xe')](_0x1f6436(null));};}for(var e in events){if(events[_0x2e22('0xf')](e)){var event=events[e];ChatInteraction[_0x2e22('0x10')](e,emitEvent(event));}}module[_0x2e22('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 fec19f0..f018562 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 _0x0d59=['utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0d59,0x199));var _0x90d5=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0x0d59[_0x2118ad];return _0x4b5715;};'use strict';var _=require('lodash');var util=require(_0x90d5('0x0'));var logger=require(_0x90d5('0x1'))(_0x90d5('0x2'));var moment=require('moment');var BPromise=require(_0x90d5('0x3'));var rp=require(_0x90d5('0x4'));var fs=require('fs');var path=require(_0x90d5('0x5'));var rimraf=require(_0x90d5('0x6'));var config=require(_0x90d5('0x7'));var attributes=require(_0x90d5('0x8'));module[_0x90d5('0x9')]=function(_0x434da5,_0x50e4bc){return _0x434da5[_0x90d5('0xa')](_0x90d5('0xb'),attributes,{'tableName':_0x90d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46b766,_0x63dfb6,_0x8c94fb){if(_0x46b766[_0x90d5('0xd')](_0x90d5('0xe'))){_0x46b766['closedAt']=moment()[_0x90d5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x8c94fb(null,_0x46b766);}},'charset':_0x90d5('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2f10=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x2f10,0x107));var _0x02f1=function(_0x3cddb2,_0x3b43f7){_0x3cddb2=_0x3cddb2-0x0;var _0x3ade7d=_0x2f10[_0x3cddb2];return _0x3ade7d;};'use strict';var _=require(_0x02f1('0x0'));var util=require(_0x02f1('0x1'));var logger=require('../../config/logger')(_0x02f1('0x2'));var moment=require(_0x02f1('0x3'));var BPromise=require(_0x02f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02f1('0x5'));var rimraf=require('rimraf');var config=require(_0x02f1('0x6'));var attributes=require(_0x02f1('0x7'));module[_0x02f1('0x8')]=function(_0xfddf8e,_0x23f202){return _0xfddf8e[_0x02f1('0x9')](_0x02f1('0xa'),attributes,{'tableName':_0x02f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4529b0,_0x176448,_0x3d7399){if(_0x4529b0[_0x02f1('0xc')](_0x02f1('0xd'))){_0x4529b0[_0x02f1('0xe')]=moment()[_0x02f1('0xf')](_0x02f1('0x10'));}_0x3d7399(null,_0x4529b0);}},'charset':'utf8mb4','collate':_0x02f1('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index ed5cbd8..e994314 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 _0x40d6=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x474036,_0x5710d9){var _0x3f9a71=function(_0x4e4d7e){while(--_0x4e4d7e){_0x474036['push'](_0x474036['shift']());}};_0x3f9a71(++_0x5710d9);}(_0x40d6,0x100));var _0x640d=function(_0x2dd355,_0x47b7c4){_0x2dd355=_0x2dd355-0x0;var _0x15b4e2=_0x40d6[_0x2dd355];return _0x15b4e2;};'use strict';var _=require('lodash');var util=require(_0x640d('0x0'));var moment=require(_0x640d('0x1'));var BPromise=require(_0x640d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x640d('0x3'));var db=require(_0x640d('0x4'))['db'];var utils=require(_0x640d('0x5'));var logger=require(_0x640d('0x6'))(_0x640d('0x7'));var config=require(_0x640d('0x8'));var jayson=require(_0x640d('0x9'));var client=jayson['client'][_0x640d('0xa')]({'port':0x232a});config[_0x640d('0xb')]=_['defaults'](config[_0x640d('0xb')],{'host':_0x640d('0xc'),'port':0x18eb});var socket=require(_0x640d('0xd'))(new Redis(config[_0x640d('0xb')]));require(_0x640d('0xe'))[_0x640d('0xf')](socket);function respondWithRpcPromise(_0x263fdd,_0x2c009f,_0x2525e8){return new BPromise(function(_0xd57c93,_0x38b774){return client[_0x640d('0x10')](_0x263fdd,_0x2525e8)[_0x640d('0x11')](function(_0x3c9785){logger[_0x640d('0x12')](_0x640d('0x13'),_0x2c009f,'request\x20sent');logger[_0x640d('0x14')](_0x640d('0x15'),_0x2c009f,_0x640d('0x16'),JSON[_0x640d('0x17')](_0x3c9785));if(_0x3c9785[_0x640d('0x18')]){if(_0x3c9785[_0x640d('0x18')][_0x640d('0x19')]===0x1f4){logger[_0x640d('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x2c009f,_0x3c9785[_0x640d('0x18')][_0x640d('0x1a')]);return _0x38b774(_0x3c9785[_0x640d('0x18')]['message']);}logger[_0x640d('0x18')](_0x640d('0x13'),_0x2c009f,_0x3c9785['error'][_0x640d('0x1a')]);return _0xd57c93(_0x3c9785['error'][_0x640d('0x1a')]);}else{logger['info'](_0x640d('0x13'),_0x2c009f,_0x640d('0x16'));_0xd57c93(_0x3c9785[_0x640d('0x1b')][_0x640d('0x1a')]);}})[_0x640d('0x1c')](function(_0x316815){logger[_0x640d('0x18')](_0x640d('0x13'),_0x2c009f,_0x316815);_0x38b774(_0x316815);});});}exports[_0x640d('0x1d')]=function(_0x5891df){var _0x4ee370=this;return new Promise(function(_0x589546,_0x2bdf19){return db[_0x640d('0x1e')][_0x640d('0x1f')](_0x5891df[_0x640d('0x20')],{'raw':_0x5891df[_0x640d('0x21')]?_0x5891df[_0x640d('0x21')][_0x640d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5891df[_0x640d('0x21')]?_0x5891df[_0x640d('0x21')]['where']||null:null,'attributes':_0x5891df[_0x640d('0x21')]?_0x5891df[_0x640d('0x21')][_0x640d('0x23')]||null:null,'limit':_0x5891df[_0x640d('0x21')]?_0x5891df['options'][_0x640d('0x24')]||null:null})['then'](function(_0x322049){logger[_0x640d('0x12')](_0x640d('0x1d'),_0x5891df);logger[_0x640d('0x14')](_0x640d('0x1d'),_0x5891df,JSON['stringify'](_0x322049));_0x589546(_0x322049);})[_0x640d('0x1c')](function(_0x4f34bb){logger['error'](_0x640d('0x1d'),_0x4f34bb[_0x640d('0x1a')],_0x5891df);_0x2bdf19(_0x4ee370['error'](0x1f4,_0x4f34bb[_0x640d('0x1a')]));});});};exports[_0x640d('0x25')]=function(_0x450248){return new Promise(function(_0x3c9443,_0x12fa55){return db[_0x640d('0x1e')][_0x640d('0x26')]({'where':_0x450248[_0x640d('0x21')]?_0x450248[_0x640d('0x21')]['where']||null:null})[_0x640d('0x11')](function(_0x20cd4b){if(_0x20cd4b){return _0x20cd4b[_0x640d('0x27')](_0x450248[_0x640d('0x20')]['ids'],_[_0x640d('0x28')](_0x450248[_0x640d('0x20')],[_0x640d('0x29'),'id'])||{});}})[_0x640d('0x2a')](function(_0x49182b){logger['info'](_0x640d('0x2b'),_0x450248);logger[_0x640d('0x14')](_0x640d('0x2b'),_0x450248,JSON[_0x640d('0x17')](_0x49182b));_0x3c9443(_0x49182b);})['catch'](function(_0x26d891){logger[_0x640d('0x18')]('AddTags',_0x26d891['message'],_0x450248);_0x12fa55(_this[_0x640d('0x18')](0x1f4,_0x26d891[_0x640d('0x1a')]));});});};
\ No newline at end of file
+var _0x8623=['AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit'];(function(_0x5773e7,_0x435e69){var _0x5e6621=function(_0x112829){while(--_0x112829){_0x5773e7['push'](_0x5773e7['shift']());}};_0x5e6621(++_0x435e69);}(_0x8623,0x1e7));var _0x3862=function(_0x47b4ff,_0x5b68fd){_0x47b4ff=_0x47b4ff-0x0;var _0x2e6bd4=_0x8623[_0x47b4ff];return _0x2e6bd4;};'use strict';var _=require(_0x3862('0x0'));var util=require(_0x3862('0x1'));var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3862('0x4'));var db=require(_0x3862('0x5'))['db'];var utils=require(_0x3862('0x6'));var logger=require(_0x3862('0x7'))(_0x3862('0x8'));var config=require(_0x3862('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3862('0xa')]['http']({'port':0x232a});config[_0x3862('0xb')]=_[_0x3862('0xc')](config[_0x3862('0xb')],{'host':_0x3862('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3862('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x39efde,_0x26f064,_0x2d76c5){return new BPromise(function(_0xb301f6,_0x1ddb87){return client['request'](_0x39efde,_0x2d76c5)[_0x3862('0xe')](function(_0x3acefd){logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,'request\x20sent');logger[_0x3862('0x11')](_0x3862('0x12'),_0x26f064,'request\x20sent',JSON[_0x3862('0x13')](_0x3acefd));if(_0x3acefd[_0x3862('0x14')]){if(_0x3acefd[_0x3862('0x14')][_0x3862('0x15')]===0x1f4){logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd['error'][_0x3862('0x16')]);return _0x1ddb87(_0x3acefd[_0x3862('0x14')][_0x3862('0x16')]);}logger['error'](_0x3862('0x10'),_0x26f064,_0x3acefd[_0x3862('0x14')]['message']);return _0xb301f6(_0x3acefd['error'][_0x3862('0x16')]);}else{logger[_0x3862('0xf')](_0x3862('0x10'),_0x26f064,_0x3862('0x17'));_0xb301f6(_0x3acefd[_0x3862('0x18')][_0x3862('0x16')]);}})['catch'](function(_0x3c31d8){logger[_0x3862('0x14')](_0x3862('0x10'),_0x26f064,_0x3c31d8);_0x1ddb87(_0x3c31d8);});});}exports[_0x3862('0x19')]=function(_0x33a62d){var _0x2f90ae=this;return new Promise(function(_0x387c2b,_0x501b75){return db[_0x3862('0x1a')][_0x3862('0x1b')](_0x33a62d[_0x3862('0x1c')],{'raw':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')][_0x3862('0x1f')]||null:null,'attributes':_0x33a62d[_0x3862('0x1d')]?_0x33a62d[_0x3862('0x1d')]['attributes']||null:null,'limit':_0x33a62d['options']?_0x33a62d[_0x3862('0x1d')][_0x3862('0x20')]||null:null})[_0x3862('0xe')](function(_0x25d2bd){logger[_0x3862('0xf')]('UpdateChatInteraction',_0x33a62d);logger['debug'](_0x3862('0x19'),_0x33a62d,JSON[_0x3862('0x13')](_0x25d2bd));_0x387c2b(_0x25d2bd);})['catch'](function(_0x283e34){logger['error']('UpdateChatInteraction',_0x283e34[_0x3862('0x16')],_0x33a62d);_0x501b75(_0x2f90ae['error'](0x1f4,_0x283e34['message']));});});};exports[_0x3862('0x21')]=function(_0x867813){return new Promise(function(_0x560964,_0x2084e0){return db['ChatInteraction']['find']({'where':_0x867813[_0x3862('0x1d')]?_0x867813['options'][_0x3862('0x1f')]||null:null})[_0x3862('0xe')](function(_0x3f82e6){if(_0x3f82e6){return _0x3f82e6[_0x3862('0x22')](_0x867813[_0x3862('0x1c')][_0x3862('0x23')],_[_0x3862('0x24')](_0x867813[_0x3862('0x1c')],[_0x3862('0x23'),'id'])||{});}})[_0x3862('0x25')](function(_0x23f0e5){logger['info'](_0x3862('0x26'),_0x867813);logger[_0x3862('0x11')](_0x3862('0x26'),_0x867813,JSON[_0x3862('0x13')](_0x23f0e5));_0x560964(_0x23f0e5);})[_0x3862('0x27')](function(_0x4deef3){logger[_0x3862('0x14')](_0x3862('0x26'),_0x4deef3[_0x3862('0x16')],_0x867813);_0x2084e0(_this['error'](0x1f4,_0x4deef3[_0x3862('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f340ae1..fc325f5 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 _0x2a06=['removeListener','length','chatInteraction:','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2a06,0x87));var _0x62a0=function(_0x2a7831,_0x282a0d){_0x2a7831=_0x2a7831-0x0;var _0x3822f7=_0x2a06[_0x2a7831];return _0x3822f7;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x62a0('0x0'),_0x62a0('0x1')];function createListener(_0x1053be,_0x385838){return function(_0x1ea375){_0x385838[_0x62a0('0x2')](_0x1053be,_0x1ea375);};}function removeListener(_0x4677db,_0xf48ecf){return function(){ChatInteractionEvents[_0x62a0('0x3')](_0x4677db,_0xf48ecf);};}exports['register']=function(_0x3a1cd2){for(var _0x5f42c2=0x0,_0x49366d=events[_0x62a0('0x4')];_0x5f42c2<_0x49366d;_0x5f42c2++){var _0x4c5ee9=events[_0x5f42c2];var _0x1f1de1=createListener(_0x62a0('0x5')+_0x4c5ee9,_0x3a1cd2);ChatInteractionEvents['on'](_0x4c5ee9,_0x1f1de1);}};
\ No newline at end of file
+var _0x5b7f=['emit','removeListener','register','length','./chatInteraction.events','save','remove','update'];(function(_0x23c152,_0x156378){var _0x426f2e=function(_0x51ee0d){while(--_0x51ee0d){_0x23c152['push'](_0x23c152['shift']());}};_0x426f2e(++_0x156378);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x5f0c02,_0xabb6e6){_0x5f0c02=_0x5f0c02-0x0;var _0x112d1c=_0x5b7f[_0x5f0c02];return _0x112d1c;};'use strict';var ChatInteractionEvents=require(_0xf5b7('0x0'));var events=[_0xf5b7('0x1'),_0xf5b7('0x2'),_0xf5b7('0x3')];function createListener(_0x3c760b,_0x1efe58){return function(_0x3bb362){_0x1efe58[_0xf5b7('0x4')](_0x3c760b,_0x3bb362);};}function removeListener(_0x2c5439,_0x2dfb67){return function(){ChatInteractionEvents[_0xf5b7('0x5')](_0x2c5439,_0x2dfb67);};}exports[_0xf5b7('0x6')]=function(_0x1e67ac){for(var _0x984337=0x0,_0x1d7c78=events[_0xf5b7('0x7')];_0x984337<_0x1d7c78;_0x984337++){var _0x3711ec=events[_0x984337];var _0x426253=createListener('chatInteraction:'+_0x3711ec,_0x1e67ac);ChatInteractionEvents['on'](_0x3711ec,_0x426253);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 9b7cebc..bf6a49c 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 _0x8f62=['post','create','/:id/vidaoo','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','update','put','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x28d1b4,_0x32048a){var _0x287f4c=function(_0x3b0d01){while(--_0x3b0d01){_0x28d1b4['push'](_0x28d1b4['shift']());}};_0x287f4c(++_0x32048a);}(_0x8f62,0x101));var _0x28f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f62[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x28f6('0x0'));var path=require('path');var timeout=require(_0x28f6('0x1'));var express=require(_0x28f6('0x2'));var router=express[_0x28f6('0x3')]();var fs_extra=require(_0x28f6('0x4'));var auth=require(_0x28f6('0x5'));var interaction=require(_0x28f6('0x6'));var config=require(_0x28f6('0x7'));var controller=require(_0x28f6('0x8'));router[_0x28f6('0x9')]('/',auth[_0x28f6('0xa')](),controller[_0x28f6('0xb')]);router[_0x28f6('0x9')](_0x28f6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x28f6('0x9')](_0x28f6('0xd'),auth[_0x28f6('0xe')](),controller[_0x28f6('0xf')]);router[_0x28f6('0x9')]('/:id/attachment_download',auth[_0x28f6('0xe')](),controller['attachmentDownload']);router[_0x28f6('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x28f6('0x9')](_0x28f6('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x28f6('0x11')]);router[_0x28f6('0x9')](_0x28f6('0x12'),auth[_0x28f6('0xa')](),controller['download']);router[_0x28f6('0x13')]('/',auth['isAuthenticated'](),controller[_0x28f6('0x14')]);router[_0x28f6('0x13')](_0x28f6('0x15'),auth[_0x28f6('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x28f6('0x16')]({'destination':function(_0x37e3e5,_0x454261,_0x224323){_0x224323(null,path['join'](config['root'],_0x28f6('0x17')));},'filename':function(_0x3df583,_0x305d35,_0x196478){_0x196478(null,util[_0x28f6('0x18')](_0x28f6('0x19'),Date[_0x28f6('0x1a')](),_0x305d35[_0x28f6('0x1b')][_0x28f6('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x28f6('0x13')](_0x28f6('0x1d'),upload[_0x28f6('0x1e')]('file'),controller[_0x28f6('0x1f')]);router[_0x28f6('0x13')](_0x28f6('0x20'),auth[_0x28f6('0xe')](),controller[_0x28f6('0x21')]);router[_0x28f6('0x13')](_0x28f6('0x22'),auth[_0x28f6('0xa')](),interaction[_0x28f6('0x23')](_0x28f6('0x24'),_0x28f6('0x25')),controller['addTags']);router['put'](_0x28f6('0xd'),auth[_0x28f6('0xa')](),interaction[_0x28f6('0x23')](_0x28f6('0x24'),'chatinteraction:update'),controller[_0x28f6('0x26')]);router[_0x28f6('0x27')]('/:id/custom_update',controller['customUpdate']);router[_0x28f6('0x27')](_0x28f6('0x28'),auth[_0x28f6('0xe')](),controller[_0x28f6('0x29')]);router[_0x28f6('0x27')]('/:id/close',controller[_0x28f6('0x2a')]);router[_0x28f6('0x2b')](_0x28f6('0xd'),auth[_0x28f6('0xa')](),interaction[_0x28f6('0x23')]('chat',_0x28f6('0x2c')),controller[_0x28f6('0x2d')]);router[_0x28f6('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x5361=['/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','%s-%s','now','originalname','single','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','delete','chatinteraction:destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','index','/describe','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show'];(function(_0x304bd5,_0xea943d){var _0x2bcd87=function(_0x53d3c5){while(--_0x53d3c5){_0x304bd5['push'](_0x304bd5['shift']());}};_0x2bcd87(++_0xea943d);}(_0x5361,0x162));var _0x1536=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5361[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1536('0x0'));var util=require('util');var path=require(_0x1536('0x1'));var timeout=require(_0x1536('0x2'));var express=require(_0x1536('0x3'));var router=express[_0x1536('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1536('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1536('0x6')]);router['get'](_0x1536('0x7'),auth[_0x1536('0x8')](),controller[_0x1536('0x9')]);router[_0x1536('0xa')](_0x1536('0xb'),auth[_0x1536('0xc')](),controller[_0x1536('0xd')]);router['get'](_0x1536('0xe'),auth[_0x1536('0xc')](),controller[_0x1536('0xf')]);router[_0x1536('0xa')](_0x1536('0x10'),auth[_0x1536('0x8')](),controller[_0x1536('0x11')]);router['get'](_0x1536('0x12'),auth[_0x1536('0xc')](),controller['getMyMessages']);router[_0x1536('0xa')](_0x1536('0x13'),auth[_0x1536('0x8')](),controller[_0x1536('0x14')]);router[_0x1536('0x15')]('/',auth[_0x1536('0x8')](),controller[_0x1536('0x16')]);router[_0x1536('0x15')]('/:id/vidaoo',auth[_0x1536('0x8')](),controller[_0x1536('0x17')]);var upload=multer({'storage':multer[_0x1536('0x18')]({'destination':function(_0x165a45,_0x43d70c,_0x2ff5a7){_0x2ff5a7(null,path[_0x1536('0x19')](config[_0x1536('0x1a')],'server/files/attachments/'));},'filename':function(_0x3fd565,_0x217497,_0x1899cf){_0x1899cf(null,util['format'](_0x1536('0x1b'),Date[_0x1536('0x1c')](),_0x217497[_0x1536('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1536('0x15')]('/:id/attachment_upload',upload[_0x1536('0x1e')]('file'),controller[_0x1536('0x1f')]);router[_0x1536('0x15')](_0x1536('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x1536('0x15')]('/:id/tags',auth[_0x1536('0x8')](),interaction[_0x1536('0x20')](_0x1536('0x21'),_0x1536('0x22')),controller[_0x1536('0x23')]);router['put'](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction['tracked'](_0x1536('0x21'),_0x1536('0x24')),controller[_0x1536('0x25')]);router[_0x1536('0x26')](_0x1536('0x27'),controller['customUpdate']);router['put'](_0x1536('0x28'),auth[_0x1536('0xc')](),controller[_0x1536('0x29')]);router[_0x1536('0x26')]('/:id/close',controller['close']);router[_0x1536('0x2a')](_0x1536('0xb'),auth[_0x1536('0x8')](),interaction[_0x1536('0x20')]('chat',_0x1536('0x2b')),controller['destroy']);router[_0x1536('0x2a')](_0x1536('0x2c'),auth[_0x1536('0x8')](),controller['removeTags']);module[_0x1536('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d630e42..a92bee6 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 _0x1de4=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x72e04a,_0x398f0b){var _0x4e8acf=function(_0x56ea91){while(--_0x56ea91){_0x72e04a['push'](_0x72e04a['shift']());}};_0x4e8acf(++_0x398f0b);}(_0x1de4,0xe5));var _0x41de=function(_0x4005ae,_0x5aae9c){_0x4005ae=_0x4005ae-0x0;var _0x38aa59=_0x1de4[_0x4005ae];return _0x38aa59;};'use strict';var Sequelize=require(_0x41de('0x0'));module[_0x41de('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x41de('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x41de('0x3')]}};
\ No newline at end of file
+var _0x9b27=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b27,0x7b));var _0x79b2=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x9b27[_0x20e40d];return _0x558350;};'use strict';var Sequelize=require(_0x79b2('0x0'));module[_0x79b2('0x1')]={'body':{'type':Sequelize[_0x79b2('0x2')](_0x79b2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x79b2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x79b2('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ed6ae7a..5419388 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 _0x6e00=['fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','json','offset','undefined','limit','count','status','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','create','body','find','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','fullname','role','userpic','online','allowmessenger','showWebBar','-online','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','filter','FromId','ToId','read','-createdAt','eml-format','zip-dir'];(function(_0x5ecbbc,_0x2541f5){var _0x219a19=function(_0x49d792){while(--_0x49d792){_0x5ecbbc['push'](_0x5ecbbc['shift']());}};_0x219a19(++_0x2541f5);}(_0x6e00,0x66));var _0x06e0=function(_0x49f444,_0xfcf462){_0x49f444=_0x49f444-0x0;var _0x3ee407=_0x6e00[_0x49f444];return _0x3ee407;};'use strict';var emlformat=require(_0x06e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06e0('0x1'));var jsonpatch=require(_0x06e0('0x2'));var rp=require(_0x06e0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x06e0('0x4'));var path=require(_0x06e0('0x5'));var sox=require('sox');var csv=require(_0x06e0('0x6'));var ejs=require(_0x06e0('0x7'));var fs=require('fs');var fs_extra=require(_0x06e0('0x8'));var _=require(_0x06e0('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x06e0('0xa'));var deskjs=require(_0x06e0('0xb'));var toCsv=require(_0x06e0('0x6'));var querystring=require('querystring');var Papa=require(_0x06e0('0xc'));var Redis=require(_0x06e0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x06e0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06e0('0xf'));var logger=require(_0x06e0('0x10'))(_0x06e0('0x11'));var utils=require(_0x06e0('0x12'));var config=require(_0x06e0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x06e0('0x14'))['db'];config[_0x06e0('0x15')]=_[_0x06e0('0x16')](config[_0x06e0('0x15')],{'host':_0x06e0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06e0('0x15')]));require(_0x06e0('0x18'))[_0x06e0('0x19')](socket);function respondWithStatusCode(_0x32762e,_0x2e1c23){_0x2e1c23=_0x2e1c23||0xcc;return function(_0x432229){if(_0x432229){return _0x32762e['sendStatus'](_0x2e1c23);}return _0x32762e['status'](_0x2e1c23)['end']();};}function respondWithResult(_0x2ed074,_0x22886e){_0x22886e=_0x22886e||0xc8;return function(_0x816ead){if(_0x816ead){return _0x2ed074['status'](_0x22886e)[_0x06e0('0x1a')](_0x816ead);}};}function respondWithFilteredResult(_0x4f39e2,_0xd6674b){return function(_0x57f4ca){if(_0x57f4ca){var _0x21b132=typeof _0xd6674b[_0x06e0('0x1b')]===_0x06e0('0x1c')&&typeof _0xd6674b[_0x06e0('0x1d')]==='undefined';var _0xcdece2=_0x57f4ca[_0x06e0('0x1e')];var _0xe7e733=_0x21b132?0x0:_0xd6674b[_0x06e0('0x1b')];var _0x1c34e9=_0x21b132?_0x57f4ca[_0x06e0('0x1e')]:_0xd6674b['offset']+_0xd6674b[_0x06e0('0x1d')];var _0x117ead;if(_0x1c34e9>=_0xcdece2){_0x1c34e9=_0xcdece2;_0x117ead=0xc8;}else{_0x117ead=0xce;}_0x4f39e2[_0x06e0('0x1f')](_0x117ead);return _0x4f39e2['set'](_0x06e0('0x20'),_0xe7e733+'-'+_0x1c34e9+'/'+_0xcdece2)[_0x06e0('0x1a')](_0x57f4ca);}return null;};}function patchUpdates(_0x3bc6bc){return function(_0x16e2fc){try{jsonpatch['apply'](_0x16e2fc,_0x3bc6bc,!![]);}catch(_0xb4aee9){return BPromise[_0x06e0('0x21')](_0xb4aee9);}return _0x16e2fc[_0x06e0('0x22')]();};}function saveUpdates(_0x15db6d,_0x494e65){return function(_0x4862fe){if(_0x4862fe){return _0x4862fe['update'](_0x15db6d)[_0x06e0('0x23')](function(_0xf286ea){return _0xf286ea;});}return null;};}function removeEntity(_0x1bf7cb,_0x562162){return function(_0xd0ddce){if(_0xd0ddce){return _0xd0ddce[_0x06e0('0x24')]()[_0x06e0('0x23')](function(){_0x1bf7cb[_0x06e0('0x1f')](0xcc)[_0x06e0('0x25')]();});}};}function handleEntityNotFound(_0x2c5ded,_0x582df2){return function(_0x1e051b){if(!_0x1e051b){_0x2c5ded[_0x06e0('0x26')](0x194);}return _0x1e051b;};}function handleError(_0x27b4a9,_0x5d91b1){_0x5d91b1=_0x5d91b1||0x1f4;return function(_0xabb351){logger[_0x06e0('0x27')](_0xabb351[_0x06e0('0x28')]);if(_0xabb351[_0x06e0('0x29')]){delete _0xabb351[_0x06e0('0x29')];}_0x27b4a9[_0x06e0('0x1f')](_0x5d91b1)[_0x06e0('0x2a')](_0xabb351);};}exports[_0x06e0('0x2b')]=function(_0xac2bf1,_0x1bb020){var _0x46a4bf={},_0x180d56={},_0x5d7deb={'count':0x0,'rows':[]};var _0x16df0b=_['map'](db[_0x06e0('0x2c')][_0x06e0('0x2d')],function(_0x43a0a0){return{'name':_0x43a0a0[_0x06e0('0x2e')],'type':_0x43a0a0['type'][_0x06e0('0x2f')]};});_0x180d56[_0x06e0('0x30')]=_[_0x06e0('0x31')](_0x16df0b,_0x06e0('0x29'));_0x180d56[_0x06e0('0x32')]=_[_0x06e0('0x33')](_0xac2bf1[_0x06e0('0x32')]);_0x180d56['filters']=_[_0x06e0('0x34')](_0x180d56[_0x06e0('0x30')],_0x180d56[_0x06e0('0x32')]);_0x46a4bf[_0x06e0('0x35')]=_[_0x06e0('0x34')](_0x180d56[_0x06e0('0x30')],qs[_0x06e0('0x36')](_0xac2bf1[_0x06e0('0x32')]['fields']));_0x46a4bf['attributes']=_0x46a4bf['attributes'][_0x06e0('0x37')]?_0x46a4bf[_0x06e0('0x35')]:_0x180d56[_0x06e0('0x30')];if(!_0xac2bf1[_0x06e0('0x32')][_0x06e0('0x38')]('nolimit')){_0x46a4bf[_0x06e0('0x1d')]=qs[_0x06e0('0x1d')](_0xac2bf1[_0x06e0('0x32')][_0x06e0('0x1d')]);_0x46a4bf[_0x06e0('0x1b')]=qs[_0x06e0('0x1b')](_0xac2bf1['query'][_0x06e0('0x1b')]);}_0x46a4bf[_0x06e0('0x39')]=qs[_0x06e0('0x3a')](_0xac2bf1[_0x06e0('0x32')][_0x06e0('0x3a')]);_0x46a4bf[_0x06e0('0x3b')]=qs['filters'](_[_0x06e0('0x3c')](_0xac2bf1[_0x06e0('0x32')],_0x180d56['filters']),_0x16df0b);if(_0xac2bf1['query']['filter']){_0x46a4bf[_0x06e0('0x3b')]=_['merge'](_0x46a4bf[_0x06e0('0x3b')],{'$or':_[_0x06e0('0x31')](_0x16df0b,function(_0x27ddcb){if(_0x27ddcb[_0x06e0('0x3d')]!==_0x06e0('0x3e')){var _0x976ec8={};_0x976ec8[_0x27ddcb[_0x06e0('0x29')]]={'$like':'%'+_0xac2bf1[_0x06e0('0x32')]['filter']+'%'};return _0x976ec8;}})});}_0x46a4bf=_[_0x06e0('0x3f')]({},_0x46a4bf,_0xac2bf1[_0x06e0('0x40')]);var _0x1b3145={'where':_0x46a4bf[_0x06e0('0x3b')]};return db[_0x06e0('0x2c')][_0x06e0('0x1e')](_0x1b3145)['then'](function(_0x4bbd16){_0x5d7deb[_0x06e0('0x1e')]=_0x4bbd16;if(_0xac2bf1[_0x06e0('0x32')][_0x06e0('0x41')]){_0x46a4bf[_0x06e0('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x06e0('0x43')](_0x46a4bf);})['then'](function(_0x394d4f){_0x5d7deb[_0x06e0('0x44')]=_0x394d4f;return _0x5d7deb;})[_0x06e0('0x23')](respondWithFilteredResult(_0x1bb020,_0x46a4bf))['catch'](handleError(_0x1bb020,null));};exports['show']=function(_0x566ddc,_0x31b1a5){var _0x154bbc={'raw':!![],'where':{'id':_0x566ddc['params']['id']}},_0x5514f8={};_0x5514f8[_0x06e0('0x30')]=_[_0x06e0('0x33')](db[_0x06e0('0x2c')][_0x06e0('0x2d')]);_0x5514f8['query']=_[_0x06e0('0x33')](_0x566ddc[_0x06e0('0x32')]);_0x5514f8['filters']=_['intersection'](_0x5514f8[_0x06e0('0x30')],_0x5514f8['query']);_0x154bbc['attributes']=_['intersection'](_0x5514f8[_0x06e0('0x30')],qs[_0x06e0('0x36')](_0x566ddc[_0x06e0('0x32')]['fields']));_0x154bbc[_0x06e0('0x35')]=_0x154bbc['attributes']['length']?_0x154bbc['attributes']:_0x5514f8[_0x06e0('0x30')];if(_0x566ddc[_0x06e0('0x32')][_0x06e0('0x41')]){_0x154bbc[_0x06e0('0x42')]=[{'all':!![]}];}_0x154bbc=_[_0x06e0('0x3f')]({},_0x154bbc,_0x566ddc[_0x06e0('0x40')]);return db['ChatInternalMessage']['find'](_0x154bbc)[_0x06e0('0x23')](handleEntityNotFound(_0x31b1a5,null))[_0x06e0('0x23')](respondWithResult(_0x31b1a5,null))[_0x06e0('0x45')](handleError(_0x31b1a5,null));};exports[_0x06e0('0x46')]=function(_0x24668d,_0x2701de){return db[_0x06e0('0x2c')]['create'](_0x24668d[_0x06e0('0x47')],{})[_0x06e0('0x23')](respondWithResult(_0x2701de,0xc9))[_0x06e0('0x45')](handleError(_0x2701de,null));};exports['update']=function(_0x362084,_0x59dd00){if(_0x362084[_0x06e0('0x47')]['id']){delete _0x362084[_0x06e0('0x47')]['id'];}return db[_0x06e0('0x2c')][_0x06e0('0x48')]({'where':{'id':_0x362084[_0x06e0('0x49')]['id']}})[_0x06e0('0x23')](handleEntityNotFound(_0x59dd00,null))[_0x06e0('0x23')](saveUpdates(_0x362084['body'],null))[_0x06e0('0x23')](respondWithResult(_0x59dd00,null))[_0x06e0('0x45')](handleError(_0x59dd00,null));};exports[_0x06e0('0x24')]=function(_0x37e507,_0x28afcf){return db[_0x06e0('0x2c')][_0x06e0('0x48')]({'where':{'id':_0x37e507[_0x06e0('0x49')]['id']}})[_0x06e0('0x23')](handleEntityNotFound(_0x28afcf,null))['then'](removeEntity(_0x28afcf,null))[_0x06e0('0x45')](handleError(_0x28afcf,null));};exports[_0x06e0('0x4a')]=function(_0x4ebafc,_0x31c001){return db[_0x06e0('0x2c')]['describe']()['then'](respondWithResult(_0x31c001,null))[_0x06e0('0x45')](handleError(_0x31c001,null));};function wrapUser(_0xa0d13){return function(_0x322f9e){var _0x610c06=_0xa0d13[_0x06e0('0x4b')]({'plain':!![]});_0x610c06[_0x06e0('0x4c')]=[];if(_0x322f9e){_0x610c06[_0x06e0('0x4d')]=_0x322f9e[_0x06e0('0x4e')];_0x610c06[_0x06e0('0x4f')]=_0x322f9e;}else{_0x610c06[_0x06e0('0x4d')]=moment(0x0)[_0x06e0('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x610c06['lastMessage']={};}return _0x610c06;};}exports['getUsers']=function(_0x30e5ea,_0x10445b,_0x22f869){var _0x10478d=[];return db[_0x06e0('0x51')][_0x06e0('0x43')]({'where':{'role':[_0x06e0('0x52'),'admin','user']},'attributes':['id',_0x06e0('0x53'),_0x06e0('0x29'),_0x06e0('0x54'),_0x06e0('0x55'),'internal',_0x06e0('0x56'),'lastLoginAt',_0x06e0('0x57'),_0x06e0('0x58')],'order':qs[_0x06e0('0x3a')](_0x06e0('0x59')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x06e0('0x29'),_0x06e0('0x3d')],'through':{'attributes':[]}}]})[_0x06e0('0x23')](function(_0x170ec6){if(_0x170ec6){var _0x3d73ad=_0x30e5ea[_0x06e0('0x5a')][_0x06e0('0x4b')]({'plain':!![]});if(!_0x3d73ad)throw new Error(_0x06e0('0x5b'));if(_0x3d73ad[_0x06e0('0x54')]===_0x06e0('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0x06e0('0x5c'),'userProfileId':_0x3d73ad[_0x06e0('0x5d')]},'raw':!![]})['then'](function(_0x4dcb32){if(_0x4dcb32){if(_0x4dcb32[_0x06e0('0x5e')]===0x0){return db[_0x06e0('0x5f')][_0x06e0('0x43')]({'where':{'sectionId':_0x4dcb32['id']},'raw':!![]})[_0x06e0('0x23')](function(_0x488bc4){var _0x596ead=[];if(_[_0x06e0('0x60')](_0x488bc4)){_0x596ead=_['filter'](_0x170ec6,function(_0x2f8de2){if(_0x2f8de2[_0x06e0('0x54')]!==_0x06e0('0x52')){return _0x2f8de2;}});return _0x596ead;}else{for(var _0x5dd466=0x0;_0x5dd466<_0x170ec6[_0x06e0('0x37')];_0x5dd466++){var _0x35ae12=_0x170ec6[_0x5dd466];if(_0x35ae12[_0x06e0('0x54')]===_0x06e0('0x52')){var _0x125325=_[_0x06e0('0x48')](_0x488bc4,function(_0x47b8bd){return _0x47b8bd[_0x06e0('0x61')]===_0x35ae12['id'];});if(_0x125325)_0x596ead[_0x06e0('0x62')](_0x35ae12);}else{_0x596ead[_0x06e0('0x62')](_0x35ae12);}}return _0x596ead;}});}else{return _0x170ec6;}}else{var _0x259030=_[_0x06e0('0x63')](_0x170ec6,function(_0x3c613f){if(_0x3c613f[_0x06e0('0x54')]!=='agent'){return _0x3c613f;}});return _0x259030;}});}else{return _0x170ec6;}}})[_0x06e0('0x23')](function(_0x32a01b){var _0xda5d03=[];if(_0x32a01b){_0x10478d=_0x32a01b;for(var _0x1451d8=0x0;_0x1451d8<_0x32a01b[_0x06e0('0x37')];_0x1451d8+=0x1){_0x10478d[_0x1451d8][_0x06e0('0x4c')]=[];_0xda5d03[_0x06e0('0x62')](db['ChatInternalMessage'][_0x06e0('0x48')]({'where':{'FromId':[_0x30e5ea[_0x06e0('0x5a')]['id'],_0x32a01b[_0x1451d8]['id']],'ToId':[_0x30e5ea[_0x06e0('0x5a')]['id'],_0x32a01b[_0x1451d8]['id']],'ChatGroupId':null},'attributes':['id',_0x06e0('0x4e'),_0x06e0('0x64'),_0x06e0('0x65'),_0x06e0('0x66'),_0x06e0('0x47')],'order':qs[_0x06e0('0x3a')](_0x06e0('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x32a01b[_0x1451d8])));}return BPromise['all'](_0xda5d03);}return[];})[_0x06e0('0x23')](function(_0x6299f4){return{'rows':_0x6299f4,'count':_0x6299f4[_0x06e0('0x37')]};})['then'](respondWithResult(_0x10445b,null))[_0x06e0('0x45')](handleError(_0x10445b,null));};
\ No newline at end of file
+var _0xe382=['../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json','undefined','offset','count','limit','set','Content-Range','reject','update','destroy','then','sendStatus','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','createdAt','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe382,0xc4));var _0x2e38=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe382[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e38('0x0'));var jsonpatch=require(_0x2e38('0x1'));var rp=require(_0x2e38('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e38('0x3'));var util=require(_0x2e38('0x4'));var path=require(_0x2e38('0x5'));var sox=require(_0x2e38('0x6'));var csv=require(_0x2e38('0x7'));var ejs=require(_0x2e38('0x8'));var fs=require('fs');var fs_extra=require(_0x2e38('0x9'));var _=require(_0x2e38('0xa'));var squel=require(_0x2e38('0xb'));var crypto=require(_0x2e38('0xc'));var jsforce=require(_0x2e38('0xd'));var deskjs=require(_0x2e38('0xe'));var toCsv=require(_0x2e38('0x7'));var querystring=require(_0x2e38('0xf'));var Papa=require(_0x2e38('0x10'));var Redis=require(_0x2e38('0x11'));var authService=require(_0x2e38('0x12'));var qs=require(_0x2e38('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e38('0x14'));var logger=require(_0x2e38('0x15'))(_0x2e38('0x16'));var utils=require(_0x2e38('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2e38('0x18'));var db=require(_0x2e38('0x19'))['db'];config[_0x2e38('0x1a')]=_['defaults'](config[_0x2e38('0x1a')],{'host':_0x2e38('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e38('0x1a')]));require('./chatInternalMessage.socket')[_0x2e38('0x1c')](socket);function respondWithStatusCode(_0x5a7b05,_0x58ea9f){_0x58ea9f=_0x58ea9f||0xcc;return function(_0xf6ca34){if(_0xf6ca34){return _0x5a7b05['sendStatus'](_0x58ea9f);}return _0x5a7b05[_0x2e38('0x1d')](_0x58ea9f)[_0x2e38('0x1e')]();};}function respondWithResult(_0x7fab37,_0x44119c){_0x44119c=_0x44119c||0xc8;return function(_0x2ef2e4){if(_0x2ef2e4){return _0x7fab37['status'](_0x44119c)[_0x2e38('0x1f')](_0x2ef2e4);}};}function respondWithFilteredResult(_0x1d3c4c,_0x10b206){return function(_0x4c827f){if(_0x4c827f){var _0x3427d6=typeof _0x10b206['offset']===_0x2e38('0x20')&&typeof _0x10b206['limit']===_0x2e38('0x20');var _0x2cdc70=_0x4c827f['count'];var _0x554978=_0x3427d6?0x0:_0x10b206[_0x2e38('0x21')];var _0x563e8a=_0x3427d6?_0x4c827f[_0x2e38('0x22')]:_0x10b206['offset']+_0x10b206[_0x2e38('0x23')];var _0x187802;if(_0x563e8a>=_0x2cdc70){_0x563e8a=_0x2cdc70;_0x187802=0xc8;}else{_0x187802=0xce;}_0x1d3c4c[_0x2e38('0x1d')](_0x187802);return _0x1d3c4c[_0x2e38('0x24')](_0x2e38('0x25'),_0x554978+'-'+_0x563e8a+'/'+_0x2cdc70)[_0x2e38('0x1f')](_0x4c827f);}return null;};}function patchUpdates(_0xe72668){return function(_0x444052){try{jsonpatch['apply'](_0x444052,_0xe72668,!![]);}catch(_0x33674c){return BPromise[_0x2e38('0x26')](_0x33674c);}return _0x444052['save']();};}function saveUpdates(_0x10e0a0,_0x4ec0e7){return function(_0x29f3bb){if(_0x29f3bb){return _0x29f3bb[_0x2e38('0x27')](_0x10e0a0)['then'](function(_0x43b1fb){return _0x43b1fb;});}return null;};}function removeEntity(_0x2bdc0c,_0x1e0767){return function(_0x5ac312){if(_0x5ac312){return _0x5ac312[_0x2e38('0x28')]()[_0x2e38('0x29')](function(){_0x2bdc0c[_0x2e38('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4089,_0x323cdd){return function(_0x540ba2){if(!_0x540ba2){_0x5a4089[_0x2e38('0x2a')](0x194);}return _0x540ba2;};}function handleError(_0x58edfe,_0x5a2c78){_0x5a2c78=_0x5a2c78||0x1f4;return function(_0x39894e){logger['error'](_0x39894e['stack']);if(_0x39894e[_0x2e38('0x2b')]){delete _0x39894e[_0x2e38('0x2b')];}_0x58edfe[_0x2e38('0x1d')](_0x5a2c78)[_0x2e38('0x2c')](_0x39894e);};}exports[_0x2e38('0x2d')]=function(_0x1c8a70,_0x342038){var _0x32d678={},_0x28d96d={},_0x496c9c={'count':0x0,'rows':[]};var _0x472a22=_['map'](db[_0x2e38('0x2e')][_0x2e38('0x2f')],function(_0xc465b8){return{'name':_0xc465b8[_0x2e38('0x30')],'type':_0xc465b8[_0x2e38('0x31')][_0x2e38('0x32')]};});_0x28d96d[_0x2e38('0x33')]=_[_0x2e38('0x34')](_0x472a22,_0x2e38('0x2b'));_0x28d96d['query']=_['keys'](_0x1c8a70['query']);_0x28d96d[_0x2e38('0x35')]=_[_0x2e38('0x36')](_0x28d96d[_0x2e38('0x33')],_0x28d96d['query']);_0x32d678['attributes']=_[_0x2e38('0x36')](_0x28d96d['model'],qs[_0x2e38('0x37')](_0x1c8a70['query'][_0x2e38('0x37')]));_0x32d678[_0x2e38('0x38')]=_0x32d678[_0x2e38('0x38')][_0x2e38('0x39')]?_0x32d678['attributes']:_0x28d96d[_0x2e38('0x33')];if(!_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3b')](_0x2e38('0x3c'))){_0x32d678[_0x2e38('0x23')]=qs[_0x2e38('0x23')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x23')]);_0x32d678['offset']=qs[_0x2e38('0x21')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x21')]);}_0x32d678['order']=qs[_0x2e38('0x3d')](_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x3d')]);_0x32d678[_0x2e38('0x3e')]=qs['filters'](_[_0x2e38('0x3f')](_0x1c8a70[_0x2e38('0x3a')],_0x28d96d[_0x2e38('0x35')]),_0x472a22);if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x40')]){_0x32d678[_0x2e38('0x3e')]=_[_0x2e38('0x41')](_0x32d678[_0x2e38('0x3e')],{'$or':_[_0x2e38('0x34')](_0x472a22,function(_0x274f6f){if(_0x274f6f[_0x2e38('0x31')]!==_0x2e38('0x42')){var _0x2a405b={};_0x2a405b[_0x274f6f[_0x2e38('0x2b')]]={'$like':'%'+_0x1c8a70[_0x2e38('0x3a')]['filter']+'%'};return _0x2a405b;}})});}_0x32d678=_['merge']({},_0x32d678,_0x1c8a70[_0x2e38('0x43')]);var _0x11b953={'where':_0x32d678['where']};return db[_0x2e38('0x2e')][_0x2e38('0x22')](_0x11b953)[_0x2e38('0x29')](function(_0x14d728){_0x496c9c[_0x2e38('0x22')]=_0x14d728;if(_0x1c8a70[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x32d678[_0x2e38('0x45')]=[{'all':!![]}];}return db[_0x2e38('0x2e')][_0x2e38('0x46')](_0x32d678);})[_0x2e38('0x29')](function(_0x546c5f){_0x496c9c[_0x2e38('0x47')]=_0x546c5f;return _0x496c9c;})[_0x2e38('0x29')](respondWithFilteredResult(_0x342038,_0x32d678))[_0x2e38('0x48')](handleError(_0x342038,null));};exports[_0x2e38('0x49')]=function(_0x4617a2,_0x541297){var _0x31d4e1={'raw':!![],'where':{'id':_0x4617a2['params']['id']}},_0x5b00f1={};_0x5b00f1[_0x2e38('0x33')]=_[_0x2e38('0x4a')](db[_0x2e38('0x2e')]['rawAttributes']);_0x5b00f1[_0x2e38('0x3a')]=_[_0x2e38('0x4a')](_0x4617a2[_0x2e38('0x3a')]);_0x5b00f1[_0x2e38('0x35')]=_['intersection'](_0x5b00f1[_0x2e38('0x33')],_0x5b00f1[_0x2e38('0x3a')]);_0x31d4e1[_0x2e38('0x38')]=_[_0x2e38('0x36')](_0x5b00f1[_0x2e38('0x33')],qs['fields'](_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x37')]));_0x31d4e1[_0x2e38('0x38')]=_0x31d4e1[_0x2e38('0x38')][_0x2e38('0x39')]?_0x31d4e1['attributes']:_0x5b00f1[_0x2e38('0x33')];if(_0x4617a2[_0x2e38('0x3a')][_0x2e38('0x44')]){_0x31d4e1[_0x2e38('0x45')]=[{'all':!![]}];}_0x31d4e1=_[_0x2e38('0x41')]({},_0x31d4e1,_0x4617a2[_0x2e38('0x43')]);return db['ChatInternalMessage']['find'](_0x31d4e1)[_0x2e38('0x29')](handleEntityNotFound(_0x541297,null))['then'](respondWithResult(_0x541297,null))[_0x2e38('0x48')](handleError(_0x541297,null));};exports[_0x2e38('0x4b')]=function(_0x218138,_0x8df1b6){return db[_0x2e38('0x2e')][_0x2e38('0x4b')](_0x218138[_0x2e38('0x4c')],{})[_0x2e38('0x29')](respondWithResult(_0x8df1b6,0xc9))[_0x2e38('0x48')](handleError(_0x8df1b6,null));};exports[_0x2e38('0x27')]=function(_0x2c841a,_0x307f18){if(_0x2c841a[_0x2e38('0x4c')]['id']){delete _0x2c841a[_0x2e38('0x4c')]['id'];}return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x2c841a[_0x2e38('0x4e')]['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x307f18,null))[_0x2e38('0x29')](saveUpdates(_0x2c841a[_0x2e38('0x4c')],null))[_0x2e38('0x29')](respondWithResult(_0x307f18,null))[_0x2e38('0x48')](handleError(_0x307f18,null));};exports[_0x2e38('0x28')]=function(_0x378340,_0x15be55){return db[_0x2e38('0x2e')][_0x2e38('0x4d')]({'where':{'id':_0x378340['params']['id']}})[_0x2e38('0x29')](handleEntityNotFound(_0x15be55,null))['then'](removeEntity(_0x15be55,null))[_0x2e38('0x48')](handleError(_0x15be55,null));};exports['describe']=function(_0x20e03e,_0x5724e0){return db[_0x2e38('0x2e')]['describe']()[_0x2e38('0x29')](respondWithResult(_0x5724e0,null))[_0x2e38('0x48')](handleError(_0x5724e0,null));};function wrapUser(_0xb7acc9){return function(_0xd4082a){var _0x174812=_0xb7acc9['get']({'plain':!![]});_0x174812['messages']=[];if(_0xd4082a){_0x174812[_0x2e38('0x4f')]=_0xd4082a['createdAt'];_0x174812['lastMessage']=_0xd4082a;}else{_0x174812[_0x2e38('0x4f')]=moment(0x0)['format'](_0x2e38('0x50'));_0x174812['lastMessage']={};}return _0x174812;};}exports[_0x2e38('0x51')]=function(_0x4f66ae,_0x2fbf48,_0xd405c2){var _0x29935b=[];return db['User'][_0x2e38('0x46')]({'where':{'role':[_0x2e38('0x52'),_0x2e38('0x53'),_0x2e38('0x54')]},'attributes':['id',_0x2e38('0x55'),_0x2e38('0x2b'),_0x2e38('0x56'),_0x2e38('0x57'),_0x2e38('0x58'),_0x2e38('0x59'),'lastLoginAt',_0x2e38('0x5a'),_0x2e38('0x5b')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x5c')),'include':[{'model':db[_0x2e38('0x5d')],'as':_0x2e38('0x5e'),'attributes':['id',_0x2e38('0x2b'),_0x2e38('0x31')],'through':{'attributes':[]}}]})[_0x2e38('0x29')](function(_0x904954){if(_0x904954){var _0x23ee28=_0x4f66ae[_0x2e38('0x54')]['get']({'plain':!![]});if(!_0x23ee28)throw new Error(_0x2e38('0x5f'));if(_0x23ee28[_0x2e38('0x56')]===_0x2e38('0x54')){return db[_0x2e38('0x60')]['find']({'where':{'name':_0x2e38('0x61'),'userProfileId':_0x23ee28[_0x2e38('0x62')]},'raw':!![]})[_0x2e38('0x29')](function(_0x331c95){if(_0x331c95){if(_0x331c95[_0x2e38('0x63')]===0x0){return db['UserProfileResource'][_0x2e38('0x46')]({'where':{'sectionId':_0x331c95['id']},'raw':!![]})['then'](function(_0xb372ed){var _0x29b443=[];if(_[_0x2e38('0x64')](_0xb372ed)){_0x29b443=_['filter'](_0x904954,function(_0x396cd0){if(_0x396cd0[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x396cd0;}});return _0x29b443;}else{for(var _0x9fa9fd=0x0;_0x9fa9fd<_0x904954[_0x2e38('0x39')];_0x9fa9fd++){var _0x28b2ef=_0x904954[_0x9fa9fd];if(_0x28b2ef[_0x2e38('0x56')]===_0x2e38('0x52')){var _0x225e2d=_[_0x2e38('0x4d')](_0xb372ed,function(_0x45953b){return _0x45953b[_0x2e38('0x65')]===_0x28b2ef['id'];});if(_0x225e2d)_0x29b443[_0x2e38('0x66')](_0x28b2ef);}else{_0x29b443[_0x2e38('0x66')](_0x28b2ef);}}return _0x29b443;}});}else{return _0x904954;}}else{var _0x3a4889=_['filter'](_0x904954,function(_0x1d1a8b){if(_0x1d1a8b[_0x2e38('0x56')]!==_0x2e38('0x52')){return _0x1d1a8b;}});return _0x3a4889;}});}else{return _0x904954;}}})[_0x2e38('0x29')](function(_0x47fe9c){var _0x1c4406=[];if(_0x47fe9c){_0x29935b=_0x47fe9c;for(var _0x10644b=0x0;_0x10644b<_0x47fe9c['length'];_0x10644b+=0x1){_0x29935b[_0x10644b][_0x2e38('0x67')]=[];_0x1c4406[_0x2e38('0x66')](db[_0x2e38('0x2e')]['find']({'where':{'FromId':[_0x4f66ae[_0x2e38('0x54')]['id'],_0x47fe9c[_0x10644b]['id']],'ToId':[_0x4f66ae['user']['id'],_0x47fe9c[_0x10644b]['id']],'ChatGroupId':null},'attributes':['id',_0x2e38('0x68'),_0x2e38('0x69'),_0x2e38('0x6a'),_0x2e38('0x6b'),_0x2e38('0x4c')],'order':qs[_0x2e38('0x3d')](_0x2e38('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x47fe9c[_0x10644b])));}return BPromise[_0x2e38('0x6d')](_0x1c4406);}return[];})[_0x2e38('0x29')](function(_0x1b0129){return{'rows':_0x1b0129,'count':_0x1b0129[_0x2e38('0x39')]};})[_0x2e38('0x29')](respondWithResult(_0x2fbf48,null))[_0x2e38('0x48')](handleError(_0x2fbf48,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d11e986..07f96ea 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 _0x6ea0=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x396b44,_0x53777a){var _0x170b96=function(_0x17e8eb){while(--_0x17e8eb){_0x396b44['push'](_0x396b44['shift']());}};_0x170b96(++_0x53777a);}(_0x6ea0,0x15a));var _0x06ea=function(_0x2be5b0,_0x4ac547){_0x2be5b0=_0x2be5b0-0x0;var _0x2a16f1=_0x6ea0[_0x2be5b0];return _0x2a16f1;};'use strict';var EventEmitter=require(_0x06ea('0x0'));var ChatInternalMessage=require(_0x06ea('0x1'))['db'][_0x06ea('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x06ea('0x3')](0x0);var events={'afterCreate':_0x06ea('0x4'),'afterUpdate':'update','afterDestroy':_0x06ea('0x5')};function emitEvent(_0x56b5c0){return function(_0x1ac9a3,_0x47e590,_0x53362d){ChatInternalMessageEvents[_0x06ea('0x6')](_0x56b5c0+':'+_0x1ac9a3['id'],_0x1ac9a3);ChatInternalMessageEvents[_0x06ea('0x6')](_0x56b5c0,_0x1ac9a3);_0x53362d(null);};}for(var e in events){if(events[_0x06ea('0x7')](e)){var event=events[e];ChatInternalMessage[_0x06ea('0x8')](e,emitEvent(event));}}module[_0x06ea('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8a8a=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2af20f,_0x5564d6){var _0x281721=function(_0x5b05ca){while(--_0x5b05ca){_0x2af20f['push'](_0x2af20f['shift']());}};_0x281721(++_0x5564d6);}(_0x8a8a,0x1f2));var _0xa8a8=function(_0x56deee,_0x121efd){_0x56deee=_0x56deee-0x0;var _0x1a52fc=_0x8a8a[_0x56deee];return _0x1a52fc;};'use strict';var EventEmitter=require(_0xa8a8('0x0'));var ChatInternalMessage=require(_0xa8a8('0x1'))['db'][_0xa8a8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa8a8('0x3')](0x0);var events={'afterCreate':_0xa8a8('0x4'),'afterUpdate':'update','afterDestroy':_0xa8a8('0x5')};function emitEvent(_0x4257eb){return function(_0x576d56,_0x26a9b8,_0x3e4ecf){ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb+':'+_0x576d56['id'],_0x576d56);ChatInternalMessageEvents[_0xa8a8('0x6')](_0x4257eb,_0x576d56);_0x3e4ecf(null);};}for(var e in events){if(events[_0xa8a8('0x7')](e)){var event=events[e];ChatInternalMessage[_0xa8a8('0x8')](e,emitEvent(event));}}module[_0xa8a8('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d73a8de..01998eb 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 _0x90c9=['../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0x90c9,0xac));var _0x990c=function(_0x1df803,_0x25192d){_0x1df803=_0x1df803-0x0;var _0x20ef12=_0x90c9[_0x1df803];return _0x20ef12;};'use strict';var _=require(_0x990c('0x0'));var util=require(_0x990c('0x1'));var logger=require('../../config/logger')(_0x990c('0x2'));var moment=require(_0x990c('0x3'));var BPromise=require(_0x990c('0x4'));var rp=require(_0x990c('0x5'));var fs=require('fs');var path=require(_0x990c('0x6'));var rimraf=require(_0x990c('0x7'));var config=require(_0x990c('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x990c('0x9')]=function(_0x54d885,_0x41093d){return _0x54d885[_0x990c('0xa')](_0x990c('0xb'),attributes,{'tableName':_0x990c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x990c('0xd'),'collate':_0x990c('0xe')});};
\ No newline at end of file
+var _0x653a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4269e2,_0x343092){var _0x29641d=function(_0x4036e5){while(--_0x4036e5){_0x4269e2['push'](_0x4269e2['shift']());}};_0x29641d(++_0x343092);}(_0x653a,0x133));var _0xa653=function(_0xf0f9ae,_0x3b02ef){_0xf0f9ae=_0xf0f9ae-0x0;var _0x46b898=_0x653a[_0xf0f9ae];return _0x46b898;};'use strict';var _=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var logger=require('../../config/logger')(_0xa653('0x2'));var moment=require(_0xa653('0x3'));var BPromise=require(_0xa653('0x4'));var rp=require(_0xa653('0x5'));var fs=require('fs');var path=require(_0xa653('0x6'));var rimraf=require(_0xa653('0x7'));var config=require(_0xa653('0x8'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x50b405,_0x52778d){return _0x50b405[_0xa653('0x9')](_0xa653('0xa'),attributes,{'tableName':_0xa653('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa653('0xc'),'collate':_0xa653('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3d91ec2..10faebc 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 _0x71e2=['client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x40579e,_0x1f4bcc){var _0x406aee=function(_0x149f47){while(--_0x149f47){_0x40579e['push'](_0x40579e['shift']());}};_0x406aee(++_0x1f4bcc);}(_0x71e2,0x1c0));var _0x271e=function(_0x345545,_0x56db52){_0x345545=_0x345545-0x0;var _0x1d24de=_0x71e2[_0x345545];return _0x1d24de;};'use strict';var _=require('lodash');var util=require(_0x271e('0x0'));var moment=require('moment');var BPromise=require(_0x271e('0x1'));var rs=require(_0x271e('0x2'));var fs=require('fs');var Redis=require(_0x271e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x271e('0x4'));var logger=require('../../config/logger')(_0x271e('0x5'));var config=require(_0x271e('0x6'));var jayson=require(_0x271e('0x7'));var client=jayson[_0x271e('0x8')][_0x271e('0x9')]({'port':0x232a});config['redis']=_[_0x271e('0xa')](config[_0x271e('0xb')],{'host':_0x271e('0xc'),'port':0x18eb});var socket=require(_0x271e('0xd'))(new Redis(config[_0x271e('0xb')]));require('./chatInternalMessage.socket')[_0x271e('0xe')](socket);function respondWithRpcPromise(_0x36488f,_0x417cfc,_0x3f2653){return new BPromise(function(_0x369975,_0x22393a){return client[_0x271e('0xf')](_0x36488f,_0x3f2653)[_0x271e('0x10')](function(_0x3bfc74){logger['info'](_0x271e('0x11'),_0x417cfc,_0x271e('0x12'));logger['debug'](_0x271e('0x13'),_0x417cfc,_0x271e('0x12'),JSON[_0x271e('0x14')](_0x3bfc74));if(_0x3bfc74['error']){if(_0x3bfc74['error']['code']===0x1f4){logger[_0x271e('0x15')](_0x271e('0x11'),_0x417cfc,_0x3bfc74['error'][_0x271e('0x16')]);return _0x22393a(_0x3bfc74[_0x271e('0x15')][_0x271e('0x16')]);}logger[_0x271e('0x15')](_0x271e('0x11'),_0x417cfc,_0x3bfc74[_0x271e('0x15')][_0x271e('0x16')]);return _0x369975(_0x3bfc74[_0x271e('0x15')]['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x417cfc,_0x271e('0x12'));_0x369975(_0x3bfc74[_0x271e('0x17')][_0x271e('0x16')]);}})['catch'](function(_0x33c985){logger[_0x271e('0x15')](_0x271e('0x11'),_0x417cfc,_0x33c985);_0x22393a(_0x33c985);});});}
\ No newline at end of file
+var _0x03cf=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x03cf,0x64));var _0xf03c=function(_0x383ca6,_0x39dc19){_0x383ca6=_0x383ca6-0x0;var _0x7e0082=_0x03cf[_0x383ca6];return _0x7e0082;};'use strict';var _=require('lodash');var util=require(_0xf03c('0x0'));var moment=require(_0xf03c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf03c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03c('0x3'));var logger=require('../../config/logger')(_0xf03c('0x4'));var config=require(_0xf03c('0x5'));var jayson=require(_0xf03c('0x6'));var client=jayson['client'][_0xf03c('0x7')]({'port':0x232a});config[_0xf03c('0x8')]=_[_0xf03c('0x9')](config[_0xf03c('0x8')],{'host':_0xf03c('0xa'),'port':0x18eb});var socket=require(_0xf03c('0xb'))(new Redis(config['redis']));require(_0xf03c('0xc'))[_0xf03c('0xd')](socket);function respondWithRpcPromise(_0x1713d6,_0x17ff63,_0x15d5c6){return new BPromise(function(_0x36c6c3,_0xa50ef){return client[_0xf03c('0xe')](_0x1713d6,_0x15d5c6)[_0xf03c('0xf')](function(_0x30e960){logger[_0xf03c('0x10')](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));logger['debug'](_0xf03c('0x13'),_0x17ff63,_0xf03c('0x12'),JSON[_0xf03c('0x14')](_0x30e960));if(_0x30e960[_0xf03c('0x15')]){if(_0x30e960['error'][_0xf03c('0x16')]===0x1f4){logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0xa50ef(_0x30e960[_0xf03c('0x15')]['message']);}logger[_0xf03c('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x17ff63,_0x30e960[_0xf03c('0x15')][_0xf03c('0x17')]);return _0x36c6c3(_0x30e960['error']['message']);}else{logger['info'](_0xf03c('0x11'),_0x17ff63,_0xf03c('0x12'));_0x36c6c3(_0x30e960[_0xf03c('0x18')]['message']);}})[_0xf03c('0x19')](function(_0x3eb515){logger[_0xf03c('0x15')](_0xf03c('0x11'),_0x17ff63,_0x3eb515);_0xa50ef(_0x3eb515);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index d19228c..c33fd1b 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 _0x6046=['./chatInternalMessage.events','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0x6046,0x85));var _0x6604=function(_0x332140,_0x5ce7ef){_0x332140=_0x332140-0x0;var _0x50768c=_0x6046[_0x332140];return _0x50768c;};'use strict';var ChatInternalMessageEvents=require(_0x6604('0x0'));var events=['save',_0x6604('0x1'),_0x6604('0x2')];function createListener(_0x401af7,_0xe8f637){return function(_0x3e760e){_0xe8f637[_0x6604('0x3')](_0x401af7,_0x3e760e);};}function removeListener(_0x1e565c,_0x4d3036){return function(){ChatInternalMessageEvents['removeListener'](_0x1e565c,_0x4d3036);};}exports[_0x6604('0x4')]=function(_0x1342a9){for(var _0x15dbec=0x0,_0x289de4=events[_0x6604('0x5')];_0x15dbec<_0x289de4;_0x15dbec++){var _0x429141=events[_0x15dbec];var _0x32abd6=createListener(_0x6604('0x6')+_0x429141,_0x1342a9);ChatInternalMessageEvents['on'](_0x429141,_0x32abd6);}};
\ No newline at end of file
+var _0x2c9d=['./chatInternalMessage.events','remove','emit','removeListener','length','chatInternalMessage:'];(function(_0x467b25,_0x14a29a){var _0x2ad500=function(_0x301649){while(--_0x301649){_0x467b25['push'](_0x467b25['shift']());}};_0x2ad500(++_0x14a29a);}(_0x2c9d,0x90));var _0xd2c9=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x2c9d[_0x2df507];return _0x1f7167;};'use strict';var ChatInternalMessageEvents=require(_0xd2c9('0x0'));var events=['save',_0xd2c9('0x1'),'update'];function createListener(_0x2b1376,_0x4a80c5){return function(_0x265d23){_0x4a80c5[_0xd2c9('0x2')](_0x2b1376,_0x265d23);};}function removeListener(_0x1a1cdb,_0x4ca468){return function(){ChatInternalMessageEvents[_0xd2c9('0x3')](_0x1a1cdb,_0x4ca468);};}exports['register']=function(_0x4ac6c2){for(var _0x81ff9b=0x0,_0x244c12=events[_0xd2c9('0x4')];_0x81ff9b<_0x244c12;_0x81ff9b++){var _0x44188c=events[_0x81ff9b];var _0x21fadd=createListener(_0xd2c9('0x5')+_0x44188c,_0x4ac6c2);ChatInternalMessageEvents['on'](_0x44188c,_0x21fadd);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 746ce18..e82116d 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 _0xff86=['../../config/environment','get','isAuthenticated','index','/describe','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0xff86,0x173));var _0x6ff8=function(_0x6c9577,_0x3942ad){_0x6c9577=_0x6c9577-0x0;var _0x2e397f=_0xff86[_0x6c9577];return _0x2e397f;};'use strict';var multer=require(_0x6ff8('0x0'));var util=require(_0x6ff8('0x1'));var path=require(_0x6ff8('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ff8('0x3'));var router=express[_0x6ff8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ff8('0x5'));var interaction=require(_0x6ff8('0x6'));var config=require(_0x6ff8('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x6ff8('0x8')]('/',auth[_0x6ff8('0x9')](),controller[_0x6ff8('0xa')]);router['get'](_0x6ff8('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/users',auth[_0x6ff8('0x9')](),controller[_0x6ff8('0xc')]);router[_0x6ff8('0x8')]('/:id',auth[_0x6ff8('0x9')](),controller[_0x6ff8('0xd')]);router[_0x6ff8('0xe')]('/',auth[_0x6ff8('0x9')](),controller[_0x6ff8('0xf')]);router[_0x6ff8('0x10')](_0x6ff8('0x11'),controller[_0x6ff8('0x12')]);router[_0x6ff8('0x13')](_0x6ff8('0x11'),auth['isAuthenticated'](),controller[_0x6ff8('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x50ec=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getUsers','/:id','show','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x50ec,0x189));var _0xc50e=function(_0x2615e6,_0x3ef965){_0x2615e6=_0x2615e6-0x0;var _0x315886=_0x50ec[_0x2615e6];return _0x315886;};'use strict';var multer=require('multer');var util=require(_0xc50e('0x0'));var path=require('path');var timeout=require(_0xc50e('0x1'));var express=require(_0xc50e('0x2'));var router=express[_0xc50e('0x3')]();var fs_extra=require(_0xc50e('0x4'));var auth=require(_0xc50e('0x5'));var interaction=require(_0xc50e('0x6'));var config=require(_0xc50e('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xc50e('0x8')]('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xa')]);router[_0xc50e('0x8')]('/describe',auth[_0xc50e('0x9')](),controller[_0xc50e('0xb')]);router[_0xc50e('0x8')]('/users',auth['isAuthenticated'](),controller[_0xc50e('0xc')]);router[_0xc50e('0x8')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0xe')]);router['post']('/',auth[_0xc50e('0x9')](),controller[_0xc50e('0xf')]);router['put'](_0xc50e('0xd'),controller['update']);router[_0xc50e('0x10')](_0xc50e('0xd'),auth[_0xc50e('0x9')](),controller[_0xc50e('0x11')]);module[_0xc50e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 78ba780..d282516 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 _0x93e9=['BOOLEAN','ENUM','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x43d08c,_0x1c6410){var _0x206279=function(_0x58a1c8){while(--_0x58a1c8){_0x43d08c['push'](_0x43d08c['shift']());}};_0x206279(++_0x1c6410);}(_0x93e9,0xcc));var _0x993e=function(_0x503350,_0x3fbbb8){_0x503350=_0x503350-0x0;var _0x49e615=_0x93e9[_0x503350];return _0x49e615;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'body':{'type':Sequelize[_0x993e('0x2')](_0x993e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x993e('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x993e('0x6')]},'providerName':{'type':Sequelize[_0x993e('0x7')]},'providerResponse':{'type':Sequelize[_0x993e('0x2')]}};
\ No newline at end of file
+var _0x235b=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x3c3e48,_0x51d19f){var _0x1982eb=function(_0x4b1b45){while(--_0x4b1b45){_0x3c3e48['push'](_0x3c3e48['shift']());}};_0x1982eb(++_0x51d19f);}(_0x235b,0x1ed));var _0xb235=function(_0xd5e4d4,_0x50c61a){_0xd5e4d4=_0xd5e4d4-0x0;var _0x35181=_0x235b[_0xd5e4d4];return _0x35181;};'use strict';var Sequelize=require(_0xb235('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb235('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb235('0x3')]('in',_0xb235('0x4')),'defaultValue':_0xb235('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x5')]},'providerResponse':{'type':Sequelize[_0xb235('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 1e5173f..db0f6f1 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 _0x8398=['options','ChatMessage','rows','show','params','includeAll','find','create','body','describe','../../config/logger','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','null','rejectMessage','Sequelize','interface','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./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','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8398,0xb5));var _0x8839=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x8398[_0x500419];return _0x241c1a;};'use strict';var emlformat=require(_0x8839('0x0'));var rimraf=require(_0x8839('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8839('0x2'));var rp=require(_0x8839('0x3'));var moment=require(_0x8839('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8839('0x5'));var util=require(_0x8839('0x6'));var path=require(_0x8839('0x7'));var sox=require(_0x8839('0x8'));var csv=require(_0x8839('0x9'));var ejs=require(_0x8839('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8839('0xb'));var squel=require('squel');var crypto=require(_0x8839('0xc'));var jsforce=require(_0x8839('0xd'));var deskjs=require(_0x8839('0xe'));var toCsv=require(_0x8839('0x9'));var querystring=require(_0x8839('0xf'));var Papa=require(_0x8839('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8839('0x11'));var as=require(_0x8839('0x12'));var hardwareService=require(_0x8839('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8839('0x14'));var config=require(_0x8839('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8839('0x16')](config[_0x8839('0x17')],{'host':_0x8839('0x18'),'port':0x18eb});var socket=require(_0x8839('0x19'))(new Redis(config[_0x8839('0x17')]));require(_0x8839('0x1a'))[_0x8839('0x1b')](socket);var jayson=require(_0x8839('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8839('0x1d')][_0x8839('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x117568,_0x98d944,_0x408240,_0xfc0954){return new BPromise(function(_0x4e4e25,_0x17976c){var _0x47501b=_0xfc0954||client;return _0x47501b['request'](_0x117568,_0x408240)[_0x8839('0x1f')](function(_0xc9e7b4){logger[_0x8839('0x20')](_0x8839('0x21'),_0x98d944,_0x8839('0x22'));logger[_0x8839('0x23')](_0x8839('0x24'),_0x98d944,_0x8839('0x22'),JSON[_0x8839('0x25')](_0xc9e7b4));if(_0xc9e7b4['error']){if(_0xc9e7b4[_0x8839('0x26')][_0x8839('0x27')]===0x1f4){logger[_0x8839('0x26')](_0x8839('0x21'),_0x98d944,_0xc9e7b4[_0x8839('0x26')][_0x8839('0x28')]);return _0x17976c(_0xc9e7b4['error'][_0x8839('0x28')]);}logger[_0x8839('0x26')]('ChatMessage,\x20%s,\x20%s',_0x98d944,_0xc9e7b4['error']['message']);return _0x4e4e25(_0xc9e7b4['error'][_0x8839('0x28')]);}else{logger[_0x8839('0x20')](_0x8839('0x21'),_0x98d944,_0x8839('0x22'));_0x4e4e25(_0xc9e7b4['result'][_0x8839('0x28')]);}})[_0x8839('0x29')](function(_0x417377){logger[_0x8839('0x26')](_0x8839('0x21'),_0x98d944,_0x417377);_0x17976c(_0x417377);});});}function respondWithStatusCode(_0x28ede0,_0x144455){_0x144455=_0x144455||0xcc;return function(_0x152295){if(_0x152295){return _0x28ede0[_0x8839('0x2a')](_0x144455);}return _0x28ede0[_0x8839('0x2b')](_0x144455)[_0x8839('0x2c')]();};}function respondWithResult(_0x857ad5,_0x58c299){_0x58c299=_0x58c299||0xc8;return function(_0x1cead3){if(_0x1cead3){return _0x857ad5[_0x8839('0x2b')](_0x58c299)[_0x8839('0x2d')](_0x1cead3);}};}function respondWithFilteredResult(_0x4126ff,_0x520efa){return function(_0x2ea645){if(_0x2ea645){var _0x16c200=typeof _0x520efa[_0x8839('0x2e')]===_0x8839('0x2f')&&typeof _0x520efa[_0x8839('0x30')]===_0x8839('0x2f');var _0x4243d8=_0x2ea645['count'];var _0x5a845b=_0x16c200?0x0:_0x520efa[_0x8839('0x2e')];var _0x264013=_0x16c200?_0x2ea645[_0x8839('0x31')]:_0x520efa[_0x8839('0x2e')]+_0x520efa['limit'];var _0x3399e4;if(_0x264013>=_0x4243d8){_0x264013=_0x4243d8;_0x3399e4=0xc8;}else{_0x3399e4=0xce;}_0x4126ff[_0x8839('0x2b')](_0x3399e4);return _0x4126ff['set'](_0x8839('0x32'),_0x5a845b+'-'+_0x264013+'/'+_0x4243d8)[_0x8839('0x2d')](_0x2ea645);}return null;};}function patchUpdates(_0xdd08cf){return function(_0x238649){try{jsonpatch[_0x8839('0x33')](_0x238649,_0xdd08cf,!![]);}catch(_0x49f92b){return BPromise[_0x8839('0x34')](_0x49f92b);}return _0x238649[_0x8839('0x35')]();};}function saveUpdates(_0xe4a902,_0x3242ed){return function(_0x39f904){if(_0x39f904){return _0x39f904[_0x8839('0x36')](_0xe4a902)['then'](function(_0x204d80){return _0x204d80;});}return null;};}function removeEntity(_0x415997,_0xfff4e2){return function(_0xb00e5e){if(_0xb00e5e){return _0xb00e5e[_0x8839('0x37')]()[_0x8839('0x1f')](function(){_0x415997[_0x8839('0x2b')](0xcc)[_0x8839('0x2c')]();});}};}function handleEntityNotFound(_0x1acf8d,_0x227d33){return function(_0x13d560){if(!_0x13d560){_0x1acf8d[_0x8839('0x2a')](0x194);}return _0x13d560;};}function handleError(_0x403bcf,_0x32ea5a){_0x32ea5a=_0x32ea5a||0x1f4;return function(_0x506864){logger[_0x8839('0x26')](_0x506864['stack']);if(_0x506864[_0x8839('0x38')]){delete _0x506864[_0x8839('0x38')];}_0x403bcf[_0x8839('0x2b')](_0x32ea5a)['send'](_0x506864);};}exports[_0x8839('0x39')]=function(_0x453266,_0x47f40d){var _0x3f49ea={},_0x1524f8={},_0x53814a={'count':0x0,'rows':[]};var _0x3826c3=_[_0x8839('0x3a')](db['ChatMessage'][_0x8839('0x3b')],function(_0x9c2029){return{'name':_0x9c2029['fieldName'],'type':_0x9c2029[_0x8839('0x3c')][_0x8839('0x3d')]};});_0x1524f8[_0x8839('0x3e')]=_[_0x8839('0x3a')](_0x3826c3,_0x8839('0x38'));_0x1524f8[_0x8839('0x3f')]=_[_0x8839('0x40')](_0x453266[_0x8839('0x3f')]);_0x1524f8['filters']=_['intersection'](_0x1524f8['model'],_0x1524f8[_0x8839('0x3f')]);_0x3f49ea[_0x8839('0x41')]=_[_0x8839('0x42')](_0x1524f8['model'],qs['fields'](_0x453266[_0x8839('0x3f')][_0x8839('0x43')]));_0x3f49ea['attributes']=_0x3f49ea[_0x8839('0x41')][_0x8839('0x44')]?_0x3f49ea[_0x8839('0x41')]:_0x1524f8[_0x8839('0x3e')];if(!_0x453266[_0x8839('0x3f')][_0x8839('0x45')](_0x8839('0x46'))){_0x3f49ea['limit']=qs[_0x8839('0x30')](_0x453266[_0x8839('0x3f')][_0x8839('0x30')]);_0x3f49ea['offset']=qs['offset'](_0x453266[_0x8839('0x3f')]['offset']);}_0x3f49ea[_0x8839('0x47')]=qs['sort'](_0x453266[_0x8839('0x3f')][_0x8839('0x48')]);_0x3f49ea[_0x8839('0x49')]=qs[_0x8839('0x4a')](_[_0x8839('0x4b')](_0x453266[_0x8839('0x3f')],_0x1524f8[_0x8839('0x4a')]),_0x3826c3);if(_0x453266[_0x8839('0x3f')][_0x8839('0x4c')]){_0x3f49ea[_0x8839('0x49')]=_[_0x8839('0x4d')](_0x3f49ea[_0x8839('0x49')],{'$or':_[_0x8839('0x3a')](_0x3826c3,function(_0x2eff03){if(_0x2eff03[_0x8839('0x3c')]!==_0x8839('0x4e')){var _0x584564={};_0x584564[_0x2eff03[_0x8839('0x38')]]={'$like':'%'+_0x453266[_0x8839('0x3f')][_0x8839('0x4c')]+'%'};return _0x584564;}})});}_0x3f49ea=_['merge']({},_0x3f49ea,_0x453266[_0x8839('0x4f')]);var _0x2770be={'where':_0x3f49ea[_0x8839('0x49')]};return db[_0x8839('0x50')][_0x8839('0x31')](_0x2770be)['then'](function(_0x322b77){_0x53814a[_0x8839('0x31')]=_0x322b77;if(_0x453266['query']['includeAll']){_0x3f49ea['include']=[{'all':!![]}];}return db[_0x8839('0x50')]['findAll'](_0x3f49ea);})['then'](function(_0x1f9562){_0x53814a[_0x8839('0x51')]=_0x1f9562;return _0x53814a;})[_0x8839('0x1f')](respondWithFilteredResult(_0x47f40d,_0x3f49ea))[_0x8839('0x29')](handleError(_0x47f40d,null));};exports[_0x8839('0x52')]=function(_0x23ab16,_0x53af23){var _0x1c2f97={'raw':!![],'where':{'id':_0x23ab16[_0x8839('0x53')]['id']}},_0x878f3c={};_0x878f3c['model']=_[_0x8839('0x40')](db['ChatMessage'][_0x8839('0x3b')]);_0x878f3c['query']=_['keys'](_0x23ab16[_0x8839('0x3f')]);_0x878f3c[_0x8839('0x4a')]=_[_0x8839('0x42')](_0x878f3c[_0x8839('0x3e')],_0x878f3c['query']);_0x1c2f97[_0x8839('0x41')]=_[_0x8839('0x42')](_0x878f3c[_0x8839('0x3e')],qs[_0x8839('0x43')](_0x23ab16[_0x8839('0x3f')][_0x8839('0x43')]));_0x1c2f97[_0x8839('0x41')]=_0x1c2f97[_0x8839('0x41')][_0x8839('0x44')]?_0x1c2f97['attributes']:_0x878f3c[_0x8839('0x3e')];if(_0x23ab16[_0x8839('0x3f')][_0x8839('0x54')]){_0x1c2f97['include']=[{'all':!![]}];}_0x1c2f97=_[_0x8839('0x4d')]({},_0x1c2f97,_0x23ab16[_0x8839('0x4f')]);return db[_0x8839('0x50')][_0x8839('0x55')](_0x1c2f97)[_0x8839('0x1f')](handleEntityNotFound(_0x53af23,null))[_0x8839('0x1f')](respondWithResult(_0x53af23,null))['catch'](handleError(_0x53af23,null));};exports['create']=function(_0x32f83e,_0x12c5fc){return db[_0x8839('0x50')][_0x8839('0x56')](_0x32f83e[_0x8839('0x57')],{})[_0x8839('0x1f')](respondWithResult(_0x12c5fc,0xc9))['catch'](handleError(_0x12c5fc,null));};exports[_0x8839('0x36')]=function(_0x38ad55,_0x4c7dbd){if(_0x38ad55[_0x8839('0x57')]['id']){delete _0x38ad55['body']['id'];}return db['ChatMessage'][_0x8839('0x55')]({'where':{'id':_0x38ad55[_0x8839('0x53')]['id']}})[_0x8839('0x1f')](handleEntityNotFound(_0x4c7dbd,null))[_0x8839('0x1f')](saveUpdates(_0x38ad55[_0x8839('0x57')],null))[_0x8839('0x1f')](respondWithResult(_0x4c7dbd,null))[_0x8839('0x29')](handleError(_0x4c7dbd,null));};exports[_0x8839('0x37')]=function(_0x182c5b,_0x1f376e){return db[_0x8839('0x50')][_0x8839('0x55')]({'where':{'id':_0x182c5b[_0x8839('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f376e,null))['then'](removeEntity(_0x1f376e,null))[_0x8839('0x29')](handleError(_0x1f376e,null));};exports[_0x8839('0x58')]=function(_0x5d3b44,_0x5cb9e1){return db[_0x8839('0x50')]['describe']()[_0x8839('0x1f')](respondWithResult(_0x5cb9e1,null))['catch'](handleError(_0x5cb9e1,null));};var interaction_log=require(_0x8839('0x59'))(_0x8839('0x5a'));exports['accept']=function(_0x1b13f8,_0x2d2154,_0x23e7f4){var _0x3038eb={'agent':{},'channel':_0x8839('0x5b')};if(_0x1b13f8[_0x8839('0x57')]['id']){delete _0x1b13f8['body']['id'];}_0x1b13f8[_0x8839('0x57')]['read']=!![];_0x1b13f8[_0x8839('0x57')][_0x8839('0x5c')]=moment()[_0x8839('0x5d')](_0x8839('0x5e'));_0x1b13f8['body'][_0x8839('0x5f')]=_0x1b13f8[_0x8839('0x57')]['UserId']||_0x1b13f8[_0x8839('0x60')]['id'];_0x3038eb[_0x8839('0x61')]['id']=_0x1b13f8['body']['UserId'];return db['ChatMessage'][_0x8839('0x55')]({'where':{'id':_0x1b13f8[_0x8839('0x53')]['id'],'UserId':null}})[_0x8839('0x1f')](handleEntityNotFound(_0x2d2154,null))[_0x8839('0x1f')](saveUpdates(_0x1b13f8[_0x8839('0x57')],null))[_0x8839('0x1f')](function(_0x5064a8){if(_0x5064a8){_0x3038eb[_0x8839('0x28')]=_0x5064a8['get']({'plain':!![]});return db[_0x8839('0x62')][_0x8839('0x55')]({'where':{'id':_0x5064a8[_0x8839('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2d2154,null))[_0x8839('0x1f')](function(_0x3f8460){if(_0x3f8460){return _0x3f8460[_0x8839('0x36')]({'UserId':_0x1b13f8[_0x8839('0x57')]['UserId'],'read1stAt':_[_0x8839('0x64')](_0x3f8460[_0x8839('0x65')])?moment()[_0x8839('0x5d')](_0x8839('0x5e')):undefined});}return null;})[_0x8839('0x1f')](function(_0x1fe42b){if(_0x1fe42b){_0x3038eb[_0x8839('0x66')]=_0x1fe42b[_0x8839('0x67')]({'plain':!![]});interaction_log[_0x8839('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b13f8[_0x8839('0x60')]['id'],_0x1b13f8[_0x8839('0x60')][_0x8839('0x38')],_0x1b13f8['user'][_0x8839('0x68')],_0x3038eb[_0x8839('0x66')]['id'],_0x1b13f8[_0x8839('0x57')]?JSON[_0x8839('0x25')](_0x1b13f8[_0x8839('0x57')]):'null');return respondWithRpcPromise(_0x8839('0x69'),_0x8839('0x6a'),_0x3038eb);}return null;})['then'](function(_0x4ca5bd){var _0x34b504=_0x8839('0x6b')+_0x4ca5bd[_0x8839('0x28')][_0x8839('0x6c')];return db[_0x8839('0x6d')][_0x8839('0x3f')](_0x34b504,{'type':db['Sequelize'][_0x8839('0x6e')][_0x8839('0x6f')],'raw':!![]})[_0x8839('0x1f')](function(_0x347b8f){return _0x347b8f;});})[_0x8839('0x1f')](function(_0x4d63dc){if(_0x4d63dc){_0x3038eb[_0x8839('0x28')][_0x8839('0x70')]=_0x4d63dc[0x0];if(!_0x1b13f8['body'][_0x8839('0x5f')])return;return db[_0x8839('0x71')][_0x8839('0x55')]({'where':{'id':_0x1b13f8[_0x8839('0x57')]['UserId'],'role':_0x8839('0x61')},'attributes':['id','name','fullname',_0x8839('0x72'),_0x8839('0x73')],'raw':!![]});}return null;})[_0x8839('0x1f')](function(_0x4ec116){if(!_0x4ec116)return null;_0x3038eb[_0x8839('0x28')][_0x8839('0x61')]=_0x4ec116;return _0x3038eb;})[_0x8839('0x1f')](function(_0x196b9d){if(_0x196b9d){if(_0x1b13f8['body'][_0x8839('0x74')]){_0x3038eb['message']['interface']=util[_0x8839('0x5d')](_0x8839('0x75'),_0x1b13f8[_0x8839('0x60')][_0x8839('0x38')]);_0x3038eb[_0x8839('0x28')][_0x8839('0x76')]=_0x3038eb[_0x8839('0x76')];_0x3038eb[_0x8839('0x28')][_0x8839('0x77')]=_0x3038eb['channel'];_0x3038eb[_0x8839('0x28')][_0x8839('0x78')]=_0x8839('0x79');return respondWithRpcPromise('EventManager',_0x8839('0x7a'),{'event':_0x8839('0x7b'),'message':_[_0x8839('0x4d')](_0x3038eb[_0x8839('0x28')],JSON['parse'](_0x3038eb[_0x8839('0x66')][_0x8839('0x7c')]))},client9002)[_0x8839('0x1f')](function(){return _0x3038eb;});}return _0x3038eb;}return null;})['then'](respondWithResult(_0x2d2154,null))[_0x8839('0x29')](handleError(_0x2d2154,null));};var interaction_log=require('../../config/logger')(_0x8839('0x5a'));exports[_0x8839('0x34')]=function(_0x535248,_0x5aec92,_0x536e63){var _0x5ce994={'agent':{},'channel':_0x8839('0x5b')};if(_0x535248[_0x8839('0x57')]['id']){delete _0x535248['body']['id'];}_0x535248[_0x8839('0x57')][_0x8839('0x5f')]=_0x535248['body']['UserId']||_0x535248[_0x8839('0x60')]['id'];_0x5ce994[_0x8839('0x61')]['id']=_0x535248['body']['UserId'];return db['ChatMessage'][_0x8839('0x55')]({'where':{'id':_0x535248['params']['id'],'UserId':null}})[_0x8839('0x1f')](handleEntityNotFound(_0x5aec92,null))[_0x8839('0x1f')](function(_0x22349b){if(_0x22349b){_0x5ce994[_0x8839('0x28')]=_0x22349b[_0x8839('0x67')]({'plain':!![]});return db[_0x8839('0x62')][_0x8839('0x55')]({'where':{'id':_0x22349b[_0x8839('0x63')]}});}return null;})[_0x8839('0x1f')](handleEntityNotFound(_0x5aec92,null))[_0x8839('0x1f')](function(_0x6d6260){if(_0x6d6260){_0x5ce994['interaction']=_0x6d6260[_0x8839('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x535248[_0x8839('0x60')]['id'],_0x535248['user'][_0x8839('0x38')],_0x535248['user'][_0x8839('0x68')],_0x5ce994['interaction']['id'],_0x535248['body']?JSON[_0x8839('0x25')](_0x535248[_0x8839('0x57')]):_0x8839('0x7d'));return respondWithRpcPromise('RejectMessage',_0x8839('0x7e'),_0x5ce994);}return null;})[_0x8839('0x1f')](function(_0x590c0c){var _0x31c0f2=_0x8839('0x6b')+_0x590c0c[_0x8839('0x28')]['ContactId'];return db['sequelize'][_0x8839('0x3f')](_0x31c0f2,{'type':db[_0x8839('0x7f')][_0x8839('0x6e')][_0x8839('0x6f')],'raw':!![]})[_0x8839('0x1f')](function(_0x13a66d){return _0x13a66d;});})['then'](function(_0x1d8d7d){if(_0x1d8d7d){_0x5ce994[_0x8839('0x28')][_0x8839('0x70')]=_0x1d8d7d[0x0];if(!_0x535248[_0x8839('0x57')][_0x8839('0x5f')])return;return db[_0x8839('0x71')][_0x8839('0x55')]({'where':{'id':_0x535248[_0x8839('0x57')]['UserId'],'role':_0x8839('0x61')},'attributes':['id','name','fullname',_0x8839('0x72'),_0x8839('0x73')],'raw':!![]});}return null;})[_0x8839('0x1f')](function(_0x461fba){if(!_0x461fba)return null;_0x5ce994[_0x8839('0x28')][_0x8839('0x61')]=_0x461fba;return _0x5ce994;})[_0x8839('0x1f')](function(_0x71bae9){if(_0x71bae9){_0x71bae9[_0x8839('0x28')][_0x8839('0x80')]=util['format'](_0x8839('0x75'),_0x535248['user'][_0x8839('0x38')]);_0x71bae9[_0x8839('0x28')][_0x8839('0x76')]=_0x5ce994['channel'];_0x71bae9['message'][_0x8839('0x77')]=_0x5ce994[_0x8839('0x76')];_0x71bae9[_0x8839('0x28')][_0x8839('0x78')]=_0x8839('0x34');respondWithRpcPromise(_0x8839('0x7a'),_0x8839('0x7a'),{'event':_0x8839('0x81'),'message':_[_0x8839('0x4d')](_0x5ce994[_0x8839('0x28')],JSON['parse'](_0x5ce994[_0x8839('0x66')][_0x8839('0x7c')]))},client9002);return _0x5ce994;}return null;})['then'](respondWithResult(_0x5aec92,null))[_0x8839('0x29')](handleError(_0x5aec92,null));};
\ No newline at end of file
+var _0x363c=['role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','map','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','find','body','describe','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x363c,0x1a0));var _0xc363=function(_0x4a23ca,_0x47836b){_0x4a23ca=_0x4a23ca-0x0;var _0x39f446=_0x363c[_0x4a23ca];return _0x39f446;};'use strict';var emlformat=require(_0xc363('0x0'));var rimraf=require(_0xc363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc363('0x2'));var rp=require(_0xc363('0x3'));var moment=require(_0xc363('0x4'));var BPromise=require(_0xc363('0x5'));var Mustache=require(_0xc363('0x6'));var util=require(_0xc363('0x7'));var path=require('path');var sox=require(_0xc363('0x8'));var csv=require(_0xc363('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc363('0xa'));var _=require(_0xc363('0xb'));var squel=require(_0xc363('0xc'));var crypto=require(_0xc363('0xd'));var jsforce=require(_0xc363('0xe'));var deskjs=require(_0xc363('0xf'));var toCsv=require(_0xc363('0x9'));var querystring=require('querystring');var Papa=require(_0xc363('0x10'));var Redis=require(_0xc363('0x11'));var authService=require(_0xc363('0x12'));var qs=require(_0xc363('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc363('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc363('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc363('0x16')]=_[_0xc363('0x17')](config[_0xc363('0x16')],{'host':_0xc363('0x18'),'port':0x18eb});var socket=require(_0xc363('0x19'))(new Redis(config[_0xc363('0x16')]));require('./chatMessage.socket')[_0xc363('0x1a')](socket);var jayson=require(_0xc363('0x1b'));var client=jayson[_0xc363('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4346fd,_0x1a7d32,_0x1d6895,_0x3e33b8){return new BPromise(function(_0xd41e6f,_0x1d976b){var _0x382ea=_0x3e33b8||client;return _0x382ea['request'](_0x4346fd,_0x1d6895)['then'](function(_0x556bcf){logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');logger['debug'](_0xc363('0x1f'),_0x1a7d32,_0xc363('0x20'),JSON[_0xc363('0x21')](_0x556bcf));if(_0x556bcf['error']){if(_0x556bcf['error'][_0xc363('0x22')]===0x1f4){logger['error'](_0xc363('0x1e'),_0x1a7d32,_0x556bcf['error']['message']);return _0x1d976b(_0x556bcf[_0xc363('0x23')]['message']);}logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x556bcf[_0xc363('0x23')]['message']);return _0xd41e6f(_0x556bcf[_0xc363('0x23')][_0xc363('0x24')]);}else{logger[_0xc363('0x1d')](_0xc363('0x1e'),_0x1a7d32,'request\x20sent');_0xd41e6f(_0x556bcf[_0xc363('0x25')][_0xc363('0x24')]);}})[_0xc363('0x26')](function(_0x58fd82){logger[_0xc363('0x23')](_0xc363('0x1e'),_0x1a7d32,_0x58fd82);_0x1d976b(_0x58fd82);});});}function respondWithStatusCode(_0x5f15f8,_0xecb301){_0xecb301=_0xecb301||0xcc;return function(_0x22ee06){if(_0x22ee06){return _0x5f15f8[_0xc363('0x27')](_0xecb301);}return _0x5f15f8[_0xc363('0x28')](_0xecb301)[_0xc363('0x29')]();};}function respondWithResult(_0x21e95e,_0x118500){_0x118500=_0x118500||0xc8;return function(_0x376f46){if(_0x376f46){return _0x21e95e[_0xc363('0x28')](_0x118500)[_0xc363('0x2a')](_0x376f46);}};}function respondWithFilteredResult(_0x3d1358,_0x27803c){return function(_0x22f4ec){if(_0x22f4ec){var _0x19570b=typeof _0x27803c[_0xc363('0x2b')]===_0xc363('0x2c')&&typeof _0x27803c[_0xc363('0x2d')]===_0xc363('0x2c');var _0xb1edf9=_0x22f4ec[_0xc363('0x2e')];var _0x17cd50=_0x19570b?0x0:_0x27803c['offset'];var _0x474b49=_0x19570b?_0x22f4ec[_0xc363('0x2e')]:_0x27803c[_0xc363('0x2b')]+_0x27803c[_0xc363('0x2d')];var _0x922c42;if(_0x474b49>=_0xb1edf9){_0x474b49=_0xb1edf9;_0x922c42=0xc8;}else{_0x922c42=0xce;}_0x3d1358[_0xc363('0x28')](_0x922c42);return _0x3d1358[_0xc363('0x2f')]('Content-Range',_0x17cd50+'-'+_0x474b49+'/'+_0xb1edf9)['json'](_0x22f4ec);}return null;};}function patchUpdates(_0x2736a5){return function(_0x12e5c0){try{jsonpatch[_0xc363('0x30')](_0x12e5c0,_0x2736a5,!![]);}catch(_0x146968){return BPromise[_0xc363('0x31')](_0x146968);}return _0x12e5c0[_0xc363('0x32')]();};}function saveUpdates(_0xe269c6,_0xdaa9b8){return function(_0x1e6b2f){if(_0x1e6b2f){return _0x1e6b2f[_0xc363('0x33')](_0xe269c6)['then'](function(_0x124765){return _0x124765;});}return null;};}function removeEntity(_0x577feb,_0x1d1772){return function(_0x11a1a7){if(_0x11a1a7){return _0x11a1a7[_0xc363('0x34')]()[_0xc363('0x35')](function(){_0x577feb[_0xc363('0x28')](0xcc)[_0xc363('0x29')]();});}};}function handleEntityNotFound(_0x405162,_0x1a88a8){return function(_0x4eecdc){if(!_0x4eecdc){_0x405162['sendStatus'](0x194);}return _0x4eecdc;};}function handleError(_0x3d08b9,_0x5229dd){_0x5229dd=_0x5229dd||0x1f4;return function(_0x48219e){logger[_0xc363('0x23')](_0x48219e['stack']);if(_0x48219e[_0xc363('0x36')]){delete _0x48219e[_0xc363('0x36')];}_0x3d08b9[_0xc363('0x28')](_0x5229dd)[_0xc363('0x37')](_0x48219e);};}exports[_0xc363('0x38')]=function(_0x267ec9,_0x1171ca){var _0x4663b7={},_0x12b8ea={},_0x4e47ff={'count':0x0,'rows':[]};var _0x3eae6a=_[_0xc363('0x39')](db['ChatMessage']['rawAttributes'],function(_0x16b172){return{'name':_0x16b172['fieldName'],'type':_0x16b172['type'][_0xc363('0x3a')]};});_0x12b8ea[_0xc363('0x3b')]=_[_0xc363('0x39')](_0x3eae6a,_0xc363('0x36'));_0x12b8ea['query']=_['keys'](_0x267ec9[_0xc363('0x3c')]);_0x12b8ea[_0xc363('0x3d')]=_[_0xc363('0x3e')](_0x12b8ea['model'],_0x12b8ea[_0xc363('0x3c')]);_0x4663b7[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x12b8ea['model'],qs[_0xc363('0x40')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x40')]));_0x4663b7[_0xc363('0x3f')]=_0x4663b7[_0xc363('0x3f')]['length']?_0x4663b7['attributes']:_0x12b8ea[_0xc363('0x3b')];if(!_0x267ec9['query'][_0xc363('0x41')](_0xc363('0x42'))){_0x4663b7['limit']=qs[_0xc363('0x2d')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2d')]);_0x4663b7[_0xc363('0x2b')]=qs['offset'](_0x267ec9[_0xc363('0x3c')][_0xc363('0x2b')]);}_0x4663b7[_0xc363('0x43')]=qs[_0xc363('0x44')](_0x267ec9[_0xc363('0x3c')][_0xc363('0x44')]);_0x4663b7[_0xc363('0x45')]=qs[_0xc363('0x3d')](_[_0xc363('0x46')](_0x267ec9[_0xc363('0x3c')],_0x12b8ea[_0xc363('0x3d')]),_0x3eae6a);if(_0x267ec9[_0xc363('0x3c')]['filter']){_0x4663b7['where']=_[_0xc363('0x47')](_0x4663b7[_0xc363('0x45')],{'$or':_['map'](_0x3eae6a,function(_0x18ba8c){if(_0x18ba8c[_0xc363('0x48')]!==_0xc363('0x49')){var _0x2495be={};_0x2495be[_0x18ba8c['name']]={'$like':'%'+_0x267ec9[_0xc363('0x3c')][_0xc363('0x4a')]+'%'};return _0x2495be;}})});}_0x4663b7=_[_0xc363('0x47')]({},_0x4663b7,_0x267ec9[_0xc363('0x4b')]);var _0x4eee70={'where':_0x4663b7['where']};return db[_0xc363('0x4c')]['count'](_0x4eee70)[_0xc363('0x35')](function(_0x351738){_0x4e47ff[_0xc363('0x2e')]=_0x351738;if(_0x267ec9[_0xc363('0x3c')][_0xc363('0x4d')]){_0x4663b7[_0xc363('0x4e')]=[{'all':!![]}];}return db[_0xc363('0x4c')][_0xc363('0x4f')](_0x4663b7);})['then'](function(_0x5056fb){_0x4e47ff[_0xc363('0x50')]=_0x5056fb;return _0x4e47ff;})['then'](respondWithFilteredResult(_0x1171ca,_0x4663b7))[_0xc363('0x26')](handleError(_0x1171ca,null));};exports[_0xc363('0x51')]=function(_0x437f5e,_0x1aa0bd){var _0x1e665d={'raw':!![],'where':{'id':_0x437f5e[_0xc363('0x52')]['id']}},_0x3c73bf={};_0x3c73bf['model']=_[_0xc363('0x53')](db[_0xc363('0x4c')][_0xc363('0x54')]);_0x3c73bf[_0xc363('0x3c')]=_[_0xc363('0x53')](_0x437f5e[_0xc363('0x3c')]);_0x3c73bf[_0xc363('0x3d')]=_['intersection'](_0x3c73bf[_0xc363('0x3b')],_0x3c73bf[_0xc363('0x3c')]);_0x1e665d[_0xc363('0x3f')]=_[_0xc363('0x3e')](_0x3c73bf[_0xc363('0x3b')],qs['fields'](_0x437f5e[_0xc363('0x3c')][_0xc363('0x40')]));_0x1e665d[_0xc363('0x3f')]=_0x1e665d[_0xc363('0x3f')][_0xc363('0x55')]?_0x1e665d[_0xc363('0x3f')]:_0x3c73bf[_0xc363('0x3b')];if(_0x437f5e[_0xc363('0x3c')][_0xc363('0x4d')]){_0x1e665d[_0xc363('0x4e')]=[{'all':!![]}];}_0x1e665d=_[_0xc363('0x47')]({},_0x1e665d,_0x437f5e['options']);return db[_0xc363('0x4c')][_0xc363('0x56')](_0x1e665d)[_0xc363('0x35')](handleEntityNotFound(_0x1aa0bd,null))[_0xc363('0x35')](respondWithResult(_0x1aa0bd,null))['catch'](handleError(_0x1aa0bd,null));};exports['create']=function(_0x5548f1,_0x9ded8a){return db[_0xc363('0x4c')]['create'](_0x5548f1['body'],{})[_0xc363('0x35')](respondWithResult(_0x9ded8a,0xc9))['catch'](handleError(_0x9ded8a,null));};exports[_0xc363('0x33')]=function(_0x4d382b,_0x152ab2){if(_0x4d382b[_0xc363('0x57')]['id']){delete _0x4d382b[_0xc363('0x57')]['id'];}return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4d382b['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x152ab2,null))[_0xc363('0x35')](saveUpdates(_0x4d382b[_0xc363('0x57')],null))[_0xc363('0x35')](respondWithResult(_0x152ab2,null))[_0xc363('0x26')](handleError(_0x152ab2,null));};exports[_0xc363('0x34')]=function(_0x3be9a5,_0x2edaf9){return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x3be9a5['params']['id']}})[_0xc363('0x35')](handleEntityNotFound(_0x2edaf9,null))[_0xc363('0x35')](removeEntity(_0x2edaf9,null))['catch'](handleError(_0x2edaf9,null));};exports[_0xc363('0x58')]=function(_0x3ac9d6,_0x1560b0){return db[_0xc363('0x4c')][_0xc363('0x58')]()[_0xc363('0x35')](respondWithResult(_0x1560b0,null))[_0xc363('0x26')](handleError(_0x1560b0,null));};var interaction_log=require(_0xc363('0x59'))(_0xc363('0x5a'));exports[_0xc363('0x5b')]=function(_0x4844a3,_0xb39bdf,_0x5b300d){var _0x36a7e4={'agent':{},'channel':_0xc363('0x5c')};if(_0x4844a3['body']['id']){delete _0x4844a3[_0xc363('0x57')]['id'];}_0x4844a3[_0xc363('0x57')]['read']=!![];_0x4844a3['body']['readAt']=moment()[_0xc363('0x5d')](_0xc363('0x5e'));_0x4844a3[_0xc363('0x57')][_0xc363('0x5f')]=_0x4844a3['body'][_0xc363('0x5f')]||_0x4844a3[_0xc363('0x60')]['id'];_0x36a7e4[_0xc363('0x61')]['id']=_0x4844a3['body']['UserId'];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x4844a3[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](saveUpdates(_0x4844a3[_0xc363('0x57')],null))[_0xc363('0x35')](function(_0x48db71){if(_0x48db71){_0x36a7e4[_0xc363('0x24')]=_0x48db71[_0xc363('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x48db71[_0xc363('0x63')]}});}return null;})[_0xc363('0x35')](handleEntityNotFound(_0xb39bdf,null))[_0xc363('0x35')](function(_0xd01717){if(_0xd01717){return _0xd01717[_0xc363('0x33')]({'UserId':_0x4844a3['body'][_0xc363('0x5f')],'read1stAt':_[_0xc363('0x64')](_0xd01717[_0xc363('0x65')])?moment()[_0xc363('0x5d')](_0xc363('0x5e')):undefined});}return null;})[_0xc363('0x35')](function(_0x2da7a1){if(_0x2da7a1){_0x36a7e4[_0xc363('0x66')]=_0x2da7a1[_0xc363('0x62')]({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x67'),_0x4844a3[_0xc363('0x60')]['id'],_0x4844a3['user'][_0xc363('0x36')],_0x4844a3['user'][_0xc363('0x68')],_0x36a7e4[_0xc363('0x66')]['id'],_0x4844a3[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x4844a3[_0xc363('0x57')]):'null');return respondWithRpcPromise(_0xc363('0x69'),'acceptMessage',_0x36a7e4);}return null;})['then'](function(_0x37f876){var _0x46e6fe=_0xc363('0x6a')+_0x37f876[_0xc363('0x24')][_0xc363('0x6b')];return db[_0xc363('0x6c')]['query'](_0x46e6fe,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x3d6ec9){return _0x3d6ec9;});})[_0xc363('0x35')](function(_0x36d3e7){if(_0x36d3e7){_0x36a7e4[_0xc363('0x24')][_0xc363('0x70')]=_0x36d3e7[0x0];if(!_0x4844a3['body'][_0xc363('0x5f')])return;return db[_0xc363('0x71')][_0xc363('0x56')]({'where':{'id':_0x4844a3['body'][_0xc363('0x5f')],'role':'agent'},'attributes':['id',_0xc363('0x36'),_0xc363('0x72'),_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x515198){if(!_0x515198)return null;_0x36a7e4['message']['agent']=_0x515198;return _0x36a7e4;})[_0xc363('0x35')](function(_0x3b78e7){if(_0x3b78e7){if(_0x4844a3[_0xc363('0x57')][_0xc363('0x75')]){_0x36a7e4['message'][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x4844a3['user'][_0xc363('0x36')]);_0x36a7e4[_0xc363('0x24')]['channel']=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x79')]=_0x36a7e4[_0xc363('0x78')];_0x36a7e4[_0xc363('0x24')][_0xc363('0x7a')]=_0xc363('0x5b');return respondWithRpcPromise(_0xc363('0x7b'),_0xc363('0x7b'),{'event':_0xc363('0x7c'),'message':_[_0xc363('0x47')](_0x36a7e4[_0xc363('0x24')],JSON['parse'](_0x36a7e4['interaction'][_0xc363('0x7d')]))},client9002)['then'](function(){return _0x36a7e4;});}return _0x36a7e4;}return null;})['then'](respondWithResult(_0xb39bdf,null))[_0xc363('0x26')](handleError(_0xb39bdf,null));};var interaction_log=require(_0xc363('0x59'))('chat-interactions');exports[_0xc363('0x31')]=function(_0x128fcb,_0x583f59,_0xacef53){var _0x225e4e={'agent':{},'channel':_0xc363('0x5c')};if(_0x128fcb['body']['id']){delete _0x128fcb[_0xc363('0x57')]['id'];}_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')]||_0x128fcb['user']['id'];_0x225e4e[_0xc363('0x61')]['id']=_0x128fcb[_0xc363('0x57')][_0xc363('0x5f')];return db[_0xc363('0x4c')][_0xc363('0x56')]({'where':{'id':_0x128fcb[_0xc363('0x52')]['id'],'UserId':null}})[_0xc363('0x35')](handleEntityNotFound(_0x583f59,null))['then'](function(_0x147133){if(_0x147133){_0x225e4e['message']=_0x147133['get']({'plain':!![]});return db['ChatInteraction'][_0xc363('0x56')]({'where':{'id':_0x147133[_0xc363('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x583f59,null))[_0xc363('0x35')](function(_0x5b86ab){if(_0x5b86ab){_0x225e4e[_0xc363('0x66')]=_0x5b86ab['get']({'plain':!![]});interaction_log[_0xc363('0x1d')](_0xc363('0x7e'),_0x128fcb['user']['id'],_0x128fcb['user']['name'],_0x128fcb[_0xc363('0x60')][_0xc363('0x68')],_0x225e4e[_0xc363('0x66')]['id'],_0x128fcb[_0xc363('0x57')]?JSON[_0xc363('0x21')](_0x128fcb['body']):_0xc363('0x7f'));return respondWithRpcPromise('RejectMessage',_0xc363('0x80'),_0x225e4e);}return null;})[_0xc363('0x35')](function(_0x546227){var _0x31354f=_0xc363('0x6a')+_0x546227['message']['ContactId'];return db[_0xc363('0x6c')][_0xc363('0x3c')](_0x31354f,{'type':db[_0xc363('0x6d')][_0xc363('0x6e')][_0xc363('0x6f')],'raw':!![]})[_0xc363('0x35')](function(_0x1e6c15){return _0x1e6c15;});})['then'](function(_0x2fd8dc){if(_0x2fd8dc){_0x225e4e[_0xc363('0x24')][_0xc363('0x70')]=_0x2fd8dc[0x0];if(!_0x128fcb['body'][_0xc363('0x5f')])return;return db['User'][_0xc363('0x56')]({'where':{'id':_0x128fcb['body']['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xc363('0x73'),_0xc363('0x74')],'raw':!![]});}return null;})['then'](function(_0x25973d){if(!_0x25973d)return null;_0x225e4e['message']['agent']=_0x25973d;return _0x225e4e;})[_0xc363('0x35')](function(_0x2a6b0a){if(_0x2a6b0a){_0x2a6b0a[_0xc363('0x24')][_0xc363('0x76')]=util['format'](_0xc363('0x77'),_0x128fcb[_0xc363('0x60')]['name']);_0x2a6b0a[_0xc363('0x24')][_0xc363('0x78')]=_0x225e4e[_0xc363('0x78')];_0x2a6b0a['message']['motionChannel']=_0x225e4e[_0xc363('0x78')];_0x2a6b0a[_0xc363('0x24')][_0xc363('0x7a')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xc363('0x81'),'message':_[_0xc363('0x47')](_0x225e4e[_0xc363('0x24')],JSON['parse'](_0x225e4e[_0xc363('0x66')][_0xc363('0x7d')]))},client9002);return _0x225e4e;}return null;})[_0xc363('0x35')](respondWithResult(_0x583f59,null))[_0xc363('0x26')](handleError(_0x583f59,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index acc7038..7ab13a9 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 _0xb369=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x2bc16a,_0x308cda){var _0x2b82dc=function(_0x75a795){while(--_0x75a795){_0x2bc16a['push'](_0x2bc16a['shift']());}};_0x2b82dc(++_0x308cda);}(_0xb369,0x168));var _0x9b36=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb369[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x9b36('0x0'));var ChatMessage=require(_0x9b36('0x1'))['db'][_0x9b36('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9b36('0x3')](0x0);var events={'afterCreate':_0x9b36('0x4'),'afterUpdate':_0x9b36('0x5'),'afterDestroy':_0x9b36('0x6')};function emitEvent(_0x239a7d){return function(_0xb2f3da,_0xef50f5,_0x5d67db){ChatMessageEvents[_0x9b36('0x7')](_0x239a7d+':'+_0xb2f3da['id'],_0xb2f3da);ChatMessageEvents['emit'](_0x239a7d,_0xb2f3da);_0x5d67db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9b36('0x8')](e,emitEvent(event));}}module[_0x9b36('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2ced=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4376db,_0x597fb9){var _0x3b522b=function(_0x299f4b){while(--_0x299f4b){_0x4376db['push'](_0x4376db['shift']());}};_0x3b522b(++_0x597fb9);}(_0x2ced,0x1ef));var _0xd2ce=function(_0x555678,_0x19c01d){_0x555678=_0x555678-0x0;var _0x59444b=_0x2ced[_0x555678];return _0x59444b;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xd2ce('0x0'))['db'][_0xd2ce('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd2ce('0x2')](0x0);var events={'afterCreate':_0xd2ce('0x3'),'afterUpdate':_0xd2ce('0x4'),'afterDestroy':'remove'};function emitEvent(_0x217cc7){return function(_0x7fb897,_0x466aad,_0x256174){ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7+':'+_0x7fb897['id'],_0x7fb897);ChatMessageEvents[_0xd2ce('0x5')](_0x217cc7,_0x7fb897);_0x256174(null);};}for(var e in events){if(events[_0xd2ce('0x6')](e)){var event=events[e];ChatMessage[_0xd2ce('0x7')](e,emitEvent(event));}}module[_0xd2ce('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 1446bac..e848882 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 _0x6a26=['moment','bluebird','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','lodash','util','../../config/logger'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x6a26,0x14f));var _0x66a2=function(_0x2f3864,_0x1e15c0){_0x2f3864=_0x2f3864-0x0;var _0x309073=_0x6a26[_0x2f3864];return _0x309073;};'use strict';var _=require(_0x66a2('0x0'));var util=require(_0x66a2('0x1'));var logger=require(_0x66a2('0x2'))('api');var moment=require(_0x66a2('0x3'));var BPromise=require(_0x66a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66a2('0x5'));var rimraf=require('rimraf');var config=require(_0x66a2('0x6'));var attributes=require(_0x66a2('0x7'));module['exports']=function(_0x1264ad,_0x57ebc9){return _0x1264ad[_0x66a2('0x8')](_0x66a2('0x9'),attributes,{'tableName':_0x66a2('0xa'),'paranoid':![],'indexes':[{'name':_0x66a2('0xb'),'fields':[_0x66a2('0xc')],'type':_0x66a2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x454719,_0x1fe7cf,_0x49993d){var _0x556366=_0x1264ad['models'];var _0x39c68c=_0x454719[_0x66a2('0xe')]({'plain':!![]});if(_0x39c68c[_0x66a2('0xf')]['toLowerCase']()==='in'||_0x39c68c['direction'][_0x66a2('0x10')]()==='out'&&!_0x39c68c[_0x66a2('0x11')]&&!_[_0x66a2('0x12')](_0x39c68c[_0x66a2('0x13')])){_0x556366[_0x66a2('0x14')][_0x66a2('0x15')]({'where':{'id':_0x39c68c[_0x66a2('0x16')]}})[_0x66a2('0x17')](function(_0x2669af){if(_0x2669af){_0x2669af['update']({'lastMsgAt':_0x39c68c[_0x66a2('0x18')],'lastMsgDirection':_0x39c68c[_0x66a2('0xf')][_0x66a2('0x10')]()});}})[_0x66a2('0x19')](function(_0x4e7977){console['error'](_0x4e7977);});}_0x49993d();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3819=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x3819,0x83));var _0x9381=function(_0xd50738,_0x2f195e){_0xd50738=_0xd50738-0x0;var _0x162f8f=_0x3819[_0xd50738];return _0x162f8f;};'use strict';var _=require('lodash');var util=require(_0x9381('0x0'));var logger=require('../../config/logger')(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rp=require(_0x9381('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9381('0x5'));var attributes=require(_0x9381('0x6'));module[_0x9381('0x7')]=function(_0x1d0cf5,_0x52577f){return _0x1d0cf5['define'](_0x9381('0x8'),attributes,{'tableName':_0x9381('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x9381('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x79065c,_0x4c0c31,_0x302fa7){var _0x2357d6=_0x1d0cf5[_0x9381('0xb')];var _0x50b0c3=_0x79065c['get']({'plain':!![]});if(_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()==='in'||_0x50b0c3['direction'][_0x9381('0xd')]()==='out'&&!_0x50b0c3[_0x9381('0xe')]&&!_[_0x9381('0xf')](_0x50b0c3['UserId'])){_0x2357d6[_0x9381('0x10')][_0x9381('0x11')]({'where':{'id':_0x50b0c3[_0x9381('0x12')]}})[_0x9381('0x13')](function(_0x52826a){if(_0x52826a){_0x52826a['update']({'lastMsgAt':_0x50b0c3[_0x9381('0x14')],'lastMsgDirection':_0x50b0c3[_0x9381('0xc')][_0x9381('0xd')]()});}})[_0x9381('0x15')](function(_0xc44fb8){console[_0x9381('0x16')](_0xc44fb8);});}_0x302fa7();}},'charset':_0x9381('0x17'),'collate':_0x9381('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f4f996f..1eb99c6 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 _0x0686=['localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x123578,_0x3203ef){var _0x5d1bde=function(_0x5dc668){while(--_0x5dc668){_0x123578['push'](_0x123578['shift']());}};_0x5d1bde(++_0x3203ef);}(_0x0686,0x123));var _0x6068=function(_0x201fcc,_0x103048){_0x201fcc=_0x201fcc-0x0;var _0x23c66d=_0x0686[_0x201fcc];return _0x23c66d;};'use strict';var _=require(_0x6068('0x0'));var util=require(_0x6068('0x1'));var moment=require(_0x6068('0x2'));var BPromise=require(_0x6068('0x3'));var rs=require(_0x6068('0x4'));var fs=require('fs');var Redis=require(_0x6068('0x5'));var db=require(_0x6068('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6068('0x7'))(_0x6068('0x8'));var config=require(_0x6068('0x9'));var jayson=require(_0x6068('0xa'));var client=jayson[_0x6068('0xb')][_0x6068('0xc')]({'port':0x232a});config[_0x6068('0xd')]=_[_0x6068('0xe')](config[_0x6068('0xd')],{'host':_0x6068('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6068('0xd')]));require(_0x6068('0x10'))[_0x6068('0x11')](socket);function respondWithRpcPromise(_0x18a7d0,_0x29d37b,_0x3d27cf){return new BPromise(function(_0xbb38d9,_0x52e03f){return client[_0x6068('0x12')](_0x18a7d0,_0x3d27cf)[_0x6068('0x13')](function(_0x20453d){logger[_0x6068('0x14')](_0x6068('0x15'),_0x29d37b,'request\x20sent');logger[_0x6068('0x16')](_0x6068('0x17'),_0x29d37b,'request\x20sent',JSON[_0x6068('0x18')](_0x20453d));if(_0x20453d[_0x6068('0x19')]){if(_0x20453d[_0x6068('0x19')][_0x6068('0x1a')]===0x1f4){logger[_0x6068('0x19')](_0x6068('0x15'),_0x29d37b,_0x20453d[_0x6068('0x19')][_0x6068('0x1b')]);return _0x52e03f(_0x20453d[_0x6068('0x19')]['message']);}logger[_0x6068('0x19')](_0x6068('0x15'),_0x29d37b,_0x20453d['error'][_0x6068('0x1b')]);return _0xbb38d9(_0x20453d[_0x6068('0x19')][_0x6068('0x1b')]);}else{logger[_0x6068('0x14')]('ChatMessage,\x20%s,\x20%s',_0x29d37b,'request\x20sent');_0xbb38d9(_0x20453d[_0x6068('0x1c')][_0x6068('0x1b')]);}})[_0x6068('0x1d')](function(_0xf66d6e){logger['error']('ChatMessage,\x20%s,\x20%s',_0x29d37b,_0xf66d6e);_0x52e03f(_0xf66d6e);});});}exports[_0x6068('0x1e')]=function(_0x391994){var _0x28a383=this;return new Promise(function(_0x4fb041,_0x247c2d){return db[_0x6068('0x1f')][_0x6068('0x20')](_0x391994['body'],{'raw':_0x391994['options']?_0x391994['options'][_0x6068('0x21')]===undefined?!![]:![]:!![]})[_0x6068('0x13')](function(_0x1b4f91){logger[_0x6068('0x14')](_0x6068('0x1e'),_0x391994);logger[_0x6068('0x16')](_0x6068('0x1e'),_0x391994,JSON[_0x6068('0x18')](_0x1b4f91));_0x4fb041(_0x1b4f91);})['catch'](function(_0x251a76){logger[_0x6068('0x19')]('CreateChatMessage',_0x251a76[_0x6068('0x1b')],_0x391994);_0x247c2d(_0x28a383[_0x6068('0x19')](0x1f4,_0x251a76[_0x6068('0x1b')]));});});};
\ No newline at end of file
+var _0xafea=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','defaults','localhost','redis','./chatMessage.socket','request'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xafea,0x1e0));var _0xaafe=function(_0x553c38,_0x5f53f4){_0x553c38=_0x553c38-0x0;var _0x5d8038=_0xafea[_0x553c38];return _0x5d8038;};'use strict';var _=require('lodash');var util=require(_0xaafe('0x0'));var moment=require(_0xaafe('0x1'));var BPromise=require(_0xaafe('0x2'));var rs=require(_0xaafe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafe('0x4'))['db'];var utils=require(_0xaafe('0x5'));var logger=require('../../config/logger')(_0xaafe('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaafe('0x7')]['http']({'port':0x232a});config['redis']=_[_0xaafe('0x8')](config['redis'],{'host':_0xaafe('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaafe('0xa')]));require(_0xaafe('0xb'))['register'](socket);function respondWithRpcPromise(_0x576b51,_0x3b0750,_0x497a78){return new BPromise(function(_0x3529cc,_0x1cf969){return client[_0xaafe('0xc')](_0x576b51,_0x497a78)['then'](function(_0x35d921){logger[_0xaafe('0xd')](_0xaafe('0xe'),_0x3b0750,_0xaafe('0xf'));logger[_0xaafe('0x10')](_0xaafe('0x11'),_0x3b0750,'request\x20sent',JSON[_0xaafe('0x12')](_0x35d921));if(_0x35d921[_0xaafe('0x13')]){if(_0x35d921[_0xaafe('0x13')]['code']===0x1f4){logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x1cf969(_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);}logger[_0xaafe('0x13')](_0xaafe('0xe'),_0x3b0750,_0x35d921[_0xaafe('0x13')][_0xaafe('0x14')]);return _0x3529cc(_0x35d921[_0xaafe('0x13')]['message']);}else{logger[_0xaafe('0xd')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,'request\x20sent');_0x3529cc(_0x35d921['result'][_0xaafe('0x14')]);}})[_0xaafe('0x15')](function(_0x58961f){logger[_0xaafe('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3b0750,_0x58961f);_0x1cf969(_0x58961f);});});}exports[_0xaafe('0x16')]=function(_0x43a6ea){var _0x226ef9=this;return new Promise(function(_0x4840c9,_0x506881){return db[_0xaafe('0x17')][_0xaafe('0x18')](_0x43a6ea[_0xaafe('0x19')],{'raw':_0x43a6ea['options']?_0x43a6ea[_0xaafe('0x1a')][_0xaafe('0x1b')]===undefined?!![]:![]:!![]})[_0xaafe('0x1c')](function(_0x3ce964){logger[_0xaafe('0xd')](_0xaafe('0x16'),_0x43a6ea);logger[_0xaafe('0x10')](_0xaafe('0x16'),_0x43a6ea,JSON[_0xaafe('0x12')](_0x3ce964));_0x4840c9(_0x3ce964);})[_0xaafe('0x15')](function(_0x48baf2){logger[_0xaafe('0x13')](_0xaafe('0x16'),_0x48baf2['message'],_0x43a6ea);_0x506881(_0x226ef9[_0xaafe('0x13')](0x1f4,_0x48baf2[_0xaafe('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8cd90c4..201ab52 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 _0x6c7b=['register','chatMessage:','./chatMessage.events','emit','removeListener'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x3ff06f,_0x591b14){_0x3ff06f=_0x3ff06f-0x0;var _0x152633=_0x6c7b[_0x3ff06f];return _0x152633;};'use strict';var ChatMessageEvents=require(_0xb6c7('0x0'));var events=['save','remove','update'];function createListener(_0x3f3910,_0x5528b3){return function(_0x2b678a){_0x5528b3[_0xb6c7('0x1')](_0x3f3910,_0x2b678a);};}function removeListener(_0x35674b,_0x5857e0){return function(){ChatMessageEvents[_0xb6c7('0x2')](_0x35674b,_0x5857e0);};}exports[_0xb6c7('0x3')]=function(_0xfe3eb9){for(var _0x219abc=0x0,_0xb889c3=events['length'];_0x219abc<_0xb889c3;_0x219abc++){var _0x12e97e=events[_0x219abc];var _0x41a5a5=createListener(_0xb6c7('0x4')+_0x12e97e,_0xfe3eb9);ChatMessageEvents['on'](_0x12e97e,_0x41a5a5);}};
\ No newline at end of file
+var _0x0fda=['register','length','./chatMessage.events','remove','update','emit'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x92972,_0x2206b2){_0x92972=_0x92972-0x0;var _0x28a061=_0x0fda[_0x92972];return _0x28a061;};'use strict';var ChatMessageEvents=require(_0xa0fd('0x0'));var events=['save',_0xa0fd('0x1'),_0xa0fd('0x2')];function createListener(_0x314a1a,_0x2f71f3){return function(_0x426242){_0x2f71f3[_0xa0fd('0x3')](_0x314a1a,_0x426242);};}function removeListener(_0x13c734,_0x574fca){return function(){ChatMessageEvents['removeListener'](_0x13c734,_0x574fca);};}exports[_0xa0fd('0x4')]=function(_0x4aec58){for(var _0x49b3c1=0x0,_0x868183=events[_0xa0fd('0x5')];_0x49b3c1<_0x868183;_0x49b3c1++){var _0x1aab41=events[_0x49b3c1];var _0x248cca=createListener('chatMessage:'+_0x1aab41,_0x4aec58);ChatMessageEvents['on'](_0x1aab41,_0x248cca);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c72a796..8b8af03 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 _0x5fe3=['update','accept','put','/:id/reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','./chatMessage.controller','get','index','isAuthenticated','describe','show','post','tracked','chat','create','/:id'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0x5fe3,0x18d));var _0x35fe=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x5fe3[_0x5a1cc9];return _0x471761;};'use strict';var multer=require(_0x35fe('0x0'));var util=require('util');var path=require(_0x35fe('0x1'));var timeout=require(_0x35fe('0x2'));var express=require(_0x35fe('0x3'));var router=express[_0x35fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x35fe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35fe('0x6'));router[_0x35fe('0x7')]('/',auth['isAuthenticated'](),controller[_0x35fe('0x8')]);router[_0x35fe('0x7')]('/describe',auth[_0x35fe('0x9')](),controller[_0x35fe('0xa')]);router[_0x35fe('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x35fe('0xb')]);router[_0x35fe('0xc')]('/',auth['isAuthenticated'](),interaction[_0x35fe('0xd')](_0x35fe('0xe'),'chatmessage:create'),controller[_0x35fe('0xf')]);router['put'](_0x35fe('0x10'),controller[_0x35fe('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x35fe('0x12')]);router[_0x35fe('0x13')](_0x35fe('0x14'),auth[_0x35fe('0x9')](),controller['reject']);router[_0x35fe('0x15')](_0x35fe('0x10'),auth['isAuthenticated'](),controller[_0x35fe('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xdb41=['accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xdb41,0x1e1));var _0x1db4=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0xdb41[_0x5b26cb];return _0x563d12;};'use strict';var multer=require('multer');var util=require(_0x1db4('0x0'));var path=require(_0x1db4('0x1'));var timeout=require(_0x1db4('0x2'));var express=require(_0x1db4('0x3'));var router=express['Router']();var fs_extra=require(_0x1db4('0x4'));var auth=require(_0x1db4('0x5'));var interaction=require(_0x1db4('0x6'));var config=require(_0x1db4('0x7'));var controller=require(_0x1db4('0x8'));router[_0x1db4('0x9')]('/',auth[_0x1db4('0xa')](),controller[_0x1db4('0xb')]);router['get'](_0x1db4('0xc'),auth['isAuthenticated'](),controller[_0x1db4('0xd')]);router[_0x1db4('0x9')](_0x1db4('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1db4('0xf')]('/',auth[_0x1db4('0xa')](),interaction[_0x1db4('0x10')](_0x1db4('0x11'),_0x1db4('0x12')),controller[_0x1db4('0x13')]);router[_0x1db4('0x14')](_0x1db4('0xe'),controller[_0x1db4('0x15')]);router[_0x1db4('0x14')](_0x1db4('0x16'),auth['isAuthenticated'](),controller[_0x1db4('0x17')]);router[_0x1db4('0x14')](_0x1db4('0x18'),auth[_0x1db4('0xa')](),controller['reject']);router[_0x1db4('0x19')](_0x1db4('0xe'),auth[_0x1db4('0xa')](),controller[_0x1db4('0x1a')]);module[_0x1db4('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b5ca77a..065e853 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 _0x6c27=['exports','TEXT','medium','sequelize'];(function(_0x1ce8c3,_0x85454b){var _0x85b036=function(_0x385a19){while(--_0x385a19){_0x1ce8c3['push'](_0x1ce8c3['shift']());}};_0x85b036(++_0x85454b);}(_0x6c27,0x19b));var _0x76c2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6c27[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x76c2('0x0'));module[_0x76c2('0x1')]={'body':{'type':Sequelize[_0x76c2('0x2')](_0x76c2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x9c9a=['exports','medium'];(function(_0x2e1578,_0x102dbb){var _0x371a8e=function(_0x4ac106){while(--_0x4ac106){_0x2e1578['push'](_0x2e1578['shift']());}};_0x371a8e(++_0x102dbb);}(_0x9c9a,0xfa));var _0xa9c9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9c9a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xa9c9('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa9c9('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index f62fed9..f7a1129 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(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7a54,0x106));var _0x47a5=function(_0x49aa0c,_0x193ac8){_0x49aa0c=_0x49aa0c-0x0;var _0x3cb64a=_0x7a54[_0x49aa0c];return _0x3cb64a;};'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(_0x31c469,_0x391c91){var _0x3a2ac2=function(_0x5ee2bf){while(--_0x5ee2bf){_0x31c469['push'](_0x31c469['shift']());}};_0x3a2ac2(++_0x391c91);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 6875c82..34c23bf 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 _0x2804=['../../config/environment','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f65ee,_0x3b15c8){var _0x2f9c47=function(_0x1b7d24){while(--_0x1b7d24){_0x3f65ee['push'](_0x3f65ee['shift']());}};_0x2f9c47(++_0x3b15c8);}(_0x2804,0x1cc));var _0x4280=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4280('0x0'));var util=require(_0x4280('0x1'));var logger=require(_0x4280('0x2'))(_0x4280('0x3'));var moment=require(_0x4280('0x4'));var BPromise=require(_0x4280('0x5'));var rp=require(_0x4280('0x6'));var fs=require('fs');var path=require(_0x4280('0x7'));var rimraf=require('rimraf');var config=require(_0x4280('0x8'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x8a9941,_0x28083c){return _0x8a9941['define'](_0x4280('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4280('0xa'),'collate':_0x4280('0xb')});};
\ No newline at end of file
+var _0x386a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x386a,0x1de));var _0xa386=function(_0x5ac24a,_0x135289){_0x5ac24a=_0x5ac24a-0x0;var _0x4e3896=_0x386a[_0x5ac24a];return _0x4e3896;};'use strict';var _=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var logger=require(_0xa386('0x2'))(_0xa386('0x3'));var moment=require('moment');var BPromise=require(_0xa386('0x4'));var rp=require(_0xa386('0x5'));var fs=require('fs');var path=require(_0xa386('0x6'));var rimraf=require(_0xa386('0x7'));var config=require('../../config/environment');var attributes=require(_0xa386('0x8'));module[_0xa386('0x9')]=function(_0x40c728,_0x4bdd33){return _0x40c728[_0xa386('0xa')](_0xa386('0xb'),attributes,{'tableName':_0xa386('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa386('0xd'),'collate':_0xa386('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 5969aed..a5bd49b 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 _0xab3d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13cd20,_0x1d9211){var _0x22b6de=function(_0x4b574f){while(--_0x4b574f){_0x13cd20['push'](_0x13cd20['shift']());}};_0x22b6de(++_0x1d9211);}(_0xab3d,0x82));var _0xdab3=function(_0xd18e83,_0x54afac){_0xd18e83=_0xd18e83-0x0;var _0x40b79f=_0xab3d[_0xd18e83];return _0x40b79f;};'use strict';var _=require(_0xdab3('0x0'));var util=require(_0xdab3('0x1'));var moment=require('moment');var BPromise=require(_0xdab3('0x2'));var rs=require(_0xdab3('0x3'));var fs=require('fs');var Redis=require(_0xdab3('0x4'));var db=require(_0xdab3('0x5'))['db'];var utils=require(_0xdab3('0x6'));var logger=require(_0xdab3('0x7'))(_0xdab3('0x8'));var config=require(_0xdab3('0x9'));var jayson=require(_0xdab3('0xa'));var client=jayson[_0xdab3('0xb')][_0xdab3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b77c0,_0x1079f0,_0x2e2fd7){return new BPromise(function(_0xa13e33,_0x594d3a){return client[_0xdab3('0xd')](_0x5b77c0,_0x2e2fd7)[_0xdab3('0xe')](function(_0x3f3b4e){logger[_0xdab3('0xf')](_0xdab3('0x10'),_0x1079f0,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1079f0,_0xdab3('0x11'),JSON[_0xdab3('0x12')](_0x3f3b4e));if(_0x3f3b4e[_0xdab3('0x13')]){if(_0x3f3b4e[_0xdab3('0x13')][_0xdab3('0x14')]===0x1f4){logger[_0xdab3('0x13')](_0xdab3('0x10'),_0x1079f0,_0x3f3b4e[_0xdab3('0x13')][_0xdab3('0x15')]);return _0x594d3a(_0x3f3b4e[_0xdab3('0x13')]['message']);}logger['error'](_0xdab3('0x10'),_0x1079f0,_0x3f3b4e[_0xdab3('0x13')]['message']);return _0xa13e33(_0x3f3b4e[_0xdab3('0x13')]['message']);}else{logger[_0xdab3('0xf')](_0xdab3('0x10'),_0x1079f0,_0xdab3('0x11'));_0xa13e33(_0x3f3b4e[_0xdab3('0x16')]['message']);}})['catch'](function(_0x2dc8a4){logger['error'](_0xdab3('0x10'),_0x1079f0,_0x2dc8a4);_0x594d3a(_0x2dc8a4);});});}
\ No newline at end of file
+var _0x597b=['result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x597b,0xc7));var _0xb597=function(_0x1909a3,_0x106e97){_0x1909a3=_0x1909a3-0x0;var _0xab8ee8=_0x597b[_0x1909a3];return _0xab8ee8;};'use strict';var _=require('lodash');var util=require(_0xb597('0x0'));var moment=require(_0xb597('0x1'));var BPromise=require(_0xb597('0x2'));var rs=require(_0xb597('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb597('0x5'))(_0xb597('0x6'));var config=require(_0xb597('0x7'));var jayson=require(_0xb597('0x8'));var client=jayson[_0xb597('0x9')][_0xb597('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc48,_0x29ea54,_0x2a3d88){return new BPromise(function(_0x17310d,_0x5b5f33){return client[_0xb597('0xb')](_0x4bbc48,_0x2a3d88)[_0xb597('0xc')](function(_0x2b70cf){logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,'request\x20sent');logger[_0xb597('0xf')](_0xb597('0x10'),_0x29ea54,_0xb597('0x11'),JSON['stringify'](_0x2b70cf));if(_0x2b70cf[_0xb597('0x12')]){if(_0x2b70cf[_0xb597('0x12')][_0xb597('0x13')]===0x1f4){logger[_0xb597('0x12')](_0xb597('0xe'),_0x29ea54,_0x2b70cf['error']['message']);return _0x5b5f33(_0x2b70cf['error']['message']);}logger['error'](_0xb597('0xe'),_0x29ea54,_0x2b70cf[_0xb597('0x12')][_0xb597('0x14')]);return _0x17310d(_0x2b70cf[_0xb597('0x12')]['message']);}else{logger[_0xb597('0xd')](_0xb597('0xe'),_0x29ea54,_0xb597('0x11'));_0x17310d(_0x2b70cf[_0xb597('0x15')][_0xb597('0x14')]);}})['catch'](function(_0x3da474){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x29ea54,_0x3da474);_0x5b5f33(_0x3da474);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index c2f86b8..e4329da 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 _0x5862=['../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','describe','get','show','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x30abd5,_0xd71245){var _0xad301=function(_0x4311a0){while(--_0x4311a0){_0x30abd5['push'](_0x30abd5['shift']());}};_0xad301(++_0xd71245);}(_0x5862,0x161));var _0x2586=function(_0x58389d,_0x3137df){_0x58389d=_0x58389d-0x0;var _0x2be20a=_0x5862[_0x58389d];return _0x2be20a;};'use strict';var multer=require(_0x2586('0x0'));var util=require(_0x2586('0x1'));var path=require(_0x2586('0x2'));var timeout=require('connect-timeout');var express=require(_0x2586('0x3'));var router=express[_0x2586('0x4')]();var fs_extra=require(_0x2586('0x5'));var auth=require(_0x2586('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2586('0x7'));var controller=require(_0x2586('0x8'));router['get']('/',auth[_0x2586('0x9')](),controller[_0x2586('0xa')]);router['get']('/describe',auth[_0x2586('0x9')](),controller[_0x2586('0xb')]);router[_0x2586('0xc')]('/:id',auth[_0x2586('0x9')](),controller[_0x2586('0xd')]);router[_0x2586('0xe')]('/',auth[_0x2586('0x9')](),controller[_0x2586('0xf')]);router['put'](_0x2586('0x10'),auth[_0x2586('0x9')](),controller['update']);router[_0x2586('0x11')](_0x2586('0x10'),auth['isAuthenticated'](),controller[_0x2586('0x12')]);module[_0x2586('0x13')]=router;
\ No newline at end of file
+var _0x0dcd=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','describe','/:id','show','post','isAuthenticated','put','update'];(function(_0x4ad2f9,_0x51909b){var _0x2584bd=function(_0x22d7a3){while(--_0x22d7a3){_0x4ad2f9['push'](_0x4ad2f9['shift']());}};_0x2584bd(++_0x51909b);}(_0x0dcd,0xdb));var _0xd0dc=function(_0x4a0e2e,_0x34c3d0){_0x4a0e2e=_0x4a0e2e-0x0;var _0x26ed6c=_0x0dcd[_0x4a0e2e];return _0x26ed6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd0dc('0x0'));var timeout=require(_0xd0dc('0x1'));var express=require(_0xd0dc('0x2'));var router=express[_0xd0dc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0dc('0x4'));var config=require(_0xd0dc('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd0dc('0x6')]);router[_0xd0dc('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd0dc('0x8')]);router[_0xd0dc('0x7')](_0xd0dc('0x9'),auth['isAuthenticated'](),controller[_0xd0dc('0xa')]);router[_0xd0dc('0xb')]('/',auth[_0xd0dc('0xc')](),controller['create']);router[_0xd0dc('0xd')]('/:id',auth[_0xd0dc('0xc')](),controller[_0xd0dc('0xe')]);router[_0xd0dc('0xf')](_0xd0dc('0x9'),auth[_0xd0dc('0xc')](),controller[_0xd0dc('0x10')]);module[_0xd0dc('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 4339d93..06efdcf 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 _0x7569=['INTEGER','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7569,0x121));var _0x9756=function(_0x31878c,_0x590aff){_0x31878c=_0x31878c-0x0;var _0x24ef2b=_0x7569[_0x31878c];return _0x24ef2b;};'use strict';var Sequelize=require('sequelize');module[_0x9756('0x0')]={'name':{'type':Sequelize[_0x9756('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9756('0x2')](_0x9756('0x3'),_0x9756('0x4')),'defaultValue':_0x9756('0x3')},'selector':{'type':Sequelize[_0x9756('0x1')]},'timeout':{'type':Sequelize[_0x9756('0x5')]}};
\ No newline at end of file
+var _0x94d5=['INTEGER','exports','STRING','timeout','mouseOver'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0x94d5,0x1d2));var _0x594d=function(_0x3ddffc,_0x2ffe2c){_0x3ddffc=_0x3ddffc-0x0;var _0x462170=_0x94d5[_0x3ddffc];return _0x462170;};'use strict';var Sequelize=require('sequelize');module[_0x594d('0x0')]={'name':{'type':Sequelize[_0x594d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x594d('0x2')),'defaultValue':_0x594d('0x3')},'selector':{'type':Sequelize[_0x594d('0x1')]},'timeout':{'type':Sequelize[_0x594d('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4f88715..e76f147 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 _0x323b=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','keys','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x323b,0x1ad));var _0xb323=function(_0x223de8,_0x159864){_0x223de8=_0x223de8-0x0;var _0x5eb782=_0x323b[_0x223de8];return _0x5eb782;};'use strict';var emlformat=require(_0xb323('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb323('0x1'));var jsonpatch=require(_0xb323('0x2'));var rp=require(_0xb323('0x3'));var moment=require('moment');var BPromise=require(_0xb323('0x4'));var Mustache=require(_0xb323('0x5'));var util=require(_0xb323('0x6'));var path=require(_0xb323('0x7'));var sox=require(_0xb323('0x8'));var csv=require(_0xb323('0x9'));var ejs=require(_0xb323('0xa'));var fs=require('fs');var fs_extra=require(_0xb323('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb323('0xc'));var jsforce=require(_0xb323('0xd'));var deskjs=require(_0xb323('0xe'));var toCsv=require(_0xb323('0x9'));var querystring=require('querystring');var Papa=require(_0xb323('0xf'));var Redis=require(_0xb323('0x10'));var authService=require(_0xb323('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb323('0x12'));var hardwareService=require(_0xb323('0x13'));var logger=require(_0xb323('0x14'))(_0xb323('0x15'));var utils=require(_0xb323('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb323('0x17'));var db=require(_0xb323('0x18'))['db'];function respondWithStatusCode(_0x4c1bf1,_0x2f03f0){_0x2f03f0=_0x2f03f0||0xcc;return function(_0x524bf7){if(_0x524bf7){return _0x4c1bf1[_0xb323('0x19')](_0x2f03f0);}return _0x4c1bf1[_0xb323('0x1a')](_0x2f03f0)[_0xb323('0x1b')]();};}function respondWithResult(_0x51117c,_0x3a4c5f){_0x3a4c5f=_0x3a4c5f||0xc8;return function(_0x18c341){if(_0x18c341){return _0x51117c[_0xb323('0x1a')](_0x3a4c5f)[_0xb323('0x1c')](_0x18c341);}};}function respondWithFilteredResult(_0x41a47d,_0x57e9a0){return function(_0xb56df2){if(_0xb56df2){var _0xb3dd4=typeof _0x57e9a0[_0xb323('0x1d')]===_0xb323('0x1e')&&typeof _0x57e9a0['limit']===_0xb323('0x1e');var _0x3bc40f=_0xb56df2['count'];var _0x16d415=_0xb3dd4?0x0:_0x57e9a0[_0xb323('0x1d')];var _0x42a063=_0xb3dd4?_0xb56df2[_0xb323('0x1f')]:_0x57e9a0[_0xb323('0x1d')]+_0x57e9a0['limit'];var _0x3efcf7;if(_0x42a063>=_0x3bc40f){_0x42a063=_0x3bc40f;_0x3efcf7=0xc8;}else{_0x3efcf7=0xce;}_0x41a47d[_0xb323('0x1a')](_0x3efcf7);return _0x41a47d[_0xb323('0x20')]('Content-Range',_0x16d415+'-'+_0x42a063+'/'+_0x3bc40f)[_0xb323('0x1c')](_0xb56df2);}return null;};}function patchUpdates(_0x5d5f32){return function(_0x2fc9a5){try{jsonpatch[_0xb323('0x21')](_0x2fc9a5,_0x5d5f32,!![]);}catch(_0x7357b5){return BPromise[_0xb323('0x22')](_0x7357b5);}return _0x2fc9a5[_0xb323('0x23')]();};}function saveUpdates(_0x4afcd0,_0x5318a2){return function(_0x16b127){if(_0x16b127){return _0x16b127[_0xb323('0x24')](_0x4afcd0)[_0xb323('0x25')](function(_0x5e1d88){return _0x5e1d88;});}return null;};}function removeEntity(_0x25ab3c,_0x14b549){return function(_0x2b5ea2){if(_0x2b5ea2){return _0x2b5ea2[_0xb323('0x26')]()[_0xb323('0x25')](function(){_0x25ab3c['status'](0xcc)[_0xb323('0x1b')]();});}};}function handleEntityNotFound(_0x5ea703,_0x361d76){return function(_0x1aa17d){if(!_0x1aa17d){_0x5ea703['sendStatus'](0x194);}return _0x1aa17d;};}function handleError(_0x486a86,_0x5b44be){_0x5b44be=_0x5b44be||0x1f4;return function(_0x444c1d){logger[_0xb323('0x27')](_0x444c1d[_0xb323('0x28')]);if(_0x444c1d[_0xb323('0x29')]){delete _0x444c1d[_0xb323('0x29')];}_0x486a86[_0xb323('0x1a')](_0x5b44be)[_0xb323('0x2a')](_0x444c1d);};}exports[_0xb323('0x2b')]=function(_0x428c5a,_0x305563){var _0x38a533={'raw':!![],'where':{'id':_0x428c5a['params']['id']}},_0x45bd66={};_0x45bd66['model']=_[_0xb323('0x2c')](db['ChatProactiveAction'][_0xb323('0x2d')]);_0x45bd66[_0xb323('0x2e')]=_['keys'](_0x428c5a[_0xb323('0x2e')]);_0x45bd66[_0xb323('0x2f')]=_['intersection'](_0x45bd66[_0xb323('0x30')],_0x45bd66['query']);_0x38a533[_0xb323('0x31')]=_[_0xb323('0x32')](_0x45bd66[_0xb323('0x30')],qs[_0xb323('0x33')](_0x428c5a[_0xb323('0x2e')][_0xb323('0x33')]));_0x38a533[_0xb323('0x31')]=_0x38a533[_0xb323('0x31')][_0xb323('0x34')]?_0x38a533['attributes']:_0x45bd66['model'];if(_0x428c5a[_0xb323('0x2e')][_0xb323('0x35')]){_0x38a533[_0xb323('0x36')]=[{'all':!![]}];}_0x38a533=_[_0xb323('0x37')]({},_0x38a533,_0x428c5a[_0xb323('0x38')]);return db[_0xb323('0x39')]['find'](_0x38a533)['then'](handleEntityNotFound(_0x305563,null))[_0xb323('0x25')](respondWithResult(_0x305563,null))[_0xb323('0x3a')](handleError(_0x305563,null));};exports[_0xb323('0x3b')]=function(_0x4668c9,_0x31e9ac){return db[_0xb323('0x39')]['create'](_0x4668c9[_0xb323('0x3c')],{})['then'](respondWithResult(_0x31e9ac,0xc9))[_0xb323('0x3a')](handleError(_0x31e9ac,null));};exports[_0xb323('0x24')]=function(_0x301c70,_0x1b8616){if(_0x301c70[_0xb323('0x3c')]['id']){delete _0x301c70[_0xb323('0x3c')]['id'];}return db[_0xb323('0x39')][_0xb323('0x3d')]({'where':{'id':_0x301c70[_0xb323('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1b8616,null))[_0xb323('0x25')](saveUpdates(_0x301c70[_0xb323('0x3c')],null))[_0xb323('0x25')](respondWithResult(_0x1b8616,null))[_0xb323('0x3a')](handleError(_0x1b8616,null));};exports['destroy']=function(_0x187805,_0x5cb95e){return db[_0xb323('0x39')]['find']({'where':{'id':_0x187805['params']['id']}})[_0xb323('0x25')](handleEntityNotFound(_0x5cb95e,null))['then'](removeEntity(_0x5cb95e,null))[_0xb323('0x3a')](handleError(_0x5cb95e,null));};
\ No newline at end of file
+var _0xc18a=['rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0xc18a,0x1cf));var _0xac18=function(_0x4568d1,_0xfcd25a){_0x4568d1=_0x4568d1-0x0;var _0x2e9cf5=_0xc18a[_0x4568d1];return _0x2e9cf5;};'use strict';var emlformat=require(_0xac18('0x0'));var rimraf=require(_0xac18('0x1'));var zipdir=require(_0xac18('0x2'));var jsonpatch=require(_0xac18('0x3'));var rp=require('request-promise');var moment=require(_0xac18('0x4'));var BPromise=require(_0xac18('0x5'));var Mustache=require(_0xac18('0x6'));var util=require(_0xac18('0x7'));var path=require(_0xac18('0x8'));var sox=require(_0xac18('0x9'));var csv=require(_0xac18('0xa'));var ejs=require(_0xac18('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac18('0xc'));var squel=require(_0xac18('0xd'));var crypto=require(_0xac18('0xe'));var jsforce=require(_0xac18('0xf'));var deskjs=require(_0xac18('0x10'));var toCsv=require(_0xac18('0xa'));var querystring=require(_0xac18('0x11'));var Papa=require(_0xac18('0x12'));var Redis=require(_0xac18('0x13'));var authService=require(_0xac18('0x14'));var qs=require(_0xac18('0x15'));var as=require(_0xac18('0x16'));var hardwareService=require(_0xac18('0x17'));var logger=require(_0xac18('0x18'))('api');var utils=require(_0xac18('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xac18('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x567d8d,_0x215482){_0x215482=_0x215482||0xcc;return function(_0x53b975){if(_0x53b975){return _0x567d8d['sendStatus'](_0x215482);}return _0x567d8d[_0xac18('0x1b')](_0x215482)[_0xac18('0x1c')]();};}function respondWithResult(_0x4a7219,_0x1e6150){_0x1e6150=_0x1e6150||0xc8;return function(_0x33eb5a){if(_0x33eb5a){return _0x4a7219['status'](_0x1e6150)[_0xac18('0x1d')](_0x33eb5a);}};}function respondWithFilteredResult(_0x518187,_0x362b31){return function(_0x550438){if(_0x550438){var _0x4a747c=typeof _0x362b31[_0xac18('0x1e')]===_0xac18('0x1f')&&typeof _0x362b31['limit']==='undefined';var _0x436009=_0x550438[_0xac18('0x20')];var _0x506819=_0x4a747c?0x0:_0x362b31[_0xac18('0x1e')];var _0x98b7d3=_0x4a747c?_0x550438[_0xac18('0x20')]:_0x362b31[_0xac18('0x1e')]+_0x362b31[_0xac18('0x21')];var _0x3666d0;if(_0x98b7d3>=_0x436009){_0x98b7d3=_0x436009;_0x3666d0=0xc8;}else{_0x3666d0=0xce;}_0x518187[_0xac18('0x1b')](_0x3666d0);return _0x518187['set'](_0xac18('0x22'),_0x506819+'-'+_0x98b7d3+'/'+_0x436009)[_0xac18('0x1d')](_0x550438);}return null;};}function patchUpdates(_0x3f6498){return function(_0xbcd5fd){try{jsonpatch[_0xac18('0x23')](_0xbcd5fd,_0x3f6498,!![]);}catch(_0x4a55c0){return BPromise[_0xac18('0x24')](_0x4a55c0);}return _0xbcd5fd[_0xac18('0x25')]();};}function saveUpdates(_0x3924a7,_0x147a03){return function(_0x4f2f18){if(_0x4f2f18){return _0x4f2f18[_0xac18('0x26')](_0x3924a7)[_0xac18('0x27')](function(_0x2c10f3){return _0x2c10f3;});}return null;};}function removeEntity(_0x2c5b19,_0x20d639){return function(_0x204a05){if(_0x204a05){return _0x204a05['destroy']()[_0xac18('0x27')](function(){_0x2c5b19[_0xac18('0x1b')](0xcc)[_0xac18('0x1c')]();});}};}function handleEntityNotFound(_0x53fd81,_0x2d2f69){return function(_0x302b23){if(!_0x302b23){_0x53fd81[_0xac18('0x28')](0x194);}return _0x302b23;};}function handleError(_0x39086e,_0x3e3202){_0x3e3202=_0x3e3202||0x1f4;return function(_0x1aae67){logger[_0xac18('0x29')](_0x1aae67[_0xac18('0x2a')]);if(_0x1aae67['name']){delete _0x1aae67[_0xac18('0x2b')];}_0x39086e[_0xac18('0x1b')](_0x3e3202)['send'](_0x1aae67);};}exports[_0xac18('0x2c')]=function(_0x65f692,_0x14d74a){var _0x2d1492={'raw':!![],'where':{'id':_0x65f692[_0xac18('0x2d')]['id']}},_0xb710bb={};_0xb710bb[_0xac18('0x2e')]=_[_0xac18('0x2f')](db[_0xac18('0x30')][_0xac18('0x31')]);_0xb710bb[_0xac18('0x32')]=_['keys'](_0x65f692['query']);_0xb710bb[_0xac18('0x33')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],_0xb710bb['query']);_0x2d1492[_0xac18('0x35')]=_[_0xac18('0x34')](_0xb710bb[_0xac18('0x2e')],qs[_0xac18('0x36')](_0x65f692[_0xac18('0x32')]['fields']));_0x2d1492[_0xac18('0x35')]=_0x2d1492[_0xac18('0x35')]['length']?_0x2d1492[_0xac18('0x35')]:_0xb710bb[_0xac18('0x2e')];if(_0x65f692['query'][_0xac18('0x37')]){_0x2d1492[_0xac18('0x38')]=[{'all':!![]}];}_0x2d1492=_[_0xac18('0x39')]({},_0x2d1492,_0x65f692[_0xac18('0x3a')]);return db[_0xac18('0x30')][_0xac18('0x3b')](_0x2d1492)[_0xac18('0x27')](handleEntityNotFound(_0x14d74a,null))[_0xac18('0x27')](respondWithResult(_0x14d74a,null))[_0xac18('0x3c')](handleError(_0x14d74a,null));};exports['create']=function(_0x38b847,_0x3c318c){return db[_0xac18('0x30')][_0xac18('0x3d')](_0x38b847[_0xac18('0x3e')],{})[_0xac18('0x27')](respondWithResult(_0x3c318c,0xc9))[_0xac18('0x3c')](handleError(_0x3c318c,null));};exports[_0xac18('0x26')]=function(_0x2404de,_0x678f26){if(_0x2404de['body']['id']){delete _0x2404de['body']['id'];}return db[_0xac18('0x30')][_0xac18('0x3b')]({'where':{'id':_0x2404de['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x678f26,null))['then'](saveUpdates(_0x2404de[_0xac18('0x3e')],null))['then'](respondWithResult(_0x678f26,null))[_0xac18('0x3c')](handleError(_0x678f26,null));};exports[_0xac18('0x3f')]=function(_0x5d1721,_0x4ed58d){return db['ChatProactiveAction']['find']({'where':{'id':_0x5d1721['params']['id']}})[_0xac18('0x27')](handleEntityNotFound(_0x4ed58d,null))['then'](removeEntity(_0x4ed58d,null))[_0xac18('0x3c')](handleError(_0x4ed58d,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7676af1..b69c28d 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 _0xd280=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions'];(function(_0xa223dc,_0x3df032){var _0x58200b=function(_0x5e8541){while(--_0x5e8541){_0xa223dc['push'](_0xa223dc['shift']());}};_0x58200b(++_0x3df032);}(_0xd280,0xb0));var _0x0d28=function(_0x5ee98a,_0x5a0da5){_0x5ee98a=_0x5ee98a-0x0;var _0x4c5050=_0xd280[_0x5ee98a];return _0x4c5050;};'use strict';var _=require(_0x0d28('0x0'));var util=require(_0x0d28('0x1'));var logger=require(_0x0d28('0x2'))('api');var moment=require(_0x0d28('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d28('0x4'));var fs=require('fs');var path=require(_0x0d28('0x5'));var rimraf=require(_0x0d28('0x6'));var config=require('../../config/environment');var attributes=require(_0x0d28('0x7'));module[_0x0d28('0x8')]=function(_0x42b434,_0x4fbc3c){return _0x42b434[_0x0d28('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x0d28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1180=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3cc68e,_0x5a4b48){var _0x46e345=function(_0x335150){while(--_0x335150){_0x3cc68e['push'](_0x3cc68e['shift']());}};_0x46e345(++_0x5a4b48);}(_0x1180,0xce));var _0x0118=function(_0x35548f,_0x4ad849){_0x35548f=_0x35548f-0x0;var _0x10b877=_0x1180[_0x35548f];return _0x10b877;};'use strict';var _=require(_0x0118('0x0'));var util=require(_0x0118('0x1'));var logger=require(_0x0118('0x2'))(_0x0118('0x3'));var moment=require(_0x0118('0x4'));var BPromise=require(_0x0118('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0118('0x6'));var config=require(_0x0118('0x7'));var attributes=require(_0x0118('0x8'));module[_0x0118('0x9')]=function(_0x1eb888,_0x97cf21){return _0x1eb888['define'](_0x0118('0xa'),attributes,{'tableName':_0x0118('0xb'),'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 b001a2f..ad66a8f 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 _0x8119=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4e1bf8,_0x4bbcec){var _0x5e0146=function(_0x194ad8){while(--_0x194ad8){_0x4e1bf8['push'](_0x4e1bf8['shift']());}};_0x5e0146(++_0x4bbcec);}(_0x8119,0x126));var _0x9811=function(_0x261adc,_0x591b26){_0x261adc=_0x261adc-0x0;var _0x482218=_0x8119[_0x261adc];return _0x482218;};'use strict';var _=require(_0x9811('0x0'));var util=require(_0x9811('0x1'));var moment=require(_0x9811('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9811('0x3'));var db=require(_0x9811('0x4'))['db'];var utils=require(_0x9811('0x5'));var logger=require(_0x9811('0x6'))(_0x9811('0x7'));var config=require(_0x9811('0x8'));var jayson=require(_0x9811('0x9'));var client=jayson[_0x9811('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x92a712,_0x1f76f9,_0x32fd4b){return new BPromise(function(_0x18fde9,_0x19e9ab){return client[_0x9811('0xb')](_0x92a712,_0x32fd4b)['then'](function(_0x32c757){logger[_0x9811('0xc')](_0x9811('0xd'),_0x1f76f9,_0x9811('0xe'));logger[_0x9811('0xf')](_0x9811('0x10'),_0x1f76f9,_0x9811('0xe'),JSON[_0x9811('0x11')](_0x32c757));if(_0x32c757[_0x9811('0x12')]){if(_0x32c757[_0x9811('0x12')]['code']===0x1f4){logger[_0x9811('0x12')](_0x9811('0xd'),_0x1f76f9,_0x32c757[_0x9811('0x12')][_0x9811('0x13')]);return _0x19e9ab(_0x32c757[_0x9811('0x12')][_0x9811('0x13')]);}logger[_0x9811('0x12')](_0x9811('0xd'),_0x1f76f9,_0x32c757['error'][_0x9811('0x13')]);return _0x18fde9(_0x32c757['error']['message']);}else{logger[_0x9811('0xc')](_0x9811('0xd'),_0x1f76f9,'request\x20sent');_0x18fde9(_0x32c757[_0x9811('0x14')][_0x9811('0x13')]);}})['catch'](function(_0x283573){logger[_0x9811('0x12')](_0x9811('0xd'),_0x1f76f9,_0x283573);_0x19e9ab(_0x283573);});});}
\ No newline at end of file
+var _0xd3e8=['rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','bluebird','../../config/utils','../../config/logger'];(function(_0xf177dd,_0x51fc3d){var _0x3a6a54=function(_0x15b7c5){while(--_0x15b7c5){_0xf177dd['push'](_0xf177dd['shift']());}};_0x3a6a54(++_0x51fc3d);}(_0xd3e8,0x95));var _0x8d3e=function(_0x10f154,_0x12cf31){_0x10f154=_0x10f154-0x0;var _0xa58978=_0xd3e8[_0x10f154];return _0xa58978;};'use strict';var _=require(_0x8d3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8d3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d3e('0x2'));var logger=require(_0x8d3e('0x3'))(_0x8d3e('0x4'));var config=require(_0x8d3e('0x5'));var jayson=require(_0x8d3e('0x6'));var client=jayson['client'][_0x8d3e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x152da3,_0xd212b1,_0x210b12){return new BPromise(function(_0x3dc26d,_0x165fef){return client['request'](_0x152da3,_0x210b12)[_0x8d3e('0x8')](function(_0x537691){logger[_0x8d3e('0x9')](_0x8d3e('0xa'),_0xd212b1,'request\x20sent');logger['debug'](_0x8d3e('0xb'),_0xd212b1,'request\x20sent',JSON['stringify'](_0x537691));if(_0x537691[_0x8d3e('0xc')]){if(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xd')]===0x1f4){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x537691[_0x8d3e('0xc')]['message']);return _0x165fef(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0xd212b1,_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);return _0x3dc26d(_0x537691[_0x8d3e('0xc')][_0x8d3e('0xe')]);}else{logger['info'](_0x8d3e('0xa'),_0xd212b1,_0x8d3e('0xf'));_0x3dc26d(_0x537691[_0x8d3e('0x10')]['message']);}})['catch'](function(_0x117100){logger[_0x8d3e('0xc')](_0x8d3e('0xa'),_0xd212b1,_0x117100);_0x165fef(_0x117100);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c0ad4c9..3231e4c 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 _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x98a8,0x12c));var _0x898a=function(_0x275f4b,_0x2064e5){_0x275f4b=_0x275f4b-0x0;var _0x4ba50d=_0x98a8[_0x275f4b];return _0x4ba50d;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x7da7,0x10d));var _0x77da=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x7da7[_0x21353c];return _0xa99120;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index cda1d5a..dca0c43 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 _0x4f29=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x2d9d5f,_0x5a672a){var _0x58f10f=function(_0x5e4dd8){while(--_0x5e4dd8){_0x2d9d5f['push'](_0x2d9d5f['shift']());}};_0x58f10f(++_0x5a672a);}(_0x4f29,0xa6));var _0x94f2=function(_0x4e6846,_0x29ca95){_0x4e6846=_0x4e6846-0x0;var _0x112645=_0x4f29[_0x4e6846];return _0x112645;};'use strict';var Sequelize=require(_0x94f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x94f2('0x1')],'unique':_0x94f2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x94f2('0x1')]},'timeout':{'type':Sequelize[_0x94f2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x94f2('0x4'),_0x94f2('0x5'),_0x94f2('0x6'))}};
\ No newline at end of file
+var _0x7187=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x505642,_0xdbee26){var _0x541223=function(_0x3d06dd){while(--_0x3d06dd){_0x505642['push'](_0x505642['shift']());}};_0x541223(++_0xdbee26);}(_0x7187,0x88));var _0x7718=function(_0x5a3a55,_0x11e0ce){_0x5a3a55=_0x5a3a55-0x0;var _0x1ce4da=_0x7187[_0x5a3a55];return _0x1ce4da;};'use strict';var Sequelize=require(_0x7718('0x0'));module[_0x7718('0x1')]={'name':{'type':Sequelize[_0x7718('0x2')],'unique':_0x7718('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7718('0x2')]},'timeout':{'type':Sequelize[_0x7718('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7718('0x5')](_0x7718('0x6'),_0x7718('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 06cd7a4..eb0388e 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 _0x4d64=['length','options','create','body','user','role','ChatQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','nolimit','ChatQueueId','UserChatQueue','User','findAndCountAll','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','ids','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','userChatQueue:remove','addAgents','spread','userChatQueue:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','type','query','filters','attributes','intersection','fields','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','keys'];(function(_0x415a7d,_0x3e9ed8){var _0x1a5de4=function(_0xc27a3c){while(--_0xc27a3c){_0x415a7d['push'](_0x415a7d['shift']());}};_0x1a5de4(++_0x3e9ed8);}(_0x4d64,0xd4));var _0x44d6=function(_0x53ab1d,_0x5d283b){_0x53ab1d=_0x53ab1d-0x0;var _0x363b70=_0x4d64[_0x53ab1d];return _0x363b70;};'use strict';var emlformat=require(_0x44d6('0x0'));var rimraf=require(_0x44d6('0x1'));var zipdir=require(_0x44d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44d6('0x3'));var moment=require(_0x44d6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x44d6('0x5'));var path=require(_0x44d6('0x6'));var sox=require(_0x44d6('0x7'));var csv=require(_0x44d6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44d6('0x9'));var squel=require('squel');var crypto=require(_0x44d6('0xa'));var jsforce=require(_0x44d6('0xb'));var deskjs=require(_0x44d6('0xc'));var toCsv=require(_0x44d6('0x8'));var querystring=require(_0x44d6('0xd'));var Papa=require(_0x44d6('0xe'));var Redis=require(_0x44d6('0xf'));var authService=require(_0x44d6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x44d6('0x11'));var hardwareService=require(_0x44d6('0x12'));var logger=require(_0x44d6('0x13'))(_0x44d6('0x14'));var utils=require(_0x44d6('0x15'));var config=require(_0x44d6('0x16'));var licenseUtil=require(_0x44d6('0x17'));var db=require(_0x44d6('0x18'))['db'];config[_0x44d6('0x19')]=_[_0x44d6('0x1a')](config[_0x44d6('0x19')],{'host':_0x44d6('0x1b'),'port':0x18eb});var socket=require(_0x44d6('0x1c'))(new Redis(config[_0x44d6('0x19')]));require(_0x44d6('0x1d'))[_0x44d6('0x1e')](socket);var jayson=require(_0x44d6('0x1f'));var client=jayson[_0x44d6('0x20')][_0x44d6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2c1fdd,_0x503965,_0x20ec84,_0x564cbe){return new BPromise(function(_0x2ff0c5,_0xd5f353){var _0x5e4e6=_0x564cbe||client;return _0x5e4e6['request'](_0x2c1fdd,_0x20ec84)[_0x44d6('0x22')](function(_0x4a42ae){logger[_0x44d6('0x23')](_0x44d6('0x24'),_0x503965,_0x44d6('0x25'));logger['debug'](_0x44d6('0x26'),_0x503965,_0x44d6('0x25'),JSON[_0x44d6('0x27')](_0x4a42ae));if(_0x4a42ae[_0x44d6('0x28')]){if(_0x4a42ae['error']['code']===0x1f4){logger[_0x44d6('0x28')](_0x44d6('0x24'),_0x503965,_0x4a42ae['error']['message']);return _0xd5f353(_0x4a42ae['error'][_0x44d6('0x29')]);}logger[_0x44d6('0x28')]('ChatQueue,\x20%s,\x20%s',_0x503965,_0x4a42ae['error'][_0x44d6('0x29')]);return _0x2ff0c5(_0x4a42ae[_0x44d6('0x28')][_0x44d6('0x29')]);}else{logger[_0x44d6('0x23')]('ChatQueue,\x20%s,\x20%s',_0x503965,_0x44d6('0x25'));_0x2ff0c5(_0x4a42ae[_0x44d6('0x2a')][_0x44d6('0x29')]);}})[_0x44d6('0x2b')](function(_0x1b83cf){logger[_0x44d6('0x28')](_0x44d6('0x24'),_0x503965,_0x1b83cf);_0xd5f353(_0x1b83cf);});});}function respondWithStatusCode(_0x5bcb65,_0x18952f){_0x18952f=_0x18952f||0xcc;return function(_0x7c46a1){if(_0x7c46a1){return _0x5bcb65[_0x44d6('0x2c')](_0x18952f);}return _0x5bcb65['status'](_0x18952f)['end']();};}function respondWithResult(_0x49a09c,_0x42587c){_0x42587c=_0x42587c||0xc8;return function(_0x242bf8){if(_0x242bf8){return _0x49a09c[_0x44d6('0x2d')](_0x42587c)[_0x44d6('0x2e')](_0x242bf8);}};}function respondWithFilteredResult(_0x2c4ec8,_0x3eb924){return function(_0x29b999){if(_0x29b999){var _0x292563=typeof _0x3eb924[_0x44d6('0x2f')]===_0x44d6('0x30')&&typeof _0x3eb924[_0x44d6('0x31')]===_0x44d6('0x30');var _0x588bd8=_0x29b999['count'];var _0x5a8dc5=_0x292563?0x0:_0x3eb924['offset'];var _0x33b8c4=_0x292563?_0x29b999[_0x44d6('0x32')]:_0x3eb924[_0x44d6('0x2f')]+_0x3eb924[_0x44d6('0x31')];var _0x4f731f;if(_0x33b8c4>=_0x588bd8){_0x33b8c4=_0x588bd8;_0x4f731f=0xc8;}else{_0x4f731f=0xce;}_0x2c4ec8[_0x44d6('0x2d')](_0x4f731f);return _0x2c4ec8[_0x44d6('0x33')](_0x44d6('0x34'),_0x5a8dc5+'-'+_0x33b8c4+'/'+_0x588bd8)[_0x44d6('0x2e')](_0x29b999);}return null;};}function patchUpdates(_0x5f43cc){return function(_0x60b1ef){try{jsonpatch[_0x44d6('0x35')](_0x60b1ef,_0x5f43cc,!![]);}catch(_0x4664ea){return BPromise['reject'](_0x4664ea);}return _0x60b1ef[_0x44d6('0x36')]();};}function saveUpdates(_0x3a28b3,_0x340de4){return function(_0x4d9344){if(_0x4d9344){return _0x4d9344['update'](_0x3a28b3)['then'](function(_0x30a395){return _0x30a395;});}return null;};}function removeEntity(_0x5647a9,_0xa0edf2){return function(_0x17c8c1){if(_0x17c8c1){return _0x17c8c1[_0x44d6('0x37')]()[_0x44d6('0x22')](function(){var _0x2765e8=_0x17c8c1[_0x44d6('0x38')]({'plain':!![]});var _0x31348e='ChatQueues';return db[_0x44d6('0x39')][_0x44d6('0x37')]({'where':{'type':_0x31348e,'resourceId':_0x2765e8['id']}})[_0x44d6('0x22')](function(){return _0x17c8c1;});})[_0x44d6('0x22')](function(){_0x5647a9[_0x44d6('0x2d')](0xcc)[_0x44d6('0x3a')]();});}};}function handleEntityNotFound(_0x3bcbf3,_0x1c1c98){return function(_0x4d0aae){if(!_0x4d0aae){_0x3bcbf3['sendStatus'](0x194);}return _0x4d0aae;};}function handleError(_0x533981,_0x1365a4){_0x1365a4=_0x1365a4||0x1f4;return function(_0x4d33de){logger['error'](_0x4d33de[_0x44d6('0x3b')]);if(_0x4d33de[_0x44d6('0x3c')]){delete _0x4d33de[_0x44d6('0x3c')];}_0x533981['status'](_0x1365a4)[_0x44d6('0x3d')](_0x4d33de);};}exports[_0x44d6('0x3e')]=function(_0x2e6050,_0x1865e1){var _0x4f474d={},_0x3e718b={},_0x1c63c0={'count':0x0,'rows':[]};var _0x1a2828=_[_0x44d6('0x3f')](db[_0x44d6('0x40')][_0x44d6('0x41')],function(_0x456aa7){return{'name':_0x456aa7['fieldName'],'type':_0x456aa7[_0x44d6('0x42')]['key']};});_0x3e718b['model']=_[_0x44d6('0x3f')](_0x1a2828,_0x44d6('0x3c'));_0x3e718b[_0x44d6('0x43')]=_['keys'](_0x2e6050['query']);_0x3e718b[_0x44d6('0x44')]=_['intersection'](_0x3e718b['model'],_0x3e718b['query']);_0x4f474d[_0x44d6('0x45')]=_[_0x44d6('0x46')](_0x3e718b['model'],qs[_0x44d6('0x47')](_0x2e6050[_0x44d6('0x43')][_0x44d6('0x47')]));_0x4f474d[_0x44d6('0x45')]=_0x4f474d[_0x44d6('0x45')]['length']?_0x4f474d['attributes']:_0x3e718b[_0x44d6('0x48')];if(!_0x2e6050[_0x44d6('0x43')][_0x44d6('0x49')]('nolimit')){_0x4f474d[_0x44d6('0x31')]=qs['limit'](_0x2e6050[_0x44d6('0x43')][_0x44d6('0x31')]);_0x4f474d[_0x44d6('0x2f')]=qs[_0x44d6('0x2f')](_0x2e6050[_0x44d6('0x43')][_0x44d6('0x2f')]);}_0x4f474d[_0x44d6('0x4a')]=qs['sort'](_0x2e6050[_0x44d6('0x43')][_0x44d6('0x4b')]);_0x4f474d[_0x44d6('0x4c')]=qs[_0x44d6('0x44')](_[_0x44d6('0x4d')](_0x2e6050['query'],_0x3e718b[_0x44d6('0x44')]),_0x1a2828);if(_0x2e6050[_0x44d6('0x43')][_0x44d6('0x4e')]){_0x4f474d['where']=_[_0x44d6('0x4f')](_0x4f474d[_0x44d6('0x4c')],{'$or':_[_0x44d6('0x3f')](_0x1a2828,function(_0x4687c9){if(_0x4687c9[_0x44d6('0x42')]!==_0x44d6('0x50')){var _0x1895c7={};_0x1895c7[_0x4687c9[_0x44d6('0x3c')]]={'$like':'%'+_0x2e6050['query']['filter']+'%'};return _0x1895c7;}})});}_0x4f474d=_[_0x44d6('0x4f')]({},_0x4f474d,_0x2e6050['options']);var _0xd95e32={'where':_0x4f474d[_0x44d6('0x4c')]};return db[_0x44d6('0x40')][_0x44d6('0x32')](_0xd95e32)[_0x44d6('0x22')](function(_0x7f1fa3){_0x1c63c0[_0x44d6('0x32')]=_0x7f1fa3;if(_0x2e6050[_0x44d6('0x43')][_0x44d6('0x51')]){_0x4f474d[_0x44d6('0x52')]=[{'all':!![]}];}return db[_0x44d6('0x40')][_0x44d6('0x53')](_0x4f474d);})[_0x44d6('0x22')](function(_0x452f61){_0x1c63c0['rows']=_0x452f61;return _0x1c63c0;})['then'](respondWithFilteredResult(_0x1865e1,_0x4f474d))[_0x44d6('0x2b')](handleError(_0x1865e1,null));};exports[_0x44d6('0x54')]=function(_0x2bdd3c,_0x1dc6ad){var _0x59d260={'raw':!![],'where':{'id':_0x2bdd3c['params']['id']}},_0x16e450={};_0x16e450[_0x44d6('0x48')]=_[_0x44d6('0x55')](db['ChatQueue'][_0x44d6('0x41')]);_0x16e450[_0x44d6('0x43')]=_['keys'](_0x2bdd3c[_0x44d6('0x43')]);_0x16e450['filters']=_[_0x44d6('0x46')](_0x16e450[_0x44d6('0x48')],_0x16e450[_0x44d6('0x43')]);_0x59d260[_0x44d6('0x45')]=_[_0x44d6('0x46')](_0x16e450[_0x44d6('0x48')],qs['fields'](_0x2bdd3c[_0x44d6('0x43')]['fields']));_0x59d260['attributes']=_0x59d260[_0x44d6('0x45')][_0x44d6('0x56')]?_0x59d260[_0x44d6('0x45')]:_0x16e450[_0x44d6('0x48')];if(_0x2bdd3c[_0x44d6('0x43')][_0x44d6('0x51')]){_0x59d260['include']=[{'all':!![]}];}_0x59d260=_[_0x44d6('0x4f')]({},_0x59d260,_0x2bdd3c[_0x44d6('0x57')]);return db[_0x44d6('0x40')]['find'](_0x59d260)[_0x44d6('0x22')](handleEntityNotFound(_0x1dc6ad,null))['then'](respondWithResult(_0x1dc6ad,null))[_0x44d6('0x2b')](handleError(_0x1dc6ad,null));};exports[_0x44d6('0x58')]=function(_0x11db46,_0x587de3){return db[_0x44d6('0x40')]['create'](_0x11db46[_0x44d6('0x59')],{})[_0x44d6('0x22')](function(_0xa8e92d){var _0xe4d420=_0x11db46[_0x44d6('0x5a')][_0x44d6('0x38')]({'plain':!![]});if(!_0xe4d420)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe4d420[_0x44d6('0x5b')]===_0x44d6('0x5a')){var _0x279e6b=_0xa8e92d[_0x44d6('0x38')]({'plain':!![]});var _0x3eaba4=_0x44d6('0x5c');return db['UserProfileSection'][_0x44d6('0x5d')]({'where':{'name':_0x3eaba4,'userProfileId':_0xe4d420[_0x44d6('0x5e')]},'raw':!![]})['then'](function(_0x148cd2){if(_0x148cd2&&_0x148cd2[_0x44d6('0x5f')]===0x0){return db[_0x44d6('0x39')]['create']({'name':_0x279e6b[_0x44d6('0x3c')],'resourceId':_0x279e6b['id'],'type':_0x148cd2[_0x44d6('0x3c')],'sectionId':_0x148cd2['id']},{})[_0x44d6('0x22')](function(){return _0xa8e92d;});}else{return _0xa8e92d;}})[_0x44d6('0x2b')](function(_0x18951a){logger[_0x44d6('0x28')](_0x44d6('0x60'),_0x18951a);throw _0x18951a;});}return _0xa8e92d;})[_0x44d6('0x22')](respondWithResult(_0x587de3,0xc9))[_0x44d6('0x2b')](handleError(_0x587de3,null));};exports[_0x44d6('0x61')]=function(_0x4d6f66,_0xe18a7a){if(_0x4d6f66[_0x44d6('0x59')]['id']){delete _0x4d6f66[_0x44d6('0x59')]['id'];}return db[_0x44d6('0x40')]['find']({'where':{'id':_0x4d6f66[_0x44d6('0x62')]['id']}})['then'](handleEntityNotFound(_0xe18a7a,null))[_0x44d6('0x22')](saveUpdates(_0x4d6f66[_0x44d6('0x59')],null))[_0x44d6('0x22')](respondWithResult(_0xe18a7a,null))['catch'](handleError(_0xe18a7a,null));};exports[_0x44d6('0x37')]=function(_0x521dd0,_0x29e37d){return db['ChatQueue'][_0x44d6('0x5d')]({'where':{'id':_0x521dd0['params']['id']}})[_0x44d6('0x22')](handleEntityNotFound(_0x29e37d,null))['then'](removeEntity(_0x29e37d,null))['catch'](handleError(_0x29e37d,null));};exports[_0x44d6('0x63')]=function(_0x108085,_0x42aa81){return db[_0x44d6('0x40')][_0x44d6('0x63')]()[_0x44d6('0x22')](respondWithResult(_0x42aa81,null))['catch'](handleError(_0x42aa81,null));};exports[_0x44d6('0x64')]=function(_0x38f355,_0x5d4faf,_0x11ceb7){var _0x3a46fb={'raw':!![],'where':{}},_0x2f9331={},_0x496a39;return db[_0x44d6('0x40')][_0x44d6('0x65')]({'where':{'id':_0x38f355['params']['id']}})[_0x44d6('0x22')](handleEntityNotFound(_0x5d4faf,null))['then'](function(_0x1d65a5){if(_0x1d65a5){_0x496a39=_0x1d65a5['get']({'plain':!![]});_0x2f9331[_0x44d6('0x48')]=_[_0x44d6('0x55')](db['UserChatQueue']['rawAttributes']);_0x2f9331[_0x44d6('0x43')]=_[_0x44d6('0x55')](_0x38f355['query']);_0x2f9331[_0x44d6('0x44')]=_['intersection'](_0x2f9331[_0x44d6('0x48')],_0x2f9331['query']);_0x3a46fb[_0x44d6('0x45')]=_['intersection'](_0x2f9331['model'],qs[_0x44d6('0x47')](_0x38f355['query']['fields']));_0x3a46fb[_0x44d6('0x45')]=_0x3a46fb[_0x44d6('0x45')][_0x44d6('0x56')]?_0x3a46fb['attributes']:_0x2f9331[_0x44d6('0x48')];if(!_0x38f355['query']['hasOwnProperty'](_0x44d6('0x66'))){_0x3a46fb[_0x44d6('0x31')]=qs[_0x44d6('0x31')](_0x38f355[_0x44d6('0x43')][_0x44d6('0x31')]);_0x3a46fb[_0x44d6('0x2f')]=qs['offset'](_0x38f355['query'][_0x44d6('0x2f')]);}_0x3a46fb[_0x44d6('0x4a')]=qs['sort'](_0x38f355[_0x44d6('0x43')][_0x44d6('0x4b')]);_0x3a46fb['where']=qs['filters'](_[_0x44d6('0x4d')](_0x38f355[_0x44d6('0x43')],_0x2f9331[_0x44d6('0x44')]));_0x3a46fb[_0x44d6('0x4c')][_0x44d6('0x67')]=_0x1d65a5['id'];if(_0x38f355['query'][_0x44d6('0x4e')]){_0x3a46fb[_0x44d6('0x4c')]=_[_0x44d6('0x4f')](_0x3a46fb[_0x44d6('0x4c')],{'$or':_[_0x44d6('0x3f')](_0x3a46fb[_0x44d6('0x45')],function(_0x189dd0){var _0x32804f={};_0x32804f[_0x189dd0]={'$like':'%'+_0x38f355[_0x44d6('0x43')][_0x44d6('0x4e')]+'%'};return _0x32804f;})});}_0x3a46fb=_[_0x44d6('0x4f')]({},_0x3a46fb,_0x38f355[_0x44d6('0x57')]);return db[_0x44d6('0x68')][_0x44d6('0x53')](_0x3a46fb);}})['then'](function(_0x5c1af7){if(_0x5c1af7){return db[_0x44d6('0x69')][_0x44d6('0x6a')]({'where':{'id':_['map'](_0x5c1af7,'UserId'),'role':'agent'},'attributes':['id','name',_0x44d6('0x6b'),_0x44d6('0x6c'),_0x44d6('0x6d')]});}})[_0x44d6('0x22')](function(_0x367740){if(_0x367740){return{'count':_0x367740[_0x44d6('0x32')],'rows':_[_0x44d6('0x3f')](_0x367740[_0x44d6('0x6e')],function(_0x365de5){return{'membername':_0x365de5['name'],'UserId':_0x365de5['id'],'queue_name':_0x496a39['name'],'ChatQueueId':_0x496a39['id'],'interface':util[_0x44d6('0x6f')](_0x44d6('0x70'),_0x44d6('0x71'),_0x365de5[_0x44d6('0x3c')]),'penalty':0x0,'paused':_0x365de5['chatPause'],'createdAt':_0x365de5['createdAt'],'updatedAt':_0x365de5[_0x44d6('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44d6('0x22')](respondWithFilteredResult(_0x5d4faf,_0x3a46fb))[_0x44d6('0x2b')](handleError(_0x5d4faf,null));};exports[_0x44d6('0x72')]=function(_0x24f41b,_0x363076,_0x164725){var _0x119f96={};var _0x6f2368={};var _0x449d3b;var _0x5c9c0f;return db[_0x44d6('0x40')][_0x44d6('0x65')]({'where':{'id':_0x24f41b[_0x44d6('0x62')]['id']}})['then'](handleEntityNotFound(_0x363076,null))[_0x44d6('0x22')](function(_0x1d728c){if(_0x1d728c){_0x449d3b=_0x1d728c;_0x6f2368['model']=_['keys'](db[_0x44d6('0x73')][_0x44d6('0x41')]);_0x6f2368['query']=_[_0x44d6('0x55')](_0x24f41b[_0x44d6('0x43')]);_0x6f2368[_0x44d6('0x44')]=_[_0x44d6('0x46')](_0x6f2368[_0x44d6('0x48')],_0x6f2368[_0x44d6('0x43')]);_0x119f96[_0x44d6('0x45')]=_[_0x44d6('0x46')](_0x6f2368[_0x44d6('0x48')],qs[_0x44d6('0x47')](_0x24f41b[_0x44d6('0x43')][_0x44d6('0x47')]));_0x119f96['attributes']=_0x119f96['attributes'][_0x44d6('0x56')]?_0x119f96[_0x44d6('0x45')]:_0x6f2368[_0x44d6('0x48')];_0x119f96[_0x44d6('0x4a')]=qs[_0x44d6('0x4b')](_0x24f41b['query'][_0x44d6('0x4b')]);_0x119f96[_0x44d6('0x4c')]=qs['filters'](_[_0x44d6('0x4d')](_0x24f41b[_0x44d6('0x43')],_0x6f2368[_0x44d6('0x44')]));if(_0x24f41b[_0x44d6('0x43')]['filter']){_0x119f96[_0x44d6('0x4c')]=_[_0x44d6('0x4f')](_0x119f96[_0x44d6('0x4c')],{'$or':_[_0x44d6('0x3f')](_0x119f96[_0x44d6('0x45')],function(_0x40d9b2){var _0x3fa3d3={};_0x3fa3d3[_0x40d9b2]={'$like':'%'+_0x24f41b[_0x44d6('0x43')][_0x44d6('0x4e')]+'%'};return _0x3fa3d3;})});}_0x119f96=_[_0x44d6('0x4f')]({},_0x119f96,_0x24f41b[_0x44d6('0x57')]);return _0x449d3b[_0x44d6('0x72')](_0x119f96);}})[_0x44d6('0x22')](function(_0x1a527a){if(_0x1a527a){_0x5c9c0f=_0x1a527a['length'];if(!_0x24f41b[_0x44d6('0x43')]['hasOwnProperty'](_0x44d6('0x66'))){_0x119f96[_0x44d6('0x31')]=qs[_0x44d6('0x31')](_0x24f41b[_0x44d6('0x43')][_0x44d6('0x31')]);_0x119f96[_0x44d6('0x2f')]=qs[_0x44d6('0x2f')](_0x24f41b[_0x44d6('0x43')][_0x44d6('0x2f')]);}return _0x449d3b[_0x44d6('0x72')](_0x119f96);}})[_0x44d6('0x22')](function(_0x49b3ef){if(_0x49b3ef){return _0x49b3ef?{'count':_0x5c9c0f,'rows':_0x49b3ef}:null;}})['then'](respondWithResult(_0x363076,null))['catch'](handleError(_0x363076,null));};exports[_0x44d6('0x74')]=function(_0x2f8757,_0x566001,_0x2a7ce5){var _0xee28d6=_0x2f8757[_0x44d6('0x59')]['ids'];return db[_0x44d6('0x73')][_0x44d6('0x53')]({'where':{'id':_0xee28d6},'attributes':['id'],'include':[{'model':db[_0x44d6('0x69')],'as':_0x44d6('0x75'),'attributes':['id',_0x44d6('0x3c'),_0x44d6('0x76'),'voicePause',_0x44d6('0x77')],'raw':!![]}]})[_0x44d6('0x22')](function(_0x35bb63){if(_0x35bb63){var _0x2e2ba5=_[_0x44d6('0x78')](_0x35bb63,function(_0x4cfc74){var _0x9a3f56=_0x4cfc74['get']({'plain':!![]});return _0x9a3f56[_0x44d6('0x75')];});return db[_0x44d6('0x40')][_0x44d6('0x5d')]({'where':{'id':_0x2f8757[_0x44d6('0x62')]['id']}})['then'](function(_0x2e2c41){return db[_0x44d6('0x79')][_0x44d6('0x7a')](function(_0x21a3b2){return _0x2e2c41[_0x44d6('0x74')](_0xee28d6,{'transaction':_0x21a3b2})[_0x44d6('0x22')](function(){return BPromise[_0x44d6('0x7b')](_0x2e2ba5,function(_0x46313f){return db[_0x44d6('0x68')]['findOrCreate']({'where':{'UserId':_0x46313f['id'],'ChatQueueId':_0x2f8757[_0x44d6('0x62')]['id']},'transaction':_0x21a3b2});});})['then'](function(){_0x2e2ba5[_0x44d6('0x7c')](function(_0x29ebb1){socket[_0x44d6('0x7d')]('userChatQueue:save',{'UserId':_0x29ebb1['id'],'ChatQueueId':_0x2e2c41['id']});});});});});}})[_0x44d6('0x22')](respondWithStatusCode(_0x566001,null))['catch'](handleError(_0x566001,null));};exports[_0x44d6('0x7e')]=function(_0xe9fcb3,_0x3bc220,_0x3721f8){return db[_0x44d6('0x73')][_0x44d6('0x53')]({'where':{'id':_0xe9fcb3[_0x44d6('0x43')][_0x44d6('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x44d6('0x69')],'as':_0x44d6('0x75'),'attributes':['id'],'raw':!![]}]})[_0x44d6('0x22')](handleEntityNotFound(_0x3bc220,null))[_0x44d6('0x22')](function(_0x2d31e){var _0x15e92a=_['map'](_0x2d31e,'id');var _0xd78ce4=[];var _0x252588=[];var _0x32f86d=squel['select']();_0x32f86d[_0x44d6('0x80')]('tq.TeamId')['from'](_0x44d6('0x81'),'tq')[_0x44d6('0x82')](_0x44d6('0x83'),'ut',_0x44d6('0x84'))[_0x44d6('0x4c')]('ChatQueueId\x20=\x20?',_0xe9fcb3[_0x44d6('0x62')]['id']);for(var _0x4a834c=0x0;_0x4a834c<_0x2d31e['length'];_0x4a834c+=0x1){let _0x1d6d1f=_0x2d31e[_0x4a834c];for(var _0x53354b=0x0;_0x53354b<_0x1d6d1f[_0x44d6('0x75')]['length'];_0x53354b+=0x1){let _0x547b0e=_0x1d6d1f[_0x44d6('0x75')][_0x53354b];var _0x5d84bd=_0x32f86d['clone']();_0x5d84bd[_0x44d6('0x4c')](_0x44d6('0x85'),_0x547b0e['id']);_0x252588['push'](db[_0x44d6('0x79')]['query'](_0x5d84bd[_0x44d6('0x86')](),{'type':db[_0x44d6('0x79')][_0x44d6('0x87')][_0x44d6('0x88')]})[_0x44d6('0x22')](function(_0x18d571){if(_0x18d571[_0x44d6('0x56')]===0x1){return _0x547b0e['id'];}else{var _0x361e28=_[_0x44d6('0x89')](_[_0x44d6('0x3f')](_0x18d571,'TeamId'),function(_0x1f19e9){return _[_0x44d6('0x8a')](_0x15e92a,_0x1f19e9);});if(_0x361e28){return _0x547b0e['id'];}}}));}}return BPromise['all'](_0x252588)[_0x44d6('0x22')](function(_0xb81ecc){_0xd78ce4=_(_0xd78ce4)[_0x44d6('0x8b')](_0xb81ecc)[_0x44d6('0x8c')]()[_0x44d6('0x8d')]();return db['ChatQueue'][_0x44d6('0x5d')]({'where':{'id':_0xe9fcb3['params']['id']}})[_0x44d6('0x22')](function(_0xa70bce){return db['sequelize'][_0x44d6('0x7a')](function(_0xc35cf7){return _0xa70bce[_0x44d6('0x7e')](_0xe9fcb3['query'][_0x44d6('0x7f')],{'transaction':_0xc35cf7})[_0x44d6('0x22')](function(){if(!_[_0x44d6('0x8e')](_0xd78ce4)){return _0xa70bce['removeAgents'](_0xd78ce4,{'transaction':_0xc35cf7});}})['then'](function(){_0xd78ce4[_0x44d6('0x7c')](function(_0x3f925e){socket['emit'](_0x44d6('0x8f'),{'UserId':_0x3f925e,'ChatQueueId':_0xa70bce['id']});});});});});});})[_0x44d6('0x22')](respondWithStatusCode(_0x3bc220,null))[_0x44d6('0x2b')](handleError(_0x3bc220,null));};exports[_0x44d6('0x90')]=function(_0x490670,_0x42802f,_0x5a2222){return db[_0x44d6('0x40')][_0x44d6('0x5d')]({'where':{'id':_0x490670[_0x44d6('0x62')]['id']}})[_0x44d6('0x22')](handleEntityNotFound(_0x42802f,null))[_0x44d6('0x22')](function(_0x1fb7dc){if(_0x1fb7dc){return _0x1fb7dc[_0x44d6('0x90')](_0x490670[_0x44d6('0x59')][_0x44d6('0x7f')],_['omit'](_0x490670[_0x44d6('0x59')],[_0x44d6('0x7f'),'id'])||{})[_0x44d6('0x91')](function(_0x49bd84){for(var _0x342dae=0x0;_0x342dae<_0x490670[_0x44d6('0x59')][_0x44d6('0x7f')][_0x44d6('0x56')];_0x342dae+=0x1){socket['emit'](_0x44d6('0x92'),{'UserId':Number(_0x490670[_0x44d6('0x59')]['ids'][_0x342dae]),'ChatQueueId':Number(_0x490670[_0x44d6('0x62')]['id'])});}return _0x49bd84;});}})['then'](respondWithResult(_0x42802f,null))[_0x44d6('0x2b')](handleError(_0x42802f,null));};exports[_0x44d6('0x93')]=function(_0x4f9c2f,_0x1e8e11,_0x1d8e4f){return db[_0x44d6('0x40')]['find']({'where':{'id':_0x4f9c2f['params']['id']}})['then'](handleEntityNotFound(_0x1e8e11,null))[_0x44d6('0x22')](function(_0x136334){if(_0x136334){return _0x136334[_0x44d6('0x93')](_0x4f9c2f['query'][_0x44d6('0x7f')])[_0x44d6('0x22')](function(){if(_['isArray'](_0x4f9c2f['query'][_0x44d6('0x7f')])){for(var _0x2dc32a=0x0;_0x2dc32a<_0x4f9c2f[_0x44d6('0x43')][_0x44d6('0x7f')][_0x44d6('0x56')];_0x2dc32a+=0x1){socket['emit'](_0x44d6('0x8f'),{'UserId':Number(_0x4f9c2f[_0x44d6('0x43')][_0x44d6('0x7f')][_0x2dc32a]),'ChatQueueId':Number(_0x4f9c2f[_0x44d6('0x62')]['id'])});}}else{socket[_0x44d6('0x7d')](_0x44d6('0x8f'),{'UserId':Number(_0x4f9c2f['query'][_0x44d6('0x7f')]),'ChatQueueId':Number(_0x4f9c2f[_0x44d6('0x62')]['id'])});}});}})[_0x44d6('0x22')](respondWithStatusCode(_0x1e8e11,null))[_0x44d6('0x2b')](handleError(_0x1e8e11,null));};exports[_0x44d6('0x94')]=function(_0x3bd9e4,_0x3718f0,_0xffd40){var _0x2b2e1b={};var _0x4cab6f={};var _0x5a4d96;var _0x3df6f0;return db['ChatQueue'][_0x44d6('0x65')]({'where':{'id':_0x3bd9e4['params']['id']}})[_0x44d6('0x22')](handleEntityNotFound(_0x3718f0,null))[_0x44d6('0x22')](function(_0x41761c){if(_0x41761c){_0x5a4d96=_0x41761c;_0x4cab6f['model']=_[_0x44d6('0x55')](db[_0x44d6('0x69')][_0x44d6('0x41')]);_0x4cab6f[_0x44d6('0x43')]=_[_0x44d6('0x55')](_0x3bd9e4[_0x44d6('0x43')]);_0x4cab6f[_0x44d6('0x44')]=_['intersection'](_0x4cab6f[_0x44d6('0x48')],_0x4cab6f[_0x44d6('0x43')]);_0x2b2e1b['attributes']=_['intersection'](_0x4cab6f[_0x44d6('0x48')],qs[_0x44d6('0x47')](_0x3bd9e4[_0x44d6('0x43')][_0x44d6('0x47')]));_0x2b2e1b[_0x44d6('0x45')]=_0x2b2e1b[_0x44d6('0x45')][_0x44d6('0x56')]?_0x2b2e1b['attributes']:_0x4cab6f[_0x44d6('0x48')];_0x2b2e1b[_0x44d6('0x4a')]=qs[_0x44d6('0x4b')](_0x3bd9e4['query'][_0x44d6('0x4b')]);_0x2b2e1b['where']=qs['filters'](_[_0x44d6('0x4d')](_0x3bd9e4[_0x44d6('0x43')],_0x4cab6f['filters']));if(_0x3bd9e4[_0x44d6('0x43')]['filter']){_0x2b2e1b[_0x44d6('0x4c')]=_[_0x44d6('0x4f')](_0x2b2e1b[_0x44d6('0x4c')],{'$or':_['map'](_0x2b2e1b['attributes'],function(_0x1d1ba9){var _0x5df80b={};_0x5df80b[_0x1d1ba9]={'$like':'%'+_0x3bd9e4[_0x44d6('0x43')]['filter']+'%'};return _0x5df80b;})});}_0x2b2e1b=_[_0x44d6('0x4f')]({},_0x2b2e1b,_0x3bd9e4[_0x44d6('0x57')]);return _0x5a4d96[_0x44d6('0x94')](_0x2b2e1b);}})[_0x44d6('0x22')](function(_0x4459b8){if(_0x4459b8){_0x3df6f0=_0x4459b8['length'];if(!_0x3bd9e4[_0x44d6('0x43')]['hasOwnProperty'](_0x44d6('0x66'))){_0x2b2e1b['limit']=qs[_0x44d6('0x31')](_0x3bd9e4[_0x44d6('0x43')]['limit']);_0x2b2e1b[_0x44d6('0x2f')]=qs[_0x44d6('0x2f')](_0x3bd9e4[_0x44d6('0x43')][_0x44d6('0x2f')]);}return _0x5a4d96[_0x44d6('0x94')](_0x2b2e1b);}})[_0x44d6('0x22')](function(_0x175a48){if(_0x175a48){return _0x175a48?{'count':_0x3df6f0,'rows':_0x175a48}:null;}})[_0x44d6('0x22')](respondWithResult(_0x3718f0,null))[_0x44d6('0x2b')](handleError(_0x3718f0,null));};
\ No newline at end of file
+var _0x4c35=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c35,0x86));var _0x54c3=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x4c35[_0x7185f7];return _0x182e45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54c3('0x1'));var rp=require('request-promise');var moment=require(_0x54c3('0x2'));var BPromise=require(_0x54c3('0x3'));var Mustache=require(_0x54c3('0x4'));var util=require(_0x54c3('0x5'));var path=require(_0x54c3('0x6'));var sox=require(_0x54c3('0x7'));var csv=require(_0x54c3('0x8'));var ejs=require(_0x54c3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54c3('0xa'));var squel=require('squel');var crypto=require(_0x54c3('0xb'));var jsforce=require(_0x54c3('0xc'));var deskjs=require(_0x54c3('0xd'));var toCsv=require(_0x54c3('0x8'));var querystring=require(_0x54c3('0xe'));var Papa=require('papaparse');var Redis=require(_0x54c3('0xf'));var authService=require(_0x54c3('0x10'));var qs=require(_0x54c3('0x11'));var as=require(_0x54c3('0x12'));var hardwareService=require(_0x54c3('0x13'));var logger=require(_0x54c3('0x14'))(_0x54c3('0x15'));var utils=require('../../config/utils');var config=require(_0x54c3('0x16'));var licenseUtil=require(_0x54c3('0x17'));var db=require(_0x54c3('0x18'))['db'];config[_0x54c3('0x19')]=_[_0x54c3('0x1a')](config[_0x54c3('0x19')],{'host':_0x54c3('0x1b'),'port':0x18eb});var socket=require(_0x54c3('0x1c'))(new Redis(config[_0x54c3('0x19')]));require(_0x54c3('0x1d'))['register'](socket);var jayson=require(_0x54c3('0x1e'));var client=jayson[_0x54c3('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183454,_0x3a1334,_0xf5d99f,_0x17ec0b){return new BPromise(function(_0x1b1bc0,_0x2e4833){var _0x1ee2c6=_0x17ec0b||client;return _0x1ee2c6[_0x54c3('0x20')](_0x183454,_0xf5d99f)['then'](function(_0x2b8e07){logger['info'](_0x54c3('0x21'),_0x3a1334,'request\x20sent');logger[_0x54c3('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3a1334,'request\x20sent',JSON[_0x54c3('0x23')](_0x2b8e07));if(_0x2b8e07[_0x54c3('0x24')]){if(_0x2b8e07['error'][_0x54c3('0x25')]===0x1f4){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')]['message']);return _0x2e4833(_0x2b8e07['error'][_0x54c3('0x26')]);}logger['error'](_0x54c3('0x21'),_0x3a1334,_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);return _0x1b1bc0(_0x2b8e07[_0x54c3('0x24')][_0x54c3('0x26')]);}else{logger[_0x54c3('0x27')](_0x54c3('0x21'),_0x3a1334,_0x54c3('0x28'));_0x1b1bc0(_0x2b8e07[_0x54c3('0x29')][_0x54c3('0x26')]);}})[_0x54c3('0x2a')](function(_0x2a556e){logger[_0x54c3('0x24')](_0x54c3('0x21'),_0x3a1334,_0x2a556e);_0x2e4833(_0x2a556e);});});}function respondWithStatusCode(_0x4918e9,_0x3f43c2){_0x3f43c2=_0x3f43c2||0xcc;return function(_0x128eb6){if(_0x128eb6){return _0x4918e9[_0x54c3('0x2b')](_0x3f43c2);}return _0x4918e9[_0x54c3('0x2c')](_0x3f43c2)[_0x54c3('0x2d')]();};}function respondWithResult(_0x217226,_0x2bbec9){_0x2bbec9=_0x2bbec9||0xc8;return function(_0x188993){if(_0x188993){return _0x217226[_0x54c3('0x2c')](_0x2bbec9)[_0x54c3('0x2e')](_0x188993);}};}function respondWithFilteredResult(_0x16b310,_0xfa7714){return function(_0x3cecc4){if(_0x3cecc4){var _0x6c24e7=typeof _0xfa7714[_0x54c3('0x2f')]===_0x54c3('0x30')&&typeof _0xfa7714[_0x54c3('0x31')]===_0x54c3('0x30');var _0x371e04=_0x3cecc4[_0x54c3('0x32')];var _0x2f4252=_0x6c24e7?0x0:_0xfa7714['offset'];var _0x51bffb=_0x6c24e7?_0x3cecc4[_0x54c3('0x32')]:_0xfa7714['offset']+_0xfa7714[_0x54c3('0x31')];var _0x4febda;if(_0x51bffb>=_0x371e04){_0x51bffb=_0x371e04;_0x4febda=0xc8;}else{_0x4febda=0xce;}_0x16b310[_0x54c3('0x2c')](_0x4febda);return _0x16b310['set'](_0x54c3('0x33'),_0x2f4252+'-'+_0x51bffb+'/'+_0x371e04)[_0x54c3('0x2e')](_0x3cecc4);}return null;};}function patchUpdates(_0x343e2d){return function(_0x1fc2aa){try{jsonpatch['apply'](_0x1fc2aa,_0x343e2d,!![]);}catch(_0x5e7855){return BPromise[_0x54c3('0x34')](_0x5e7855);}return _0x1fc2aa[_0x54c3('0x35')]();};}function saveUpdates(_0x31b918,_0x2605f6){return function(_0x1e05f7){if(_0x1e05f7){return _0x1e05f7[_0x54c3('0x36')](_0x31b918)[_0x54c3('0x37')](function(_0x3c05e6){return _0x3c05e6;});}return null;};}function removeEntity(_0x52d548,_0x420b18){return function(_0x17a716){if(_0x17a716){return _0x17a716[_0x54c3('0x38')]()[_0x54c3('0x37')](function(){var _0x38be6d=_0x17a716[_0x54c3('0x39')]({'plain':!![]});var _0x4f382b=_0x54c3('0x3a');return db[_0x54c3('0x3b')][_0x54c3('0x38')]({'where':{'type':_0x4f382b,'resourceId':_0x38be6d['id']}})['then'](function(){return _0x17a716;});})[_0x54c3('0x37')](function(){_0x52d548['status'](0xcc)[_0x54c3('0x2d')]();});}};}function handleEntityNotFound(_0x4b5999,_0x3329f9){return function(_0x14555d){if(!_0x14555d){_0x4b5999[_0x54c3('0x2b')](0x194);}return _0x14555d;};}function handleError(_0x3e95db,_0x24e965){_0x24e965=_0x24e965||0x1f4;return function(_0x2dc5f8){logger[_0x54c3('0x24')](_0x2dc5f8[_0x54c3('0x3c')]);if(_0x2dc5f8['name']){delete _0x2dc5f8[_0x54c3('0x3d')];}_0x3e95db[_0x54c3('0x2c')](_0x24e965)[_0x54c3('0x3e')](_0x2dc5f8);};}exports[_0x54c3('0x3f')]=function(_0x12dd6a,_0x376d03){var _0x41b9e2={},_0x29d1c4={},_0x2b441e={'count':0x0,'rows':[]};var _0x477be8=_['map'](db[_0x54c3('0x40')][_0x54c3('0x41')],function(_0x348709){return{'name':_0x348709[_0x54c3('0x42')],'type':_0x348709[_0x54c3('0x43')][_0x54c3('0x44')]};});_0x29d1c4[_0x54c3('0x45')]=_[_0x54c3('0x46')](_0x477be8,_0x54c3('0x3d'));_0x29d1c4['query']=_['keys'](_0x12dd6a['query']);_0x29d1c4[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x29d1c4['model'],_0x29d1c4[_0x54c3('0x49')]);_0x41b9e2[_0x54c3('0x4a')]=_['intersection'](_0x29d1c4[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x12dd6a['query'][_0x54c3('0x4b')]));_0x41b9e2[_0x54c3('0x4a')]=_0x41b9e2[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x41b9e2[_0x54c3('0x4a')]:_0x29d1c4['model'];if(!_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x4d')]('nolimit')){_0x41b9e2['limit']=qs[_0x54c3('0x31')](_0x12dd6a[_0x54c3('0x49')]['limit']);_0x41b9e2[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x41b9e2['order']=qs[_0x54c3('0x4e')](_0x12dd6a['query'][_0x54c3('0x4e')]);_0x41b9e2[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x12dd6a[_0x54c3('0x49')],_0x29d1c4[_0x54c3('0x47')]),_0x477be8);if(_0x12dd6a['query'][_0x54c3('0x51')]){_0x41b9e2['where']=_[_0x54c3('0x52')](_0x41b9e2[_0x54c3('0x4f')],{'$or':_['map'](_0x477be8,function(_0x13331c){if(_0x13331c[_0x54c3('0x43')]!==_0x54c3('0x53')){var _0x37078b={};_0x37078b[_0x13331c[_0x54c3('0x3d')]]={'$like':'%'+_0x12dd6a[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x37078b;}})});}_0x41b9e2=_[_0x54c3('0x52')]({},_0x41b9e2,_0x12dd6a[_0x54c3('0x54')]);var _0x183878={'where':_0x41b9e2[_0x54c3('0x4f')]};return db['ChatQueue'][_0x54c3('0x32')](_0x183878)[_0x54c3('0x37')](function(_0x5172c8){_0x2b441e[_0x54c3('0x32')]=_0x5172c8;if(_0x12dd6a[_0x54c3('0x49')]['includeAll']){_0x41b9e2['include']=[{'all':!![]}];}return db[_0x54c3('0x40')][_0x54c3('0x55')](_0x41b9e2);})[_0x54c3('0x37')](function(_0x2517b9){_0x2b441e[_0x54c3('0x56')]=_0x2517b9;return _0x2b441e;})[_0x54c3('0x37')](respondWithFilteredResult(_0x376d03,_0x41b9e2))[_0x54c3('0x2a')](handleError(_0x376d03,null));};exports[_0x54c3('0x57')]=function(_0x2f2793,_0x4e84d0){var _0x128618={'raw':!![],'where':{'id':_0x2f2793[_0x54c3('0x58')]['id']}},_0x4ffbc1={};_0x4ffbc1['model']=_['keys'](db['ChatQueue'][_0x54c3('0x41')]);_0x4ffbc1['query']=_[_0x54c3('0x59')](_0x2f2793[_0x54c3('0x49')]);_0x4ffbc1[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],_0x4ffbc1[_0x54c3('0x49')]);_0x128618[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x4ffbc1[_0x54c3('0x45')],qs['fields'](_0x2f2793[_0x54c3('0x49')][_0x54c3('0x4b')]));_0x128618[_0x54c3('0x4a')]=_0x128618[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x128618['attributes']:_0x4ffbc1[_0x54c3('0x45')];if(_0x2f2793['query']['includeAll']){_0x128618[_0x54c3('0x5a')]=[{'all':!![]}];}_0x128618=_[_0x54c3('0x52')]({},_0x128618,_0x2f2793[_0x54c3('0x54')]);return db[_0x54c3('0x40')][_0x54c3('0x5b')](_0x128618)[_0x54c3('0x37')](handleEntityNotFound(_0x4e84d0,null))[_0x54c3('0x37')](respondWithResult(_0x4e84d0,null))[_0x54c3('0x2a')](handleError(_0x4e84d0,null));};exports[_0x54c3('0x5c')]=function(_0x471505,_0x273475){return db['ChatQueue'][_0x54c3('0x5c')](_0x471505[_0x54c3('0x5d')],{})[_0x54c3('0x37')](function(_0x20459a){var _0x45e7e8=_0x471505['user'][_0x54c3('0x39')]({'plain':!![]});if(!_0x45e7e8)throw new Error(_0x54c3('0x5e'));if(_0x45e7e8['role']===_0x54c3('0x5f')){var _0x4396ed=_0x20459a[_0x54c3('0x39')]({'plain':!![]});var _0x3cb2e0=_0x54c3('0x3a');return db[_0x54c3('0x60')][_0x54c3('0x5b')]({'where':{'name':_0x3cb2e0,'userProfileId':_0x45e7e8['userProfileId']},'raw':!![]})['then'](function(_0x42e58c){if(_0x42e58c&&_0x42e58c[_0x54c3('0x61')]===0x0){return db[_0x54c3('0x3b')]['create']({'name':_0x4396ed[_0x54c3('0x3d')],'resourceId':_0x4396ed['id'],'type':_0x42e58c['name'],'sectionId':_0x42e58c['id']},{})[_0x54c3('0x37')](function(){return _0x20459a;});}else{return _0x20459a;}})[_0x54c3('0x2a')](function(_0x310818){logger['error'](_0x54c3('0x62'),_0x310818);throw _0x310818;});}return _0x20459a;})['then'](respondWithResult(_0x273475,0xc9))[_0x54c3('0x2a')](handleError(_0x273475,null));};exports['update']=function(_0x50146e,_0x32b5d3){if(_0x50146e[_0x54c3('0x5d')]['id']){delete _0x50146e['body']['id'];}return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x50146e[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x32b5d3,null))[_0x54c3('0x37')](saveUpdates(_0x50146e['body'],null))[_0x54c3('0x37')](respondWithResult(_0x32b5d3,null))[_0x54c3('0x2a')](handleError(_0x32b5d3,null));};exports[_0x54c3('0x38')]=function(_0x357723,_0x25a40e){return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x357723[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x25a40e,null))[_0x54c3('0x37')](removeEntity(_0x25a40e,null))['catch'](handleError(_0x25a40e,null));};exports['describe']=function(_0x62100e,_0x288bf5){return db[_0x54c3('0x40')][_0x54c3('0x63')]()[_0x54c3('0x37')](respondWithResult(_0x288bf5,null))[_0x54c3('0x2a')](handleError(_0x288bf5,null));};exports[_0x54c3('0x64')]=function(_0x330d92,_0x9f247a,_0x39b564){var _0x583ae1={'raw':!![],'where':{}},_0xcee158={},_0x57f5ff;return db['ChatQueue'][_0x54c3('0x65')]({'where':{'id':_0x330d92[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x9f247a,null))['then'](function(_0x5cccdf){if(_0x5cccdf){_0x57f5ff=_0x5cccdf['get']({'plain':!![]});_0xcee158[_0x54c3('0x45')]=_[_0x54c3('0x59')](db[_0x54c3('0x66')][_0x54c3('0x41')]);_0xcee158[_0x54c3('0x49')]=_['keys'](_0x330d92[_0x54c3('0x49')]);_0xcee158[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],_0xcee158[_0x54c3('0x49')]);_0x583ae1[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0xcee158[_0x54c3('0x45')],qs['fields'](_0x330d92['query'][_0x54c3('0x4b')]));_0x583ae1['attributes']=_0x583ae1[_0x54c3('0x4a')][_0x54c3('0x4c')]?_0x583ae1[_0x54c3('0x4a')]:_0xcee158[_0x54c3('0x45')];if(!_0x330d92['query'][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x583ae1[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x330d92['query'][_0x54c3('0x31')]);_0x583ae1[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x330d92[_0x54c3('0x49')][_0x54c3('0x2f')]);}_0x583ae1[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x330d92['query'][_0x54c3('0x4e')]);_0x583ae1[_0x54c3('0x4f')]=qs['filters'](_[_0x54c3('0x50')](_0x330d92[_0x54c3('0x49')],_0xcee158[_0x54c3('0x47')]));_0x583ae1[_0x54c3('0x4f')][_0x54c3('0x69')]=_0x5cccdf['id'];if(_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]){_0x583ae1['where']=_[_0x54c3('0x52')](_0x583ae1[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x583ae1[_0x54c3('0x4a')],function(_0xc1632a){var _0x4b2fb6={};_0x4b2fb6[_0xc1632a]={'$like':'%'+_0x330d92[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x4b2fb6;})});}_0x583ae1=_['merge']({},_0x583ae1,_0x330d92[_0x54c3('0x54')]);return db['UserChatQueue']['findAll'](_0x583ae1);}})[_0x54c3('0x37')](function(_0x3756ce){if(_0x3756ce){return db[_0x54c3('0x6a')][_0x54c3('0x6b')]({'where':{'id':_[_0x54c3('0x46')](_0x3756ce,'UserId'),'role':_0x54c3('0x6c')},'attributes':['id',_0x54c3('0x3d'),_0x54c3('0x6d'),_0x54c3('0x6e'),_0x54c3('0x6f')]});}})[_0x54c3('0x37')](function(_0x1a365a){if(_0x1a365a){return{'count':_0x1a365a[_0x54c3('0x32')],'rows':_['map'](_0x1a365a['rows'],function(_0xef1026){return{'membername':_0xef1026[_0x54c3('0x3d')],'UserId':_0xef1026['id'],'queue_name':_0x57f5ff[_0x54c3('0x3d')],'ChatQueueId':_0x57f5ff['id'],'interface':util[_0x54c3('0x70')]('%s/%s',_0x54c3('0x71'),_0xef1026[_0x54c3('0x3d')]),'penalty':0x0,'paused':_0xef1026['chatPause'],'createdAt':_0xef1026[_0x54c3('0x6f')],'updatedAt':_0xef1026[_0x54c3('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9f247a,_0x583ae1))[_0x54c3('0x2a')](handleError(_0x9f247a,null));};exports[_0x54c3('0x72')]=function(_0x58c9e8,_0x2b837a,_0x312f18){var _0x3bc8e3={};var _0x583e63={};var _0x118aa0;var _0x7f8a5c;return db[_0x54c3('0x40')]['findOne']({'where':{'id':_0x58c9e8[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0x2b837a,null))['then'](function(_0x4f00cc){if(_0x4f00cc){_0x118aa0=_0x4f00cc;_0x583e63[_0x54c3('0x45')]=_[_0x54c3('0x59')](db['Team']['rawAttributes']);_0x583e63['query']=_[_0x54c3('0x59')](_0x58c9e8[_0x54c3('0x49')]);_0x583e63[_0x54c3('0x47')]=_['intersection'](_0x583e63[_0x54c3('0x45')],_0x583e63[_0x54c3('0x49')]);_0x3bc8e3[_0x54c3('0x4a')]=_[_0x54c3('0x48')](_0x583e63[_0x54c3('0x45')],qs['fields'](_0x58c9e8[_0x54c3('0x49')]['fields']));_0x3bc8e3[_0x54c3('0x4a')]=_0x3bc8e3['attributes']['length']?_0x3bc8e3['attributes']:_0x583e63[_0x54c3('0x45')];_0x3bc8e3[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4e')]);_0x3bc8e3[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_['pick'](_0x58c9e8[_0x54c3('0x49')],_0x583e63[_0x54c3('0x47')]));if(_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]){_0x3bc8e3[_0x54c3('0x4f')]=_[_0x54c3('0x52')](_0x3bc8e3[_0x54c3('0x4f')],{'$or':_[_0x54c3('0x46')](_0x3bc8e3['attributes'],function(_0x5bb20e){var _0x734cb7={};_0x734cb7[_0x5bb20e]={'$like':'%'+_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x734cb7;})});}_0x3bc8e3=_['merge']({},_0x3bc8e3,_0x58c9e8[_0x54c3('0x54')]);return _0x118aa0[_0x54c3('0x72')](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0xf75424){if(_0xf75424){_0x7f8a5c=_0xf75424[_0x54c3('0x4c')];if(!_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0x3bc8e3[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x58c9e8[_0x54c3('0x49')][_0x54c3('0x31')]);_0x3bc8e3[_0x54c3('0x2f')]=qs[_0x54c3('0x2f')](_0x58c9e8['query'][_0x54c3('0x2f')]);}return _0x118aa0['getTeams'](_0x3bc8e3);}})[_0x54c3('0x37')](function(_0x4785b6){if(_0x4785b6){return _0x4785b6?{'count':_0x7f8a5c,'rows':_0x4785b6}:null;}})['then'](respondWithResult(_0x2b837a,null))[_0x54c3('0x2a')](handleError(_0x2b837a,null));};exports[_0x54c3('0x73')]=function(_0x54e2c9,_0x39b8cb,_0x38e22c){var _0x57ae8c=_0x54e2c9[_0x54c3('0x5d')][_0x54c3('0x74')];return db['Team']['findAll']({'where':{'id':_0x57ae8c},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':'Agents','attributes':['id',_0x54c3('0x3d'),'online',_0x54c3('0x75'),'interface'],'raw':!![]}]})['then'](function(_0xf241b2){if(_0xf241b2){var _0x4df675=_['flatMap'](_0xf241b2,function(_0x637366){var _0x4a3670=_0x637366['get']({'plain':!![]});return _0x4a3670[_0x54c3('0x76')];});return db['ChatQueue'][_0x54c3('0x5b')]({'where':{'id':_0x54e2c9['params']['id']}})[_0x54c3('0x37')](function(_0x1ad25c){return db['sequelize'][_0x54c3('0x77')](function(_0x5d4dee){return _0x1ad25c[_0x54c3('0x73')](_0x57ae8c,{'transaction':_0x5d4dee})[_0x54c3('0x37')](function(){return BPromise[_0x54c3('0x78')](_0x4df675,function(_0x2015bd){return db[_0x54c3('0x66')][_0x54c3('0x79')]({'where':{'UserId':_0x2015bd['id'],'ChatQueueId':_0x54e2c9[_0x54c3('0x58')]['id']},'transaction':_0x5d4dee});});})['then'](function(){_0x4df675[_0x54c3('0x7a')](function(_0x559448){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':_0x559448['id'],'ChatQueueId':_0x1ad25c['id']});});});});});}})['then'](respondWithStatusCode(_0x39b8cb,null))['catch'](handleError(_0x39b8cb,null));};exports[_0x54c3('0x7d')]=function(_0x18f309,_0x51d8dd,_0x246ed7){return db[_0x54c3('0x7e')][_0x54c3('0x55')]({'where':{'id':_0x18f309['query'][_0x54c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0x54c3('0x6a')],'as':_0x54c3('0x76'),'attributes':['id'],'raw':!![]}]})[_0x54c3('0x37')](handleEntityNotFound(_0x51d8dd,null))[_0x54c3('0x37')](function(_0x2e795f){var _0x196bef=_['map'](_0x2e795f,'id');var _0x565f18=[];var _0x562cc0=[];var _0x2de9d6=squel[_0x54c3('0x7f')]();_0x2de9d6[_0x54c3('0x80')](_0x54c3('0x81'))[_0x54c3('0x82')]('team_has_chat_queues','tq')['join'](_0x54c3('0x83'),'ut',_0x54c3('0x84'))[_0x54c3('0x4f')](_0x54c3('0x85'),_0x18f309['params']['id']);for(var _0x52c6ec=0x0;_0x52c6ec<_0x2e795f[_0x54c3('0x4c')];_0x52c6ec+=0x1){let _0xf741=_0x2e795f[_0x52c6ec];for(var _0x1360ea=0x0;_0x1360ea<_0xf741['Agents'][_0x54c3('0x4c')];_0x1360ea+=0x1){let _0x3281a2=_0xf741[_0x54c3('0x76')][_0x1360ea];var _0x24460e=_0x2de9d6[_0x54c3('0x86')]();_0x24460e['where'](_0x54c3('0x87'),_0x3281a2['id']);_0x562cc0['push'](db['sequelize']['query'](_0x24460e[_0x54c3('0x88')](),{'type':db['sequelize'][_0x54c3('0x89')]['SELECT']})[_0x54c3('0x37')](function(_0x4df5fd){if(_0x4df5fd['length']===0x1){return _0x3281a2['id'];}else{var _0x28eee9=_['every'](_[_0x54c3('0x46')](_0x4df5fd,_0x54c3('0x8a')),function(_0x4d231c){return _['includes'](_0x196bef,_0x4d231c);});if(_0x28eee9){return _0x3281a2['id'];}}}));}}return BPromise[_0x54c3('0x8b')](_0x562cc0)[_0x54c3('0x37')](function(_0x3b2a3b){_0x565f18=_(_0x565f18)[_0x54c3('0x8c')](_0x3b2a3b)[_0x54c3('0x8d')]()[_0x54c3('0x8e')]();return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x18f309[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](function(_0xd0858a){return db[_0x54c3('0x8f')][_0x54c3('0x77')](function(_0x1e8149){return _0xd0858a[_0x54c3('0x7d')](_0x18f309['query'][_0x54c3('0x74')],{'transaction':_0x1e8149})[_0x54c3('0x37')](function(){if(!_[_0x54c3('0x90')](_0x565f18)){return _0xd0858a[_0x54c3('0x91')](_0x565f18,{'transaction':_0x1e8149});}})[_0x54c3('0x37')](function(){_0x565f18[_0x54c3('0x7a')](function(_0x64c5dc){socket[_0x54c3('0x7b')](_0x54c3('0x92'),{'UserId':_0x64c5dc,'ChatQueueId':_0xd0858a['id']});});});});});});})[_0x54c3('0x37')](respondWithStatusCode(_0x51d8dd,null))[_0x54c3('0x2a')](handleError(_0x51d8dd,null));};exports[_0x54c3('0x93')]=function(_0x569bda,_0x21a0ad,_0x5aec34){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x569bda[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x21a0ad,null))[_0x54c3('0x37')](function(_0x514949){if(_0x514949){return _0x514949[_0x54c3('0x93')](_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')],_[_0x54c3('0x94')](_0x569bda[_0x54c3('0x5d')],['ids','id'])||{})[_0x54c3('0x95')](function(_0x290987){for(var _0x301548=0x0;_0x301548<_0x569bda[_0x54c3('0x5d')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x301548+=0x1){socket[_0x54c3('0x7b')](_0x54c3('0x7c'),{'UserId':Number(_0x569bda[_0x54c3('0x5d')]['ids'][_0x301548]),'ChatQueueId':Number(_0x569bda['params']['id'])});}return _0x290987;});}})[_0x54c3('0x37')](respondWithResult(_0x21a0ad,null))[_0x54c3('0x2a')](handleError(_0x21a0ad,null));};exports['removeAgents']=function(_0x34d33c,_0x18296a,_0x21149f){return db[_0x54c3('0x40')][_0x54c3('0x5b')]({'where':{'id':_0x34d33c[_0x54c3('0x58')]['id']}})['then'](handleEntityNotFound(_0x18296a,null))[_0x54c3('0x37')](function(_0x29f9fe){if(_0x29f9fe){return _0x29f9fe['removeAgents'](_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')])[_0x54c3('0x37')](function(){if(_['isArray'](_0x34d33c[_0x54c3('0x49')]['ids'])){for(var _0x54690c=0x0;_0x54690c<_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54c3('0x4c')];_0x54690c+=0x1){socket['emit'](_0x54c3('0x92'),{'UserId':Number(_0x34d33c[_0x54c3('0x49')][_0x54c3('0x74')][_0x54690c]),'ChatQueueId':Number(_0x34d33c[_0x54c3('0x58')]['id'])});}}else{socket[_0x54c3('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x34d33c[_0x54c3('0x49')]['ids']),'ChatQueueId':Number(_0x34d33c['params']['id'])});}});}})[_0x54c3('0x37')](respondWithStatusCode(_0x18296a,null))[_0x54c3('0x2a')](handleError(_0x18296a,null));};exports[_0x54c3('0x96')]=function(_0x1e26a6,_0xabd60d,_0x5a86cf){var _0xeadb86={};var _0x5e1564={};var _0x597daf;var _0x4c0c60;return db[_0x54c3('0x40')][_0x54c3('0x65')]({'where':{'id':_0x1e26a6[_0x54c3('0x58')]['id']}})[_0x54c3('0x37')](handleEntityNotFound(_0xabd60d,null))[_0x54c3('0x37')](function(_0xfd694){if(_0xfd694){_0x597daf=_0xfd694;_0x5e1564[_0x54c3('0x45')]=_['keys'](db[_0x54c3('0x6a')][_0x54c3('0x41')]);_0x5e1564['query']=_[_0x54c3('0x59')](_0x1e26a6[_0x54c3('0x49')]);_0x5e1564[_0x54c3('0x47')]=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],_0x5e1564['query']);_0xeadb86['attributes']=_[_0x54c3('0x48')](_0x5e1564[_0x54c3('0x45')],qs[_0x54c3('0x4b')](_0x1e26a6['query'][_0x54c3('0x4b')]));_0xeadb86[_0x54c3('0x4a')]=_0xeadb86[_0x54c3('0x4a')]['length']?_0xeadb86[_0x54c3('0x4a')]:_0x5e1564[_0x54c3('0x45')];_0xeadb86[_0x54c3('0x68')]=qs[_0x54c3('0x4e')](_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4e')]);_0xeadb86[_0x54c3('0x4f')]=qs[_0x54c3('0x47')](_[_0x54c3('0x50')](_0x1e26a6[_0x54c3('0x49')],_0x5e1564['filters']));if(_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]){_0xeadb86['where']=_[_0x54c3('0x52')](_0xeadb86['where'],{'$or':_[_0x54c3('0x46')](_0xeadb86[_0x54c3('0x4a')],function(_0x256354){var _0x5231c3={};_0x5231c3[_0x256354]={'$like':'%'+_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x51')]+'%'};return _0x5231c3;})});}_0xeadb86=_[_0x54c3('0x52')]({},_0xeadb86,_0x1e26a6[_0x54c3('0x54')]);return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x4e8422){if(_0x4e8422){_0x4c0c60=_0x4e8422[_0x54c3('0x4c')];if(!_0x1e26a6[_0x54c3('0x49')][_0x54c3('0x4d')](_0x54c3('0x67'))){_0xeadb86[_0x54c3('0x31')]=qs[_0x54c3('0x31')](_0x1e26a6['query'][_0x54c3('0x31')]);_0xeadb86['offset']=qs[_0x54c3('0x2f')](_0x1e26a6[_0x54c3('0x49')]['offset']);}return _0x597daf[_0x54c3('0x96')](_0xeadb86);}})[_0x54c3('0x37')](function(_0x3ab4c2){if(_0x3ab4c2){return _0x3ab4c2?{'count':_0x4c0c60,'rows':_0x3ab4c2}:null;}})[_0x54c3('0x37')](respondWithResult(_0xabd60d,null))['catch'](handleError(_0xabd60d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 2c48a6f..8c19dda 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 _0x67e4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x3b7847,_0xfefc56){var _0x2060ce=function(_0x25c37e){while(--_0x25c37e){_0x3b7847['push'](_0x3b7847['shift']());}};_0x2060ce(++_0xfefc56);}(_0x67e4,0x161));var _0x467e=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x67e4[_0x28e2cd];return _0x11fd46;};'use strict';var EventEmitter=require(_0x467e('0x0'));var ChatQueue=require(_0x467e('0x1'))['db'][_0x467e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x467e('0x3')](0x0);var events={'afterCreate':_0x467e('0x4'),'afterUpdate':_0x467e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5d616b){return function(_0x4f7c4b,_0x391d73,_0x5c7a38){ChatQueueEvents[_0x467e('0x6')](_0x5d616b+':'+_0x4f7c4b['id'],_0x4f7c4b);ChatQueueEvents[_0x467e('0x6')](_0x5d616b,_0x4f7c4b);_0x5c7a38(null);};}for(var e in events){if(events[_0x467e('0x7')](e)){var event=events[e];ChatQueue[_0x467e('0x8')](e,emitEvent(event));}}module[_0x467e('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7d70=['save','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x45bbe9,_0x5e1882){var _0x38d715=function(_0x32e2be){while(--_0x32e2be){_0x45bbe9['push'](_0x45bbe9['shift']());}};_0x38d715(++_0x5e1882);}(_0x7d70,0x12e));var _0x07d7=function(_0x27de9e,_0x43861a){_0x27de9e=_0x27de9e-0x0;var _0x53be65=_0x7d70[_0x27de9e];return _0x53be65;};'use strict';var EventEmitter=require(_0x07d7('0x0'));var ChatQueue=require(_0x07d7('0x1'))['db'][_0x07d7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x07d7('0x3')](0x0);var events={'afterCreate':_0x07d7('0x4'),'afterUpdate':'update','afterDestroy':_0x07d7('0x5')};function emitEvent(_0x1a1312){return function(_0x26f91c,_0x5ae830,_0x44e7ce){ChatQueueEvents[_0x07d7('0x6')](_0x1a1312+':'+_0x26f91c['id'],_0x26f91c);ChatQueueEvents[_0x07d7('0x6')](_0x1a1312,_0x26f91c);_0x44e7ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x07d7('0x7')](e,emitEvent(event));}}module[_0x07d7('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index b67647d..0899439 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 _0xbd81=['../../config/environment','./chatQueue.attributes','exports','define','chat_queues','util','api','moment','bluebird','request-promise'];(function(_0x327ae5,_0x4268e0){var _0x402ec4=function(_0x39de4b){while(--_0x39de4b){_0x327ae5['push'](_0x327ae5['shift']());}};_0x402ec4(++_0x4268e0);}(_0xbd81,0xf5));var _0x1bd8=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbd81[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x1bd8('0x0'));var logger=require('../../config/logger')(_0x1bd8('0x1'));var moment=require(_0x1bd8('0x2'));var BPromise=require(_0x1bd8('0x3'));var rp=require(_0x1bd8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1bd8('0x5'));var attributes=require(_0x1bd8('0x6'));module[_0x1bd8('0x7')]=function(_0x47ceb3,_0x2fe613){return _0x47ceb3[_0x1bd8('0x8')]('ChatQueue',attributes,{'tableName':_0x1bd8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x558f=['util','../../config/logger','api','moment','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x1eb8ab,_0x17d3d0){var _0x353c9b=function(_0x3b69b0){while(--_0x3b69b0){_0x1eb8ab['push'](_0x1eb8ab['shift']());}};_0x353c9b(++_0x17d3d0);}(_0x558f,0xcb));var _0xf558=function(_0x4fdc01,_0x4101ea){_0x4fdc01=_0x4fdc01-0x0;var _0x5bb876=_0x558f[_0x4fdc01];return _0x5bb876;};'use strict';var _=require(_0xf558('0x0'));var util=require(_0xf558('0x1'));var logger=require(_0xf558('0x2'))(_0xf558('0x3'));var moment=require(_0xf558('0x4'));var BPromise=require('bluebird');var rp=require(_0xf558('0x5'));var fs=require('fs');var path=require(_0xf558('0x6'));var rimraf=require(_0xf558('0x7'));var config=require('../../config/environment');var attributes=require(_0xf558('0x8'));module[_0xf558('0x9')]=function(_0x5c294b,_0x5771a3){return _0x5c294b['define'](_0xf558('0xa'),attributes,{'tableName':_0xf558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 78f4ffc..f4f8800 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 _0x8383=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','options','where','attributes','include','map','model','GetChatQueue','raw','ShowChatQueue','lodash','bluebird','randomstring','ioredis'];(function(_0x2d1022,_0x292ba7){var _0x35dc62=function(_0x3ef12a){while(--_0x3ef12a){_0x2d1022['push'](_0x2d1022['shift']());}};_0x35dc62(++_0x292ba7);}(_0x8383,0x98));var _0x3838=function(_0x3f5a54,_0x121e75){_0x3f5a54=_0x3f5a54-0x0;var _0x331ec9=_0x8383[_0x3f5a54];return _0x331ec9;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3838('0x1'));var rs=require(_0x3838('0x2'));var fs=require('fs');var Redis=require(_0x3838('0x3'));var db=require(_0x3838('0x4'))['db'];var utils=require(_0x3838('0x5'));var logger=require(_0x3838('0x6'))(_0x3838('0x7'));var config=require(_0x3838('0x8'));var jayson=require(_0x3838('0x9'));var client=jayson[_0x3838('0xa')]['http']({'port':0x232a});config[_0x3838('0xb')]=_[_0x3838('0xc')](config['redis'],{'host':_0x3838('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3838('0xb')]));require(_0x3838('0xe'))[_0x3838('0xf')](socket);function respondWithRpcPromise(_0x550a5c,_0x2af70d,_0xeccb09){return new BPromise(function(_0x15c28a,_0x545100){return client[_0x3838('0x10')](_0x550a5c,_0xeccb09)[_0x3838('0x11')](function(_0x9161a2){logger[_0x3838('0x12')]('ChatQueue,\x20%s,\x20%s',_0x2af70d,_0x3838('0x13'));logger[_0x3838('0x14')](_0x3838('0x15'),_0x2af70d,'request\x20sent',JSON[_0x3838('0x16')](_0x9161a2));if(_0x9161a2['error']){if(_0x9161a2[_0x3838('0x17')][_0x3838('0x18')]===0x1f4){logger[_0x3838('0x17')](_0x3838('0x19'),_0x2af70d,_0x9161a2[_0x3838('0x17')]['message']);return _0x545100(_0x9161a2[_0x3838('0x17')][_0x3838('0x1a')]);}logger[_0x3838('0x17')](_0x3838('0x19'),_0x2af70d,_0x9161a2[_0x3838('0x17')]['message']);return _0x15c28a(_0x9161a2[_0x3838('0x17')][_0x3838('0x1a')]);}else{logger[_0x3838('0x12')]('ChatQueue,\x20%s,\x20%s',_0x2af70d,_0x3838('0x13'));_0x15c28a(_0x9161a2[_0x3838('0x1b')]['message']);}})[_0x3838('0x1c')](function(_0x2fe3c8){logger['error'](_0x3838('0x19'),_0x2af70d,_0x2fe3c8);_0x545100(_0x2fe3c8);});});}exports['GetChatQueue']=function(_0x26580){var _0x37f607=this;return new Promise(function(_0x1ae6c9,_0x2f9965){return db[_0x3838('0x1d')]['findAll']({'raw':_0x26580['options']?_0x26580[_0x3838('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x26580[_0x3838('0x1e')]?_0x26580[_0x3838('0x1e')][_0x3838('0x1f')]||null:null,'attributes':_0x26580[_0x3838('0x1e')]?_0x26580[_0x3838('0x1e')][_0x3838('0x20')]||null:null,'limit':_0x26580[_0x3838('0x1e')]?_0x26580[_0x3838('0x1e')]['limit']||null:null,'include':_0x26580[_0x3838('0x1e')]?_0x26580['options'][_0x3838('0x21')]?_[_0x3838('0x22')](_0x26580['options'][_0x3838('0x21')],function(_0x265099){return{'model':db[_0x265099['model']],'as':_0x265099['as'],'attributes':_0x265099[_0x3838('0x20')],'include':_0x265099[_0x3838('0x21')]?_['map'](_0x265099[_0x3838('0x21')],function(_0x4c1efb){return{'model':db[_0x4c1efb[_0x3838('0x23')]],'as':_0x4c1efb['as'],'attributes':_0x4c1efb['attributes'],'include':_0x4c1efb['include']?_[_0x3838('0x22')](_0x4c1efb[_0x3838('0x21')],function(_0x41bb45){return{'model':db[_0x41bb45[_0x3838('0x23')]],'as':_0x41bb45['as'],'attributes':_0x41bb45[_0x3838('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1baf56){logger[_0x3838('0x12')](_0x3838('0x24'),_0x26580);logger['debug'](_0x3838('0x24'),_0x26580,JSON['stringify'](_0x1baf56));_0x1ae6c9(_0x1baf56);})[_0x3838('0x1c')](function(_0x4b1a0c){logger[_0x3838('0x17')](_0x3838('0x24'),_0x4b1a0c['message'],_0x26580);_0x2f9965(_0x37f607[_0x3838('0x17')](0x1f4,_0x4b1a0c['message']));});});};exports['ShowChatQueue']=function(_0x19ec76){var _0x25b81c=this;return new Promise(function(_0x5c74ac,_0x5b594d){return db[_0x3838('0x1d')]['find']({'raw':_0x19ec76[_0x3838('0x1e')]?_0x19ec76[_0x3838('0x1e')][_0x3838('0x25')]===undefined?!![]:![]:!![],'where':_0x19ec76[_0x3838('0x1e')]?_0x19ec76[_0x3838('0x1e')][_0x3838('0x1f')]||null:null,'attributes':_0x19ec76['options']?_0x19ec76[_0x3838('0x1e')][_0x3838('0x20')]||null:null,'include':_0x19ec76[_0x3838('0x1e')]?_0x19ec76[_0x3838('0x1e')][_0x3838('0x21')]?_[_0x3838('0x22')](_0x19ec76[_0x3838('0x1e')][_0x3838('0x21')],function(_0x368298){return{'model':db[_0x368298[_0x3838('0x23')]],'as':_0x368298['as'],'attributes':_0x368298[_0x3838('0x20')],'include':_0x368298['include']?_[_0x3838('0x22')](_0x368298[_0x3838('0x21')],function(_0x3518c9){return{'model':db[_0x3518c9[_0x3838('0x23')]],'as':_0x3518c9['as'],'attributes':_0x3518c9['attributes'],'include':_0x3518c9[_0x3838('0x21')]?_[_0x3838('0x22')](_0x3518c9[_0x3838('0x21')],function(_0x1f4331){return{'model':db[_0x1f4331['model']],'as':_0x1f4331['as'],'attributes':_0x1f4331[_0x3838('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3838('0x11')](function(_0x1c752e){logger[_0x3838('0x12')]('ShowChatQueue',_0x19ec76);logger[_0x3838('0x14')](_0x3838('0x26'),_0x19ec76,JSON[_0x3838('0x16')](_0x1c752e));_0x5c74ac(_0x1c752e);})['catch'](function(_0x5b3383){logger[_0x3838('0x17')](_0x3838('0x26'),_0x5b3383[_0x3838('0x1a')],_0x19ec76);_0x5b594d(_0x25b81c[_0x3838('0x17')](0x1f4,_0x5b3383[_0x3838('0x1a')]));});});};
\ No newline at end of file
+var _0x13cc=['options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x13cc,0x161));var _0xc13c=function(_0x296c1a,_0xa87d73){_0x296c1a=_0x296c1a-0x0;var _0x273bf6=_0x13cc[_0x296c1a];return _0x273bf6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});config[_0xc13c('0x9')]=_[_0xc13c('0xa')](config[_0xc13c('0x9')],{'host':_0xc13c('0xb'),'port':0x18eb});var socket=require(_0xc13c('0xc'))(new Redis(config[_0xc13c('0x9')]));require(_0xc13c('0xd'))['register'](socket);function respondWithRpcPromise(_0x494d38,_0x514064,_0x294739){return new BPromise(function(_0x201daf,_0x3a895e){return client[_0xc13c('0xe')](_0x494d38,_0x294739)[_0xc13c('0xf')](function(_0x4d16f7){logger[_0xc13c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x514064,_0xc13c('0x11'),JSON[_0xc13c('0x12')](_0x4d16f7));if(_0x4d16f7[_0xc13c('0x13')]){if(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x14')]===0x1f4){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);return _0x3a895e(_0x4d16f7[_0xc13c('0x13')]['message']);}logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x4d16f7[_0xc13c('0x13')]['message']);return _0x201daf(_0x4d16f7[_0xc13c('0x13')][_0xc13c('0x16')]);}else{logger[_0xc13c('0x10')](_0xc13c('0x15'),_0x514064,_0xc13c('0x11'));_0x201daf(_0x4d16f7[_0xc13c('0x17')][_0xc13c('0x16')]);}})[_0xc13c('0x18')](function(_0x535808){logger[_0xc13c('0x13')](_0xc13c('0x15'),_0x514064,_0x535808);_0x3a895e(_0x535808);});});}exports[_0xc13c('0x19')]=function(_0x59f32c){var _0x455bda=this;return new Promise(function(_0xe1deaf,_0x52bc34){return db['ChatQueue'][_0xc13c('0x1a')]({'raw':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c['options'][_0xc13c('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x59f32c['options']?_0x59f32c['options'][_0xc13c('0x1e')]||null:null,'limit':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x1f')]||null:null,'include':_0x59f32c[_0xc13c('0x1b')]?_0x59f32c[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x59f32c[_0xc13c('0x1b')]['include'],function(_0x4abf16){return{'model':db[_0x4abf16[_0xc13c('0x22')]],'as':_0x4abf16['as'],'attributes':_0x4abf16[_0xc13c('0x1e')],'include':_0x4abf16[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x4abf16[_0xc13c('0x20')],function(_0x2a1b98){return{'model':db[_0x2a1b98[_0xc13c('0x22')]],'as':_0x2a1b98['as'],'attributes':_0x2a1b98[_0xc13c('0x1e')],'include':_0x2a1b98[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x2a1b98[_0xc13c('0x20')],function(_0x1b005a){return{'model':db[_0x1b005a['model']],'as':_0x1b005a['as'],'attributes':_0x1b005a[_0xc13c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc13c('0xf')](function(_0x1997f3){logger[_0xc13c('0x10')](_0xc13c('0x19'),_0x59f32c);logger['debug'](_0xc13c('0x19'),_0x59f32c,JSON[_0xc13c('0x12')](_0x1997f3));_0xe1deaf(_0x1997f3);})[_0xc13c('0x18')](function(_0x5b0c18){logger[_0xc13c('0x13')]('GetChatQueue',_0x5b0c18['message'],_0x59f32c);_0x52bc34(_0x455bda[_0xc13c('0x13')](0x1f4,_0x5b0c18[_0xc13c('0x16')]));});});};exports[_0xc13c('0x23')]=function(_0x153f04){var _0x544448=this;return new Promise(function(_0x1a44c4,_0x3958ec){return db['ChatQueue'][_0xc13c('0x24')]({'raw':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x153f04[_0xc13c('0x1b')]?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1d')]||null:null,'attributes':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x1e')]||null:null,'include':_0x153f04['options']?_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x153f04[_0xc13c('0x1b')][_0xc13c('0x20')],function(_0x3552b1){return{'model':db[_0x3552b1[_0xc13c('0x22')]],'as':_0x3552b1['as'],'attributes':_0x3552b1[_0xc13c('0x1e')],'include':_0x3552b1[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x3552b1[_0xc13c('0x20')],function(_0x54a9ed){return{'model':db[_0x54a9ed[_0xc13c('0x22')]],'as':_0x54a9ed['as'],'attributes':_0x54a9ed[_0xc13c('0x1e')],'include':_0x54a9ed[_0xc13c('0x20')]?_[_0xc13c('0x21')](_0x54a9ed['include'],function(_0x11f9b9){return{'model':db[_0x11f9b9[_0xc13c('0x22')]],'as':_0x11f9b9['as'],'attributes':_0x11f9b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bb516){logger['info'](_0xc13c('0x23'),_0x153f04);logger[_0xc13c('0x25')]('ShowChatQueue',_0x153f04,JSON[_0xc13c('0x12')](_0x4bb516));_0x1a44c4(_0x4bb516);})[_0xc13c('0x18')](function(_0xf35739){logger[_0xc13c('0x13')]('ShowChatQueue',_0xf35739['message'],_0x153f04);_0x3958ec(_0x544448[_0xc13c('0x13')](0x1f4,_0xf35739['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e187c1d..b39e2d0 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 _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x1a09c1,_0x3704ec){var _0x209647=function(_0x850dbb){while(--_0x850dbb){_0x1a09c1['push'](_0x1a09c1['shift']());}};_0x209647(++_0x3704ec);}(_0x8ce3,0xc3));var _0x38ce=function(_0x893787,_0x2ecfe4){_0x893787=_0x893787-0x0;var _0x4d2cb0=_0x8ce3[_0x893787];return _0x4d2cb0;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}};
\ No newline at end of file
+var _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x34f19f,_0x41209e){var _0x304ec8=function(_0x4fb45e){while(--_0x4fb45e){_0x34f19f['push'](_0x34f19f['shift']());}};_0x304ec8(++_0x41209e);}(_0x9b67,0xf6));var _0x79b6=function(_0x7f69d7,_0x1b57f1){_0x7f69d7=_0x7f69d7-0x0;var _0x5c8667=_0x9b67[_0x7f69d7];return _0x5c8667;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 54b4244..211484c 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5fc3[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f9c4b,_0x3cad26){var _0xf2c727=function(_0x6bd900){while(--_0x6bd900){_0x1f9c4b['push'](_0x1f9c4b['shift']());}};_0xf2c727(++_0x3cad26);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 731947b..4e93913 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 _0xd043=['exports','STRING','DATE','moment','sequelize'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0xd043,0x143));var _0x3d04=function(_0x32b248,_0x4e4850){_0x32b248=_0x32b248-0x0;var _0x1634c4=_0xd043[_0x32b248];return _0x1634c4;};'use strict';var moment=require(_0x3d04('0x0'));var Sequelize=require(_0x3d04('0x1'));module[_0x3d04('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3d04('0x3')]},'joinAt':{'type':Sequelize[_0x3d04('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3d04('0x4')]},'exitAt':{'type':Sequelize[_0x3d04('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xca60=['exports','STRING','DATE','moment'];(function(_0x31fcfc,_0x1a1cfc){var _0x535b8d=function(_0x557443){while(--_0x557443){_0x31fcfc['push'](_0x31fcfc['shift']());}};_0x535b8d(++_0x1a1cfc);}(_0xca60,0xef));var _0x0ca6=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0xca60[_0x3a7db0];return _0x17cbba;};'use strict';var moment=require(_0x0ca6('0x0'));var Sequelize=require('sequelize');module[_0x0ca6('0x1')]={'uniqueid':{'type':Sequelize[_0x0ca6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0ca6('0x2')]},'joinAt':{'type':Sequelize[_0x0ca6('0x3')]},'leaveAt':{'type':Sequelize[_0x0ca6('0x3')]},'acceptAt':{'type':Sequelize[_0x0ca6('0x3')]},'exitAt':{'type':Sequelize[_0x0ca6('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 fb537f2..11ea10a 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 _0x39e6=['params','keys','find','create','update','body','destroy','describe','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','catch','show'];(function(_0x248020,_0x225812){var _0x4a25c4=function(_0x31a7a7){while(--_0x31a7a7){_0x248020['push'](_0x248020['shift']());}};_0x4a25c4(++_0x225812);}(_0x39e6,0x9e));var _0x639e=function(_0x305c4d,_0xba0d5b){_0x305c4d=_0x305c4d-0x0;var _0x59751d=_0x39e6[_0x305c4d];return _0x59751d;};'use strict';var emlformat=require(_0x639e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x639e('0x2'));var BPromise=require(_0x639e('0x3'));var Mustache=require('mustache');var util=require(_0x639e('0x4'));var path=require(_0x639e('0x5'));var sox=require(_0x639e('0x6'));var csv=require(_0x639e('0x7'));var ejs=require(_0x639e('0x8'));var fs=require('fs');var fs_extra=require(_0x639e('0x9'));var _=require(_0x639e('0xa'));var squel=require(_0x639e('0xb'));var crypto=require(_0x639e('0xc'));var jsforce=require(_0x639e('0xd'));var deskjs=require(_0x639e('0xe'));var toCsv=require(_0x639e('0x7'));var querystring=require(_0x639e('0xf'));var Papa=require(_0x639e('0x10'));var Redis=require(_0x639e('0x11'));var authService=require(_0x639e('0x12'));var qs=require(_0x639e('0x13'));var as=require(_0x639e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x639e('0x15'));var utils=require(_0x639e('0x16'));var config=require(_0x639e('0x17'));var licenseUtil=require(_0x639e('0x18'));var db=require(_0x639e('0x19'))['db'];function respondWithStatusCode(_0x16117b,_0x30b490){_0x30b490=_0x30b490||0xcc;return function(_0x4f3d38){if(_0x4f3d38){return _0x16117b['sendStatus'](_0x30b490);}return _0x16117b[_0x639e('0x1a')](_0x30b490)[_0x639e('0x1b')]();};}function respondWithResult(_0x89302c,_0x199fb5){_0x199fb5=_0x199fb5||0xc8;return function(_0x37b8e2){if(_0x37b8e2){return _0x89302c[_0x639e('0x1a')](_0x199fb5)['json'](_0x37b8e2);}};}function respondWithFilteredResult(_0x31826a,_0x20bfbb){return function(_0x23f0f9){if(_0x23f0f9){var _0x4077c5=typeof _0x20bfbb['offset']===_0x639e('0x1c')&&typeof _0x20bfbb['limit']===_0x639e('0x1c');var _0x3932a8=_0x23f0f9[_0x639e('0x1d')];var _0x20b76f=_0x4077c5?0x0:_0x20bfbb[_0x639e('0x1e')];var _0x1c023e=_0x4077c5?_0x23f0f9['count']:_0x20bfbb[_0x639e('0x1e')]+_0x20bfbb[_0x639e('0x1f')];var _0x36f71d;if(_0x1c023e>=_0x3932a8){_0x1c023e=_0x3932a8;_0x36f71d=0xc8;}else{_0x36f71d=0xce;}_0x31826a[_0x639e('0x1a')](_0x36f71d);return _0x31826a['set'](_0x639e('0x20'),_0x20b76f+'-'+_0x1c023e+'/'+_0x3932a8)[_0x639e('0x21')](_0x23f0f9);}return null;};}function patchUpdates(_0x44dd33){return function(_0x149472){try{jsonpatch[_0x639e('0x22')](_0x149472,_0x44dd33,!![]);}catch(_0x50de77){return BPromise[_0x639e('0x23')](_0x50de77);}return _0x149472[_0x639e('0x24')]();};}function saveUpdates(_0x4f4421,_0x25ead8){return function(_0x48dce7){if(_0x48dce7){return _0x48dce7['update'](_0x4f4421)[_0x639e('0x25')](function(_0x3813f6){return _0x3813f6;});}return null;};}function removeEntity(_0x3ab673,_0x24e1ad){return function(_0x211fcb){if(_0x211fcb){return _0x211fcb['destroy']()[_0x639e('0x25')](function(){_0x3ab673[_0x639e('0x1a')](0xcc)[_0x639e('0x1b')]();});}};}function handleEntityNotFound(_0x2da264,_0x2df4d1){return function(_0x5f27f6){if(!_0x5f27f6){_0x2da264[_0x639e('0x26')](0x194);}return _0x5f27f6;};}function handleError(_0x97665a,_0x3a4fe3){_0x3a4fe3=_0x3a4fe3||0x1f4;return function(_0x10abb0){logger['error'](_0x10abb0[_0x639e('0x27')]);if(_0x10abb0[_0x639e('0x28')]){delete _0x10abb0[_0x639e('0x28')];}_0x97665a['status'](_0x3a4fe3)[_0x639e('0x29')](_0x10abb0);};}exports['index']=function(_0x38ce3a,_0x4da5f4){var _0x525a1f={},_0x2c8e3a={},_0x2a3f56={'count':0x0,'rows':[]};var _0x3f7b0f=_[_0x639e('0x2a')](db[_0x639e('0x2b')][_0x639e('0x2c')],function(_0x5797da){return{'name':_0x5797da[_0x639e('0x2d')],'type':_0x5797da[_0x639e('0x2e')]['key']};});_0x2c8e3a['model']=_[_0x639e('0x2a')](_0x3f7b0f,_0x639e('0x28'));_0x2c8e3a[_0x639e('0x2f')]=_['keys'](_0x38ce3a[_0x639e('0x2f')]);_0x2c8e3a['filters']=_[_0x639e('0x30')](_0x2c8e3a[_0x639e('0x31')],_0x2c8e3a[_0x639e('0x2f')]);_0x525a1f['attributes']=_[_0x639e('0x30')](_0x2c8e3a['model'],qs[_0x639e('0x32')](_0x38ce3a[_0x639e('0x2f')][_0x639e('0x32')]));_0x525a1f['attributes']=_0x525a1f[_0x639e('0x33')][_0x639e('0x34')]?_0x525a1f[_0x639e('0x33')]:_0x2c8e3a['model'];if(!_0x38ce3a[_0x639e('0x2f')]['hasOwnProperty'](_0x639e('0x35'))){_0x525a1f[_0x639e('0x1f')]=qs[_0x639e('0x1f')](_0x38ce3a[_0x639e('0x2f')][_0x639e('0x1f')]);_0x525a1f['offset']=qs[_0x639e('0x1e')](_0x38ce3a[_0x639e('0x2f')][_0x639e('0x1e')]);}_0x525a1f[_0x639e('0x36')]=qs['sort'](_0x38ce3a[_0x639e('0x2f')][_0x639e('0x37')]);_0x525a1f[_0x639e('0x38')]=qs['filters'](_[_0x639e('0x39')](_0x38ce3a['query'],_0x2c8e3a[_0x639e('0x3a')]),_0x3f7b0f);if(_0x38ce3a[_0x639e('0x2f')][_0x639e('0x3b')]){_0x525a1f[_0x639e('0x38')]=_[_0x639e('0x3c')](_0x525a1f[_0x639e('0x38')],{'$or':_['map'](_0x3f7b0f,function(_0xebceb5){if(_0xebceb5[_0x639e('0x2e')]!=='VIRTUAL'){var _0x26e637={};_0x26e637[_0xebceb5['name']]={'$like':'%'+_0x38ce3a[_0x639e('0x2f')][_0x639e('0x3b')]+'%'};return _0x26e637;}})});}_0x525a1f=_[_0x639e('0x3c')]({},_0x525a1f,_0x38ce3a[_0x639e('0x3d')]);var _0x35878c={'where':_0x525a1f[_0x639e('0x38')]};return db[_0x639e('0x2b')][_0x639e('0x1d')](_0x35878c)['then'](function(_0x485359){_0x2a3f56['count']=_0x485359;if(_0x38ce3a['query'][_0x639e('0x3e')]){_0x525a1f[_0x639e('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x639e('0x40')](_0x525a1f);})[_0x639e('0x25')](function(_0x16a792){_0x2a3f56['rows']=_0x16a792;return _0x2a3f56;})[_0x639e('0x25')](respondWithFilteredResult(_0x4da5f4,_0x525a1f))[_0x639e('0x41')](handleError(_0x4da5f4,null));};exports[_0x639e('0x42')]=function(_0x3c7d42,_0xb9ef6c){var _0x1bede6={'raw':!![],'where':{'id':_0x3c7d42[_0x639e('0x43')]['id']}},_0x21b62d={};_0x21b62d[_0x639e('0x31')]=_['keys'](db[_0x639e('0x2b')][_0x639e('0x2c')]);_0x21b62d[_0x639e('0x2f')]=_[_0x639e('0x44')](_0x3c7d42[_0x639e('0x2f')]);_0x21b62d[_0x639e('0x3a')]=_['intersection'](_0x21b62d[_0x639e('0x31')],_0x21b62d[_0x639e('0x2f')]);_0x1bede6[_0x639e('0x33')]=_[_0x639e('0x30')](_0x21b62d[_0x639e('0x31')],qs[_0x639e('0x32')](_0x3c7d42[_0x639e('0x2f')][_0x639e('0x32')]));_0x1bede6[_0x639e('0x33')]=_0x1bede6[_0x639e('0x33')][_0x639e('0x34')]?_0x1bede6[_0x639e('0x33')]:_0x21b62d['model'];if(_0x3c7d42[_0x639e('0x2f')]['includeAll']){_0x1bede6['include']=[{'all':!![]}];}_0x1bede6=_[_0x639e('0x3c')]({},_0x1bede6,_0x3c7d42[_0x639e('0x3d')]);return db[_0x639e('0x2b')][_0x639e('0x45')](_0x1bede6)[_0x639e('0x25')](handleEntityNotFound(_0xb9ef6c,null))['then'](respondWithResult(_0xb9ef6c,null))[_0x639e('0x41')](handleError(_0xb9ef6c,null));};exports[_0x639e('0x46')]=function(_0x56ecea,_0x32000e){return db[_0x639e('0x2b')][_0x639e('0x46')](_0x56ecea['body'],{})[_0x639e('0x25')](respondWithResult(_0x32000e,0xc9))[_0x639e('0x41')](handleError(_0x32000e,null));};exports[_0x639e('0x47')]=function(_0x39c352,_0x4d0d3b){if(_0x39c352[_0x639e('0x48')]['id']){delete _0x39c352['body']['id'];}return db[_0x639e('0x2b')]['find']({'where':{'id':_0x39c352[_0x639e('0x43')]['id']}})[_0x639e('0x25')](handleEntityNotFound(_0x4d0d3b,null))[_0x639e('0x25')](saveUpdates(_0x39c352[_0x639e('0x48')],null))[_0x639e('0x25')](respondWithResult(_0x4d0d3b,null))['catch'](handleError(_0x4d0d3b,null));};exports[_0x639e('0x49')]=function(_0x1d3ace,_0x20a122){return db['ChatQueueReport'][_0x639e('0x45')]({'where':{'id':_0x1d3ace[_0x639e('0x43')]['id']}})[_0x639e('0x25')](handleEntityNotFound(_0x20a122,null))[_0x639e('0x25')](removeEntity(_0x20a122,null))['catch'](handleError(_0x20a122,null));};exports[_0x639e('0x4a')]=function(_0x5915ed,_0x9f62aa){return db[_0x639e('0x2b')][_0x639e('0x4a')]()[_0x639e('0x25')](respondWithResult(_0x9f62aa,null))['catch'](handleError(_0x9f62aa,null));};
\ No newline at end of file
+var _0x8be8=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x8be8,0xf6));var _0x88be=function(_0x45b8ca,_0x361efb){_0x45b8ca=_0x45b8ca-0x0;var _0x589fb8=_0x8be8[_0x45b8ca];return _0x589fb8;};'use strict';var emlformat=require(_0x88be('0x0'));var rimraf=require(_0x88be('0x1'));var zipdir=require(_0x88be('0x2'));var jsonpatch=require(_0x88be('0x3'));var rp=require(_0x88be('0x4'));var moment=require(_0x88be('0x5'));var BPromise=require(_0x88be('0x6'));var Mustache=require(_0x88be('0x7'));var util=require(_0x88be('0x8'));var path=require('path');var sox=require(_0x88be('0x9'));var csv=require('to-csv');var ejs=require(_0x88be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88be('0xb'));var squel=require(_0x88be('0xc'));var crypto=require(_0x88be('0xd'));var jsforce=require(_0x88be('0xe'));var deskjs=require(_0x88be('0xf'));var toCsv=require(_0x88be('0x10'));var querystring=require('querystring');var Papa=require(_0x88be('0x11'));var Redis=require('ioredis');var authService=require(_0x88be('0x12'));var qs=require(_0x88be('0x13'));var as=require(_0x88be('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88be('0x15'))(_0x88be('0x16'));var utils=require(_0x88be('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321775,_0x484d78){_0x484d78=_0x484d78||0xcc;return function(_0x51ee23){if(_0x51ee23){return _0x321775[_0x88be('0x19')](_0x484d78);}return _0x321775[_0x88be('0x1a')](_0x484d78)[_0x88be('0x1b')]();};}function respondWithResult(_0x220d9f,_0x1f6f57){_0x1f6f57=_0x1f6f57||0xc8;return function(_0x209623){if(_0x209623){return _0x220d9f[_0x88be('0x1a')](_0x1f6f57)[_0x88be('0x1c')](_0x209623);}};}function respondWithFilteredResult(_0x4ec7cc,_0xefc67){return function(_0x94737d){if(_0x94737d){var _0x44a12f=typeof _0xefc67['offset']===_0x88be('0x1d')&&typeof _0xefc67[_0x88be('0x1e')]==='undefined';var _0x3566e7=_0x94737d[_0x88be('0x1f')];var _0xf43785=_0x44a12f?0x0:_0xefc67[_0x88be('0x20')];var _0x152918=_0x44a12f?_0x94737d[_0x88be('0x1f')]:_0xefc67[_0x88be('0x20')]+_0xefc67[_0x88be('0x1e')];var _0x53fb85;if(_0x152918>=_0x3566e7){_0x152918=_0x3566e7;_0x53fb85=0xc8;}else{_0x53fb85=0xce;}_0x4ec7cc[_0x88be('0x1a')](_0x53fb85);return _0x4ec7cc['set'](_0x88be('0x21'),_0xf43785+'-'+_0x152918+'/'+_0x3566e7)['json'](_0x94737d);}return null;};}function patchUpdates(_0x51c0e4){return function(_0x2fd77d){try{jsonpatch[_0x88be('0x22')](_0x2fd77d,_0x51c0e4,!![]);}catch(_0x4079f7){return BPromise['reject'](_0x4079f7);}return _0x2fd77d[_0x88be('0x23')]();};}function saveUpdates(_0x332e50,_0x1d0414){return function(_0x213580){if(_0x213580){return _0x213580[_0x88be('0x24')](_0x332e50)[_0x88be('0x25')](function(_0x466b19){return _0x466b19;});}return null;};}function removeEntity(_0x344c20,_0xdd27c1){return function(_0x215024){if(_0x215024){return _0x215024[_0x88be('0x26')]()[_0x88be('0x25')](function(){_0x344c20[_0x88be('0x1a')](0xcc)[_0x88be('0x1b')]();});}};}function handleEntityNotFound(_0x1c3e45,_0x2be310){return function(_0x5c1671){if(!_0x5c1671){_0x1c3e45[_0x88be('0x19')](0x194);}return _0x5c1671;};}function handleError(_0x1c9be2,_0x20c9de){_0x20c9de=_0x20c9de||0x1f4;return function(_0x58b671){logger[_0x88be('0x27')](_0x58b671[_0x88be('0x28')]);if(_0x58b671[_0x88be('0x29')]){delete _0x58b671[_0x88be('0x29')];}_0x1c9be2[_0x88be('0x1a')](_0x20c9de)['send'](_0x58b671);};}exports[_0x88be('0x2a')]=function(_0x48f6a0,_0x3dc88a){var _0x537c0b={},_0x3a08fa={},_0x2fe023={'count':0x0,'rows':[]};var _0x1af670=_[_0x88be('0x2b')](db[_0x88be('0x2c')][_0x88be('0x2d')],function(_0x3180a5){return{'name':_0x3180a5[_0x88be('0x2e')],'type':_0x3180a5[_0x88be('0x2f')]['key']};});_0x3a08fa[_0x88be('0x30')]=_[_0x88be('0x2b')](_0x1af670,_0x88be('0x29'));_0x3a08fa[_0x88be('0x31')]=_[_0x88be('0x32')](_0x48f6a0[_0x88be('0x31')]);_0x3a08fa[_0x88be('0x33')]=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],_0x3a08fa['query']);_0x537c0b['attributes']=_[_0x88be('0x34')](_0x3a08fa[_0x88be('0x30')],qs[_0x88be('0x35')](_0x48f6a0['query']['fields']));_0x537c0b[_0x88be('0x36')]=_0x537c0b['attributes'][_0x88be('0x37')]?_0x537c0b['attributes']:_0x3a08fa[_0x88be('0x30')];if(!_0x48f6a0[_0x88be('0x31')][_0x88be('0x38')](_0x88be('0x39'))){_0x537c0b[_0x88be('0x1e')]=qs[_0x88be('0x1e')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x1e')]);_0x537c0b[_0x88be('0x20')]=qs[_0x88be('0x20')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x20')]);}_0x537c0b[_0x88be('0x3a')]=qs[_0x88be('0x3b')](_0x48f6a0[_0x88be('0x31')][_0x88be('0x3b')]);_0x537c0b[_0x88be('0x3c')]=qs[_0x88be('0x33')](_[_0x88be('0x3d')](_0x48f6a0[_0x88be('0x31')],_0x3a08fa[_0x88be('0x33')]),_0x1af670);if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]){_0x537c0b[_0x88be('0x3c')]=_['merge'](_0x537c0b['where'],{'$or':_['map'](_0x1af670,function(_0x32d763){if(_0x32d763['type']!==_0x88be('0x3f')){var _0x3e7fdf={};_0x3e7fdf[_0x32d763[_0x88be('0x29')]]={'$like':'%'+_0x48f6a0[_0x88be('0x31')][_0x88be('0x3e')]+'%'};return _0x3e7fdf;}})});}_0x537c0b=_[_0x88be('0x40')]({},_0x537c0b,_0x48f6a0[_0x88be('0x41')]);var _0x4bec59={'where':_0x537c0b['where']};return db[_0x88be('0x2c')][_0x88be('0x1f')](_0x4bec59)[_0x88be('0x25')](function(_0x63b253){_0x2fe023['count']=_0x63b253;if(_0x48f6a0[_0x88be('0x31')][_0x88be('0x42')]){_0x537c0b[_0x88be('0x43')]=[{'all':!![]}];}return db[_0x88be('0x2c')]['findAll'](_0x537c0b);})[_0x88be('0x25')](function(_0x429f7b){_0x2fe023[_0x88be('0x44')]=_0x429f7b;return _0x2fe023;})[_0x88be('0x25')](respondWithFilteredResult(_0x3dc88a,_0x537c0b))[_0x88be('0x45')](handleError(_0x3dc88a,null));};exports[_0x88be('0x46')]=function(_0x6da13f,_0x1514d2){var _0x1dc5b4={'raw':!![],'where':{'id':_0x6da13f[_0x88be('0x47')]['id']}},_0x5261d7={};_0x5261d7['model']=_['keys'](db[_0x88be('0x2c')][_0x88be('0x2d')]);_0x5261d7[_0x88be('0x31')]=_[_0x88be('0x32')](_0x6da13f['query']);_0x5261d7[_0x88be('0x33')]=_[_0x88be('0x34')](_0x5261d7[_0x88be('0x30')],_0x5261d7[_0x88be('0x31')]);_0x1dc5b4[_0x88be('0x36')]=_['intersection'](_0x5261d7[_0x88be('0x30')],qs[_0x88be('0x35')](_0x6da13f['query'][_0x88be('0x35')]));_0x1dc5b4['attributes']=_0x1dc5b4[_0x88be('0x36')]['length']?_0x1dc5b4[_0x88be('0x36')]:_0x5261d7[_0x88be('0x30')];if(_0x6da13f['query'][_0x88be('0x42')]){_0x1dc5b4[_0x88be('0x43')]=[{'all':!![]}];}_0x1dc5b4=_[_0x88be('0x40')]({},_0x1dc5b4,_0x6da13f[_0x88be('0x41')]);return db[_0x88be('0x2c')][_0x88be('0x48')](_0x1dc5b4)['then'](handleEntityNotFound(_0x1514d2,null))['then'](respondWithResult(_0x1514d2,null))[_0x88be('0x45')](handleError(_0x1514d2,null));};exports[_0x88be('0x49')]=function(_0x1c6c8f,_0x18d1db){return db[_0x88be('0x2c')][_0x88be('0x49')](_0x1c6c8f['body'],{})['then'](respondWithResult(_0x18d1db,0xc9))[_0x88be('0x45')](handleError(_0x18d1db,null));};exports[_0x88be('0x24')]=function(_0xf60d87,_0x174488){if(_0xf60d87['body']['id']){delete _0xf60d87['body']['id'];}return db[_0x88be('0x2c')]['find']({'where':{'id':_0xf60d87[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x174488,null))[_0x88be('0x25')](saveUpdates(_0xf60d87['body'],null))[_0x88be('0x25')](respondWithResult(_0x174488,null))[_0x88be('0x45')](handleError(_0x174488,null));};exports['destroy']=function(_0x3dc85b,_0x582efa){return db[_0x88be('0x2c')]['find']({'where':{'id':_0x3dc85b[_0x88be('0x47')]['id']}})[_0x88be('0x25')](handleEntityNotFound(_0x582efa,null))[_0x88be('0x25')](removeEntity(_0x582efa,null))[_0x88be('0x45')](handleError(_0x582efa,null));};exports[_0x88be('0x4a')]=function(_0x44577f,_0x33d797){return db[_0x88be('0x2c')]['describe']()[_0x88be('0x25')](respondWithResult(_0x33d797,null))[_0x88be('0x45')](handleError(_0x33d797,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b4da4f8..bdb3b58 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(_0x450606,_0x4248fb){var _0x433264=function(_0x5e1b04){while(--_0x5e1b04){_0x450606['push'](_0x450606['shift']());}};_0x433264(++_0x4248fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xb10b[_0x355ce8];return _0x1db8b8;};'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(_0x409d93,_0x205e56){var _0x22eaa9=function(_0x51001e){while(--_0x51001e){_0x409d93['push'](_0x409d93['shift']());}};_0x22eaa9(++_0x205e56);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xcb91[_0x273dc5];return _0x46dae7;};'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 fe32314..d2d35d6 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 _0xbed9=['attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','catch','UpdateChatQueueReport','raw','where'];(function(_0x31aae6,_0x2dbce8){var _0x520c28=function(_0x781477){while(--_0x781477){_0x31aae6['push'](_0x31aae6['shift']());}};_0x520c28(++_0x2dbce8);}(_0xbed9,0x7a));var _0x9bed=function(_0x5e4c60,_0x27fb14){_0x5e4c60=_0x5e4c60-0x0;var _0x50e15e=_0xbed9[_0x5e4c60];return _0x50e15e;};'use strict';var _=require(_0x9bed('0x0'));var util=require(_0x9bed('0x1'));var moment=require('moment');var BPromise=require(_0x9bed('0x2'));var rs=require(_0x9bed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bed('0x4'))['db'];var utils=require(_0x9bed('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9bed('0x6'));var jayson=require(_0x9bed('0x7'));var client=jayson[_0x9bed('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7e18,_0x7aaabe,_0x7fde4a){return new BPromise(function(_0x3e7ac6,_0x36c495){return client['request'](_0x5d7e18,_0x7fde4a)[_0x9bed('0x9')](function(_0x2a2038){logger[_0x9bed('0xa')](_0x9bed('0xb'),_0x7aaabe,_0x9bed('0xc'));logger[_0x9bed('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x7aaabe,_0x9bed('0xc'),JSON[_0x9bed('0xe')](_0x2a2038));if(_0x2a2038[_0x9bed('0xf')]){if(_0x2a2038[_0x9bed('0xf')][_0x9bed('0x10')]===0x1f4){logger['error'](_0x9bed('0xb'),_0x7aaabe,_0x2a2038[_0x9bed('0xf')]['message']);return _0x36c495(_0x2a2038[_0x9bed('0xf')][_0x9bed('0x11')]);}logger[_0x9bed('0xf')](_0x9bed('0xb'),_0x7aaabe,_0x2a2038[_0x9bed('0xf')]['message']);return _0x3e7ac6(_0x2a2038[_0x9bed('0xf')][_0x9bed('0x11')]);}else{logger['info'](_0x9bed('0xb'),_0x7aaabe,_0x9bed('0xc'));_0x3e7ac6(_0x2a2038[_0x9bed('0x12')]['message']);}})['catch'](function(_0x1974dc){logger[_0x9bed('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x7aaabe,_0x1974dc);_0x36c495(_0x1974dc);});});}exports[_0x9bed('0x13')]=function(_0x429175){var _0x240201=this;return new Promise(function(_0x53f347,_0xe909d){return db[_0x9bed('0x14')][_0x9bed('0x15')](_0x429175[_0x9bed('0x16')],{'raw':_0x429175[_0x9bed('0x17')]?_0x429175[_0x9bed('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9bed('0x9')](function(_0x116021){logger[_0x9bed('0xa')]('CreateChatQueueReport',_0x429175);logger[_0x9bed('0xd')](_0x9bed('0x13'),_0x429175,JSON[_0x9bed('0xe')](_0x116021));_0x53f347(_0x116021);})[_0x9bed('0x18')](function(_0x22d831){logger['error'](_0x9bed('0x13'),_0x22d831[_0x9bed('0x11')],_0x429175);_0xe909d(_0x240201['error'](0x1f4,_0x22d831[_0x9bed('0x11')]));});});};exports[_0x9bed('0x19')]=function(_0x3dc088){var _0x48cd72=this;return new Promise(function(_0x24b925,_0x40116f){return db[_0x9bed('0x14')]['update'](_0x3dc088[_0x9bed('0x16')],{'raw':_0x3dc088['options']?_0x3dc088['options'][_0x9bed('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dc088[_0x9bed('0x17')]?_0x3dc088[_0x9bed('0x17')][_0x9bed('0x1b')]||null:null,'attributes':_0x3dc088[_0x9bed('0x17')]?_0x3dc088[_0x9bed('0x17')][_0x9bed('0x1c')]||null:null,'limit':_0x3dc088[_0x9bed('0x17')]?_0x3dc088[_0x9bed('0x17')][_0x9bed('0x1d')]||null:null})[_0x9bed('0x9')](function(_0xc4f76c){logger[_0x9bed('0xa')](_0x9bed('0x19'),_0x3dc088);logger[_0x9bed('0xd')](_0x9bed('0x19'),_0x3dc088,JSON[_0x9bed('0xe')](_0xc4f76c));_0x24b925(_0xc4f76c);})['catch'](function(_0x4e0306){logger[_0x9bed('0xf')](_0x9bed('0x19'),_0x4e0306[_0x9bed('0x11')],_0x3dc088);_0x40116f(_0x48cd72['error'](0x1f4,_0x4e0306[_0x9bed('0x11')]));});});};
\ No newline at end of file
+var _0xff84=['UpdateChatQueueReport','body','where','attributes','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','options','raw','debug','CreateChatQueueReport'];(function(_0x5ea512,_0x2c0faa){var _0x5ab27b=function(_0x2ba725){while(--_0x2ba725){_0x5ea512['push'](_0x5ea512['shift']());}};_0x5ab27b(++_0x2c0faa);}(_0xff84,0x13a));var _0x4ff8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xff84[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4ff8('0x0'));var rs=require(_0x4ff8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ff8('0x2'))['db'];var utils=require(_0x4ff8('0x3'));var logger=require(_0x4ff8('0x4'))(_0x4ff8('0x5'));var config=require(_0x4ff8('0x6'));var jayson=require(_0x4ff8('0x7'));var client=jayson[_0x4ff8('0x8')][_0x4ff8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6ab909,_0x940bd2,_0x18d074){return new BPromise(function(_0x2afdeb,_0x11e927){return client['request'](_0x6ab909,_0x18d074)[_0x4ff8('0xa')](function(_0x9ce9b3){logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,_0x4ff8('0xd'));logger['debug'](_0x4ff8('0xe'),_0x940bd2,_0x4ff8('0xd'),JSON[_0x4ff8('0xf')](_0x9ce9b3));if(_0x9ce9b3[_0x4ff8('0x10')]){if(_0x9ce9b3['error'][_0x4ff8('0x11')]===0x1f4){logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3[_0x4ff8('0x10')][_0x4ff8('0x12')]);return _0x11e927(_0x9ce9b3[_0x4ff8('0x10')]['message']);}logger[_0x4ff8('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x940bd2,_0x9ce9b3['error'][_0x4ff8('0x12')]);return _0x2afdeb(_0x9ce9b3['error'][_0x4ff8('0x12')]);}else{logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x940bd2,'request\x20sent');_0x2afdeb(_0x9ce9b3[_0x4ff8('0x13')][_0x4ff8('0x12')]);}})[_0x4ff8('0x14')](function(_0x9d03e6){logger['error'](_0x4ff8('0xc'),_0x940bd2,_0x9d03e6);_0x11e927(_0x9d03e6);});});}exports['CreateChatQueueReport']=function(_0x418d03){var _0x4f17c0=this;return new Promise(function(_0x5baebc,_0x5238c5){return db[_0x4ff8('0x15')][_0x4ff8('0x16')](_0x418d03['body'],{'raw':_0x418d03[_0x4ff8('0x17')]?_0x418d03['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![]})[_0x4ff8('0xa')](function(_0x5bce72){logger[_0x4ff8('0xb')]('CreateChatQueueReport',_0x418d03);logger[_0x4ff8('0x19')](_0x4ff8('0x1a'),_0x418d03,JSON['stringify'](_0x5bce72));_0x5baebc(_0x5bce72);})[_0x4ff8('0x14')](function(_0x3e0d1b){logger[_0x4ff8('0x10')]('CreateChatQueueReport',_0x3e0d1b[_0x4ff8('0x12')],_0x418d03);_0x5238c5(_0x4f17c0[_0x4ff8('0x10')](0x1f4,_0x3e0d1b['message']));});});};exports[_0x4ff8('0x1b')]=function(_0x5f3b6f){var _0x279b73=this;return new Promise(function(_0x3093f3,_0x552f45){return db[_0x4ff8('0x15')]['update'](_0x5f3b6f[_0x4ff8('0x1c')],{'raw':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options'][_0x4ff8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3b6f['options']?_0x5f3b6f['options'][_0x4ff8('0x1d')]||null:null,'attributes':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f[_0x4ff8('0x17')][_0x4ff8('0x1e')]||null:null,'limit':_0x5f3b6f[_0x4ff8('0x17')]?_0x5f3b6f['options']['limit']||null:null})['then'](function(_0x5955d4){logger[_0x4ff8('0xb')](_0x4ff8('0x1b'),_0x5f3b6f);logger[_0x4ff8('0x19')](_0x4ff8('0x1b'),_0x5f3b6f,JSON['stringify'](_0x5955d4));_0x3093f3(_0x5955d4);})['catch'](function(_0x41c8b9){logger['error'](_0x4ff8('0x1b'),_0x41c8b9['message'],_0x5f3b6f);_0x552f45(_0x279b73[_0x4ff8('0x10')](0x1f4,_0x41c8b9[_0x4ff8('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 6b526c4..dbb06a1 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 _0x0459=['../../config/environment','./chatQueueReport.controller','index','get','describe','/:id','show','post','create','put','update','delete','isAuthenticated','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e8c0f,_0x1f20d9){var _0x568dbe=function(_0xdc6797){while(--_0xdc6797){_0x5e8c0f['push'](_0x5e8c0f['shift']());}};_0x568dbe(++_0x1f20d9);}(_0x0459,0x77));var _0x9045=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x0459[_0xbb091];return _0x467a04;};'use strict';var multer=require('multer');var util=require(_0x9045('0x0'));var path=require(_0x9045('0x1'));var timeout=require('connect-timeout');var express=require(_0x9045('0x2'));var router=express[_0x9045('0x3')]();var fs_extra=require(_0x9045('0x4'));var auth=require(_0x9045('0x5'));var interaction=require(_0x9045('0x6'));var config=require(_0x9045('0x7'));var controller=require(_0x9045('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9045('0x9')]);router[_0x9045('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9045('0xb')]);router['get'](_0x9045('0xc'),auth['isAuthenticated'](),controller[_0x9045('0xd')]);router[_0x9045('0xe')]('/',auth['isAuthenticated'](),controller[_0x9045('0xf')]);router[_0x9045('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9045('0x11')]);router[_0x9045('0x12')]('/:id',auth[_0x9045('0x13')](),controller['destroy']);module[_0x9045('0x14')]=router;
\ No newline at end of file
+var _0xbbf5=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','create','put','/:id','update','destroy','util','path'];(function(_0x3a5c6a,_0x290dd1){var _0x4ac43a=function(_0x368a85){while(--_0x368a85){_0x3a5c6a['push'](_0x3a5c6a['shift']());}};_0x4ac43a(++_0x290dd1);}(_0xbbf5,0xee));var _0x5bbf=function(_0x16206e,_0x2019fe){_0x16206e=_0x16206e-0x0;var _0x1feede=_0xbbf5[_0x16206e];return _0x1feede;};'use strict';var multer=require('multer');var util=require(_0x5bbf('0x0'));var path=require(_0x5bbf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5bbf('0x2')]();var fs_extra=require(_0x5bbf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5bbf('0x4'));var config=require(_0x5bbf('0x5'));var controller=require('./chatQueueReport.controller');router[_0x5bbf('0x6')]('/',auth[_0x5bbf('0x7')](),controller['index']);router['get'](_0x5bbf('0x8'),auth[_0x5bbf('0x7')](),controller['describe']);router[_0x5bbf('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5bbf('0x9')]);router[_0x5bbf('0xa')]('/',auth['isAuthenticated'](),controller[_0x5bbf('0xb')]);router[_0x5bbf('0xc')](_0x5bbf('0xd'),auth[_0x5bbf('0x7')](),controller[_0x5bbf('0xe')]);router['delete'](_0x5bbf('0xd'),auth['isAuthenticated'](),controller[_0x5bbf('0xf')]);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 50c6234..6496f20 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x10499e,_0x56fd86){var _0x3fef98=function(_0x55daeb){while(--_0x55daeb){_0x10499e['push'](_0x10499e['shift']());}};_0x3fef98(++_0x56fd86);}(_0x008c,0x188));var _0xc008=function(_0x8c2e4e,_0x3c105b){_0x8c2e4e=_0x8c2e4e-0x0;var _0x2286bb=_0x008c[_0x8c2e4e];return _0x2286bb;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 81141bf..9404199 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 _0xfb57=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv'];(function(_0x2bf612,_0xddded5){var _0x14c0d3=function(_0x55c005){while(--_0x55c005){_0x2bf612['push'](_0x2bf612['shift']());}};_0x14c0d3(++_0xddded5);}(_0xfb57,0x85));var _0x7fb5=function(_0x40d339,_0xb726c3){_0x40d339=_0x40d339-0x0;var _0x5cbd0b=_0xfb57[_0x40d339];return _0x5cbd0b;};'use strict';var emlformat=require(_0x7fb5('0x0'));var rimraf=require(_0x7fb5('0x1'));var zipdir=require(_0x7fb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fb5('0x3'));var moment=require('moment');var BPromise=require(_0x7fb5('0x4'));var Mustache=require(_0x7fb5('0x5'));var util=require(_0x7fb5('0x6'));var path=require(_0x7fb5('0x7'));var sox=require(_0x7fb5('0x8'));var csv=require('to-csv');var ejs=require(_0x7fb5('0x9'));var fs=require('fs');var fs_extra=require(_0x7fb5('0xa'));var _=require(_0x7fb5('0xb'));var squel=require('squel');var crypto=require(_0x7fb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fb5('0xd'));var toCsv=require(_0x7fb5('0xe'));var querystring=require(_0x7fb5('0xf'));var Papa=require(_0x7fb5('0x10'));var Redis=require(_0x7fb5('0x11'));var authService=require(_0x7fb5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb5('0x14'))(_0x7fb5('0x15'));var utils=require(_0x7fb5('0x16'));var config=require(_0x7fb5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb5('0x18'))['db'];function respondWithStatusCode(_0x1e62c6,_0x54f007){_0x54f007=_0x54f007||0xcc;return function(_0x370fa0){if(_0x370fa0){return _0x1e62c6[_0x7fb5('0x19')](_0x54f007);}return _0x1e62c6['status'](_0x54f007)[_0x7fb5('0x1a')]();};}function respondWithResult(_0x35c92b,_0xcd2aa3){_0xcd2aa3=_0xcd2aa3||0xc8;return function(_0x19cafb){if(_0x19cafb){return _0x35c92b[_0x7fb5('0x1b')](_0xcd2aa3)[_0x7fb5('0x1c')](_0x19cafb);}};}function respondWithFilteredResult(_0x4e8879,_0x258bb9){return function(_0x1b187b){if(_0x1b187b){var _0x15359a=typeof _0x258bb9[_0x7fb5('0x1d')]===_0x7fb5('0x1e')&&typeof _0x258bb9[_0x7fb5('0x1f')]==='undefined';var _0x37783a=_0x1b187b[_0x7fb5('0x20')];var _0x255902=_0x15359a?0x0:_0x258bb9[_0x7fb5('0x1d')];var _0x5d4772=_0x15359a?_0x1b187b[_0x7fb5('0x20')]:_0x258bb9['offset']+_0x258bb9[_0x7fb5('0x1f')];var _0x38bcf9;if(_0x5d4772>=_0x37783a){_0x5d4772=_0x37783a;_0x38bcf9=0xc8;}else{_0x38bcf9=0xce;}_0x4e8879[_0x7fb5('0x1b')](_0x38bcf9);return _0x4e8879[_0x7fb5('0x21')]('Content-Range',_0x255902+'-'+_0x5d4772+'/'+_0x37783a)[_0x7fb5('0x1c')](_0x1b187b);}return null;};}function patchUpdates(_0x4e437a){return function(_0x281060){try{jsonpatch[_0x7fb5('0x22')](_0x281060,_0x4e437a,!![]);}catch(_0x30afa0){return BPromise[_0x7fb5('0x23')](_0x30afa0);}return _0x281060[_0x7fb5('0x24')]();};}function saveUpdates(_0x21dff6,_0x3d027f){return function(_0x5e60df){if(_0x5e60df){return _0x5e60df['update'](_0x21dff6)['then'](function(_0x4810f3){return _0x4810f3;});}return null;};}function removeEntity(_0x4972e1,_0x4f9ea1){return function(_0x36e969){if(_0x36e969){return _0x36e969['destroy']()[_0x7fb5('0x25')](function(){_0x4972e1['status'](0xcc)[_0x7fb5('0x1a')]();});}};}function handleEntityNotFound(_0x11f4ad,_0x97c140){return function(_0x2ad7a3){if(!_0x2ad7a3){_0x11f4ad[_0x7fb5('0x19')](0x194);}return _0x2ad7a3;};}function handleError(_0x3062aa,_0x5e3b13){_0x5e3b13=_0x5e3b13||0x1f4;return function(_0x36ffe9){logger[_0x7fb5('0x26')](_0x36ffe9['stack']);if(_0x36ffe9[_0x7fb5('0x27')]){delete _0x36ffe9['name'];}_0x3062aa[_0x7fb5('0x1b')](_0x5e3b13)['send'](_0x36ffe9);};}exports[_0x7fb5('0x28')]=function(_0x26475f,_0x2f1234){var _0x2de6bc={},_0xcd0e81={},_0x463ad4={'count':0x0,'rows':[]};var _0x221770=_[_0x7fb5('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x49e9f3){return{'name':_0x49e9f3[_0x7fb5('0x2a')],'type':_0x49e9f3['type']['key']};});_0xcd0e81[_0x7fb5('0x2b')]=_['map'](_0x221770,'name');_0xcd0e81[_0x7fb5('0x2c')]=_[_0x7fb5('0x2d')](_0x26475f[_0x7fb5('0x2c')]);_0xcd0e81[_0x7fb5('0x2e')]=_['intersection'](_0xcd0e81[_0x7fb5('0x2b')],_0xcd0e81[_0x7fb5('0x2c')]);_0x2de6bc[_0x7fb5('0x2f')]=_[_0x7fb5('0x30')](_0xcd0e81['model'],qs[_0x7fb5('0x31')](_0x26475f[_0x7fb5('0x2c')][_0x7fb5('0x31')]));_0x2de6bc[_0x7fb5('0x2f')]=_0x2de6bc[_0x7fb5('0x2f')][_0x7fb5('0x32')]?_0x2de6bc[_0x7fb5('0x2f')]:_0xcd0e81[_0x7fb5('0x2b')];if(!_0x26475f['query'][_0x7fb5('0x33')](_0x7fb5('0x34'))){_0x2de6bc['limit']=qs[_0x7fb5('0x1f')](_0x26475f[_0x7fb5('0x2c')][_0x7fb5('0x1f')]);_0x2de6bc['offset']=qs[_0x7fb5('0x1d')](_0x26475f[_0x7fb5('0x2c')][_0x7fb5('0x1d')]);}_0x2de6bc['order']=qs[_0x7fb5('0x35')](_0x26475f[_0x7fb5('0x2c')]['sort']);_0x2de6bc[_0x7fb5('0x36')]=qs[_0x7fb5('0x2e')](_[_0x7fb5('0x37')](_0x26475f[_0x7fb5('0x2c')],_0xcd0e81[_0x7fb5('0x2e')]),_0x221770);if(_0x26475f['query'][_0x7fb5('0x38')]){_0x2de6bc[_0x7fb5('0x36')]=_[_0x7fb5('0x39')](_0x2de6bc[_0x7fb5('0x36')],{'$or':_[_0x7fb5('0x29')](_0x221770,function(_0x583f7d){if(_0x583f7d['type']!==_0x7fb5('0x3a')){var _0x1ca2e3={};_0x1ca2e3[_0x583f7d['name']]={'$like':'%'+_0x26475f[_0x7fb5('0x2c')][_0x7fb5('0x38')]+'%'};return _0x1ca2e3;}})});}_0x2de6bc=_[_0x7fb5('0x39')]({},_0x2de6bc,_0x26475f[_0x7fb5('0x3b')]);var _0x425ef8={'where':_0x2de6bc[_0x7fb5('0x36')]};return db['ChatTransferReport'][_0x7fb5('0x20')](_0x425ef8)['then'](function(_0x453f56){_0x463ad4[_0x7fb5('0x20')]=_0x453f56;if(_0x26475f[_0x7fb5('0x2c')][_0x7fb5('0x3c')]){_0x2de6bc[_0x7fb5('0x3d')]=[{'all':!![]}];}return db[_0x7fb5('0x3e')][_0x7fb5('0x3f')](_0x2de6bc);})['then'](function(_0x3a953e){_0x463ad4[_0x7fb5('0x40')]=_0x3a953e;return _0x463ad4;})[_0x7fb5('0x25')](respondWithFilteredResult(_0x2f1234,_0x2de6bc))[_0x7fb5('0x41')](handleError(_0x2f1234,null));};exports[_0x7fb5('0x42')]=function(_0x16e25f,_0x35b213){var _0x31fbf3={'raw':!![],'where':{'id':_0x16e25f['params']['id']}},_0xdde86a={};_0xdde86a[_0x7fb5('0x2b')]=_[_0x7fb5('0x2d')](db['ChatTransferReport'][_0x7fb5('0x43')]);_0xdde86a[_0x7fb5('0x2c')]=_[_0x7fb5('0x2d')](_0x16e25f[_0x7fb5('0x2c')]);_0xdde86a['filters']=_['intersection'](_0xdde86a[_0x7fb5('0x2b')],_0xdde86a[_0x7fb5('0x2c')]);_0x31fbf3['attributes']=_['intersection'](_0xdde86a[_0x7fb5('0x2b')],qs[_0x7fb5('0x31')](_0x16e25f[_0x7fb5('0x2c')][_0x7fb5('0x31')]));_0x31fbf3[_0x7fb5('0x2f')]=_0x31fbf3[_0x7fb5('0x2f')][_0x7fb5('0x32')]?_0x31fbf3[_0x7fb5('0x2f')]:_0xdde86a['model'];if(_0x16e25f[_0x7fb5('0x2c')][_0x7fb5('0x3c')]){_0x31fbf3[_0x7fb5('0x3d')]=[{'all':!![]}];}_0x31fbf3=_[_0x7fb5('0x39')]({},_0x31fbf3,_0x16e25f[_0x7fb5('0x3b')]);return db[_0x7fb5('0x3e')][_0x7fb5('0x44')](_0x31fbf3)[_0x7fb5('0x25')](handleEntityNotFound(_0x35b213,null))[_0x7fb5('0x25')](respondWithResult(_0x35b213,null))['catch'](handleError(_0x35b213,null));};exports[_0x7fb5('0x45')]=function(_0x5629f8,_0x3ae031){return db[_0x7fb5('0x3e')][_0x7fb5('0x45')](_0x5629f8[_0x7fb5('0x46')],{})['then'](respondWithResult(_0x3ae031,0xc9))['catch'](handleError(_0x3ae031,null));};exports[_0x7fb5('0x47')]=function(_0x2a2f47,_0x367dde){if(_0x2a2f47[_0x7fb5('0x46')]['id']){delete _0x2a2f47['body']['id'];}return db[_0x7fb5('0x3e')][_0x7fb5('0x44')]({'where':{'id':_0x2a2f47['params']['id']}})[_0x7fb5('0x25')](handleEntityNotFound(_0x367dde,null))[_0x7fb5('0x25')](saveUpdates(_0x2a2f47['body'],null))['then'](respondWithResult(_0x367dde,null))['catch'](handleError(_0x367dde,null));};exports['destroy']=function(_0x19f52c,_0xdc2775){return db[_0x7fb5('0x3e')][_0x7fb5('0x44')]({'where':{'id':_0x19f52c[_0x7fb5('0x48')]['id']}})[_0x7fb5('0x25')](handleEntityNotFound(_0xdc2775,null))[_0x7fb5('0x25')](removeEntity(_0xdc2775,null))[_0x7fb5('0x41')](handleError(_0xdc2775,null));};exports[_0x7fb5('0x49')]=function(_0x3e8b43,_0x334c57){return db['ChatTransferReport'][_0x7fb5('0x49')]()[_0x7fb5('0x25')](respondWithResult(_0x334c57,null))[_0x7fb5('0x41')](handleError(_0x334c57,null));};
\ No newline at end of file
+var _0xec11=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport'];(function(_0x5afbce,_0x33b3e2){var _0x5f2ccc=function(_0x5cc929){while(--_0x5cc929){_0x5afbce['push'](_0x5afbce['shift']());}};_0x5f2ccc(++_0x33b3e2);}(_0xec11,0x157));var _0x1ec1=function(_0x5d3808,_0x424178){_0x5d3808=_0x5d3808-0x0;var _0x13f6e4=_0xec11[_0x5d3808];return _0x13f6e4;};'use strict';var emlformat=require(_0x1ec1('0x0'));var rimraf=require(_0x1ec1('0x1'));var zipdir=require(_0x1ec1('0x2'));var jsonpatch=require(_0x1ec1('0x3'));var rp=require(_0x1ec1('0x4'));var moment=require(_0x1ec1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1ec1('0x6'));var util=require(_0x1ec1('0x7'));var path=require(_0x1ec1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ec1('0x9'));var fs=require('fs');var fs_extra=require(_0x1ec1('0xa'));var _=require(_0x1ec1('0xb'));var squel=require(_0x1ec1('0xc'));var crypto=require(_0x1ec1('0xd'));var jsforce=require(_0x1ec1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ec1('0xf'));var Papa=require(_0x1ec1('0x10'));var Redis=require(_0x1ec1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ec1('0x12'));var hardwareService=require(_0x1ec1('0x13'));var logger=require(_0x1ec1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1ec1('0x15'));var licenseUtil=require(_0x1ec1('0x16'));var db=require(_0x1ec1('0x17'))['db'];function respondWithStatusCode(_0x595fb6,_0x2f430b){_0x2f430b=_0x2f430b||0xcc;return function(_0x167159){if(_0x167159){return _0x595fb6['sendStatus'](_0x2f430b);}return _0x595fb6[_0x1ec1('0x18')](_0x2f430b)[_0x1ec1('0x19')]();};}function respondWithResult(_0x5f00a1,_0x3a8854){_0x3a8854=_0x3a8854||0xc8;return function(_0x52d7cc){if(_0x52d7cc){return _0x5f00a1[_0x1ec1('0x18')](_0x3a8854)[_0x1ec1('0x1a')](_0x52d7cc);}};}function respondWithFilteredResult(_0x4a8b31,_0x2f5460){return function(_0x57706a){if(_0x57706a){var _0x4a1380=typeof _0x2f5460[_0x1ec1('0x1b')]==='undefined'&&typeof _0x2f5460['limit']===_0x1ec1('0x1c');var _0x3d94e5=_0x57706a[_0x1ec1('0x1d')];var _0x13134b=_0x4a1380?0x0:_0x2f5460[_0x1ec1('0x1b')];var _0x315d8d=_0x4a1380?_0x57706a['count']:_0x2f5460[_0x1ec1('0x1b')]+_0x2f5460[_0x1ec1('0x1e')];var _0x24ebb0;if(_0x315d8d>=_0x3d94e5){_0x315d8d=_0x3d94e5;_0x24ebb0=0xc8;}else{_0x24ebb0=0xce;}_0x4a8b31[_0x1ec1('0x18')](_0x24ebb0);return _0x4a8b31[_0x1ec1('0x1f')](_0x1ec1('0x20'),_0x13134b+'-'+_0x315d8d+'/'+_0x3d94e5)[_0x1ec1('0x1a')](_0x57706a);}return null;};}function patchUpdates(_0x415b2a){return function(_0x30c10e){try{jsonpatch[_0x1ec1('0x21')](_0x30c10e,_0x415b2a,!![]);}catch(_0x547951){return BPromise[_0x1ec1('0x22')](_0x547951);}return _0x30c10e[_0x1ec1('0x23')]();};}function saveUpdates(_0x2fda34,_0x1ab561){return function(_0xcf41f1){if(_0xcf41f1){return _0xcf41f1[_0x1ec1('0x24')](_0x2fda34)['then'](function(_0x297ce5){return _0x297ce5;});}return null;};}function removeEntity(_0x287c45,_0x24a197){return function(_0x1e2b97){if(_0x1e2b97){return _0x1e2b97[_0x1ec1('0x25')]()[_0x1ec1('0x26')](function(){_0x287c45[_0x1ec1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b14af,_0x20ead9){return function(_0x4fead1){if(!_0x4fead1){_0x4b14af[_0x1ec1('0x27')](0x194);}return _0x4fead1;};}function handleError(_0x59f0c5,_0x16cc86){_0x16cc86=_0x16cc86||0x1f4;return function(_0x50fb1f){logger[_0x1ec1('0x28')](_0x50fb1f[_0x1ec1('0x29')]);if(_0x50fb1f[_0x1ec1('0x2a')]){delete _0x50fb1f['name'];}_0x59f0c5[_0x1ec1('0x18')](_0x16cc86)[_0x1ec1('0x2b')](_0x50fb1f);};}exports[_0x1ec1('0x2c')]=function(_0x447eae,_0xc67f93){var _0xa940b5={},_0x2441dd={},_0x52bc72={'count':0x0,'rows':[]};var _0x30a432=_[_0x1ec1('0x2d')](db[_0x1ec1('0x2e')][_0x1ec1('0x2f')],function(_0x1ced7f){return{'name':_0x1ced7f[_0x1ec1('0x30')],'type':_0x1ced7f[_0x1ec1('0x31')][_0x1ec1('0x32')]};});_0x2441dd['model']=_['map'](_0x30a432,_0x1ec1('0x2a'));_0x2441dd[_0x1ec1('0x33')]=_[_0x1ec1('0x34')](_0x447eae['query']);_0x2441dd[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],_0x2441dd['query']);_0xa940b5['attributes']=_[_0x1ec1('0x36')](_0x2441dd[_0x1ec1('0x37')],qs[_0x1ec1('0x38')](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0xa940b5[_0x1ec1('0x39')]=_0xa940b5[_0x1ec1('0x39')][_0x1ec1('0x3a')]?_0xa940b5[_0x1ec1('0x39')]:_0x2441dd['model'];if(!_0x447eae['query'][_0x1ec1('0x3b')]('nolimit')){_0xa940b5[_0x1ec1('0x1e')]=qs[_0x1ec1('0x1e')](_0x447eae['query']['limit']);_0xa940b5[_0x1ec1('0x1b')]=qs['offset'](_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x1b')]);}_0xa940b5[_0x1ec1('0x3c')]=qs[_0x1ec1('0x3d')](_0x447eae[_0x1ec1('0x33')]['sort']);_0xa940b5['where']=qs[_0x1ec1('0x35')](_[_0x1ec1('0x3e')](_0x447eae[_0x1ec1('0x33')],_0x2441dd['filters']),_0x30a432);if(_0x447eae['query']['filter']){_0xa940b5[_0x1ec1('0x3f')]=_[_0x1ec1('0x40')](_0xa940b5[_0x1ec1('0x3f')],{'$or':_[_0x1ec1('0x2d')](_0x30a432,function(_0x380fe6){if(_0x380fe6[_0x1ec1('0x31')]!==_0x1ec1('0x41')){var _0x405356={};_0x405356[_0x380fe6['name']]={'$like':'%'+_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x42')]+'%'};return _0x405356;}})});}_0xa940b5=_[_0x1ec1('0x40')]({},_0xa940b5,_0x447eae[_0x1ec1('0x43')]);var _0x5764d8={'where':_0xa940b5[_0x1ec1('0x3f')]};return db[_0x1ec1('0x2e')][_0x1ec1('0x1d')](_0x5764d8)[_0x1ec1('0x26')](function(_0x6d72a5){_0x52bc72[_0x1ec1('0x1d')]=_0x6d72a5;if(_0x447eae[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0xa940b5[_0x1ec1('0x45')]=[{'all':!![]}];}return db[_0x1ec1('0x2e')][_0x1ec1('0x46')](_0xa940b5);})[_0x1ec1('0x26')](function(_0x39d19c){_0x52bc72['rows']=_0x39d19c;return _0x52bc72;})[_0x1ec1('0x26')](respondWithFilteredResult(_0xc67f93,_0xa940b5))[_0x1ec1('0x47')](handleError(_0xc67f93,null));};exports[_0x1ec1('0x48')]=function(_0x118ea2,_0x5192bf){var _0x2940b5={'raw':!![],'where':{'id':_0x118ea2[_0x1ec1('0x49')]['id']}},_0x3974df={};_0x3974df[_0x1ec1('0x37')]=_[_0x1ec1('0x34')](db[_0x1ec1('0x2e')]['rawAttributes']);_0x3974df[_0x1ec1('0x33')]=_['keys'](_0x118ea2[_0x1ec1('0x33')]);_0x3974df[_0x1ec1('0x35')]=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],_0x3974df[_0x1ec1('0x33')]);_0x2940b5['attributes']=_[_0x1ec1('0x36')](_0x3974df[_0x1ec1('0x37')],qs['fields'](_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x38')]));_0x2940b5[_0x1ec1('0x39')]=_0x2940b5['attributes']['length']?_0x2940b5[_0x1ec1('0x39')]:_0x3974df[_0x1ec1('0x37')];if(_0x118ea2[_0x1ec1('0x33')][_0x1ec1('0x44')]){_0x2940b5[_0x1ec1('0x45')]=[{'all':!![]}];}_0x2940b5=_[_0x1ec1('0x40')]({},_0x2940b5,_0x118ea2[_0x1ec1('0x43')]);return db[_0x1ec1('0x2e')]['find'](_0x2940b5)['then'](handleEntityNotFound(_0x5192bf,null))[_0x1ec1('0x26')](respondWithResult(_0x5192bf,null))[_0x1ec1('0x47')](handleError(_0x5192bf,null));};exports[_0x1ec1('0x4a')]=function(_0x384017,_0x696b3a){return db['ChatTransferReport']['create'](_0x384017[_0x1ec1('0x4b')],{})[_0x1ec1('0x26')](respondWithResult(_0x696b3a,0xc9))[_0x1ec1('0x47')](handleError(_0x696b3a,null));};exports[_0x1ec1('0x24')]=function(_0x5481a6,_0x2e6c66){if(_0x5481a6['body']['id']){delete _0x5481a6[_0x1ec1('0x4b')]['id'];}return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5481a6['params']['id']}})['then'](handleEntityNotFound(_0x2e6c66,null))[_0x1ec1('0x26')](saveUpdates(_0x5481a6[_0x1ec1('0x4b')],null))['then'](respondWithResult(_0x2e6c66,null))[_0x1ec1('0x47')](handleError(_0x2e6c66,null));};exports[_0x1ec1('0x25')]=function(_0x5360dc,_0x1dedb2){return db[_0x1ec1('0x2e')][_0x1ec1('0x4c')]({'where':{'id':_0x5360dc['params']['id']}})[_0x1ec1('0x26')](handleEntityNotFound(_0x1dedb2,null))[_0x1ec1('0x26')](removeEntity(_0x1dedb2,null))['catch'](handleError(_0x1dedb2,null));};exports[_0x1ec1('0x4d')]=function(_0x26657d,_0x25f929){return db[_0x1ec1('0x2e')][_0x1ec1('0x4d')]()['then'](respondWithResult(_0x25f929,null))[_0x1ec1('0x47')](handleError(_0x25f929,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 899709c..e76e832 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 _0x97ca=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97ca,0x1c3));var _0xa97c=function(_0x4b0a5a,_0x49f7ab){_0x4b0a5a=_0x4b0a5a-0x0;var _0x12d259=_0x97ca[_0x4b0a5a];return _0x12d259;};'use strict';var _=require(_0xa97c('0x0'));var util=require(_0xa97c('0x1'));var logger=require(_0xa97c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa97c('0x3'));var fs=require('fs');var path=require(_0xa97c('0x4'));var rimraf=require(_0xa97c('0x5'));var config=require(_0xa97c('0x6'));var attributes=require(_0xa97c('0x7'));module[_0xa97c('0x8')]=function(_0x17a9c8,_0x239127){return _0x17a9c8[_0xa97c('0x9')]('ChatTransferReport',attributes,{'tableName':_0xa97c('0xa'),'paranoid':![],'indexes':[{'name':_0xa97c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xddff=['exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x293500,_0x5bc106){var _0x324f05=function(_0x53ed67){while(--_0x53ed67){_0x293500['push'](_0x293500['shift']());}};_0x324f05(++_0x5bc106);}(_0xddff,0x124));var _0xfddf=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xddff[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0xfddf('0x0'));var util=require(_0xfddf('0x1'));var logger=require(_0xfddf('0x2'))('api');var moment=require(_0xfddf('0x3'));var BPromise=require(_0xfddf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfddf('0x5'));var rimraf=require(_0xfddf('0x6'));var config=require(_0xfddf('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xfddf('0x8')]=function(_0x3f9841,_0x52dc41){return _0x3f9841[_0xfddf('0x9')](_0xfddf('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xfddf('0xb'),'fields':[_0xfddf('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 cbcbb18..9de33f5 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 _0xeaa4=['stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug'];(function(_0x39520d,_0x154825){var _0xdd35ff=function(_0xbfa43e){while(--_0xbfa43e){_0x39520d['push'](_0x39520d['shift']());}};_0xdd35ff(++_0x154825);}(_0xeaa4,0x104));var _0x4eaa=function(_0x34159c,_0x1f3bb3){_0x34159c=_0x34159c-0x0;var _0x28f809=_0xeaa4[_0x34159c];return _0x28f809;};'use strict';var _=require(_0x4eaa('0x0'));var util=require(_0x4eaa('0x1'));var moment=require(_0x4eaa('0x2'));var BPromise=require(_0x4eaa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4eaa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eaa('0x5'))(_0x4eaa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4eaa('0x7')][_0x4eaa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b55d,_0x50fa95,_0x21dec0){return new BPromise(function(_0x3e60e9,_0x53cc38){return client[_0x4eaa('0x9')](_0x29b55d,_0x21dec0)[_0x4eaa('0xa')](function(_0x142a79){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x50fa95,_0x4eaa('0xb'));logger[_0x4eaa('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x50fa95,_0x4eaa('0xb'),JSON[_0x4eaa('0xd')](_0x142a79));if(_0x142a79[_0x4eaa('0xe')]){if(_0x142a79[_0x4eaa('0xe')][_0x4eaa('0xf')]===0x1f4){logger[_0x4eaa('0xe')](_0x4eaa('0x10'),_0x50fa95,_0x142a79[_0x4eaa('0xe')][_0x4eaa('0x11')]);return _0x53cc38(_0x142a79[_0x4eaa('0xe')][_0x4eaa('0x11')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x50fa95,_0x142a79[_0x4eaa('0xe')][_0x4eaa('0x11')]);return _0x3e60e9(_0x142a79[_0x4eaa('0xe')]['message']);}else{logger[_0x4eaa('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x50fa95,_0x4eaa('0xb'));_0x3e60e9(_0x142a79[_0x4eaa('0x13')][_0x4eaa('0x11')]);}})[_0x4eaa('0x14')](function(_0x1cbf51){logger[_0x4eaa('0xe')](_0x4eaa('0x10'),_0x50fa95,_0x1cbf51);_0x53cc38(_0x1cbf51);});});}
\ No newline at end of file
+var _0xb101=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis'];(function(_0xfac4f8,_0x16f091){var _0x4c2a2e=function(_0x44bb18){while(--_0x44bb18){_0xfac4f8['push'](_0xfac4f8['shift']());}};_0x4c2a2e(++_0x16f091);}(_0xb101,0x188));var _0x1b10=function(_0x195054,_0x38c4ba){_0x195054=_0x195054-0x0;var _0x65352f=_0xb101[_0x195054];return _0x65352f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b10('0x0'));var BPromise=require(_0x1b10('0x1'));var rs=require(_0x1b10('0x2'));var fs=require('fs');var Redis=require(_0x1b10('0x3'));var db=require(_0x1b10('0x4'))['db'];var utils=require(_0x1b10('0x5'));var logger=require('../../config/logger')(_0x1b10('0x6'));var config=require(_0x1b10('0x7'));var jayson=require(_0x1b10('0x8'));var client=jayson['client'][_0x1b10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b560,_0xfb586b,_0x48f6ef){return new BPromise(function(_0x2c0131,_0x4df364){return client[_0x1b10('0xa')](_0x59b560,_0x48f6ef)[_0x1b10('0xb')](function(_0x2b6336){logger[_0x1b10('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xfb586b,'request\x20sent',JSON[_0x1b10('0xd')](_0x2b6336));if(_0x2b6336[_0x1b10('0xe')]){if(_0x2b6336[_0x1b10('0xe')]['code']===0x1f4){logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x4df364(_0x2b6336['error']['message']);}logger[_0x1b10('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xfb586b,_0x2b6336[_0x1b10('0xe')][_0x1b10('0xf')]);return _0x2c0131(_0x2b6336['error'][_0x1b10('0xf')]);}else{logger[_0x1b10('0xc')](_0x1b10('0x10'),_0xfb586b,'request\x20sent');_0x2c0131(_0x2b6336[_0x1b10('0x11')][_0x1b10('0xf')]);}})['catch'](function(_0x6dcbfa){logger['error'](_0x1b10('0x10'),_0xfb586b,_0x6dcbfa);_0x4df364(_0x6dcbfa);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 8bca68b..26009cb 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 _0x374b=['/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x374b,0x84));var _0xb374=function(_0x417c5b,_0x98b8ba){_0x417c5b=_0x417c5b-0x0;var _0x54e241=_0x374b[_0x417c5b];return _0x54e241;};'use strict';var multer=require(_0xb374('0x0'));var util=require(_0xb374('0x1'));var path=require(_0xb374('0x2'));var timeout=require(_0xb374('0x3'));var express=require(_0xb374('0x4'));var router=express[_0xb374('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb374('0x6'));var config=require('../../config/environment');var controller=require(_0xb374('0x7'));router[_0xb374('0x8')]('/',auth[_0xb374('0x9')](),controller['index']);router[_0xb374('0x8')](_0xb374('0xa'),auth[_0xb374('0x9')](),controller[_0xb374('0xb')]);router[_0xb374('0x8')](_0xb374('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb374('0xd')]('/',auth['isAuthenticated'](),controller[_0xb374('0xe')]);router[_0xb374('0xf')](_0xb374('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb374('0x10')](_0xb374('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb374('0x11')]=router;
\ No newline at end of file
+var _0xaaa1=['index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x41dec5,_0x32ac03){var _0x249717=function(_0x500f98){while(--_0x500f98){_0x41dec5['push'](_0x41dec5['shift']());}};_0x249717(++_0x32ac03);}(_0xaaa1,0x13f));var _0x1aaa=function(_0x317c5c,_0x5d2952){_0x317c5c=_0x317c5c-0x0;var _0x504506=_0xaaa1[_0x317c5c];return _0x504506;};'use strict';var multer=require(_0x1aaa('0x0'));var util=require(_0x1aaa('0x1'));var path=require(_0x1aaa('0x2'));var timeout=require('connect-timeout');var express=require(_0x1aaa('0x3'));var router=express[_0x1aaa('0x4')]();var fs_extra=require(_0x1aaa('0x5'));var auth=require(_0x1aaa('0x6'));var interaction=require(_0x1aaa('0x7'));var config=require(_0x1aaa('0x8'));var controller=require(_0x1aaa('0x9'));router[_0x1aaa('0xa')]('/',auth['isAuthenticated'](),controller[_0x1aaa('0xb')]);router['get'](_0x1aaa('0xc'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xe')]);router[_0x1aaa('0xa')]('/:id',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0xf')]);router[_0x1aaa('0x10')]('/',auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x11')]);router[_0x1aaa('0x12')](_0x1aaa('0x13'),auth[_0x1aaa('0xd')](),controller[_0x1aaa('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1aaa('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8a53a65..904861a 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 _0xb2e2=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','Feedback','star','stringify','input','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x30f3df,_0x214d7c){var _0x1c3aa2=function(_0x1fbbfc){while(--_0x1fbbfc){_0x30f3df['push'](_0x30f3df['shift']());}};_0x1c3aa2(++_0x214d7c);}(_0xb2e2,0x1a2));var _0x2b2e=function(_0x426e21,_0x5e7983){_0x426e21=_0x426e21-0x0;var _0x319df9=_0xb2e2[_0x426e21];return _0x319df9;};'use strict';var Sequelize=require(_0x2b2e('0x0'));var rs=require(_0x2b2e('0x1'));module[_0x2b2e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2b2e('0x3')],'allowNull':![],'unique':_0x2b2e('0x4')},'description':{'type':Sequelize[_0x2b2e('0x3')]},'mapKey':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x5')},'key':{'type':Sequelize[_0x2b2e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2b2e('0x3')],'allowNull':![],'defaultValue':_0x2b2e('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2b2e('0x3')],'allowNull':![],'defaultValue':_0x2b2e('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2b2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2b2e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2b2e('0x3')]},'animation':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2b2e('0x9')](_0x2b2e('0xa'),'squared'),'defaultValue':_0x2b2e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x2b2e('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2b2e('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2b2e('0xd')},'header_offline':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0xe')},'download_transcript':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2b2e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2b2e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x2b2e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x12')},'closingMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0xd')},'skipMessageButton':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x13')},'conditionAgreement':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x14')},'ratingType':{'type':Sequelize[_0x2b2e('0x9')](_0x2b2e('0x15'),'thumb'),'defaultValue':_0x2b2e('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x2b2e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2b2e('0xf')],'defaultValue':function(){return JSON[_0x2b2e('0x16')]({'items':[{'type':_0x2b2e('0x17'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x2b2e('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x2b2e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2b2e('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2b2e('0x19')]('onlineForm')?JSON[_0x2b2e('0x1a')](this[_0x2b2e('0x19')](_0x2b2e('0x1b'))):{};},'set':function(_0x36c0c9){return this[_0x2b2e('0x1c')](_0x2b2e('0x1b'),JSON[_0x2b2e('0x16')](_0x36c0c9));}},'offlineForm':{'type':Sequelize[_0x2b2e('0xf')],'defaultValue':function(){return JSON[_0x2b2e('0x16')]({'items':[{'type':_0x2b2e('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2b2e('0x5'),'type':_0x2b2e('0x5')},'variable':null},{'type':_0x2b2e('0x1d'),'config':{'placeholder':_0x2b2e('0x1e')},'props':{'title':_0x2b2e('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x2b2e('0x1f'))?JSON[_0x2b2e('0x1a')](this[_0x2b2e('0x19')](_0x2b2e('0x1f'))):{};},'set':function(_0x44c5e7){return this[_0x2b2e('0x1c')](_0x2b2e('0x1f'),JSON[_0x2b2e('0x16')](_0x44c5e7));}},'token':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':function(){return rs[_0x2b2e('0x20')]();}},'autoclose':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2b2e('0x3')]},'forwardOffline':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2b2e('0x3')]},'waitingTitle':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x21')},'offlineMessageSubject':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x22')},'offlineMessageBody':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x24')},'skipUnmanaged':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x13')},'sendUnmanaged':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2b2e('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2b2e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2b2e('0xf')],'defaultValue':function(){return _0x2b2e('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b2e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':_0x2b2e('0x27')},'verticalAlignment':{'type':Sequelize[_0x2b2e('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2b2e('0x3')]},'customerAvatar':{'type':Sequelize[_0x2b2e('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2b2e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b2e('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b2e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b2e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x2b2e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2b2e('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x377cd5){if(!_0x377cd5)this[_0x2b2e('0x1c')](_0x2b2e('0x2a'),null);this['setDataValue'](_0x2b2e('0x2b'),_0x377cd5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2b2e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b2e('0x2c')},'vidaooNote':{'type':Sequelize[_0x2b2e('0x3')],'defaultValue':function(){return _0x2b2e('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x2b2e('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2b2e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2b2e('0xf')]}};
\ No newline at end of file
+var _0x1b2c=['sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Skip','Feedback','star','thumb','TEXT','stringify','name','input','onlineForm','parse','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x19e00b,_0x16400c){var _0x533ce0=function(_0x2e2b22){while(--_0x2e2b22){_0x19e00b['push'](_0x19e00b['shift']());}};_0x533ce0(++_0x16400c);}(_0x1b2c,0x190));var _0xc1b2=function(_0x19085d,_0x5d8bc0){_0x19085d=_0x19085d-0x0;var _0xdb3f69=_0x1b2c[_0x19085d];return _0xdb3f69;};'use strict';var Sequelize=require(_0xc1b2('0x0'));var rs=require(_0xc1b2('0x1'));module[_0xc1b2('0x2')]={'name':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'unique':_0xc1b2('0x4')},'description':{'type':Sequelize[_0xc1b2('0x3')]},'mapKey':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x5')},'mapKeyOffline':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x6')},'customerAlias':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc1b2('0x3')]},'animation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0xc'),_0xc1b2('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0xe')},'start_chat_button':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x11')},'download_transcript':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x15')},'placeholderMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'skipMessageButton':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'conditionAgreement':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x17')},'ratingType':{'type':Sequelize[_0xc1b2('0xb')](_0xc1b2('0x18'),_0xc1b2('0x19')),'defaultValue':_0xc1b2('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xc1b2('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':_0xc1b2('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc1b2('0x1e'))?JSON[_0xc1b2('0x1f')](this[_0xc1b2('0x20')](_0xc1b2('0x1e'))):{};},'set':function(_0x210781){return this[_0xc1b2('0x21')]('onlineForm',JSON[_0xc1b2('0x1b')](_0x210781));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc1b2('0x1b')]({'items':[{'type':_0xc1b2('0x1d'),'props':{'title':_0xc1b2('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc1b2('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc1b2('0x22'),'helpText':_0xc1b2('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc1b2('0x20')](_0xc1b2('0x24'))?JSON[_0xc1b2('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x295f68){return this[_0xc1b2('0x21')](_0xc1b2('0x24'),JSON['stringify'](_0x295f68));}},'token':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return rs[_0xc1b2('0x25')]();}},'autoclose':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc1b2('0x3')]},'forwardOffline':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc1b2('0x3')]},'waitingTitle':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x26')},'waitingMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x29')},'skipUnmanaged':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc1b2('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc1b2('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':function(){return _0xc1b2('0x2a');}},'notificationSound':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':_0xc1b2('0x2c')},'defaultTitle':{'type':Sequelize[_0xc1b2('0x3')]},'customerAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc1b2('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc1b2('0x3')],'allowNull':![],'defaultValue':_0xc1b2('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc1b2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xc1b2('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x198ab9){if(!_0x198ab9)this[_0xc1b2('0x21')](_0xc1b2('0x2e'),null);this[_0xc1b2('0x21')](_0xc1b2('0x2f'),_0x198ab9);}},'vidaooEscalation':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc1b2('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc1b2('0x30')},'vidaooNote':{'type':Sequelize[_0xc1b2('0x3')],'defaultValue':function(){return _0xc1b2('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc1b2('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc1b2('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc1b2('0x1a')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4e9dd8d..be38569 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 _0x5725=['no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','create','body','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize'];(function(_0x9c32df,_0x533254){var _0x4edcc2=function(_0x53fc0a){while(--_0x53fc0a){_0x9c32df['push'](_0x9c32df['shift']());}};_0x4edcc2(++_0x533254);}(_0x5725,0x1d9));var _0x5572=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5725[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x5572('0x0'));var rimraf=require(_0x5572('0x1'));var zipdir=require(_0x5572('0x2'));var jsonpatch=require(_0x5572('0x3'));var rp=require('request-promise');var moment=require(_0x5572('0x4'));var BPromise=require(_0x5572('0x5'));var Mustache=require('mustache');var util=require(_0x5572('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5572('0x7'));var ejs=require(_0x5572('0x8'));var fs=require('fs');var fs_extra=require(_0x5572('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5572('0xa'));var deskjs=require(_0x5572('0xb'));var toCsv=require(_0x5572('0x7'));var querystring=require(_0x5572('0xc'));var Papa=require(_0x5572('0xd'));var Redis=require(_0x5572('0xe'));var authService=require(_0x5572('0xf'));var qs=require(_0x5572('0x10'));var as=require(_0x5572('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5572('0x12'))(_0x5572('0x13'));var utils=require(_0x5572('0x14'));var config=require(_0x5572('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5572('0x16')]=_[_0x5572('0x17')](config[_0x5572('0x16')],{'host':_0x5572('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5572('0x16')]));require(_0x5572('0x19'))['register'](socket);var jayson=require(_0x5572('0x1a'));var client=jayson[_0x5572('0x1b')][_0x5572('0x1c')]({'port':0x232c});var client9002=jayson[_0x5572('0x1b')][_0x5572('0x1c')]({'port':0x232a});var client9003=jayson[_0x5572('0x1b')][_0x5572('0x1c')]({'port':0x232b});var client9001=jayson[_0x5572('0x1b')]['http']({'port':0x2329});function respondWithRpcPromise(_0x153fc0,_0x465835,_0x1756bd,_0x417245){return new BPromise(function(_0x5c5686,_0x21e3c2){var _0x4cebbb=_0x417245||client;return _0x4cebbb['request'](_0x153fc0,_0x1756bd)['then'](function(_0x5c7465){logger[_0x5572('0x1d')](_0x5572('0x1e'),_0x465835,_0x5572('0x1f'));logger[_0x5572('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x465835,_0x5572('0x1f'),JSON[_0x5572('0x21')](_0x5c7465));if(_0x5c7465['error']){if(_0x5c7465['error'][_0x5572('0x22')]===0x1f4){logger[_0x5572('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x465835,_0x5c7465[_0x5572('0x23')]['message']);return _0x21e3c2(_0x5c7465[_0x5572('0x23')][_0x5572('0x24')]);}logger['error'](_0x5572('0x1e'),_0x465835,_0x5c7465['error'][_0x5572('0x24')]);return _0x5c5686(_0x5c7465[_0x5572('0x23')][_0x5572('0x24')]);}else{logger[_0x5572('0x1d')](_0x5572('0x1e'),_0x465835,_0x5572('0x1f'));_0x5c5686(_0x5c7465[_0x5572('0x25')][_0x5572('0x24')]);}})[_0x5572('0x26')](function(_0x492f76){logger[_0x5572('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x465835,_0x492f76);_0x21e3c2(_0x492f76);});});}function respondWithStatusCode(_0x205dea,_0x459a47){_0x459a47=_0x459a47||0xcc;return function(_0xfd264e){if(_0xfd264e){return _0x205dea['sendStatus'](_0x459a47);}return _0x205dea[_0x5572('0x27')](_0x459a47)[_0x5572('0x28')]();};}function respondWithResult(_0x1ad7ae,_0x5ded01){_0x5ded01=_0x5ded01||0xc8;return function(_0x441f8){if(_0x441f8){return _0x1ad7ae[_0x5572('0x27')](_0x5ded01)[_0x5572('0x29')](_0x441f8);}};}function respondWithFilteredResult(_0x1464c0,_0xdf0aa7){return function(_0x3e1e3f){if(_0x3e1e3f){var _0x3a57b3=typeof _0xdf0aa7[_0x5572('0x2a')]===_0x5572('0x2b')&&typeof _0xdf0aa7[_0x5572('0x2c')]===_0x5572('0x2b');var _0x255a65=_0x3e1e3f[_0x5572('0x2d')];var _0x21da23=_0x3a57b3?0x0:_0xdf0aa7[_0x5572('0x2a')];var _0x3fc4ce=_0x3a57b3?_0x3e1e3f[_0x5572('0x2d')]:_0xdf0aa7[_0x5572('0x2a')]+_0xdf0aa7[_0x5572('0x2c')];var _0x268d90;if(_0x3fc4ce>=_0x255a65){_0x3fc4ce=_0x255a65;_0x268d90=0xc8;}else{_0x268d90=0xce;}_0x1464c0['status'](_0x268d90);return _0x1464c0[_0x5572('0x2e')](_0x5572('0x2f'),_0x21da23+'-'+_0x3fc4ce+'/'+_0x255a65)[_0x5572('0x29')](_0x3e1e3f);}return null;};}function patchUpdates(_0xe4f55d){return function(_0x196ac1){try{jsonpatch[_0x5572('0x30')](_0x196ac1,_0xe4f55d,!![]);}catch(_0x259a8f){return BPromise['reject'](_0x259a8f);}return _0x196ac1['save']();};}function saveUpdates(_0x2d8a28,_0x5620c8){return function(_0x2df5aa){if(_0x2df5aa){return _0x2df5aa[_0x5572('0x31')](_0x2d8a28)[_0x5572('0x32')](function(_0x24cbbb){return _0x24cbbb;});}return null;};}function removeEntity(_0x56794b,_0x1af010){return function(_0x392856){if(_0x392856){return _0x392856[_0x5572('0x33')]()[_0x5572('0x32')](function(){var _0x553ece=_0x392856[_0x5572('0x34')]({'plain':!![]});var _0x577a4e=_0x5572('0x35');return db[_0x5572('0x36')][_0x5572('0x33')]({'where':{'type':_0x577a4e,'resourceId':_0x553ece['id']}})[_0x5572('0x32')](function(){return _0x392856;});})[_0x5572('0x32')](function(){_0x56794b[_0x5572('0x27')](0xcc)[_0x5572('0x28')]();});}};}function handleEntityNotFound(_0x4c3836,_0x292729){return function(_0x51398c){if(!_0x51398c){_0x4c3836[_0x5572('0x37')](0x194);}return _0x51398c;};}function handleError(_0x4930e9,_0x1d02d7){_0x1d02d7=_0x1d02d7||0x1f4;return function(_0x4486fd){logger[_0x5572('0x23')](_0x4486fd[_0x5572('0x38')]);if(_0x4486fd[_0x5572('0x39')]){delete _0x4486fd[_0x5572('0x39')];}_0x4930e9[_0x5572('0x27')](_0x1d02d7)[_0x5572('0x3a')](_0x4486fd);};}exports[_0x5572('0x3b')]=function(_0x3fb75c,_0x39cd8f){var _0x58670d={'include':[{'model':db[_0x5572('0x3c')],'as':_0x5572('0x3d')}]},_0x5d35b8={},_0x4e5c16={'count':0x0,'rows':[]};var _0x4ebb49=_[_0x5572('0x3e')](db[_0x5572('0x3f')][_0x5572('0x40')],function(_0x4cb732){return{'name':_0x4cb732[_0x5572('0x41')],'type':_0x4cb732['type'][_0x5572('0x42')]};});_0x5d35b8[_0x5572('0x43')]=_[_0x5572('0x3e')](_0x4ebb49,_0x5572('0x39'));_0x5d35b8[_0x5572('0x44')]=_['keys'](_0x3fb75c[_0x5572('0x44')]);_0x5d35b8[_0x5572('0x45')]=_[_0x5572('0x46')](_0x5d35b8['model'],_0x5d35b8[_0x5572('0x44')]);_0x58670d['attributes']=_[_0x5572('0x46')](_0x5d35b8[_0x5572('0x43')],qs[_0x5572('0x47')](_0x3fb75c[_0x5572('0x44')]['fields']));_0x58670d[_0x5572('0x48')]=_0x58670d[_0x5572('0x48')][_0x5572('0x49')]?_0x58670d[_0x5572('0x48')]:_0x5d35b8['model'];if(!_0x3fb75c[_0x5572('0x44')][_0x5572('0x4a')](_0x5572('0x4b'))){_0x58670d[_0x5572('0x2c')]=qs[_0x5572('0x2c')](_0x3fb75c[_0x5572('0x44')]['limit']);_0x58670d[_0x5572('0x2a')]=qs[_0x5572('0x2a')](_0x3fb75c[_0x5572('0x44')][_0x5572('0x2a')]);}_0x58670d[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x3fb75c[_0x5572('0x44')][_0x5572('0x4d')]);_0x58670d[_0x5572('0x4e')]=qs[_0x5572('0x45')](_['pick'](_0x3fb75c[_0x5572('0x44')],_0x5d35b8[_0x5572('0x45')]),_0x4ebb49);if(_0x3fb75c[_0x5572('0x44')][_0x5572('0x4f')]){_0x58670d[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x58670d[_0x5572('0x4e')],{'$or':_[_0x5572('0x3e')](_0x4ebb49,function(_0x16e80a){if(_0x16e80a[_0x5572('0x51')]!==_0x5572('0x52')){var _0x75f4a5={};_0x75f4a5[_0x16e80a['name']]={'$like':'%'+_0x3fb75c[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x75f4a5;}})});}_0x58670d=_[_0x5572('0x50')]({},_0x58670d,_0x3fb75c[_0x5572('0x53')]);var _0x3e938e={'where':_0x58670d[_0x5572('0x4e')]};return db[_0x5572('0x3f')][_0x5572('0x2d')](_0x3e938e)[_0x5572('0x32')](function(_0x487468){_0x4e5c16['count']=_0x487468;if(_0x3fb75c['query'][_0x5572('0x54')]){_0x58670d[_0x5572('0x55')]=[{'all':!![]}];}return db[_0x5572('0x3f')][_0x5572('0x56')](_0x58670d);})[_0x5572('0x32')](function(_0x234f2b){_0x4e5c16[_0x5572('0x57')]=_0x234f2b;return _0x4e5c16;})[_0x5572('0x32')](respondWithFilteredResult(_0x39cd8f,_0x58670d))[_0x5572('0x26')](handleError(_0x39cd8f,null));};exports[_0x5572('0x58')]=function(_0x4fe60a,_0x41fec1){var _0x595319={'raw':![],'where':{'id':_0x4fe60a['params']['id']},'include':[{'model':db[_0x5572('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4df5db={};_0x4df5db[_0x5572('0x43')]=_[_0x5572('0x59')](db[_0x5572('0x3f')][_0x5572('0x40')]);_0x4df5db['query']=_[_0x5572('0x59')](_0x4fe60a['query']);_0x4df5db[_0x5572('0x45')]=_[_0x5572('0x46')](_0x4df5db[_0x5572('0x43')],_0x4df5db['query']);_0x595319[_0x5572('0x48')]=_[_0x5572('0x46')](_0x4df5db[_0x5572('0x43')],qs['fields'](_0x4fe60a['query'][_0x5572('0x47')]));_0x595319['attributes']=_0x595319[_0x5572('0x48')][_0x5572('0x49')]?_0x595319[_0x5572('0x48')]:_0x4df5db[_0x5572('0x43')];if(_0x4fe60a[_0x5572('0x44')][_0x5572('0x54')]){_0x595319['include']=[{'all':!![]}];}_0x595319=_[_0x5572('0x50')]({},_0x595319,_0x4fe60a[_0x5572('0x53')]);return db[_0x5572('0x3f')]['find'](_0x595319)['then'](handleEntityNotFound(_0x41fec1,null))['then'](respondWithResult(_0x41fec1,null))['catch'](handleError(_0x41fec1,null));};exports[_0x5572('0x5a')]=function(_0x2e796c,_0x809c66){return db[_0x5572('0x3f')]['create'](_0x2e796c[_0x5572('0x5b')],{})[_0x5572('0x32')](function(_0x5e3372){var _0x5c29be=_0x2e796c[_0x5572('0x5c')][_0x5572('0x34')]({'plain':!![]});if(!_0x5c29be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c29be['role']===_0x5572('0x5c')){var _0x2dce01=_0x5e3372[_0x5572('0x34')]({'plain':!![]});var _0x37cb74='ChatWebsites';return db[_0x5572('0x5d')][_0x5572('0x5e')]({'where':{'name':_0x37cb74,'userProfileId':_0x5c29be['userProfileId']},'raw':!![]})[_0x5572('0x32')](function(_0x285c70){if(_0x285c70&&_0x285c70['autoAssociation']===0x0){return db[_0x5572('0x36')][_0x5572('0x5a')]({'name':_0x2dce01['name'],'resourceId':_0x2dce01['id'],'type':_0x285c70[_0x5572('0x39')],'sectionId':_0x285c70['id']},{})[_0x5572('0x32')](function(){return _0x5e3372;});}else{return _0x5e3372;}})[_0x5572('0x26')](function(_0x29f01d){logger[_0x5572('0x23')](_0x5572('0x5f'),_0x29f01d);throw _0x29f01d;});}return _0x5e3372;})[_0x5572('0x32')](respondWithResult(_0x809c66,0xc9))[_0x5572('0x26')](handleError(_0x809c66,null));};exports[_0x5572('0x31')]=function(_0x50451f,_0x441539){if(_0x50451f['body']['id']){delete _0x50451f[_0x5572('0x5b')]['id'];}return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x50451f['params']['id']},'include':[{'model':db['Pause'],'as':_0x5572('0x3d')}]})[_0x5572('0x32')](handleEntityNotFound(_0x441539,null))[_0x5572('0x32')](saveUpdates(_0x50451f['body'],null))['then'](respondWithResult(_0x441539,null))[_0x5572('0x26')](handleError(_0x441539,null));};exports[_0x5572('0x33')]=function(_0x12be74,_0xde28c3){return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x12be74[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0xde28c3,null))['then'](removeEntity(_0xde28c3,null))[_0x5572('0x26')](handleError(_0xde28c3,null));};exports[_0x5572('0x61')]=function(_0x1216d7,_0x49768d){return db[_0x5572('0x3f')][_0x5572('0x61')]()[_0x5572('0x32')](respondWithResult(_0x49768d,null))[_0x5572('0x26')](handleError(_0x49768d,null));};exports['addDisposition']=function(_0x5ae321,_0x3f7a21,_0x264ab2){if(_0x5ae321[_0x5572('0x5b')]['id']){delete _0x5ae321[_0x5572('0x5b')]['id'];}return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x5ae321[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x3f7a21,null))[_0x5572('0x32')](function(_0x23784f){if(_0x23784f){_0x5ae321[_0x5572('0x5b')][_0x5572('0x62')]=_0x23784f['id'];return db[_0x5572('0x63')][_0x5572('0x5a')](_0x5ae321[_0x5572('0x5b')]);}})[_0x5572('0x32')](respondWithResult(_0x3f7a21,null))[_0x5572('0x26')](handleError(_0x3f7a21,null));};exports['getDispositions']=function(_0x2150b7,_0x486d85,_0x483364){var _0x3454e8={'raw':![],'where':{}};var _0x5d8064={};var _0x100995={'count':0x0,'rows':[]};return db[_0x5572('0x3f')]['findOne']({'where':{'id':_0x2150b7[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x486d85,null))[_0x5572('0x32')](function(_0x500d18){if(_0x500d18){_0x5d8064[_0x5572('0x43')]=_[_0x5572('0x59')](db[_0x5572('0x63')][_0x5572('0x40')]);_0x5d8064[_0x5572('0x44')]=_[_0x5572('0x59')](_0x2150b7['query']);_0x5d8064[_0x5572('0x45')]=_[_0x5572('0x46')](_0x5d8064[_0x5572('0x43')],_0x5d8064[_0x5572('0x44')]);_0x3454e8[_0x5572('0x48')]=_[_0x5572('0x46')](_0x5d8064['model'],qs[_0x5572('0x47')](_0x2150b7[_0x5572('0x44')]['fields']));_0x3454e8[_0x5572('0x48')]=_0x3454e8['attributes'][_0x5572('0x49')]?_0x3454e8['attributes']:_0x5d8064[_0x5572('0x43')];if(!_0x2150b7[_0x5572('0x44')][_0x5572('0x4a')]('nolimit')){_0x3454e8['limit']=qs[_0x5572('0x2c')](_0x2150b7['query'][_0x5572('0x2c')]);_0x3454e8[_0x5572('0x2a')]=qs[_0x5572('0x2a')](_0x2150b7[_0x5572('0x44')][_0x5572('0x2a')]);}_0x3454e8[_0x5572('0x4c')]=qs['sort'](_0x2150b7[_0x5572('0x44')]['sort']);_0x3454e8[_0x5572('0x4e')]=qs['filters'](_[_0x5572('0x64')](_0x2150b7['query'],_0x5d8064[_0x5572('0x45')]));_0x3454e8[_0x5572('0x4e')][_0x5572('0x62')]=_0x500d18['id'];if(_0x2150b7[_0x5572('0x44')][_0x5572('0x4f')]){_0x3454e8[_0x5572('0x4e')]=_['merge'](_0x3454e8['where'],{'$or':_[_0x5572('0x3e')](_0x3454e8[_0x5572('0x48')],function(_0x4298a6){var _0x3fa18b={};_0x3fa18b[_0x4298a6]={'$like':'%'+_0x2150b7[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x3fa18b;})});}_0x3454e8=_['merge']({},_0x3454e8,_0x2150b7[_0x5572('0x53')]);return db['Disposition'][_0x5572('0x2d')]({'where':_0x3454e8[_0x5572('0x4e')]})[_0x5572('0x32')](function(_0x25332e){_0x100995[_0x5572('0x2d')]=_0x25332e;if(_0x2150b7[_0x5572('0x44')]['includeAll']){_0x3454e8[_0x5572('0x55')]=[{'all':!![]}];}return db[_0x5572('0x63')][_0x5572('0x56')](_0x3454e8);})['then'](function(_0xe84beb){_0x100995[_0x5572('0x57')]=_0xe84beb;return _0x100995;});}})[_0x5572('0x32')](respondWithFilteredResult(_0x486d85,_0x3454e8))[_0x5572('0x26')](handleError(_0x486d85,null));};exports[_0x5572('0x65')]=function(_0x301c8d,_0x1a8fb5,_0x3ad785){return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x301c8d['params']['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x1a8fb5,null))[_0x5572('0x32')](function(_0x2852b0){if(_0x2852b0){return _0x2852b0[_0x5572('0x65')](_0x301c8d[_0x5572('0x44')][_0x5572('0x66')]);}})[_0x5572('0x32')](respondWithStatusCode(_0x1a8fb5,null))[_0x5572('0x26')](handleError(_0x1a8fb5,null));};exports[_0x5572('0x67')]=function(_0x611e01,_0x20e9d8,_0x6f5a5c){if(_0x611e01[_0x5572('0x5b')]['id']){delete _0x611e01[_0x5572('0x5b')]['id'];}return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x611e01[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x20e9d8,null))[_0x5572('0x32')](function(_0xdff796){if(_0xdff796){_0x611e01[_0x5572('0x5b')][_0x5572('0x62')]=_0xdff796['id'];return db[_0x5572('0x68')]['create'](_0x611e01[_0x5572('0x5b')]);}})[_0x5572('0x32')](respondWithResult(_0x20e9d8,null))[_0x5572('0x26')](handleError(_0x20e9d8,null));};exports[_0x5572('0x69')]=function(_0x18e1d4,_0x2f8ace,_0x41e1fa){var _0x5e41f2={'raw':![],'where':{}};var _0x2b76cd={};var _0x469b35={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5572('0x6a')]({'where':{'id':_0x18e1d4[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x2f8ace,null))[_0x5572('0x32')](function(_0x9ce452){if(_0x9ce452){_0x2b76cd[_0x5572('0x43')]=_[_0x5572('0x59')](db[_0x5572('0x68')][_0x5572('0x40')]);_0x2b76cd[_0x5572('0x44')]=_['keys'](_0x18e1d4['query']);_0x2b76cd[_0x5572('0x45')]=_[_0x5572('0x46')](_0x2b76cd[_0x5572('0x43')],_0x2b76cd['query']);_0x5e41f2['attributes']=_[_0x5572('0x46')](_0x2b76cd[_0x5572('0x43')],qs[_0x5572('0x47')](_0x18e1d4[_0x5572('0x44')]['fields']));_0x5e41f2[_0x5572('0x48')]=_0x5e41f2['attributes']['length']?_0x5e41f2['attributes']:_0x2b76cd[_0x5572('0x43')];if(!_0x18e1d4['query'][_0x5572('0x4a')]('nolimit')){_0x5e41f2['limit']=qs[_0x5572('0x2c')](_0x18e1d4['query'][_0x5572('0x2c')]);_0x5e41f2['offset']=qs['offset'](_0x18e1d4['query'][_0x5572('0x2a')]);}_0x5e41f2[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x18e1d4[_0x5572('0x44')][_0x5572('0x4d')]);_0x5e41f2[_0x5572('0x4e')]=qs[_0x5572('0x45')](_[_0x5572('0x64')](_0x18e1d4[_0x5572('0x44')],_0x2b76cd['filters']));_0x5e41f2[_0x5572('0x4e')][_0x5572('0x62')]=_0x9ce452['id'];if(_0x18e1d4[_0x5572('0x44')][_0x5572('0x4f')]){_0x5e41f2[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x5e41f2[_0x5572('0x4e')],{'$or':_[_0x5572('0x3e')](_0x5e41f2[_0x5572('0x48')],function(_0x2e8e4f){var _0x3bb7e0={};_0x3bb7e0[_0x2e8e4f]={'$like':'%'+_0x18e1d4[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x3bb7e0;})});}_0x5e41f2=_[_0x5572('0x50')]({},_0x5e41f2,_0x18e1d4[_0x5572('0x53')]);return db[_0x5572('0x68')][_0x5572('0x2d')]({'where':_0x5e41f2[_0x5572('0x4e')]})['then'](function(_0x554add){_0x469b35[_0x5572('0x2d')]=_0x554add;if(_0x18e1d4['query'][_0x5572('0x54')]){_0x5e41f2[_0x5572('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5e41f2);})[_0x5572('0x32')](function(_0x4c961b){_0x469b35['rows']=_0x4c961b;return _0x469b35;});}})[_0x5572('0x32')](respondWithFilteredResult(_0x2f8ace,_0x5e41f2))[_0x5572('0x26')](handleError(_0x2f8ace,null));};exports[_0x5572('0x6b')]=function(_0x50e8f6,_0x5a8f04,_0x579c49){return db['ChatWebsite']['find']({'where':{'id':_0x50e8f6[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x5a8f04,null))[_0x5572('0x32')](function(_0x27ce53){if(_0x27ce53){return _0x27ce53['removeAnswers'](_0x50e8f6[_0x5572('0x44')][_0x5572('0x66')]);}})[_0x5572('0x32')](respondWithStatusCode(_0x5a8f04,null))[_0x5572('0x26')](handleError(_0x5a8f04,null));};exports[_0x5572('0x6c')]=function(_0x35b84a,_0x2dca00,_0x5b19bc){_0x35b84a[_0x5572('0x5b')][_0x5572('0x6d')]=_0x35b84a[_0x5572('0x6e')][_0x5572('0x6f')];return db[_0x5572('0x3f')]['find']({'where':{'id':_0x35b84a[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x2dca00,null))['then'](saveUpdates(_0x35b84a[_0x5572('0x5b')],null))[_0x5572('0x32')](respondWithResult(_0x2dca00,null))[_0x5572('0x26')](handleError(_0x2dca00,null));};exports[_0x5572('0x70')]=function(_0x4c6614,_0xfebe28,_0x4ac77c){_0x4c6614[_0x5572('0x5b')]['agentAvatar']=_0x4c6614[_0x5572('0x6e')][_0x5572('0x6f')];return db[_0x5572('0x3f')]['find']({'where':{'id':_0x4c6614[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0xfebe28,null))[_0x5572('0x32')](saveUpdates(_0x4c6614[_0x5572('0x5b')],null))[_0x5572('0x32')](respondWithResult(_0xfebe28,null))[_0x5572('0x26')](handleError(_0xfebe28,null));};exports[_0x5572('0x71')]=function(_0x741a16,_0x42b0b8,_0x4cb6c9){_0x741a16['body']['customerAvatar']=_0x741a16['file']['filename'];return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x741a16[_0x5572('0x60')]['id']}})['then'](handleEntityNotFound(_0x42b0b8,null))[_0x5572('0x32')](saveUpdates(_0x741a16['body'],null))[_0x5572('0x32')](respondWithResult(_0x42b0b8,null))[_0x5572('0x26')](handleError(_0x42b0b8,null));};exports[_0x5572('0x72')]=function(_0x28e85c,_0xd86b02,_0x4feb50){_0x28e85c[_0x5572('0x5b')][_0x5572('0x73')]=_0x28e85c[_0x5572('0x6e')][_0x5572('0x6f')];return db[_0x5572('0x3f')]['find']({'where':{'id':_0x28e85c[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0xd86b02,null))['then'](saveUpdates(_0x28e85c[_0x5572('0x5b')],null))[_0x5572('0x32')](respondWithResult(_0xd86b02,null))[_0x5572('0x26')](handleError(_0xd86b02,null));};exports[_0x5572('0x74')]=function(_0x3f63c2,_0x1470ad,_0x35ecf5){var _0x4c72c8=path[_0x5572('0x75')](config[_0x5572('0x76')],'server/files/images/logos/default_logo.svg');var _0x308884={'where':{'id':_0x3f63c2[_0x5572('0x60')]['id']},'attributes':['id',_0x5572('0x6d')],'raw':!![]};var _0x26909d=![];return require('../../config/license/util')[_0x5572('0x77')]()[_0x5572('0x32')](function(_0x3e57dc){if(_0x3e57dc){_0x26909d=_0x3e57dc[_0x5572('0x78')];}})[_0x5572('0x32')](function(){return db['ChatWebsite'][_0x5572('0x5e')](_0x308884);})[_0x5572('0x32')](handleEntityNotFound(_0x1470ad,null))[_0x5572('0x32')](function(_0x496a61){if(_0x496a61){if(!_['isNil'](_0x496a61[_0x5572('0x6d')])){if(fs[_0x5572('0x79')](path[_0x5572('0x75')](config[_0x5572('0x76')],_0x5572('0x7a'),_0x496a61[_0x5572('0x6d')]))&&_0x26909d){_0x4c72c8=path['join'](config[_0x5572('0x76')],_0x5572('0x7a'),_0x496a61[_0x5572('0x6d')]);}}return _0x1470ad[_0x5572('0x7b')](_0x4c72c8);}})[_0x5572('0x26')](handleError(_0x1470ad,null));};exports['getAvatar']=function(_0x333164,_0x537dc0,_0x5d738c){var _0x37db52=path[_0x5572('0x75')](config[_0x5572('0x76')],'server/files/images/avatars/default_avatar.png');var _0x4c73cd={'where':{'id':_0x333164[_0x5572('0x60')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x4c73cd)['then'](handleEntityNotFound(_0x537dc0,null))['then'](function(_0xc66569){if(_0xc66569){if(!_[_0x5572('0x7c')](_0xc66569[_0x5572('0x7d')])){if(fs[_0x5572('0x79')](path[_0x5572('0x75')](config['root'],_0x5572('0x7e'),_0xc66569[_0x5572('0x7d')]))){_0x37db52=path[_0x5572('0x75')](config[_0x5572('0x76')],_0x5572('0x7e'),_0xc66569[_0x5572('0x7d')]);}}return _0x537dc0['download'](_0x37db52);}})[_0x5572('0x26')](handleError(_0x537dc0,null));};exports[_0x5572('0x7f')]=function(_0x225afe,_0x1268fe,_0x4f6671){var _0x52c7d7=path[_0x5572('0x75')](config[_0x5572('0x76')],_0x5572('0x80'));var _0x20f5c2={'where':{'id':_0x225afe[_0x5572('0x60')]['id']},'attributes':['id',_0x5572('0x81'),_0x5572('0x82')],'raw':!![]};return db[_0x5572('0x3f')][_0x5572('0x5e')](_0x20f5c2)['then'](handleEntityNotFound(_0x1268fe,null))[_0x5572('0x32')](function(_0x4d2a74){if(_0x4d2a74){if(!_[_0x5572('0x7c')](_0x4d2a74[_0x5572('0x81')])){if(fs[_0x5572('0x79')](path['join'](config[_0x5572('0x76')],'server/files/images/avatars/',_0x4d2a74[_0x5572('0x81')]))&&_0x4d2a74[_0x5572('0x82')]){_0x52c7d7=path[_0x5572('0x75')](config['root'],_0x5572('0x7e'),_0x4d2a74[_0x5572('0x81')]);}}return _0x1268fe[_0x5572('0x7b')](_0x52c7d7);}})[_0x5572('0x26')](handleError(_0x1268fe,null));};exports['getSystemAvatar']=function(_0x3cc987,_0x47320b,_0x14519b){var _0x32dd48=path[_0x5572('0x75')](config[_0x5572('0x76')],'server/files/images/avatars/system_avatar.png');var _0x29e60b={'where':{'id':_0x3cc987['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x5572('0x3f')][_0x5572('0x5e')](_0x29e60b)[_0x5572('0x32')](handleEntityNotFound(_0x47320b,null))['then'](function(_0x248057){if(_0x248057){if(!_[_0x5572('0x7c')](_0x248057['systemAvatar'])){if(fs[_0x5572('0x79')](path[_0x5572('0x75')](config['root'],_0x5572('0x7e'),_0x248057['systemAvatar']))){_0x32dd48=path['join'](config[_0x5572('0x76')],_0x5572('0x7e'),_0x248057[_0x5572('0x73')]);}}return _0x47320b[_0x5572('0x7b')](_0x32dd48);}})[_0x5572('0x26')](handleError(_0x47320b,null));};exports[_0x5572('0x83')]=function(_0x2377fa,_0x58d342,_0x5827c8){var _0xfb35fe=require(_0x5572('0x84'));var _0x2ead53=new _0xfb35fe();var _0x20aee5=_0x2ead53[_0x5572('0x85')](_0x2377fa[_0x5572('0x86')]['user-agent'])[_0x5572('0x87')]();var _0x17b40a={'body':_0x2377fa[_0x5572('0x5b')],'channel':_0x5572('0x88')};var _0xe96a7f=[];var _0x4e726d=[];var _0x251b75={};var _0x5a49d8=![];return db[_0x5572('0x89')][_0x5572('0x61')]()[_0x5572('0x32')](function(_0x2d29e8){if(!_0x2d29e8){throw new db[(_0x5572('0x8a'))]['ValidationError'](_0x5572('0x8b'));}_0xe96a7f=_[_0x5572('0x8c')](_['keys'](_0x2d29e8),[_0x5572('0x8d'),_0x5572('0x8e')]);_0x4e726d=_[_0x5572('0x8c')](_[_0x5572('0x59')](_0x2d29e8),[_0x5572('0x8d'),_0x5572('0x8e'),_0x5572('0x8f'),_0x5572('0x90')]);if(_0x2377fa['body']['id']){delete _0x2377fa[_0x5572('0x5b')]['id'];}if(_[_0x5572('0x7c')](_0x2377fa[_0x5572('0x5b')][_0x5572('0x91')])){throw new db[(_0x5572('0x8a'))][(_0x5572('0x92'))](_0x5572('0x93'));}if(_[_0x5572('0x7c')](_0x2377fa['body'][_0x5572('0x5b')])||_0x2377fa[_0x5572('0x5b')][_0x5572('0x5b')]===''){throw new db[(_0x5572('0x8a'))][(_0x5572('0x92'))](_0x5572('0x94'));}if(_[_0x5572('0x7c')](_0x2377fa['body'][_0x5572('0x95')])){throw new db[(_0x5572('0x8a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e726d);}if(!_[_0x5572('0x96')](_0x4e726d,_0x2377fa[_0x5572('0x5b')][_0x5572('0x95')])){throw new db[(_0x5572('0x8a'))]['ValidationError'](_0x5572('0x97')+_0x4e726d);}_0x251b75[_0x2377fa[_0x5572('0x5b')]['mapKey']]=_0x2377fa[_0x5572('0x5b')][_0x5572('0x91')];})[_0x5572('0x32')](function(){return db['ChatWebsite'][_0x5572('0x5e')]({'where':{'id':_0x2377fa[_0x5572('0x60')]['id']},'include':[{'model':db[_0x5572('0x98')],'as':_0x5572('0x99'),'include':[{'model':db[_0x5572('0x89')],'as':_0x5572('0x9a'),'where':_0x251b75,'limit':0x1,'order':[[_0x5572('0x8e'),_0x5572('0x9b')]]}]},{'model':db[_0x5572('0x9c')],'as':_0x5572('0x9d')}]});})[_0x5572('0x32')](handleEntityNotFound(_0x58d342,null))[_0x5572('0x32')](function(_0x275123){if(_0x275123&&_0x275123[_0x5572('0x99')]){_0x17b40a[_0x5572('0x9e')]=_0x275123;_0x17b40a[_0x5572('0x9f')]=_0x275123[_0x5572('0x9d')];_0x17b40a[_0x5572('0xa0')]=_0x275123[_0x5572('0x99')];_0x17b40a['applications']=_[_0x5572('0xa1')](_0x17b40a[_0x5572('0x9f')],[_0x5572('0xa2')],[_0x5572('0xa3')]);if(_0x17b40a['account'][_0x5572('0x9d')]){delete _0x17b40a['account'][_0x5572('0x9d')];}if(_0x17b40a[_0x5572('0x9e')][_0x5572('0x99')]&&_0x17b40a['account'][_0x5572('0x99')]['Contacts'][_0x5572('0x49')]){return _0x17b40a[_0x5572('0x9e')][_0x5572('0x99')][_0x5572('0x9a')][0x0];}var _0x395e22=_[_0x5572('0x17')](_0x2377fa[_0x5572('0x5b')],{'firstName':_0x2377fa['body']['from'],'ListId':_0x275123[_0x5572('0x90')]});_0x395e22[_0x2377fa['body']['mapKey']]=_0x2377fa[_0x5572('0x5b')][_0x5572('0x91')];return db[_0x5572('0x89')][_0x5572('0x5a')](_0x395e22,{'fields':_0xe96a7f,'raw':!![]});}})[_0x5572('0x32')](handleEntityNotFound(_0x58d342,null))[_0x5572('0x32')](function(_0x1cf92){_0x17b40a[_0x5572('0xa4')]=_0x1cf92;var _0x5c6d29=_0x2377fa[_0x5572('0x5b')][_0x5572('0xa5')];if(_0x2377fa[_0x5572('0x86')][_0x5572('0xa6')]){_0x5c6d29=_0x2377fa[_0x5572('0x86')]['cf-connecting-ip'];}else if(_0x2377fa[_0x5572('0x86')]['x-forwarded-for']){_0x5c6d29=_[_0x5572('0xa7')](_0x2377fa[_0x5572('0x86')][_0x5572('0xa8')][_0x5572('0xa9')](','));}if(_0x1cf92){var _0x4f154f={'ContactId':_0x1cf92['id'],'ChatWebsiteId':_0x2377fa['params']['id'],'from':(_0x1cf92[_0x5572('0xaa')]||'')+'\x20'+(_0x1cf92[_0x5572('0xab')]||''),'customerIp':_0x5c6d29,'customerPort':_0x2377fa[_0x5572('0x86')][_0x5572('0xac')]?_0x2377fa[_0x5572('0x86')][_0x5572('0xac')]:null,'referer':_0x2377fa[_0x5572('0x5b')]['referer'],'browserName':_0x20aee5[_0x5572('0xad')][_0x5572('0x39')]&&_0x20aee5['browser'][_0x5572('0xae')]?util[_0x5572('0xaf')]('%s\x20%s',_0x20aee5[_0x5572('0xad')]['name'],_0x20aee5[_0x5572('0xad')][_0x5572('0xae')]):_0x5572('0xb0'),'browserVersion':_0x20aee5[_0x5572('0xad')][_0x5572('0xae')]||_0x5572('0xb0'),'osName':util[_0x5572('0xaf')](_0x5572('0xb1'),_0x20aee5['os'][_0x5572('0x39')],_0x20aee5['os'][_0x5572('0xae')]),'osVersion':_0x20aee5['os'][_0x5572('0xae')],'deviceModel':_0x20aee5[_0x5572('0xb2')][_0x5572('0x43')]&&_0x20aee5['device'][_0x5572('0xb3')]?util[_0x5572('0xaf')]('%s\x20%s\x20%s',_0x20aee5[_0x5572('0xb2')][_0x5572('0x43')],_0x20aee5[_0x5572('0xb2')][_0x5572('0xb3')],_0x20aee5[_0x5572('0xb2')][_0x5572('0x51')]):null,'deviceVendor':_0x20aee5[_0x5572('0xb2')][_0x5572('0xb3')],'deviceType':_0x20aee5['device']['type'],'formData':JSON['stringify'](_0x2377fa[_0x5572('0x5b')])};var _0x76451a={'ChatWebsiteId':_0x2377fa[_0x5572('0x60')]['id'],'closed':![]};if(_0x2377fa[_0x5572('0x5b')][_0x5572('0xb4')]){_0x76451a[_0x5572('0xb4')]=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb4')];return db[_0x5572('0xb5')]['find']({'where':_0x76451a})[_0x5572('0x32')](function(_0x280ada){if(_0x280ada){return[_0x280ada,![]];}_0x4f154f[_0x5572('0xb4')]=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb4')];_0x4f154f[_0x5572('0xb6')]=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb6')];return db['ChatInteraction'][_0x5572('0x5a')](_0x4f154f)[_0x5572('0x32')](function(_0xc94f74){return[_0xc94f74,!![]];});});}_0x76451a['ContactId']=_0x1cf92['id'];if(_0x2377fa[_0x5572('0x5b')][_0x5572('0xb7')]&&_0x2377fa[_0x5572('0x5b')][_0x5572('0xb7')]['id']){_0x76451a['id']=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb7')]['id'];return db[_0x5572('0xb5')][_0x5572('0x5e')]({'where':_0x76451a})['then'](function(_0x1f240e){if(_0x1f240e){return[_0x1f240e,![]];}return db[_0x5572('0xb5')][_0x5572('0x5a')](_0x4f154f)[_0x5572('0x32')](function(_0x3b988c){return[_0x3b988c,!![]];});});}return db[_0x5572('0xb5')][_0x5572('0x5a')](_0x4f154f)[_0x5572('0x32')](function(_0x3a0326){return[_0x3a0326,!![]];});}})[_0x5572('0xb8')](function(_0x55a208,_0xfa92d8){if(_0x55a208){_0x5a49d8=_0xfa92d8;if(!_0xfa92d8){var _0x28773d={'from':(_0x17b40a[_0x5572('0xa4')]['firstName']||'')+'\x20'+(_0x17b40a[_0x5572('0xa4')][_0x5572('0xab')]||'')};if(_0x2377fa[_0x5572('0x5b')][_0x5572('0xb4')]&&_0x2377fa['body'][_0x5572('0xb9')]&&_0x2377fa[_0x5572('0x5b')]['threadId']!=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb9')]){_0x28773d['threadId']=_0x2377fa[_0x5572('0x5b')][_0x5572('0xb9')];}return _0x55a208['update'](_0x28773d);}else{return _0x55a208;}}})[_0x5572('0x32')](function(_0x58390c){_0x17b40a['interaction']=_0x58390c[_0x5572('0x34')]({'plain':!![]});_0x17b40a[_0x5572('0xb7')][_0x5572('0xba')]=_0x5a49d8;if(_0x17b40a[_0x5572('0xb7')][_0x5572('0xba')]){if(_0x17b40a[_0x5572('0x9e')][_0x5572('0xbb')]){_0x17b40a['applications']['push']({'id':0x0,'priority':_0x17b40a['applications'][_0x5572('0x49')]+0x1,'app':_0x5572('0xbc'),'appdata':_0x5572('0xbd'),'interval':_0x5572('0xbe')});}}return db[_0x5572('0xbf')]['create']({'body':_0x2377fa[_0x5572('0x5b')][_0x5572('0x5b')],'ChatWebsiteId':_0x2377fa[_0x5572('0x60')]['id'],'ChatInteractionId':_0x58390c['id'],'direction':'in','ContactId':_0x17b40a['contact']['id'],'AttachmentId':_0x2377fa[_0x5572('0x5b')][_0x5572('0xc0')]});})[_0x5572('0x32')](function(_0x4b3907){_0x17b40a[_0x5572('0x24')]=_0x4b3907;if(_0x17b40a[_0x5572('0xb7')][_0x5572('0xc1')]){return db[_0x5572('0xc2')][_0x5572('0x5e')]({'attributes':['id',_0x5572('0x39')],'where':{'id':_0x17b40a[_0x5572('0xb7')]['UserId']}})[_0x5572('0x32')](function(_0x5ecc63){if(_0x5ecc63){_0x17b40a['applications'][_0x5572('0xc3')]({'id':0x0,'priority':0x0,'app':_0x5572('0xc4'),'appdata':_0x5ecc63[_0x5572('0x39')]+','+(_0x17b40a[_0x5572('0x9e')][_0x5572('0xc5')]||0xa),'interval':_0x5572('0xbe')});_0x17b40a['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x5572('0xc6'),_0x17b40a);});}return respondWithRpcPromise(_0x5572('0xc7'),_0x5572('0xc6'),_0x17b40a);})[_0x5572('0x32')](function(_0x4298c7){respondWithRpcPromise(_0x5572('0xc8'),_0x5572('0xc8'),{'event':'notify','message':_0x4298c7},client9002);return _0x4298c7;})['then'](respondWithResult(_0x58d342,null))[_0x5572('0x26')](handleError(_0x58d342,null));};exports[_0x5572('0xc9')]=function(_0x17b1b5,_0xb8b669,_0x514ba9){var _0x385518,_0x70acbb,_0x5b9e6f;var _0x195df8=[];var _0x4480d0=[];var _0x7d4daa={};var _0x3fca9d=_0x17b1b5[_0x5572('0xca')]||[];var _0x42d216=[];var _0x3a0b2f;return db[_0x5572('0x89')][_0x5572('0x61')]()['then'](function(_0x2712bb){if(!_0x2712bb){throw new db['Sequelize'][(_0x5572('0x92'))](_0x5572('0x8b'));}_0x4480d0=_[_0x5572('0x8c')](_[_0x5572('0x59')](_0x2712bb),[_0x5572('0x8d'),'updatedAt']);_0x195df8=_['difference'](_[_0x5572('0x59')](_0x2712bb),['createdAt',_0x5572('0x8e'),_0x5572('0x8f'),_0x5572('0x90')]);if(_0x17b1b5[_0x5572('0x5b')]['id']){delete _0x17b1b5['body']['id'];}if(_[_0x5572('0x7c')](_0x17b1b5[_0x5572('0x5b')]['from'])){throw _0xb8b669[_0x5572('0x27')](0x1f4)[_0x5572('0x3a')](new db[(_0x5572('0x8a'))][(_0x5572('0x92'))](_0x5572('0x93')));}if(_[_0x5572('0x7c')](_0x17b1b5[_0x5572('0x5b')][_0x5572('0x5b')])||_0x17b1b5[_0x5572('0x5b')][_0x5572('0x5b')]===''){throw _0xb8b669[_0x5572('0x27')](0x1f4)['send'](new db[(_0x5572('0x8a'))][(_0x5572('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5572('0x7c')](_0x17b1b5[_0x5572('0x5b')][_0x5572('0xcb')])){throw _0xb8b669[_0x5572('0x27')](0x1f4)[_0x5572('0x3a')](new db[(_0x5572('0x8a'))][(_0x5572('0x92'))](_0x5572('0xcc')+_0x195df8));}if(!_[_0x5572('0x96')](_0x195df8,_0x17b1b5[_0x5572('0x5b')][_0x5572('0xcb')])){throw _0xb8b669[_0x5572('0x27')](0x1f4)[_0x5572('0x3a')](new db['Sequelize'][(_0x5572('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x195df8));}_0x7d4daa[_0x17b1b5[_0x5572('0x5b')][_0x5572('0xcb')]]=_0x17b1b5[_0x5572('0x5b')]['from'];})[_0x5572('0x32')](function(){return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x17b1b5[_0x5572('0x60')]['id']},'include':[{'model':db[_0x5572('0x98')],'as':_0x5572('0x99')},{'model':db['MailAccount'],'as':_0x5572('0xcd')}]});})['then'](handleEntityNotFound(_0xb8b669,null))[_0x5572('0x32')](function(_0x20fff7){if(_0x20fff7&&_0x20fff7[_0x5572('0x99')]){_0x70acbb=_0x20fff7;var _0x3e2b4b=_['defaults'](_0x17b1b5[_0x5572('0x5b')],{'firstName':_0x17b1b5[_0x5572('0x5b')][_0x5572('0x91')],'phone':_0x17b1b5[_0x5572('0x5b')][_0x5572('0x91')],'ListId':_0x20fff7['ListId']});_0x3e2b4b[_0x17b1b5['body'][_0x5572('0xcb')]]=_0x17b1b5['body']['from'];return db['CmContact'][_0x5572('0xce')]({'where':_0x7d4daa,'defaults':_0x3e2b4b});}})[_0x5572('0xb8')](function(_0xb5f79e){if(_0xb5f79e){_0x5b9e6f=_0xb5f79e;var _0x581434=fs[_0x5572('0xcf')](path['join'](config[_0x5572('0x76')],'server/files/templates/chatOfflineMessage.ejs'),_0x5572('0xd0'));var _0x27899d=ejs['render'](_0x581434,{'body':_[_0x5572('0xd1')](_0x17b1b5[_0x5572('0x5b')][_0x5572('0x5b')]),'bodyTitle':_0x70acbb[_0x5572('0xd2')]});return db[_0x5572('0xd3')]['create']({'body':_0x27899d,'ContactId':_0xb5f79e['id'],'ChatWebsiteId':_0x70acbb['id']});}})[_0x5572('0x32')](function(_0x8cdf03){_0x3a0b2f=_0x8cdf03;if(_0x3fca9d[_0x5572('0x49')]){var _0x418771=_0x3fca9d['map'](function(_0x2a2dbf){return{'name':_0x2a2dbf[_0x5572('0xd4')],'basename':_0x2a2dbf['filename'],'type':_0x2a2dbf[_0x5572('0xd5')],'ChatOfflineMessageId':_0x8cdf03['id']};});_0x42d216=_0x418771[_0x5572('0x3e')](_0xa0a90=>{var _0x5e1f98={'filename':_0xa0a90[_0x5572('0x39')],'path':path[_0x5572('0x75')](config[_0x5572('0x76')],_0x5572('0xd6'),_0x5572('0xca'),_0x5572('0xd7'),'offline-chat',_0xa0a90[_0x5572('0xd8')])};return _0x5e1f98;});if(!_0x70acbb[_0x5572('0xd9')]){return db[_0x5572('0xda')]['transaction'](function(_0x4a7b4e){return db[_0x5572('0xdb')][_0x5572('0xdc')](_0x418771,{'transaction':_0x4a7b4e});});}}})['then'](function(){if(_0x3a0b2f){_0x385518=_0x3a0b2f;return db[_0x5572('0xcd')][_0x5572('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0x5572('0xdd')],'as':_0x5572('0xde'),'raw':!![]}]});}})[_0x5572('0x32')](function(_0x1c8e5f){if(_0x1c8e5f&&_0x1c8e5f[_0x5572('0xde')]&&_0x70acbb[_0x5572('0xdf')]&&_0x70acbb[_0x5572('0xe0')]){var _0x228d89={'tls':{'rejectUnauthorized':![]}};if(_0x1c8e5f['Smtp'][_0x5572('0xe1')]){_0x228d89['service']=_0x1c8e5f[_0x5572('0xde')][_0x5572('0xe1')];}else{_0x228d89[_0x5572('0xe2')]=_0x1c8e5f[_0x5572('0xde')][_0x5572('0xe2')];_0x228d89[_0x5572('0xe3')]=_0x1c8e5f[_0x5572('0xde')]['port'];_0x228d89[_0x5572('0xe4')]=_0x1c8e5f[_0x5572('0xde')][_0x5572('0xe4')];}if(_0x1c8e5f['Smtp'][_0x5572('0xe5')]){_0x228d89[_0x5572('0xe6')]={'user':_0x1c8e5f[_0x5572('0xde')][_0x5572('0x5c')],'pass':_0x1c8e5f[_0x5572('0xde')][_0x5572('0xe7')]};}return respondWithRpcPromise(_0x5572('0xe8'),_0x5572('0xe9'),{'account':_0x228d89,'message':{'from':util[_0x5572('0xaf')](_0x5572('0xea'),_0x1c8e5f[_0x5572('0x39')],_0x1c8e5f['email']||_0x1c8e5f[_0x5572('0xde')][_0x5572('0x5c')]),'to':_0x70acbb['forwardOfflineAddress'],'subject':_0x70acbb[_0x5572('0xeb')],'html':_0x385518[_0x5572('0x5b')],'attachments':_0x42d216}},client9003)[_0x5572('0x32')](function(){return _0x385518;})['catch'](function(_0x4237aa){console[_0x5572('0x23')](_0x4237aa);});}})[_0x5572('0x32')](function(){if(_0x70acbb&&_0x70acbb['openNewInteraction']&&_0x70acbb[_0x5572('0xec')]){var _0x2fed1d=[];if(_0x3fca9d[_0x5572('0x49')]){_0x2fed1d=_0x3fca9d[_0x5572('0x3e')](function(_0x4e1188){return{'name':_0x4e1188['originalname'],'basename':_0x4e1188[_0x5572('0x6f')],'type':_0x4e1188[_0x5572('0xd5')],'ChatOfflineMessageId':_0x3a0b2f['id']};});}var _0xc861b9;if(!_['isNil'](_0x70acbb[_0x5572('0xed')])){var _0x49aa81=_[_0x5572('0x3e')](_0x17b1b5['body'],function(_0x293abb){return _0x293abb;});var _0x5ef3cd=_['toPairsIn'](_0x49aa81)[0x0];var _0x4e1c5b=_['mapValues'](_0x5ef3cd,function(_0x30f799){return _0x30f799;});_0xc861b9=_0x4e1c5b[0x1][_0x70acbb[_0x5572('0xed')]];}var _0x3a3aae={'from':_0x5b9e6f[_0x5572('0xee')],'firstName':_0x5b9e6f[_0x5572('0xaa')],'lastName':_0x5b9e6f[_0x5572('0xab')],'mapKey':_0x5572('0xee'),'message':{'from':_0x5b9e6f[_0x5572('0xee')],'to':_0x70acbb['MailAccount'][_0x5572('0xee')],'cc':'','subject':_[_0x5572('0x7c')](_0xc861b9)?_0x70acbb[_0x5572('0xeb')]:_0xc861b9,'messageId':'','sentAt':new Date(),'attach':_0x2fed1d[_0x5572('0x49')],'attachments':_0x2fed1d,'originChannel':_0x5572('0xef'),'ChatWebsiteId':_0x70acbb['id'],'ChatOfflineMessageId':_0x385518['id'],'originTo':_0x70acbb['MailAccount']['email']},'body':_0x385518[_0x5572('0x5b')]};var _0x1bf3bc={'account':{'id':_0x70acbb[_0x5572('0xec')]},'body':_0x3a3aae,'log':_0x5572('0xf0')};return respondWithRpcPromise(_0x5572('0xf0'),_0x5572('0xf1'),_0x1bf3bc,client9001)[_0x5572('0x32')](function(){return _0x385518;})[_0x5572('0x26')](function(_0xb5141d){console[_0x5572('0x23')](_0xb5141d);});}return;})[_0x5572('0x32')](function(){if(_0x385518){return _0x385518;}})[_0x5572('0x32')](respondWithResult(_0xb8b669,null))[_0x5572('0x26')](function(_0x2f93be){console[_0x5572('0x23')](_0x5572('0x26'),_0x2f93be);for(var _0x165015 of _0x3fca9d){var _0x4f5b97=path[_0x5572('0x75')](config[_0x5572('0x76')],_0x5572('0xd6'),_0x5572('0xca'),_0x5572('0xd7'),_0x5572('0xf2'),_0x165015[_0x5572('0x6f')]);fs_extra[_0x5572('0xf3')](_0x4f5b97)['catch'](function(_0x5abd7c){console[_0x5572('0x23')](_0x5572('0xf4'),_0x4f5b97,_0x5abd7c);});}});};exports[_0x5572('0xf5')]=function(_0x2f13e2,_0x2507f8,_0x3781db){return db[_0x5572('0xb5')][_0x5572('0x5e')]({'where':{'id':_0x2f13e2['params']['id']}})['then'](handleEntityNotFound(_0x2507f8,null))[_0x5572('0x32')](function(_0x11b8b9){if(_0x11b8b9){return _0x11b8b9[_0x5572('0xf5')](_0x2f13e2[_0x5572('0x5b')][_0x5572('0x66')],_[_0x5572('0xf6')](_0x2f13e2[_0x5572('0x5b')],[_0x5572('0x66'),'id'])||{});}})[_0x5572('0x32')](respondWithResult(_0x2507f8,null))['catch'](handleError(_0x2507f8,null));};exports[_0x5572('0xf7')]=function(_0x20e285,_0x2ce143,_0x394cfd){var _0x269b34={'raw':![],'where':{}};var _0x3aa32b={};var _0x288a65={'count':0x0,'rows':[]};return db[_0x5572('0x3f')][_0x5572('0x6a')]({'where':{'id':_0x20e285[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x2ce143,null))[_0x5572('0x32')](function(_0x1f2c14){if(_0x1f2c14){_0x3aa32b[_0x5572('0x43')]=_[_0x5572('0x59')](db[_0x5572('0xb5')]['rawAttributes']);_0x3aa32b[_0x5572('0x44')]=_[_0x5572('0x59')](_0x20e285[_0x5572('0x44')]);_0x3aa32b[_0x5572('0x45')]=_['intersection'](_0x3aa32b['model'],_0x3aa32b[_0x5572('0x44')]);_0x269b34[_0x5572('0x48')]=_[_0x5572('0x46')](_0x3aa32b[_0x5572('0x43')],qs[_0x5572('0x47')](_0x20e285['query'][_0x5572('0x47')]));_0x269b34[_0x5572('0x48')]=_0x269b34[_0x5572('0x48')][_0x5572('0x49')]?_0x269b34['attributes']:_0x3aa32b['model'];if(!_0x20e285[_0x5572('0x44')]['hasOwnProperty'](_0x5572('0x4b'))){_0x269b34['limit']=qs['limit'](_0x20e285[_0x5572('0x44')][_0x5572('0x2c')]);_0x269b34['offset']=qs[_0x5572('0x2a')](_0x20e285[_0x5572('0x44')][_0x5572('0x2a')]);}_0x269b34[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x20e285[_0x5572('0x44')][_0x5572('0x4d')]);_0x269b34['where']=qs[_0x5572('0x45')](_[_0x5572('0x64')](_0x20e285['query'],_0x3aa32b[_0x5572('0x45')]));_0x269b34[_0x5572('0x4e')][_0x5572('0x62')]=_0x1f2c14['id'];if(_0x20e285[_0x5572('0x44')][_0x5572('0x4f')]){_0x269b34[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x269b34[_0x5572('0x4e')],{'$or':_[_0x5572('0x3e')](_0x269b34[_0x5572('0x48')],function(_0x2389e8){var _0x3ecd80={};_0x3ecd80[_0x2389e8]={'$like':'%'+_0x20e285[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x3ecd80;})});}_0x269b34=_[_0x5572('0x50')]({},_0x269b34,_0x20e285[_0x5572('0x53')]);return db[_0x5572('0xb5')][_0x5572('0x2d')]({'where':_0x269b34[_0x5572('0x4e')]})[_0x5572('0x32')](function(_0x4f18eb){_0x288a65[_0x5572('0x2d')]=_0x4f18eb;if(_0x20e285[_0x5572('0x44')]['includeAll']){_0x269b34['include']=[{'model':db[_0x5572('0x89')],'as':'Contact','required':![]},{'model':db[_0x5572('0xc2')],'as':_0x5572('0xf8'),'attributes':['name','fullname',_0x5572('0xf9')],'required':![]},{'model':db[_0x5572('0xfa')],'as':_0x5572('0xfb'),'attributes':['id',_0x5572('0x39'),_0x5572('0xfc')],'where':_0x20e285['query'][_0x5572('0xfd')]?{'id':_0x20e285[_0x5572('0x44')][_0x5572('0xfd')]}:undefined,'required':_0x20e285[_0x5572('0x44')][_0x5572('0xfd')]?!![]:![]}];}return db[_0x5572('0xb5')][_0x5572('0x56')](_0x269b34);})[_0x5572('0x32')](function(_0x5ad745){_0x288a65['rows']=_0x5ad745;return _0x288a65;});}})[_0x5572('0x32')](respondWithFilteredResult(_0x2ce143,_0x269b34))[_0x5572('0x26')](handleError(_0x2ce143,null));};function iftimePromise(_0x5b840e,_0x3105bd){return respondWithRpcPromise('Command',_0x5572('0xfe'),{'command':_0x3105bd[_0x5572('0xff')]?util[_0x5572('0xaf')](_0x5572('0x100'),_0x5b840e['interval'],_0x3105bd[_0x5572('0xff')]):util[_0x5572('0xaf')](_0x5572('0x101'),_0x5b840e['interval'])},client9002)[_0x5572('0x32')](function(_0x5c02a2){var _0x523b71=_0x5c02a2&&_0x5c02a2['indexOf'](_0x5572('0x102'))>=0x0?!![]:![];logger[_0x5572('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3105bd['id'],_0x5b840e['id'],_0x5b840e['interval'],_0x523b71?_0x5572('0x103'):'OFFLINE',_0x3105bd[_0x5572('0xff')]?_0x3105bd['timezone']:_0x5572('0x104'));return _0x523b71;})[_0x5572('0x26')](function(_0x39f992){logger[_0x5572('0x23')](_0x5572('0x105'),_0x3105bd['id'],_0x5b840e['id'],_0x5b840e[_0x5572('0x106')],util[_0x5572('0x107')](_0x39f992,{'showHidden':![],'depth':null}),_0x3105bd[_0x5572('0xff')]?_0x3105bd[_0x5572('0xff')]:_0x5572('0x104'));return![];});}exports[_0x5572('0xfe')]=function(_0x4a1d3f,_0x11b926,_0x1138b6){var _0x49bd89=0x0;var _0x174fe1=0x0;var _0x77817c=![];var _0x489b6e;var _0x527ea7;return db['ChatWebsite']['find']({'where':{'id':_0x4a1d3f[_0x5572('0x60')]['id']},'include':[{'model':db[_0x5572('0x108')],'as':_0x5572('0x108'),'include':[{'model':db[_0x5572('0x108')],'as':_0x5572('0x109'),'attributes':['id',_0x5572('0x106')],'raw':!![]}]}]})[_0x5572('0x32')](handleEntityNotFound(_0x11b926,null))['then'](function(_0x32d8f1){if(_0x32d8f1){_0x489b6e=_0x32d8f1;return _0x32d8f1[_0x5572('0x10a')]({'raw':!![]});}})[_0x5572('0x32')](function(_0x2a02ec){if(_0x489b6e){if(_0x2a02ec){_0x527ea7=_0x2a02ec;}}return require(_0x5572('0x10b'))[_0x5572('0x77')]();})['then'](function(_0x264749){if(_0x264749){_0x174fe1=_0x264749[_0x5572('0x10c')];_0x77817c=_0x264749[_0x5572('0x78')];}})['then'](function(){return db[_0x5572('0xb5')][_0x5572('0x2d')]({'where':{'closed':![]}});})['then'](function(_0xda97cc){_0x49bd89=_0xda97cc;if(_0x174fe1&&_0xda97cc>_0x174fe1){return db[_0x5572('0x10d')]['findOne']({'where':{'id':0x1}})[_0x5572('0x32')](function(_0x2f455f){if(_0x2f455f){_0x2f455f['increment'](_0x5572('0x10e'));}});}})[_0x5572('0x32')](function(){if(_0x489b6e['Interval']&&_0x489b6e[_0x5572('0x108')][_0x5572('0x109')]){var _0x5cf603=[];for(var _0xa7dc6c=0x0;_0xa7dc6c<_0x489b6e[_0x5572('0x108')][_0x5572('0x109')][_0x5572('0x49')];_0xa7dc6c++){var _0x2f0dc7=_0x489b6e[_0x5572('0x108')][_0x5572('0x109')][_0xa7dc6c][_0x5572('0x34')]({'plain':!![]});_0x5cf603[_0x5572('0x10f')](iftimePromise(_0x2f0dc7,_0x489b6e));}return BPromise[_0x5572('0x110')](_0x5cf603)[_0x5572('0x32')](function(_0x7b9c31){return _[_0x5572('0x111')](_0x7b9c31);});}else{return!![];}})[_0x5572('0x32')](function(_0x257795){var _0x2e02f3=fs[_0x5572('0xcf')](path[_0x5572('0x75')](config['root'],_0x5572('0x112')),_0x5572('0xd0'));var _0x5d27a4={'remote':_0x489b6e[_0x5572('0x113')],'query':querystring['stringify'](_[_0x5572('0x50')](_0x489b6e[_0x5572('0x34')]({'plain':!![]}),{'customerIp':_0x4a1d3f[_0x5572('0x86')][_0x5572('0xa8')]||_0x4a1d3f['headers'][_0x5572('0x114')]||_0x4a1d3f['connection'][_0x5572('0x115')]||_0x4a1d3f['ip'],'referer':_0x4a1d3f[_0x5572('0x86')][_0x5572('0x116')],'openedInteractions':_0x49bd89,'maxInteractions':_0x174fe1,'virtual':_0x77817c['virtual'],'online':_0x257795,'custom':_0x77817c}))[_0x5572('0x117')](/'/g,'\x5c\x27')};_0x11b926[_0x5572('0x3a')](ejs[_0x5572('0x118')](Mustache[_0x5572('0x118')](_0x2e02f3,_0x5d27a4),{'proactiveActions':_0x527ea7,'alignment':_0x489b6e[_0x5572('0x119')],'verticalAlignment':_0x489b6e[_0x5572('0x11a')],'div_color':_0x489b6e[_0x5572('0xfc')],'text_color':_0x489b6e[_0x5572('0x11b')],'button_color':_0x489b6e[_0x5572('0x11c')],'background_color':_0x489b6e[_0x5572('0x11d')]}));})[_0x5572('0x26')](handleError(_0x11b926,null));};exports[_0x5572('0x11e')]=function(_0x111538,_0x20b2e7,_0x246a0a){return db[_0x5572('0x3f')][_0x5572('0x6a')]({'where':{'id':_0x111538['params']['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x20b2e7,null))['then'](function(_0x35b1ad){if(_0x35b1ad){return db[_0x5572('0xda')][_0x5572('0x11f')](function(_0x401c9a){return db['ChatApplication'][_0x5572('0x33')]({'where':{'ChatWebsiteId':_0x111538['params']['id']},'transaction':_0x401c9a})[_0x5572('0x32')](function(_0x1f6196){var _0x1b6be0=_[_0x5572('0x3e')](_0x111538['body'],function(_0x3f55af){_0x3f55af[_0x5572('0x62')]=_0x111538[_0x5572('0x60')]['id'];return _0x3f55af;});return db['ChatApplication'][_0x5572('0xdc')](_0x1b6be0,{'transaction':_0x401c9a});});})[_0x5572('0x32')](function(){return db['ChatApplication'][_0x5572('0x120')]({'where':{'ChatWebsiteId':_0x111538[_0x5572('0x60')]['id']},'order':_0x5572('0xa2')});});}})[_0x5572('0x32')](respondWithResult(_0x20b2e7,null))['catch'](handleError(_0x20b2e7,null));};exports['getApplications']=function(_0x50feda,_0xb28511,_0x4f85e9){var _0x38dcaf={};var _0x2746f7={};var _0x165e18;var _0x39e8c2;return db[_0x5572('0x3f')][_0x5572('0x6a')]({'where':{'id':_0x50feda['params']['id']}})[_0x5572('0x32')](handleEntityNotFound(_0xb28511,null))[_0x5572('0x32')](function(_0x503c7e){if(_0x503c7e){_0x165e18=_0x503c7e;_0x2746f7[_0x5572('0x43')]=_[_0x5572('0x59')](db[_0x5572('0x9c')]['rawAttributes']);_0x2746f7['query']=_[_0x5572('0x59')](_0x50feda[_0x5572('0x44')]);_0x2746f7['filters']=_['intersection'](_0x2746f7[_0x5572('0x43')],_0x2746f7[_0x5572('0x44')]);_0x38dcaf[_0x5572('0x48')]=_[_0x5572('0x46')](_0x2746f7[_0x5572('0x43')],qs[_0x5572('0x47')](_0x50feda[_0x5572('0x44')][_0x5572('0x47')]));_0x38dcaf['attributes']=_0x38dcaf['attributes'][_0x5572('0x49')]?_0x38dcaf[_0x5572('0x48')]:_0x2746f7[_0x5572('0x43')];_0x38dcaf[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x50feda[_0x5572('0x44')][_0x5572('0x4d')]);_0x38dcaf[_0x5572('0x4e')]=qs['filters'](_['pick'](_0x50feda['query'],_0x2746f7[_0x5572('0x45')]));if(_0x50feda[_0x5572('0x44')][_0x5572('0x4f')]){_0x38dcaf[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x38dcaf['where'],{'$or':_['map'](_0x38dcaf['attributes'],function(_0x3cc96d){var _0x12031={};_0x12031[_0x3cc96d]={'$like':'%'+_0x50feda[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x12031;})});}_0x38dcaf=_[_0x5572('0x50')]({},_0x38dcaf,_0x50feda['options']);return _0x165e18['getApplications'](_0x38dcaf);}})['then'](function(_0x165f28){if(_0x165f28){_0x39e8c2=_0x165f28['length'];if(!_0x50feda[_0x5572('0x44')]['hasOwnProperty']('nolimit')){_0x38dcaf[_0x5572('0x2c')]=qs[_0x5572('0x2c')](_0x50feda['query'][_0x5572('0x2c')]);_0x38dcaf[_0x5572('0x2a')]=qs[_0x5572('0x2a')](_0x50feda['query']['offset']);}return _0x165e18[_0x5572('0x121')](_0x38dcaf);}})[_0x5572('0x32')](function(_0x2cc4b8){if(_0x2cc4b8){return _0x2cc4b8?{'count':_0x39e8c2,'rows':_0x2cc4b8}:null;}})[_0x5572('0x32')](respondWithResult(_0xb28511,null))[_0x5572('0x26')](handleError(_0xb28511,null));};exports[_0x5572('0x122')]=function(_0x535999,_0x29da52,_0x4e22f4){return db[_0x5572('0x123')]['find']({'where':{'id':_0x535999[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x29da52,null))[_0x5572('0x32')](function(_0x1c3186){if(_0x1c3186){return _0x1c3186[_0x5572('0x122')](_0x535999[_0x5572('0x5b')][_0x5572('0x66')],_[_0x5572('0xf6')](_0x535999[_0x5572('0x5b')],[_0x5572('0x66'),'id'])||{});}})[_0x5572('0x32')](respondWithResult(_0x29da52,null))[_0x5572('0x26')](handleError(_0x29da52,null));};exports[_0x5572('0x10a')]=function(_0x74e540,_0x37df3a,_0x236cb5){var _0x5adfe1={};var _0x4284ba={};var _0x150768;var _0x1a7900;return db[_0x5572('0x3f')]['findOne']({'where':{'id':_0x74e540[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x37df3a,null))[_0x5572('0x32')](function(_0x2c47a7){if(_0x2c47a7){_0x150768=_0x2c47a7;_0x4284ba[_0x5572('0x43')]=_[_0x5572('0x59')](db['ChatProactiveAction'][_0x5572('0x40')]);_0x4284ba['query']=_['keys'](_0x74e540[_0x5572('0x44')]);_0x4284ba['filters']=_[_0x5572('0x46')](_0x4284ba[_0x5572('0x43')],_0x4284ba[_0x5572('0x44')]);_0x5adfe1[_0x5572('0x48')]=_[_0x5572('0x46')](_0x4284ba['model'],qs['fields'](_0x74e540['query'][_0x5572('0x47')]));_0x5adfe1[_0x5572('0x48')]=_0x5adfe1[_0x5572('0x48')][_0x5572('0x49')]?_0x5adfe1[_0x5572('0x48')]:_0x4284ba['model'];_0x5adfe1['order']=qs[_0x5572('0x4d')](_0x74e540[_0x5572('0x44')][_0x5572('0x4d')]);_0x5adfe1['where']=qs[_0x5572('0x45')](_[_0x5572('0x64')](_0x74e540[_0x5572('0x44')],_0x4284ba['filters']));if(_0x74e540[_0x5572('0x44')][_0x5572('0x4f')]){_0x5adfe1[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x5adfe1[_0x5572('0x4e')],{'$or':_[_0x5572('0x3e')](_0x5adfe1[_0x5572('0x48')],function(_0x256966){var _0x2046cc={};_0x2046cc[_0x256966]={'$like':'%'+_0x74e540[_0x5572('0x44')]['filter']+'%'};return _0x2046cc;})});}_0x5adfe1=_[_0x5572('0x50')]({},_0x5adfe1,_0x74e540[_0x5572('0x53')]);return _0x150768['getProactiveActions'](_0x5adfe1);}})['then'](function(_0x407c13){if(_0x407c13){_0x1a7900=_0x407c13[_0x5572('0x49')];if(!_0x74e540[_0x5572('0x44')][_0x5572('0x4a')](_0x5572('0x4b'))){_0x5adfe1['limit']=qs['limit'](_0x74e540[_0x5572('0x44')]['limit']);_0x5adfe1[_0x5572('0x2a')]=qs[_0x5572('0x2a')](_0x74e540['query'][_0x5572('0x2a')]);}return _0x150768[_0x5572('0x10a')](_0x5adfe1);}})[_0x5572('0x32')](function(_0x5ae781){if(_0x5ae781){return _0x5ae781?{'count':_0x1a7900,'rows':_0x5ae781}:null;}})[_0x5572('0x32')](respondWithResult(_0x37df3a,null))[_0x5572('0x26')](handleError(_0x37df3a,null));};exports[_0x5572('0x124')]=function(_0x436276,_0x509cf3,_0xc71fe1){var _0x543072=_0x436276['query'][_0x5572('0x125')]===_0x5572('0x126')?_0x5572('0x127'):'onlineForm';return db['ChatWebsite'][_0x5572('0x5e')]({'attributes':['id',_0x543072],'where':{'id':_0x436276[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x509cf3,null))[_0x5572('0x32')](function(_0x218602){if(_0x218602){var _0x4e1c62=_0x218602[_0x543072];var _0x9d58bb=_0x4e1c62&&_0x4e1c62[_0x5572('0x128')]?_0x4e1c62[_0x5572('0x128')]:[];_0x509cf3[_0x5572('0x3a')]({'fromKey':_[_0x5572('0x7c')](_0x4e1c62[_0x5572('0x129')])?undefined:_0x4e1c62['fromKey'],'count':_0x9d58bb['length'],'rows':_0x9d58bb});}})[_0x5572('0x26')](handleError(_0x509cf3,null));};exports[_0x5572('0x12a')]=function(_0x4cf87a,_0x20605d,_0x8eb893){var _0x5256df={'raw':![],'where':{}};var _0x29ce9f={};var _0x100729={'count':0x0,'rows':[]};return db[_0x5572('0x3f')][_0x5572('0x6a')]({'where':{'id':_0x4cf87a[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x20605d,null))[_0x5572('0x32')](function(_0x34a35a){if(_0x34a35a){_0x29ce9f['model']=_['keys'](db[_0x5572('0xd3')][_0x5572('0x40')]);_0x29ce9f['query']=_[_0x5572('0x59')](_0x4cf87a['query']);_0x29ce9f[_0x5572('0x45')]=_[_0x5572('0x46')](_0x29ce9f[_0x5572('0x43')],_0x29ce9f[_0x5572('0x44')]);_0x5256df[_0x5572('0x48')]=_[_0x5572('0x46')](_0x29ce9f[_0x5572('0x43')],qs[_0x5572('0x47')](_0x4cf87a[_0x5572('0x44')][_0x5572('0x47')]));_0x5256df[_0x5572('0x48')]=_0x5256df['attributes'][_0x5572('0x49')]?_0x5256df[_0x5572('0x48')]:_0x29ce9f['model'];if(!_0x4cf87a[_0x5572('0x44')]['hasOwnProperty']('nolimit')){_0x5256df[_0x5572('0x2c')]=qs[_0x5572('0x2c')](_0x4cf87a[_0x5572('0x44')][_0x5572('0x2c')]);_0x5256df[_0x5572('0x2a')]=qs[_0x5572('0x2a')](_0x4cf87a['query'][_0x5572('0x2a')]);}_0x5256df[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x4cf87a[_0x5572('0x44')][_0x5572('0x4d')]);_0x5256df[_0x5572('0x4e')]=qs[_0x5572('0x45')](_['pick'](_0x4cf87a['query'],_0x29ce9f[_0x5572('0x45')]));_0x5256df[_0x5572('0x4e')]['ChatWebsiteId']=_0x34a35a['id'];if(_0x4cf87a[_0x5572('0x44')][_0x5572('0x4f')]){_0x5256df[_0x5572('0x4e')]=_[_0x5572('0x50')](_0x5256df['where'],{'$or':_[_0x5572('0x3e')](_0x5256df[_0x5572('0x48')],function(_0x432e44){var _0x33dea2={};_0x33dea2[_0x432e44]={'$like':'%'+_0x4cf87a[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x33dea2;})});}_0x5256df=_[_0x5572('0x50')]({},_0x5256df,_0x4cf87a['options']);return db['ChatOfflineMessage'][_0x5572('0x2d')]({'where':_0x5256df['where']})[_0x5572('0x32')](function(_0x2d249c){_0x100729[_0x5572('0x2d')]=_0x2d249c;if(_0x4cf87a[_0x5572('0x44')][_0x5572('0x54')]){_0x5256df['include']=[{'all':!![]}];}else{_0x5256df['include']=[{'model':db[_0x5572('0x89')],'as':_0x5572('0x12b'),'required':![]},{'model':db[_0x5572('0xdb')],'as':'Attachments','required':![]}];}return db[_0x5572('0xd3')][_0x5572('0x56')](_0x5256df);})[_0x5572('0x32')](function(_0x14abfc){_0x100729[_0x5572('0x57')]=_0x14abfc;return _0x100729;});}})[_0x5572('0x32')](respondWithFilteredResult(_0x20605d,_0x5256df))['catch'](handleError(_0x20605d,null));};exports[_0x5572('0x12c')]=function(_0x305106,_0x4c8d26,_0x11aed8){return db[_0x5572('0x3f')][_0x5572('0x5e')]({'where':{'id':_0x305106['params']['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x4c8d26,null))[_0x5572('0x32')](function(_0x1eee02){if(_0x1eee02){return _0x1eee02[_0x5572('0x12c')](_0x305106[_0x5572('0x5b')][_0x5572('0x66')],_[_0x5572('0xf6')](_0x305106[_0x5572('0x5b')],[_0x5572('0x66'),'id'])||{})[_0x5572('0xb8')](function(_0x4bdd50){for(var _0x5c5875=0x0;_0x5c5875<_0x305106[_0x5572('0x5b')][_0x5572('0x66')]['length'];_0x5c5875+=0x1){socket[_0x5572('0x12d')](_0x5572('0x12e'),{'UserId':Number(_0x305106['body'][_0x5572('0x66')][_0x5c5875]),'ChatWebsiteId':Number(_0x305106[_0x5572('0x60')]['id'])});}return _0x4bdd50;});}})[_0x5572('0x32')](respondWithResult(_0x4c8d26,null))['catch'](handleError(_0x4c8d26,null));};exports[_0x5572('0x12f')]=function(_0x3c53e8,_0x3f1683,_0xc72fe8){return db[_0x5572('0x3f')]['find']({'where':{'id':_0x3c53e8['params']['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x3f1683,null))[_0x5572('0x32')](function(_0x357357){if(_0x357357){return _0x357357['removeAgents'](_0x3c53e8[_0x5572('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x3c53e8['query']['ids'])){for(var _0x4369da=0x0;_0x4369da<_0x3c53e8[_0x5572('0x44')][_0x5572('0x66')][_0x5572('0x49')];_0x4369da+=0x1){socket[_0x5572('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x3c53e8['query'][_0x5572('0x66')][_0x4369da]),'ChatWebsiteId':Number(_0x3c53e8[_0x5572('0x60')]['id'])});}}else{socket['emit'](_0x5572('0x130'),{'UserId':Number(_0x3c53e8[_0x5572('0x44')][_0x5572('0x66')]),'ChatWebsiteId':Number(_0x3c53e8[_0x5572('0x60')]['id'])});}});}})[_0x5572('0x32')](respondWithStatusCode(_0x3f1683,null))[_0x5572('0x26')](handleError(_0x3f1683,null));};exports['getAgents']=function(_0x568f0c,_0x185939,_0x548e36){var _0xd6814b={};var _0xd7d7aa={};var _0x25fd17;var _0x4d39d6;return db[_0x5572('0x3f')][_0x5572('0x6a')]({'where':{'id':_0x568f0c[_0x5572('0x60')]['id']}})[_0x5572('0x32')](handleEntityNotFound(_0x185939,null))[_0x5572('0x32')](function(_0x134d69){if(_0x134d69){_0x25fd17=_0x134d69;_0xd7d7aa[_0x5572('0x43')]=_[_0x5572('0x59')](db['User'][_0x5572('0x40')]);_0xd7d7aa[_0x5572('0x44')]=_['keys'](_0x568f0c['query']);_0xd7d7aa[_0x5572('0x45')]=_['intersection'](_0xd7d7aa[_0x5572('0x43')],_0xd7d7aa['query']);_0xd6814b[_0x5572('0x48')]=_[_0x5572('0x46')](_0xd7d7aa[_0x5572('0x43')],qs[_0x5572('0x47')](_0x568f0c[_0x5572('0x44')][_0x5572('0x47')]));_0xd6814b[_0x5572('0x48')]=_0xd6814b[_0x5572('0x48')]['length']?_0xd6814b[_0x5572('0x48')]:_0xd7d7aa[_0x5572('0x43')];_0xd6814b[_0x5572('0x4c')]=qs[_0x5572('0x4d')](_0x568f0c[_0x5572('0x44')][_0x5572('0x4d')]);_0xd6814b['where']=qs[_0x5572('0x45')](_[_0x5572('0x64')](_0x568f0c[_0x5572('0x44')],_0xd7d7aa['filters']));if(_0x568f0c[_0x5572('0x44')][_0x5572('0x4f')]){_0xd6814b['where']=_['merge'](_0xd6814b['where'],{'$or':_[_0x5572('0x3e')](_0xd6814b[_0x5572('0x48')],function(_0x400ae1){var _0x4e6c28={};_0x4e6c28[_0x400ae1]={'$like':'%'+_0x568f0c[_0x5572('0x44')][_0x5572('0x4f')]+'%'};return _0x4e6c28;})});}_0xd6814b=_[_0x5572('0x50')]({},_0xd6814b,_0x568f0c[_0x5572('0x53')]);return _0x25fd17[_0x5572('0x131')](_0xd6814b);}})[_0x5572('0x32')](function(_0x589b41){if(_0x589b41){_0x4d39d6=_0x589b41[_0x5572('0x49')];if(!_0x568f0c['query'][_0x5572('0x4a')](_0x5572('0x4b'))){_0xd6814b[_0x5572('0x2c')]=qs[_0x5572('0x2c')](_0x568f0c[_0x5572('0x44')][_0x5572('0x2c')]);_0xd6814b[_0x5572('0x2a')]=qs['offset'](_0x568f0c[_0x5572('0x44')][_0x5572('0x2a')]);}return _0x25fd17[_0x5572('0x131')](_0xd6814b);}})[_0x5572('0x32')](function(_0x1ebafe){if(_0x1ebafe){return _0x1ebafe?{'count':_0x4d39d6,'rows':_0x1ebafe}:null;}})[_0x5572('0x32')](respondWithResult(_0x185939,null))['catch'](handleError(_0x185939,null));};
\ No newline at end of file
+var _0x6e9f=['referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','color_button','addApplications','transaction','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','ChatWebsite','findAll','rows','show','params','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','Disposition','findOne','includeAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','isNil','existsSync','join','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','Contacts','ListId','contact','x-forwarded-for','split','firstName','lastName','x-real-port'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6e9f,0x1ac));var _0xf6e9=function(_0x9d520b,_0x5dc955){_0x9d520b=_0x9d520b-0x0;var _0x119126=_0x6e9f[_0x9d520b];return _0x119126;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e9('0x0'));var zipdir=require(_0xf6e9('0x1'));var jsonpatch=require(_0xf6e9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6e9('0x3'));var Mustache=require(_0xf6e9('0x4'));var util=require(_0xf6e9('0x5'));var path=require('path');var sox=require(_0xf6e9('0x6'));var csv=require('to-csv');var ejs=require(_0xf6e9('0x7'));var fs=require('fs');var fs_extra=require(_0xf6e9('0x8'));var _=require(_0xf6e9('0x9'));var squel=require('squel');var crypto=require(_0xf6e9('0xa'));var jsforce=require(_0xf6e9('0xb'));var deskjs=require(_0xf6e9('0xc'));var toCsv=require(_0xf6e9('0xd'));var querystring=require(_0xf6e9('0xe'));var Papa=require(_0xf6e9('0xf'));var Redis=require(_0xf6e9('0x10'));var authService=require(_0xf6e9('0x11'));var qs=require(_0xf6e9('0x12'));var as=require(_0xf6e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf6e9('0x14'));var utils=require(_0xf6e9('0x15'));var config=require(_0xf6e9('0x16'));var licenseUtil=require(_0xf6e9('0x17'));var db=require(_0xf6e9('0x18'))['db'];config[_0xf6e9('0x19')]=_[_0xf6e9('0x1a')](config['redis'],{'host':_0xf6e9('0x1b'),'port':0x18eb});var socket=require(_0xf6e9('0x1c'))(new Redis(config[_0xf6e9('0x19')]));require('./chatWebsite.socket')[_0xf6e9('0x1d')](socket);var jayson=require(_0xf6e9('0x1e'));var client=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232c});var client9002=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232a});var client9003=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x232b});var client9001=jayson[_0xf6e9('0x1f')][_0xf6e9('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x3cc5f2,_0xfa63db,_0x47d9d1,_0x550db6){return new BPromise(function(_0x863c76,_0xe11c0){var _0x12ae70=_0x550db6||client;return _0x12ae70[_0xf6e9('0x21')](_0x3cc5f2,_0x47d9d1)[_0xf6e9('0x22')](function(_0x33fc4b){logger[_0xf6e9('0x23')](_0xf6e9('0x24'),_0xfa63db,'request\x20sent');logger['debug'](_0xf6e9('0x25'),_0xfa63db,_0xf6e9('0x26'),JSON[_0xf6e9('0x27')](_0x33fc4b));if(_0x33fc4b[_0xf6e9('0x28')]){if(_0x33fc4b['error'][_0xf6e9('0x29')]===0x1f4){logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b[_0xf6e9('0x28')][_0xf6e9('0x2a')]);return _0xe11c0(_0x33fc4b['error'][_0xf6e9('0x2a')]);}logger[_0xf6e9('0x28')](_0xf6e9('0x24'),_0xfa63db,_0x33fc4b['error'][_0xf6e9('0x2a')]);return _0x863c76(_0x33fc4b[_0xf6e9('0x28')]['message']);}else{logger[_0xf6e9('0x23')]('ChatWebsite,\x20%s,\x20%s',_0xfa63db,_0xf6e9('0x26'));_0x863c76(_0x33fc4b['result'][_0xf6e9('0x2a')]);}})[_0xf6e9('0x2b')](function(_0x15b95f){logger['error'](_0xf6e9('0x24'),_0xfa63db,_0x15b95f);_0xe11c0(_0x15b95f);});});}function respondWithStatusCode(_0x2c41d1,_0x548008){_0x548008=_0x548008||0xcc;return function(_0xb10a27){if(_0xb10a27){return _0x2c41d1[_0xf6e9('0x2c')](_0x548008);}return _0x2c41d1['status'](_0x548008)[_0xf6e9('0x2d')]();};}function respondWithResult(_0x3c46df,_0x21e7a0){_0x21e7a0=_0x21e7a0||0xc8;return function(_0x45992a){if(_0x45992a){return _0x3c46df[_0xf6e9('0x2e')](_0x21e7a0)['json'](_0x45992a);}};}function respondWithFilteredResult(_0x233eb4,_0x33a4e5){return function(_0x5d61ca){if(_0x5d61ca){var _0x1c1baa=typeof _0x33a4e5[_0xf6e9('0x2f')]===_0xf6e9('0x30')&&typeof _0x33a4e5[_0xf6e9('0x31')]===_0xf6e9('0x30');var _0x228fd4=_0x5d61ca[_0xf6e9('0x32')];var _0x2fa96d=_0x1c1baa?0x0:_0x33a4e5[_0xf6e9('0x2f')];var _0x3a4ae0=_0x1c1baa?_0x5d61ca[_0xf6e9('0x32')]:_0x33a4e5['offset']+_0x33a4e5['limit'];var _0x4681dd;if(_0x3a4ae0>=_0x228fd4){_0x3a4ae0=_0x228fd4;_0x4681dd=0xc8;}else{_0x4681dd=0xce;}_0x233eb4[_0xf6e9('0x2e')](_0x4681dd);return _0x233eb4[_0xf6e9('0x33')](_0xf6e9('0x34'),_0x2fa96d+'-'+_0x3a4ae0+'/'+_0x228fd4)['json'](_0x5d61ca);}return null;};}function patchUpdates(_0x477d87){return function(_0x391ce7){try{jsonpatch[_0xf6e9('0x35')](_0x391ce7,_0x477d87,!![]);}catch(_0x4891b1){return BPromise['reject'](_0x4891b1);}return _0x391ce7['save']();};}function saveUpdates(_0x59e917,_0x28450a){return function(_0x34851f){if(_0x34851f){return _0x34851f[_0xf6e9('0x36')](_0x59e917)[_0xf6e9('0x22')](function(_0x370ad2){return _0x370ad2;});}return null;};}function removeEntity(_0x3564e8,_0x3bc73d){return function(_0xb61f30){if(_0xb61f30){return _0xb61f30[_0xf6e9('0x37')]()[_0xf6e9('0x22')](function(){var _0x25c6cb=_0xb61f30[_0xf6e9('0x38')]({'plain':!![]});var _0xd47a0e=_0xf6e9('0x39');return db[_0xf6e9('0x3a')][_0xf6e9('0x37')]({'where':{'type':_0xd47a0e,'resourceId':_0x25c6cb['id']}})['then'](function(){return _0xb61f30;});})[_0xf6e9('0x22')](function(){_0x3564e8[_0xf6e9('0x2e')](0xcc)[_0xf6e9('0x2d')]();});}};}function handleEntityNotFound(_0x5ea49b,_0x2aac78){return function(_0x1e2791){if(!_0x1e2791){_0x5ea49b[_0xf6e9('0x2c')](0x194);}return _0x1e2791;};}function handleError(_0x56b950,_0xe06593){_0xe06593=_0xe06593||0x1f4;return function(_0x891fdf){logger[_0xf6e9('0x28')](_0x891fdf[_0xf6e9('0x3b')]);if(_0x891fdf['name']){delete _0x891fdf['name'];}_0x56b950[_0xf6e9('0x2e')](_0xe06593)[_0xf6e9('0x3c')](_0x891fdf);};}exports[_0xf6e9('0x3d')]=function(_0x53c109,_0xdf5475){var _0x1547ab={'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x373377={},_0x1d61ec={'count':0x0,'rows':[]};var _0xc1509b=_[_0xf6e9('0x40')](db['ChatWebsite'][_0xf6e9('0x41')],function(_0x4fbeb6){return{'name':_0x4fbeb6['fieldName'],'type':_0x4fbeb6[_0xf6e9('0x42')][_0xf6e9('0x43')]};});_0x373377['model']=_[_0xf6e9('0x40')](_0xc1509b,_0xf6e9('0x44'));_0x373377[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x53c109['query']);_0x373377[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x373377[_0xf6e9('0x49')],_0x373377[_0xf6e9('0x45')]);_0x1547ab[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x373377['model'],qs[_0xf6e9('0x4b')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x1547ab[_0xf6e9('0x4a')]=_0x1547ab['attributes'][_0xf6e9('0x4c')]?_0x1547ab[_0xf6e9('0x4a')]:_0x373377[_0xf6e9('0x49')];if(!_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x1547ab[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x1547ab[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1547ab[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x1547ab[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x53c109[_0xf6e9('0x45')],_0x373377[_0xf6e9('0x47')]),_0xc1509b);if(_0x53c109[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x1547ab[_0xf6e9('0x51')]=_['merge'](_0x1547ab[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xc1509b,function(_0x1d3067){if(_0x1d3067[_0xf6e9('0x42')]!==_0xf6e9('0x54')){var _0x565389={};_0x565389[_0x1d3067[_0xf6e9('0x44')]]={'$like':'%'+_0x53c109['query'][_0xf6e9('0x53')]+'%'};return _0x565389;}})});}_0x1547ab=_['merge']({},_0x1547ab,_0x53c109[_0xf6e9('0x55')]);var _0x306b94={'where':_0x1547ab[_0xf6e9('0x51')]};return db['ChatWebsite'][_0xf6e9('0x32')](_0x306b94)[_0xf6e9('0x22')](function(_0x8e38ec){_0x1d61ec['count']=_0x8e38ec;if(_0x53c109[_0xf6e9('0x45')]['includeAll']){_0x1547ab['include']=[{'all':!![]}];}return db[_0xf6e9('0x56')][_0xf6e9('0x57')](_0x1547ab);})['then'](function(_0x18e45e){_0x1d61ec[_0xf6e9('0x58')]=_0x18e45e;return _0x1d61ec;})[_0xf6e9('0x22')](respondWithFilteredResult(_0xdf5475,_0x1547ab))[_0xf6e9('0x2b')](handleError(_0xdf5475,null));};exports[_0xf6e9('0x59')]=function(_0xe92d20,_0x36d417){var _0x4d63a0={'raw':![],'where':{'id':_0xe92d20[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]},_0x1782e6={};_0x1782e6[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x56')]['rawAttributes']);_0x1782e6[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0xe92d20[_0xf6e9('0x45')]);_0x1782e6[_0xf6e9('0x47')]=_['intersection'](_0x1782e6[_0xf6e9('0x49')],_0x1782e6[_0xf6e9('0x45')]);_0x4d63a0[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x1782e6[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0xe92d20[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4d63a0[_0xf6e9('0x4a')]=_0x4d63a0[_0xf6e9('0x4a')]['length']?_0x4d63a0[_0xf6e9('0x4a')]:_0x1782e6[_0xf6e9('0x49')];if(_0xe92d20[_0xf6e9('0x45')]['includeAll']){_0x4d63a0[_0xf6e9('0x5b')]=[{'all':!![]}];}_0x4d63a0=_[_0xf6e9('0x5c')]({},_0x4d63a0,_0xe92d20['options']);return db['ChatWebsite'][_0xf6e9('0x5d')](_0x4d63a0)[_0xf6e9('0x22')](handleEntityNotFound(_0x36d417,null))[_0xf6e9('0x22')](respondWithResult(_0x36d417,null))[_0xf6e9('0x2b')](handleError(_0x36d417,null));};exports[_0xf6e9('0x5e')]=function(_0xfd7321,_0x44bee3){return db[_0xf6e9('0x56')][_0xf6e9('0x5e')](_0xfd7321[_0xf6e9('0x5f')],{})['then'](function(_0x2d5ec5){var _0x297c07=_0xfd7321[_0xf6e9('0x60')][_0xf6e9('0x38')]({'plain':!![]});if(!_0x297c07)throw new Error(_0xf6e9('0x61'));if(_0x297c07[_0xf6e9('0x62')]===_0xf6e9('0x60')){var _0x5ddc3c=_0x2d5ec5[_0xf6e9('0x38')]({'plain':!![]});var _0x371764='ChatWebsites';return db[_0xf6e9('0x63')]['find']({'where':{'name':_0x371764,'userProfileId':_0x297c07['userProfileId']},'raw':!![]})['then'](function(_0xe83822){if(_0xe83822&&_0xe83822[_0xf6e9('0x64')]===0x0){return db[_0xf6e9('0x3a')][_0xf6e9('0x5e')]({'name':_0x5ddc3c[_0xf6e9('0x44')],'resourceId':_0x5ddc3c['id'],'type':_0xe83822[_0xf6e9('0x44')],'sectionId':_0xe83822['id']},{})['then'](function(){return _0x2d5ec5;});}else{return _0x2d5ec5;}})[_0xf6e9('0x2b')](function(_0x2db5f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db5f4);throw _0x2db5f4;});}return _0x2d5ec5;})[_0xf6e9('0x22')](respondWithResult(_0x44bee3,0xc9))[_0xf6e9('0x2b')](handleError(_0x44bee3,null));};exports[_0xf6e9('0x36')]=function(_0x40745d,_0xaf8706){if(_0x40745d[_0xf6e9('0x5f')]['id']){delete _0x40745d[_0xf6e9('0x5f')]['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x40745d[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x3e')],'as':_0xf6e9('0x3f')}]})['then'](handleEntityNotFound(_0xaf8706,null))[_0xf6e9('0x22')](saveUpdates(_0x40745d['body'],null))[_0xf6e9('0x22')](respondWithResult(_0xaf8706,null))[_0xf6e9('0x2b')](handleError(_0xaf8706,null));};exports[_0xf6e9('0x37')]=function(_0x57583b,_0x354509){return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x57583b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x354509,null))[_0xf6e9('0x22')](removeEntity(_0x354509,null))[_0xf6e9('0x2b')](handleError(_0x354509,null));};exports[_0xf6e9('0x65')]=function(_0x5e67f3,_0xebd1ea){return db[_0xf6e9('0x56')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](respondWithResult(_0xebd1ea,null))[_0xf6e9('0x2b')](handleError(_0xebd1ea,null));};exports[_0xf6e9('0x66')]=function(_0x529591,_0x44728b,_0x4c6638){if(_0x529591[_0xf6e9('0x5f')]['id']){delete _0x529591['body']['id'];}return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x529591['params']['id']}})['then'](handleEntityNotFound(_0x44728b,null))['then'](function(_0xe4b85f){if(_0xe4b85f){_0x529591[_0xf6e9('0x5f')]['ChatWebsiteId']=_0xe4b85f['id'];return db[_0xf6e9('0x67')][_0xf6e9('0x5e')](_0x529591[_0xf6e9('0x5f')]);}})[_0xf6e9('0x22')](respondWithResult(_0x44728b,null))[_0xf6e9('0x2b')](handleError(_0x44728b,null));};exports['getDispositions']=function(_0x40ab4d,_0x142cce,_0x143bdc){var _0xbd2f8f={'raw':![],'where':{}};var _0x4bfa25={};var _0x1a9afa={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x40ab4d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x142cce,null))[_0xf6e9('0x22')](function(_0x4a7342){if(_0x4a7342){_0x4bfa25[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['Disposition']['rawAttributes']);_0x4bfa25[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x40ab4d[_0xf6e9('0x45')]);_0x4bfa25[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x4bfa25[_0xf6e9('0x49')],_0x4bfa25[_0xf6e9('0x45')]);_0xbd2f8f[_0xf6e9('0x4a')]=_['intersection'](_0x4bfa25[_0xf6e9('0x49')],qs[_0xf6e9('0x4b')](_0x40ab4d[_0xf6e9('0x45')]['fields']));_0xbd2f8f[_0xf6e9('0x4a')]=_0xbd2f8f['attributes'][_0xf6e9('0x4c')]?_0xbd2f8f['attributes']:_0x4bfa25[_0xf6e9('0x49')];if(!_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0xbd2f8f['limit']=qs[_0xf6e9('0x31')](_0x40ab4d['query'][_0xf6e9('0x31')]);_0xbd2f8f[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0xbd2f8f[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x40ab4d[_0xf6e9('0x45')]['sort']);_0xbd2f8f[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_['pick'](_0x40ab4d['query'],_0x4bfa25[_0xf6e9('0x47')]));_0xbd2f8f[_0xf6e9('0x51')]['ChatWebsiteId']=_0x4a7342['id'];if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0xbd2f8f[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0xbd2f8f[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0xbd2f8f[_0xf6e9('0x4a')],function(_0xbf2451){var _0x22e692={};_0x22e692[_0xbf2451]={'$like':'%'+_0x40ab4d[_0xf6e9('0x45')]['filter']+'%'};return _0x22e692;})});}_0xbd2f8f=_[_0xf6e9('0x5c')]({},_0xbd2f8f,_0x40ab4d['options']);return db['Disposition']['count']({'where':_0xbd2f8f[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4aea88){_0x1a9afa[_0xf6e9('0x32')]=_0x4aea88;if(_0x40ab4d[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0xbd2f8f[_0xf6e9('0x5b')]=[{'all':!![]}];}return db[_0xf6e9('0x67')][_0xf6e9('0x57')](_0xbd2f8f);})[_0xf6e9('0x22')](function(_0x3098ad){_0x1a9afa[_0xf6e9('0x58')]=_0x3098ad;return _0x1a9afa;});}})['then'](respondWithFilteredResult(_0x142cce,_0xbd2f8f))['catch'](handleError(_0x142cce,null));};exports[_0xf6e9('0x6a')]=function(_0x3a764f,_0x327c13,_0x4edc21){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x3a764f['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x327c13,null))[_0xf6e9('0x22')](function(_0x3f9adb){if(_0x3f9adb){return _0x3f9adb['removeDispositions'](_0x3a764f[_0xf6e9('0x45')][_0xf6e9('0x6b')]);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x327c13,null))['catch'](handleError(_0x327c13,null));};exports[_0xf6e9('0x6c')]=function(_0x476545,_0x33382b,_0x2f9054){if(_0x476545[_0xf6e9('0x5f')]['id']){delete _0x476545[_0xf6e9('0x5f')]['id'];}return db['ChatWebsite'][_0xf6e9('0x5d')]({'where':{'id':_0x476545['params']['id']}})['then'](handleEntityNotFound(_0x33382b,null))[_0xf6e9('0x22')](function(_0x28e99e){if(_0x28e99e){_0x476545['body'][_0xf6e9('0x6d')]=_0x28e99e['id'];return db[_0xf6e9('0x6e')][_0xf6e9('0x5e')](_0x476545['body']);}})[_0xf6e9('0x22')](respondWithResult(_0x33382b,null))['catch'](handleError(_0x33382b,null));};exports[_0xf6e9('0x6f')]=function(_0x195ccb,_0xf7e828,_0x811de){var _0x1ab528={'raw':![],'where':{}};var _0x1e7477={};var _0xb26a12={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x195ccb['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xf7e828,null))[_0xf6e9('0x22')](function(_0x3936a5){if(_0x3936a5){_0x1e7477[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x6e')][_0xf6e9('0x41')]);_0x1e7477[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x195ccb['query']);_0x1e7477['filters']=_[_0xf6e9('0x48')](_0x1e7477[_0xf6e9('0x49')],_0x1e7477[_0xf6e9('0x45')]);_0x1ab528[_0xf6e9('0x4a')]=_['intersection'](_0x1e7477['model'],qs['fields'](_0x195ccb[_0xf6e9('0x45')]['fields']));_0x1ab528[_0xf6e9('0x4a')]=_0x1ab528[_0xf6e9('0x4a')]['length']?_0x1ab528['attributes']:_0x1e7477['model'];if(!_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x1ab528[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x195ccb['query'][_0xf6e9('0x31')]);_0x1ab528[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x1ab528['order']=qs['sort'](_0x195ccb[_0xf6e9('0x45')]['sort']);_0x1ab528[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x195ccb[_0xf6e9('0x45')],_0x1e7477[_0xf6e9('0x47')]));_0x1ab528[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x3936a5['id'];if(_0x195ccb['query'][_0xf6e9('0x53')]){_0x1ab528[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x1ab528['where'],{'$or':_[_0xf6e9('0x40')](_0x1ab528[_0xf6e9('0x4a')],function(_0x2266d6){var _0x526db7={};_0x526db7[_0x2266d6]={'$like':'%'+_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x526db7;})});}_0x1ab528=_[_0xf6e9('0x5c')]({},_0x1ab528,_0x195ccb[_0xf6e9('0x55')]);return db['CannedAnswer'][_0xf6e9('0x32')]({'where':_0x1ab528[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x17a27c){_0xb26a12['count']=_0x17a27c;if(_0x195ccb[_0xf6e9('0x45')][_0xf6e9('0x69')]){_0x1ab528['include']=[{'all':!![]}];}return db[_0xf6e9('0x6e')][_0xf6e9('0x57')](_0x1ab528);})['then'](function(_0x404af1){_0xb26a12['rows']=_0x404af1;return _0xb26a12;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0xf7e828,_0x1ab528))[_0xf6e9('0x2b')](handleError(_0xf7e828,null));};exports[_0xf6e9('0x70')]=function(_0x2f932d,_0x2537a0,_0x3b8ede){return db['ChatWebsite']['find']({'where':{'id':_0x2f932d['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2537a0,null))[_0xf6e9('0x22')](function(_0x5c4d12){if(_0x5c4d12){return _0x5c4d12['removeAnswers'](_0x2f932d[_0xf6e9('0x45')]['ids']);}})[_0xf6e9('0x22')](respondWithStatusCode(_0x2537a0,null))['catch'](handleError(_0x2537a0,null));};exports['addLogo']=function(_0x2273fd,_0x313baa,_0x11e215){_0x2273fd['body'][_0xf6e9('0x71')]=_0x2273fd[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x2273fd[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x313baa,null))[_0xf6e9('0x22')](saveUpdates(_0x2273fd[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x313baa,null))[_0xf6e9('0x2b')](handleError(_0x313baa,null));};exports[_0xf6e9('0x74')]=function(_0x4b7caf,_0x1ed17a,_0x1b9920){_0x4b7caf['body']['agentAvatar']=_0x4b7caf['file'][_0xf6e9('0x73')];return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x4b7caf[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1ed17a,null))[_0xf6e9('0x22')](saveUpdates(_0x4b7caf[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0x1ed17a,null))[_0xf6e9('0x2b')](handleError(_0x1ed17a,null));};exports[_0xf6e9('0x75')]=function(_0x5d84b9,_0xaaf96b,_0x573126){_0x5d84b9['body']['customerAvatar']=_0x5d84b9[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x5d84b9[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0xaaf96b,null))[_0xf6e9('0x22')](saveUpdates(_0x5d84b9[_0xf6e9('0x5f')],null))[_0xf6e9('0x22')](respondWithResult(_0xaaf96b,null))[_0xf6e9('0x2b')](handleError(_0xaaf96b,null));};exports[_0xf6e9('0x76')]=function(_0x21f24a,_0x1f65b2,_0x423886){_0x21f24a['body'][_0xf6e9('0x77')]=_0x21f24a[_0xf6e9('0x72')][_0xf6e9('0x73')];return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x21f24a['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1f65b2,null))[_0xf6e9('0x22')](saveUpdates(_0x21f24a[_0xf6e9('0x5f')],null))['then'](respondWithResult(_0x1f65b2,null))[_0xf6e9('0x2b')](handleError(_0x1f65b2,null));};exports[_0xf6e9('0x78')]=function(_0x3e836b,_0x3816c7,_0x1551bb){var _0x128519=path['join'](config[_0xf6e9('0x79')],'server/files/images/logos/default_logo.svg');var _0x312906={'where':{'id':_0x3e836b[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x71')],'raw':!![]};var _0x35d754=![];return require(_0xf6e9('0x17'))[_0xf6e9('0x7a')]()[_0xf6e9('0x22')](function(_0xf1c9f0){if(_0xf1c9f0){_0x35d754=_0xf1c9f0['custom'];}})['then'](function(){return db['ChatWebsite'][_0xf6e9('0x5d')](_0x312906);})['then'](handleEntityNotFound(_0x3816c7,null))[_0xf6e9('0x22')](function(_0x23c54f){if(_0x23c54f){if(!_[_0xf6e9('0x7b')](_0x23c54f[_0xf6e9('0x71')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]))&&_0x35d754){_0x128519=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x7e'),_0x23c54f[_0xf6e9('0x71')]);}}return _0x3816c7['download'](_0x128519);}})['catch'](handleError(_0x3816c7,null));};exports[_0xf6e9('0x7f')]=function(_0x255e3c,_0xf4dfc4,_0x373de4){var _0x7f2d57=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/default_avatar.png');var _0x3cefe2={'where':{'id':_0x255e3c[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x80')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x3cefe2)[_0xf6e9('0x22')](handleEntityNotFound(_0xf4dfc4,null))['then'](function(_0x5ce1f9){if(_0x5ce1f9){if(!_['isNil'](_0x5ce1f9[_0xf6e9('0x80')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]))){_0x7f2d57=path[_0xf6e9('0x7d')](config['root'],_0xf6e9('0x81'),_0x5ce1f9[_0xf6e9('0x80')]);}}return _0xf4dfc4[_0xf6e9('0x82')](_0x7f2d57);}})[_0xf6e9('0x2b')](handleError(_0xf4dfc4,null));};exports[_0xf6e9('0x83')]=function(_0x24201c,_0x486d02,_0x22b9e8){var _0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x84'));var _0x4ffd6c={'where':{'id':_0x24201c['params']['id']},'attributes':['id',_0xf6e9('0x85'),_0xf6e9('0x86')],'raw':!![]};return db[_0xf6e9('0x56')][_0xf6e9('0x5d')](_0x4ffd6c)[_0xf6e9('0x22')](handleEntityNotFound(_0x486d02,null))[_0xf6e9('0x22')](function(_0x309d93){if(_0x309d93){if(!_[_0xf6e9('0x7b')](_0x309d93[_0xf6e9('0x85')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93['customerAvatar']))&&_0x309d93[_0xf6e9('0x86')]){_0x2556d5=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x309d93[_0xf6e9('0x85')]);}}return _0x486d02[_0xf6e9('0x82')](_0x2556d5);}})[_0xf6e9('0x2b')](handleError(_0x486d02,null));};exports[_0xf6e9('0x87')]=function(_0x26755d,_0x1879e4,_0x4ad31c){var _0x426552=path['join'](config['root'],_0xf6e9('0x88'));var _0x2fa784={'where':{'id':_0x26755d[_0xf6e9('0x5a')]['id']},'attributes':['id',_0xf6e9('0x77')],'raw':!![]};return db[_0xf6e9('0x56')]['find'](_0x2fa784)[_0xf6e9('0x22')](handleEntityNotFound(_0x1879e4,null))[_0xf6e9('0x22')](function(_0x1c6800){if(_0x1c6800){if(!_[_0xf6e9('0x7b')](_0x1c6800[_0xf6e9('0x77')])){if(fs[_0xf6e9('0x7c')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x81'),_0x1c6800[_0xf6e9('0x77')]))){_0x426552=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/images/avatars/',_0x1c6800[_0xf6e9('0x77')]);}}return _0x1879e4[_0xf6e9('0x82')](_0x426552);}})[_0xf6e9('0x2b')](handleError(_0x1879e4,null));};exports[_0xf6e9('0x89')]=function(_0xb83a6d,_0x93b38d,_0xbedbf4){var _0x50f448=require('user-agent-parser');var _0x49d2d0=new _0x50f448();var _0x1330cc=_0x49d2d0[_0xf6e9('0x8a')](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0x8c')])[_0xf6e9('0x8d')]();var _0x589832={'body':_0xb83a6d[_0xf6e9('0x5f')],'channel':_0xf6e9('0x8e')};var _0x19570d=[];var _0x1abdf2=[];var _0x51a9c7={};var _0x40c027=![];return db[_0xf6e9('0x8f')]['describe']()[_0xf6e9('0x22')](function(_0x5c9f82){if(!_0x5c9f82){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x92'));}_0x19570d=_[_0xf6e9('0x93')](_[_0xf6e9('0x46')](_0x5c9f82),[_0xf6e9('0x94'),_0xf6e9('0x95')]);_0x1abdf2=_['difference'](_['keys'](_0x5c9f82),[_0xf6e9('0x94'),'updatedAt',_0xf6e9('0x96'),'ListId']);if(_0xb83a6d[_0xf6e9('0x5f')]['id']){delete _0xb83a6d[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x98'));}if(_[_0xf6e9('0x7b')](_0xb83a6d['body'][_0xf6e9('0x5f')])||_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x99'));}if(_[_0xf6e9('0x7b')](_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x9a')])){throw new db['Sequelize'][(_0xf6e9('0x91'))](_0xf6e9('0x9b')+_0x1abdf2);}if(!_['includes'](_0x1abdf2,_0xb83a6d[_0xf6e9('0x5f')]['mapKey'])){throw new db[(_0xf6e9('0x90'))][(_0xf6e9('0x91'))](_0xf6e9('0x9c')+_0x1abdf2);}_0x51a9c7[_0xb83a6d['body'][_0xf6e9('0x9a')]]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb83a6d[_0xf6e9('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xf6e9('0x9d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51a9c7,'limit':0x1,'order':[['updatedAt',_0xf6e9('0x9e')]]}]},{'model':db[_0xf6e9('0x9f')],'as':_0xf6e9('0xa0')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x51204c){if(_0x51204c&&_0x51204c[_0xf6e9('0x9d')]){_0x589832['account']=_0x51204c;_0x589832[_0xf6e9('0xa1')]=_0x51204c[_0xf6e9('0xa0')];_0x589832['list']=_0x51204c[_0xf6e9('0x9d')];_0x589832[_0xf6e9('0xa1')]=_[_0xf6e9('0xa2')](_0x589832[_0xf6e9('0xa1')],[_0xf6e9('0xa3')],[_0xf6e9('0xa4')]);if(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')]){delete _0x589832[_0xf6e9('0xa5')][_0xf6e9('0xa0')];}if(_0x589832['account'][_0xf6e9('0x9d')]&&_0x589832[_0xf6e9('0xa5')]['List']['Contacts'][_0xf6e9('0x4c')]){return _0x589832[_0xf6e9('0xa5')]['List'][_0xf6e9('0xa6')][0x0];}var _0x3a720f=_[_0xf6e9('0x1a')](_0xb83a6d[_0xf6e9('0x5f')],{'firstName':_0xb83a6d[_0xf6e9('0x5f')]['from'],'ListId':_0x51204c[_0xf6e9('0xa7')]});_0x3a720f[_0xb83a6d[_0xf6e9('0x5f')]['mapKey']]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')][_0xf6e9('0x5e')](_0x3a720f,{'fields':_0x19570d,'raw':!![]});}})[_0xf6e9('0x22')](handleEntityNotFound(_0x93b38d,null))[_0xf6e9('0x22')](function(_0x13c448){_0x589832[_0xf6e9('0xa8')]=_0x13c448;var _0x3b4736=_0xb83a6d['body']['customerIp'];if(_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip']){_0x3b4736=_0xb83a6d[_0xf6e9('0x8b')]['cf-connecting-ip'];}else if(_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')]){_0x3b4736=_['first'](_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xa9')][_0xf6e9('0xaa')](','));}if(_0x13c448){var _0x2e9f75={'ContactId':_0x13c448['id'],'ChatWebsiteId':_0xb83a6d['params']['id'],'from':(_0x13c448[_0xf6e9('0xab')]||'')+'\x20'+(_0x13c448[_0xf6e9('0xac')]||''),'customerIp':_0x3b4736,'customerPort':_0xb83a6d[_0xf6e9('0x8b')]['x-real-port']?_0xb83a6d[_0xf6e9('0x8b')][_0xf6e9('0xad')]:null,'referer':_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xae')],'browserName':_0x1330cc['browser'][_0xf6e9('0x44')]&&_0x1330cc[_0xf6e9('0xaf')]['version']?util[_0xf6e9('0xb0')](_0xf6e9('0xb1'),_0x1330cc['browser'][_0xf6e9('0x44')],_0x1330cc['browser'][_0xf6e9('0xb2')]):_0xf6e9('0xb3'),'browserVersion':_0x1330cc[_0xf6e9('0xaf')][_0xf6e9('0xb2')]||_0xf6e9('0xb3'),'osName':util[_0xf6e9('0xb0')]('%s\x20%s',_0x1330cc['os'][_0xf6e9('0x44')],_0x1330cc['os'][_0xf6e9('0xb2')]),'osVersion':_0x1330cc['os'][_0xf6e9('0xb2')],'deviceModel':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')]&&_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')]?util[_0xf6e9('0xb0')](_0xf6e9('0xb6'),_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x49')],_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0xb5')],_0x1330cc[_0xf6e9('0xb4')]['type']):null,'deviceVendor':_0x1330cc[_0xf6e9('0xb4')]['vendor'],'deviceType':_0x1330cc[_0xf6e9('0xb4')][_0xf6e9('0x42')],'formData':JSON[_0xf6e9('0x27')](_0xb83a6d[_0xf6e9('0x5f')])};var _0x3b85a9={'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'closed':![]};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]){_0x3b85a9[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')]['threadId'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})['then'](function(_0x5b9673){if(_0x5b9673){return[_0x5b9673,![]];}_0x2e9f75[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')];_0x2e9f75[_0xf6e9('0xb9')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb9')];return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x8a9509){return[_0x8a9509,!![]];});});}_0x3b85a9[_0xf6e9('0xba')]=_0x13c448['id'];if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]&&_0xb83a6d['body'][_0xf6e9('0xbb')]['id']){_0x3b85a9['id']=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbb')]['id'];return db[_0xf6e9('0xb8')][_0xf6e9('0x5d')]({'where':_0x3b85a9})[_0xf6e9('0x22')](function(_0x465e4a){if(_0x465e4a){return[_0x465e4a,![]];}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)[_0xf6e9('0x22')](function(_0x330939){return[_0x330939,!![]];});});}return db[_0xf6e9('0xb8')][_0xf6e9('0x5e')](_0x2e9f75)['then'](function(_0x510583){return[_0x510583,!![]];});}})[_0xf6e9('0xbc')](function(_0x15c5f5,_0x49099f){if(_0x15c5f5){_0x40c027=_0x49099f;if(!_0x49099f){var _0x22a404={'from':(_0x589832['contact'][_0xf6e9('0xab')]||'')+'\x20'+(_0x589832[_0xf6e9('0xa8')][_0xf6e9('0xac')]||'')};if(_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')]&&_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xb7')]!=_0xb83a6d['body'][_0xf6e9('0xbd')]){_0x22a404[_0xf6e9('0xb7')]=_0xb83a6d[_0xf6e9('0x5f')][_0xf6e9('0xbd')];}return _0x15c5f5[_0xf6e9('0x36')](_0x22a404);}else{return _0x15c5f5;}}})[_0xf6e9('0x22')](function(_0x83498a){_0x589832[_0xf6e9('0xbb')]=_0x83498a[_0xf6e9('0x38')]({'plain':!![]});_0x589832['interaction'][_0xf6e9('0xbe')]=_0x40c027;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xbe')]){if(_0x589832[_0xf6e9('0xa5')]['autoclose']){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xbf')]({'id':0x0,'priority':_0x589832[_0xf6e9('0xa1')][_0xf6e9('0x4c')]+0x1,'app':_0xf6e9('0xc0'),'appdata':_0xf6e9('0xc1'),'interval':_0xf6e9('0xc2')});}}return db[_0xf6e9('0xc3')][_0xf6e9('0x5e')]({'body':_0xb83a6d[_0xf6e9('0x5f')]['body'],'ChatWebsiteId':_0xb83a6d[_0xf6e9('0x5a')]['id'],'ChatInteractionId':_0x83498a['id'],'direction':'in','ContactId':_0x589832[_0xf6e9('0xa8')]['id'],'AttachmentId':_0xb83a6d[_0xf6e9('0x5f')]['AttachmentId']});})[_0xf6e9('0x22')](function(_0x5a739b){_0x589832[_0xf6e9('0x2a')]=_0x5a739b;if(_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]){return db[_0xf6e9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x589832[_0xf6e9('0xbb')][_0xf6e9('0xc4')]}})[_0xf6e9('0x22')](function(_0x405c51){if(_0x405c51){_0x589832[_0xf6e9('0xa1')][_0xf6e9('0xc6')]({'id':0x0,'priority':0x0,'app':_0xf6e9('0xc7'),'appdata':_0x405c51[_0xf6e9('0x44')]+','+(_0x589832[_0xf6e9('0xa5')][_0xf6e9('0xc8')]||0xa),'interval':_0xf6e9('0xc2')});_0x589832[_0xf6e9('0xc9')]=!![];}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);});}return respondWithRpcPromise(_0xf6e9('0xca'),_0xf6e9('0xcb'),_0x589832);})[_0xf6e9('0x22')](function(_0x2436f6){respondWithRpcPromise(_0xf6e9('0xcc'),_0xf6e9('0xcc'),{'event':'notify','message':_0x2436f6},client9002);return _0x2436f6;})[_0xf6e9('0x22')](respondWithResult(_0x93b38d,null))[_0xf6e9('0x2b')](handleError(_0x93b38d,null));};exports['offline']=function(_0x7bc5d7,_0x3b77d5,_0x10e804){var _0x51770a,_0xbd592c,_0x4e5285;var _0x533d64=[];var _0x126c69=[];var _0x4b5c59={};var _0x3ce98b=_0x7bc5d7[_0xf6e9('0xcd')]||[];var _0x276654=[];var _0x54f87c;return db[_0xf6e9('0x8f')][_0xf6e9('0x65')]()[_0xf6e9('0x22')](function(_0x23ddde){if(!_0x23ddde){throw new db['Sequelize'][(_0xf6e9('0x91'))]('no\x20available\x20attributes');}_0x126c69=_['difference'](_['keys'](_0x23ddde),['createdAt','updatedAt']);_0x533d64=_['difference'](_[_0xf6e9('0x46')](_0x23ddde),[_0xf6e9('0x94'),_0xf6e9('0x95'),_0xf6e9('0x96'),_0xf6e9('0xa7')]);if(_0x7bc5d7[_0xf6e9('0x5f')]['id']){delete _0x7bc5d7[_0xf6e9('0x5f')]['id'];}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0x98')));}if(_[_0xf6e9('0x7b')](_0x7bc5d7[_0xf6e9('0x5f')]['body'])||_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]===''){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf6e9('0x7b')](_0x7bc5d7['body']['mapKeyOffline'])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)[_0xf6e9('0x3c')](new db[(_0xf6e9('0x90'))]['ValidationError'](_0xf6e9('0xce')+_0x533d64));}if(!_['includes'](_0x533d64,_0x7bc5d7['body'][_0xf6e9('0xcf')])){throw _0x3b77d5[_0xf6e9('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0xf6e9('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x533d64));}_0x4b5c59[_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0xcf')]]=_0x7bc5d7[_0xf6e9('0x5f')]['from'];})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x56')]['find']({'where':{'id':_0x7bc5d7[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0xd0')],'as':_0xf6e9('0x9d')},{'model':db[_0xf6e9('0xd1')],'as':_0xf6e9('0xd1')}]});})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b77d5,null))[_0xf6e9('0x22')](function(_0x45ad55){if(_0x45ad55&&_0x45ad55[_0xf6e9('0x9d')]){_0xbd592c=_0x45ad55;var _0x40c26f=_[_0xf6e9('0x1a')](_0x7bc5d7['body'],{'firstName':_0x7bc5d7['body'][_0xf6e9('0x97')],'phone':_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x97')],'ListId':_0x45ad55[_0xf6e9('0xa7')]});_0x40c26f[_0x7bc5d7['body'][_0xf6e9('0xcf')]]=_0x7bc5d7['body'][_0xf6e9('0x97')];return db[_0xf6e9('0x8f')]['findOrCreate']({'where':_0x4b5c59,'defaults':_0x40c26f});}})[_0xf6e9('0xbc')](function(_0x563e18){if(_0x563e18){_0x4e5285=_0x563e18;var _0x1c592d=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x18ddba=ejs[_0xf6e9('0xd3')](_0x1c592d,{'body':_[_0xf6e9('0xd4')](_0x7bc5d7[_0xf6e9('0x5f')][_0xf6e9('0x5f')]),'bodyTitle':_0xbd592c[_0xf6e9('0xd5')]});return db[_0xf6e9('0xd6')][_0xf6e9('0x5e')]({'body':_0x18ddba,'ContactId':_0x563e18['id'],'ChatWebsiteId':_0xbd592c['id']});}})[_0xf6e9('0x22')](function(_0x6c6df4){_0x54f87c=_0x6c6df4;if(_0x3ce98b[_0xf6e9('0x4c')]){var _0x11609c=_0x3ce98b[_0xf6e9('0x40')](function(_0x42ced5){return{'name':_0x42ced5[_0xf6e9('0xd7')],'basename':_0x42ced5['filename'],'type':_0x42ced5[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x6c6df4['id']};});_0x276654=_0x11609c['map'](_0x3f27b2=>{var _0x4750e9={'filename':_0x3f27b2[_0xf6e9('0x44')],'path':path['join'](config['root'],_0xf6e9('0xd9'),_0xf6e9('0xcd'),_0xf6e9('0xda'),_0xf6e9('0xdb'),_0x3f27b2[_0xf6e9('0xdc')])};return _0x4750e9;});if(!_0xbd592c[_0xf6e9('0xdd')]){return db[_0xf6e9('0xde')]['transaction'](function(_0x422322){return db['Attachment']['bulkCreate'](_0x11609c,{'transaction':_0x422322});});}}})['then'](function(){if(_0x54f87c){_0x51770a=_0x54f87c;return db[_0xf6e9('0xd1')][_0xf6e9('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xf6e9('0xdf')],'as':_0xf6e9('0xe0'),'raw':!![]}]});}})['then'](function(_0x138b35){if(_0x138b35&&_0x138b35[_0xf6e9('0xe0')]&&_0xbd592c['forwardOffline']&&_0xbd592c[_0xf6e9('0xe1')]){var _0x1c344d={'tls':{'rejectUnauthorized':![]}};if(_0x138b35['Smtp'][_0xf6e9('0xe2')]){_0x1c344d[_0xf6e9('0xe2')]=_0x138b35['Smtp'][_0xf6e9('0xe2')];}else{_0x1c344d['host']=_0x138b35[_0xf6e9('0xe0')]['host'];_0x1c344d[_0xf6e9('0xe3')]=_0x138b35['Smtp'][_0xf6e9('0xe3')];_0x1c344d[_0xf6e9('0xe4')]=_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe4')];}if(_0x138b35[_0xf6e9('0xe0')][_0xf6e9('0xe5')]){_0x1c344d[_0xf6e9('0xe6')]={'user':_0x138b35[_0xf6e9('0xe0')]['user'],'pass':_0x138b35['Smtp'][_0xf6e9('0xe7')]};}return respondWithRpcPromise('SendMail',_0xf6e9('0xe8'),{'account':_0x1c344d,'message':{'from':util['format'](_0xf6e9('0xe9'),_0x138b35[_0xf6e9('0x44')],_0x138b35['email']||_0x138b35[_0xf6e9('0xe0')]['user']),'to':_0xbd592c[_0xf6e9('0xe1')],'subject':_0xbd592c[_0xf6e9('0xea')],'html':_0x51770a['body'],'attachments':_0x276654}},client9003)['then'](function(){return _0x51770a;})['catch'](function(_0x2fdf50){console['error'](_0x2fdf50);});}})[_0xf6e9('0x22')](function(){if(_0xbd592c&&_0xbd592c[_0xf6e9('0xdd')]&&_0xbd592c[_0xf6e9('0xeb')]){var _0x1f552c=[];if(_0x3ce98b['length']){_0x1f552c=_0x3ce98b[_0xf6e9('0x40')](function(_0x1ada23){return{'name':_0x1ada23['originalname'],'basename':_0x1ada23[_0xf6e9('0x73')],'type':_0x1ada23[_0xf6e9('0xd8')],'ChatOfflineMessageId':_0x54f87c['id']};});}var _0x3c8e72;if(!_[_0xf6e9('0x7b')](_0xbd592c[_0xf6e9('0xec')])){var _0x166f86=_[_0xf6e9('0x40')](_0x7bc5d7[_0xf6e9('0x5f')],function(_0x5672e3){return _0x5672e3;});var _0x3a2d03=_[_0xf6e9('0xed')](_0x166f86)[0x0];var _0x1ea261=_[_0xf6e9('0xee')](_0x3a2d03,function(_0x267946){return _0x267946;});_0x3c8e72=_0x1ea261[0x1][_0xbd592c[_0xf6e9('0xec')]];}var _0x284fbd={'from':_0x4e5285[_0xf6e9('0xef')],'firstName':_0x4e5285['firstName'],'lastName':_0x4e5285[_0xf6e9('0xac')],'mapKey':'email','message':{'from':_0x4e5285[_0xf6e9('0xef')],'to':_0xbd592c[_0xf6e9('0xd1')]['email'],'cc':'','subject':_[_0xf6e9('0x7b')](_0x3c8e72)?_0xbd592c[_0xf6e9('0xea')]:_0x3c8e72,'messageId':'','sentAt':new Date(),'attach':_0x1f552c['length'],'attachments':_0x1f552c,'originChannel':_0xf6e9('0xf0'),'ChatWebsiteId':_0xbd592c['id'],'ChatOfflineMessageId':_0x51770a['id'],'originTo':_0xbd592c[_0xf6e9('0xd1')][_0xf6e9('0xef')]},'body':_0x51770a[_0xf6e9('0x5f')]};var _0x2144a9={'account':{'id':_0xbd592c[_0xf6e9('0xeb')]},'body':_0x284fbd,'log':_0xf6e9('0xf1')};return respondWithRpcPromise(_0xf6e9('0xf1'),_0xf6e9('0xf2'),_0x2144a9,client9001)[_0xf6e9('0x22')](function(){return _0x51770a;})['catch'](function(_0x188663){console['error'](_0x188663);});}return;})[_0xf6e9('0x22')](function(){if(_0x51770a){return _0x51770a;}})[_0xf6e9('0x22')](respondWithResult(_0x3b77d5,null))[_0xf6e9('0x2b')](function(_0x3e1db3){console[_0xf6e9('0x28')](_0xf6e9('0x2b'),_0x3e1db3);for(var _0x4bec47 of _0x3ce98b){var _0x207632=path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],'server',_0xf6e9('0xcd'),'attachments','offline-chat',_0x4bec47['filename']);fs_extra['remove'](_0x207632)[_0xf6e9('0x2b')](function(_0x35ab66){console[_0xf6e9('0x28')](_0xf6e9('0xf3'),_0x207632,_0x35ab66);});}});};exports[_0xf6e9('0xf4')]=function(_0x297eee,_0x50e7b5,_0x111ecb){return db[_0xf6e9('0xb8')]['find']({'where':{'id':_0x297eee['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x50e7b5,null))[_0xf6e9('0x22')](function(_0xe386b){if(_0xe386b){return _0xe386b[_0xf6e9('0xf4')](_0x297eee[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x297eee['body'],['ids','id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x50e7b5,null))[_0xf6e9('0x2b')](handleError(_0x50e7b5,null));};exports[_0xf6e9('0xf6')]=function(_0x329e8c,_0x1b91ea,_0xb27843){var _0x4ee38b={'raw':![],'where':{}};var _0x2eb405={};var _0x19661b={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x329e8c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x1b91ea,null))['then'](function(_0x39809a){if(_0x39809a){_0x2eb405[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xb8')][_0xf6e9('0x41')]);_0x2eb405[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x329e8c[_0xf6e9('0x45')]);_0x2eb405[_0xf6e9('0x47')]=_['intersection'](_0x2eb405['model'],_0x2eb405['query']);_0x4ee38b[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2eb405[_0xf6e9('0x49')],qs['fields'](_0x329e8c['query'][_0xf6e9('0x4b')]));_0x4ee38b[_0xf6e9('0x4a')]=_0x4ee38b[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4ee38b[_0xf6e9('0x4a')]:_0x2eb405[_0xf6e9('0x49')];if(!_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4ee38b['limit']=qs[_0xf6e9('0x31')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4ee38b['offset']=qs[_0xf6e9('0x2f')](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}_0x4ee38b[_0xf6e9('0x4f')]=qs['sort'](_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4ee38b['where']=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x329e8c[_0xf6e9('0x45')],_0x2eb405[_0xf6e9('0x47')]));_0x4ee38b[_0xf6e9('0x51')]['ChatWebsiteId']=_0x39809a['id'];if(_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4ee38b[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4ee38b['where'],{'$or':_[_0xf6e9('0x40')](_0x4ee38b[_0xf6e9('0x4a')],function(_0x2f3870){var _0x1c6130={};_0x1c6130[_0x2f3870]={'$like':'%'+_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x1c6130;})});}_0x4ee38b=_[_0xf6e9('0x5c')]({},_0x4ee38b,_0x329e8c[_0xf6e9('0x55')]);return db[_0xf6e9('0xb8')]['count']({'where':_0x4ee38b[_0xf6e9('0x51')]})[_0xf6e9('0x22')](function(_0x4993e8){_0x19661b[_0xf6e9('0x32')]=_0x4993e8;if(_0x329e8c[_0xf6e9('0x45')]['includeAll']){_0x4ee38b[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':_0xf6e9('0xf7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xf6e9('0x44'),'fullname',_0xf6e9('0xf8')],'required':![]},{'model':db[_0xf6e9('0xf9')],'as':_0xf6e9('0xfa'),'attributes':['id','name','color'],'where':_0x329e8c[_0xf6e9('0x45')]['tag']?{'id':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]}:undefined,'required':_0x329e8c[_0xf6e9('0x45')][_0xf6e9('0xfb')]?!![]:![]}];}return db[_0xf6e9('0xb8')][_0xf6e9('0x57')](_0x4ee38b);})['then'](function(_0x1fbb14){_0x19661b[_0xf6e9('0x58')]=_0x1fbb14;return _0x19661b;});}})[_0xf6e9('0x22')](respondWithFilteredResult(_0x1b91ea,_0x4ee38b))[_0xf6e9('0x2b')](handleError(_0x1b91ea,null));};function iftimePromise(_0x4c7f0e,_0x25610c){return respondWithRpcPromise(_0xf6e9('0xfc'),'getSnippet',{'command':_0x25610c['timezone']?util[_0xf6e9('0xb0')](_0xf6e9('0xfd'),_0x4c7f0e['interval'],_0x25610c[_0xf6e9('0xfe')]):util[_0xf6e9('0xb0')]('iftime\x20%s',_0x4c7f0e[_0xf6e9('0xff')])},client9002)[_0xf6e9('0x22')](function(_0x386748){var _0x3a2621=_0x386748&&_0x386748['indexOf'](_0xf6e9('0x100'))>=0x0?!![]:![];logger[_0xf6e9('0x23')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e[_0xf6e9('0xff')],_0x3a2621?_0xf6e9('0x102'):_0xf6e9('0x103'),_0x25610c['timezone']?_0x25610c[_0xf6e9('0xfe')]:'No\x20timezone');return _0x3a2621;})[_0xf6e9('0x2b')](function(_0x273bce){logger[_0xf6e9('0x28')](_0xf6e9('0x101'),_0x25610c['id'],_0x4c7f0e['id'],_0x4c7f0e['interval'],util[_0xf6e9('0x104')](_0x273bce,{'showHidden':![],'depth':null}),_0x25610c[_0xf6e9('0xfe')]?_0x25610c[_0xf6e9('0xfe')]:_0xf6e9('0x105'));return![];});}exports[_0xf6e9('0x106')]=function(_0x243feb,_0x3f6bf7,_0x5a7060){var _0x4fe6e8=0x0;var _0x3acee6=0x0;var _0x2b54ea=![];var _0x3bd6bc;var _0x503330;return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0x243feb[_0xf6e9('0x5a')]['id']},'include':[{'model':db[_0xf6e9('0x107')],'as':'Interval','include':[{'model':db[_0xf6e9('0x107')],'as':_0xf6e9('0x108'),'attributes':['id',_0xf6e9('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3f6bf7,null))[_0xf6e9('0x22')](function(_0x3f341e){if(_0x3f341e){_0x3bd6bc=_0x3f341e;return _0x3f341e[_0xf6e9('0x109')]({'raw':!![]});}})[_0xf6e9('0x22')](function(_0x3ad84a){if(_0x3bd6bc){if(_0x3ad84a){_0x503330=_0x3ad84a;}}return require('../../config/license/util')[_0xf6e9('0x7a')]();})['then'](function(_0x4f812a){if(_0x4f812a){_0x3acee6=_0x4f812a[_0xf6e9('0x10a')];_0x2b54ea=_0x4f812a['custom'];}})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0xb8')][_0xf6e9('0x32')]({'where':{'closed':![]}});})['then'](function(_0x53374f){_0x4fe6e8=_0x53374f;if(_0x3acee6&&_0x53374f>_0x3acee6){return db[_0xf6e9('0x10b')][_0xf6e9('0x68')]({'where':{'id':0x1}})[_0xf6e9('0x22')](function(_0xfcad4a){if(_0xfcad4a){_0xfcad4a[_0xf6e9('0x10c')]('chatLicenseExceeded');}});}})[_0xf6e9('0x22')](function(){if(_0x3bd6bc[_0xf6e9('0x107')]&&_0x3bd6bc['Interval'][_0xf6e9('0x108')]){var _0x579b45=[];for(var _0x5aab7d=0x0;_0x5aab7d<_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0xf6e9('0x4c')];_0x5aab7d++){var _0x4afc43=_0x3bd6bc[_0xf6e9('0x107')][_0xf6e9('0x108')][_0x5aab7d][_0xf6e9('0x38')]({'plain':!![]});_0x579b45['push'](iftimePromise(_0x4afc43,_0x3bd6bc));}return BPromise['all'](_0x579b45)[_0xf6e9('0x22')](function(_0x3c9dd1){return _['some'](_0x3c9dd1);});}else{return!![];}})[_0xf6e9('0x22')](function(_0x2672f0){var _0x1951cf=fs[_0xf6e9('0xd2')](path[_0xf6e9('0x7d')](config[_0xf6e9('0x79')],_0xf6e9('0x10d')),_0xf6e9('0x10e'));var _0x121a5a={'remote':_0x3bd6bc[_0xf6e9('0x10f')],'query':querystring['stringify'](_['merge'](_0x3bd6bc[_0xf6e9('0x38')]({'plain':!![]}),{'customerIp':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xa9')]||_0x243feb['headers'][_0xf6e9('0x110')]||_0x243feb[_0xf6e9('0x111')][_0xf6e9('0x112')]||_0x243feb['ip'],'referer':_0x243feb[_0xf6e9('0x8b')][_0xf6e9('0xae')],'openedInteractions':_0x4fe6e8,'maxInteractions':_0x3acee6,'virtual':_0x2b54ea[_0xf6e9('0x10a')],'online':_0x2672f0,'custom':_0x2b54ea}))[_0xf6e9('0x113')](/'/g,'\x5c\x27')};_0x3f6bf7[_0xf6e9('0x3c')](ejs[_0xf6e9('0xd3')](Mustache[_0xf6e9('0xd3')](_0x1951cf,_0x121a5a),{'proactiveActions':_0x503330,'alignment':_0x3bd6bc[_0xf6e9('0x114')],'verticalAlignment':_0x3bd6bc['verticalAlignment'],'div_color':_0x3bd6bc['color'],'text_color':_0x3bd6bc[_0xf6e9('0x115')],'button_color':_0x3bd6bc[_0xf6e9('0x116')],'background_color':_0x3bd6bc['backgroundColor']}));})[_0xf6e9('0x2b')](handleError(_0x3f6bf7,null));};exports[_0xf6e9('0x117')]=function(_0x1f668b,_0x2c2a34,_0x11d665){return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x1f668b['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2c2a34,null))[_0xf6e9('0x22')](function(_0x51bcfd){if(_0x51bcfd){return db[_0xf6e9('0xde')][_0xf6e9('0x118')](function(_0x2c1d54){return db['ChatApplication'][_0xf6e9('0x37')]({'where':{'ChatWebsiteId':_0x1f668b['params']['id']},'transaction':_0x2c1d54})[_0xf6e9('0x22')](function(_0x53bd22){var _0x19b486=_['map'](_0x1f668b['body'],function(_0x46f51c){_0x46f51c['ChatWebsiteId']=_0x1f668b[_0xf6e9('0x5a')]['id'];return _0x46f51c;});return db[_0xf6e9('0x9f')][_0xf6e9('0x119')](_0x19b486,{'transaction':_0x2c1d54});});})[_0xf6e9('0x22')](function(){return db[_0xf6e9('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f668b[_0xf6e9('0x5a')]['id']},'order':_0xf6e9('0xa3')});});}})[_0xf6e9('0x22')](respondWithResult(_0x2c2a34,null))[_0xf6e9('0x2b')](handleError(_0x2c2a34,null));};exports[_0xf6e9('0x11a')]=function(_0x189e1a,_0x2f7925,_0x45b455){var _0x4bb45d={};var _0x2aa387={};var _0xaab1d8;var _0x302214;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x189e1a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x2f7925,null))[_0xf6e9('0x22')](function(_0x15d1b7){if(_0x15d1b7){_0xaab1d8=_0x15d1b7;_0x2aa387[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x9f')][_0xf6e9('0x41')]);_0x2aa387[_0xf6e9('0x45')]=_[_0xf6e9('0x46')](_0x189e1a[_0xf6e9('0x45')]);_0x2aa387['filters']=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],_0x2aa387[_0xf6e9('0x45')]);_0x4bb45d[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x2aa387[_0xf6e9('0x49')],qs['fields'](_0x189e1a[_0xf6e9('0x45')]['fields']));_0x4bb45d[_0xf6e9('0x4a')]=_0x4bb45d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4bb45d[_0xf6e9('0x4a')]:_0x2aa387[_0xf6e9('0x49')];_0x4bb45d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4bb45d[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x189e1a[_0xf6e9('0x45')],_0x2aa387[_0xf6e9('0x47')]));if(_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x4bb45d[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4bb45d[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x4bb45d[_0xf6e9('0x4a')],function(_0x490730){var _0xea9909={};_0xea9909[_0x490730]={'$like':'%'+_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0xea9909;})});}_0x4bb45d=_[_0xf6e9('0x5c')]({},_0x4bb45d,_0x189e1a[_0xf6e9('0x55')]);return _0xaab1d8['getApplications'](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x43e60a){if(_0x43e60a){_0x302214=_0x43e60a['length'];if(!_0x189e1a[_0xf6e9('0x45')]['hasOwnProperty'](_0xf6e9('0x4e'))){_0x4bb45d[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4bb45d[_0xf6e9('0x2f')]=qs['offset'](_0x189e1a[_0xf6e9('0x45')][_0xf6e9('0x2f')]);}return _0xaab1d8[_0xf6e9('0x11a')](_0x4bb45d);}})[_0xf6e9('0x22')](function(_0x358caf){if(_0x358caf){return _0x358caf?{'count':_0x302214,'rows':_0x358caf}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x2f7925,null))['catch'](handleError(_0x2f7925,null));};exports[_0xf6e9('0x11b')]=function(_0x449f4c,_0x3b00cd,_0x332fd0){return db[_0xf6e9('0x11c')][_0xf6e9('0x5d')]({'where':{'id':_0x449f4c[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x3b00cd,null))[_0xf6e9('0x22')](function(_0x40e196){if(_0x40e196){return _0x40e196['addProactiveActions'](_0x449f4c[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0x449f4c[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{});}})[_0xf6e9('0x22')](respondWithResult(_0x3b00cd,null))[_0xf6e9('0x2b')](handleError(_0x3b00cd,null));};exports['getProactiveActions']=function(_0x545542,_0x303007,_0x1334a4){var _0x4232f9={};var _0x17fc8f={};var _0x55b461;var _0x335005;return db[_0xf6e9('0x56')]['findOne']({'where':{'id':_0x545542[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x303007,null))[_0xf6e9('0x22')](function(_0x572783){if(_0x572783){_0x55b461=_0x572783;_0x17fc8f[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db[_0xf6e9('0x11d')][_0xf6e9('0x41')]);_0x17fc8f['query']=_[_0xf6e9('0x46')](_0x545542[_0xf6e9('0x45')]);_0x17fc8f[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x17fc8f[_0xf6e9('0x49')],_0x17fc8f[_0xf6e9('0x45')]);_0x4232f9['attributes']=_['intersection'](_0x17fc8f['model'],qs['fields'](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4232f9[_0xf6e9('0x4a')]=_0x4232f9['attributes'][_0xf6e9('0x4c')]?_0x4232f9[_0xf6e9('0x4a')]:_0x17fc8f[_0xf6e9('0x49')];_0x4232f9['order']=qs[_0xf6e9('0x50')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x50')]);_0x4232f9[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x545542[_0xf6e9('0x45')],_0x17fc8f[_0xf6e9('0x47')]));if(_0x545542[_0xf6e9('0x45')]['filter']){_0x4232f9[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x4232f9['where'],{'$or':_['map'](_0x4232f9[_0xf6e9('0x4a')],function(_0x39c0e4){var _0x5f20ff={};_0x5f20ff[_0x39c0e4]={'$like':'%'+_0x545542[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5f20ff;})});}_0x4232f9=_[_0xf6e9('0x5c')]({},_0x4232f9,_0x545542[_0xf6e9('0x55')]);return _0x55b461['getProactiveActions'](_0x4232f9);}})['then'](function(_0x1c20be){if(_0x1c20be){_0x335005=_0x1c20be[_0xf6e9('0x4c')];if(!_0x545542[_0xf6e9('0x45')][_0xf6e9('0x4d')](_0xf6e9('0x4e'))){_0x4232f9[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x545542[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x4232f9[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x545542['query']['offset']);}return _0x55b461[_0xf6e9('0x109')](_0x4232f9);}})[_0xf6e9('0x22')](function(_0x27afd1){if(_0x27afd1){return _0x27afd1?{'count':_0x335005,'rows':_0x27afd1}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x303007,null))[_0xf6e9('0x2b')](handleError(_0x303007,null));};exports[_0xf6e9('0x11e')]=function(_0x100edb,_0x337e37,_0x28a1a7){var _0x57d9e4=_0x100edb[_0xf6e9('0x45')]['online']===_0xf6e9('0x11f')?'offlineForm':_0xf6e9('0x120');return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'attributes':['id',_0x57d9e4],'where':{'id':_0x100edb[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x337e37,null))[_0xf6e9('0x22')](function(_0x2971e0){if(_0x2971e0){var _0xb56642=_0x2971e0[_0x57d9e4];var _0x2e03af=_0xb56642&&_0xb56642[_0xf6e9('0x121')]?_0xb56642[_0xf6e9('0x121')]:[];_0x337e37[_0xf6e9('0x3c')]({'fromKey':_[_0xf6e9('0x7b')](_0xb56642[_0xf6e9('0x122')])?undefined:_0xb56642[_0xf6e9('0x122')],'count':_0x2e03af[_0xf6e9('0x4c')],'rows':_0x2e03af});}})[_0xf6e9('0x2b')](handleError(_0x337e37,null));};exports[_0xf6e9('0x123')]=function(_0x3d1940,_0x343e35,_0x448032){var _0x4f496d={'raw':![],'where':{}};var _0x46c6ee={};var _0x21be4d={'count':0x0,'rows':[]};return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x3d1940[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x343e35,null))[_0xf6e9('0x22')](function(_0x290252){if(_0x290252){_0x46c6ee[_0xf6e9('0x49')]=_[_0xf6e9('0x46')](db['ChatOfflineMessage'][_0xf6e9('0x41')]);_0x46c6ee['query']=_[_0xf6e9('0x46')](_0x3d1940[_0xf6e9('0x45')]);_0x46c6ee['filters']=_[_0xf6e9('0x48')](_0x46c6ee['model'],_0x46c6ee[_0xf6e9('0x45')]);_0x4f496d['attributes']=_[_0xf6e9('0x48')](_0x46c6ee['model'],qs['fields'](_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4b')]));_0x4f496d[_0xf6e9('0x4a')]=_0x4f496d[_0xf6e9('0x4a')][_0xf6e9('0x4c')]?_0x4f496d['attributes']:_0x46c6ee['model'];if(!_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x4d')]('nolimit')){_0x4f496d['limit']=qs['limit'](_0x3d1940['query'][_0xf6e9('0x31')]);_0x4f496d[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x3d1940[_0xf6e9('0x45')]['offset']);}_0x4f496d[_0xf6e9('0x4f')]=qs[_0xf6e9('0x50')](_0x3d1940[_0xf6e9('0x45')]['sort']);_0x4f496d[_0xf6e9('0x51')]=qs[_0xf6e9('0x47')](_[_0xf6e9('0x52')](_0x3d1940['query'],_0x46c6ee[_0xf6e9('0x47')]));_0x4f496d[_0xf6e9('0x51')][_0xf6e9('0x6d')]=_0x290252['id'];if(_0x3d1940['query'][_0xf6e9('0x53')]){_0x4f496d[_0xf6e9('0x51')]=_['merge'](_0x4f496d['where'],{'$or':_[_0xf6e9('0x40')](_0x4f496d[_0xf6e9('0x4a')],function(_0x3f3556){var _0x5226f5={};_0x5226f5[_0x3f3556]={'$like':'%'+_0x3d1940[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x5226f5;})});}_0x4f496d=_['merge']({},_0x4f496d,_0x3d1940[_0xf6e9('0x55')]);return db[_0xf6e9('0xd6')][_0xf6e9('0x32')]({'where':_0x4f496d['where']})[_0xf6e9('0x22')](function(_0x57c768){_0x21be4d[_0xf6e9('0x32')]=_0x57c768;if(_0x3d1940['query']['includeAll']){_0x4f496d[_0xf6e9('0x5b')]=[{'all':!![]}];}else{_0x4f496d[_0xf6e9('0x5b')]=[{'model':db[_0xf6e9('0x8f')],'as':'Contact','required':![]},{'model':db[_0xf6e9('0x124')],'as':_0xf6e9('0x125'),'required':![]}];}return db[_0xf6e9('0xd6')][_0xf6e9('0x57')](_0x4f496d);})[_0xf6e9('0x22')](function(_0x2d017c){_0x21be4d[_0xf6e9('0x58')]=_0x2d017c;return _0x21be4d;});}})['then'](respondWithFilteredResult(_0x343e35,_0x4f496d))[_0xf6e9('0x2b')](handleError(_0x343e35,null));};exports[_0xf6e9('0x126')]=function(_0xb2125a,_0x29d620,_0x3c2114){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xb2125a[_0xf6e9('0x5a')]['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x29d620,null))[_0xf6e9('0x22')](function(_0x3ac055){if(_0x3ac055){return _0x3ac055[_0xf6e9('0x126')](_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')],_[_0xf6e9('0xf5')](_0xb2125a[_0xf6e9('0x5f')],[_0xf6e9('0x6b'),'id'])||{})[_0xf6e9('0xbc')](function(_0x5ebfc3){for(var _0x265e42=0x0;_0x265e42<_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0xf6e9('0x4c')];_0x265e42+=0x1){socket['emit'](_0xf6e9('0x127'),{'UserId':Number(_0xb2125a[_0xf6e9('0x5f')][_0xf6e9('0x6b')][_0x265e42]),'ChatWebsiteId':Number(_0xb2125a['params']['id'])});}return _0x5ebfc3;});}})[_0xf6e9('0x22')](respondWithResult(_0x29d620,null))[_0xf6e9('0x2b')](handleError(_0x29d620,null));};exports[_0xf6e9('0x128')]=function(_0xc3548c,_0x5680dd,_0x5e154b){return db[_0xf6e9('0x56')][_0xf6e9('0x5d')]({'where':{'id':_0xc3548c['params']['id']}})[_0xf6e9('0x22')](handleEntityNotFound(_0x5680dd,null))[_0xf6e9('0x22')](function(_0x1da778){if(_0x1da778){return _0x1da778[_0xf6e9('0x128')](_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')])['then'](function(){if(_[_0xf6e9('0x129')](_0xc3548c['query'][_0xf6e9('0x6b')])){for(var _0x4a8b92=0x0;_0x4a8b92<_0xc3548c[_0xf6e9('0x45')]['ids'][_0xf6e9('0x4c')];_0x4a8b92+=0x1){socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c[_0xf6e9('0x45')][_0xf6e9('0x6b')][_0x4a8b92]),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}}else{socket[_0xf6e9('0x12a')](_0xf6e9('0x12b'),{'UserId':Number(_0xc3548c['query']['ids']),'ChatWebsiteId':Number(_0xc3548c[_0xf6e9('0x5a')]['id'])});}});}})[_0xf6e9('0x22')](respondWithStatusCode(_0x5680dd,null))[_0xf6e9('0x2b')](handleError(_0x5680dd,null));};exports[_0xf6e9('0x12c')]=function(_0x4a3d6d,_0x5531ce,_0x2849d5){var _0x5afad7={};var _0x892cca={};var _0x117820;var _0x3c78d9;return db[_0xf6e9('0x56')][_0xf6e9('0x68')]({'where':{'id':_0x4a3d6d[_0xf6e9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5531ce,null))[_0xf6e9('0x22')](function(_0x2881b2){if(_0x2881b2){_0x117820=_0x2881b2;_0x892cca[_0xf6e9('0x49')]=_['keys'](db[_0xf6e9('0xc5')][_0xf6e9('0x41')]);_0x892cca['query']=_[_0xf6e9('0x46')](_0x4a3d6d['query']);_0x892cca[_0xf6e9('0x47')]=_[_0xf6e9('0x48')](_0x892cca['model'],_0x892cca['query']);_0x5afad7[_0xf6e9('0x4a')]=_[_0xf6e9('0x48')](_0x892cca[_0xf6e9('0x49')],qs['fields'](_0x4a3d6d['query'][_0xf6e9('0x4b')]));_0x5afad7[_0xf6e9('0x4a')]=_0x5afad7['attributes'][_0xf6e9('0x4c')]?_0x5afad7[_0xf6e9('0x4a')]:_0x892cca['model'];_0x5afad7['order']=qs[_0xf6e9('0x50')](_0x4a3d6d['query'][_0xf6e9('0x50')]);_0x5afad7[_0xf6e9('0x51')]=qs['filters'](_[_0xf6e9('0x52')](_0x4a3d6d[_0xf6e9('0x45')],_0x892cca['filters']));if(_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]){_0x5afad7[_0xf6e9('0x51')]=_[_0xf6e9('0x5c')](_0x5afad7[_0xf6e9('0x51')],{'$or':_[_0xf6e9('0x40')](_0x5afad7['attributes'],function(_0x5c3c6a){var _0x427d09={};_0x427d09[_0x5c3c6a]={'$like':'%'+_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x53')]+'%'};return _0x427d09;})});}_0x5afad7=_['merge']({},_0x5afad7,_0x4a3d6d[_0xf6e9('0x55')]);return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0xba0834){if(_0xba0834){_0x3c78d9=_0xba0834[_0xf6e9('0x4c')];if(!_0x4a3d6d['query']['hasOwnProperty'](_0xf6e9('0x4e'))){_0x5afad7[_0xf6e9('0x31')]=qs[_0xf6e9('0x31')](_0x4a3d6d[_0xf6e9('0x45')][_0xf6e9('0x31')]);_0x5afad7[_0xf6e9('0x2f')]=qs[_0xf6e9('0x2f')](_0x4a3d6d['query'][_0xf6e9('0x2f')]);}return _0x117820[_0xf6e9('0x12c')](_0x5afad7);}})['then'](function(_0x1d252a){if(_0x1d252a){return _0x1d252a?{'count':_0x3c78d9,'rows':_0x1d252a}:null;}})[_0xf6e9('0x22')](respondWithResult(_0x5531ce,null))[_0xf6e9('0x2b')](handleError(_0x5531ce,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 08c1ca0..a700267 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 _0x202c=['save','update','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x692282,_0x279660){var _0x172aa8=function(_0x5bd982){while(--_0x5bd982){_0x692282['push'](_0x692282['shift']());}};_0x172aa8(++_0x279660);}(_0x202c,0x178));var _0xc202=function(_0x3536d1,_0x555abb){_0x3536d1=_0x3536d1-0x0;var _0x27ba9d=_0x202c[_0x3536d1];return _0x27ba9d;};'use strict';var EventEmitter=require(_0xc202('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc202('0x1')](0x0);var events={'afterCreate':_0xc202('0x2'),'afterUpdate':_0xc202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x215161){return function(_0x155c3b,_0x1763f5,_0x1a75ed){ChatWebsiteEvents['emit'](_0x215161+':'+_0x155c3b['id'],_0x155c3b);ChatWebsiteEvents[_0xc202('0x4')](_0x215161,_0x155c3b);_0x1a75ed(null);};}for(var e in events){if(events[_0xc202('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc202('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3a0f=['exports','ChatWebsite','update','remove','emit','hook'];(function(_0x14f9b1,_0x48441c){var _0x14c44d=function(_0x4e2033){while(--_0x4e2033){_0x14f9b1['push'](_0x14f9b1['shift']());}};_0x14c44d(++_0x48441c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x1185fb,_0x37613d){_0x1185fb=_0x1185fb-0x0;var _0x478556=_0x3a0f[_0x1185fb];return _0x478556;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xf3a0('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3a0('0x1'),'afterDestroy':_0xf3a0('0x2')};function emitEvent(_0x154115){return function(_0x31a1b4,_0x3d0886,_0xa3ed18){ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115+':'+_0x31a1b4['id'],_0x31a1b4);ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115,_0x31a1b4);_0xa3ed18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf3a0('0x4')](e,emitEvent(event));}}module[_0xf3a0('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 21ddb47..907b420 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 _0x1207=['exports','define','ChatWebsite','chat_websites','util','../../config/logger','bluebird','path','../../config/environment','./chatWebsite.attributes'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1207,0x194));var _0x7120=function(_0x2bd08d,_0x322a50){_0x2bd08d=_0x2bd08d-0x0;var _0x1d2e2d=_0x1207[_0x2bd08d];return _0x1d2e2d;};'use strict';var _=require('lodash');var util=require(_0x7120('0x0'));var logger=require(_0x7120('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7120('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7120('0x3'));var rimraf=require('rimraf');var config=require(_0x7120('0x4'));var attributes=require(_0x7120('0x5'));module[_0x7120('0x6')]=function(_0x47d139,_0x494a81){return _0x47d139[_0x7120('0x7')](_0x7120('0x8'),attributes,{'tableName':_0x7120('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x036c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','../../config/logger','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x036c,0x189));var _0xc036=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x036c[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xc036('0x0'));var util=require('util');var logger=require(_0xc036('0x1'))('api');var moment=require(_0xc036('0x2'));var BPromise=require(_0xc036('0x3'));var rp=require(_0xc036('0x4'));var fs=require('fs');var path=require(_0xc036('0x5'));var rimraf=require(_0xc036('0x6'));var config=require(_0xc036('0x7'));var attributes=require(_0xc036('0x8'));module[_0xc036('0x9')]=function(_0x36fa5b,_0xb8f234){return _0x36fa5b['define']('ChatWebsite',attributes,{'tableName':_0xc036('0xa'),'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 6fc4146..413ba06 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 _0x5812=['register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket'];(function(_0x531034,_0x13c1ec){var _0x225fcd=function(_0x591026){while(--_0x591026){_0x531034['push'](_0x531034['shift']());}};_0x225fcd(++_0x13c1ec);}(_0x5812,0xa6));var _0x2581=function(_0x3d5a85,_0xe82e44){_0x3d5a85=_0x3d5a85-0x0;var _0x403a6f=_0x5812[_0x3d5a85];return _0x403a6f;};'use strict';var _=require('lodash');var util=require(_0x2581('0x0'));var moment=require(_0x2581('0x1'));var BPromise=require(_0x2581('0x2'));var rs=require(_0x2581('0x3'));var fs=require('fs');var Redis=require(_0x2581('0x4'));var db=require(_0x2581('0x5'))['db'];var utils=require(_0x2581('0x6'));var logger=require(_0x2581('0x7'))('rpc');var config=require(_0x2581('0x8'));var jayson=require(_0x2581('0x9'));var client=jayson[_0x2581('0xa')][_0x2581('0xb')]({'port':0x232a});config[_0x2581('0xc')]=_[_0x2581('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2581('0xe'))(new Redis(config[_0x2581('0xc')]));require(_0x2581('0xf'))[_0x2581('0x10')](socket);function respondWithRpcPromise(_0x46e983,_0x42a388,_0x127264){return new BPromise(function(_0x59fc92,_0x442838){return client[_0x2581('0x11')](_0x46e983,_0x127264)['then'](function(_0x5c1781){logger['info'](_0x2581('0x12'),_0x42a388,_0x2581('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x42a388,_0x2581('0x13'),JSON[_0x2581('0x14')](_0x5c1781));if(_0x5c1781[_0x2581('0x15')]){if(_0x5c1781['error'][_0x2581('0x16')]===0x1f4){logger[_0x2581('0x15')](_0x2581('0x12'),_0x42a388,_0x5c1781['error'][_0x2581('0x17')]);return _0x442838(_0x5c1781[_0x2581('0x15')][_0x2581('0x17')]);}logger[_0x2581('0x15')](_0x2581('0x12'),_0x42a388,_0x5c1781[_0x2581('0x15')][_0x2581('0x17')]);return _0x59fc92(_0x5c1781[_0x2581('0x15')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x42a388,_0x2581('0x13'));_0x59fc92(_0x5c1781[_0x2581('0x18')][_0x2581('0x17')]);}})[_0x2581('0x19')](function(_0x51771e){logger[_0x2581('0x15')](_0x2581('0x12'),_0x42a388,_0x51771e);_0x442838(_0x51771e);});});}
\ No newline at end of file
+var _0x5d9c=['message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x5d9c,0xa5));var _0xc5d9=function(_0x2387ac,_0x45fcfc){_0x2387ac=_0x2387ac-0x0;var _0xb56c58=_0x5d9c[_0x2387ac];return _0xb56c58;};'use strict';var _=require(_0xc5d9('0x0'));var util=require(_0xc5d9('0x1'));var moment=require('moment');var BPromise=require(_0xc5d9('0x2'));var rs=require(_0xc5d9('0x3'));var fs=require('fs');var Redis=require(_0xc5d9('0x4'));var db=require(_0xc5d9('0x5'))['db'];var utils=require(_0xc5d9('0x6'));var logger=require(_0xc5d9('0x7'))(_0xc5d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xc5d9('0x9'));var client=jayson[_0xc5d9('0xa')][_0xc5d9('0xb')]({'port':0x232a});config[_0xc5d9('0xc')]=_[_0xc5d9('0xd')](config[_0xc5d9('0xc')],{'host':_0xc5d9('0xe'),'port':0x18eb});var socket=require(_0xc5d9('0xf'))(new Redis(config[_0xc5d9('0xc')]));require(_0xc5d9('0x10'))[_0xc5d9('0x11')](socket);function respondWithRpcPromise(_0x5745fc,_0x20ff22,_0x5df21f){return new BPromise(function(_0x42921a,_0x38d146){return client[_0xc5d9('0x12')](_0x5745fc,_0x5df21f)[_0xc5d9('0x13')](function(_0x37954a){logger['info'](_0xc5d9('0x14'),_0x20ff22,_0xc5d9('0x15'));logger['debug'](_0xc5d9('0x16'),_0x20ff22,'request\x20sent',JSON['stringify'](_0x37954a));if(_0x37954a[_0xc5d9('0x17')]){if(_0x37954a[_0xc5d9('0x17')]['code']===0x1f4){logger['error'](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')]['message']);return _0x38d146(_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);}logger[_0xc5d9('0x17')](_0xc5d9('0x14'),_0x20ff22,_0x37954a[_0xc5d9('0x17')][_0xc5d9('0x18')]);return _0x42921a(_0x37954a[_0xc5d9('0x17')]['message']);}else{logger[_0xc5d9('0x19')](_0xc5d9('0x14'),_0x20ff22,'request\x20sent');_0x42921a(_0x37954a[_0xc5d9('0x1a')]['message']);}})['catch'](function(_0x18947b){logger[_0xc5d9('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x20ff22,_0x18947b);_0x38d146(_0x18947b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3f7a339..e0175b9 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 _0x9129=['save','update','register','length','./chatWebsite.events'];(function(_0x57a0df,_0x2959d0){var _0x1e3442=function(_0x4ba681){while(--_0x4ba681){_0x57a0df['push'](_0x57a0df['shift']());}};_0x1e3442(++_0x2959d0);}(_0x9129,0x1da));var _0x9912=function(_0x251421,_0x34bf49){_0x251421=_0x251421-0x0;var _0xe9bbff=_0x9129[_0x251421];return _0xe9bbff;};'use strict';var ChatWebsiteEvents=require(_0x9912('0x0'));var events=[_0x9912('0x1'),'remove',_0x9912('0x2')];function createListener(_0x4966e8,_0x4a8017){return function(_0x5b1d99){_0x4a8017['emit'](_0x4966e8,_0x5b1d99);};}function removeListener(_0x20daed,_0xfe1023){return function(){ChatWebsiteEvents['removeListener'](_0x20daed,_0xfe1023);};}exports[_0x9912('0x3')]=function(_0x20c6bc){for(var _0x2cdda7=0x0,_0x5ce271=events[_0x9912('0x4')];_0x2cdda7<_0x5ce271;_0x2cdda7++){var _0x2afe9b=events[_0x2cdda7];var _0x2cd20a=createListener('chatWebsite:'+_0x2afe9b,_0x20c6bc);ChatWebsiteEvents['on'](_0x2afe9b,_0x2cd20a);}};
\ No newline at end of file
+var _0xecce=['remove','emit','removeListener','chatWebsite:'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xecce,0x1a4));var _0xeecc=function(_0x51b255,_0x2a91cf){_0x51b255=_0x51b255-0x0;var _0x43bd02=_0xecce[_0x51b255];return _0x43bd02;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xeecc('0x0'),'update'];function createListener(_0x53402b,_0xd2e85b){return function(_0x56908c){_0xd2e85b[_0xeecc('0x1')](_0x53402b,_0x56908c);};}function removeListener(_0x1d3ee2,_0x361a85){return function(){ChatWebsiteEvents[_0xeecc('0x2')](_0x1d3ee2,_0x361a85);};}exports['register']=function(_0x2aa21f){for(var _0x562083=0x0,_0x167e84=events['length'];_0x562083<_0x167e84;_0x562083++){var _0x3c60f0=events[_0x562083];var _0xf86cae=createListener(_0xeecc('0x3')+_0x3c60f0,_0x2aa21f);ChatWebsiteEvents['on'](_0x3c60f0,_0xf86cae);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index f41e1e8..0174234 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 _0xa7cd=['addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','single','file','addLogo','server/files/images/avatars/','%s-%s','now','originalname','addAvatar','addCustomerAvatar','/:id/notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa7cd,0x182));var _0xda7c=function(_0x5f5b7a,_0x563e61){_0x5f5b7a=_0x5f5b7a-0x0;var _0x7d276d=_0xa7cd[_0x5f5b7a];return _0x7d276d;};'use strict';var multer=require('multer');var util=require(_0xda7c('0x0'));var path=require(_0xda7c('0x1'));var timeout=require('connect-timeout');var express=require(_0xda7c('0x2'));var router=express[_0xda7c('0x3')]();var fs_extra=require(_0xda7c('0x4'));var auth=require(_0xda7c('0x5'));var interaction=require(_0xda7c('0x6'));var config=require(_0xda7c('0x7'));var controller=require(_0xda7c('0x8'));router['get']('/',auth[_0xda7c('0x9')](),controller[_0xda7c('0xa')]);router[_0xda7c('0xb')](_0xda7c('0xc'),auth[_0xda7c('0x9')](),controller[_0xda7c('0xd')]);router[_0xda7c('0xb')](_0xda7c('0xe'),auth['isAuthenticated'](),controller[_0xda7c('0xf')]);router[_0xda7c('0xb')](_0xda7c('0x10'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x11')]);router['get'](_0xda7c('0x12'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x13')]);router['get'](_0xda7c('0x14'),controller[_0xda7c('0x15')]);router[_0xda7c('0xb')](_0xda7c('0x16'),controller[_0xda7c('0x17')]);router['get'](_0xda7c('0x18'),controller[_0xda7c('0x19')]);router[_0xda7c('0xb')](_0xda7c('0x1a'),controller[_0xda7c('0x1b')]);router['get'](_0xda7c('0x1c'),auth[_0xda7c('0x9')](),controller['getInteractions']);router['get'](_0xda7c('0x1d'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xda7c('0x9')](),controller[_0xda7c('0x1e')]);router[_0xda7c('0xb')](_0xda7c('0x1f'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x20')]);router['get'](_0xda7c('0x21'),controller['getFields']);router[_0xda7c('0xb')]('/:id/offline_messages',auth[_0xda7c('0x9')](),controller[_0xda7c('0x22')]);router['get'](_0xda7c('0x23'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x24')]);router[_0xda7c('0x25')]('/',auth[_0xda7c('0x9')](),controller[_0xda7c('0x26')]);router['post'](_0xda7c('0x10'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x27')]);router[_0xda7c('0x25')](_0xda7c('0x12'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x28')]);var upload=multer({'storage':multer[_0xda7c('0x29')]({'destination':function(_0x3f3491,_0x94df04,_0x3a0850){_0x3a0850(null,path[_0xda7c('0x2a')](config[_0xda7c('0x2b')],_0xda7c('0x2c')));},'filename':function(_0x23f74e,_0xa3e5f3,_0x275d07){_0x275d07(null,util[_0xda7c('0x2d')]('%s-%s',Date['now'](),_0xa3e5f3['originalname']));}})});router[_0xda7c('0x25')]('/:id/logo',upload[_0xda7c('0x2e')](_0xda7c('0x2f')),controller[_0xda7c('0x30')]);var upload=multer({'storage':multer[_0xda7c('0x29')]({'destination':function(_0x31f4a3,_0x2df24d,_0x445409){_0x445409(null,path['join'](config[_0xda7c('0x2b')],_0xda7c('0x31')));},'filename':function(_0x344a5b,_0x1b5cc7,_0x42ba09){_0x42ba09(null,util[_0xda7c('0x2d')](_0xda7c('0x32'),Date[_0xda7c('0x33')](),_0x1b5cc7[_0xda7c('0x34')]));}})});router[_0xda7c('0x25')](_0xda7c('0x16'),upload[_0xda7c('0x2e')](_0xda7c('0x2f')),controller[_0xda7c('0x35')]);var upload=multer({'storage':multer[_0xda7c('0x29')]({'destination':function(_0x5e2aa3,_0x59eba3,_0x346e1d){_0x346e1d(null,path[_0xda7c('0x2a')](config['root'],_0xda7c('0x31')));},'filename':function(_0x178a64,_0x2f0762,_0x8d1939){_0x8d1939(null,util['format']('%s-%s',Date[_0xda7c('0x33')](),_0x2f0762['originalname']));}})});router[_0xda7c('0x25')](_0xda7c('0x18'),upload[_0xda7c('0x2e')](_0xda7c('0x2f')),controller[_0xda7c('0x36')]);var upload=multer({'storage':multer[_0xda7c('0x29')]({'destination':function(_0x48a3c9,_0xd13526,_0x29c5f1){_0x29c5f1(null,path[_0xda7c('0x2a')](config[_0xda7c('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x5531af,_0x5afa28,_0x54aa53){_0x54aa53(null,util[_0xda7c('0x2d')](_0xda7c('0x32'),Date['now'](),_0x5afa28['originalname']));}})});router[_0xda7c('0x25')](_0xda7c('0x1a'),upload[_0xda7c('0x2e')](_0xda7c('0x2f')),controller['addSystemAvatar']);router[_0xda7c('0x25')](_0xda7c('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3b943c,_0x430513,_0x261450){const _0x325ff2=path[_0xda7c('0x2a')](config[_0xda7c('0x2b')],_0xda7c('0x38'),_0xda7c('0x39'),'offline-chat');fs_extra[_0xda7c('0x3a')](_0x325ff2,function(){_0x261450(null,_0x325ff2);});},'filename':function(_0x21e6ec,_0x331ba7,_0x3dcc44){const _0x88c13b=_0x331ba7[_0xda7c('0x34')][_0xda7c('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x21fd8c=path[_0xda7c('0x3c')](_0x88c13b);const _0x51802c=Date[_0xda7c('0x33')]()+'-'+_0x88c13b[_0xda7c('0x3b')](_0x21fd8c,'')+_0x21fd8c;_0x3dcc44(null,_0x51802c);}})});router[_0xda7c('0x25')](_0xda7c('0x3d'),offlineUploadMulter[_0xda7c('0x3e')](),controller[_0xda7c('0x3f')]);router['post'](_0xda7c('0x1c'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x40')]);router['post'](_0xda7c('0x41'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x42')]);router[_0xda7c('0x25')](_0xda7c('0x1f'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x43')]);router[_0xda7c('0x25')](_0xda7c('0x23'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x44')]);router['put']('/:id',auth[_0xda7c('0x9')](),controller[_0xda7c('0x45')]);router[_0xda7c('0x46')](_0xda7c('0xe'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xda7c('0x10'),auth['isAuthenticated'](),controller[_0xda7c('0x47')]);router[_0xda7c('0x46')](_0xda7c('0x12'),auth['isAuthenticated'](),controller[_0xda7c('0x48')]);router[_0xda7c('0x46')](_0xda7c('0x23'),auth[_0xda7c('0x9')](),controller[_0xda7c('0x49')]);module[_0xda7c('0x4a')]=router;
\ No newline at end of file
+var _0xca82=['originalname','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/applications','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','join'];(function(_0x1b7e02,_0x18b016){var _0x1150a4=function(_0x2b3171){while(--_0x2b3171){_0x1b7e02['push'](_0x1b7e02['shift']());}};_0x1150a4(++_0x18b016);}(_0xca82,0x187));var _0x2ca8=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xca82[_0x3640e2];return _0x277415;};'use strict';var multer=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var path=require('path');var timeout=require(_0x2ca8('0x2'));var express=require(_0x2ca8('0x3'));var router=express[_0x2ca8('0x4')]();var fs_extra=require(_0x2ca8('0x5'));var auth=require(_0x2ca8('0x6'));var interaction=require(_0x2ca8('0x7'));var config=require('../../config/environment');var controller=require(_0x2ca8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2ca8('0x9'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0xb')]);router['get'](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0xd')]);router[_0x2ca8('0xe')](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x10')]);router[_0x2ca8('0xe')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x11')]);router[_0x2ca8('0xe')](_0x2ca8('0x12'),controller[_0x2ca8('0x13')]);router[_0x2ca8('0xe')](_0x2ca8('0x14'),controller[_0x2ca8('0x15')]);router['get'](_0x2ca8('0x16'),controller['getCustomerAvatar']);router['get'](_0x2ca8('0x17'),controller[_0x2ca8('0x18')]);router['get']('/:id/interactions',auth[_0x2ca8('0xa')](),controller['getInteractions']);router[_0x2ca8('0xe')](_0x2ca8('0x19'),controller[_0x2ca8('0x1a')]);router[_0x2ca8('0xe')]('/:id/applications',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x1b')]);router[_0x2ca8('0xe')](_0x2ca8('0x1c'),auth['isAuthenticated'](),controller[_0x2ca8('0x1d')]);router[_0x2ca8('0xe')](_0x2ca8('0x1e'),controller['getFields']);router[_0x2ca8('0xe')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2ca8('0x1f')]);router[_0x2ca8('0xe')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x21')]);router['post']('/',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x22')]);router['post'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x23')]);router[_0x2ca8('0x24')]('/:id/canned_answers',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x25')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xc932be,_0x37993b,_0x704f92){_0x704f92(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x28')));},'filename':function(_0x5f3c95,_0x5a7a2e,_0xc10569){_0xc10569(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x5a7a2e['originalname']));}})});router[_0x2ca8('0x24')](_0x2ca8('0x12'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0xf86f7a,_0x52aa01,_0x29ecd1){_0x29ecd1(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],'server/files/images/avatars/'));},'filename':function(_0x5669d4,_0x4a9c29,_0x346579){_0x346579(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date['now'](),_0x4a9c29[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x14'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x379b33,_0x3361eb,_0x45ffd7){_0x45ffd7(null,path[_0x2ca8('0x2e')](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x5467b7,_0x1a8ad5,_0x40633e){_0x40633e(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x1a8ad5[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x16'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x31')]);var upload=multer({'storage':multer[_0x2ca8('0x26')]({'destination':function(_0x3b0cb2,_0x1be8bd,_0x36a791){_0x36a791(null,path['join'](config[_0x2ca8('0x27')],_0x2ca8('0x30')));},'filename':function(_0x817005,_0x41804e,_0x8bc892){_0x8bc892(null,util[_0x2ca8('0x29')](_0x2ca8('0x2a'),Date[_0x2ca8('0x2b')](),_0x41804e[_0x2ca8('0x2f')]));}})});router[_0x2ca8('0x24')](_0x2ca8('0x17'),upload[_0x2ca8('0x2c')](_0x2ca8('0x2d')),controller[_0x2ca8('0x32')]);router[_0x2ca8('0x24')](_0x2ca8('0x33'),controller[_0x2ca8('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x30255a,_0x20d4c5,_0x4d707f){const _0x4aa8fd=path['join'](config['root'],_0x2ca8('0x35'),'attachments',_0x2ca8('0x36'));fs_extra['ensureDir'](_0x4aa8fd,function(){_0x4d707f(null,_0x4aa8fd);});},'filename':function(_0x51412e,_0x1f68cb,_0xa998bc){const _0x283c12=_0x1f68cb['originalname'][_0x2ca8('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x271d88=path[_0x2ca8('0x38')](_0x283c12);const _0x3a6e8f=Date[_0x2ca8('0x2b')]()+'-'+_0x283c12[_0x2ca8('0x37')](_0x271d88,'')+_0x271d88;_0xa998bc(null,_0x3a6e8f);}})});router[_0x2ca8('0x24')](_0x2ca8('0x39'),offlineUploadMulter[_0x2ca8('0x3a')](),controller[_0x2ca8('0x3b')]);router[_0x2ca8('0x24')](_0x2ca8('0x3c'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3d')]);router[_0x2ca8('0x24')](_0x2ca8('0x3e'),auth[_0x2ca8('0xa')](),controller['addApplications']);router['post'](_0x2ca8('0x1c'),auth[_0x2ca8('0xa')](),controller['addProactiveActions']);router[_0x2ca8('0x24')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x3f')]);router[_0x2ca8('0x40')]('/:id',auth['isAuthenticated'](),controller[_0x2ca8('0x41')]);router[_0x2ca8('0x42')](_0x2ca8('0xc'),auth['isAuthenticated'](),controller[_0x2ca8('0x43')]);router['delete'](_0x2ca8('0xf'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x44')]);router['delete'](_0x2ca8('0x45'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x46')]);router[_0x2ca8('0x42')](_0x2ca8('0x20'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x47')]);module[_0x2ca8('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 7981896..5aa27e3 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 _0x5a9e=['exports','STRING','Google'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0x5a9e[_0x52a6e3];return _0x8910d0;};'use strict';var Sequelize=require('sequelize');module[_0xe5a9('0x0')]={'name':{'type':Sequelize[_0xe5a9('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xe5a9('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xe5a9('0x1')]},'data2':{'type':Sequelize[_0xe5a9('0x1')]}};
\ No newline at end of file
+var _0x34f2=['ENUM','AmazonAWS','Google','STRING','sequelize','exports'];(function(_0x5f0b46,_0x1e9de1){var _0x53f7d4=function(_0x30fbc4){while(--_0x30fbc4){_0x5f0b46['push'](_0x5f0b46['shift']());}};_0x53f7d4(++_0x1e9de1);}(_0x34f2,0x15a));var _0x234f=function(_0x3f5e9a,_0x5bb5f1){_0x3f5e9a=_0x3f5e9a-0x0;var _0x30b558=_0x34f2[_0x3f5e9a];return _0x30b558;};'use strict';var Sequelize=require(_0x234f('0x0'));module[_0x234f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x234f('0x2')](_0x234f('0x3'),_0x234f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x234f('0x5')]},'data2':{'type':Sequelize[_0x234f('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f22c97b..3800f34 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x2676cf,_0x509894){var _0x5263b6=function(_0x1a516b){while(--_0x1a516b){_0x2676cf['push'](_0x2676cf['shift']());}};_0x5263b6(++_0x509894);}(_0x0b0e,0x187));var _0xe0b0=function(_0x422ac3,_0x48bbd4){_0x422ac3=_0x422ac3-0x0;var _0x53c0d4=_0x0b0e[_0x422ac3];return _0x53c0d4;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0xfe990b,_0x20bd5a){var _0x489968=function(_0x4d19ec){while(--_0x4d19ec){_0xfe990b['push'](_0xfe990b['shift']());}};_0x489968(++_0x20bd5a);}(_0x7a54,0x106));var _0x47a5=function(_0x37b089,_0x54ecc7){_0x37b089=_0x37b089-0x0;var _0x2eab80=_0x7a54[_0x37b089];return _0x2eab80;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c143c38..35cb88f 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 _0x4270=['bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','api'];(function(_0x4a7480,_0x3cd95b){var _0x25775a=function(_0x22bd81){while(--_0x22bd81){_0x4a7480['push'](_0x4a7480['shift']());}};_0x25775a(++_0x3cd95b);}(_0x4270,0x166));var _0x0427=function(_0xaf9bda,_0x2dc0f9){_0xaf9bda=_0xaf9bda-0x0;var _0x505e48=_0x4270[_0xaf9bda];return _0x505e48;};'use strict';var _=require(_0x0427('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0427('0x1'));var moment=require('moment');var BPromise=require(_0x0427('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0427('0x3'));var rimraf=require('rimraf');var config=require(_0x0427('0x4'));var attributes=require(_0x0427('0x5'));module[_0x0427('0x6')]=function(_0xfd5a1c,_0x543681){return _0xfd5a1c[_0x0427('0x7')](_0x0427('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x510f=['define','CloudProvider','cloud_providers','util','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x510f,0x1a0));var _0xf510=function(_0x3fc59a,_0x5c0c1d){_0x3fc59a=_0x3fc59a-0x0;var _0x2af724=_0x510f[_0x3fc59a];return _0x2af724;};'use strict';var _=require('lodash');var util=require(_0xf510('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf510('0x1'));var BPromise=require(_0xf510('0x2'));var rp=require(_0xf510('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x53bf8a,_0x1fce43){return _0x53bf8a[_0xf510('0x4')](_0xf510('0x5'),attributes,{'tableName':_0xf510('0x6'),'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 fcafc00..29036b9 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 _0x781d=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x5ee908,_0x1ee8ac){var _0x899c41=function(_0x26bf11){while(--_0x26bf11){_0x5ee908['push'](_0x5ee908['shift']());}};_0x899c41(++_0x1ee8ac);}(_0x781d,0x14a));var _0xd781=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x781d[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('CloudProvider,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}
\ No newline at end of file
+var _0x1f81=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x1f81,0xab));var _0x11f8=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x1f81[_0x40be86];return _0xda3c3b;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var moment=require('moment');var BPromise=require(_0x11f8('0x2'));var rs=require(_0x11f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f8('0x4'))['db'];var utils=require(_0x11f8('0x5'));var logger=require(_0x11f8('0x6'))(_0x11f8('0x7'));var config=require(_0x11f8('0x8'));var jayson=require(_0x11f8('0x9'));var client=jayson[_0x11f8('0xa')][_0x11f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fd0cf,_0x1d899d,_0x8009d7){return new BPromise(function(_0x1cecbe,_0x1bc74d){return client[_0x11f8('0xc')](_0x4fd0cf,_0x8009d7)[_0x11f8('0xd')](function(_0x5ec20c){logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));logger[_0x11f8('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1d899d,_0x11f8('0x10'),JSON[_0x11f8('0x12')](_0x5ec20c));if(_0x5ec20c[_0x11f8('0x13')]){if(_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x14')]===0x1f4){logger[_0x11f8('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1bc74d(_0x5ec20c[_0x11f8('0x13')]['message']);}logger[_0x11f8('0x13')](_0x11f8('0xf'),_0x1d899d,_0x5ec20c[_0x11f8('0x13')][_0x11f8('0x15')]);return _0x1cecbe(_0x5ec20c['error'][_0x11f8('0x15')]);}else{logger[_0x11f8('0xe')](_0x11f8('0xf'),_0x1d899d,_0x11f8('0x10'));_0x1cecbe(_0x5ec20c[_0x11f8('0x16')]['message']);}})[_0x11f8('0x17')](function(_0x3e7fb3){logger['error'](_0x11f8('0xf'),_0x1d899d,_0x3e7fb3);_0x1bc74d(_0x3e7fb3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e58c2e0..e327cd1 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 _0x4b02=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','update','delete','destroy','util','path','express','Router','fs-extra'];(function(_0x689740,_0x15278f){var _0x413ae1=function(_0x2582e5){while(--_0x2582e5){_0x689740['push'](_0x689740['shift']());}};_0x413ae1(++_0x15278f);}(_0x4b02,0xcd));var _0x24b0=function(_0x518c05,_0x705614){_0x518c05=_0x518c05-0x0;var _0x5adb6e=_0x4b02[_0x518c05];return _0x5adb6e;};'use strict';var multer=require('multer');var util=require(_0x24b0('0x0'));var path=require(_0x24b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x24b0('0x2'));var router=express[_0x24b0('0x3')]();var fs_extra=require(_0x24b0('0x4'));var auth=require(_0x24b0('0x5'));var interaction=require(_0x24b0('0x6'));var config=require(_0x24b0('0x7'));var controller=require(_0x24b0('0x8'));router[_0x24b0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24b0('0x9')]('/:id',auth[_0x24b0('0xa')](),controller['show']);router['post']('/',auth[_0x24b0('0xa')](),controller['create']);router['put']('/:id',auth[_0x24b0('0xa')](),controller[_0x24b0('0xb')]);router[_0x24b0('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x24b0('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x8b52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x541b39,_0x1ac387){var _0x31aec8=function(_0x13f4ea){while(--_0x13f4ea){_0x541b39['push'](_0x541b39['shift']());}};_0x31aec8(++_0x1ac387);}(_0x8b52,0x151));var _0x28b5=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8b52[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var path=require(_0x28b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b5('0x3'));var router=express[_0x28b5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28b5('0x5'));var interaction=require(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));var controller=require(_0x28b5('0x8'));router[_0x28b5('0x9')]('/',auth[_0x28b5('0xa')](),controller[_0x28b5('0xb')]);router[_0x28b5('0x9')](_0x28b5('0xc'),auth['isAuthenticated'](),controller[_0x28b5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x28b5('0xe')]);router[_0x28b5('0xf')]('/:id',auth[_0x28b5('0xa')](),controller[_0x28b5('0x10')]);router['delete'](_0x28b5('0xc'),auth[_0x28b5('0xa')](),controller[_0x28b5('0x11')]);module[_0x28b5('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2eab3da..3abf093 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 _0x54a9=['sequelize','STRING'];(function(_0x3bddde,_0x1409a1){var _0x2f5d10=function(_0x2a0035){while(--_0x2a0035){_0x3bddde['push'](_0x3bddde['shift']());}};_0x2f5d10(++_0x1409a1);}(_0x54a9,0x186));var _0x954a=function(_0x940cb7,_0x25ab25){_0x940cb7=_0x940cb7-0x0;var _0x20ff52=_0x54a9[_0x940cb7];return _0x20ff52;};'use strict';var Sequelize=require(_0x954a('0x0'));module['exports']={'name':{'type':Sequelize[_0x954a('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x954a('0x1')]},'companyId':{'type':Sequelize[_0x954a('0x1')]},'website':{'type':Sequelize[_0x954a('0x1')]},'phone':{'type':Sequelize[_0x954a('0x1')]},'fax':{'type':Sequelize[_0x954a('0x1')]},'type':{'type':Sequelize[_0x954a('0x1')]},'street':{'type':Sequelize[_0x954a('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x954a('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x954a('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x954a('0x1')]},'sStreet':{'type':Sequelize[_0x954a('0x1')]},'sPostalCode':{'type':Sequelize[_0x954a('0x1')]},'sCity':{'type':Sequelize[_0x954a('0x1')]},'sCountry':{'type':Sequelize[_0x954a('0x1')]},'description':{'type':Sequelize[_0x954a('0x1')]}};
\ No newline at end of file
+var _0x9df1=['name','sequelize','exports','STRING'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x9df1,0xcd));var _0x19df=function(_0x30e278,_0x30caeb){_0x30e278=_0x30e278-0x0;var _0xd74914=_0x9df1[_0x30e278];return _0xd74914;};'use strict';var Sequelize=require(_0x19df('0x0'));module[_0x19df('0x1')]={'name':{'type':Sequelize[_0x19df('0x2')],'unique':_0x19df('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x19df('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x19df('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x19df('0x2')]},'street':{'type':Sequelize[_0x19df('0x2')]},'postalCode':{'type':Sequelize[_0x19df('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x19df('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x19df('0x2')]},'sStreet':{'type':Sequelize[_0x19df('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x19df('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5a5bcc8..4ec1082 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 _0xbbbb=['send','CmCompany','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','options','include','findAll','rows','catch','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','describe','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','stack','name'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xbbbb,0x128));var _0xbbbb=function(_0x405235,_0xc9d51b){_0x405235=_0x405235-0x0;var _0x4c271f=_0xbbbb[_0x405235];return _0x4c271f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbbb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbbb('0x1'));var rp=require(_0xbbbb('0x2'));var moment=require(_0xbbbb('0x3'));var BPromise=require(_0xbbbb('0x4'));var Mustache=require(_0xbbbb('0x5'));var util=require(_0xbbbb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbbbb('0x7'));var ejs=require(_0xbbbb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbbbb('0x9'));var crypto=require(_0xbbbb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbbbb('0xb'));var toCsv=require(_0xbbbb('0x7'));var querystring=require(_0xbbbb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbbbb('0xd'));var as=require(_0xbbbb('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbbb('0xf'))('api');var utils=require(_0xbbbb('0x10'));var config=require(_0xbbbb('0x11'));var licenseUtil=require(_0xbbbb('0x12'));var db=require(_0xbbbb('0x13'))['db'];function respondWithStatusCode(_0x444731,_0x1b57ab){_0x1b57ab=_0x1b57ab||0xcc;return function(_0x807208){if(_0x807208){return _0x444731[_0xbbbb('0x14')](_0x1b57ab);}return _0x444731[_0xbbbb('0x15')](_0x1b57ab)[_0xbbbb('0x16')]();};}function respondWithResult(_0x4ab5f6,_0x1b5480){_0x1b5480=_0x1b5480||0xc8;return function(_0x5b2b92){if(_0x5b2b92){return _0x4ab5f6[_0xbbbb('0x15')](_0x1b5480)[_0xbbbb('0x17')](_0x5b2b92);}};}function respondWithFilteredResult(_0x3964a3,_0x5d1fb0){return function(_0xf80a94){if(_0xf80a94){var _0x389515=typeof _0x5d1fb0[_0xbbbb('0x18')]===_0xbbbb('0x19')&&typeof _0x5d1fb0['limit']===_0xbbbb('0x19');var _0x24613d=_0xf80a94[_0xbbbb('0x1a')];var _0x2e59e6=_0x389515?0x0:_0x5d1fb0['offset'];var _0x5bfcf8=_0x389515?_0xf80a94[_0xbbbb('0x1a')]:_0x5d1fb0[_0xbbbb('0x18')]+_0x5d1fb0['limit'];var _0x434918;if(_0x5bfcf8>=_0x24613d){_0x5bfcf8=_0x24613d;_0x434918=0xc8;}else{_0x434918=0xce;}_0x3964a3[_0xbbbb('0x15')](_0x434918);return _0x3964a3[_0xbbbb('0x1b')](_0xbbbb('0x1c'),_0x2e59e6+'-'+_0x5bfcf8+'/'+_0x24613d)[_0xbbbb('0x17')](_0xf80a94);}return null;};}function patchUpdates(_0x1bbf39){return function(_0x1bd676){try{jsonpatch[_0xbbbb('0x1d')](_0x1bd676,_0x1bbf39,!![]);}catch(_0x1e1f5c){return BPromise[_0xbbbb('0x1e')](_0x1e1f5c);}return _0x1bd676[_0xbbbb('0x1f')]();};}function saveUpdates(_0x7401a2,_0x2e5784){return function(_0x2943c8){if(_0x2943c8){return _0x2943c8[_0xbbbb('0x20')](_0x7401a2)['then'](function(_0x15128a){return _0x15128a;});}return null;};}function removeEntity(_0x36231b,_0x2c8e7e){return function(_0x41596c){if(_0x41596c){return _0x41596c[_0xbbbb('0x21')]()[_0xbbbb('0x22')](function(){var _0x5b8dd5=_0x41596c[_0xbbbb('0x23')]({'plain':!![]});var _0x5caf6d=_0xbbbb('0x24');return db[_0xbbbb('0x25')][_0xbbbb('0x21')]({'where':{'type':_0x5caf6d,'resourceId':_0x5b8dd5['id']}})['then'](function(){return _0x41596c;});})[_0xbbbb('0x22')](function(){_0x36231b[_0xbbbb('0x15')](0xcc)[_0xbbbb('0x16')]();});}};}function handleEntityNotFound(_0xef89f6,_0x1525e7){return function(_0x25b3ed){if(!_0x25b3ed){_0xef89f6[_0xbbbb('0x14')](0x194);}return _0x25b3ed;};}function handleError(_0x230885,_0x3e0101){_0x3e0101=_0x3e0101||0x1f4;return function(_0x5b33f2){logger['error'](_0x5b33f2[_0xbbbb('0x26')]);if(_0x5b33f2[_0xbbbb('0x27')]){delete _0x5b33f2['name'];}_0x230885[_0xbbbb('0x15')](_0x3e0101)[_0xbbbb('0x28')](_0x5b33f2);};}exports['index']=function(_0xb0ee89,_0x49607f){var _0x2117a5={},_0x334a55={},_0x553a00={'count':0x0,'rows':[]};return db[_0xbbbb('0x29')]['describe']()[_0xbbbb('0x22')](function(_0x437cc1){_0x334a55['model']=_['keys'](_0x437cc1);_0x334a55[_0xbbbb('0x2a')]=_['keys'](_0xb0ee89[_0xbbbb('0x2a')]);_0x334a55['filters']=_[_0xbbbb('0x2b')](_0x334a55[_0xbbbb('0x2c')],_0x334a55['query']);_0x2117a5[_0xbbbb('0x2d')]=_[_0xbbbb('0x2b')](_0x334a55[_0xbbbb('0x2c')],qs[_0xbbbb('0x2e')](_0xb0ee89['query'][_0xbbbb('0x2e')]));_0x2117a5[_0xbbbb('0x2d')]=_0x2117a5['attributes'][_0xbbbb('0x2f')]?_0x2117a5['attributes']:_0x334a55['model'];if(!_0xb0ee89[_0xbbbb('0x2a')][_0xbbbb('0x30')]('nolimit')){_0x2117a5[_0xbbbb('0x31')]=qs[_0xbbbb('0x31')](_0xb0ee89['query'][_0xbbbb('0x31')]);_0x2117a5['offset']=qs[_0xbbbb('0x18')](_0xb0ee89[_0xbbbb('0x2a')][_0xbbbb('0x18')]);}_0x2117a5[_0xbbbb('0x32')]=qs[_0xbbbb('0x33')](_0xb0ee89[_0xbbbb('0x2a')][_0xbbbb('0x33')]);_0x2117a5[_0xbbbb('0x34')]=qs[_0xbbbb('0x35')](_[_0xbbbb('0x36')](_0xb0ee89[_0xbbbb('0x2a')],_0x334a55[_0xbbbb('0x35')]),_0x437cc1);if(_0xb0ee89[_0xbbbb('0x2a')][_0xbbbb('0x37')]){_0x2117a5['where']=_[_0xbbbb('0x38')](_0x2117a5[_0xbbbb('0x34')],{'$or':_[_0xbbbb('0x39')](_0x2117a5[_0xbbbb('0x2d')],function(_0x299618){var _0x3e59e0={};_0x3e59e0[_0x299618]={'$like':'%'+_0xb0ee89['query']['filter']+'%'};return _0x3e59e0;})});}_0x2117a5=_[_0xbbbb('0x38')]({},_0x2117a5,_0xb0ee89[_0xbbbb('0x3a')]);var _0x23d0b5={'where':_0x2117a5[_0xbbbb('0x34')]};return db[_0xbbbb('0x29')]['count'](_0x23d0b5)['then'](function(_0x34126b){_0x553a00[_0xbbbb('0x1a')]=_0x34126b;if(_0xb0ee89['query']['includeAll']){_0x2117a5[_0xbbbb('0x3b')]=[{'all':!![]}];}return db[_0xbbbb('0x29')][_0xbbbb('0x3c')](_0x2117a5);})[_0xbbbb('0x22')](function(_0xac095e){_0x553a00[_0xbbbb('0x3d')]=_0xac095e;return _0x553a00;})[_0xbbbb('0x22')](respondWithFilteredResult(_0x49607f,_0x2117a5))[_0xbbbb('0x3e')](handleError(_0x49607f,null));})[_0xbbbb('0x3e')](handleError(_0x49607f,null));};exports['show']=function(_0x3e3f72,_0x25dc1f){var _0x59f5d5={'raw':![],'where':{'id':_0x3e3f72['params']['id']}},_0x53efbb={};_0x53efbb[_0xbbbb('0x2c')]=_[_0xbbbb('0x3f')](db[_0xbbbb('0x29')][_0xbbbb('0x40')]);_0x53efbb['query']=_[_0xbbbb('0x3f')](_0x3e3f72[_0xbbbb('0x2a')]);_0x53efbb[_0xbbbb('0x35')]=_[_0xbbbb('0x2b')](_0x53efbb['model'],_0x53efbb['query']);_0x59f5d5[_0xbbbb('0x2d')]=_[_0xbbbb('0x2b')](_0x53efbb[_0xbbbb('0x2c')],qs[_0xbbbb('0x2e')](_0x3e3f72[_0xbbbb('0x2a')][_0xbbbb('0x2e')]));_0x59f5d5[_0xbbbb('0x2d')]=_0x59f5d5[_0xbbbb('0x2d')][_0xbbbb('0x2f')]?_0x59f5d5[_0xbbbb('0x2d')]:_0x53efbb[_0xbbbb('0x2c')];if(_0x3e3f72[_0xbbbb('0x2a')]['includeAll']){_0x59f5d5[_0xbbbb('0x3b')]=[{'all':!![]}];}_0x59f5d5=_['merge']({},_0x59f5d5,_0x3e3f72[_0xbbbb('0x3a')]);return db[_0xbbbb('0x29')][_0xbbbb('0x41')](_0x59f5d5)[_0xbbbb('0x22')](handleEntityNotFound(_0x25dc1f,null))[_0xbbbb('0x22')](respondWithResult(_0x25dc1f,null))[_0xbbbb('0x3e')](handleError(_0x25dc1f,null));};exports[_0xbbbb('0x42')]=function(_0x5613a8,_0x27a2cb){return db[_0xbbbb('0x29')]['create'](_0x5613a8[_0xbbbb('0x43')],{})[_0xbbbb('0x22')](function(_0x175ae0){var _0x1809bf=_0x5613a8[_0xbbbb('0x44')][_0xbbbb('0x23')]({'plain':!![]});if(!_0x1809bf)throw new Error(_0xbbbb('0x45'));if(_0x1809bf[_0xbbbb('0x46')]===_0xbbbb('0x44')){var _0x388f40=_0x175ae0[_0xbbbb('0x23')]({'plain':!![]});var _0x5d13e8=_0xbbbb('0x24');return db[_0xbbbb('0x47')][_0xbbbb('0x41')]({'where':{'name':_0x5d13e8,'userProfileId':_0x1809bf[_0xbbbb('0x48')]},'raw':!![]})['then'](function(_0x2de578){if(_0x2de578&&_0x2de578[_0xbbbb('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x388f40['name'],'resourceId':_0x388f40['id'],'type':_0x2de578[_0xbbbb('0x27')],'sectionId':_0x2de578['id']},{})['then'](function(){return _0x175ae0;});}else{return _0x175ae0;}})[_0xbbbb('0x3e')](function(_0x39614c){logger[_0xbbbb('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39614c);throw _0x39614c;});}return _0x175ae0;})[_0xbbbb('0x22')](respondWithResult(_0x27a2cb,0xc9))['catch'](handleError(_0x27a2cb,null));};exports[_0xbbbb('0x20')]=function(_0x4fa3a5,_0x1dbdc6){if(_0x4fa3a5[_0xbbbb('0x43')]['id']){delete _0x4fa3a5['body']['id'];}return db[_0xbbbb('0x29')][_0xbbbb('0x41')]({'where':{'id':_0x4fa3a5[_0xbbbb('0x4b')]['id']}})[_0xbbbb('0x22')](handleEntityNotFound(_0x1dbdc6,null))['then'](saveUpdates(_0x4fa3a5[_0xbbbb('0x43')],null))['then'](respondWithResult(_0x1dbdc6,null))[_0xbbbb('0x3e')](handleError(_0x1dbdc6,null));};exports[_0xbbbb('0x21')]=function(_0x4d7aa9,_0x281f1e){return db[_0xbbbb('0x29')]['find']({'where':{'id':_0x4d7aa9[_0xbbbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x281f1e,null))[_0xbbbb('0x22')](removeEntity(_0x281f1e,null))['catch'](handleError(_0x281f1e,null));};exports[_0xbbbb('0x4c')]=function(_0x2e9881,_0x2dd412){return db['CmCompany'][_0xbbbb('0x4c')]()[_0xbbbb('0x22')](respondWithResult(_0x2dd412,null))[_0xbbbb('0x3e')](handleError(_0x2dd412,null));};exports[_0xbbbb('0x4d')]=function(_0x240b21,_0x570ff3,_0x2a3ccd){return db[_0xbbbb('0x4e')][_0xbbbb('0x41')]({'where':{'id':_0x240b21[_0xbbbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x570ff3,null))[_0xbbbb('0x22')](function(_0x956e01){if(_0x956e01){return _0x956e01[_0xbbbb('0x4d')](_0x240b21[_0xbbbb('0x43')][_0xbbbb('0x4f')],_[_0xbbbb('0x50')](_0x240b21[_0xbbbb('0x43')],[_0xbbbb('0x4f'),'id'])||{});}})[_0xbbbb('0x22')](respondWithResult(_0x570ff3,null))[_0xbbbb('0x3e')](handleError(_0x570ff3,null));};exports[_0xbbbb('0x51')]=function(_0x1b6ded,_0x3fa9d4,_0x1a8956){var _0x2fa4c0={};var _0x1e95f2={};var _0xb90ffd;var _0x24811a;return db[_0xbbbb('0x29')][_0xbbbb('0x52')]({'where':{'id':_0x1b6ded[_0xbbbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3fa9d4,null))[_0xbbbb('0x22')](function(_0x4459af){if(_0x4459af){_0xb90ffd=_0x4459af;_0x1e95f2['model']=_[_0xbbbb('0x3f')](db['CmContact'][_0xbbbb('0x40')]);_0x1e95f2[_0xbbbb('0x2a')]=_[_0xbbbb('0x3f')](_0x1b6ded[_0xbbbb('0x2a')]);_0x1e95f2[_0xbbbb('0x35')]=_[_0xbbbb('0x2b')](_0x1e95f2[_0xbbbb('0x2c')],_0x1e95f2[_0xbbbb('0x2a')]);_0x2fa4c0[_0xbbbb('0x2d')]=_[_0xbbbb('0x2b')](_0x1e95f2[_0xbbbb('0x2c')],qs[_0xbbbb('0x2e')](_0x1b6ded[_0xbbbb('0x2a')]['fields']));_0x2fa4c0[_0xbbbb('0x2d')]=_0x2fa4c0[_0xbbbb('0x2d')][_0xbbbb('0x2f')]?_0x2fa4c0['attributes']:_0x1e95f2[_0xbbbb('0x2c')];_0x2fa4c0[_0xbbbb('0x32')]=qs[_0xbbbb('0x33')](_0x1b6ded[_0xbbbb('0x2a')]['sort']);_0x2fa4c0['where']=qs[_0xbbbb('0x35')](_['pick'](_0x1b6ded[_0xbbbb('0x2a')],_0x1e95f2['filters']));if(_0x1b6ded[_0xbbbb('0x2a')][_0xbbbb('0x37')]){_0x2fa4c0['where']=_[_0xbbbb('0x38')](_0x2fa4c0[_0xbbbb('0x34')],{'$or':_['map'](_0x2fa4c0[_0xbbbb('0x2d')],function(_0x1cd0b9){var _0x2d7d1c={};_0x2d7d1c[_0x1cd0b9]={'$like':'%'+_0x1b6ded[_0xbbbb('0x2a')][_0xbbbb('0x37')]+'%'};return _0x2d7d1c;})});}_0x2fa4c0=_['merge']({},_0x2fa4c0,_0x1b6ded[_0xbbbb('0x3a')]);return _0xb90ffd[_0xbbbb('0x51')](_0x2fa4c0);}})[_0xbbbb('0x22')](function(_0x2c2bbc){if(_0x2c2bbc){_0x24811a=_0x2c2bbc['length'];if(!_0x1b6ded[_0xbbbb('0x2a')]['hasOwnProperty'](_0xbbbb('0x53'))){_0x2fa4c0[_0xbbbb('0x31')]=qs[_0xbbbb('0x31')](_0x1b6ded[_0xbbbb('0x2a')][_0xbbbb('0x31')]);_0x2fa4c0[_0xbbbb('0x18')]=qs[_0xbbbb('0x18')](_0x1b6ded[_0xbbbb('0x2a')][_0xbbbb('0x18')]);}return _0xb90ffd['getContacts'](_0x2fa4c0);}})[_0xbbbb('0x22')](function(_0x2899d9){if(_0x2899d9){return _0x2899d9?{'count':_0x24811a,'rows':_0x2899d9}:null;}})[_0xbbbb('0x22')](respondWithResult(_0x3fa9d4,null))[_0xbbbb('0x3e')](handleError(_0x3fa9d4,null));};
\ No newline at end of file
+var _0x8391=['find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','filter','includeAll','findAll','rows','catch','rawAttributes','include','merge','options'];(function(_0xcadb58,_0x1e17d){var _0xf8c6c3=function(_0x12cdf5){while(--_0x12cdf5){_0xcadb58['push'](_0xcadb58['shift']());}};_0xf8c6c3(++_0x1e17d);}(_0x8391,0x1cd));var _0x1839=function(_0x15ae07,_0x3a6b7d){_0x15ae07=_0x15ae07-0x0;var _0x4585dc=_0x8391[_0x15ae07];return _0x4585dc;};'use strict';var emlformat=require(_0x1839('0x0'));var rimraf=require(_0x1839('0x1'));var zipdir=require(_0x1839('0x2'));var jsonpatch=require(_0x1839('0x3'));var rp=require(_0x1839('0x4'));var moment=require('moment');var BPromise=require(_0x1839('0x5'));var Mustache=require(_0x1839('0x6'));var util=require(_0x1839('0x7'));var path=require(_0x1839('0x8'));var sox=require('sox');var csv=require(_0x1839('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1839('0xa'));var _=require(_0x1839('0xb'));var squel=require(_0x1839('0xc'));var crypto=require(_0x1839('0xd'));var jsforce=require(_0x1839('0xe'));var deskjs=require(_0x1839('0xf'));var toCsv=require(_0x1839('0x9'));var querystring=require(_0x1839('0x10'));var Papa=require(_0x1839('0x11'));var Redis=require(_0x1839('0x12'));var authService=require(_0x1839('0x13'));var qs=require(_0x1839('0x14'));var as=require(_0x1839('0x15'));var hardwareService=require(_0x1839('0x16'));var logger=require(_0x1839('0x17'))(_0x1839('0x18'));var utils=require(_0x1839('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1839('0x1a'));var db=require(_0x1839('0x1b'))['db'];function respondWithStatusCode(_0x26677d,_0x813900){_0x813900=_0x813900||0xcc;return function(_0x2fb190){if(_0x2fb190){return _0x26677d['sendStatus'](_0x813900);}return _0x26677d[_0x1839('0x1c')](_0x813900)[_0x1839('0x1d')]();};}function respondWithResult(_0x1f168a,_0x4264a7){_0x4264a7=_0x4264a7||0xc8;return function(_0x4f47e4){if(_0x4f47e4){return _0x1f168a[_0x1839('0x1c')](_0x4264a7)[_0x1839('0x1e')](_0x4f47e4);}};}function respondWithFilteredResult(_0x126b16,_0x5f21b5){return function(_0x955771){if(_0x955771){var _0x3818c5=typeof _0x5f21b5[_0x1839('0x1f')]==='undefined'&&typeof _0x5f21b5[_0x1839('0x20')]===_0x1839('0x21');var _0x2b4ed7=_0x955771[_0x1839('0x22')];var _0x92994f=_0x3818c5?0x0:_0x5f21b5[_0x1839('0x1f')];var _0x27156d=_0x3818c5?_0x955771[_0x1839('0x22')]:_0x5f21b5['offset']+_0x5f21b5['limit'];var _0x563fb6;if(_0x27156d>=_0x2b4ed7){_0x27156d=_0x2b4ed7;_0x563fb6=0xc8;}else{_0x563fb6=0xce;}_0x126b16[_0x1839('0x1c')](_0x563fb6);return _0x126b16[_0x1839('0x23')]('Content-Range',_0x92994f+'-'+_0x27156d+'/'+_0x2b4ed7)[_0x1839('0x1e')](_0x955771);}return null;};}function patchUpdates(_0x32df50){return function(_0x45abdd){try{jsonpatch['apply'](_0x45abdd,_0x32df50,!![]);}catch(_0x21cd25){return BPromise[_0x1839('0x24')](_0x21cd25);}return _0x45abdd[_0x1839('0x25')]();};}function saveUpdates(_0x10e97b,_0x10e455){return function(_0x2d5246){if(_0x2d5246){return _0x2d5246[_0x1839('0x26')](_0x10e97b)['then'](function(_0x255ed0){return _0x255ed0;});}return null;};}function removeEntity(_0x1ae6a8,_0x1e5d4e){return function(_0x4957e2){if(_0x4957e2){return _0x4957e2[_0x1839('0x27')]()[_0x1839('0x28')](function(){var _0x764b85=_0x4957e2['get']({'plain':!![]});var _0xf963ce='Companies';return db[_0x1839('0x29')]['destroy']({'where':{'type':_0xf963ce,'resourceId':_0x764b85['id']}})[_0x1839('0x28')](function(){return _0x4957e2;});})['then'](function(){_0x1ae6a8[_0x1839('0x1c')](0xcc)[_0x1839('0x1d')]();});}};}function handleEntityNotFound(_0x680add,_0x134108){return function(_0x1f22ff){if(!_0x1f22ff){_0x680add[_0x1839('0x2a')](0x194);}return _0x1f22ff;};}function handleError(_0x232e18,_0x418a37){_0x418a37=_0x418a37||0x1f4;return function(_0x353a65){logger[_0x1839('0x2b')](_0x353a65['stack']);if(_0x353a65[_0x1839('0x2c')]){delete _0x353a65[_0x1839('0x2c')];}_0x232e18[_0x1839('0x1c')](_0x418a37)[_0x1839('0x2d')](_0x353a65);};}exports[_0x1839('0x2e')]=function(_0x3ad143,_0x59fc8f){var _0x1ce220={},_0x23fd57={},_0xb5e09f={'count':0x0,'rows':[]};return db[_0x1839('0x2f')][_0x1839('0x30')]()[_0x1839('0x28')](function(_0x4db2b7){_0x23fd57[_0x1839('0x31')]=_[_0x1839('0x32')](_0x4db2b7);_0x23fd57['query']=_[_0x1839('0x32')](_0x3ad143[_0x1839('0x33')]);_0x23fd57['filters']=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],_0x23fd57[_0x1839('0x33')]);_0x1ce220[_0x1839('0x35')]=_[_0x1839('0x34')](_0x23fd57[_0x1839('0x31')],qs[_0x1839('0x36')](_0x3ad143[_0x1839('0x33')][_0x1839('0x36')]));_0x1ce220[_0x1839('0x35')]=_0x1ce220[_0x1839('0x35')][_0x1839('0x37')]?_0x1ce220[_0x1839('0x35')]:_0x23fd57[_0x1839('0x31')];if(!_0x3ad143[_0x1839('0x33')][_0x1839('0x38')](_0x1839('0x39'))){_0x1ce220['limit']=qs[_0x1839('0x20')](_0x3ad143[_0x1839('0x33')][_0x1839('0x20')]);_0x1ce220['offset']=qs[_0x1839('0x1f')](_0x3ad143[_0x1839('0x33')][_0x1839('0x1f')]);}_0x1ce220[_0x1839('0x3a')]=qs[_0x1839('0x3b')](_0x3ad143[_0x1839('0x33')][_0x1839('0x3b')]);_0x1ce220['where']=qs[_0x1839('0x3c')](_[_0x1839('0x3d')](_0x3ad143['query'],_0x23fd57['filters']),_0x4db2b7);if(_0x3ad143['query']['filter']){_0x1ce220[_0x1839('0x3e')]=_['merge'](_0x1ce220['where'],{'$or':_[_0x1839('0x3f')](_0x1ce220[_0x1839('0x35')],function(_0x44e607){var _0x586b47={};_0x586b47[_0x44e607]={'$like':'%'+_0x3ad143['query'][_0x1839('0x40')]+'%'};return _0x586b47;})});}_0x1ce220=_['merge']({},_0x1ce220,_0x3ad143['options']);var _0x4d4b19={'where':_0x1ce220[_0x1839('0x3e')]};return db[_0x1839('0x2f')][_0x1839('0x22')](_0x4d4b19)[_0x1839('0x28')](function(_0x4680f7){_0xb5e09f['count']=_0x4680f7;if(_0x3ad143[_0x1839('0x33')][_0x1839('0x41')]){_0x1ce220['include']=[{'all':!![]}];}return db[_0x1839('0x2f')][_0x1839('0x42')](_0x1ce220);})[_0x1839('0x28')](function(_0x5d1897){_0xb5e09f[_0x1839('0x43')]=_0x5d1897;return _0xb5e09f;})[_0x1839('0x28')](respondWithFilteredResult(_0x59fc8f,_0x1ce220))[_0x1839('0x44')](handleError(_0x59fc8f,null));})[_0x1839('0x44')](handleError(_0x59fc8f,null));};exports['show']=function(_0x32684d,_0x3a8cad){var _0x46baa8={'raw':![],'where':{'id':_0x32684d['params']['id']}},_0x22ee96={};_0x22ee96['model']=_[_0x1839('0x32')](db[_0x1839('0x2f')][_0x1839('0x45')]);_0x22ee96['query']=_[_0x1839('0x32')](_0x32684d[_0x1839('0x33')]);_0x22ee96[_0x1839('0x3c')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],_0x22ee96['query']);_0x46baa8[_0x1839('0x35')]=_[_0x1839('0x34')](_0x22ee96[_0x1839('0x31')],qs[_0x1839('0x36')](_0x32684d['query']['fields']));_0x46baa8['attributes']=_0x46baa8[_0x1839('0x35')][_0x1839('0x37')]?_0x46baa8[_0x1839('0x35')]:_0x22ee96[_0x1839('0x31')];if(_0x32684d[_0x1839('0x33')]['includeAll']){_0x46baa8[_0x1839('0x46')]=[{'all':!![]}];}_0x46baa8=_[_0x1839('0x47')]({},_0x46baa8,_0x32684d[_0x1839('0x48')]);return db[_0x1839('0x2f')][_0x1839('0x49')](_0x46baa8)[_0x1839('0x28')](handleEntityNotFound(_0x3a8cad,null))['then'](respondWithResult(_0x3a8cad,null))['catch'](handleError(_0x3a8cad,null));};exports[_0x1839('0x4a')]=function(_0x2cd7ca,_0x25a592){return db[_0x1839('0x2f')][_0x1839('0x4a')](_0x2cd7ca[_0x1839('0x4b')],{})['then'](function(_0x18c680){var _0x56214d=_0x2cd7ca[_0x1839('0x4c')][_0x1839('0x4d')]({'plain':!![]});if(!_0x56214d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56214d[_0x1839('0x4e')]===_0x1839('0x4c')){var _0x42c3c6=_0x18c680[_0x1839('0x4d')]({'plain':!![]});var _0x257df8='Companies';return db[_0x1839('0x4f')][_0x1839('0x49')]({'where':{'name':_0x257df8,'userProfileId':_0x56214d[_0x1839('0x50')]},'raw':!![]})[_0x1839('0x28')](function(_0x33bd96){if(_0x33bd96&&_0x33bd96[_0x1839('0x51')]===0x0){return db[_0x1839('0x29')][_0x1839('0x4a')]({'name':_0x42c3c6[_0x1839('0x2c')],'resourceId':_0x42c3c6['id'],'type':_0x33bd96[_0x1839('0x2c')],'sectionId':_0x33bd96['id']},{})[_0x1839('0x28')](function(){return _0x18c680;});}else{return _0x18c680;}})[_0x1839('0x44')](function(_0x4c0a1d){logger[_0x1839('0x2b')](_0x1839('0x52'),_0x4c0a1d);throw _0x4c0a1d;});}return _0x18c680;})[_0x1839('0x28')](respondWithResult(_0x25a592,0xc9))['catch'](handleError(_0x25a592,null));};exports[_0x1839('0x26')]=function(_0x5abac1,_0x1a886c){if(_0x5abac1[_0x1839('0x4b')]['id']){delete _0x5abac1[_0x1839('0x4b')]['id'];}return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x5abac1[_0x1839('0x53')]['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x1a886c,null))[_0x1839('0x28')](saveUpdates(_0x5abac1['body'],null))[_0x1839('0x28')](respondWithResult(_0x1a886c,null))[_0x1839('0x44')](handleError(_0x1a886c,null));};exports[_0x1839('0x27')]=function(_0x39a137,_0x567a33){return db[_0x1839('0x2f')][_0x1839('0x49')]({'where':{'id':_0x39a137['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x567a33,null))[_0x1839('0x28')](removeEntity(_0x567a33,null))['catch'](handleError(_0x567a33,null));};exports[_0x1839('0x30')]=function(_0x368295,_0x5f7c8d){return db['CmCompany'][_0x1839('0x30')]()['then'](respondWithResult(_0x5f7c8d,null))['catch'](handleError(_0x5f7c8d,null));};exports[_0x1839('0x54')]=function(_0x37431c,_0x16afc5,_0x418ea0){return db[_0x1839('0x55')]['find']({'where':{'id':_0x37431c['params']['id']}})[_0x1839('0x28')](handleEntityNotFound(_0x16afc5,null))[_0x1839('0x28')](function(_0x1c9a07){if(_0x1c9a07){return _0x1c9a07['addContacts'](_0x37431c[_0x1839('0x4b')][_0x1839('0x56')],_[_0x1839('0x57')](_0x37431c[_0x1839('0x4b')],[_0x1839('0x56'),'id'])||{});}})[_0x1839('0x28')](respondWithResult(_0x16afc5,null))[_0x1839('0x44')](handleError(_0x16afc5,null));};exports[_0x1839('0x58')]=function(_0x2ece61,_0x270501,_0x1680b9){var _0x526fb5={};var _0x1c124e={};var _0x33d939;var _0x1cda21;return db[_0x1839('0x2f')]['findOne']({'where':{'id':_0x2ece61['params']['id']}})['then'](handleEntityNotFound(_0x270501,null))[_0x1839('0x28')](function(_0x33fdfd){if(_0x33fdfd){_0x33d939=_0x33fdfd;_0x1c124e['model']=_[_0x1839('0x32')](db[_0x1839('0x55')][_0x1839('0x45')]);_0x1c124e['query']=_[_0x1839('0x32')](_0x2ece61['query']);_0x1c124e[_0x1839('0x3c')]=_['intersection'](_0x1c124e[_0x1839('0x31')],_0x1c124e[_0x1839('0x33')]);_0x526fb5['attributes']=_[_0x1839('0x34')](_0x1c124e['model'],qs['fields'](_0x2ece61['query'][_0x1839('0x36')]));_0x526fb5['attributes']=_0x526fb5[_0x1839('0x35')][_0x1839('0x37')]?_0x526fb5[_0x1839('0x35')]:_0x1c124e['model'];_0x526fb5[_0x1839('0x3a')]=qs['sort'](_0x2ece61[_0x1839('0x33')][_0x1839('0x3b')]);_0x526fb5[_0x1839('0x3e')]=qs[_0x1839('0x3c')](_['pick'](_0x2ece61[_0x1839('0x33')],_0x1c124e[_0x1839('0x3c')]));if(_0x2ece61[_0x1839('0x33')]['filter']){_0x526fb5[_0x1839('0x3e')]=_[_0x1839('0x47')](_0x526fb5[_0x1839('0x3e')],{'$or':_[_0x1839('0x3f')](_0x526fb5[_0x1839('0x35')],function(_0x30e29b){var _0x33f5a5={};_0x33f5a5[_0x30e29b]={'$like':'%'+_0x2ece61[_0x1839('0x33')]['filter']+'%'};return _0x33f5a5;})});}_0x526fb5=_[_0x1839('0x47')]({},_0x526fb5,_0x2ece61[_0x1839('0x48')]);return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0xfe9122){if(_0xfe9122){_0x1cda21=_0xfe9122[_0x1839('0x37')];if(!_0x2ece61['query'][_0x1839('0x38')]('nolimit')){_0x526fb5[_0x1839('0x20')]=qs['limit'](_0x2ece61[_0x1839('0x33')][_0x1839('0x20')]);_0x526fb5[_0x1839('0x1f')]=qs[_0x1839('0x1f')](_0x2ece61['query'][_0x1839('0x1f')]);}return _0x33d939[_0x1839('0x58')](_0x526fb5);}})[_0x1839('0x28')](function(_0x119b22){if(_0x119b22){return _0x119b22?{'count':_0x1cda21,'rows':_0x119b22}:null;}})[_0x1839('0x28')](respondWithResult(_0x270501,null))['catch'](handleError(_0x270501,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 08fecf6..76b58f2 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 _0xbb6e=['define','CmCompany','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb6e,0x1c4));var _0xebb6=function(_0x2a2b22,_0x3fa62c){_0x2a2b22=_0x2a2b22-0x0;var _0x710fd9=_0xbb6e[_0x2a2b22];return _0x710fd9;};'use strict';var _=require(_0xebb6('0x0'));var util=require(_0xebb6('0x1'));var logger=require(_0xebb6('0x2'))('api');var moment=require(_0xebb6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xebb6('0x4'));var rimraf=require(_0xebb6('0x5'));var config=require(_0xebb6('0x6'));var attributes=require(_0xebb6('0x7'));module['exports']=function(_0x52771e,_0x24fbc4){return _0x52771e[_0xebb6('0x8')](_0xebb6('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x394a=['../../config/environment','exports','define','CmCompany','util','api','bluebird','path','rimraf'];(function(_0x12cae1,_0x71e0d2){var _0x726f43=function(_0x2e71e0){while(--_0x2e71e0){_0x12cae1['push'](_0x12cae1['shift']());}};_0x726f43(++_0x71e0d2);}(_0x394a,0x1f3));var _0xa394=function(_0x26f145,_0xfe0e1d){_0x26f145=_0x26f145-0x0;var _0x2b55f0=_0x394a[_0x26f145];return _0x2b55f0;};'use strict';var _=require('lodash');var util=require(_0xa394('0x0'));var logger=require('../../config/logger')(_0xa394('0x1'));var moment=require('moment');var BPromise=require(_0xa394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa394('0x3'));var rimraf=require(_0xa394('0x4'));var config=require(_0xa394('0x5'));var attributes=require('./cmCompany.attributes');module[_0xa394('0x6')]=function(_0x210a0b,_0x11f468){return _0x210a0b[_0xa394('0x7')](_0xa394('0x8'),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 9fe8a2a..e540b6a 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 _0x24a6=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x22b201,_0x1df7ec){var _0x445393=function(_0x2148ef){while(--_0x2148ef){_0x22b201['push'](_0x22b201['shift']());}};_0x445393(++_0x1df7ec);}(_0x24a6,0x1d4));var _0x624a=function(_0x478fe2,_0x368eee){_0x478fe2=_0x478fe2-0x0;var _0x2f2f46=_0x24a6[_0x478fe2];return _0x2f2f46;};'use strict';var _=require(_0x624a('0x0'));var util=require(_0x624a('0x1'));var moment=require(_0x624a('0x2'));var BPromise=require(_0x624a('0x3'));var rs=require(_0x624a('0x4'));var fs=require('fs');var Redis=require(_0x624a('0x5'));var db=require(_0x624a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x624a('0x7'))('rpc');var config=require(_0x624a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x624a('0x9')][_0x624a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3327,_0x1bae1a,_0x2f959d){return new BPromise(function(_0x19b6e6,_0x2196a6){return client[_0x624a('0xb')](_0x3e3327,_0x2f959d)[_0x624a('0xc')](function(_0x50f16b){logger[_0x624a('0xd')](_0x624a('0xe'),_0x1bae1a,_0x624a('0xf'));logger[_0x624a('0x10')](_0x624a('0x11'),_0x1bae1a,_0x624a('0xf'),JSON[_0x624a('0x12')](_0x50f16b));if(_0x50f16b[_0x624a('0x13')]){if(_0x50f16b['error']['code']===0x1f4){logger[_0x624a('0x13')](_0x624a('0xe'),_0x1bae1a,_0x50f16b['error'][_0x624a('0x14')]);return _0x2196a6(_0x50f16b[_0x624a('0x13')][_0x624a('0x14')]);}logger['error'](_0x624a('0xe'),_0x1bae1a,_0x50f16b['error'][_0x624a('0x14')]);return _0x19b6e6(_0x50f16b[_0x624a('0x13')][_0x624a('0x14')]);}else{logger[_0x624a('0xd')]('CmCompany,\x20%s,\x20%s',_0x1bae1a,'request\x20sent');_0x19b6e6(_0x50f16b['result'][_0x624a('0x14')]);}})[_0x624a('0x15')](function(_0x197306){logger[_0x624a('0x13')]('CmCompany,\x20%s,\x20%s',_0x1bae1a,_0x197306);_0x2196a6(_0x197306);});});}
\ No newline at end of file
+var _0xe1dc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0xe1dc,0xcb));var _0xce1d=function(_0x11b43d,_0x3f1aa5){_0x11b43d=_0x11b43d-0x0;var _0x14a908=_0xe1dc[_0x11b43d];return _0x14a908;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var moment=require(_0xce1d('0x2'));var BPromise=require(_0xce1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce1d('0x4'));var db=require(_0xce1d('0x5'))['db'];var utils=require(_0xce1d('0x6'));var logger=require(_0xce1d('0x7'))(_0xce1d('0x8'));var config=require('../../config/environment');var jayson=require(_0xce1d('0x9'));var client=jayson['client'][_0xce1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x565e69,_0x5e539e,_0x55a626){return new BPromise(function(_0x2f6404,_0x30c554){return client['request'](_0x565e69,_0x55a626)[_0xce1d('0xb')](function(_0x57e3ad){logger[_0xce1d('0xc')](_0xce1d('0xd'),_0x5e539e,_0xce1d('0xe'));logger[_0xce1d('0xf')](_0xce1d('0x10'),_0x5e539e,_0xce1d('0xe'),JSON[_0xce1d('0x11')](_0x57e3ad));if(_0x57e3ad[_0xce1d('0x12')]){if(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x13')]===0x1f4){logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad['error'][_0xce1d('0x14')]);return _0x30c554(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}logger[_0xce1d('0x12')](_0xce1d('0xd'),_0x5e539e,_0x57e3ad[_0xce1d('0x12')]['message']);return _0x2f6404(_0x57e3ad[_0xce1d('0x12')][_0xce1d('0x14')]);}else{logger['info'](_0xce1d('0xd'),_0x5e539e,'request\x20sent');_0x2f6404(_0x57e3ad[_0xce1d('0x15')][_0xce1d('0x14')]);}})[_0xce1d('0x16')](function(_0x417121){logger[_0xce1d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5e539e,_0x417121);_0x30c554(_0x417121);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 33ae52d..c6a1df0 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 _0xd477=['put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','create','post','addContacts'];(function(_0x433dc0,_0x122ca6){var _0x3ced3c=function(_0x302318){while(--_0x302318){_0x433dc0['push'](_0x433dc0['shift']());}};_0x3ced3c(++_0x122ca6);}(_0xd477,0xdf));var _0x7d47=function(_0x45aca3,_0x2dc880){_0x45aca3=_0x45aca3-0x0;var _0x540d06=_0xd477[_0x45aca3];return _0x540d06;};'use strict';var multer=require(_0x7d47('0x0'));var util=require(_0x7d47('0x1'));var path=require(_0x7d47('0x2'));var timeout=require(_0x7d47('0x3'));var express=require(_0x7d47('0x4'));var router=express['Router']();var fs_extra=require(_0x7d47('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7d47('0x6'));var config=require(_0x7d47('0x7'));var controller=require('./cmCompany.controller');router[_0x7d47('0x8')]('/',auth[_0x7d47('0x9')](),controller[_0x7d47('0xa')]);router[_0x7d47('0x8')](_0x7d47('0xb'),auth[_0x7d47('0x9')](),controller[_0x7d47('0xc')]);router['get'](_0x7d47('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7d47('0x8')](_0x7d47('0xe'),auth[_0x7d47('0x9')](),controller[_0x7d47('0xf')]);router['post']('/',auth[_0x7d47('0x9')](),controller[_0x7d47('0x10')]);router[_0x7d47('0x11')](_0x7d47('0xe'),auth['isAuthenticated'](),controller[_0x7d47('0x12')]);router[_0x7d47('0x13')](_0x7d47('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x7d47('0x9')](),controller[_0x7d47('0x14')]);module[_0x7d47('0x15')]=router;
\ No newline at end of file
+var _0xf12d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','put','destroy','exports'];(function(_0x7ab3f9,_0x4aa58b){var _0x502b8f=function(_0x29f065){while(--_0x29f065){_0x7ab3f9['push'](_0x7ab3f9['shift']());}};_0x502b8f(++_0x4aa58b);}(_0xf12d,0xcc));var _0xdf12=function(_0x4681ae,_0x52791a){_0x4681ae=_0x4681ae-0x0;var _0x5b0ce6=_0xf12d[_0x4681ae];return _0x5b0ce6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf12('0x0'));var express=require(_0xdf12('0x1'));var router=express[_0xdf12('0x2')]();var fs_extra=require(_0xdf12('0x3'));var auth=require(_0xdf12('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf12('0x5'));router[_0xdf12('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf12('0x6')]('/describe',auth[_0xdf12('0x7')](),controller[_0xdf12('0x8')]);router['get'](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['show']);router[_0xdf12('0x6')](_0xdf12('0xa'),auth[_0xdf12('0x7')](),controller[_0xdf12('0xb')]);router[_0xdf12('0xc')]('/',auth['isAuthenticated'](),controller[_0xdf12('0xd')]);router['post']('/:id/contacts',auth[_0xdf12('0x7')](),controller['addContacts']);router[_0xdf12('0xe')](_0xdf12('0x9'),auth[_0xdf12('0x7')](),controller['update']);router['delete'](_0xdf12('0x9'),auth['isAuthenticated'](),controller[_0xdf12('0xf')]);module[_0xdf12('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 5a80dbd..fdd89d8 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 _0xdf04=['INTEGER','UNSIGNED','NOW','lodash','sequelize','STRING','TEXT'];(function(_0x595d29,_0x3cab2a){var _0x254cdf=function(_0x2f3b9c){while(--_0x2f3b9c){_0x595d29['push'](_0x595d29['shift']());}};_0x254cdf(++_0x3cab2a);}(_0xdf04,0x8f));var _0x4df0=function(_0x544715,_0xc2d150){_0x544715=_0x544715-0x0;var _0x371fbb=_0xdf04[_0x544715];return _0x371fbb;};'use strict';var _=require(_0x4df0('0x0'));var Sequelize=require(_0x4df0('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4df0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4df0('0x2')]},'city':{'type':Sequelize[_0x4df0('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4df0('0x2')]},'description':{'type':Sequelize[_0x4df0('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x4df0('0x2')]},'fax':{'type':Sequelize[_0x4df0('0x2')]},'email':{'type':Sequelize[_0x4df0('0x2')]},'url':{'type':Sequelize[_0x4df0('0x2')]},'facebook':{'type':Sequelize[_0x4df0('0x2')]},'fb_data':{'type':Sequelize[_0x4df0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4df0('0x2')]},'teams':{'type':Sequelize[_0x4df0('0x2')]},'viber':{'type':Sequelize[_0x4df0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4df0('0x2')]},'telegram':{'type':Sequelize[_0x4df0('0x2')]},'UserId':{'type':Sequelize[_0x4df0('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4df0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4df0('0x6')]}};
\ No newline at end of file
+var _0x210f=['UNSIGNED','NOW','exports','STRING','INTEGER'];(function(_0x9db9e,_0x4a52b0){var _0x12af4a=function(_0x17e8e4){while(--_0x17e8e4){_0x9db9e['push'](_0x9db9e['shift']());}};_0x12af4a(++_0x4a52b0);}(_0x210f,0x17e));var _0xf210=function(_0x4a38f7,_0x42419){_0x4a38f7=_0x4a38f7-0x0;var _0x1b3108=_0x210f[_0x4a38f7];return _0x1b3108;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xf210('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf210('0x1')]},'street':{'type':Sequelize[_0xf210('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf210('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf210('0x1')]},'mobile':{'type':Sequelize[_0xf210('0x1')]},'fax':{'type':Sequelize[_0xf210('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xf210('0x1')]},'facebook':{'type':Sequelize[_0xf210('0x1')]},'fb_data':{'type':Sequelize[_0xf210('0x1')]},'twitter':{'type':Sequelize[_0xf210('0x1')]},'skype':{'type':Sequelize[_0xf210('0x1')]},'teams':{'type':Sequelize[_0xf210('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xf210('0x1')]},'wechat':{'type':Sequelize[_0xf210('0x1')]},'telegram':{'type':Sequelize[_0xf210('0x1')]},'UserId':{'type':Sequelize[_0xf210('0x2')]},'priority':{'type':Sequelize[_0xf210('0x2')](0x2)[_0xf210('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf210('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 2f45479..36eab8a 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 _0xb162=['c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','CmContact','tags','columnName','displayName','analytics','findAll','alias','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','show','params','cf_%d','$and','omit','format','table','setFields','toParam','text','phone','rawAttributes','options','getTags','setTags','ids','getHoppers','includeAll','ContactId','include','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','parse','meta','No\x20phone\x20column\x20specified','binding','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','startCase','Website','Account','closed','secondDisposition','key','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','Interaction','Owner','flatten','sortBy','reverse','slice','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','offset','undefined','limit','count','Content-Range','json','update','then','destroy','status','sendStatus','error','stack','name','index','describe','keys','length','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','forEach','union','uc.UserId\x20=\x20?','dateOfBirth','DATE','buildExpression','start','end','map','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','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','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','having','t.id\x20IN\x20?','resolve','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','user','ListId','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone'];(function(_0x2c9c1a,_0x2192c1){var _0x5c25a2=function(_0xe1e6cc){while(--_0xe1e6cc){_0x2c9c1a['push'](_0x2c9c1a['shift']());}};_0x5c25a2(++_0x2192c1);}(_0xb162,0x1a8));var _0x2b16=function(_0x38819a,_0x316ca7){_0x38819a=_0x38819a-0x0;var _0x880444=_0xb162[_0x38819a];return _0x880444;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x2b16('0x0'));var path=require(_0x2b16('0x1'));var fs=require('fs');var _=require(_0x2b16('0x2'));var squel=require(_0x2b16('0x3'));var Papa=require('papaparse');var Redis=require(_0x2b16('0x4'));var qs=require(_0x2b16('0x5'));var as=require(_0x2b16('0x6'));var logger=require('../../config/logger')(_0x2b16('0x7'));var config=require('../../config/environment');var db=require(_0x2b16('0x8'))['db'];config[_0x2b16('0x9')]=_['defaults'](config[_0x2b16('0x9')],{'host':_0x2b16('0xa'),'port':0x18eb});var socket=require(_0x2b16('0xb'))(new Redis(config[_0x2b16('0x9')]));require(_0x2b16('0xc'))[_0x2b16('0xd')](socket);function respondWithResult(_0x47c0b3,_0x414aad){_0x414aad=_0x414aad||0xc8;return function(_0x15f486){if(_0x15f486){return _0x47c0b3['status'](_0x414aad)['json'](_0x15f486);}};}function respondWithFilteredResult(_0x558d60,_0x3daa87){return function(_0x1b6803){if(_0x1b6803){var _0x3d0088=typeof _0x3daa87[_0x2b16('0xe')]===_0x2b16('0xf')&&typeof _0x3daa87[_0x2b16('0x10')]===_0x2b16('0xf');var _0x29bb48=_0x1b6803['count'];var _0x1fc82c=_0x3d0088?0x0:_0x3daa87[_0x2b16('0xe')];var _0x30edfd=_0x3d0088?_0x1b6803[_0x2b16('0x11')]:_0x3daa87['offset']+_0x3daa87[_0x2b16('0x10')];var _0x2efe46;if(_0x30edfd>=_0x29bb48){_0x30edfd=_0x29bb48;_0x2efe46=0xc8;}else{_0x2efe46=0xce;}_0x558d60['status'](_0x2efe46);return _0x558d60['set'](_0x2b16('0x12'),_0x1fc82c+'-'+_0x30edfd+'/'+_0x29bb48)[_0x2b16('0x13')](_0x1b6803);}return null;};}function saveUpdates(_0x2feca4){return function(_0x2f8204){if(_0x2f8204){return _0x2f8204[_0x2b16('0x14')](_0x2feca4)[_0x2b16('0x15')](function(_0x22ba26){return _0x22ba26;});}return null;};}function removeEntity(_0x523c87){return function(_0x535b1a){if(_0x535b1a){return _0x535b1a[_0x2b16('0x16')]()['then'](function(){_0x523c87[_0x2b16('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9625){return function(_0x142216){if(!_0x142216){_0x5e9625[_0x2b16('0x18')](0x194);}return _0x142216;};}function handleError(_0x4b9a64,_0x45e13f){_0x45e13f=_0x45e13f||0x1f4;return function(_0x544c41){logger[_0x2b16('0x19')](_0x544c41[_0x2b16('0x1a')]);if(_0x544c41['name']){delete _0x544c41[_0x2b16('0x1b')];}_0x4b9a64['status'](_0x45e13f)['send'](_0x544c41);};}exports[_0x2b16('0x1c')]=function(_0x21f551,_0x603910){var _0x3387df={},_0xa0aeef={},_0x1e6731={'count':0x0,'rows':[]};return db['CmContact'][_0x2b16('0x1d')]()[_0x2b16('0x15')](function(_0xad6543){var _0x32b091=[];for(var _0x58880b=0x0;_0x58880b
','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','randomstring','node-tnef','email','head','value','address','anonymous','generate','name','indexOf','length','join','Anonymous','split','isEmpty','html','test','includes','0x1?_0x35e162['slice'](0x0,-0x1)[_0xaa93('0xb')]('\x20'):_0x4bb171['name'];}return _0xaa93('0xc');}function getLastName(_0x4169bf){var _0x2e2307=_[_0xaa93('0x3')](_0x4169bf[_0xaa93('0x4')]);if(_0x2e2307&&_0x2e2307['name']){var _0x2ac2f5=_0x2e2307['name'][_0xaa93('0xd')](/\s+/);return _0x2ac2f5[_0xaa93('0xa')]>0x1?_0x2ac2f5['pop']():'';}return'';}function getMails(_0x543a57,_0x1394d5){var _0x665c32='';for(var _0x1cc0bc=0x0;_0x1cc0bc<_0x1394d5[_0xaa93('0x4')][_0xaa93('0xa')];_0x1cc0bc+=0x1){if(_0x1394d5[_0xaa93('0x4')][_0x1cc0bc][_0xaa93('0x5')]!==_0x543a57){if(!_[_0xaa93('0xe')](_0x665c32)){_0x665c32+=',';}_0x665c32+=_0x1394d5[_0xaa93('0x4')][_0x1cc0bc]['name']||_0x1394d5[_0xaa93('0x4')][_0x1cc0bc][_0xaa93('0x5')]||'';_0x665c32+='\x20<';_0x665c32+=_0x1394d5[_0xaa93('0x4')][_0x1cc0bc]['address']?_0x1394d5[_0xaa93('0x4')][_0x1cc0bc][_0xaa93('0x5')]:'anonymous'+random[_0xaa93('0x7')](0x6)+'@xcally.com';_0x665c32+='>';}}return _0x665c32;}function parseEmail(_0x7fc9be,_0x5b7735,_0x20e2d0){if(_0x5b7735[_0xaa93('0xf')]){var _0x4d6a45=/